@yetuzi/vue3-query-components 1.1.28 → 1.1.32

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/dist/index.d.ts CHANGED
@@ -1,130 +1,782 @@
1
- // Vue3 Common Components 类型声明文件
2
- import type { Plugin, DefineComponent } from 'vue'
3
- import type { InputProps, ButtonProps } from 'element-plus'
4
-
5
- // 基础配置类型
6
- export interface Config {
7
- component: {
8
- placeholder: string
9
- pagination: {
10
- defaultPageCount: number
11
- defaultPageSize: number
12
- }
13
- table: {
14
- headerCellStyle: Record<string, any>
15
- }
16
- form: {
17
- submitText: string
18
- resetText: string
19
- formItem: {
20
- components: {
21
- width: string
22
- }
23
- }
24
- }
25
- }
26
- }
27
-
28
- // 表格列配置
29
- export interface CommonTableColumn {
30
- prop: string
31
- label: string
32
- width?: string | number
33
- minWidth?: string | number
34
- fixed?: boolean | string
35
- sortable?: boolean | string
36
- formatter?: (row: any, column: any, cellValue: any, index: number) => string
37
- renderHeader?: (h: any, column: any) => any
38
- [key: string]: any
39
- }
40
-
41
- // 表单配置
42
- export interface CommonFormPropForm {
43
- components: {
44
- width: string
45
- }
46
- }
47
-
48
- // 分页参数
49
- export interface PaginationParam {
50
- page: number
51
- size: number
52
- total?: number
53
- }
54
-
55
- // 列表参数
56
- export interface ListParam extends PaginationParam {
57
- [key: string]: any
58
- }
59
-
60
- // 表格属性
61
- export interface CommonTableProps {
62
- columns: CommonTableColumn[]
63
- data: any[]
64
- loading?: boolean
65
- pagination?: boolean | PaginationParam
66
- [key: string]: any
67
- }
68
-
69
- // 表单属性
70
- export interface CommonFormProps {
71
- formItems: any[]
72
- modelValue: Record<string, any>
73
- form?: CommonFormPropForm
74
- [key: string]: any
75
- }
76
-
77
- // 查询表格属性
78
- export interface CommonQueryTableProps extends CommonTableProps {
79
- queryFormItems?: any[]
80
- [key: string]: any
81
- }
82
-
83
- // 组件属性类型
84
- export type CommonInputProps = InputProps
85
- export type CommonButtonProps = ButtonProps
86
- export interface CommonSelectProps {
87
- [key: string]: any
88
- }
89
- export interface CommonDatePickerProps {
90
- [key: string]: any
91
- }
92
- export interface CommonPaginationProps {
93
- [key: string]: any
94
- }
95
- export interface CommonCheckboxProps {
96
- [key: string]: any
97
- }
98
- export interface CommonRadioProps {
99
- [key: string]: any
100
- }
101
- export interface CommonSwitchProps {
102
- [key: string]: any
103
- }
104
-
105
- // 组件类型定义
106
- export declare const CommonInput: DefineComponent<CommonInputProps>
107
- export declare const CommonButton: DefineComponent<CommonButtonProps>
108
- export declare const CommonForm: DefineComponent<CommonFormProps>
109
- export declare const CommonTable: DefineComponent<CommonTableProps>
110
- export declare const CommonQueryTable: DefineComponent<CommonQueryTableProps>
111
- export declare const CommonPagination: DefineComponent<CommonPaginationProps>
112
- export declare const CommonSelect: DefineComponent<CommonSelectProps>
113
- export declare const CommonDatePicker: DefineComponent<CommonDatePickerProps>
114
- export declare const CommonCheckbox: DefineComponent<CommonCheckboxProps>
115
- export declare const CommonRadio: DefineComponent<CommonRadioProps>
116
- export declare const CommonSwitch: DefineComponent<CommonSwitchProps>
117
- export declare const CommonConfigProvider: DefineComponent<any>
118
-
119
- // 版本号
120
- export declare const version: string
1
+ import { AllowedComponentProps } from 'vue';
2
+ import { ButtonProps } from 'element-plus';
3
+ import { CheckboxGroupProps } from 'element-plus';
4
+ import { CheckboxGroupValueType } from 'element-plus';
5
+ import { Component } from 'vue';
6
+ import { ComponentCustomProps } from 'vue';
7
+ import { ComponentOptionsMixin } from 'vue';
8
+ import { ComponentProps } from 'vue-component-type-helpers';
9
+ import { ComponentProvideOptions } from 'vue';
10
+ import { ComputedRef } from 'vue';
11
+ import { DatePickerProps } from 'element-plus';
12
+ import { DefineComponent } from 'vue';
13
+ import { DistributeRef } from '@vue/reactivity';
14
+ import { EpPropMergeType } from 'element-plus/es/utils';
15
+ import { ExtractDefaultPropTypes } from 'vue';
16
+ import { ExtractPropTypes } from 'vue';
17
+ import { ExtractPublicPropTypes } from 'vue';
18
+ import { FormInstance } from 'element-plus';
19
+ import { FormItemProps } from 'element-plus';
20
+ import { FormProps } from 'element-plus';
21
+ import { IfAny } from '@vue/shared';
22
+ import { InjectionKey } from 'vue';
23
+ import { InputProps } from 'element-plus';
24
+ import { ModelRef } from 'vue';
25
+ import { ModelValueType } from 'element-plus';
26
+ import { PaginationProps } from 'element-plus';
27
+ import { PublicProps } from 'vue';
28
+ import { RadioGroupProps } from 'element-plus';
29
+ import { Reactive } from 'vue';
30
+ import { Ref } from 'vue';
31
+ import { SelectProps } from 'element-plus';
32
+ import { ShallowUnwrapRef } from 'vue';
33
+ import { SwitchProps } from 'element-plus';
34
+ import { TableColumnCtx } from 'element-plus';
35
+ import { TableInstance } from 'element-plus';
36
+ import { TableProps } from 'element-plus';
37
+ import { UnwrapRef } from 'vue';
38
+ import { VNode } from 'vue';
39
+ import { VNodeProps } from 'vue';
121
40
 
