import { Observable } from 'rxjs'; export interface IFormValidator { type: 'EXPRESSION' | 'VALIDATOR' | 'MIN' | 'MAX' | 'MINLENGTH' | 'MAXLENGTH' | 'REQUIRED' | 'PATTERN'; value?: any; error?: string; } export interface IFormTextarea extends IFormCell, IFormPrefixSuffix, IFormInput { type: 'TEXTAREA'; } export interface IFormText extends IFormCell, IFormPrefixSuffix, IFormInput { type: 'TEXT'; } export interface IFormPassword extends IFormCell, IFormPrefixSuffix, IFormInput { type: 'PASSWORD'; } export interface IFormNumber extends IFormCell, IFormPrefixSuffix, IFormInput { type: 'NUMBER'; } export interface IFormDate extends IFormCell, IFormPrefixSuffix, IFormInput { type: 'DATE' | 'DATETIME'; } export interface IFormFile extends IFormCell, IFormPrefixSuffix, IFormInput { type: 'FILE'; } export interface IFormSelect extends IFormCell, IFormPrefixSuffix, IFormOptions { type: 'SELECT'; } export interface IFormChips extends IFormCell, IFormPrefixSuffix, IFormOptions { type: 'CHIPS'; forced?: boolean; can_add?: boolean; } export interface IFormAutocomplete extends IFormCell, IFormPrefixSuffix, IFormOptions { type: 'AUTOCOMPLETE'; } export interface IFormRadio extends IFormCell, IFormPrefixSuffix, IFormOptions { type: 'RADIO'; } export interface IFormCheckbox extends IFormCell, IFormPrefixSuffix { type: 'CHECKBOX'; } export interface IFormAmount extends IFormCell, IFormPrefixSuffix { type: 'AMOUNT'; } export interface IFormLink extends IFormCell, IFormPrefixSuffix { type: 'LINK'; function?: (e?: any) => void; link?: string; newPage?: boolean; buttonColor?: 'BASIC' | 'PRIMARY' | 'ACCENT' | 'WARN'; buttonStyle?: 'BASIC' | 'RAISED' | 'STROKED' | 'FLAT'; } export interface IFormInfo extends IFormCell { type: 'INFO'; template: string; endpoint?: string; observe?: Observable; } export interface IFormHidden extends IFormCell, IFormPrefixSuffix { type: 'HIDDEN'; } interface IFormPrefixSuffix { prefix?: string; suffix?: string; } interface IFormCell { label: string; controlName: string; cellSize?: number; disabled?: (boolean | string)[]; hidden?: (boolean | string)[]; fieldColor?: 'BASIC' | 'PRIMARY' | 'ACCENT' | 'WARN'; fieldAppearance?: 'LEGACY' | 'STANDARD' | 'FILL' | 'OUTLINE'; validators?: IFormValidator[]; defaultValue?: any; tooltip?: string; } interface IFormOptions { placeholder?: string; endpoint?: string; observe?: Observable; options?: any[]; valueName?: string; descriptionName?: string; } interface IFormInput { placeholder?: string; min?: any; max?: any; } export {};