File

src/interfaces/IParamsColEditor.ts

Index

Properties

Properties

autoComplete
autoComplete: IParamsColEditorAutoComplete
Type : IParamsColEditorAutoComplete
Optional

for autoComplete

class
class: any
Type : any
Optional

custom ngClass

cols
cols: IParamsCol[]
Type : IParamsCol[]
Optional
config
config: any
Type : any
Optional

for Tinymce

custom
custom: literal type
Type : literal type
Optional

Need this if type is 'custom'

datetime
datetime: literal type
Type : literal type
Optional

Need this if type is 'datetime'

disabled
disabled: boolean
Type : boolean
Optional

Set as disabled

display
display: function
Type : function
Optional

Need this when type is 'pickList'

filterBy
filterBy: string
Type : string
Optional

for pickList

hidden
hidden: boolean
Type : boolean
Optional

Hide column while editing

logs
logs: function
Type : function
Optional

Need this if type is 'logs'

offLabel
offLabel: string
Type : string
Optional
onChange
onChange: function
Type : function
Optional

On field changed

onLabel
onLabel: string
Type : string
Optional

Need this if type is 'switch'

options
options: Array<literal type>
Type : Array<literal type>
Optional

Need this if type is 'enum'

placeholder
placeholder: string
Type : string
Optional

Placeholder

ref
ref: literal type
Type : literal type
Optional

Need this if type is 'ref'

title
title: function
Type : function
Optional

for object and objects

type
type: "autoComplete" | "checkBox" | "chip" | "custom" | "datetime" | "enum" | "file" | "image" | "images" | "layeredCheckBox" | "logs" | "object" | "objects" | "pickList" | "ref" | "switch" | "text" | "textArea" | "tinymce" | "videos" | "virtual"
Type : "autoComplete" | "checkBox" | "chip" | "custom" | "datetime" | "enum" | "file" | "image" | "images" | "layeredCheckBox" | "logs" | "object" | "objects" | "pickList" | "ref" | "switch" | "text" | "textArea" | "tinymce" | "videos" | "virtual"

Type of editor.

upload
upload: function
Type : function
Optional

Need this when type is 'file', 'files', 'image', or 'images', 'videos'

virtual
virtual: function
Type : function
Optional

Need this if type is 'virtual'

import { RestAdminComponent } from '../component';
import { IParamsCol, IParamsColEditorAutoComplete } from './';

export interface IParamsColEditor {
  /**
   * Type of editor.
   */
  type:
    | 'autoComplete'
    | 'checkBox'
    | 'chip'
    | 'custom'
    | 'datetime'
    | 'enum'
    | 'file'
    | 'image'
    | 'images'
    | 'layeredCheckBox'
    | 'logs'
    | 'object'
    | 'objects'
    | 'pickList'
    | 'ref'
    | 'switch'
    | 'text'
    | 'textArea'
    | 'tinymce'
    | 'videos'
    | 'virtual';

  /**
   * On field changed
   */
  onChange?: (self: RestAdminComponent) => void;

  /**
   * Placeholder
   */
  placeholder?: string;

  /**
   * Set as disabled
   */
  disabled?: boolean;

  /**
   * Hide column while editing
   */
  hidden?: boolean;

  /**
   * Need this if type is 'enum'
   */
  options?: Array<{
    /**
     * Label
     */
    label: string;

    /**
     * value
     */
    value: any;
  }>;

  /**
   * Need this if type is 'logs'
   */
  logs?: (item: any) => string;

  /**
   * Need this if type is 'datetime'
   */
  datetime?: {
    /**
     * eg. 2016:2020
     */
    yearRange: string;
  };

  /**
   * Need this when type is 'file', 'files', 'image', or 'images', 'videos'
   */
  upload?: (file: Blob) => Promise<string>;

  /**
   * Need this when type is 'pickList'
   */
  display?: (item: any) => string;

  /**
   * Need this if type is 'ref'
   */
  ref?: {
    /**
     * Reference label
     */
    label: ((x: any) => string) | String;

    /**
     * Reference data field
     */
    path: string;
  };

  /**
   * Need this if type is 'custom'
   */
  custom?: {
    /**
     * Display
     */
    display: (selected: any, key: string) => string;

    /**
     * Click
     */
    onClick: (selected: any, key: string) => Promise<any>;
  };

  /**
   * Need this if type is 'switch'
   */
  onLabel?: string;
  offLabel?: string;

  /**
   * for pickList
   */
  filterBy?: string;

  /**
   * for Tinymce
   */
  config?: any;

  /**
   * for autoComplete
   */
  autoComplete?: IParamsColEditorAutoComplete;

  /**
   * for object and objects
   */
  title?: (selected: any) => string;
  cols?: IParamsCol[];

    /**
   * Need this if type is 'virtual'
   */
  virtual?: (selected: any, key: string) => string;

  /**
   * custom ngClass
   */
  class?: any;
}

results matching ""

    No results matching ""