@qin-ui/antdv-next-pro 1.1.14 → 1.2.0
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/AI-CONTEXT.md +281 -23
- package/LICENSE +9 -0
- package/README.md +75 -58
- package/api.json +70 -28
- package/bin/init-ai.mjs +404 -49
- package/es/antdv-next-pro.css +9 -9
- package/es/component-provider/{index-Daiw7IxY.js → index-Tesc9NuK.js} +2 -1
- package/es/component-provider/index-Tesc9NuK.js.map +1 -0
- package/es/component-provider/index.js +2 -1
- package/es/component-provider/index.js.map +1 -0
- package/es/components/component-provider/components/index.vue.d.ts +27 -0
- package/es/components/component-provider/components/index.vue.d.ts.map +1 -0
- package/es/components/component-provider/constants/index.d.ts +16 -0
- package/es/components/component-provider/constants/index.d.ts.map +1 -0
- package/es/components/component-provider/index.d.ts +4 -0
- package/es/components/component-provider/index.d.ts.map +1 -0
- package/es/components/component-provider/types/index.d.ts +26 -0
- package/es/components/component-provider/types/index.d.ts.map +1 -0
- package/es/components/form/components/BaseField/index.vue.d.ts +13 -0
- package/es/components/form/components/BaseField/index.vue.d.ts.map +1 -0
- package/es/components/form/components/BaseField/utils/index.d.ts +3 -0
- package/es/components/form/components/BaseField/utils/index.d.ts.map +1 -0
- package/es/components/form/components/BaseFormItem/index.vue.d.ts +9 -0
- package/es/components/form/components/BaseFormItem/index.vue.d.ts.map +1 -0
- package/es/components/form/components/ContainerFragment/index.vue.d.ts +23 -0
- package/es/components/form/components/ContainerFragment/index.vue.d.ts.map +1 -0
- package/es/components/form/components/GroupedFieldAttrs/index.vue.d.ts +31 -0
- package/es/components/form/components/GroupedFieldAttrs/index.vue.d.ts.map +1 -0
- package/es/components/form/components/PathProvider/index.vue.d.ts +24 -0
- package/es/components/form/components/PathProvider/index.vue.d.ts.map +1 -0
- package/es/components/form/components/ProForm/index.vue.d.ts +36 -0
- package/es/components/form/components/ProForm/index.vue.d.ts.map +1 -0
- package/es/components/form/components/SlotComponent/index.vue.d.ts +7 -0
- package/es/components/form/components/SlotComponent/index.vue.d.ts.map +1 -0
- package/es/components/form/components/index.d.ts +12 -0
- package/es/components/form/components/index.d.ts.map +1 -0
- package/es/components/form/constants/index.d.ts +81 -0
- package/es/components/form/constants/index.d.ts.map +1 -0
- package/es/components/form/hooks/index.d.ts +5 -0
- package/es/components/form/hooks/index.d.ts.map +1 -0
- package/es/components/form/hooks/useFields.d.ts +57 -0
- package/es/components/form/hooks/useFields.d.ts.map +1 -0
- package/es/components/form/hooks/useForm.d.ts +93 -0
- package/es/components/form/hooks/useForm.d.ts.map +1 -0
- package/es/components/form/hooks/useFormRef.d.ts +30 -0
- package/es/components/form/hooks/useFormRef.d.ts.map +1 -0
- package/es/components/form/index.d.ts +7 -0
- package/es/components/form/index.d.ts.map +1 -0
- package/es/components/form/types/index.d.ts +251 -0
- package/es/components/form/types/index.d.ts.map +1 -0
- package/es/components/table/components/ColumnControl.vue.d.ts +9 -0
- package/es/components/table/components/ColumnControl.vue.d.ts.map +1 -0
- package/es/components/table/components/DefaultSearchFormContainer.vue.d.ts +18 -0
- package/es/components/table/components/DefaultSearchFormContainer.vue.d.ts.map +1 -0
- package/es/components/table/components/DefaultTableContainer.vue.d.ts +18 -0
- package/es/components/table/components/DefaultTableContainer.vue.d.ts.map +1 -0
- package/es/components/table/components/ProTable.vue.d.ts +118 -0
- package/es/components/table/components/ProTable.vue.d.ts.map +1 -0
- package/es/components/table/components/SearchForm.vue.d.ts +48 -0
- package/es/components/table/components/SearchForm.vue.d.ts.map +1 -0
- package/es/components/table/components/SizeControl.vue.d.ts +12 -0
- package/es/components/table/components/SizeControl.vue.d.ts.map +1 -0
- package/es/components/table/components/icons/ColumnHeightOutlined.vue.d.ts +3 -0
- package/es/components/table/components/icons/ColumnHeightOutlined.vue.d.ts.map +1 -0
- package/es/components/table/components/icons/DownOutlined.vue.d.ts +3 -0
- package/es/components/table/components/icons/DownOutlined.vue.d.ts.map +1 -0
- package/es/components/table/components/icons/FilterOutlined.vue.d.ts +3 -0
- package/es/components/table/components/icons/FilterOutlined.vue.d.ts.map +1 -0
- package/es/components/table/components/index.d.ts +5 -0
- package/es/components/table/components/index.d.ts.map +1 -0
- package/es/components/table/index.d.ts +8 -0
- package/es/components/table/index.d.ts.map +1 -0
- package/es/components/table/types/index.d.ts +48 -0
- package/es/components/table/types/index.d.ts.map +1 -0
- package/es/components/table/useTable.d.ts +111 -0
- package/es/components/table/useTable.d.ts.map +1 -0
- package/es/form/{index-7clzY8ZD.js → index-CcP5OaUd.js} +12 -6
- package/es/form/index-CcP5OaUd.js.map +1 -0
- package/es/form/index.js +4 -3
- package/es/form/index.js.map +1 -0
- package/es/index.d.ts +76 -1522
- package/es/index.d.ts.map +1 -0
- package/es/index.js +14 -23
- package/es/index.js.map +1 -0
- package/es/shared/core/index.d.ts +6 -0
- package/es/shared/core/index.d.ts.map +1 -0
- package/es/shared/ui/index.d.ts +9 -0
- package/es/shared/ui/index.d.ts.map +1 -0
- package/es/table/index.js +11 -9
- package/es/table/index.js.map +1 -0
- package/package.json +10 -11
- package/src/components/component-provider/components/index.vue +67 -0
- package/src/components/component-provider/constants/index.ts +177 -0
- package/src/components/component-provider/index.ts +6 -0
- package/src/components/component-provider/types/index.ts +59 -0
- package/src/components/form/components/BaseField/index.vue +181 -0
- package/src/components/form/components/BaseField/utils/index.ts +16 -0
- package/src/components/form/components/BaseFormItem/index.vue +158 -0
- package/src/components/form/components/ContainerFragment/index.vue +24 -0
- package/src/components/form/components/GroupedFieldAttrs/index.vue +119 -0
- package/src/components/form/components/PathProvider/index.vue +19 -0
- package/src/components/form/components/ProForm/index.vue +104 -0
- package/src/components/form/components/SlotComponent/index.vue +26 -0
- package/src/components/form/components/index.ts +15 -0
- package/src/components/form/constants/index.ts +140 -0
- package/src/components/form/hooks/index.ts +5 -0
- package/src/components/form/hooks/useFields.ts +67 -0
- package/src/components/form/hooks/useForm.ts +110 -0
- package/src/components/form/hooks/useFormRef.ts +35 -0
- package/src/components/form/index.ts +29 -0
- package/src/components/form/types/index.ts +317 -0
- package/src/components/table/components/ColumnControl.vue +142 -0
- package/src/components/table/components/DefaultSearchFormContainer.vue +22 -0
- package/src/components/table/components/DefaultTableContainer.vue +19 -0
- package/src/components/table/components/ProTable.vue +372 -0
- package/src/components/table/components/SearchForm.vue +296 -0
- package/src/components/table/components/SizeControl.vue +54 -0
- package/src/components/table/components/icons/ColumnHeightOutlined.vue +4 -0
- package/src/components/table/components/icons/DownOutlined.vue +4 -0
- package/src/components/table/components/icons/FilterOutlined.vue +4 -0
- package/src/components/table/components/index.ts +4 -0
- package/src/components/table/index.ts +14 -0
- package/src/components/table/types/index.ts +52 -0
- package/src/components/table/useTable.ts +129 -0
- package/src/index.ts +81 -0
- package/src/shared/core/index.ts +37 -0
- package/src/shared/ui/index.ts +55 -0
- package/es/core/index-ghYuQ3Sy.js +0 -360
- package/es/vendor/utils/lodash-es-p6jau26B.js +0 -1120
package/es/index.d.ts
CHANGED
|
@@ -1,1522 +1,76 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
import {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
import {
|
|
68
|
-
import
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
declare type __VLS_PrettifyLocal_2<T> = {
|
|
78
|
-
[K in keyof T]: T[K];
|
|
79
|
-
} & {};
|
|
80
|
-
|
|
81
|
-
declare function __VLS_template(): {
|
|
82
|
-
attrs: Partial<{}>;
|
|
83
|
-
slots: {
|
|
84
|
-
default?(_: {}): any;
|
|
85
|
-
default?(_: {}): any;
|
|
86
|
-
};
|
|
87
|
-
refs: {};
|
|
88
|
-
rootEl: any;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
92
|
-
|
|
93
|
-
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
94
|
-
new (): {
|
|
95
|
-
$slots: S;
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* FormItem 实例提供的额外方法
|
|
101
|
-
* @template FormItemInstance - FormItem 组件实例类型
|
|
102
|
-
*/
|
|
103
|
-
declare type AdditionalMethods<FormItemInstance> = {
|
|
104
|
-
/**
|
|
105
|
-
* @description 获取 FormItem 实例的方法
|
|
106
|
-
*/
|
|
107
|
-
getFormItemRef?: () => FormItemInstance;
|
|
108
|
-
/**
|
|
109
|
-
* @description 获取传入 FormItem 组件的属性
|
|
110
|
-
*/
|
|
111
|
-
getFormItemComputedProps?: () => Readonly<{
|
|
112
|
-
[x: string]: any;
|
|
113
|
-
}>;
|
|
114
|
-
/**
|
|
115
|
-
* @description 获取组件实例的方法
|
|
116
|
-
*/
|
|
117
|
-
getComponentRef?: () => any;
|
|
118
|
-
/**
|
|
119
|
-
* @description 获取传入 Component 组件的属性
|
|
120
|
-
*/
|
|
121
|
-
getComponentComputedProps?: () => Readonly<{
|
|
122
|
-
disabled?: boolean;
|
|
123
|
-
[x: string]: any;
|
|
124
|
-
}>;
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
declare type AllowStringKey<T, Prefix extends string = ''> = {
|
|
128
|
-
[K in keyof T as string extends K ? never : number extends K ? never : K extends string ? K : never]: T[K] extends (infer U)[] ? `${Prefix}${K & string}` | (IsRecord<U> extends true ? AllowStringKey<U, `${Prefix}${K & string}[index].`> : never) : IsRecord<T[K]> extends true ? `${Prefix}${K & string}` | AllowStringKey<T[K], `${Prefix}${K & string}.`> : `${Prefix}${K & string}`;
|
|
129
|
-
} extends infer Obj ? Obj[keyof Obj] : never;
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* @type {Object} Base - 基础公共字段类型
|
|
133
|
-
*/
|
|
134
|
-
declare type Base<D extends Data = Data> = BaseWithFields<D> | BaseWithoutFields<D>;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* 基础表格列配置接口
|
|
138
|
-
* @template D - 表格数据类型,应为一个对象类型
|
|
139
|
-
*
|
|
140
|
-
* @example
|
|
141
|
-
* ```ts
|
|
142
|
-
* interface User { name: string; age: number; address: { city: string } }
|
|
143
|
-
*
|
|
144
|
-
* // 简单列
|
|
145
|
-
* const column: BaseColumn<User> = {
|
|
146
|
-
* key: 'name',
|
|
147
|
-
* title: '姓名',
|
|
148
|
-
* }
|
|
149
|
-
*
|
|
150
|
-
* // 带数据索引和嵌套列
|
|
151
|
-
* const column: BaseColumn<User> = {
|
|
152
|
-
* key: 'address',
|
|
153
|
-
* title: '地址',
|
|
154
|
-
* children: [
|
|
155
|
-
* { key: 'city', title: '城市' },
|
|
156
|
-
* ],
|
|
157
|
-
* }
|
|
158
|
-
* ```
|
|
159
|
-
*/
|
|
160
|
-
declare interface BaseColumn<D extends Data = Data> {
|
|
161
|
-
/**
|
|
162
|
-
* @description 列字段路径(数据对象的 key 路径),支持点号分隔的深层路径
|
|
163
|
-
* @example 'name' | 'address.city'
|
|
164
|
-
*/
|
|
165
|
-
key?: Path<D>;
|
|
166
|
-
/**
|
|
167
|
-
* @description 数据索引,与 key 作用类似,支持数组格式
|
|
168
|
-
* @example 'name' | ['address', 'city']
|
|
169
|
-
*/
|
|
170
|
-
dataIndex?: Path<D> | Path<D>[];
|
|
171
|
-
/**
|
|
172
|
-
* @description 嵌套子列配置,用于实现表头分组
|
|
173
|
-
* @example [{ key: 'firstName', title: '名' }, { key: 'lastName', title: '姓' }]
|
|
174
|
-
*/
|
|
175
|
-
children?: BaseColumn<D>[];
|
|
176
|
-
/** 其他任意自定义属性(如 title、width、fixed 等 UI 属性) */
|
|
177
|
-
[key: string]: any;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
declare type BaseCommon<D extends Data = Data> = {
|
|
181
|
-
/**
|
|
182
|
-
* @description 字段标识namePath, 同name
|
|
183
|
-
* @example 'name' | 'age' | 'sex' | ...
|
|
184
|
-
*/
|
|
185
|
-
path?: Path<D>;
|
|
186
|
-
/**
|
|
187
|
-
* @description 字段是否隐藏
|
|
188
|
-
*/
|
|
189
|
-
hidden?: boolean;
|
|
190
|
-
/**
|
|
191
|
-
* @description 字段是否禁用
|
|
192
|
-
*/
|
|
193
|
-
disabled?: boolean;
|
|
194
|
-
/**
|
|
195
|
-
* @description 字段中文名称,支持字符串或组件
|
|
196
|
-
* @example '姓名' | '年龄' | '性别' | () => h('span', '自定义标签')
|
|
197
|
-
*/
|
|
198
|
-
label?: SlotComponentType;
|
|
199
|
-
/**
|
|
200
|
-
* @description 字段插槽配置,可包含formItem插槽和component插槽
|
|
201
|
-
* @example
|
|
202
|
-
* ```js
|
|
203
|
-
* slots: {
|
|
204
|
-
* label: () => h('div', { style: { fontSize: '12px' } }, '年龄'),
|
|
205
|
-
* addonAfter: '岁',
|
|
206
|
-
* suffix: () => h('span', '元')
|
|
207
|
-
* }
|
|
208
|
-
* ```
|
|
209
|
-
*/
|
|
210
|
-
slots?: Partial<ComponentSlots<typeof FormItem>>;
|
|
211
|
-
/**
|
|
212
|
-
* @description 字段formItem样式属性
|
|
213
|
-
* @example { marginBottom: '8px', padding: '12px' }
|
|
214
|
-
*/
|
|
215
|
-
formItemStyle?: CSSProperties;
|
|
216
|
-
/**
|
|
217
|
-
* @description 字段formItem样式类名
|
|
218
|
-
* @example 'custom-form-item' | 'required-field'
|
|
219
|
-
*/
|
|
220
|
-
formItemClass?: string;
|
|
221
|
-
/**
|
|
222
|
-
* @description 字段formItem容器包裹组件
|
|
223
|
-
* @example (props, ctx) => h('div', { class: 'custom-container' }, ctx.slots.default?.())
|
|
224
|
-
*/
|
|
225
|
-
formItemContainer?: ContainerComponent;
|
|
226
|
-
/**
|
|
227
|
-
* @description 将属性附加到 FormItem 的 DOM 节点
|
|
228
|
-
* @example { 'data-form-item-test': 'test-value', 'aria-label': 'name' }
|
|
229
|
-
*/
|
|
230
|
-
formItemDataAttrs?: Record<string, string>;
|
|
231
|
-
/**
|
|
232
|
-
* @description 额外的自定义属性,不会被当作组件参数,仅用做给字段添加标识属性等功能
|
|
233
|
-
* @example { group: 'group-1' }
|
|
234
|
-
*/
|
|
235
|
-
extraProps?: Record<string, any>;
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* 内置组件映射表
|
|
240
|
-
* @description antdv-next 内置支持的组件类型映射
|
|
241
|
-
*/
|
|
242
|
-
declare type BaseComponentMap = {
|
|
243
|
-
'input': typeof Input;
|
|
244
|
-
'textarea': typeof TextArea;
|
|
245
|
-
'input-search': typeof InputSearch;
|
|
246
|
-
'input-password': typeof InputPassword;
|
|
247
|
-
'input-number': typeof InputNumber;
|
|
248
|
-
'input-otp': typeof InputOTP;
|
|
249
|
-
'auto-complete': typeof AutoComplete;
|
|
250
|
-
'select': typeof Select;
|
|
251
|
-
'cascader': typeof Cascader;
|
|
252
|
-
'date-picker': typeof DatePicker;
|
|
253
|
-
'range-picker': typeof DateRangePicker;
|
|
254
|
-
'time-picker': typeof TimePicker;
|
|
255
|
-
'time-range-picker': typeof TimeRangePicker;
|
|
256
|
-
'checkbox-group': typeof CheckboxGroup;
|
|
257
|
-
'radio-group': typeof RadioGroup;
|
|
258
|
-
'switch': typeof Switch;
|
|
259
|
-
'slider': typeof Slider;
|
|
260
|
-
'tree-select': typeof TreeSelect;
|
|
261
|
-
'transfer': typeof Transfer;
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* 基础字段配置接口
|
|
266
|
-
* @template D - 表单数据类型,应为一个对象类型
|
|
267
|
-
*
|
|
268
|
-
* @example
|
|
269
|
-
* ```ts
|
|
270
|
-
* // 简单的文本输入字段
|
|
271
|
-
* const field: BaseField<{ name: string }> = {
|
|
272
|
-
* path: 'name',
|
|
273
|
-
* label: '姓名',
|
|
274
|
-
* }
|
|
275
|
-
*
|
|
276
|
-
* // 带嵌套子字段
|
|
277
|
-
* const field: BaseField<{ address: { city: string; street: string } }> = {
|
|
278
|
-
* path: 'address',
|
|
279
|
-
* label: '地址',
|
|
280
|
-
* fields: [
|
|
281
|
-
* { path: 'city', label: '城市' },
|
|
282
|
-
* { path: 'street', label: '街道' },
|
|
283
|
-
* ],
|
|
284
|
-
* }
|
|
285
|
-
* ```
|
|
286
|
-
*/
|
|
287
|
-
declare interface BaseField<D extends Data = Data> {
|
|
288
|
-
/**
|
|
289
|
-
* @description 字段路径(数据对象的 key 路径),支持点号分隔的深层路径
|
|
290
|
-
* @example 'name' | 'user.address.city'
|
|
291
|
-
*/
|
|
292
|
-
path?: Path<D> | any;
|
|
293
|
-
/**
|
|
294
|
-
* @description 字段名称,与 path 作用相同,两者选其一即可
|
|
295
|
-
* @deprecated 推荐使用 path 替代
|
|
296
|
-
*/
|
|
297
|
-
name?: any;
|
|
298
|
-
/**
|
|
299
|
-
* @description 嵌套子字段配置数组,用于实现分组/嵌套字段
|
|
300
|
-
* @example [{ path: 'firstName', label: '名' }, { path: 'lastName', label: '姓' }]
|
|
301
|
-
*/
|
|
302
|
-
fields?: any[];
|
|
303
|
-
/** 其他任意自定义属性 */
|
|
304
|
-
[key: string]: any;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
declare type BaseWithFields<D extends Data = Data> = BaseCommon<D> & {
|
|
308
|
-
/**
|
|
309
|
-
* @description 嵌套子字段配置
|
|
310
|
-
* @example [{ key: 'firstName', label: '名' }, { key: 'lastName', label: '姓' }]
|
|
311
|
-
*/
|
|
312
|
-
fields: Fields<D>;
|
|
313
|
-
/**
|
|
314
|
-
* @description 网格布局属性,true表示使用默认网格布局,针对具有嵌套字段的字段
|
|
315
|
-
* @example boolean | { gutter: 24 }
|
|
316
|
-
*/
|
|
317
|
-
grid?: Grid;
|
|
318
|
-
component?: never;
|
|
319
|
-
/**
|
|
320
|
-
* @description 字段component样式属性
|
|
321
|
-
* @example { width: '100%', borderColor: '#d9d9d9' }
|
|
322
|
-
*/
|
|
323
|
-
componentStyle?: never;
|
|
324
|
-
/**
|
|
325
|
-
* @description 字段component样式类名
|
|
326
|
-
* @example 'custom-input' | 'error-input'
|
|
327
|
-
*/
|
|
328
|
-
componentClass?: never;
|
|
329
|
-
/**
|
|
330
|
-
* @description 字段component容器包裹组件
|
|
331
|
-
* @example (props, ctx) => h('div', { class: 'input-wrapper' }, ctx.slots.default?.())
|
|
332
|
-
*/
|
|
333
|
-
componentContainer?: never;
|
|
334
|
-
/**
|
|
335
|
-
* @description 将属性附加到表单组件的 DOM 节点
|
|
336
|
-
* @example { 'data-test': 'input-value', 'aria-label': 'name' }
|
|
337
|
-
*/
|
|
338
|
-
componentDataAttrs?: never;
|
|
339
|
-
/**
|
|
340
|
-
* @description 字段值处理函数,在onUpdateValue前执行,函数返回值将作为更新值,也可设置get和set函数,用于处理字段值
|
|
341
|
-
* @example (val) => val?.trim()
|
|
342
|
-
*/
|
|
343
|
-
valueFormatter?: never;
|
|
344
|
-
/**
|
|
345
|
-
* @description 组件v-model双向绑定更新属性名,默认'value'
|
|
346
|
-
*/
|
|
347
|
-
modelProp?: never;
|
|
348
|
-
};
|
|
349
|
-
|
|
350
|
-
declare type BaseWithoutFields<D extends Data = Data> = BaseCommon<D> & {
|
|
351
|
-
fields?: undefined;
|
|
352
|
-
grid?: never;
|
|
353
|
-
/**
|
|
354
|
-
* @description 字段component样式属性
|
|
355
|
-
* @example { width: '100%', borderColor: '#d9d9d9' }
|
|
356
|
-
*/
|
|
357
|
-
componentStyle?: CSSProperties;
|
|
358
|
-
/**
|
|
359
|
-
* @description 字段component样式类名
|
|
360
|
-
* @example 'custom-input' | 'error-input'
|
|
361
|
-
*/
|
|
362
|
-
componentClass?: string;
|
|
363
|
-
/**
|
|
364
|
-
* @description 字段component容器包裹组件
|
|
365
|
-
* @example (props, ctx) => h('div', { class: 'input-wrapper' }, ctx.slots.default?.())
|
|
366
|
-
*/
|
|
367
|
-
componentContainer?: ContainerComponent;
|
|
368
|
-
/**
|
|
369
|
-
* @description 将属性附加到表单组件的 DOM 节点
|
|
370
|
-
* @example { 'data-test': 'input-value', 'aria-label': 'name' }
|
|
371
|
-
*/
|
|
372
|
-
componentDataAttrs?: Record<string, string>;
|
|
373
|
-
/**
|
|
374
|
-
* @description 字段值处理函数,在onUpdateValue前执行,函数返回值将作为更新值,也可设置get和set函数,用于处理字段值
|
|
375
|
-
* @example (val) => val?.trim()
|
|
376
|
-
*/
|
|
377
|
-
valueFormatter?: ValueFormatter;
|
|
378
|
-
/**
|
|
379
|
-
* @description 组件v-model双向绑定更新属性名,默认'value'
|
|
380
|
-
*/
|
|
381
|
-
modelProp?: string;
|
|
382
|
-
};
|
|
383
|
-
|
|
384
|
-
declare type ButtonProps = {
|
|
385
|
-
onClick: () => void;
|
|
386
|
-
};
|
|
387
|
-
|
|
388
|
-
/**
|
|
389
|
-
* @qin-ui/antdv-next-pro 表格列配置类型
|
|
390
|
-
*
|
|
391
|
-
* @description 继承 antdv-next 的 ColumnType 列类型,并添加:
|
|
392
|
-
* - 类型安全的 dataIndex(基于泛型 D 推导路径),优先使用
|
|
393
|
-
* - key 作为辅助标识
|
|
394
|
-
* - hidden 属性用于控制列显隐
|
|
395
|
-
*
|
|
396
|
-
* @template D - 表格行数据类型
|
|
397
|
-
*
|
|
398
|
-
* @example
|
|
399
|
-
* ```ts
|
|
400
|
-
* interface User { name: string; age: number }
|
|
401
|
-
*
|
|
402
|
-
* const columns: Columns<User> = [
|
|
403
|
-
* { dataIndex: 'name', title: '姓名', width: 120 },
|
|
404
|
-
* { dataIndex: 'age', title: '年龄', width: 80 },
|
|
405
|
-
* ]
|
|
406
|
-
* ```
|
|
407
|
-
|
|
408
|
-
* @public
|
|
409
|
-
*/
|
|
410
|
-
export declare type Column<D extends Data = Data> = Omit<TableColumnType, 'dataIndex' | 'key'> & {
|
|
411
|
-
/**
|
|
412
|
-
* @description 列数据路径(主要字段),优先使用 dataIndex 进行字段匹配
|
|
413
|
-
* @example 'name' | 'address.city' | ['address', 'city']
|
|
414
|
-
*/
|
|
415
|
-
dataIndex?: KeyExpandString<Extract<keyof D, string>> | Paths<D>;
|
|
416
|
-
/**
|
|
417
|
-
* @description 列字段标识(辅助字段),当 dataIndex 不满足需求时使用
|
|
418
|
-
*/
|
|
419
|
-
key?: Path<D>;
|
|
420
|
-
/**
|
|
421
|
-
* @description 是否隐藏该列
|
|
422
|
-
* @default false
|
|
423
|
-
*/
|
|
424
|
-
hidden?: boolean;
|
|
425
|
-
};
|
|
426
|
-
|
|
427
|
-
/**
|
|
428
|
-
* 列查找函数类型,通过自定义函数匹配列
|
|
429
|
-
* @template D - 表格数据类型
|
|
430
|
-
* @template C - 列配置类型
|
|
431
|
-
*
|
|
432
|
-
* @example
|
|
433
|
-
* ```ts
|
|
434
|
-
* // 查找 title 为 '姓名' 的列
|
|
435
|
-
* const findBy: ColumnFindBy<MyData> = (column) => column.title === '姓名'
|
|
436
|
-
*
|
|
437
|
-
* // 查找所有宽度小于 100 的列
|
|
438
|
-
* const findBy: ColumnFindBy<MyData> = (column) => column.width && column.width < 100
|
|
439
|
-
* ```
|
|
440
|
-
*/
|
|
441
|
-
declare type ColumnFindBy<D extends Data, C extends BaseColumn<D> = BaseColumn<D>> = (column: Readonly<C>) => boolean;
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
* @qin-ui/antdv-next-pro 表格列配置数组类型
|
|
445
|
-
* @template D - 表格行数据类型
|
|
446
|
-
|
|
447
|
-
* @public
|
|
448
|
-
*/
|
|
449
|
-
export declare type Columns<D extends Data = Data> = Array<Column<D>>;
|
|
450
|
-
|
|
451
|
-
/**
|
|
452
|
-
* 列配置数组类型
|
|
453
|
-
* @template D - 表格数据类型
|
|
454
|
-
* @template C - 列配置类型
|
|
455
|
-
*/
|
|
456
|
-
declare type Columns_2<D extends Data = Data, C extends BaseColumn<D> = BaseColumn<D>> = Array<C>;
|
|
457
|
-
|
|
458
|
-
/**
|
|
459
|
-
* 组件映射扩展接口
|
|
460
|
-
* @description 暴露给外部扩充自定义组件类型的接口。
|
|
461
|
-
* 用户可通过 TypeScript 的声明合并(module augmentation)添加自定义组件。
|
|
462
|
-
*
|
|
463
|
-
* @example
|
|
464
|
-
* ```ts
|
|
465
|
-
* // 在项目中任意 .d.ts 文件中
|
|
466
|
-
* declare module '@qin-ui/antdv-next-pro' {
|
|
467
|
-
* interface ComponentMap {
|
|
468
|
-
* 'my-custom-input': typeof MyCustomInput;
|
|
469
|
-
* }
|
|
470
|
-
* }
|
|
471
|
-
* ```
|
|
472
|
-
|
|
473
|
-
* @public
|
|
474
|
-
*/
|
|
475
|
-
export declare interface ComponentMap {
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
/**
|
|
479
|
-
* 组件名称联合类型
|
|
480
|
-
* @description 所有支持的组件名称
|
|
481
|
-
|
|
482
|
-
* @public
|
|
483
|
-
*/
|
|
484
|
-
export declare type ComponentName = keyof BaseComponentMap | keyof ComponentMap | 'custom';
|
|
485
|
-
|
|
486
|
-
export declare type ComponentVars = Partial<RequiredComponentVars>;
|
|
487
|
-
|
|
488
|
-
/**
|
|
489
|
-
* @description 容器组件类型
|
|
490
|
-
*/
|
|
491
|
-
declare type ContainerComponent = Component<PathProps>;
|
|
492
|
-
|
|
493
|
-
export declare const ContainerFragment: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
494
|
-
|
|
495
|
-
/**
|
|
496
|
-
* 基础数据类型,表示任意对象
|
|
497
|
-
* @description 所有表单数据对象和表格数据对象的基础类型
|
|
498
|
-
*/
|
|
499
|
-
declare type Data = Record<string, any>;
|
|
500
|
-
|
|
501
|
-
/**
|
|
502
|
-
* 递归地将对象的所有属性变为可选
|
|
503
|
-
* @template T - 原始类型
|
|
504
|
-
*
|
|
505
|
-
* @example
|
|
506
|
-
* ```ts
|
|
507
|
-
* type T = DeepPartial<{ name: string; address: { city: string } }>
|
|
508
|
-
* // { name?: string; address?: { city?: string } }
|
|
509
|
-
* ```
|
|
510
|
-
*/
|
|
511
|
-
declare type DeepPartial<T> = T extends object ? {
|
|
512
|
-
[P in keyof T]?: DeepPartial<T[P]>;
|
|
513
|
-
} : T;
|
|
514
|
-
|
|
515
|
-
declare const _default: {
|
|
516
|
-
/**
|
|
517
|
-
* @qin-ui/antdv-next-pro 安装方法
|
|
518
|
-
* @description 全局注册所有组件(ProForm、ProTable、ProComponentProvider)
|
|
519
|
-
*
|
|
520
|
-
* @param {App} app - Vue 应用实例
|
|
521
|
-
*
|
|
522
|
-
* @example
|
|
523
|
-
* ```ts
|
|
524
|
-
* import { createApp } from 'vue'
|
|
525
|
-
* import QinUI from '@qin-ui/antdv-next-pro'
|
|
526
|
-
* const app = createApp(App)
|
|
527
|
-
* app.use(QinUI)
|
|
528
|
-
* ```
|
|
529
|
-
*/
|
|
530
|
-
install(app: App): void;
|
|
531
|
-
};
|
|
532
|
-
export default _default;
|
|
533
|
-
|
|
534
|
-
declare const _default_2: <T extends Table<any> = Table>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
535
|
-
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
536
|
-
readonly "onUpdate:size"?: ((value: ButtonSize) => any) | undefined;
|
|
537
|
-
readonly "onUpdate:loading"?: ((value: boolean) => any) | undefined;
|
|
538
|
-
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, "onUpdate:size" | "onUpdate:loading"> & ({
|
|
539
|
-
size?: TableProps["size"];
|
|
540
|
-
loading?: boolean;
|
|
541
|
-
} & {
|
|
542
|
-
table?: T;
|
|
543
|
-
search?: () => Promise<unknown>;
|
|
544
|
-
addIndexColumn?: boolean;
|
|
545
|
-
immediateSearch?: boolean;
|
|
546
|
-
control?: boolean | Partial<{
|
|
547
|
-
sizeControl: boolean;
|
|
548
|
-
columnControl: boolean;
|
|
549
|
-
}>;
|
|
550
|
-
searchFormConfig?: Omit<SearchFormProps, "form"> & {
|
|
551
|
-
hidden?: boolean;
|
|
552
|
-
container?: ContainerComponent | false;
|
|
553
|
-
};
|
|
554
|
-
tableContainer?: ContainerComponent | false;
|
|
555
|
-
} & TableProps<AnyObject>) & Partial<{}>> & PublicProps;
|
|
556
|
-
expose(exposed: ShallowUnwrapRef< {}>): void;
|
|
557
|
-
attrs: any;
|
|
558
|
-
slots: Readonly<Omit<Omit<Readonly<{
|
|
559
|
-
default?: (() => any) | undefined;
|
|
560
|
-
title?: ((data: readonly AnyObject[]) => any) | undefined;
|
|
561
|
-
footer?: ((data: readonly AnyObject[]) => any) | undefined;
|
|
562
|
-
summary?: ((data: readonly AnyObject[]) => any) | undefined;
|
|
563
|
-
emptyText?: (() => any) | undefined;
|
|
564
|
-
expandIcon?: ((info: any) => any) | undefined;
|
|
565
|
-
expandedRowRender?: ((ctx: {
|
|
566
|
-
record: AnyObject;
|
|
567
|
-
index: number;
|
|
568
|
-
indent: number;
|
|
569
|
-
expanded: boolean;
|
|
570
|
-
}) => any) | undefined;
|
|
571
|
-
headerCell?: ((ctx: {
|
|
572
|
-
column: TableColumnType<AnyObject>;
|
|
573
|
-
index: number;
|
|
574
|
-
text: any;
|
|
575
|
-
}) => any) | undefined;
|
|
576
|
-
bodyCell?: ((ctx: {
|
|
577
|
-
column: TableColumnType<AnyObject>;
|
|
578
|
-
index: number;
|
|
579
|
-
text: any;
|
|
580
|
-
record: AnyObject;
|
|
581
|
-
}) => any) | undefined;
|
|
582
|
-
filterDropdown?: ((ctx: FilterDropdownProps & {
|
|
583
|
-
column: TableColumnType<AnyObject>;
|
|
584
|
-
}) => any) | undefined;
|
|
585
|
-
filterIcon?: ((ctx: {
|
|
586
|
-
column: TableColumnType<AnyObject>;
|
|
587
|
-
filtered: boolean;
|
|
588
|
-
}) => any) | undefined;
|
|
589
|
-
}>, "bodyCell"> & Readonly<{
|
|
590
|
-
bodyCell?: (props: {
|
|
591
|
-
text: any;
|
|
592
|
-
value: any;
|
|
593
|
-
record: T extends Table<any, infer R extends Data> ? R : never;
|
|
594
|
-
index: number;
|
|
595
|
-
column: Column<T extends Table<any, infer R extends Data> ? R : never>;
|
|
596
|
-
}) => void;
|
|
597
|
-
}> & Readonly<Partial<Record<"table" | "search-form" | "button-bar" | "toolbar", Slot>>>, "default">> & Omit<Omit<Readonly<{
|
|
598
|
-
default?: (() => any) | undefined;
|
|
599
|
-
title?: ((data: readonly AnyObject[]) => any) | undefined;
|
|
600
|
-
footer?: ((data: readonly AnyObject[]) => any) | undefined;
|
|
601
|
-
summary?: ((data: readonly AnyObject[]) => any) | undefined;
|
|
602
|
-
emptyText?: (() => any) | undefined;
|
|
603
|
-
expandIcon?: ((info: any) => any) | undefined;
|
|
604
|
-
expandedRowRender?: ((ctx: {
|
|
605
|
-
record: AnyObject;
|
|
606
|
-
index: number;
|
|
607
|
-
indent: number;
|
|
608
|
-
expanded: boolean;
|
|
609
|
-
}) => any) | undefined;
|
|
610
|
-
headerCell?: ((ctx: {
|
|
611
|
-
column: TableColumnType<AnyObject>;
|
|
612
|
-
index: number;
|
|
613
|
-
text: any;
|
|
614
|
-
}) => any) | undefined;
|
|
615
|
-
bodyCell?: ((ctx: {
|
|
616
|
-
column: TableColumnType<AnyObject>;
|
|
617
|
-
index: number;
|
|
618
|
-
text: any;
|
|
619
|
-
record: AnyObject;
|
|
620
|
-
}) => any) | undefined;
|
|
621
|
-
filterDropdown?: ((ctx: FilterDropdownProps & {
|
|
622
|
-
column: TableColumnType<AnyObject>;
|
|
623
|
-
}) => any) | undefined;
|
|
624
|
-
filterIcon?: ((ctx: {
|
|
625
|
-
column: TableColumnType<AnyObject>;
|
|
626
|
-
filtered: boolean;
|
|
627
|
-
}) => any) | undefined;
|
|
628
|
-
}>, "bodyCell"> & Readonly<{
|
|
629
|
-
bodyCell?: (props: {
|
|
630
|
-
text: any;
|
|
631
|
-
value: any;
|
|
632
|
-
record: T extends Table<any, infer R extends Data> ? R : never;
|
|
633
|
-
index: number;
|
|
634
|
-
column: Column<T extends Table<any, infer R extends Data> ? R : never>;
|
|
635
|
-
}) => void;
|
|
636
|
-
}> & Readonly<Partial<Record<"table" | "search-form" | "button-bar" | "toolbar", Slot>>>, "default">;
|
|
637
|
-
emit: ((evt: "update:size", value: ButtonSize) => void) & ((evt: "update:loading", value: boolean) => void);
|
|
638
|
-
}>) => VNode & {
|
|
639
|
-
__ctx?: Awaited<typeof __VLS_setup>;
|
|
640
|
-
};
|
|
641
|
-
|
|
642
|
-
declare const _default_3: <F extends Form<any> = Form>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal_2<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
643
|
-
props: __VLS_PrettifyLocal_2<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & ({
|
|
644
|
-
grid?: Grid;
|
|
645
|
-
form?: F;
|
|
646
|
-
} & Partial<Omit<FormProps, "model">>) & Partial<{}>> & PublicProps;
|
|
647
|
-
expose(exposed: ShallowUnwrapRef< {}>): void;
|
|
648
|
-
attrs: any;
|
|
649
|
-
slots: Readonly<Partial<Record<F extends Form<infer D extends Data> ? Path<D> : string, Slot<VModelProps & {
|
|
650
|
-
path?: string;
|
|
651
|
-
} & Data & {
|
|
652
|
-
[x: string]: any;
|
|
653
|
-
disabled?: boolean;
|
|
654
|
-
}>> & {
|
|
655
|
-
default: Slot;
|
|
656
|
-
}>> & Partial<Record<F extends Form<infer D extends Data> ? Path<D> : string, Slot<VModelProps & {
|
|
657
|
-
path?: string;
|
|
658
|
-
} & Data & {
|
|
659
|
-
[x: string]: any;
|
|
660
|
-
disabled?: boolean;
|
|
661
|
-
}>> & {
|
|
662
|
-
default: Slot;
|
|
663
|
-
}>;
|
|
664
|
-
emit: {};
|
|
665
|
-
}>) => VNode & {
|
|
666
|
-
__ctx?: Awaited<typeof __VLS_setup>;
|
|
667
|
-
};
|
|
668
|
-
|
|
669
|
-
declare const _default_4: DefineComponent<Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props_3> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
670
|
-
|
|
671
|
-
declare type Expand = {
|
|
672
|
-
minExpandRows?: number;
|
|
673
|
-
expandStatus?: boolean;
|
|
674
|
-
};
|
|
675
|
-
|
|
676
|
-
declare type ExpandButtonProps = ButtonProps & {
|
|
677
|
-
expandStatus: boolean;
|
|
678
|
-
};
|
|
679
|
-
|
|
680
|
-
/**
|
|
681
|
-
* 用 Record<string, any> 扩展对象类型,保留所有原始属性结构,
|
|
682
|
-
* 同时允许访问任意字符串 key。
|
|
683
|
-
* @template D - 原始对象类型
|
|
684
|
-
*
|
|
685
|
-
* @example
|
|
686
|
-
* ```ts
|
|
687
|
-
* type T = ExtendWithAny<{ name: string; age: number }>
|
|
688
|
-
* // { name: string; age: number } & Record<string, any>
|
|
689
|
-
* // 可访问任意额外属性: obj.anyKey
|
|
690
|
-
* ```
|
|
691
|
-
*/
|
|
692
|
-
declare type ExtendWithAny<D> = {
|
|
693
|
-
[K in keyof D]: IsRecord<D[K]> extends true ? ExtendWithAny<D[K]> : D[K];
|
|
694
|
-
} & Record<string, any>;
|
|
695
|
-
|
|
696
|
-
/**
|
|
697
|
-
* @description 字段配置类型,包含所有字段属性和响应式支持
|
|
698
|
-
* @template D - 数据对象类型
|
|
699
|
-
|
|
700
|
-
* @public
|
|
701
|
-
*/
|
|
702
|
-
export declare type Field<C extends ComponentName = ComponentName, D extends Data = Data> = (FieldTypeMap<D>[C] & {
|
|
703
|
-
component?: C extends 'custom' ? FieldTypeMap<D>[C]['component'] : C;
|
|
704
|
-
}) | WithFields<D>;
|
|
705
|
-
|
|
706
|
-
/**
|
|
707
|
-
* 字段查找函数类型,通过自定义函数匹配字段
|
|
708
|
-
* @template D - 表单数据类型
|
|
709
|
-
* @template F - 字段配置类型
|
|
710
|
-
* @example
|
|
711
|
-
* ```ts
|
|
712
|
-
* // 查找 label 为 '姓名' 的字段
|
|
713
|
-
* const findBy: FieldFindBy<MyData> = (field) => field.label === '姓名'
|
|
714
|
-
* ```
|
|
715
|
-
*/
|
|
716
|
-
declare type FieldFindBy<D extends Data, F extends BaseField<D> = BaseField<D>> = (field: Readonly<F>) => boolean;
|
|
717
|
-
|
|
718
|
-
/**
|
|
719
|
-
* @description 字段数组类型
|
|
720
|
-
* @template D - 数据对象类型
|
|
721
|
-
|
|
722
|
-
* @public
|
|
723
|
-
*/
|
|
724
|
-
export declare type Fields<D extends Data = Data> = Array<Field<ComponentName, D>>;
|
|
725
|
-
|
|
726
|
-
/**
|
|
727
|
-
* @type {FieldTypeMap} 字段类型集合
|
|
728
|
-
*/
|
|
729
|
-
declare type FieldTypeMap<D extends Data = Data> = {
|
|
730
|
-
[K in ComponentName]: K extends 'custom' ? WithCommon<{
|
|
731
|
-
slots?: Slots;
|
|
732
|
-
[x: string]: any;
|
|
733
|
-
}, D> & {
|
|
734
|
-
component?: RenderComponentType | Raw<RenderComponentType>;
|
|
735
|
-
} : WithComponent<GetComponentType<K>, D> & {
|
|
736
|
-
component?: K;
|
|
737
|
-
};
|
|
738
|
-
};
|
|
739
|
-
|
|
740
|
-
/**
|
|
741
|
-
* @qin-ui/antdv-next-pro 的表单实例类型
|
|
742
|
-
*
|
|
743
|
-
* @description 在 core Form 类型的基础上:
|
|
744
|
-
* 1. 将字段类型 F 默认绑定为本地 Field<ComponentName, D>,支持 antdv-next 所有内置组件类型
|
|
745
|
-
* 2. 将底层表单实例 I 绑定为 antdv-next 的 FormInstance,使 formRef 获得完整的类型提示
|
|
746
|
-
*
|
|
747
|
-
* @template D - 表单数据类型
|
|
748
|
-
* @template F - 字段配置类型,默认使用本地 Field 类型
|
|
749
|
-
*
|
|
750
|
-
* @example
|
|
751
|
-
* ```ts
|
|
752
|
-
* interface User { name: string; age: number }
|
|
753
|
-
* const form: Form<User> = useForm({ name: '张三', age: 25 })
|
|
754
|
-
* form.formRef.value?.validate() // 类型安全地访问 antdv-next Form validate 方法
|
|
755
|
-
* ```
|
|
756
|
-
|
|
757
|
-
* @public
|
|
758
|
-
*/
|
|
759
|
-
export declare type Form<D extends Data = Data, F extends Field<ComponentName, D> = Field<ComponentName, D>> = Form_2<D, F, FormInstance>;
|
|
760
|
-
|
|
761
|
-
/**
|
|
762
|
-
* 表单实例类型
|
|
763
|
-
* @template D - 表单数据类型
|
|
764
|
-
* @template F - 字段配置类型
|
|
765
|
-
* @template I - 底层 UI 框架 Form 组件实例类型
|
|
766
|
-
*
|
|
767
|
-
* 组合了表单数据操作、字段操作和表单 ref 操作的能力。
|
|
768
|
-
*
|
|
769
|
-
* @example
|
|
770
|
-
* ```ts
|
|
771
|
-
* // 定义数据类型
|
|
772
|
-
* interface User {
|
|
773
|
-
* name: string
|
|
774
|
-
* age: number
|
|
775
|
-
* address: { city: string; street: string }
|
|
776
|
-
* }
|
|
777
|
-
*
|
|
778
|
-
* // 创建表单实例
|
|
779
|
-
* const form: Form<User> = useForm({
|
|
780
|
-
* name: '张三',
|
|
781
|
-
* age: 25,
|
|
782
|
-
* })
|
|
783
|
-
*
|
|
784
|
-
* // 读取数据
|
|
785
|
-
* form.getFormData('name') // '张三'
|
|
786
|
-
* form.getFormData('address.city') // 支持深层路径
|
|
787
|
-
*
|
|
788
|
-
* // 设置数据
|
|
789
|
-
* form.setFormData('name', '李四')
|
|
790
|
-
* form.setFormData({ name: '王五', age: 30 }) // 批量设置
|
|
791
|
-
*
|
|
792
|
-
* // 字段操作
|
|
793
|
-
* form.getField('name') // 获取字段配置
|
|
794
|
-
* form.setField('name', { label: '用户名' }) // 更新字段配置
|
|
795
|
-
* ```
|
|
796
|
-
*/
|
|
797
|
-
declare type Form_2<D extends Data = Data, F extends BaseField<D> = BaseField<D>, I = any> = ReturnType<typeof useFormData<D>> & ReturnType<typeof useFields_2<D, F>> & ReturnType<typeof useFormRef_2<I>>;
|
|
798
|
-
|
|
799
|
-
declare type FormItemInstance = InstanceType<typeof FormItem>;
|
|
800
|
-
|
|
801
|
-
declare type _FormProps = Pick<Partial<FormProps>, 'colon' | 'disabled' | 'labelAlign' | 'labelCol' | 'labelWrap' | 'name' | 'wrapperCol'>;
|
|
802
|
-
|
|
803
|
-
declare type FP<T extends Record<string, any>> = Partial<T & Pick<Base, 'valueFormatter' | 'componentContainer' | 'modelProp' | 'componentClass' | 'componentStyle'> & AllowedComponentProps>;
|
|
804
|
-
|
|
805
|
-
/**
|
|
806
|
-
* 根据组件名获取组件类型
|
|
807
|
-
* @template K - 组件名称
|
|
808
|
-
*/
|
|
809
|
-
declare type GetComponentType<K extends ComponentName> = K extends keyof ComponentMap ? ComponentMap[K] : K extends keyof BaseComponentMap ? BaseComponentMap[K] : never;
|
|
810
|
-
|
|
811
|
-
declare type Grid = boolean | (RowProps & {});
|
|
812
|
-
|
|
813
|
-
/**
|
|
814
|
-
* 判断类型是否为对象(排除函数、数组和 null)
|
|
815
|
-
* @template T - 要判断的类型
|
|
816
|
-
*/
|
|
817
|
-
declare type IsRecord<T> = T extends object ? T extends ((...args: any[]) => any) | any[] | null ? false : true : false;
|
|
818
|
-
|
|
819
|
-
declare type JoinPath<Prefix extends any[], Key extends PropertyKey> = [
|
|
820
|
-
...Prefix,
|
|
821
|
-
KeyExpandString<Extract<Key, string>>
|
|
822
|
-
];
|
|
823
|
-
|
|
824
|
-
/**
|
|
825
|
-
* 展开字符串联合类型,保留字符串字面量,同时兼容 string
|
|
826
|
-
* @template T - 字符串字面量类型
|
|
827
|
-
*/
|
|
828
|
-
declare type KeyExpandString<T extends string> = T | (string & {});
|
|
829
|
-
|
|
830
|
-
/**
|
|
831
|
-
* 点号分隔的路径字符串类型
|
|
832
|
-
* @template D - 数据对象类型
|
|
833
|
-
*
|
|
834
|
-
* @description 用于类型安全地表示深层对象属性的路径。
|
|
835
|
-
* 例如给定 `{ user: { name: string; address: { city: string } } }`,
|
|
836
|
-
* 路径值可以是 `'user'`、`'user.name'`、`'user.address.city'`。
|
|
837
|
-
*
|
|
838
|
-
* 同时兼容 string 类型,用于运行时动态路径。
|
|
839
|
-
*
|
|
840
|
-
* @example
|
|
841
|
-
* ```ts
|
|
842
|
-
* interface User {
|
|
843
|
-
* name: string
|
|
844
|
-
* age: number
|
|
845
|
-
* address: { city: string; street: string }
|
|
846
|
-
* }
|
|
847
|
-
*
|
|
848
|
-
* type P = KeyPathString<User>
|
|
849
|
-
* // 'name' | 'age' | 'address' | 'address.city' | 'address.street' | string
|
|
850
|
-
* ```
|
|
851
|
-
*/
|
|
852
|
-
declare type KeyPathString<D extends Data> = KeyExpandString<AllowStringKey<D>>;
|
|
853
|
-
|
|
854
|
-
declare type MaybeRefOrComputedRef<T = any> = MaybeRef<T> | ComputedRef<T>;
|
|
855
|
-
|
|
856
|
-
/**
|
|
857
|
-
* @description 不支持响应式的属性名
|
|
858
|
-
*/
|
|
859
|
-
declare type NotSupportedRefOrGetterProps = 'component' | 'formItemContainer' | 'componentContainer' | 'valueFormatter' | 'fields' | 'slots' | 'modelProp';
|
|
860
|
-
|
|
861
|
-
/**
|
|
862
|
-
* 分页参数
|
|
863
|
-
*
|
|
864
|
-
* @example
|
|
865
|
-
* ```ts
|
|
866
|
-
* const pageParam: PageParam = {
|
|
867
|
-
* current: 1,
|
|
868
|
-
* pageSize: 10,
|
|
869
|
-
* total: 100,
|
|
870
|
-
* }
|
|
871
|
-
* ```
|
|
872
|
-
*/
|
|
873
|
-
declare interface PageParam {
|
|
874
|
-
/** 当前页码 */
|
|
875
|
-
current: number;
|
|
876
|
-
/** 每页条数 */
|
|
877
|
-
pageSize: number;
|
|
878
|
-
/** 总记录数 */
|
|
879
|
-
total: number;
|
|
880
|
-
/** 其他自定义分页属性 */
|
|
881
|
-
[key: string]: any;
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
/**
|
|
885
|
-
* 路径类型,用于类型安全的深层属性访问
|
|
886
|
-
* @template D - 数据对象类型
|
|
887
|
-
*
|
|
888
|
-
* @description 提供对数据对象的深层路径的类型推导。
|
|
889
|
-
* 在 useFormData、useFields 等 API 中作为 path 参数的类型。
|
|
890
|
-
*
|
|
891
|
-
* @example
|
|
892
|
-
* ```ts
|
|
893
|
-
* interface User { name: string; address: { city: string } }
|
|
894
|
-
*
|
|
895
|
-
* // 类型安全的路径
|
|
896
|
-
* const path: Path<User> = 'address.city' // ✅
|
|
897
|
-
* const path: Path<User> = 'invalid.path' // ❌ 类型错误
|
|
898
|
-
* ```
|
|
899
|
-
*/
|
|
900
|
-
declare type Path<D extends Data = Data> = KeyPathString<D>;
|
|
901
|
-
|
|
902
|
-
declare type PathProps = {
|
|
903
|
-
path?: string;
|
|
904
|
-
} & Data;
|
|
905
|
-
|
|
906
|
-
/**
|
|
907
|
-
* 路径数组类型(Path 的数组表示)
|
|
908
|
-
* @template T - 数据对象类型
|
|
909
|
-
* @template Prefix - 前缀路径数组(内部递归使用)
|
|
910
|
-
*
|
|
911
|
-
* @description 与 Path 类似,但以元组数组形式表示路径。
|
|
912
|
-
*
|
|
913
|
-
* @example
|
|
914
|
-
* ```ts
|
|
915
|
-
* interface User { name: string; address: { city: string } }
|
|
916
|
-
*
|
|
917
|
-
* type P = Paths<User>
|
|
918
|
-
* // ['name'] | ['address'] | ['address', 'city']
|
|
919
|
-
* ```
|
|
920
|
-
*/
|
|
921
|
-
declare type Paths<T, Prefix extends any[] = []> = T extends object ? {
|
|
922
|
-
[K in keyof T]: IsRecord<T[K]> extends true ? JoinPath<Prefix, K> | Paths<T[K], JoinPath<Prefix, K>> : JoinPath<Prefix, K>;
|
|
923
|
-
}[keyof T] : never;
|
|
924
|
-
|
|
925
|
-
declare type PP<T extends Record<string, any>> = Partial<T & AllowedComponentProps>;
|
|
926
|
-
|
|
927
|
-
export declare const ProComponentProvider: SFCWithInstall<{
|
|
928
|
-
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
929
|
-
componentVars?: ComponentVars;
|
|
930
|
-
componentMap?: Partial<Record<ComponentName, any>>;
|
|
931
|
-
}> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
932
|
-
P: {};
|
|
933
|
-
B: {};
|
|
934
|
-
D: {};
|
|
935
|
-
C: {};
|
|
936
|
-
M: {};
|
|
937
|
-
Defaults: {};
|
|
938
|
-
}, Readonly<{
|
|
939
|
-
componentVars?: ComponentVars;
|
|
940
|
-
componentMap?: Partial<Record<ComponentName, any>>;
|
|
941
|
-
}> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
942
|
-
__isFragment?: never;
|
|
943
|
-
__isTeleport?: never;
|
|
944
|
-
__isSuspense?: never;
|
|
945
|
-
} & ComponentOptionsBase<Readonly<{
|
|
946
|
-
componentVars?: ComponentVars;
|
|
947
|
-
componentMap?: Partial<Record<ComponentName, any>>;
|
|
948
|
-
}> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
949
|
-
$slots: {
|
|
950
|
-
default?(_: {}): any;
|
|
951
|
-
};
|
|
952
|
-
})>;
|
|
953
|
-
|
|
954
|
-
export declare const ProForm: SFCWithInstall<(<F extends Form<any> = Form>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
|
|
955
|
-
slots: Readonly<Partial<Record<F extends Form<infer D extends Data> ? Path<D> : string, Slot<VModelProps & {
|
|
956
|
-
path?: string;
|
|
957
|
-
} & Data & {
|
|
958
|
-
[x: string]: any;
|
|
959
|
-
disabled?: boolean;
|
|
960
|
-
}>> & {
|
|
961
|
-
default: Slot;
|
|
962
|
-
}>> & Partial<Record<F extends Form<infer D extends Data> ? Path<D> : string, Slot<VModelProps & {
|
|
963
|
-
path?: string;
|
|
964
|
-
} & Data & {
|
|
965
|
-
[x: string]: any;
|
|
966
|
-
disabled?: boolean;
|
|
967
|
-
}>> & {
|
|
968
|
-
default: Slot;
|
|
969
|
-
}>;
|
|
970
|
-
attrs: any;
|
|
971
|
-
emit: {};
|
|
972
|
-
}, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
973
|
-
props: {
|
|
974
|
-
grid?: Grid | undefined;
|
|
975
|
-
form?: F | undefined;
|
|
976
|
-
requiredMark?: RequiredMark | undefined;
|
|
977
|
-
colon?: boolean | undefined;
|
|
978
|
-
labelAlign?: FormLabelAlign | undefined;
|
|
979
|
-
labelCol?: (ColProps & Partial<HTMLAttributes>) | undefined;
|
|
980
|
-
tooltip?: FormTooltipProps | undefined;
|
|
981
|
-
name?: string | undefined;
|
|
982
|
-
rules?: Record<string, Rule[]> | undefined;
|
|
983
|
-
validateTrigger?: string | string[] | false | undefined;
|
|
984
|
-
rootClass?: string | undefined;
|
|
985
|
-
prefixCls?: string | undefined;
|
|
986
|
-
wrapperCol?: (ColProps & Partial<HTMLAttributes>) | undefined;
|
|
987
|
-
layout?: FormLayout | undefined;
|
|
988
|
-
size?: ButtonSize;
|
|
989
|
-
disabled?: boolean | undefined;
|
|
990
|
-
variant?: Variant | undefined;
|
|
991
|
-
classes?: FormClassNamesType | undefined;
|
|
992
|
-
styles?: FormStylesType | undefined;
|
|
993
|
-
autoComplete?: string | undefined | undefined;
|
|
994
|
-
onReset?: FormEmits["reset"] | undefined;
|
|
995
|
-
onSubmit?: FormEmits["submit"] | undefined;
|
|
996
|
-
labelWrap?: boolean | undefined;
|
|
997
|
-
feedbackIcons?: FeedbackIcons | undefined;
|
|
998
|
-
scrollToFirstError?: (ScrollFocusOptions | boolean) | undefined;
|
|
999
|
-
validateMessages?: ValidateMessages | undefined;
|
|
1000
|
-
preserve?: boolean | undefined;
|
|
1001
|
-
clearOnDestroy?: boolean | undefined;
|
|
1002
|
-
validateOnRuleChange?: boolean | undefined;
|
|
1003
|
-
onFinish?: FormEmits["finish"] | undefined;
|
|
1004
|
-
onFinishFailed?: FormEmits["finishFailed"] | undefined;
|
|
1005
|
-
onValidate?: FormEmits["validate"] | undefined;
|
|
1006
|
-
onValuesChange?: FormEmits["valuesChange"] | undefined;
|
|
1007
|
-
onFieldsChange?: FormEmits["fieldsChange"] | undefined;
|
|
1008
|
-
} & PublicProps;
|
|
1009
|
-
expose(exposed: ShallowUnwrapRef< {}>): void;
|
|
1010
|
-
attrs: any;
|
|
1011
|
-
slots: Readonly<Partial<Record<F extends Form<infer D extends Data> ? Path<D> : string, Slot<VModelProps & {
|
|
1012
|
-
path?: string;
|
|
1013
|
-
} & Data & {
|
|
1014
|
-
[x: string]: any;
|
|
1015
|
-
disabled?: boolean;
|
|
1016
|
-
}>> & {
|
|
1017
|
-
default: Slot;
|
|
1018
|
-
}>> & Partial<Record<F extends Form<infer D extends Data> ? Path<D> : string, Slot<VModelProps & {
|
|
1019
|
-
path?: string;
|
|
1020
|
-
} & Data & {
|
|
1021
|
-
[x: string]: any;
|
|
1022
|
-
disabled?: boolean;
|
|
1023
|
-
}>> & {
|
|
1024
|
-
default: Slot;
|
|
1025
|
-
}>;
|
|
1026
|
-
emit: {};
|
|
1027
|
-
}>) => VNode & {
|
|
1028
|
-
__ctx?: Awaited<typeof __VLS_setup>;
|
|
1029
|
-
})>;
|
|
1030
|
-
|
|
1031
|
-
export declare type ProFormInstance = ComponentExposed<typeof _default_3>;
|
|
1032
|
-
|
|
1033
|
-
export declare type ProFormItemInstance = ComponentExposed<typeof _default_4>;
|
|
1034
|
-
|
|
1035
|
-
export declare type ProFormItemProps = ComponentProps<typeof _default_4>;
|
|
1036
|
-
|
|
1037
|
-
export declare type ProFormProps = ComponentProps<typeof _default_3>;
|
|
1038
|
-
|
|
1039
|
-
declare type Props = {
|
|
1040
|
-
component?: ContainerComponent;
|
|
1041
|
-
};
|
|
1042
|
-
|
|
1043
|
-
declare type Props_2 = {
|
|
1044
|
-
component?: SlotComponentType;
|
|
1045
|
-
};
|
|
1046
|
-
|
|
1047
|
-
declare type Props_3 = {
|
|
1048
|
-
grid?: Grid;
|
|
1049
|
-
fields?: Fields;
|
|
1050
|
-
disabled?: boolean;
|
|
1051
|
-
};
|
|
1052
|
-
|
|
1053
|
-
export declare const ProTable: typeof _default_2;
|
|
1054
|
-
|
|
1055
|
-
export declare type ProTableInstance = ComponentExposed<typeof _default_2>;
|
|
1056
|
-
|
|
1057
|
-
export declare type ProTableProps = ComponentProps<typeof _default_2>;
|
|
1058
|
-
|
|
1059
|
-
/**
|
|
1060
|
-
* @description 自定义组件
|
|
1061
|
-
* @example (p, ctx) => h('div', ctx.attrs)
|
|
1062
|
-
*/
|
|
1063
|
-
declare type RenderComponentType = Component<VModelProps & PathProps>;
|
|
1064
|
-
|
|
1065
|
-
declare type RequiredComponentVars = {
|
|
1066
|
-
'pro-table': PP<TableProps & Pick<ProTableProps, 'control' | 'searchFormConfig' | 'immediateSearch' | 'addIndexColumn' | 'tableContainer'>>;
|
|
1067
|
-
'pro-form': PP<Omit<ProFormProps, 'form' | 'grid'> & {
|
|
1068
|
-
grid: Exclude<Grid, undefined | boolean>;
|
|
1069
|
-
}>;
|
|
1070
|
-
'pro-form-item': PP<FormItemProps & Pick<ColProps, 'span' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'> & Pick<Base, 'formItemContainer'>>;
|
|
1071
|
-
'date-picker.date': FP<ComponentProps<GetComponentType<'date-picker'>>>;
|
|
1072
|
-
'date-picker.week': FP<ComponentProps<GetComponentType<'date-picker'>>>;
|
|
1073
|
-
'date-picker.month': FP<ComponentProps<GetComponentType<'date-picker'>>>;
|
|
1074
|
-
'date-picker.year': FP<ComponentProps<GetComponentType<'date-picker'>>>;
|
|
1075
|
-
'date-picker.quarter': FP<ComponentProps<GetComponentType<'date-picker'>>>;
|
|
1076
|
-
} & {
|
|
1077
|
-
[K in Exclude<ComponentName, 'custom'>]: FP<ComponentProps<GetComponentType<K>>>;
|
|
1078
|
-
};
|
|
1079
|
-
|
|
1080
|
-
declare type SearchFormProps = {
|
|
1081
|
-
form: Form;
|
|
1082
|
-
layout?: 'grid' | 'inline';
|
|
1083
|
-
expand?: boolean | Expand;
|
|
1084
|
-
searchButton?: Component<ButtonProps> | DefineComponent<ButtonProps> | false;
|
|
1085
|
-
resetButton?: Component<ButtonProps> | DefineComponent<ButtonProps> | false;
|
|
1086
|
-
expandButton?: Component<ExpandButtonProps> | DefineComponent<ExpandButtonProps> | false;
|
|
1087
|
-
rowGap?: number;
|
|
1088
|
-
columnGap?: number;
|
|
1089
|
-
} & /* @vue-ignore */ _FormProps & AllowedComponentProps;
|
|
1090
|
-
|
|
1091
|
-
declare type SetColumn<T extends Data = Data, C extends BaseColumn<T> = BaseColumn<T>> = (key: Path<T>, column: C | ((pre: Readonly<C>) => C), options?: {
|
|
1092
|
-
updateType?: 'rewrite' | 'merge';
|
|
1093
|
-
} & UpdateColumnOptions) => void;
|
|
1094
|
-
|
|
1095
|
-
declare type SetPageParam = (pageParam: Partial<PageParam> | ((pre: Readonly<PageParam>) => Partial<PageParam>)) => void;
|
|
1096
|
-
|
|
1097
|
-
declare type SFCWithInstall<T> = T & Plugin_2;
|
|
1098
|
-
|
|
1099
|
-
export declare const SlotComponent: DefineComponent<Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props_2> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
1100
|
-
|
|
1101
|
-
/**
|
|
1102
|
-
* @description 插槽组件类型
|
|
1103
|
-
*/
|
|
1104
|
-
declare type SlotComponentType = Component<PathProps> | VNode | string | number | boolean | null | undefined | ((...args: any[]) => SlotComponentType);
|
|
1105
|
-
|
|
1106
|
-
/**
|
|
1107
|
-
* @description 插槽对象类型
|
|
1108
|
-
*/
|
|
1109
|
-
declare type Slots = {
|
|
1110
|
-
[name: string]: SlotComponentType;
|
|
1111
|
-
};
|
|
1112
|
-
|
|
1113
|
-
/**
|
|
1114
|
-
* @qin-ui/antdv-next-pro 的表格实例类型
|
|
1115
|
-
*
|
|
1116
|
-
* @description 在 core Table 类型的基础上,将列类型 C 绑定为本地 Column<T>,
|
|
1117
|
-
* 使 columns 操作获得 antdv-next 表格列的完整属性类型提示。
|
|
1118
|
-
*
|
|
1119
|
-
* @template D - 搜索表单数据类型
|
|
1120
|
-
* @template T - 表格行数据类型
|
|
1121
|
-
|
|
1122
|
-
* @public
|
|
1123
|
-
*/
|
|
1124
|
-
export declare type Table<D extends Data = Data, T extends Data = ExtendWithAny<D>> = Table_2<D, T, Column<T>>;
|
|
1125
|
-
|
|
1126
|
-
/**
|
|
1127
|
-
* 表格实例类型
|
|
1128
|
-
* @template D - 搜索表单数据类型
|
|
1129
|
-
* @template T - 表格数据类型(表格行数据类型),默认为 ExtendWithAny<D>
|
|
1130
|
-
* @template C - 列配置类型,继承自 BaseColumn<T>
|
|
1131
|
-
*
|
|
1132
|
-
* 组合了列操作、数据源管理、分页管理和搜索表单的能力。
|
|
1133
|
-
*
|
|
1134
|
-
* @example
|
|
1135
|
-
* ```ts
|
|
1136
|
-
* interface User { name: string; age: number; }
|
|
1137
|
-
* interface SearchParams { keyword: string }
|
|
1138
|
-
*
|
|
1139
|
-
* const table: Table<SearchParams, User> = useTable({
|
|
1140
|
-
* columns: [
|
|
1141
|
-
* { key: 'name', title: '姓名' },
|
|
1142
|
-
* { key: 'age', title: '年龄' },
|
|
1143
|
-
* ],
|
|
1144
|
-
* dataSource: [
|
|
1145
|
-
* { name: '张三', age: 25 },
|
|
1146
|
-
* ],
|
|
1147
|
-
* searchFields: [
|
|
1148
|
-
* { path: 'keyword', label: '关键词', component: 'input' },
|
|
1149
|
-
* ],
|
|
1150
|
-
* })
|
|
1151
|
-
*
|
|
1152
|
-
* // 列操作
|
|
1153
|
-
* table.setColumn('name', { title: '用户名' })
|
|
1154
|
-
* table.appendColumn('name', { key: 'email', title: '邮箱' })
|
|
1155
|
-
* table.deleteColumn('age')
|
|
1156
|
-
*
|
|
1157
|
-
* // 分页操作
|
|
1158
|
-
* table.setPageParam({ current: 2, pageSize: 20 })
|
|
1159
|
-
* table.resetQueryParams()
|
|
1160
|
-
*
|
|
1161
|
-
* // 搜索表单
|
|
1162
|
-
* table.searchForm.getFormData('keyword')
|
|
1163
|
-
* table.searchForm.setFormData('keyword', '张三')
|
|
1164
|
-
* ```
|
|
1165
|
-
*/
|
|
1166
|
-
declare type Table_2<D extends Data = Data, T extends Data = ExtendWithAny<D>, C extends BaseColumn<T> = BaseColumn<T>> = {
|
|
1167
|
-
/** 列配置数组(响应式) */
|
|
1168
|
-
columns: Ref<Columns_2<T, C>>;
|
|
1169
|
-
/** 数据源数组(响应式) */
|
|
1170
|
-
dataSource: Ref<T[]>;
|
|
1171
|
-
/** 分页参数(响应式) */
|
|
1172
|
-
pageParam: Reactive<PageParam>;
|
|
1173
|
-
/** 搜索表单实例 */
|
|
1174
|
-
searchForm: Form_2<D>;
|
|
1175
|
-
/** 设置列配置 */
|
|
1176
|
-
setColumn: SetColumn<T, C>;
|
|
1177
|
-
/** 删除列 */
|
|
1178
|
-
deleteColumn: (path: Path<T> | ColumnFindBy<T, C>, options?: UpdateColumnOptions) => void;
|
|
1179
|
-
/** 在指定列后追加列 */
|
|
1180
|
-
appendColumn: (path: Path<T> | ColumnFindBy<T, C> | undefined, column: C | Columns_2<T, C>, options?: UpdateColumnOptions) => void;
|
|
1181
|
-
/** 在指定列前插入列 */
|
|
1182
|
-
prependColumn: (path: Path<T> | ColumnFindBy<T, C> | undefined, column: C | Columns_2<T, C>, options?: UpdateColumnOptions) => void;
|
|
1183
|
-
/** 设置分页参数 */
|
|
1184
|
-
setPageParam: SetPageParam;
|
|
1185
|
-
/** 重置查询参数(重置分页和搜索条件到初始值) */
|
|
1186
|
-
resetQueryParams: () => void;
|
|
1187
|
-
};
|
|
1188
|
-
|
|
1189
|
-
/**
|
|
1190
|
-
* 列更新选项
|
|
1191
|
-
*/
|
|
1192
|
-
declare type UpdateColumnOptions = {
|
|
1193
|
-
/**
|
|
1194
|
-
* @description 是否更新所有匹配的列
|
|
1195
|
-
* - true: 更新所有匹配的列
|
|
1196
|
-
* - false/undefined: 只更新第一个匹配的列
|
|
1197
|
-
*/
|
|
1198
|
-
all?: boolean;
|
|
1199
|
-
};
|
|
1200
|
-
|
|
1201
|
-
declare type UpdateFieldOptions = {
|
|
1202
|
-
all?: boolean;
|
|
1203
|
-
};
|
|
1204
|
-
|
|
1205
|
-
/** useFields 返回值类型,固定为本地 Fields<D>
|
|
1206
|
-
* @public
|
|
1207
|
-
*/
|
|
1208
|
-
export declare type UseFields<D extends Data = Data> = ReturnType<typeof useFields<D>>;
|
|
1209
|
-
|
|
1210
|
-
/**
|
|
1211
|
-
* @qin-ui/antdv-next-pro 的字段配置管理 Hook
|
|
1212
|
-
*
|
|
1213
|
-
* @description 类型安全的 re-export。将 core useFields 的泛型参数绑定为本地类型:
|
|
1214
|
-
* - 字段类型 F → Field<ComponentName, D>(支持 antdv-next 组件类型推导)
|
|
1215
|
-
* - FormItem 实例 → antdv-next 的 FormItemInstance
|
|
1216
|
-
*
|
|
1217
|
-
* @template D - 表单数据类型
|
|
1218
|
-
*
|
|
1219
|
-
* @example
|
|
1220
|
-
* ```ts
|
|
1221
|
-
* interface User { name: string; age: number }
|
|
1222
|
-
*
|
|
1223
|
-
* const { fields, getField, setField } = useFields<User>([
|
|
1224
|
-
* { path: 'name', label: '姓名', component: 'input' },
|
|
1225
|
-
* { path: 'age', label: '年龄', component: 'input-number' },
|
|
1226
|
-
* ])
|
|
1227
|
-
* ```
|
|
1228
|
-
|
|
1229
|
-
* @public
|
|
1230
|
-
*/
|
|
1231
|
-
export declare const useFields: {
|
|
1232
|
-
<D extends Data = Data>(initFields?: Fields<D>): ReturnType<typeof useFields_2<D, Field<ComponentName, D>, FormItemInstance>>;
|
|
1233
|
-
};
|
|
1234
|
-
|
|
1235
|
-
/**
|
|
1236
|
-
* 字段配置管理 Hook
|
|
1237
|
-
*
|
|
1238
|
-
* @description 提供对字段配置数组的增删改查操作,支持:
|
|
1239
|
-
* - 通过路径字符串或查找函数定位字段
|
|
1240
|
-
* - 深层嵌套字段的遍历和匹配
|
|
1241
|
-
* - 字段配置的合并/覆盖更新
|
|
1242
|
-
* - 字段的添加、插入、删除
|
|
1243
|
-
* - 父级字段查找
|
|
1244
|
-
*
|
|
1245
|
-
* @template D - 表单数据类型,用于路径类型推导
|
|
1246
|
-
* @template F - 字段配置类型,继承自 BaseField<D>
|
|
1247
|
-
* @template FormInstance - 底层 FormItem 组件实例类型
|
|
1248
|
-
*
|
|
1249
|
-
* @param {F[]} [initFields] - 初始字段配置数组
|
|
1250
|
-
*
|
|
1251
|
-
* @returns {object} 字段操作对象
|
|
1252
|
-
* @returns {Ref<F[]>} .fields - 字段配置数组(响应式)
|
|
1253
|
-
* @returns {Function} .getField(path) - 获取字段配置
|
|
1254
|
-
* @returns {Function} .setField(path, field) - 更新字段配置
|
|
1255
|
-
* @returns {Function} .deleteField(path) - 删除字段
|
|
1256
|
-
* @returns {Function} .appendField(path, field) - 在指定字段后追加
|
|
1257
|
-
* @returns {Function} .prependField(path, field) - 在指定字段前插入
|
|
1258
|
-
* @returns {Function} .getParentField(path) - 获取父级字段
|
|
1259
|
-
*
|
|
1260
|
-
* @example
|
|
1261
|
-
* ```ts
|
|
1262
|
-
* interface User { name: string; age: number; address: { city: string } }
|
|
1263
|
-
*
|
|
1264
|
-
* const { fields, getField, setField, deleteField } = useFields<User>([
|
|
1265
|
-
* { path: 'name', label: '姓名', component: 'input' },
|
|
1266
|
-
* { path: 'age', label: '年龄', component: 'input-number' },
|
|
1267
|
-
* {
|
|
1268
|
-
* path: 'address',
|
|
1269
|
-
* label: '地址',
|
|
1270
|
-
* fields: [
|
|
1271
|
-
* { path: 'city', label: '城市' },
|
|
1272
|
-
* ],
|
|
1273
|
-
* },
|
|
1274
|
-
* ])
|
|
1275
|
-
*
|
|
1276
|
-
* // 通过路径获取字段
|
|
1277
|
-
* getField('name') // { path: 'name', label: '姓名', ... }
|
|
1278
|
-
* getField('address.city') // { path: 'city', label: '城市', ... }
|
|
1279
|
-
*
|
|
1280
|
-
* // 通过查找函数获取字段
|
|
1281
|
-
* getField(f => f.label === '姓名')
|
|
1282
|
-
*
|
|
1283
|
-
* // 更新字段(合并模式)
|
|
1284
|
-
* setField('name', { label: '用户名' })
|
|
1285
|
-
*
|
|
1286
|
-
* // 删除字段
|
|
1287
|
-
* deleteField('age')
|
|
1288
|
-
*
|
|
1289
|
-
* // 追加/插入字段
|
|
1290
|
-
* appendField('name', { path: 'email', label: '邮箱', component: 'input' })
|
|
1291
|
-
* prependField('name', { path: 'id', label: 'ID', component: 'input' })
|
|
1292
|
-
* ```
|
|
1293
|
-
*/
|
|
1294
|
-
declare const useFields_2: <D extends Data = Data, F extends BaseField<D> = BaseField<D>, FormInstance = any>(initFields?: F[]) => {
|
|
1295
|
-
fields: Ref<F[], F[]>;
|
|
1296
|
-
getField: {
|
|
1297
|
-
(path: Path<D> | FieldFindBy<D, F>): Readonly<F & AdditionalMethods<FormInstance>> | undefined;
|
|
1298
|
-
(path: Path<D> | FieldFindBy<D, F>, options?: {
|
|
1299
|
-
all?: false;
|
|
1300
|
-
}): Readonly<F & AdditionalMethods<FormInstance>> | undefined;
|
|
1301
|
-
(path: Path<D> | FieldFindBy<D, F>, options: {
|
|
1302
|
-
all: true;
|
|
1303
|
-
}): Readonly<F & AdditionalMethods<FormInstance>>[] | undefined;
|
|
1304
|
-
};
|
|
1305
|
-
setField: (path: Path<D> | FieldFindBy<D, F>, field: F | ((preField: Readonly<F>) => F), options?: {
|
|
1306
|
-
updateType?: "rewrite" | "merge";
|
|
1307
|
-
} & UpdateFieldOptions) => void;
|
|
1308
|
-
deleteField: (path: Path<D> | FieldFindBy<D, F>, options?: UpdateFieldOptions) => void;
|
|
1309
|
-
appendField: (path: Path<D> | FieldFindBy<D, F> | undefined, field: F | F[], options?: UpdateFieldOptions) => void;
|
|
1310
|
-
prependField: (path: Path<D> | FieldFindBy<D, F> | undefined, field: F | F[], options?: UpdateFieldOptions) => void;
|
|
1311
|
-
getParentField: {
|
|
1312
|
-
(path: Path<D> | FieldFindBy<D, F>): Readonly<F & AdditionalMethods<FormInstance>> | undefined;
|
|
1313
|
-
(path: Path<D> | FieldFindBy<D, F>, options: {
|
|
1314
|
-
all?: false;
|
|
1315
|
-
}): Readonly<F & AdditionalMethods<FormInstance>> | undefined;
|
|
1316
|
-
(path: Path<D> | FieldFindBy<D, F>, options: {
|
|
1317
|
-
all: true;
|
|
1318
|
-
}): Readonly<F & AdditionalMethods<FormInstance>>[] | undefined;
|
|
1319
|
-
};
|
|
1320
|
-
};
|
|
1321
|
-
|
|
1322
|
-
/**
|
|
1323
|
-
* 创建 @qin-ui/antdv-next-pro 表单实例的 Hook
|
|
1324
|
-
*
|
|
1325
|
-
* @description 类型安全的 re-export。将 core useForm 的泛型参数绑定为本地类型:
|
|
1326
|
-
* - 字段类型 F → Field<ComponentName, D>(支持 antdv-next 组件类型推导)
|
|
1327
|
-
* - 表单实例 → antdv-next 的 FormInstance
|
|
1328
|
-
*
|
|
1329
|
-
* @template D - 表单数据类型
|
|
1330
|
-
*
|
|
1331
|
-
* @example
|
|
1332
|
-
* ```ts
|
|
1333
|
-
* interface User { name: string; age: number }
|
|
1334
|
-
*
|
|
1335
|
-
* const form = useForm<User>(
|
|
1336
|
-
* { name: '张三', age: 25 },
|
|
1337
|
-
* [
|
|
1338
|
-
* { path: 'name', label: '姓名', component: 'input' },
|
|
1339
|
-
* { path: 'age', label: '年龄', component: 'input-number' },
|
|
1340
|
-
* ],
|
|
1341
|
-
* true
|
|
1342
|
-
* )
|
|
1343
|
-
* ```
|
|
1344
|
-
|
|
1345
|
-
* @public
|
|
1346
|
-
*/
|
|
1347
|
-
export declare const useForm: {
|
|
1348
|
-
<D extends Data = Data>(initFormData?: ExtendWithAny<DeepPartial<D>>, initFields?: Field<ComponentName, D>[], root?: boolean): Form<D, Field<ComponentName, D>>;
|
|
1349
|
-
<D extends Data = Data>(root?: boolean): Form<D, Field<ComponentName, D>>;
|
|
1350
|
-
};
|
|
1351
|
-
|
|
1352
|
-
/**
|
|
1353
|
-
* 表单数据处理 Hook
|
|
1354
|
-
*
|
|
1355
|
-
* @description 提供响应式表单数据的管理能力,支持:
|
|
1356
|
-
* - 响应式数据存储(基于 Vue reactive)
|
|
1357
|
-
* - 深层路径读写(支持点号分隔,如 'address.city')
|
|
1358
|
-
* - 类型安全的路径提示(传入泛型 D 后,path 参数可获得类型推导)
|
|
1359
|
-
* - 父子表单自动注入(非根表单会从注入中获取数据)
|
|
1360
|
-
* @public
|
|
1361
|
-
*
|
|
1362
|
-
* @template D - 表单数据类型,应为一个对象类型
|
|
1363
|
-
* @param {ExtendWithAny<DeepPartial<D>>} [initFormData] - 初始表单数据
|
|
1364
|
-
*
|
|
1365
|
-
* @returns {object} 表单数据操作对象
|
|
1366
|
-
* @returns {D & Record<string, any>} .formData - 响应式表单数据
|
|
1367
|
-
* @returns {Function} .getFormData(path) - 获取指定路径的数据
|
|
1368
|
-
* @returns {Function} .setFormData(path, value) - 设置指定路径的数据
|
|
1369
|
-
*
|
|
1370
|
-
* @example
|
|
1371
|
-
* ```ts
|
|
1372
|
-
* interface User { name: string; age: number; address: { city: string } }
|
|
1373
|
-
*
|
|
1374
|
-
* const { formData, getFormData, setFormData } = useFormData<User>({
|
|
1375
|
-
* name: '张三',
|
|
1376
|
-
* address: { city: '北京' }
|
|
1377
|
-
* })
|
|
1378
|
-
*
|
|
1379
|
-
* // 读取
|
|
1380
|
-
* getFormData('name') // '张三'
|
|
1381
|
-
* getFormData('address.city') // '北京'
|
|
1382
|
-
* formData.name // '张三'(响应式)
|
|
1383
|
-
*
|
|
1384
|
-
* // 设置
|
|
1385
|
-
* setFormData('name', '李四')
|
|
1386
|
-
* setFormData('address.city', '上海')
|
|
1387
|
-
* setFormData({ name: '王五', age: 30 }) // 批量覆盖
|
|
1388
|
-
* setFormData(prev => ({ ...prev, name: '赵六' })) // 函数式更新
|
|
1389
|
-
* ```
|
|
1390
|
-
*/
|
|
1391
|
-
export declare const useFormData: <D extends Data = Data>(initFormData?: ExtendWithAny<DeepPartial<D>>) => {
|
|
1392
|
-
formData: Reactive<ExtendWithAny<D>>;
|
|
1393
|
-
getFormData: {
|
|
1394
|
-
<K extends keyof D>(path: K): D[K];
|
|
1395
|
-
<K extends keyof D & string, K1 extends keyof D[K] & string>(path: `${K}.${K1}`): D[K][K1];
|
|
1396
|
-
<K extends keyof D & string, K1_1 extends keyof D[K] & string, K2 extends keyof D[K][K1_1] & string>(path: `${K}.${K1_1}.${K2}`): D[K][K1_1][K2];
|
|
1397
|
-
(path: Path<D>): any;
|
|
1398
|
-
};
|
|
1399
|
-
setFormData: {
|
|
1400
|
-
(path: Path<D>, value: any): void;
|
|
1401
|
-
(path: Path<D>, value: (v: any) => any): void;
|
|
1402
|
-
(value: ExtendWithAny<DeepPartial<D>>): void;
|
|
1403
|
-
(value: (v: ExtendWithAny<DeepPartial<D>>) => ExtendWithAny<DeepPartial<D>>): void;
|
|
1404
|
-
};
|
|
1405
|
-
};
|
|
1406
|
-
|
|
1407
|
-
/**
|
|
1408
|
-
* @qin-ui/antdv-next-pro 的表单组件实例引用 Hook
|
|
1409
|
-
*
|
|
1410
|
-
* @description 类型安全的 re-export。将 core useFormRef 的泛型参数绑定为 antdv-next 的 FormInstance,
|
|
1411
|
-
* 使 formRef 获取到完整的 antdv-next Form 组件 API 类型提示。
|
|
1412
|
-
*
|
|
1413
|
-
* @returns {object} 表单组件实例引用管理对象
|
|
1414
|
-
* @returns {Ref<FormInstance | undefined>} .formRef - antdv-next Form 实例的响应式引用
|
|
1415
|
-
* @returns {Function} .setFormRef(inst) - 设置表单组件实例
|
|
1416
|
-
*
|
|
1417
|
-
* @example
|
|
1418
|
-
* ```ts
|
|
1419
|
-
* const { formRef, setFormRef } = useFormRef()
|
|
1420
|
-
* await formRef.value?.validate()
|
|
1421
|
-
* formRef.value?.resetFields()
|
|
1422
|
-
* ```
|
|
1423
|
-
|
|
1424
|
-
* @public
|
|
1425
|
-
*/
|
|
1426
|
-
export declare const useFormRef: {
|
|
1427
|
-
(): ReturnType<typeof useFormRef_2<FormInstance>>;
|
|
1428
|
-
};
|
|
1429
|
-
|
|
1430
|
-
/**
|
|
1431
|
-
* 表单组件实例引用 Hook
|
|
1432
|
-
*
|
|
1433
|
-
* @description 用于获取和设置底层 UI 框架(如 ant-design-vue、element-plus)的 Form 组件实例。
|
|
1434
|
-
* 在 ProForm 组件内部自动调用 setFormRef 绑定实例,外部可通过 formRef 访问。
|
|
1435
|
-
*
|
|
1436
|
-
* @template F - 底层 Form 组件实例类型,默认为 any
|
|
1437
|
-
*
|
|
1438
|
-
* @returns {object} 表单组件实例引用管理对象
|
|
1439
|
-
* @returns {Ref<F | undefined>} .formRef - 表单组件实例的响应式引用
|
|
1440
|
-
* @returns {Function} .setFormRef(inst) - 设置表单组件实例
|
|
1441
|
-
*
|
|
1442
|
-
* @example
|
|
1443
|
-
* ```ts
|
|
1444
|
-
* const { formRef, setFormRef } = useFormRef<InstanceType<typeof AForm>>()
|
|
1445
|
-
* setFormRef(formComponentInstance)
|
|
1446
|
-
* console.log(formRef.value) // 可通过 formRef 访问底层 Form 实例的方法
|
|
1447
|
-
* ```
|
|
1448
|
-
*/
|
|
1449
|
-
declare const useFormRef_2: <F = any>() => {
|
|
1450
|
-
formRef: Ref<F | undefined, F | undefined>;
|
|
1451
|
-
setFormRef: (inst: F) => void;
|
|
1452
|
-
};
|
|
1453
|
-
|
|
1454
|
-
/**
|
|
1455
|
-
* 创建 @qin-ui/antdv-next-pro 表格实例的 Hook
|
|
1456
|
-
*
|
|
1457
|
-
* @description 类型安全的 re-export。将 core useTable 的列类型绑定为本地 Column<T>,
|
|
1458
|
-
* 使 columns 操作获得 antdv-next 表格列的完整类型提示。
|
|
1459
|
-
*
|
|
1460
|
-
* @template D - 搜索表单数据类型
|
|
1461
|
-
* @template T - 表格行数据类型
|
|
1462
|
-
*
|
|
1463
|
-
* @example
|
|
1464
|
-
* ```ts
|
|
1465
|
-
* interface User { name: string; age: number; email: string }
|
|
1466
|
-
*
|
|
1467
|
-
* const table = useTable<User>({
|
|
1468
|
-
* columns: [
|
|
1469
|
-
* { dataIndex: 'name', title: '姓名', width: 120 },
|
|
1470
|
-
* { dataIndex: 'age', title: '年龄', width: 80 },
|
|
1471
|
-
* ],
|
|
1472
|
-
* dataSource: [],
|
|
1473
|
-
* pageParam: { current: 1, pageSize: 20, total: 0 },
|
|
1474
|
-
* })
|
|
1475
|
-
* ```
|
|
1476
|
-
|
|
1477
|
-
* @public
|
|
1478
|
-
*/
|
|
1479
|
-
export declare const useTable: <D extends Data = Data, T extends Data = ExtendWithAny<D>>(params: {
|
|
1480
|
-
columns?: Columns<T>;
|
|
1481
|
-
dataSource?: T[];
|
|
1482
|
-
pageParam?: PageParam;
|
|
1483
|
-
searchParam?: ExtendWithAny<DeepPartial<D>>;
|
|
1484
|
-
searchFields?: Fields<D>;
|
|
1485
|
-
}) => Table<D, T>;
|
|
1486
|
-
|
|
1487
|
-
declare type ValueFormatter = {
|
|
1488
|
-
(val: any, oldVal: any): any;
|
|
1489
|
-
} | {
|
|
1490
|
-
get?: (val: any) => any;
|
|
1491
|
-
set?: (val: any, oldVal: any) => any;
|
|
1492
|
-
};
|
|
1493
|
-
|
|
1494
|
-
declare type VModelProps<T = any> = {
|
|
1495
|
-
value?: T;
|
|
1496
|
-
'onUpdate:value'?: (val: T) => void;
|
|
1497
|
-
};
|
|
1498
|
-
|
|
1499
|
-
declare type WithCommon<T, D extends Data = Data> = WithRef<WithCommonBase<T> & BaseWithoutFields<D>>;
|
|
1500
|
-
|
|
1501
|
-
declare type WithCommonBase<T = unknown> = T & Omit<FormItemProps, 'label'> & ColProps;
|
|
1502
|
-
|
|
1503
|
-
/**
|
|
1504
|
-
* @description 自动从 Vue 组件提取 Props 和 Slots,并加上公共表单字段属性
|
|
1505
|
-
* @template T - Vue 组件类型
|
|
1506
|
-
* @template D - 数据对象类型
|
|
1507
|
-
*/
|
|
1508
|
-
declare type WithComponent<T extends abstract new (...args: any) => any, D extends Data = Data> = WithCommon<{
|
|
1509
|
-
slots?: Partial<ComponentSlots<T>>;
|
|
1510
|
-
} & Partial<Omit<ComponentProps<T>, keyof VNodeProps>>, D>;
|
|
1511
|
-
|
|
1512
|
-
declare type WithFields<D extends Data = Data> = WithRef<WithCommonBase & BaseWithFields<D>>;
|
|
1513
|
-
|
|
1514
|
-
/**
|
|
1515
|
-
* @description 为对象属性添加响应式支持的类型
|
|
1516
|
-
* @template T - 原始类型
|
|
1517
|
-
*/
|
|
1518
|
-
declare type WithRef<T> = {
|
|
1519
|
-
[P in keyof T]: P extends NotSupportedRefOrGetterProps ? T[P] : T[P] extends (...args: any[]) => any ? T[P] : MaybeRefOrComputedRef<T[P]>;
|
|
1520
|
-
};
|
|
1521
|
-
|
|
1522
|
-
export { }
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { default as ProForm } from './components/form';
|
|
3
|
+
import { default as ProTable } from './components/table';
|
|
4
|
+
import { default as ProComponentProvider } from './components/component-provider';
|
|
5
|
+
export * from './components/form';
|
|
6
|
+
export * from './components/table';
|
|
7
|
+
export * from './components/component-provider';
|
|
8
|
+
/**
|
|
9
|
+
* Schema 驱动的表单组件,基于 antdv-next Form 封装
|
|
10
|
+
*
|
|
11
|
+
* @description 通过声明式 JSON Schema 配置即可快速生成表单,
|
|
12
|
+
* 提供极致的 TypeScript 类型推导与组件库插槽扩展能力。
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```vue
|
|
16
|
+
* <script setup lang="ts">
|
|
17
|
+
* import { ProForm, useForm } from '@qin-ui/antdv-next-pro'
|
|
18
|
+
* const form = useForm<User>({ name: '' }, [
|
|
19
|
+
* { path: 'name', label: '姓名', component: 'input' }
|
|
20
|
+
* ])
|
|
21
|
+
* </script>
|
|
22
|
+
* <template>
|
|
23
|
+
* <ProForm :form="form" />
|
|
24
|
+
* </template>
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* Schema 驱动的表格组件,基于 antdv-next Table 封装
|
|
28
|
+
*
|
|
29
|
+
* @description 通过声明式列配置即可生成功能完整的表格,
|
|
30
|
+
* 支持列动态控制、搜索表单集成、分页管理等企业级能力。
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```vue
|
|
34
|
+
* <script setup lang="ts">
|
|
35
|
+
* import { ProTable, useTable } from '@qin-ui/antdv-next-pro'
|
|
36
|
+
* const table = useTable<User>({ columns: [{ key: 'name', title: '姓名' }] })
|
|
37
|
+
* </script>
|
|
38
|
+
* <template>
|
|
39
|
+
* <ProTable :table="table" />
|
|
40
|
+
* </template>
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* 组件提供者,用于全局配置 ProForm 和 ProTable 的默认行为
|
|
44
|
+
*
|
|
45
|
+
* @description 通过 `ProComponentProvider` 包裹应用根组件,
|
|
46
|
+
* 可以全局覆盖组件的默认属性(如表单布局、表格尺寸等)。
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```vue
|
|
50
|
+
* <template>
|
|
51
|
+
* <ProComponentProvider :component-props="customProps">
|
|
52
|
+
* <App />
|
|
53
|
+
* </ProComponentProvider>
|
|
54
|
+
* </template>
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export { ProForm, ProTable, ProComponentProvider };
|
|
58
|
+
declare const _default: {
|
|
59
|
+
/**
|
|
60
|
+
* @qin-ui/antdv-next-pro 安装方法
|
|
61
|
+
* @description 全局注册所有组件(ProForm、ProTable、ProComponentProvider)
|
|
62
|
+
*
|
|
63
|
+
* @param {App} app - Vue 应用实例
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* import { createApp } from 'vue'
|
|
68
|
+
* import ProComponents from '@qin-ui/antdv-next-pro'
|
|
69
|
+
* const app = createApp(App)
|
|
70
|
+
* app.use(ProComponents)
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
install(app: App): void;
|
|
74
|
+
};
|
|
75
|
+
export default _default;
|
|
76
|
+
//# sourceMappingURL=index.d.ts.map
|