hongluan-ui
Version:
Hongluan Component Library for Vue 3
65 lines (64 loc) • 2.34 kB
TypeScript
import type { ExtractPropTypes, PropType } from 'vue';
import type { Arrayable } from 'hongluan-ui/es/utils';
import type { FormItemRule } from 'hongluan-ui/es/tokens';
export declare const formItemValidateStates: readonly ["", "error", "validating", "success"];
export declare type FormItemValidateState = typeof formItemValidateStates[number];
export declare type FormItemProp = Arrayable<string>;
export declare const formItemProps: {
/**
* @description Label text.
*/
label: StringConstructor;
width: (StringConstructor | ArrayConstructor)[];
labelPosition: (StringConstructor | ArrayConstructor)[];
/**
* @description A key of `model`. It could be an array of property paths (e.g `['a', 'b', 0]`). In the use of `validate` and `resetFields` method, the attribute is required.
*/
prop: PropType<FormItemProp>;
/**
* @description Whether the field is required or not, will be determined by validation rules if omitted.
*/
required: {
type: BooleanConstructor;
default: any;
};
/**
* @description Validation rules of form, see the [following table](#formitemrule), more advanced usage at [async-validator](https://github.com/yiminghe/async-validator).
*/
rules: PropType<FormItemRule | FormItemRule[]>;
/**
* @description Field error message, set its value and the field will validate error and show this message immediately.
*/
error: StringConstructor;
/**
* @description Validation state of formItem.
*/
validateStatus: PropType<"" | "success" | "error" | "validating">;
/**
* @description Same as for in native label.
*/
for: StringConstructor;
/**
* @description Whether to show the error message.
*/
showMessage: {
type: BooleanConstructor;
default: boolean;
};
/**
* @description Control the size of components in this form-item.
*/
size: {
type: PropType<"xxxs" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl">;
validator: (val: string) => boolean;
};
gap: {
type: StringConstructor;
default: string;
};
offset: {
type: StringConstructor;
default: string;
};
};
export declare type FormItemProps = ExtractPropTypes<typeof formItemProps>;