import { PepSizeType, PepStyleType } from '../../layout'; import { ListContainer } from '../../lists'; export interface FormViewBlock { Key: string; ViewType: FormViewBlockComponentType; View: FormViewBlockComponent; } export declare type FormViewBlockComponentType = 'TextBox' | 'TextArea' | 'DropDown' | 'CheckBox' | 'Date' | 'QuantitySelector' | 'Button' | 'Separator' | 'Form' | 'List' | 'Resource' | 'JsonEditor' | 'Image' | 'RemoteBlock'; export interface FormViewBlockComponent { FieldID?: string; Title?: string; Mandatory?: boolean; Readonly?: boolean; RenderTitle?: boolean; DefaultValue?: unknown; } export interface JsonEditorBlockView extends FormViewBlockComponent { JsonData?: unknown; } export interface ImageBlockView extends FormViewBlockComponent { FieldType: 'photo' | 'signature'; PhotoQuality?: number; MaxMegapixel?: number; AllowedExtensions?: string[]; AllowOnlyCameraPhoto?: boolean; MaxImageSize?: number; } export interface FormBlockView extends FormViewBlockComponent { FormKey: string; MappedParameters: any; } export interface ListBlockView extends FormViewBlockComponent { ListKey: string; ListContainer?: ListContainer; MappedParameters: any; } export interface ResourceBlockView extends FormViewBlockComponent { IsArray: boolean; Options: { Key: string; Value: string; }[]; EmptyOption?: boolean; } export interface TextBoxBlockView extends FormViewBlockComponent { FieldType: 'text' | 'link' | 'email' | 'phone' | 'duration' | 'int' | 'percentage' | 'currency' | 'real'; MaxFieldCharacters?: number; MinValue?: number; MaxValue?: number; Regex?: string; RegexErrorMessage?: string; } export interface TextAreaBlockView extends FormViewBlockComponent { MaxFieldCharacters?: number; RowSpan?: number; } export interface DropDownBlockView extends FormViewBlockComponent { FieldType: 'select' | 'multi'; Options: { Key: string; Value: string; }[]; EmptyOption?: boolean; } export interface CheckBoxBlockView extends FormViewBlockComponent { FieldType: 'checkbox' | 'booleanText'; AdditionalValue?: string; } export interface DateBlockView extends FormViewBlockComponent { FieldType: 'datetime' | 'date'; MinDateValue?: Date; MaxDateValue?: Date; } export interface QuantitySelectorBlockView extends FormViewBlockComponent { AllowDecimal: boolean; StyleType?: PepStyleType; } export interface ButtonBlockView extends FormViewBlockComponent { Key: string; Value: string; StyleType?: PepStyleType; SizeType?: PepSizeType; IconName?: string; IconPosition?: 'start' | 'end'; } export interface SeparatorBlockView extends FormViewBlockComponent { Alignment?: 'left' | 'right' | 'center'; }