import { TypographyColor, TypographyOverflow, TypographyTransform, TypographyTypes, TypographyWeight } from "../Typography/Typography.vue";
import Button from "./../Button/Button.vue";
import FileUpload from "./../FileUpload/FileUpload.vue";
import InputText from "./../FormElements/InputText.vue";
import ButtonIcon, { ButtonIconObjectProp } from "./ButtonIcon.vue";
import EmojiPicker from "./../FormElements/EmojiPicker.vue";
import SwitchBox from "./../FormElements/SwitchBox/SwitchBox.vue";
import { OptionDetails, default as CheckOptions } from "./CheckOptions.vue";
import SearchInput from "./../SearchInput/SearchInput.vue";
import DateTimePicker from "./../FormElements/DateTimePicker/DateTimePicker.vue";
import Icon, { IconSize, IconState, IconType } from "../Icon/Icon.vue";
import AvatarUpload from "./../AvatarUpload/AvatarUpload.vue";
export type FormBuilderText = {
    text?: string;
    color?: TypographyColor;
    type?: TypographyTypes;
    weight?: TypographyWeight;
    transform?: TypographyTransform;
    overflow?: TypographyOverflow;
    link?: boolean;
    onClick?: () => void;
};
export type FormBuilderInfoText = FormBuilderText & {
    icon?: {
        name: string;
        size?: IconSize;
        type?: IconType;
        state?: IconState;
    } | boolean;
};
export type FormBuilderMultilineOption = {
    header: string;
    details?: string;
    meta?: string;
    id?: string;
};
export type FormBuilderIconOption = {
    icon: string;
    label: string;
};
export type FormBuilderInputTextField = CoreFieldWithName & {
    type: "text" | "textarea" | "password" | "email";
    suggested?: string;
    value?: string;
    placeholder?: string;
    props?: Mutable<Partial<InstanceType<typeof InputText>["$props"]>>;
    flags?: FormBuilderFlag[];
};
export type FormBuilderMultiSuggestField = CoreFieldWithName & {
    type: "suggest";
    options: string[];
    value?: string;
    placeholder?: string;
    props?: {
        options: string[];
        value?: string;
        placeholder?: string;
    };
};
export type FormBuilderInputTextNumberField = CoreFieldWithName & {
    type: "number";
    suggested?: string;
    value?: number;
    placeholder?: string;
    props?: Mutable<Partial<InstanceType<typeof InputText>["$props"]>>;
    flags?: FormBuilderFlag[];
};
export type FormBuilderFileField = CoreFieldWithName & {
    type: "file";
    multiple?: boolean;
    value?: File[];
    title?: string;
    subTitle?: string;
    accept?: string;
    props?: Mutable<Partial<InstanceType<typeof FileUpload>["$props"]>>;
};
export type FormBuilderButtonField = CoreField & {
    type: "button" | "submit";
    value: string;
    props?: Mutable<Partial<InstanceType<typeof Button>["$props"]>>;
};
export type FormBuilderButtonIconField = CoreField & {
    type: "button-icon";
    value: string | ButtonIconObjectProp;
    props?: Mutable<Partial<InstanceType<typeof ButtonIcon>["$props"]>>;
};
export type FormBuilderEmojiField = CoreFieldWithName & {
    type: "emoji";
    value?: string;
    props?: Mutable<Partial<InstanceType<typeof EmojiPicker>["$props"]>>;
};
export type FormBuilderCheckOptionsField = CoreFieldWithName & {
    type: "checkbox" | "radio";
    value?: string | OptionDetails | string[] | OptionDetails[];
    options: string[] | OptionDetails[];
    props?: Mutable<Partial<InstanceType<typeof CheckOptions>["$props"]>>;
};
export type FormBuilderSwitchBoxField = CoreFieldWithName & {
    type: "switch";
    value?: boolean;
    props?: Mutable<Partial<InstanceType<typeof SwitchBox>["$props"]>>;
};
export type MultiselectField<FieldOptionType = string | FormBuilderMultilineOption | FormBuilderIconOption> = CoreFieldWithName & {
    type: "select";
    value?: FieldOptionType | FieldOptionType[];
    options: Array<FieldOptionType>;
    placeholder?: string;
    props?: {
        disabled?: boolean;
        showLabels?: boolean;
        headerInOption?: boolean;
        multiple?: boolean;
        allowEmpty?: boolean;
        noResultMessage?: string;
        addNewOptionOnNoResult?: boolean;
        openDirection?: "top" | "bottom";
        maxHeight?: number;
        customLabel?: (arg: FieldOptionType) => string;
        options?: string[] | FormBuilderMultilineOption[] | FormBuilderIconOption[];
    };
};
export type FormBuilderAvatarField = CoreFieldWithName & {
    type: "avatar";
    props?: Mutable<Partial<InstanceType<typeof AvatarUpload>["$props"]>>;
};
export type FormBuilderSearchField = CoreFieldWithName & {
    type: "search";
    props?: Mutable<Partial<InstanceType<typeof SearchInput>["$props"]>>;
};
export type FormBuilderDateField = CoreFieldWithName & {
    type: "date";
    value?: Date;
    props?: Mutable<Partial<InstanceType<typeof DateTimePicker>["$props"]>>;
};
export type FormBuilderIconField = CoreField & {
    type: "icon";
    value: string | Mutable<Partial<InstanceType<typeof Icon>["$props"]>>;
    props?: Mutable<Partial<InstanceType<typeof Icon>["$props"]>>;
    flags?: FormBuilderFlag[];
};
export type FormBuilderArrayField = CoreFieldWithName & {
    type: "array";
    direction?: FormBuilderDirection;
    value: FormBuilderField[];
    props?: {
        fields: FormBuilderField[];
        direction: FormBuilderDirection;
    };
};
export type FormBuilderAccordionField = CoreFieldWithName & {
    type: "accordion";
    direction?: FormBuilderDirection;
    value: FormBuilderField[];
    title?: string;
    props?: {
        accordion: true;
        direction: "column";
        title?: string;
        fields: FormBuilderField[];
    };
};
export type FormBuilderHeaderField = CoreField & {
    type: "header";
};
export type FormBuilderHiddenField = CoreFieldWithName & {
    type: "hidden";
    value: any;
};
export type FormBuilderIDField = CoreField & {
    type: "id";
    value: string;
};
export type FormBuilderSeparatorField = CoreField & {
    type: "separator";
};
interface CoreField {
    id?: string;
    qaId?: string;
    label?: string | FormBuilderText;
    help?: string | FormBuilderText;
    info?: string | FormBuilderInfoText;
    rules?: string | Record<string, any>;
    cssClass?: string;
    inline?: boolean;
    customMessages?: Record<string, string>;
    onClick?: () => void;
}
interface CoreFieldWithName extends CoreField {
    name: string;
}
export type FormBuilderField<FieldOptionType = any> = FormBuilderHeaderField | FormBuilderIDField | FormBuilderSeparatorField | FormBuilderHiddenField | FormBuilderInputTextField | FormBuilderMultiSuggestField | FormBuilderInputTextNumberField | FormBuilderAvatarField | FormBuilderDateField | FormBuilderIconField | FormBuilderSearchField | MultiselectField<FieldOptionType> | FormBuilderButtonIconField | FormBuilderButtonField | FormBuilderFileField | FormBuilderArrayField | FormBuilderEmojiField | FormBuilderCheckOptionsField | FormBuilderSwitchBoxField | FormBuilderAccordionField;
export type FormBuilderFields = FormBuilderField | FormBuilderField[];
export type FormBuilderComputedField = FormBuilderField & {
    id: string;
    name: string;
    inline: boolean;
    component: string;
    model: string;
    errorProp: string;
    rawField?: FormBuilderField;
    label?: FormBuilderText;
    info?: FormBuilderInfoText;
    help?: FormBuilderText;
    props: {
        customRules: Record<string, any>;
        externalErrors: Record<string, any>;
    };
};
export type FormBuilderDirection = "row" | "column";
export type FormBuilderMode = "aggressive" | "passive";
export type FormBuilderFlag = {
    label: string;
    name: string;
    value: boolean;
};
type Mutable<T> = {
    -readonly [P in keyof T]: T[P];
};
export {};