122
- // 配置对象
123
- export declare const config: Config
41
+ declare const __VLS_component: DefineComponent<CommonConfigProviderProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<CommonConfigProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
124
42
 
125
- // 插件定义
126
- export declare const plugin: Plugin
43
+ declare const __VLS_component_2: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
44
+ form: CommonFormPropForm<AnyObject>;
45
+ layouts: Array<CommonQueryTableLayoutsUnite>;
46
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
47
+ CommonFormRef: ShallowUnwrapRef<CommonFormExpose<AnyObject>> | null;
48
+ }, HTMLDivElement>;
127
49
 
128
- // 默认导出
129
- declare const defaultExport: Plugin
130
- export default defaultExport
50
+ declare const __VLS_component_3: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
51
+ change: (args_0: PaginationParam) => any;
52
+ "update:pageNo": (value: number) => any;
53
+ "update:pageSize": (value: number) => any;
54
+ }, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
55
+ onChange?: ((args_0: PaginationParam) => any) | undefined;
56
+ "onUpdate:pageNo"?: ((value: number) => any) | undefined;
57
+ "onUpdate:pageSize"?: ((value: number) => any) | undefined;
58
+ }>, {
59
+ readonly background: boolean;
60
+ readonly teleported: EpPropMergeType<BooleanConstructor, unknown, unknown>;
61
+ readonly layout: string;
62
+ readonly total: number;
63
+ readonly pageSizes: number[];
64
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
65
+
66
+ declare const __VLS_component_4: DefineComponent<__VLS_PublicProps_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
67
+ "update:modelValue": (value: any) => any;
68
+ }, string, PublicProps, Readonly<__VLS_PublicProps_2> & Readonly<{
69
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
70
+ }>, {
71
+ options: {
72
+ label: string;
73
+ value: any;
74
+ disabled?: boolean;
75
+ }[];
76
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
77
+
78
+ declare const __VLS_component_5: DefineComponent<__VLS_PublicProps_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
79
+ "update:modelValue": (value: string) => any;
80
+ } & {
81
+ enter: (event: KeyboardEvent) => any;
82
+ }, string, PublicProps, Readonly<__VLS_PublicProps_3> & Readonly<{
83
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
84
+ onEnter?: ((event: KeyboardEvent) => any) | undefined;
85
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
86
+
87
+ declare const __VLS_component_6: DefineComponent<CommonButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<CommonButtonProps> & Readonly<{}>, {
88
+ readonly type: EpPropMergeType<StringConstructor, "" | "default" | "text" | "success" | "primary" | "warning" | "info" | "danger", unknown>;
89
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
90
+
91
+ declare type __VLS_PrettifyLocal<T> = {
92
+ [K in keyof T]: T[K];
93
+ } & {};
94
+
95
+ declare type __VLS_PrettifyLocal_2<T> = {
96
+ [K in keyof T]: T[K];
97
+ } & {};
98
+
99
+ /** 组件Props定义,提供默认值 */
100
+ declare type __VLS_Props = CommonQueryTableProps;
101
+
102
+ /** 组件Props定义,提供默认值 */
103
+ declare type __VLS_Props_2 = CommonPaginationProps;
104
+
105
+ /** 组件Props定义,提供默认值 */
106
+ declare type __VLS_Props_3 = CommonSelectProps;
107
+
108
+ /** 组件Props定义,使用运行时定义避免类型问题 */
109
+ declare type __VLS_Props_4 = CommonInputProps;
110
+
111
+ /** 组件Props定义,提供默认值 */
112
+ declare type __VLS_Props_5 = CommonDatePickerProps;
113
+
114
+ /** 组件Props定义,提供默认值 */
115
+ declare type __VLS_Props_6 = CommonRadioProps;
116
+
117
+ declare type __VLS_Props_7 = CommonCheckboxProps;
118
+
119
+ /** 组件Props定义,提供默认值 */
120
+ declare type __VLS_Props_8 = CommonSwitchProps;
121
+
122
+ declare type __VLS_PublicProps = {
123
+ 'pageNo': typeof pageNo['value'];
124
+ 'pageSize': typeof pageSize['value'];
125
+ } & __VLS_Props_2;
126
+
127
+ declare type __VLS_PublicProps_2 = {
128
+ modelValue?: any;
129
+ } & __VLS_Props_3;
130
+
131
+ declare type __VLS_PublicProps_3 = {
132
+ modelValue?: string;
133
+ } & __VLS_Props_4;
134
+
135
+ declare type __VLS_PublicProps_4 = {
136
+ modelValue?: ModelValueType;
137
+ } & __VLS_Props_5;
138
+
139
+ declare type __VLS_PublicProps_5 = {
140
+ modelValue?: RadioGroupProps['modelValue'];
141
+ } & __VLS_Props_6;
142
+
143
+ declare type __VLS_PublicProps_6 = {
144
+ modelValue?: CheckboxGroupProps['modelValue'];
145
+ } & __VLS_Props_7;
146
+
147
+ declare type __VLS_PublicProps_7 = {
148
+ modelValue?: SwitchProps['modelValue'];
149
+ } & __VLS_Props_8;
150
+
151
+ declare function __VLS_template(): {
152
+ attrs: Partial<{}>;
153
+ slots: {
154
+ default?(_: {}): any;
155
+ };
156
+ refs: {};
157
+ rootEl: any;
158
+ };
159
+
160
+ declare function __VLS_template_2(): {
161
+ attrs: Partial<{}>;
162
+ slots: Partial<Record<NonNullable<CommonQueryTableLayoutsUnite>, (_: {}) => any>> & Partial<Record<any, (_: {
163
+ props: Partial<CommonSelectProps> | Partial<CommonInputProps> | Partial<CommonDatePickerProps> | Partial<CommonRadioProps> | Partial<CommonCheckboxProps> | Partial<CommonSwitchProps> | Partial<any> | undefined;
164
+ value: any;
165
+ updateValue: (val: any) => any;
166
+ }) => any>> & Partial<Record<any, (_: {
167
+ row: any;
168
+ column: any;
169
+ index: any;
170
+ value: any;
171
+ }) => any>> & Partial<Record<any, (_: any) => any>> & Partial<Record<NonNullable<"header" | "toolbar" | "footer">, (_: {}) => any>>;
172
+ refs: {
173
+ CommonFormRef: ShallowUnwrapRef<CommonFormExpose<AnyObject>> | null;
174
+ };
175
+ rootEl: HTMLDivElement;
176
+ };
177
+
178
+ declare function __VLS_template_3(): {
179
+ attrs: Partial<{}>;
180
+ slots: {
181
+ default?(_: {}): any;
182
+ };
183
+ refs: {};
184
+ rootEl: any;
185
+ };
186
+
187
+ declare function __VLS_template_4(): {
188
+ attrs: Partial<{}>;
189
+ slots: {
190
+ default?(_: {}): any;
191
+ };
192
+ refs: {};
193
+ rootEl: any;
194
+ };
195
+
196
+ declare function __VLS_template_5(): {
197
+ attrs: Partial<{}>;
198
+ slots: Partial<Record<number, (_: any) => any>>;
199
+ refs: {};
200
+ rootEl: any;
201
+ };
202
+
203
+ declare function __VLS_template_6(): {
204
+ attrs: Partial<{}>;
205
+ slots: {
206
+ default?(_: {}): any;
207
+ };
208
+ refs: {};
209
+ rootEl: any;
210
+ };
211
+
212
+ declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
213
+
214
+ declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
215
+
216
+ declare type __VLS_TemplateResult_3 = ReturnType<typeof __VLS_template_3>;
217
+
218
+ declare type __VLS_TemplateResult_4 = ReturnType<typeof __VLS_template_4>;
219
+
220
+ declare type __VLS_TemplateResult_5 = ReturnType<typeof __VLS_template_5>;
221
+
222
+ declare type __VLS_TemplateResult_6 = ReturnType<typeof __VLS_template_6>;
223
+
224
+ declare type __VLS_WithTemplateSlots<T, S> = T & {
225
+ new (): {
226
+ $slots: S;
227
+ };
228
+ };
229
+
230
+ declare type __VLS_WithTemplateSlots_2<T, S> = T & {
231
+ new (): {
232
+ $slots: S;
233
+ };
234
+ };
235
+
236
+ declare type __VLS_WithTemplateSlots_3<T, S> = T & {
237
+ new (): {
238
+ $slots: S;
239
+ };
240
+ };
241
+
242
+ declare type __VLS_WithTemplateSlots_4<T, S> = T & {
243
+ new (): {
244
+ $slots: S;
245
+ };
246
+ };
247
+
248
+ declare type __VLS_WithTemplateSlots_5<T, S> = T & {
249
+ new (): {
250
+ $slots: S;
251
+ };
252
+ };
253
+
254
+ declare type __VLS_WithTemplateSlots_6<T, S> = T & {
255
+ new (): {
256
+ $slots: S;
257
+ };
258
+ };
259
+
260
+ /**
261
+ * 任意数组类型
262
+ */
263
+ export declare type AnyArray = any[];
264
+
265
+ /**
266
+ * 任意函数类型
267
+ */
268
+ export declare type AnyFunction = (...args: any[]) => any;
269
+
270
+ /**
271
+ * 任意对象类型
272
+ */
273
+ export declare type AnyObject = Record<string, any>;
274
+
275
+ export declare const CommonButton: __VLS_WithTemplateSlots_6<typeof __VLS_component_6, __VLS_TemplateResult_6["slots"]>;
276
+
277
+ /** CommonButton组件属性类型,继承自Element Plus Button组件 */
278
+ export declare interface CommonButtonProps extends ExtractPublicPropTypes<ButtonProps> {
279
+ }
280
+
281
+ export declare const CommonCheckbox: DefineComponent<__VLS_PublicProps_6, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
282
+ "update:modelValue": (value: CheckboxGroupValueType) => any;
283
+ }, string, PublicProps, Readonly<__VLS_PublicProps_6> & Readonly<{
284
+ "onUpdate:modelValue"?: ((value: CheckboxGroupValueType) => any) | undefined;
285
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
286
+
287
+ /**
288
+ * 多选框
289
+ */
290
+ declare interface CommonCheckboxItem<T extends AnyObject> extends CommonFormSupplement<'check-box', CommonCheckboxProps, T> {
291
+ }
292
+
293
+ export declare interface CommonCheckboxProps extends ExtractPublicPropTypes<CheckboxGroupProps> {
294
+ }
295
+
296
+ export declare const CommonConfigProvider: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
297
+
298
+ /**
299
+ * CommonConfigProvider组件属性类型
300
+ * 继承自深度部分配置类型,支持配置项的部分覆盖
301
+ * 使用@vue-ignore忽略Vue类型检查
302
+ */
303
+ export declare interface CommonConfigProviderProps extends /* @vue-ignore */ DeepPartial<Config> {
304
+ }
305
+
306
+ /**
307
+ * 自定义组件
308
+ */
309
+ declare interface CommonCustomComponentsItem<T extends AnyObject, C extends Component = Component, P = ComponentProps<C>> extends CommonFormSupplement<C, P, T> {
310
+ }
311
+
312
+ export declare const CommonDatePicker: DefineComponent<__VLS_PublicProps_4, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
313
+ "update:modelValue": (value: ModelValueType) => any;
314
+ }, string, PublicProps, Readonly<__VLS_PublicProps_4> & Readonly<{
315
+ "onUpdate:modelValue"?: ((value: ModelValueType) => any) | undefined;
316
+ }>, {
317
+ readonly placeholder: string;
318
+ readonly clearable: EpPropMergeType<BooleanConstructor, unknown, unknown>;
319
+ readonly validateEvent: EpPropMergeType<BooleanConstructor, unknown, unknown>;
320
+ readonly showFooter: EpPropMergeType<BooleanConstructor, unknown, unknown>;
321
+ readonly valueFormat: string;
322
+ readonly startPlaceholder: string;
323
+ readonly endPlaceholder: string;
324
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
325
+
326
+ /**
327
+ * 日期选择器
328
+ */
329
+ declare interface CommonDatePickerItem<T extends AnyObject> extends CommonFormSupplement<'date-picker', CommonDatePickerProps, T> {
330
+ }
331
+
332
+ /** CommonDatePicker组件属性类型,继承自Element Plus DatePicker组件 */
333
+ export declare interface CommonDatePickerProps extends Partial<DatePickerProps> {
334
+ }
335
+
336
+ export declare const CommonForm: <T extends AnyObject>(__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<{
337
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
338
+ readonly onReset?: ((formData: AnyObject) => any) | undefined;
339
+ readonly onSubmit?: ((formData: AnyObject) => any) | undefined;
340
+ readonly "onUpdate:loading"?: ((value: boolean) => any) | undefined;
341
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, "onReset" | "onSubmit" | "onUpdate:loading"> & ({
342
+ loading?: boolean;
343
+ } & CommonFormProps<T>) & Partial<{}>> & PublicProps;
344
+ expose(exposed: ShallowUnwrapRef<CommonFormExpose<T>>): void;
345
+ attrs: any;
346
+ slots: Partial<Record<NonNullable<(string & {}) | keyof T>, (_: {
347
+ props: Partial<CommonSelectProps> | Partial<CommonInputProps> | Partial<CommonDatePickerProps> | Partial<CommonRadioProps> | Partial<CommonCheckboxProps> | Partial<CommonSwitchProps> | Partial<any> | undefined;
348
+ value: DistributeRef<Reactive<CommonFormData<T>>>[(string & {}) | keyof T];
349
+ updateValue: (val: any) => any;
350
+ }) => any>>;
351
+ emit: (((evt: "reset", formData: AnyObject) => void) & ((evt: "submit", formData: AnyObject) => void)) & ((evt: "update:loading", value: boolean) => void);
352
+ }>) => VNode & {
353
+ __ctx?: Awaited<typeof __VLS_setup>;
354
+ };
355
+
356
+ /**
357
+ * 表单数据类型,支持通过prop访问
358
+ */
359
+ export declare type CommonFormData<T extends AnyObject> = T & {
360
+ [key: string]: any;
361
+ };
362
+
363
+ /**
364
+ * CommonForm 组件实例暴露类型
365
+ * 继承 FormInstance 的所有方法,可直接调用 validate()、resetFields() 等
366
+ * 并且 导出 formData 数据
367
+ */
368
+ export declare interface CommonFormExpose<T extends AnyObject = AnyObject> extends FormInstance {
369
+ /** 表单数据对象 */
370
+ formData: Reactive<CommonFormData<T>>;
371
+ }
372
+
373
+ /**
374
+ * 输入框组件
375
+ */
376
+ declare interface CommonFormInputItem<T extends AnyObject> extends CommonFormSupplement<'input', CommonInputProps, T> {
377
+ }
378
+
379
+ export declare type CommonFormPropForm<T extends AnyObject> = Array<CommonFormSelectItem<T> | CommonFormInputItem<T> | CommonDatePickerItem<T> | CommonRadioItem<T> | CommonCustomComponentsItem<T> | CommonCheckboxItem<T> | CommonSwitchItem<T>>;
380
+
381
+ /**
382
+ * form 组件props
383
+ */
384
+ export declare interface CommonFormProps<T extends AnyObject> extends ExtractPropTypes<FormProps> {
385
+ form?: CommonFormPropForm<T>;
386
+ }
387
+
388
+ /**
389
+ * 选择器组件
390
+ */
391
+ declare interface CommonFormSelectItem<T extends AnyObject> extends CommonFormSupplement<'select', CommonSelectProps, T> {
392
+ }
393
+
394
+ declare interface CommonFormSupplement<T, P, D extends AnyObject, V = any> {
395
+ is: T;
396
+ label?: string;
397
+ prop: keyof D | (string & {});
398
+ props?: Partial<P>;
399
+ initialValue?: V;
400
+ formItem?: Partial<Omit<FormItemProps, 'prop' | 'label'>>;
401
+ }
402
+
403
+ export declare const CommonInput: __VLS_WithTemplateSlots_5<typeof __VLS_component_5, __VLS_TemplateResult_5["slots"]>;
404
+
405
+ /** CommonInput组件属性类型,忽略复杂类型检查 */
406
+ export declare interface CommonInputProps extends /* @vue-ignore */ ExtractDefaultPropTypes<InputProps> {
407
+ }
408
+
409
+ export declare const CommonPagination: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
410
+
411
+ /**
412
+ * CommonPagination组件属性类型
413
+ * 直接继承Element Plus分页组件的属性,所有属性均为可选
414
+ * Element Plus内部已用ExtractPropTypes处理过类型
415
+ */
416
+ export declare interface CommonPaginationProps extends Partial<PaginationProps> {
417
+ }
418
+
419
+ export declare const CommonQueryTable: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
420
+
421
+ /** 布局名 联合类型 */
422
+ export declare type CommonQueryTableLayoutsUnite = 'header' | 'form' | 'toolbar' | 'table' | 'pagination' | 'footer';
423
+
424
+ export declare interface CommonQueryTableProps<T extends AnyObject = AnyObject> {
425
+ /**
426
+ * 数据获取函数
427
+ * @param params - 查询参数,包含分页和表单查询条件
428
+ * @returns Promise 包含数据列表和总数的对象
429
+ */
430
+ fetch: (params?: ListParam) => Promise<{
431
+ list: T[];
432
+ total: string | number;
433
+ }>;
434
+ /**
435
+ * 表单配置数组
436
+ * 定义查询表单的字段和属性
437
+ */
438
+ form?: CommonFormPropForm<T>;
439
+ /**
440
+ * 表格列配置
441
+ * 定义表格的列结构和展示方式
442
+ */
443
+ columns: CommonTableColumn<T>;
444
+ /**
445
+ * 页面布局配置
446
+ * 控制页面中各个组件的显示顺序
447
+ * @default ['form', 'table', 'pagination']
448
+ */
449
+ layouts?: Array<CommonQueryTableLayoutsUnite>;
450
+ }
451
+
452
+ export declare const CommonRadio: DefineComponent<__VLS_PublicProps_5, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
453
+ "update:modelValue": (value: EpPropMergeType<readonly [StringConstructor, NumberConstructor, BooleanConstructor], unknown, unknown> | undefined) => any;
454
+ }, string, PublicProps, Readonly<__VLS_PublicProps_5> & Readonly<{
455
+ "onUpdate:modelValue"?: ((value: EpPropMergeType<readonly [StringConstructor, NumberConstructor, BooleanConstructor], unknown, unknown> | undefined) => any) | undefined;
456
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
457
+
458
+ /**
459
+ * 单选框
460
+ */
461
+ declare interface CommonRadioItem<T extends AnyObject> extends CommonFormSupplement<'radio', CommonRadioProps, T> {
462
+ }
463
+
464
+ /** CommonRadio组件属性类型,提取自Element Plus RadioGroup组件的公共属性 */
465
+ export declare interface CommonRadioProps extends ExtractPublicPropTypes<RadioGroupProps> {
466
+ }
467
+
468
+ export declare const CommonSelect: __VLS_WithTemplateSlots_4<typeof __VLS_component_4, __VLS_TemplateResult_4["slots"]>;
469
+
470
+ /**
471
+ * CommonSelect组件属性类型
472
+ * 继承自Element Plus Select组件的属性,所有属性均为可选
473
+ */
474
+ export declare interface CommonSelectProps extends /* @vue-ignore */ ExtractDefaultPropTypes<SelectProps> {
475
+ options?: {
476
+ label: string;
477
+ value: any;
478
+ disabled?: boolean;
479
+ }[];
480
+ }
481
+
482
+ export declare const CommonSwitch: DefineComponent<__VLS_PublicProps_7, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
483
+ "update:modelValue": (value: EpPropMergeType<readonly [BooleanConstructor, StringConstructor, NumberConstructor], unknown, unknown>) => any;
484
+ }, string, PublicProps, Readonly<__VLS_PublicProps_7> & Readonly<{
485
+ "onUpdate:modelValue"?: ((value: EpPropMergeType<readonly [BooleanConstructor, StringConstructor, NumberConstructor], unknown, unknown>) => any) | undefined;
486
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
487
+
488
+ /**
489
+ * 开关
490
+ */
491
+ declare interface CommonSwitchItem<T extends AnyObject> extends CommonFormSupplement<'switch', CommonSwitchProps, T> {
492
+ }
493
+
494
+ /**
495
+ * CommonSwitch组件属性类型
496
+ * 继承自Element Plus Switch组件的公共属性,并扩展自定义颜色配置
497
+ */
498
+ export declare interface CommonSwitchProps extends ExtractPublicPropTypes<SwitchProps> {
499
+ /**
500
+ * 活跃状态时的背景颜色
501
+ */
502
+ activeColor?: string;
503
+ /**
504
+ * 不活跃状态时的背景颜色
505
+ */
506
+ inactiveColor?: string;
507
+ /**
508
+ * 开关的边框颜色
509
+ */
510
+ borderColor?: string;
511
+ }
512
+
513
+ export declare const CommonTable: <T extends AnyObject>(__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<{
514
+ props: __VLS_PrettifyLocal_2<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & CommonTableProps<T> & Partial<{}>> & PublicProps;
515
+ expose(exposed: ShallowUnwrapRef<CommonTableExpose>): void;
516
+ attrs: any;
517
+ slots: Partial<Record<string, (_: {
518
+ row: any;
519
+ column: any;
520
+ index: any;
521
+ value: any;
522
+ }) => any>> & {
523
+ empty?(_: {}): any;
524
+ };
525
+ emit: {};
526
+ }>) => VNode & {
527
+ __ctx?: Awaited<typeof __VLS_setup>;
528
+ };
529
+
530
+ /** Columns 为 Array 时的ts类型 */
531
+ export declare type CommonTableArrayColumns<T extends AnyObject> = Array<CommonTableColumnRoot<T>>;
532
+
533
+ export declare type CommonTableColumn<T extends AnyObject> = CommonTableArrayColumns<T> | CommonTableObjectColumns<T>;
534
+
535
+ /**
536
+ * Column 根类型 要求 prop 、label 为必传
537
+ */
538
+ export declare type CommonTableColumnRoot<T extends AnyObject> = TableColumnSupplement<T> | TableColumnTypeIndex<T> | TableColumnTypeSelection<T> | TableColumnTypeExpand<T> | TableColumnTypeDate<T> | TableColumnTypeDateTime<T>;
539
+
540
+ /** CommonTable 暴露给父组件的实例类型(包含 ElTable 所有方法) */
541
+ export declare interface CommonTableExpose extends TableInstance {
542
+ }
543
+
544
+ /**
545
+ * CommonTable 组件实例暴露类型
546
+ */
547
+ export declare interface CommonTableInstance {
548
+ /** ElTable 组件实例引用 */
549
+ elTableRef: Ref<TableInstance | undefined>;
550
+ }
551
+
552
+ /** Columns 为 Object 时的ts类型 */
553
+ declare type CommonTableObjectColumns<T extends AnyObject> = Record<keyof T | (string & {}), CommonTableColumnRoot<T>>;
554
+
555
+ export declare interface CommonTableProps<T extends AnyObject = AnyObject> extends ExtractPropTypes<Omit<TableProps<T>, 'data' | 'headerCellStyle'>> {
556
+ /** table 表格需要的表头 */
557
+ columns: CommonTableColumn<T>;
558
+ data: T[];
559
+ }
560
+
561
+ export declare interface Config {
562
+ component: {
563
+ /** 空值占位 */
564
+ placeholder: string;
565
+ /** 分页组件默认分页数据 */
566
+ pagination: {
567
+ /** 默认请求起始页数 */
568
+ defaultPageCount: number;
569
+ /** 默认每页请求的条数 */
570
+ defaultPageSize: number;
571
+ };
572
+ /** 表格组件 */
573
+ table: {};
574
+ /** 表单组件 */
575
+ form: {
576
+ /** 表单组件的每个 formItem */
577
+ formItem: {
578
+ /** 表单组件 formItem 里的组件 如 input select date */
579
+ components: {
580
+ width: string;
581
+ };
582
+ };
583
+ /** 提交按钮文本 */
584
+ submitText: string;
585
+ /** 重置按钮文本 */
586
+ resetText: string;
587
+ };
588
+ };
589
+ }
590
+
591
+ export declare const config: {
592
+ component: {
593
+ placeholder: string;
594
+ pagination: {
595
+ defaultPageCount: number;
596
+ defaultPageSize: number;
597
+ };
598
+ table: {};
599
+ form: {
600
+ formItem: {
601
+ components: {
602
+ width: string;
603
+ };
604
+ };
605
+ submitText: string;
606
+ resetText: string;
607
+ };
608
+ };
609
+ };
610
+
611
+ /**
612
+ * common 的接收配置项
613
+ */
614
+ export declare const configInjectKey: InjectionKey<Config>;
615
+
616
+ /**
617
+ * 深度 Partial 类型
618
+ */
619
+ export declare type DeepPartial<T> = T extends object ? {
620
+ [P in keyof T]?: DeepPartial<T[P]>;
621
+ } : T;
622
+
623
+ /**
624
+ * 过滤对象中的 null 和 undefined 值
625
+ * @param obj 要过滤的对象
626
+ * @returns 新对象,不包含 null 或 undefined 值的属性
627
+ */
628
+ export declare function filterNullAndUndefined<T extends AnyObject>(obj: T): T;
629
+
630
+ /** 获取上层配置的 config */
631
+ export declare function getCommonProviderConfig(): {
632
+ component: {
633
+ placeholder: string;
634
+ pagination: {
635
+ defaultPageCount: number;
636
+ defaultPageSize: number;
637
+ };
638
+ table: {};
639
+ form: {
640
+ formItem: {
641
+ components: {
642
+ width: string;
643
+ };
644
+ };
645
+ submitText: string;
646
+ resetText: string;
647
+ };
648
+ };
649
+ };
650
+
651
+ /**
652
+ * 返回所有参数中首位不为 null undefined ''的 值
653
+ * @param args
654
+ * @returns
655
+ */
656
+ export declare function getFirstValidValue<T>(...args: T[]): T | undefined;
657
+
658
+ /**
659
+ * 列表请求 参数要求,包含分页
660
+ */
661
+ export declare type ListParam<T extends AnyObject = AnyObject> = PaginationParam & T;
662
+
663
+ /**
664
+ * 指定的字段变为可选,其他字段保持不变。
665
+ */
666
+ export declare type OptionalFields<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
667
+
668
+ /** 当前页码,支持v-model双向绑定 */
669
+ declare const pageNo: ModelRef<number, string, number, number>;
670
+
671
+ /** 每页显示条数,支持v-model双向绑定 */
672
+ declare const pageSize: ModelRef<number, string, number, number>;
673
+
674
+ /**
675
+ * 分页请求 参数要求
676
+ */
677
+ export declare type PaginationParam = {
678
+ pageNo: number;
679
+ pageSize: number;
680
+ };
681
+
682
+ /**
683
+ * 提取指定属性的联合类型,自动过滤掉没有该属性的类型
684
+ */
685
+ export declare type PickProperty<T, K extends PropertyKey> = T extends {
686
+ [P in K]: infer U;
687
+ } ? U : never;
688
+
689
+ /**
690
+ * 指定的字段变为必填,其他字段保持不变。
691
+ * @example
692
+ * type User = { id: number; name?: string; age?: number };
693
+ * type UserWithRequiredName = RequiredSomeFields<User, 'name'>; // { id: number; name: string; age?: number }
694
+ */
695
+ export declare type RequiredSomeFields<T extends object, K extends keyof T> = Omit<T, K> & {
696
+ [P in K]-?: T[P];
697
+ };
698
+
699
+ /** 增强 TableColumn 的类型 */
700
+ declare interface TableColumnSupplement<T extends AnyObject> extends Partial<Omit<TableColumnCtx<T>, 'prop' | 'type'>> {
701
+ prop: keyof T | (string & {});
702
+ type?: 'index' | 'selection' | 'expand' | 'date' | 'dateTime';
703
+ }
704
+
705
+ /**
706
+ * 日期时间
707
+ */
708
+ declare interface TableColumnTypeDate<T extends AnyObject> extends TableColumnSupplement<T> {
709
+ /** 时间内容 */
710
+ type: 'date';
711
+ }
712
+
713
+ /**
714
+ * 日期时间
715
+ */
716
+ declare interface TableColumnTypeDateTime<T extends AnyObject> extends TableColumnSupplement<T> {
717
+ /** 时间内容 */
718
+ type: 'dateTime';
719
+ }
720
+
721
+ /**
722
+ * 可展开的按钮
723
+ */
724
+ declare interface TableColumnTypeExpand<T extends AnyObject> extends OptionalFields<TableColumnSupplement<T>, 'prop'> {
725
+ type: 'expand';
726
+ }
727
+
728
+ /**
729
+ * 下标
730
+ */
731
+ declare interface TableColumnTypeIndex<T extends AnyObject> extends OptionalFields<TableColumnSupplement<T>, 'prop'> {
732
+ type: 'index';
733
+ }
734
+
735
+ /**
736
+ * 选择器
737
+ */
738
+ declare interface TableColumnTypeSelection<T extends AnyObject> extends OptionalFields<TableColumnSupplement<T>, 'prop'> {
739
+ type: 'selection';
740
+ selectable?: (row: T, index: number) => boolean;
741
+ 'reserve-selection'?: boolean;
742
+ }
743
+
744
+ /**
745
+ * 将联合类型中某个字段的值当作key, 类型当作value
746
+ */
747
+ export declare type UnionToRecord<T, K extends keyof any> = {
748
+ [P in T extends any ? T extends Record<K, infer U extends PropertyKey> ? U : never : never]: Extract<T, Record<K, P>>;
749
+ };
750
+
751
+ export declare function useGetComponentsChildrenAttrs<K extends string>(keys: K[]): ComputedRef<Record<K, AnyObject>>;
752
+
753
+ export declare function useGetComponentsChildrenSlots<K extends string>(keys: K[]): ComputedRef<Record<K, AnyObject> | undefined>;
754
+
755
+ /**
756
+ * 创建一个可重置的响应式对象
757
+ * @param value 初始值
758
+ * @param clone 克隆函数
759
+ * @returns 一个数组,包含 state 和 reset 方法
760
+ * @example
761
+ * const [state, reset] = useResettableReactive({ count: 0 })
762
+ * state.count++ // 1
763
+ * reset() // 重置为初始值 { count: 0 }
764
+ */
765
+ export declare function useResettableReactive<T extends object>(value: T, clone?: <T_1>(value: T_1) => T_1): readonly [Reactive<T>, () => void];
766
+
767
+ /**
768
+ * 创建一个可重置的值
769
+ * @param value 初始值
770
+ * @param format 格式化函数
771
+ * @returns 一个数组,包含 state 和 reset 方法
772
+ * @example
773
+ * // 基本使用
774
+ * const [state, reset] = useResettableRef({ count: 0 })
775
+ * state.value.count++ // 1
776
+ * reset() // 重置为初始值 { count: 0 }
777
+ */
778
+ export declare function useResettableRef<T>(value: T, clone?: <T_1>(value: T_1) => T_1): readonly [[T] extends [Ref<any, any>] ? IfAny<T, Ref<T, T>, T> : Ref<UnwrapRef<T>, T | UnwrapRef<T>>, () => void];
779
+
780
+ export declare const version: string;
781
+
782
+ export { }