UNPKG

hongluan-ui

Version:
103 lines (102 loc) 3.09 kB
import type { ExtractPropTypes, PropType } from 'vue'; import type { FormItemProp } from './form-item'; export declare const formProps: { /** * @description Data of form component. */ model: ObjectConstructor; /** * @description Validation rules of form. */ rules: PropType<Partial<Record<string, import("hongluan-ui/es/utils").Arrayable<import("hongluan-ui/es/tokens").FormItemRule>>>>; /** * @description Position of label. If set to `'left'` or `'right'`, `label-width` prop is also required. */ labelPosition: (StringConstructor | ArrayConstructor)[]; width: (StringConstructor | ArrayConstructor)[]; /** * @description Suffix of the label. */ labelSuffix: { type: StringConstructor; default: string; }; /** * @description Prefix of the label. */ labelPrefix: { type: StringConstructor; default: string; }; /** * @description Whether the form is inline. */ inline: BooleanConstructor; /** * @description Whether to show the error message. */ showMessage: { type: BooleanConstructor; default: boolean; }; statusIcon: BooleanConstructor; /** * @description Control the size of components in this form. */ size: PropType<"xxxs" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl">; /** * @description Whether to disable all components in this form. If set to `true`, it will override the `disabled` prop of the inner component. */ disabled: BooleanConstructor; /** * @description Whether to trigger validation when the `rules` prop is changed. */ validateOnRuleChange: { type: BooleanConstructor; default: boolean; }; /** * @description Whether to hide required fields should have a red asterisk (star) beside their labels. */ hideRequiredAsterisk: BooleanConstructor; /** * @description Position of asterisk. */ requireAsteriskPosition: { type: StringConstructor; values: string[]; default: string; }; gap: { type: StringConstructor; default: string; }; itemGap: { type: StringConstructor; default: string; }; itemGapX: { type: StringConstructor; default: string; }; itemGapY: { type: StringConstructor; default: string; }; /** * @description When validation fails, scroll to the first error form entry. */ scrollToError: BooleanConstructor; /** * @description When validation fails, it scrolls to the first error item based on the scrollIntoView option. */ scrollIntoViewOptions: { type: (BooleanConstructor | ObjectConstructor)[]; }; fill: BooleanConstructor; }; export declare type FormProps = ExtractPropTypes<typeof formProps>; export declare const formEmits: { validate: (prop: FormItemProp, isValid: boolean, message: string) => boolean; }; export declare type FormEmits = typeof formEmits;