import type { Ref } from 'vue'; import { z } from 'zod'; import type { ReplaceRecordType } from '../types/utilities'; export declare namespace KottiField { enum Size { LARGE = "large", MEDIUM = "medium", SMALL = "small" } namespace Validation { const emptySchema: z.ZodObject<{ type: z.ZodLiteral<"empty">; }, "strip", z.ZodTypeAny, { type: "empty"; }, { type: "empty"; }>; type Empty = z.output; const errorSchema: z.ZodObject<{ text: z.ZodNullable; type: z.ZodLiteral<"error">; }, "strip", z.ZodTypeAny, { type: "error"; text: string | null; }, { type: "error"; text: string | null; }>; type Error = z.output; const successSchema: z.ZodObject<{ text: z.ZodNullable; type: z.ZodLiteral<"success">; }, "strip", z.ZodTypeAny, { type: "success"; text: string | null; }, { type: "success"; text: string | null; }>; type Success = z.output; const warningSchema: z.ZodObject<{ text: z.ZodNullable; type: z.ZodLiteral<"warning">; }, "strip", z.ZodTypeAny, { type: "warning"; text: string | null; }, { type: "warning"; text: string | null; }>; type Warning = z.output; const resultSchema: z.ZodUnion<[z.ZodObject<{ type: z.ZodLiteral<"empty">; }, "strip", z.ZodTypeAny, { type: "empty"; }, { type: "empty"; }>, z.ZodObject<{ text: z.ZodNullable; type: z.ZodLiteral<"error">; }, "strip", z.ZodTypeAny, { type: "error"; text: string | null; }, { type: "error"; text: string | null; }>, z.ZodObject<{ text: z.ZodNullable; type: z.ZodLiteral<"success">; }, "strip", z.ZodTypeAny, { type: "success"; text: string | null; }, { type: "success"; text: string | null; }>, z.ZodObject<{ text: z.ZodNullable; type: z.ZodLiteral<"warning">; }, "strip", z.ZodTypeAny, { type: "warning"; text: string | null; }, { type: "warning"; text: string | null; }>]>; type Result = z.output; const functionSchema: z.ZodFunction, z.ZodUnion<[z.ZodObject<{ type: z.ZodLiteral<"empty">; }, "strip", z.ZodTypeAny, { type: "empty"; }, { type: "empty"; }>, z.ZodObject<{ text: z.ZodNullable; type: z.ZodLiteral<"error">; }, "strip", z.ZodTypeAny, { type: "error"; text: string | null; }, { type: "error"; text: string | null; }>, z.ZodObject<{ text: z.ZodNullable; type: z.ZodLiteral<"success">; }, "strip", z.ZodTypeAny, { type: "success"; text: string | null; }, { type: "success"; text: string | null; }>, z.ZodObject<{ text: z.ZodNullable; type: z.ZodLiteral<"warning">; }, "strip", z.ZodTypeAny, { type: "warning"; text: string | null; }, { type: "warning"; text: string | null; }>]>>; type Function = z.output; } namespace Hook { interface Parameters { emit: (name: 'update:modelValue', ...args: unknown[]) => void; /** * Useful for checking validation on required fields */ isEmpty: (value: DATA_TYPE) => boolean; props: KottiField.PropsInternal; supports: KottiField.Supports; } type Returns = Pick & { currentValue: DATA_TYPE; /** * Whether the clear button is supported and enabled or not * e.g. KtFieldSingleSelect, KtFieldMultiSelect */ hasClear: boolean; inputProps: Readonly<{ /** * Native HTML Props should have lowercase keys */ 'data-test': string; disabled: boolean; id: string; tabindex: number; }>; isEmpty: boolean; setValue(newValue: DATA_TYPE, options?: { forceUpdate: boolean; }): void; validation: Readonly; }; type ReturnsWithRefs = { [KEY in keyof Returns]: Ref[KEY]>; }; } enum AutoComplete { OFF = "off", ON = "on" } /** * Each attribute on KottiField.Supports maps to one or more * KtField prop, as follows: * { * clear: ['hideClear'] * decoration: ['leftIcon', 'rightIcon', 'prefix', 'suffix'] * tabIndex: ['tabIndex'] * placeholder: ['placeholder'] * } * * The schema is only concerned with props that would have the same type, * if extended (e.g. decoration props). * Therefore, doesn't include `placeholder` since it is extended * differently per field. */ const potentiallySupportedPropsSchema: z.ZodObject<{ autoComplete: z.ZodDefault, z.ZodLiteral, z.ZodString]>>; hideClear: z.ZodDefault; isBorderless: z.ZodDefault; leftIcon: z.ZodDefault, z.ZodNativeEnum]>>>; prefix: z.ZodDefault>; rightIcon: z.ZodDefault, z.ZodNativeEnum]>>>; showVisibilityToggle: z.ZodDefault; suffix: z.ZodDefault>; tabIndex: z.ZodDefault; }, "strip", z.ZodTypeAny, { tabIndex: number; hideClear: boolean; showVisibilityToggle: boolean; isBorderless: boolean; leftIcon: "address_book" | "announce" | "arrow_down" | "arrow_line" | "arrow_right" | "arrow_up" | "arrow_up_down" | "assembly" | "attachment" | "attention" | "basket" | "bell" | "bookmark" | "bookmark_solid" | "box_3d" | "burger" | "cad" | "calendar" | "calendar_clock" | "camera" | "camera_switch" | "card" | "catalog" | "charts" | "check" | "chevron_down" | "chevron_down_double" | "chevron_left" | "chevron_left_double" | "chevron_right" | "chevron_right_double" | "chevron_up" | "chevron_up_double" | "circle_attention" | "circle_check" | "circle_cross" | "circle_i" | "circle_load" | "circle_minus" | "circle_question" | "circle_search" | "clock" | "close" | "cloud" | "cloud_download" | "cloud_upload" | "column_fixleft" | "column_fixright" | "column_hide" | "comment" | "copy" | "csv" | "dashboard" | "dimension" | "doc" | "dots" | "dots_vertical" | "download" | "edit" | "email" | "exit" | "exit_fullscreen" | "eye" | "eye_slashed" | "file" | "filled_circle_check" | "filled_circle_cross" | "filled_circle_minus" | "filled_triangle_attention" | "filter" | "fix_right" | "flag" | "folder" | "fullscreen" | "gant_chart" | "global" | "heart" | "heart_solid" | "hide_menu" | "home" | "idea" | "invoice" | "json" | "kanban" | "landline" | "layer" | "lightning_bolt" | "link" | "linked" | "list" | "location" | "logout" | "markup" | "material" | "minus" | "mobile" | "not_allow" | "not_applicable" | "notes" | "office" | "order" | "outlink" | "pdf" | "permission_locked" | "permission_unlocked" | "picture" | "plus" | "print" | "printer" | "qr_code" | "quote" | "reload" | "report_chart" | "request" | "save" | "scale" | "search" | "send" | "setting" | "share" | "shipping" | "shop" | "sidebar" | "sort_ascend" | "sort_descend" | "square_solid" | "star" | "star_solid" | "structure" | "support" | "switch" | "tag" | "tech" | "thumb_down" | "thumb_up" | "tile_layout" | "trash" | "triangle_down" | "triangle_left" | "triangle_right" | "triangle_switch" | "triangle_up" | "upload" | "user" | "user_solid" | "usergroup" | "version" | "view" | "view_sidebar" | "zip" | import("@3yourmind/yoco").Yoco.Icon | null; rightIcon: "address_book" | "announce" | "arrow_down" | "arrow_line" | "arrow_right" | "arrow_up" | "arrow_up_down" | "assembly" | "attachment" | "attention" | "basket" | "bell" | "bookmark" | "bookmark_solid" | "box_3d" | "burger" | "cad" | "calendar" | "calendar_clock" | "camera" | "camera_switch" | "card" | "catalog" | "charts" | "check" | "chevron_down" | "chevron_down_double" | "chevron_left" | "chevron_left_double" | "chevron_right" | "chevron_right_double" | "chevron_up" | "chevron_up_double" | "circle_attention" | "circle_check" | "circle_cross" | "circle_i" | "circle_load" | "circle_minus" | "circle_question" | "circle_search" | "clock" | "close" | "cloud" | "cloud_download" | "cloud_upload" | "column_fixleft" | "column_fixright" | "column_hide" | "comment" | "copy" | "csv" | "dashboard" | "dimension" | "doc" | "dots" | "dots_vertical" | "download" | "edit" | "email" | "exit" | "exit_fullscreen" | "eye" | "eye_slashed" | "file" | "filled_circle_check" | "filled_circle_cross" | "filled_circle_minus" | "filled_triangle_attention" | "filter" | "fix_right" | "flag" | "folder" | "fullscreen" | "gant_chart" | "global" | "heart" | "heart_solid" | "hide_menu" | "home" | "idea" | "invoice" | "json" | "kanban" | "landline" | "layer" | "lightning_bolt" | "link" | "linked" | "list" | "location" | "logout" | "markup" | "material" | "minus" | "mobile" | "not_allow" | "not_applicable" | "notes" | "office" | "order" | "outlink" | "pdf" | "permission_locked" | "permission_unlocked" | "picture" | "plus" | "print" | "printer" | "qr_code" | "quote" | "reload" | "report_chart" | "request" | "save" | "scale" | "search" | "send" | "setting" | "share" | "shipping" | "shop" | "sidebar" | "sort_ascend" | "sort_descend" | "square_solid" | "star" | "star_solid" | "structure" | "support" | "switch" | "tag" | "tech" | "thumb_down" | "thumb_up" | "tile_layout" | "trash" | "triangle_down" | "triangle_left" | "triangle_right" | "triangle_switch" | "triangle_up" | "upload" | "user" | "user_solid" | "usergroup" | "version" | "view" | "view_sidebar" | "zip" | import("@3yourmind/yoco").Yoco.Icon | null; prefix: string | null; suffix: string | null; autoComplete: string; }, { autoComplete?: string | undefined; hideClear?: boolean | undefined; isBorderless?: boolean | undefined; leftIcon?: "address_book" | "announce" | "arrow_down" | "arrow_line" | "arrow_right" | "arrow_up" | "arrow_up_down" | "assembly" | "attachment" | "attention" | "basket" | "bell" | "bookmark" | "bookmark_solid" | "box_3d" | "burger" | "cad" | "calendar" | "calendar_clock" | "camera" | "camera_switch" | "card" | "catalog" | "charts" | "check" | "chevron_down" | "chevron_down_double" | "chevron_left" | "chevron_left_double" | "chevron_right" | "chevron_right_double" | "chevron_up" | "chevron_up_double" | "circle_attention" | "circle_check" | "circle_cross" | "circle_i" | "circle_load" | "circle_minus" | "circle_question" | "circle_search" | "clock" | "close" | "cloud" | "cloud_download" | "cloud_upload" | "column_fixleft" | "column_fixright" | "column_hide" | "comment" | "copy" | "csv" | "dashboard" | "dimension" | "doc" | "dots" | "dots_vertical" | "download" | "edit" | "email" | "exit" | "exit_fullscreen" | "eye" | "eye_slashed" | "file" | "filled_circle_check" | "filled_circle_cross" | "filled_circle_minus" | "filled_triangle_attention" | "filter" | "fix_right" | "flag" | "folder" | "fullscreen" | "gant_chart" | "global" | "heart" | "heart_solid" | "hide_menu" | "home" | "idea" | "invoice" | "json" | "kanban" | "landline" | "layer" | "lightning_bolt" | "link" | "linked" | "list" | "location" | "logout" | "markup" | "material" | "minus" | "mobile" | "not_allow" | "not_applicable" | "notes" | "office" | "order" | "outlink" | "pdf" | "permission_locked" | "permission_unlocked" | "picture" | "plus" | "print" | "printer" | "qr_code" | "quote" | "reload" | "report_chart" | "request" | "save" | "scale" | "search" | "send" | "setting" | "share" | "shipping" | "shop" | "sidebar" | "sort_ascend" | "sort_descend" | "square_solid" | "star" | "star_solid" | "structure" | "support" | "switch" | "tag" | "tech" | "thumb_down" | "thumb_up" | "tile_layout" | "trash" | "triangle_down" | "triangle_left" | "triangle_right" | "triangle_switch" | "triangle_up" | "upload" | "user" | "user_solid" | "usergroup" | "version" | "view" | "view_sidebar" | "zip" | import("@3yourmind/yoco").Yoco.Icon | null | undefined; prefix?: string | null | undefined; rightIcon?: "address_book" | "announce" | "arrow_down" | "arrow_line" | "arrow_right" | "arrow_up" | "arrow_up_down" | "assembly" | "attachment" | "attention" | "basket" | "bell" | "bookmark" | "bookmark_solid" | "box_3d" | "burger" | "cad" | "calendar" | "calendar_clock" | "camera" | "camera_switch" | "card" | "catalog" | "charts" | "check" | "chevron_down" | "chevron_down_double" | "chevron_left" | "chevron_left_double" | "chevron_right" | "chevron_right_double" | "chevron_up" | "chevron_up_double" | "circle_attention" | "circle_check" | "circle_cross" | "circle_i" | "circle_load" | "circle_minus" | "circle_question" | "circle_search" | "clock" | "close" | "cloud" | "cloud_download" | "cloud_upload" | "column_fixleft" | "column_fixright" | "column_hide" | "comment" | "copy" | "csv" | "dashboard" | "dimension" | "doc" | "dots" | "dots_vertical" | "download" | "edit" | "email" | "exit" | "exit_fullscreen" | "eye" | "eye_slashed" | "file" | "filled_circle_check" | "filled_circle_cross" | "filled_circle_minus" | "filled_triangle_attention" | "filter" | "fix_right" | "flag" | "folder" | "fullscreen" | "gant_chart" | "global" | "heart" | "heart_solid" | "hide_menu" | "home" | "idea" | "invoice" | "json" | "kanban" | "landline" | "layer" | "lightning_bolt" | "link" | "linked" | "list" | "location" | "logout" | "markup" | "material" | "minus" | "mobile" | "not_allow" | "not_applicable" | "notes" | "office" | "order" | "outlink" | "pdf" | "permission_locked" | "permission_unlocked" | "picture" | "plus" | "print" | "printer" | "qr_code" | "quote" | "reload" | "report_chart" | "request" | "save" | "scale" | "search" | "send" | "setting" | "share" | "shipping" | "shop" | "sidebar" | "sort_ascend" | "sort_descend" | "square_solid" | "star" | "star_solid" | "structure" | "support" | "switch" | "tag" | "tech" | "thumb_down" | "thumb_up" | "tile_layout" | "trash" | "triangle_down" | "triangle_left" | "triangle_right" | "triangle_switch" | "triangle_up" | "upload" | "user" | "user_solid" | "usergroup" | "version" | "view" | "view_sidebar" | "zip" | import("@3yourmind/yoco").Yoco.Icon | null | undefined; showVisibilityToggle?: boolean | undefined; suffix?: string | null | undefined; tabIndex?: number | undefined; }>; /** * Includes, but is not limited to, properties that are not consumed by the KtForm itself, * but rather just passed-down to all fields inside the form to make common * tasks like disabling the entire form or hiding validation easier. * * These values can be explicitly overriden in the field usage */ const inheritablePropsSchema: z.ZodObject<{ /** * Is the field disabled? * This will e.g. prevent changing the value */ isDisabled: z.ZodDefault; /** * Show a skeleton in place of the input area of the field */ isLoading: z.ZodDefault; /** * Should the user have the option to clear the field * * This is never by default and specified by component schemas that need it */ hideClear: z.ZodNever; /** * Prevents the validation (e.g. color, text) from being shown */ hideValidation: z.ZodDefault; showVisibilityToggle: z.ZodDefault; /** * Defines the size of the field which influences child styles * to make fields e.g. appear more compact */ size: z.ZodDefault, z.ZodNativeEnum]>>>; }, "strip", z.ZodTypeAny, { size: "large" | "medium" | "small" | Size | null; isDisabled: boolean; isLoading: boolean; hideClear: never; hideValidation: boolean; showVisibilityToggle: boolean; }, { hideClear: never; isDisabled?: boolean | undefined; isLoading?: boolean | undefined; hideValidation?: boolean | undefined; showVisibilityToggle?: boolean | undefined; size?: "large" | "medium" | "small" | Size | null | undefined; }>; type InheritableProps = z.input; /** * Warning: All values of type `never` are replaced with `any` */ type InheritablePropsInternal = ReplaceRecordType>; const propsSchema: z.ZodObject<{ size: z.ZodDefault, z.ZodNativeEnum]>>>; isDisabled: z.ZodDefault; isLoading: z.ZodDefault; hideClear: z.ZodNever; hideValidation: z.ZodDefault; isBorderless: z.ZodNever; inputId: z.ZodDefault>; dataTest: z.ZodDefault>; formKey: z.ZodDefault]>>>; helpDescription: z.ZodDefault>; helpText: z.ZodDefault>; leftIcon: z.ZodNever; placeholder: z.ZodNever; isOptional: z.ZodDefault; label: z.ZodDefault>; rightIcon: z.ZodNever; prefix: z.ZodNever; showVisibilityToggle: z.ZodDefault; suffix: z.ZodNever; tabIndex: z.ZodNever; validator: z.ZodDefault, z.ZodUnion<[z.ZodObject<{ type: z.ZodLiteral<"empty">; }, "strip", z.ZodTypeAny, { type: "empty"; }, { type: "empty"; }>, z.ZodObject<{ text: z.ZodNullable; type: z.ZodLiteral<"error">; }, "strip", z.ZodTypeAny, { type: "error"; text: string | null; }, { type: "error"; text: string | null; }>, z.ZodObject<{ text: z.ZodNullable; type: z.ZodLiteral<"success">; }, "strip", z.ZodTypeAny, { type: "success"; text: string | null; }, { type: "success"; text: string | null; }>, z.ZodObject<{ text: z.ZodNullable; type: z.ZodLiteral<"warning">; }, "strip", z.ZodTypeAny, { type: "warning"; text: string | null; }, { type: "warning"; text: string | null; }>]>>>; modelValue: z.ZodNever; }, "strip", z.ZodTypeAny, { dataTest: string | null; label: string | null; size: "large" | "medium" | "small" | Size | null; isDisabled: boolean; isLoading: boolean; helpText: string | null; tabIndex: never; modelValue: never; placeholder: never; hideClear: never; hideValidation: boolean; showVisibilityToggle: boolean; isBorderless: never; inputId: string | null; formKey: string | null; helpDescription: string | null; leftIcon: never; isOptional: boolean; rightIcon: never; prefix: never; suffix: never; validator: (args_0: any, ...args: unknown[]) => { type: "empty"; } | { type: "error"; text: string | null; } | { type: "success"; text: string | null; } | { type: "warning"; text: string | null; }; }, { tabIndex: never; modelValue: never; placeholder: never; hideClear: never; isBorderless: never; leftIcon: never; rightIcon: never; prefix: never; suffix: never; size?: "large" | "medium" | "small" | Size | null | undefined; isDisabled?: boolean | undefined; isLoading?: boolean | undefined; hideValidation?: boolean | undefined; inputId?: string | null | undefined; dataTest?: string | null | undefined; formKey?: string | null | undefined; helpDescription?: string | null | undefined; helpText?: string | null | undefined; isOptional?: boolean | undefined; label?: string | null | undefined; showVisibilityToggle?: boolean | undefined; validator?: ((args_0: any, ...args: unknown[]) => { type: "empty"; } | { type: "error"; text: string | null; } | { type: "success"; text: string | null; } | { type: "warning"; text: string | null; }) | undefined; }>; type Props = z.input; /** * Warning: All keys of type `never` are replaced with `any` */ type PropsInternal = ReplaceRecordType>; /** * Object that explicitly specifies which of the KtField.Props are * supported, since it may not always make sense to have some of * the props on certain fields. */ type Supports = { /** * All fields except KtFieldToggle (checkbox), KtFieldRadioGroup (radio), KtFieldFileUpload, * and KtFieldDate[Range|Time|TimeRange] */ autoComplete: boolean; /** * All fields except KtFieldToggle/KtFieldToggleGroup (checkbox), KtFieldRadioGroup (radio), * and KtFieldFileUpload */ borderless: boolean; /** * In some fields, having a clear button would be nonsensical (e.g. KtFieldToggle) */ clear: boolean; /** * Affects all decoration properties like icons and affixes. * These aren’t supported on e.g. the KtFieldToggleGroup */ decoration: boolean; /** * Some components don’t have a well-defined place to put placeholders */ placeholder: boolean; /** * Some third-party components do not support passing a custom tabIndex */ tabIndex: boolean; }; type Translations = { requiredMessage: string; }; }