import { SdTableColumn, SdTableOption } from '@sd-angular/core/components/table';
import { SdUploadFile } from '@sd-angular/core/components/upload-file';
import { SdColor } from '@sd-angular/core/utilities';
import { SdPatternType } from '@sd-angular/core/utilities/models';
import { SdFormGenericSelectionStaticItem } from './form-generic-definition-selection.model';
import { SdFormGenericExpression } from './form-generic-expression.model';
import { SdFormGeneric } from './form-generic.model';
export interface SdFormRenderConfiguration {
    onLoaded?: () => void;
    components: SdFormGeneric['components'];
    validations?: SdFormGeneric['validations'];
    variables?: SdFormGenericVariable[];
    beforeSubmit?: (entity: Record<string, any>) => Promise<Record<string, any>>;
}
export interface SdFormGenericLayout {
    row?: string;
    columns: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
    mobileColumns?: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
}
export declare const GenerateId: () => string;
export declare const GenerateKey: () => string;
export declare const SdFormatComponent: (component: SdFormGenericComponent | SdFormGenericGroup) => void;
export interface SdFormGenericVariable {
    id: string;
    key: string;
    label: string;
}
export type SdFormGenericComponent = SdFormGenericTextfield | SdFormGenericChipString | SdFormGenericChipCalendar | SdFormGenericTextarea | SdFormGenericNumber | SdFormGenericCheckbox | SdFormGenericDatetime | SdFormGenericValues | SdFormGenericUpload | SdFormGenericTable | SdFormGenericHtml;
export type SdFormGenericValues = SdFormGenericRadio | SdFormGenericSelect | SdFormGenericChecklist;
export interface SdFormGenericComponentBase {
    template?: string;
    id: string;
    key: string;
    label: string;
    helperText?: string;
    layout?: SdFormGenericLayout;
    validate?: {
        required?: boolean;
    };
    disabled?: boolean;
    properties?: {
        viewed?: boolean;
        hyperlink?: string;
        hidden?: boolean;
        hiddenWhenExpression?: SdFormGenericExpression;
        visibleWhenExpression?: SdFormGenericExpression;
        disabledWhenExpression?: SdFormGenericExpression;
        requiredWhenExpression?: SdFormGenericExpression;
        onChange?: {
            setValues?: Record<string, any>;
        };
    } & Record<string, any>;
}
export interface SdFormGenericTextfield extends SdFormGenericComponentBase {
    type: 'textfield';
    defaultValue?: string;
    validate?: {
        maxlength?: number;
        minlength?: number;
        pattern?: SdPatternType | string;
        patternErrorMessage?: string;
    } & SdFormGenericComponentBase['validate'];
}
export interface SdFormGenericChipString extends SdFormGenericComponentBase {
    type: 'chip-string';
    defaultValue?: string[];
    validate?: {
        maxlength?: number;
        minlength?: number;
        pattern?: SdPatternType | string;
        patternErrorMessage?: string;
        maxOfItems?: number;
    } & SdFormGenericComponentBase['validate'];
}
export interface SdFormGenericChipCalendar extends SdFormGenericComponentBase {
    type: 'chip-calendar';
    defaultValue?: string[];
    validate?: {
        maxlength?: number;
        minlength?: number;
        pattern?: SdPatternType | string;
        patternErrorMessage?: string;
        maxOfItems?: number;
    } & SdFormGenericComponentBase['validate'];
}
export interface SdFormGenericTextarea extends SdFormGenericComponentBase {
    type: 'textarea';
    defaultValue?: string;
    validate?: {
        maxlength?: number;
        minlength?: number;
    } & SdFormGenericComponentBase['validate'];
}
export interface SdFormGenericNumber extends SdFormGenericComponentBase {
    type: 'number';
    defaultValue?: number;
    validate?: {
        min?: number;
        max?: number;
    } & SdFormGenericComponentBase['validate'];
}
export interface SdFormGenericCheckbox extends SdFormGenericComponentBase {
    type: 'checkbox';
    defaultValue?: boolean;
}
export interface SdFormGenericDatetime extends SdFormGenericComponentBase {
    type: 'datetime';
    subtype: 'date' | 'datetime';
    defaultValue?: string;
    validate?: {
        min?: 'TODAY' | string;
        max?: 'TODAY' | string;
    } & SdFormGenericComponentBase['validate'];
}
export interface SdFormGenericRadio extends SdFormGenericComponentBase {
    type: 'radio';
    values?: SdFormGenericSelectionStaticItem[];
    valuesKey?: string;
    defaultValue?: string;
    properties?: {
        direction?: 'row' | 'column';
    } & SdFormGenericComponentBase['properties'];
}
export interface SdFormGenericSelect extends SdFormGenericComponentBase {
    type: 'select';
    values?: SdFormGenericSelectionStaticItem[];
    valuesKey?: string;
    defaultValue?: string | string[];
    properties?: {
        query?: Record<string, any>;
        multiple?: boolean;
        setVariables?: Record<string, string>;
    } & SdFormGenericComponentBase['properties'];
}
export interface SdFormGenericChecklist extends SdFormGenericComponentBase {
    type: 'checklist';
    values?: SdFormGenericSelectionStaticItem[];
    valuesKey?: string;
    defaultValue?: string[];
    properties?: {
        query?: Record<string, any>;
    } & SdFormGenericComponentBase['properties'];
}
export interface SdFormGenericGroup {
    id: string;
    type: 'group';
    label: string;
    layout: SdFormGenericLayout;
    components: SdFormGenericComponent[];
    properties: {
        icon: string;
        color: SdColor;
        hidden?: boolean;
        hiddenWhenExpression?: SdFormGenericExpression;
        visibleWhenExpression?: SdFormGenericExpression;
    };
}
export interface SdFormGenericUpload extends SdFormGenericComponentBase {
    type: 'upload';
    properties?: {
        type?: SdUploadFile['type'];
        maxSize?: SdUploadFile['maxSize'];
        max?: SdUploadFile['max'];
        extensions?: SdUploadFile['extensions'];
        args?: Record<string, any>;
        source?: 'ALL' | 'PHOTO_LIBRARY' | 'CAPTURE';
    } & SdFormGenericComponentBase['properties'];
}
export interface FormRenderComponentTableColumnValues {
    valuesKey: string;
    query?: Record<string, any>;
}
export type SdFormGenericTableColumn<T = any> = TableColumnString<T> | TableColumnNumber<T> | TableColumnBool<T> | TableColumnDate<T> | TableColumnDatetime<T> | TableColumnRadio<T> | TableColumnValues<T> | TableColumnImage<T> | TableColumnFile<T>;
export declare const TableColumnTypes: {
    value: string;
    display: string;
}[];
interface TableColumnBase<T = any> {
    key: Extract<keyof T, string>;
    label: string;
    width?: SdTableColumn['width'];
    validate?: {
        required?: boolean;
    };
}
interface TableColumnString<T = any> extends TableColumnBase<T> {
    type: 'string';
    validate?: {
        minlength?: number;
        maxlength?: number;
        pattern?: string;
        patternErrorMessage?: string;
    } & TableColumnBase['validate'];
}
interface TableColumnNumber<T = any> extends TableColumnBase<T> {
    type: 'number';
    validate?: {
        min?: number;
        max?: number;
    } & TableColumnBase['validate'];
}
interface TableColumnDate<T = any> extends TableColumnBase<T> {
    type: 'date';
    validate?: {
        min?: 'TODAY' | string;
        max?: 'TODAY' | string;
    } & TableColumnBase['validate'];
}
interface TableColumnDatetime<T = any> extends TableColumnBase<T> {
    type: 'datetime';
    validate?: {
        min?: 'TODAY' | string;
        max?: 'TODAY' | string;
    } & TableColumnBase['validate'];
}
interface TableColumnBool<T = any> extends TableColumnBase<T> {
    type: 'boolean';
    displayOnTrue?: string;
    displayOnFalse?: string;
}
interface TableColumnRadio<T = any> extends TableColumnBase<T> {
    type: 'radio';
    values?: SdFormGenericSelectionStaticItem[];
}
interface TableColumnValues<T = any> extends TableColumnBase<T> {
    type: 'values';
    valuesKey: string;
    query?: Record<string, any>;
    values?: SdFormGenericSelectionStaticItem[];
}
interface TableColumnImage<T = any> extends TableColumnBase<T> {
    type: 'image';
    args?: Record<string, any>;
    validate?: {
        max?: number;
        maxSize?: number;
    } & TableColumnBase['validate'];
}
interface TableColumnFile<T = any> extends TableColumnBase<T> {
    type: 'file';
    args?: Record<string, any>;
    validate?: {
        max?: number;
        maxSize?: number;
    } & TableColumnBase['validate'];
}
export interface SdFormGenericTable extends SdFormGenericComponentBase {
    type: 'table';
    columnsKey?: string;
    columns?: SdFormGenericTableColumn[];
    properties?: {
        type?: SdTableOption['type'];
        titleButtonCreate?: string;
    } & SdFormGenericComponentBase['properties'];
}
export interface SdFormGenericHtml {
    template?: string;
    id: string;
    key?: string;
    type: 'html';
    content: string;
    validate?: {
        required?: boolean;
    };
    layout?: SdFormGenericLayout;
    properties?: {
        viewed?: boolean;
        hyperlink?: string;
        hidden?: boolean;
        hiddenWhenExpression?: SdFormGenericExpression;
        visibleWhenExpression?: SdFormGenericExpression;
        variables?: {
            key: string;
            label: string;
            value?: string;
        }[];
        queries?: {
            key: string;
            label: string;
        }[];
        query?: Record<string, any>;
    };
}
export interface FormBuilderComponent {
    type: string;
    icon: string;
    name: string;
}
export declare const FormBuilderComponents: FormBuilderComponent[];
export declare const GetComponentAttributes: (components: (SdFormGenericComponent | SdFormGenericGroup)[]) => {
    value: string;
    display: string;
}[];
export declare const GetVariableAttributes: (variables: SdFormGenericVariable[]) => {
    value: string;
    display: string;
}[];
export {};
