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