x-next 0.0.0-alpha.51 → 0.0.0-alpha.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -21
- package/dist/_hooks/_types.d.ts +6 -0
- package/dist/_hooks/use-cursor.d.ts +2 -0
- package/dist/_hooks/use-form-item.d.ts +16 -0
- package/dist/_hooks/use-trigger.d.ts +13 -0
- package/dist/_utils/get-value-by-path.d.ts +5 -0
- package/dist/_utils/keycode.d.ts +36 -0
- package/dist/_utils/pick.d.ts +1 -0
- package/dist/_utils/responsive-observe.d.ts +24 -0
- package/dist/_utils/vue-eco.d.ts +4 -0
- package/dist/components/button/Button.d.ts +11 -5
- package/dist/components/button/ButtonGroup.vue.d.ts +90 -0
- package/dist/components/button/context.d.ts +11 -0
- package/dist/components/button/index.d.ts +143 -29
- package/dist/components/button/props.d.ts +10 -6
- package/dist/components/dialog/Dialog.d.ts +3 -3
- package/dist/components/dialog/index.d.ts +11 -11
- package/dist/components/drawer/index.d.ts +225 -133
- package/dist/components/drawer/src/Drawer.vue.d.ts +111 -65
- package/dist/components/dropdown/Dropdown.vue.d.ts +1143 -0
- package/dist/components/dropdown/DropdownButton.vue.d.ts +1612 -0
- package/dist/components/dropdown/DropdownGroup.vue.d.ts +21 -0
- package/dist/components/dropdown/DropdownOption.vue.d.ts +63 -0
- package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +1234 -0
- package/dist/components/dropdown/context.d.ts +6 -0
- package/dist/components/dropdown/dropdown-panel.vue.d.ts +432 -0
- package/dist/components/dropdown/index.d.ts +7614 -0
- package/dist/components/dropdown/interface.d.ts +33 -0
- package/dist/components/dropdown/utils.d.ts +5 -0
- package/dist/components/empty/Empty.d.ts +44 -0
- package/dist/components/empty/index.d.ts +43 -0
- package/dist/components/form/Form.vue.d.ts +313 -0
- package/dist/components/form/FormItem.vue.d.ts +2218 -0
- package/dist/components/form/context.d.ts +49 -0
- package/dist/components/form/form-item-label.vue.d.ts +1435 -0
- package/dist/components/form/form-item-message.vue.d.ts +24 -0
- package/dist/components/form/index.d.ts +4189 -0
- package/dist/components/form/interface.d.ts +185 -0
- package/dist/components/form/utils.d.ts +9 -0
- package/dist/components/form/validateMessages.d.ts +46 -0
- package/dist/components/grid/Col.vue.d.ts +188 -0
- package/dist/components/grid/Grid.vue.d.ts +108 -0
- package/dist/components/grid/GridItem.vue.d.ts +78 -0
- package/dist/components/grid/Row.vue.d.ts +102 -0
- package/dist/components/grid/context.d.ts +19 -0
- package/dist/components/grid/hook/use-responsive-state.d.ts +3 -0
- package/dist/components/grid/hook/use-responsive-value.d.ts +24 -0
- package/dist/components/grid/index.d.ts +562 -0
- package/dist/components/grid/interface.d.ts +80 -0
- package/dist/components/grid/utils/index.d.ts +11 -0
- package/dist/components/image/Image.vue.d.ts +2179 -0
- package/dist/components/image/ImagePreview.vue.d.ts +1879 -0
- package/dist/components/image/ImagePreviewAction.d.ts +15 -15
- package/dist/components/image/ImagePreviewGroup.vue.d.ts +1975 -0
- package/dist/components/image/index.d.ts +14126 -0
- package/dist/components/image/interface.d.ts +8 -0
- package/dist/components/image/preview-toolbar.vue.d.ts +16 -22
- package/dist/components/index.d.ts +6 -1
- package/dist/components/input/Input.d.ts +233 -161
- package/dist/components/input/InputGroup.vue.d.ts +9 -0
- package/dist/components/input/InputPassword.vue.d.ts +337 -0
- package/dist/components/input/InputSearch.d.ts +123 -0
- package/dist/components/input/index.d.ts +927 -270
- package/dist/components/message/Message.d.ts +1 -1
- package/dist/components/message/MessageVue.vue.d.ts +1 -1
- package/dist/components/message/index.d.ts +5 -5
- package/dist/components/message-box/index.d.ts +2 -2
- package/dist/components/notification/index.d.ts +2 -2
- package/dist/components/popconfirm/index.d.ts +8 -8
- package/dist/components/popconfirm/src/Popconfirm.d.ts +2 -2
- package/dist/components/popconfirm/src/popup.vue.d.ts +18 -9
- package/dist/components/popup/Popup.d.ts +3 -3
- package/dist/components/popup/index.d.ts +11 -11
- package/dist/components/{scrollbar/src → scrollbar-v2}/Scrollbar.vue.d.ts +96 -28
- package/dist/components/{scrollbar → scrollbar-v2}/index.d.ts +94 -57
- package/dist/components/{scrollbar/src/types.d.ts → scrollbar-v2/interface.d.ts} +0 -2
- package/dist/components/scrollbar-v2/thumb.vue.d.ts +62 -0
- package/dist/components/space/index.d.ts +2 -2
- package/dist/components/tabs/index.d.ts +3 -3
- package/dist/components/tabs/tabs-nav.d.ts +1 -1
- package/dist/components/tabs/tabs-tab.vue.d.ts +1 -1
- package/dist/components/tag/index.d.ts +2 -2
- package/dist/components/timeline/index.d.ts +2 -2
- package/dist/components/timeline-item/index.d.ts +2 -2
- package/dist/components/tooltip/Tooltip.vue.d.ts +7 -7
- package/dist/components/tooltip/index.d.ts +17 -17
- package/dist/components/trend-chart/index.d.ts +2 -2
- package/dist/components/trigger/index.d.ts +6 -6
- package/dist/components/trigger/src/trigger.d.ts +2 -2
- package/dist/components/trigger-v2/index.d.ts +6 -6
- package/dist/components/trigger-v2/trigger.d.ts +2 -2
- package/dist/icons/_self/empty-better.d.ts +50 -0
- package/dist/icons/_self/empty.d.ts +50 -0
- package/dist/icons/_self/eye-invisible.d.ts +50 -0
- package/dist/icons/_self/eye.d.ts +50 -0
- package/dist/icons/_self/more-dot.d.ts +50 -0
- package/dist/icons/_self/question-message.d.ts +50 -0
- package/dist/icons/_self/search.d.ts +50 -0
- package/dist/index.es.js +7166 -3475
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +38 -21
- package/package.json +5 -3
- package/volar.d.ts +38 -21
- package/dist/components/form/constants.d.ts +0 -4
- package/dist/components/form/form-item.d.ts +0 -31
- package/dist/components/form/form.d.ts +0 -39
- package/dist/components/form/hooks.d.ts +0 -4
- package/dist/components/form/types.d.ts +0 -31
- package/dist/components/input/props.d.ts +0 -95
- package/dist/components/input/utils.d.ts +0 -6
- package/dist/components/scrollbar/src/constant.d.ts +0 -1
- package/dist/components/scrollbar/src/scrollbar.d.ts +0 -24
- package/dist/components/scrollbar/src/thumb.d.ts +0 -20
- package/dist/components/scrollbar/src/thumb.vue.d.ts +0 -47
@@ -0,0 +1,33 @@
|
|
1
|
+
import { Slot, Slots } from 'vue';
|
2
|
+
import { TriggerEvent, TriggerPosition } from '../../_utils/constant';
|
3
|
+
export type DropdownPosition = 'top' | 'tl' | 'tr' | 'bottom' | 'bl' | 'br';
|
4
|
+
export interface DropDownProps {
|
5
|
+
popupVisible?: boolean;
|
6
|
+
defaultPopupVisible?: boolean;
|
7
|
+
trigger?: TriggerEvent | TriggerEvent[];
|
8
|
+
position?: DropdownPosition;
|
9
|
+
popupContainer?: string | HTMLElement;
|
10
|
+
popupMaxHeight?: boolean | number;
|
11
|
+
}
|
12
|
+
export interface DOption {
|
13
|
+
value: string | number;
|
14
|
+
disabled?: boolean;
|
15
|
+
_props?: Record<string, any>;
|
16
|
+
_slots?: Slots;
|
17
|
+
}
|
18
|
+
export interface DGroup {
|
19
|
+
isGroup: true;
|
20
|
+
options: DropdownOption[];
|
21
|
+
title?: string;
|
22
|
+
_props?: Record<string, any>;
|
23
|
+
_slots?: Slots;
|
24
|
+
}
|
25
|
+
export interface DSubmenu extends DOption {
|
26
|
+
isSubmenu: true;
|
27
|
+
render: Slot;
|
28
|
+
children: DropdownOption[];
|
29
|
+
trigger?: TriggerEvent;
|
30
|
+
position?: TriggerPosition;
|
31
|
+
footer?: Slot;
|
32
|
+
}
|
33
|
+
export type DropdownOption = DOption | DGroup | DSubmenu;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { VNode } from 'vue';
|
2
|
+
import { DropdownOption, DGroup, DSubmenu } from './interface';
|
3
|
+
export declare const isGroup: (option: DropdownOption) => option is DGroup;
|
4
|
+
export declare const isSubmenu: (option: DropdownOption) => option is DSubmenu;
|
5
|
+
export declare const travelDropDownChildren: (children: VNode[]) => DropdownOption[];
|
@@ -0,0 +1,44 @@
|
|
1
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
2
|
+
/**
|
3
|
+
* @zh 描述内容
|
4
|
+
* @en Description
|
5
|
+
*/
|
6
|
+
description: StringConstructor;
|
7
|
+
/**
|
8
|
+
* @zh 自定义图片的地址
|
9
|
+
* @en The src of the Custom Image
|
10
|
+
*/
|
11
|
+
imgSrc: StringConstructor;
|
12
|
+
/**
|
13
|
+
* @zh 是否在 ConfigProvider 中使用
|
14
|
+
* @en Whether to use in ConfigProvider
|
15
|
+
* @version 2.47.0
|
16
|
+
*/
|
17
|
+
inConfigProvider: {
|
18
|
+
type: BooleanConstructor;
|
19
|
+
default: boolean;
|
20
|
+
};
|
21
|
+
}>, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
22
|
+
/**
|
23
|
+
* @zh 描述内容
|
24
|
+
* @en Description
|
25
|
+
*/
|
26
|
+
description: StringConstructor;
|
27
|
+
/**
|
28
|
+
* @zh 自定义图片的地址
|
29
|
+
* @en The src of the Custom Image
|
30
|
+
*/
|
31
|
+
imgSrc: StringConstructor;
|
32
|
+
/**
|
33
|
+
* @zh 是否在 ConfigProvider 中使用
|
34
|
+
* @en Whether to use in ConfigProvider
|
35
|
+
* @version 2.47.0
|
36
|
+
*/
|
37
|
+
inConfigProvider: {
|
38
|
+
type: BooleanConstructor;
|
39
|
+
default: boolean;
|
40
|
+
};
|
41
|
+
}>> & Readonly<{}>, {
|
42
|
+
inConfigProvider: boolean;
|
43
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
44
|
+
export default _default;
|
@@ -0,0 +1,43 @@
|
|
1
|
+
export declare const Empty: {
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
3
|
+
description: StringConstructor;
|
4
|
+
imgSrc: StringConstructor;
|
5
|
+
inConfigProvider: {
|
6
|
+
type: BooleanConstructor;
|
7
|
+
default: boolean;
|
8
|
+
};
|
9
|
+
}>> & Readonly<{}>, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
10
|
+
inConfigProvider: boolean;
|
11
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
12
|
+
P: {};
|
13
|
+
B: {};
|
14
|
+
D: {};
|
15
|
+
C: {};
|
16
|
+
M: {};
|
17
|
+
Defaults: {};
|
18
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
19
|
+
description: StringConstructor;
|
20
|
+
imgSrc: StringConstructor;
|
21
|
+
inConfigProvider: {
|
22
|
+
type: BooleanConstructor;
|
23
|
+
default: boolean;
|
24
|
+
};
|
25
|
+
}>> & Readonly<{}>, () => any, {}, {}, {}, {
|
26
|
+
inConfigProvider: boolean;
|
27
|
+
}>;
|
28
|
+
__isFragment?: never;
|
29
|
+
__isTeleport?: never;
|
30
|
+
__isSuspense?: never;
|
31
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
32
|
+
description: StringConstructor;
|
33
|
+
imgSrc: StringConstructor;
|
34
|
+
inConfigProvider: {
|
35
|
+
type: BooleanConstructor;
|
36
|
+
default: boolean;
|
37
|
+
};
|
38
|
+
}>> & Readonly<{}>, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
39
|
+
inConfigProvider: boolean;
|
40
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & {
|
41
|
+
install(app: import('vue').App): void;
|
42
|
+
};
|
43
|
+
export { Empty as default };
|
@@ -0,0 +1,313 @@
|
|
1
|
+
import { PropType } from 'vue';
|
2
|
+
import { Options as ScrollIntoViewOptions } from 'scroll-into-view-if-needed';
|
3
|
+
import { Size } from '../../_utils/constant';
|
4
|
+
import { FieldData, FieldRule, ValidatedError } from './interface';
|
5
|
+
declare const FORM_LAYOUTS: readonly ["horizontal", "vertical", "inline"];
|
6
|
+
type FormLayout = (typeof FORM_LAYOUTS)[number];
|
7
|
+
declare const FORM_LABEL_ALIGNS: readonly ["left", "right"];
|
8
|
+
type FormLabelAlign = (typeof FORM_LABEL_ALIGNS)[number];
|
9
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
10
|
+
/**
|
11
|
+
* @zh 表单数据对象
|
12
|
+
* @en Form data object
|
13
|
+
*/
|
14
|
+
model: {
|
15
|
+
type: ObjectConstructor;
|
16
|
+
required: true;
|
17
|
+
};
|
18
|
+
/**
|
19
|
+
* @zh 表单的布局方式,包括水平、垂直、多列
|
20
|
+
* @en The layout of the form, including horizontal, vertical, and multi-column
|
21
|
+
* @values 'horizontal', 'vertical', 'inline'
|
22
|
+
*/
|
23
|
+
layout: {
|
24
|
+
type: PropType<FormLayout>;
|
25
|
+
default: string;
|
26
|
+
};
|
27
|
+
/**
|
28
|
+
* @zh 表单控件的尺寸
|
29
|
+
* @en The size of the form
|
30
|
+
* @values 'mini','small','medium','large'
|
31
|
+
* @defaultValue 'medium'
|
32
|
+
*/
|
33
|
+
size: {
|
34
|
+
type: PropType<Size>;
|
35
|
+
};
|
36
|
+
/**
|
37
|
+
* @zh 标签元素布局选项。参数同 `<col>` 组件一致
|
38
|
+
* @en Label element layout options. The parameters are the same as the `<col>` component
|
39
|
+
*/
|
40
|
+
labelColProps: {
|
41
|
+
type: ObjectConstructor;
|
42
|
+
default: () => {
|
43
|
+
span: number;
|
44
|
+
offset: number;
|
45
|
+
};
|
46
|
+
};
|
47
|
+
/**
|
48
|
+
* @zh 表单控件布局选项。参数同 `<col>` 组件一致
|
49
|
+
* @en Form control layout options. The parameters are the same as the `<col>` component
|
50
|
+
*/
|
51
|
+
wrapperColProps: {
|
52
|
+
type: ObjectConstructor;
|
53
|
+
default: () => {
|
54
|
+
span: number;
|
55
|
+
offset: number;
|
56
|
+
};
|
57
|
+
};
|
58
|
+
labelColStyle: ObjectConstructor;
|
59
|
+
wrapperColStyle: ObjectConstructor;
|
60
|
+
/**
|
61
|
+
* @zh 标签的对齐方向
|
62
|
+
* @en Alignment direction of the label
|
63
|
+
* @values 'left', 'right'
|
64
|
+
*/
|
65
|
+
labelAlign: {
|
66
|
+
type: PropType<FormLabelAlign>;
|
67
|
+
default: string;
|
68
|
+
};
|
69
|
+
/**
|
70
|
+
* @zh 是否禁用表单
|
71
|
+
* @en Whether to disable the form
|
72
|
+
*/
|
73
|
+
disabled: {
|
74
|
+
type: BooleanConstructor;
|
75
|
+
default: undefined;
|
76
|
+
};
|
77
|
+
/**
|
78
|
+
* @zh 表单项校验规则
|
79
|
+
* @en Form item validation rules
|
80
|
+
*/
|
81
|
+
rules: {
|
82
|
+
type: PropType<Record<string, FieldRule | FieldRule[]>>;
|
83
|
+
};
|
84
|
+
/**
|
85
|
+
* @zh 是否开启自动标签宽度,仅在 `layout="horizontal"` 下生效。
|
86
|
+
* @en Whether to enable automatic label width, it only takes effect under `layout="horizontal"`.
|
87
|
+
* @version 2.13.0
|
88
|
+
*/
|
89
|
+
autoLabelWidth: {
|
90
|
+
type: BooleanConstructor;
|
91
|
+
default: boolean;
|
92
|
+
};
|
93
|
+
/**
|
94
|
+
* @zh 表单控件 `id` 的前缀
|
95
|
+
*/
|
96
|
+
id: {
|
97
|
+
type: StringConstructor;
|
98
|
+
};
|
99
|
+
/**
|
100
|
+
* @zh 验证失败后滚动到第一个错误字段
|
101
|
+
* @en Scroll to the first error field after verification fails
|
102
|
+
* @version 2.51.0
|
103
|
+
*/
|
104
|
+
scrollToFirstError: {
|
105
|
+
type: BooleanConstructor;
|
106
|
+
default: boolean;
|
107
|
+
};
|
108
|
+
}>, {
|
109
|
+
cls: import('vue').ComputedRef<(string | {
|
110
|
+
[x: string]: boolean;
|
111
|
+
})[]>;
|
112
|
+
formRef: import('vue').Ref<HTMLFormElement | undefined, HTMLFormElement | undefined>;
|
113
|
+
handleSubmit: (e: Event) => void;
|
114
|
+
innerValidate: (callback?: (errors: undefined | Record<string, ValidatedError>) => void) => Promise<undefined | Record<string, ValidatedError>>;
|
115
|
+
innerValidateField: (field: string | string[], callback?: (errors: undefined | Record<string, ValidatedError>) => void) => Promise<Record<string, ValidatedError> | undefined>;
|
116
|
+
innerResetFields: (field?: string | string[]) => void;
|
117
|
+
innerClearValidate: (field?: string | string[]) => void;
|
118
|
+
innerSetFields: (data: Record<string, FieldData>) => void;
|
119
|
+
innerScrollToField: (field: string, options?: ScrollIntoViewOptions) => void;
|
120
|
+
}, {}, {}, {
|
121
|
+
/**
|
122
|
+
* @zh 校验全部表单数据
|
123
|
+
* @en Verify all form data
|
124
|
+
* @public
|
125
|
+
* @param {(errors: undefined | Record<string, ValidatedError>) => void} callback
|
126
|
+
* @returns {Promise<undefined | Record<string, ValidatedError>>}
|
127
|
+
*/
|
128
|
+
validate(callback?: (errors: undefined | Record<string, ValidatedError>) => void): Promise<undefined | Record<string, ValidatedError>>;
|
129
|
+
/**
|
130
|
+
* @zh 校验部分表单数据
|
131
|
+
* @en Validate part of the form data
|
132
|
+
* @public
|
133
|
+
* @param {string | string[]} field
|
134
|
+
* @param {(errors: undefined | Record<string, ValidatedError>) => void} callback
|
135
|
+
* @returns {Promise<undefined | Record<string, ValidatedError>>}
|
136
|
+
*/
|
137
|
+
validateField(field: string | string[], callback?: (errors: undefined | Record<string, ValidatedError>) => void): Promise<undefined | Record<string, ValidatedError>>;
|
138
|
+
/**
|
139
|
+
* @zh 重置表单数据
|
140
|
+
* @en Reset form data
|
141
|
+
* @public
|
142
|
+
* @param {string | string[]} field
|
143
|
+
*/
|
144
|
+
resetFields(field?: string | string[]): void;
|
145
|
+
/**
|
146
|
+
* @zh 清除校验状态
|
147
|
+
* @en Clear verification status
|
148
|
+
* @public
|
149
|
+
* @param {string | string[]} field
|
150
|
+
*/
|
151
|
+
clearValidate(field?: string | string[]): void;
|
152
|
+
/**
|
153
|
+
* @zh 设置表单项的值和状态
|
154
|
+
* @en Set the value and status of the form item
|
155
|
+
* @param {Record<string, FieldData>} data
|
156
|
+
* @public
|
157
|
+
*/
|
158
|
+
setFields(data: Record<string, FieldData>): void;
|
159
|
+
/**
|
160
|
+
* @zh 滚动到指定表单项
|
161
|
+
* @en Scroll to the specified form item
|
162
|
+
* @param {string} field
|
163
|
+
* @public
|
164
|
+
* @version 2.51.0
|
165
|
+
*/
|
166
|
+
scrollToField(field: string): void;
|
167
|
+
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
168
|
+
/**
|
169
|
+
* @zh 表单提交时触发
|
170
|
+
* @en Triggered when the form is submitted
|
171
|
+
* @param {{values: Record<string, any>; errors: Record<string, ValidatedError> | undefined}} data
|
172
|
+
* @param {Event} ev
|
173
|
+
*/
|
174
|
+
submit: (data: {
|
175
|
+
values: Record<string, any>;
|
176
|
+
errors: Record<string, ValidatedError> | undefined;
|
177
|
+
}, ev: Event) => true;
|
178
|
+
/**
|
179
|
+
* @zh 验证成功时触发
|
180
|
+
* @en Triggered when verification is successful
|
181
|
+
* @param {Record<string, any>} values
|
182
|
+
* @param {Event} ev
|
183
|
+
*/
|
184
|
+
submitSuccess: (values: Record<string, any>, ev: Event) => true;
|
185
|
+
/**
|
186
|
+
* @zh 验证失败时触发
|
187
|
+
* @en Triggered when verification failed
|
188
|
+
* @param {{values: Record<string, any>; errors: Record<string, ValidatedError>}} data
|
189
|
+
* @param {Event} ev
|
190
|
+
*/
|
191
|
+
submitFailed: (data: {
|
192
|
+
values: Record<string, any>;
|
193
|
+
errors: Record<string, ValidatedError>;
|
194
|
+
}, ev: Event) => true;
|
195
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
196
|
+
/**
|
197
|
+
* @zh 表单数据对象
|
198
|
+
* @en Form data object
|
199
|
+
*/
|
200
|
+
model: {
|
201
|
+
type: ObjectConstructor;
|
202
|
+
required: true;
|
203
|
+
};
|
204
|
+
/**
|
205
|
+
* @zh 表单的布局方式,包括水平、垂直、多列
|
206
|
+
* @en The layout of the form, including horizontal, vertical, and multi-column
|
207
|
+
* @values 'horizontal', 'vertical', 'inline'
|
208
|
+
*/
|
209
|
+
layout: {
|
210
|
+
type: PropType<FormLayout>;
|
211
|
+
default: string;
|
212
|
+
};
|
213
|
+
/**
|
214
|
+
* @zh 表单控件的尺寸
|
215
|
+
* @en The size of the form
|
216
|
+
* @values 'mini','small','medium','large'
|
217
|
+
* @defaultValue 'medium'
|
218
|
+
*/
|
219
|
+
size: {
|
220
|
+
type: PropType<Size>;
|
221
|
+
};
|
222
|
+
/**
|
223
|
+
* @zh 标签元素布局选项。参数同 `<col>` 组件一致
|
224
|
+
* @en Label element layout options. The parameters are the same as the `<col>` component
|
225
|
+
*/
|
226
|
+
labelColProps: {
|
227
|
+
type: ObjectConstructor;
|
228
|
+
default: () => {
|
229
|
+
span: number;
|
230
|
+
offset: number;
|
231
|
+
};
|
232
|
+
};
|
233
|
+
/**
|
234
|
+
* @zh 表单控件布局选项。参数同 `<col>` 组件一致
|
235
|
+
* @en Form control layout options. The parameters are the same as the `<col>` component
|
236
|
+
*/
|
237
|
+
wrapperColProps: {
|
238
|
+
type: ObjectConstructor;
|
239
|
+
default: () => {
|
240
|
+
span: number;
|
241
|
+
offset: number;
|
242
|
+
};
|
243
|
+
};
|
244
|
+
labelColStyle: ObjectConstructor;
|
245
|
+
wrapperColStyle: ObjectConstructor;
|
246
|
+
/**
|
247
|
+
* @zh 标签的对齐方向
|
248
|
+
* @en Alignment direction of the label
|
249
|
+
* @values 'left', 'right'
|
250
|
+
*/
|
251
|
+
labelAlign: {
|
252
|
+
type: PropType<FormLabelAlign>;
|
253
|
+
default: string;
|
254
|
+
};
|
255
|
+
/**
|
256
|
+
* @zh 是否禁用表单
|
257
|
+
* @en Whether to disable the form
|
258
|
+
*/
|
259
|
+
disabled: {
|
260
|
+
type: BooleanConstructor;
|
261
|
+
default: undefined;
|
262
|
+
};
|
263
|
+
/**
|
264
|
+
* @zh 表单项校验规则
|
265
|
+
* @en Form item validation rules
|
266
|
+
*/
|
267
|
+
rules: {
|
268
|
+
type: PropType<Record<string, FieldRule | FieldRule[]>>;
|
269
|
+
};
|
270
|
+
/**
|
271
|
+
* @zh 是否开启自动标签宽度,仅在 `layout="horizontal"` 下生效。
|
272
|
+
* @en Whether to enable automatic label width, it only takes effect under `layout="horizontal"`.
|
273
|
+
* @version 2.13.0
|
274
|
+
*/
|
275
|
+
autoLabelWidth: {
|
276
|
+
type: BooleanConstructor;
|
277
|
+
default: boolean;
|
278
|
+
};
|
279
|
+
/**
|
280
|
+
* @zh 表单控件 `id` 的前缀
|
281
|
+
*/
|
282
|
+
id: {
|
283
|
+
type: StringConstructor;
|
284
|
+
};
|
285
|
+
/**
|
286
|
+
* @zh 验证失败后滚动到第一个错误字段
|
287
|
+
* @en Scroll to the first error field after verification fails
|
288
|
+
* @version 2.51.0
|
289
|
+
*/
|
290
|
+
scrollToFirstError: {
|
291
|
+
type: BooleanConstructor;
|
292
|
+
default: boolean;
|
293
|
+
};
|
294
|
+
}>> & Readonly<{
|
295
|
+
onSubmit?: ((data: {
|
296
|
+
values: Record<string, any>;
|
297
|
+
errors: Record<string, ValidatedError> | undefined;
|
298
|
+
}, ev: Event) => any) | undefined;
|
299
|
+
onSubmitSuccess?: ((values: Record<string, any>, ev: Event) => any) | undefined;
|
300
|
+
onSubmitFailed?: ((data: {
|
301
|
+
values: Record<string, any>;
|
302
|
+
errors: Record<string, ValidatedError>;
|
303
|
+
}, ev: Event) => any) | undefined;
|
304
|
+
}>, {
|
305
|
+
disabled: boolean;
|
306
|
+
layout: "horizontal" | "vertical" | "inline";
|
307
|
+
labelColProps: Record<string, any>;
|
308
|
+
wrapperColProps: Record<string, any>;
|
309
|
+
labelAlign: "left" | "right";
|
310
|
+
autoLabelWidth: boolean;
|
311
|
+
scrollToFirstError: boolean;
|
312
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
313
|
+
export default _default;
|