@yidun/antd-super-table 0.1.1 → 0.1.3

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.
@@ -0,0 +1,518 @@
1
+ /**
2
+ * 动态列表组件,支持拖拽排序
3
+ */
4
+ import { h } from 'vue';
5
+ import { PlusOutlined, HolderOutlined, MinusCircleOutlined } from '@ant-design/icons-vue';
6
+ import vuedraggable from 'vuedraggable';
7
+ import { isFunction } from 'lodash-es';
8
+ import type { PropType } from 'vue';
9
+ declare const dataList: import("vue").Ref<Record<string, any>[], Record<string, any>[]>;
10
+ /**
11
+ * 添加数据,加到指定索引后面
12
+ * @param {number} index - 插入位置的索引
13
+ */
14
+ declare const insertItem: (index: number) => void;
15
+ /**
16
+ * 删除数据
17
+ * @param {number} index - 要删除的项的索引
18
+ */
19
+ declare const deleteItem: (index: number) => void;
20
+ declare const __VLS_ctx: {
21
+ $style: Record<string, string> & __VLS_PrettifyGlobal<{} & {
22
+ "dynamicList": string;
23
+ } & {
24
+ "dynamicListItem": string;
25
+ } & {
26
+ "dynamicListItemContent": string;
27
+ } & {
28
+ "actionsIcons": string;
29
+ } & {
30
+ "dragIcon": string;
31
+ } & {
32
+ "dynamicListItem": string;
33
+ }>;
34
+ $: import("vue").ComponentInternalInstance;
35
+ $data: {};
36
+ $props: Partial<{
37
+ value: Record<string, any>[];
38
+ itemKey: string;
39
+ maxLength: number;
40
+ className: string;
41
+ itemClassName: string;
42
+ addButtonProps: Function | Record<string, any>;
43
+ addButtonText: string;
44
+ deleteButtonProps: Function | Record<string, any>;
45
+ deleteButtonText: string;
46
+ sortButtonProps: Function | Record<string, any>;
47
+ sortable: boolean;
48
+ getNewItemData: Function;
49
+ }> & Omit<{
50
+ readonly value: Record<string, any>[];
51
+ readonly itemKey: string;
52
+ readonly maxLength: number;
53
+ readonly className: string;
54
+ readonly itemClassName: string;
55
+ readonly addButtonProps: Function | Record<string, any>;
56
+ readonly addButtonText: string;
57
+ readonly deleteButtonProps: Function | Record<string, any>;
58
+ readonly deleteButtonText: string;
59
+ readonly sortButtonProps: Function | Record<string, any>;
60
+ readonly sortable: boolean;
61
+ readonly getNewItemData: Function;
62
+ readonly onAdd?: ((...args: any[]) => any) | undefined;
63
+ readonly onChange?: ((...args: any[]) => any) | undefined;
64
+ readonly "onUpdate:value"?: ((...args: any[]) => any) | undefined;
65
+ readonly onRemove?: ((...args: any[]) => any) | undefined;
66
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "value" | "itemKey" | "maxLength" | "className" | "itemClassName" | "addButtonProps" | "addButtonText" | "deleteButtonProps" | "deleteButtonText" | "sortButtonProps" | "sortable" | "getNewItemData">;
67
+ $attrs: {
68
+ [x: string]: unknown;
69
+ };
70
+ $refs: {
71
+ [x: string]: unknown;
72
+ };
73
+ $slots: Readonly<{
74
+ [name: string]: import("vue").Slot<any> | undefined;
75
+ }>;
76
+ $root: import("vue").ComponentPublicInstance | null;
77
+ $parent: import("vue").ComponentPublicInstance | null;
78
+ $host: Element | null;
79
+ $emit: ((event: "add", ...args: any[]) => void) & ((event: "change", ...args: any[]) => void) & ((event: "update:value", ...args: any[]) => void) & ((event: "remove", ...args: any[]) => void);
80
+ $el: any;
81
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
82
+ /**
83
+ * 列表数据
84
+ * @default []
85
+ */
86
+ value: {
87
+ type: PropType<Record<string, any>[]>;
88
+ default: () => never[];
89
+ };
90
+ /**
91
+ * 最大条数
92
+ * @default 10
93
+ */
94
+ maxLength: {
95
+ type: NumberConstructor;
96
+ default: number;
97
+ };
98
+ /**
99
+ * 组件class
100
+ * @default ''
101
+ */
102
+ className: {
103
+ type: StringConstructor;
104
+ default: string;
105
+ };
106
+ /**
107
+ * 列表中每一项对应的 class
108
+ * @default ''
109
+ */
110
+ itemClassName: {
111
+ type: StringConstructor;
112
+ default: string;
113
+ };
114
+ /**
115
+ * 添加按钮属性
116
+ * @default () => ({})
117
+ */
118
+ addButtonProps: {
119
+ type: (ObjectConstructor | FunctionConstructor)[];
120
+ default: () => {};
121
+ };
122
+ /**
123
+ * 添加按钮文案
124
+ * @default '添加数据'
125
+ */
126
+ addButtonText: {
127
+ type: StringConstructor;
128
+ default: string;
129
+ };
130
+ /**
131
+ * 删除按钮属性
132
+ * @default () => ({ icon: h(MinusCircleOutlined) })
133
+ */
134
+ deleteButtonProps: {
135
+ type: (ObjectConstructor | FunctionConstructor)[];
136
+ default: () => {
137
+ icon: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
138
+ [key: string]: any;
139
+ }>;
140
+ };
141
+ };
142
+ /**
143
+ * 删除按钮文案
144
+ * @default ''
145
+ */
146
+ deleteButtonText: {
147
+ type: StringConstructor;
148
+ default: string;
149
+ };
150
+ /**
151
+ * 排序按钮属性
152
+ * @default () => ({ icon: h(HolderOutlined) })
153
+ */
154
+ sortButtonProps: {
155
+ type: (ObjectConstructor | FunctionConstructor)[];
156
+ default: () => {
157
+ icon: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
158
+ [key: string]: any;
159
+ }>;
160
+ };
161
+ };
162
+ /**
163
+ * 是否开启拖拽排序
164
+ * @default true
165
+ */
166
+ sortable: {
167
+ type: BooleanConstructor;
168
+ default: boolean;
169
+ };
170
+ /**
171
+ * vuedraggable itemKey
172
+ * @default 'id'
173
+ */
174
+ itemKey: {
175
+ type: StringConstructor;
176
+ default: string;
177
+ };
178
+ /**
179
+ * 获取新增加的数据默认值
180
+ * @param {Record<string, any>} item - 当前项数据
181
+ * @returns {Record<string, any>} 新增项的默认数据
182
+ * @default () => (item) => item
183
+ */
184
+ getNewItemData: {
185
+ type: FunctionConstructor;
186
+ default: () => (item: Record<string, any>) => Record<string, any>;
187
+ };
188
+ }>> & Readonly<{
189
+ onAdd?: ((...args: any[]) => any) | undefined;
190
+ onChange?: ((...args: any[]) => any) | undefined;
191
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
192
+ onRemove?: ((...args: any[]) => any) | undefined;
193
+ }>, {
194
+ h: typeof h;
195
+ PlusOutlined: typeof PlusOutlined;
196
+ HolderOutlined: typeof HolderOutlined;
197
+ MinusCircleOutlined: typeof MinusCircleOutlined;
198
+ vuedraggable: typeof vuedraggable;
199
+ isFunction: typeof isFunction;
200
+ dataList: typeof dataList;
201
+ insertItem: typeof insertItem;
202
+ deleteItem: typeof deleteItem;
203
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
204
+ add: (...args: any[]) => void;
205
+ change: (...args: any[]) => void;
206
+ "update:value": (...args: any[]) => void;
207
+ remove: (...args: any[]) => void;
208
+ }, string, {
209
+ value: Record<string, any>[];
210
+ itemKey: string;
211
+ maxLength: number;
212
+ className: string;
213
+ itemClassName: string;
214
+ addButtonProps: Function | Record<string, any>;
215
+ addButtonText: string;
216
+ deleteButtonProps: Function | Record<string, any>;
217
+ deleteButtonText: string;
218
+ sortButtonProps: Function | Record<string, any>;
219
+ sortable: boolean;
220
+ getNewItemData: Function;
221
+ }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
222
+ beforeCreate?: (() => void) | (() => void)[];
223
+ created?: (() => void) | (() => void)[];
224
+ beforeMount?: (() => void) | (() => void)[];
225
+ mounted?: (() => void) | (() => void)[];
226
+ beforeUpdate?: (() => void) | (() => void)[];
227
+ updated?: (() => void) | (() => void)[];
228
+ activated?: (() => void) | (() => void)[];
229
+ deactivated?: (() => void) | (() => void)[];
230
+ beforeDestroy?: (() => void) | (() => void)[];
231
+ beforeUnmount?: (() => void) | (() => void)[];
232
+ destroyed?: (() => void) | (() => void)[];
233
+ unmounted?: (() => void) | (() => void)[];
234
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
235
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
236
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
237
+ };
238
+ $forceUpdate: () => void;
239
+ $nextTick: typeof import("vue").nextTick;
240
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
241
+ value: Record<string, any>[];
242
+ itemKey: string;
243
+ maxLength: number;
244
+ className: string;
245
+ itemClassName: string;
246
+ addButtonProps: Function | Record<string, any>;
247
+ addButtonText: string;
248
+ deleteButtonProps: Function | Record<string, any>;
249
+ deleteButtonText: string;
250
+ sortButtonProps: Function | Record<string, any>;
251
+ sortable: boolean;
252
+ getNewItemData: Function;
253
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
254
+ onChange?: ((...args: any[]) => any) | undefined;
255
+ onAdd?: ((...args: any[]) => any) | undefined;
256
+ onRemove?: ((...args: any[]) => any) | undefined;
257
+ h: typeof h;
258
+ PlusOutlined: typeof PlusOutlined;
259
+ HolderOutlined: typeof HolderOutlined;
260
+ MinusCircleOutlined: typeof MinusCircleOutlined;
261
+ vuedraggable: typeof vuedraggable;
262
+ isFunction: typeof isFunction;
263
+ dataList: Record<string, any>[];
264
+ insertItem: typeof insertItem;
265
+ deleteItem: typeof deleteItem;
266
+ };
267
+ declare var __VLS_5: {
268
+ item: any;
269
+ index: any;
270
+ };
271
+ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
272
+ default?: (props: typeof __VLS_5) => any;
273
+ }>;
274
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
275
+ /**
276
+ * 列表数据
277
+ * @default []
278
+ */
279
+ value: {
280
+ type: PropType<Record<string, any>[]>;
281
+ default: () => never[];
282
+ };
283
+ /**
284
+ * 最大条数
285
+ * @default 10
286
+ */
287
+ maxLength: {
288
+ type: NumberConstructor;
289
+ default: number;
290
+ };
291
+ /**
292
+ * 组件class
293
+ * @default ''
294
+ */
295
+ className: {
296
+ type: StringConstructor;
297
+ default: string;
298
+ };
299
+ /**
300
+ * 列表中每一项对应的 class
301
+ * @default ''
302
+ */
303
+ itemClassName: {
304
+ type: StringConstructor;
305
+ default: string;
306
+ };
307
+ /**
308
+ * 添加按钮属性
309
+ * @default () => ({})
310
+ */
311
+ addButtonProps: {
312
+ type: (ObjectConstructor | FunctionConstructor)[];
313
+ default: () => {};
314
+ };
315
+ /**
316
+ * 添加按钮文案
317
+ * @default '添加数据'
318
+ */
319
+ addButtonText: {
320
+ type: StringConstructor;
321
+ default: string;
322
+ };
323
+ /**
324
+ * 删除按钮属性
325
+ * @default () => ({ icon: h(MinusCircleOutlined) })
326
+ */
327
+ deleteButtonProps: {
328
+ type: (ObjectConstructor | FunctionConstructor)[];
329
+ default: () => {
330
+ icon: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
331
+ [key: string]: any;
332
+ }>;
333
+ };
334
+ };
335
+ /**
336
+ * 删除按钮文案
337
+ * @default ''
338
+ */
339
+ deleteButtonText: {
340
+ type: StringConstructor;
341
+ default: string;
342
+ };
343
+ /**
344
+ * 排序按钮属性
345
+ * @default () => ({ icon: h(HolderOutlined) })
346
+ */
347
+ sortButtonProps: {
348
+ type: (ObjectConstructor | FunctionConstructor)[];
349
+ default: () => {
350
+ icon: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
351
+ [key: string]: any;
352
+ }>;
353
+ };
354
+ };
355
+ /**
356
+ * 是否开启拖拽排序
357
+ * @default true
358
+ */
359
+ sortable: {
360
+ type: BooleanConstructor;
361
+ default: boolean;
362
+ };
363
+ /**
364
+ * vuedraggable itemKey
365
+ * @default 'id'
366
+ */
367
+ itemKey: {
368
+ type: StringConstructor;
369
+ default: string;
370
+ };
371
+ /**
372
+ * 获取新增加的数据默认值
373
+ * @param {Record<string, any>} item - 当前项数据
374
+ * @returns {Record<string, any>} 新增项的默认数据
375
+ * @default () => (item) => item
376
+ */
377
+ getNewItemData: {
378
+ type: FunctionConstructor;
379
+ default: () => (item: Record<string, any>) => Record<string, any>;
380
+ };
381
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
382
+ add: (...args: any[]) => void;
383
+ change: (...args: any[]) => void;
384
+ "update:value": (...args: any[]) => void;
385
+ remove: (...args: any[]) => void;
386
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
387
+ /**
388
+ * 列表数据
389
+ * @default []
390
+ */
391
+ value: {
392
+ type: PropType<Record<string, any>[]>;
393
+ default: () => never[];
394
+ };
395
+ /**
396
+ * 最大条数
397
+ * @default 10
398
+ */
399
+ maxLength: {
400
+ type: NumberConstructor;
401
+ default: number;
402
+ };
403
+ /**
404
+ * 组件class
405
+ * @default ''
406
+ */
407
+ className: {
408
+ type: StringConstructor;
409
+ default: string;
410
+ };
411
+ /**
412
+ * 列表中每一项对应的 class
413
+ * @default ''
414
+ */
415
+ itemClassName: {
416
+ type: StringConstructor;
417
+ default: string;
418
+ };
419
+ /**
420
+ * 添加按钮属性
421
+ * @default () => ({})
422
+ */
423
+ addButtonProps: {
424
+ type: (ObjectConstructor | FunctionConstructor)[];
425
+ default: () => {};
426
+ };
427
+ /**
428
+ * 添加按钮文案
429
+ * @default '添加数据'
430
+ */
431
+ addButtonText: {
432
+ type: StringConstructor;
433
+ default: string;
434
+ };
435
+ /**
436
+ * 删除按钮属性
437
+ * @default () => ({ icon: h(MinusCircleOutlined) })
438
+ */
439
+ deleteButtonProps: {
440
+ type: (ObjectConstructor | FunctionConstructor)[];
441
+ default: () => {
442
+ icon: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
443
+ [key: string]: any;
444
+ }>;
445
+ };
446
+ };
447
+ /**
448
+ * 删除按钮文案
449
+ * @default ''
450
+ */
451
+ deleteButtonText: {
452
+ type: StringConstructor;
453
+ default: string;
454
+ };
455
+ /**
456
+ * 排序按钮属性
457
+ * @default () => ({ icon: h(HolderOutlined) })
458
+ */
459
+ sortButtonProps: {
460
+ type: (ObjectConstructor | FunctionConstructor)[];
461
+ default: () => {
462
+ icon: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
463
+ [key: string]: any;
464
+ }>;
465
+ };
466
+ };
467
+ /**
468
+ * 是否开启拖拽排序
469
+ * @default true
470
+ */
471
+ sortable: {
472
+ type: BooleanConstructor;
473
+ default: boolean;
474
+ };
475
+ /**
476
+ * vuedraggable itemKey
477
+ * @default 'id'
478
+ */
479
+ itemKey: {
480
+ type: StringConstructor;
481
+ default: string;
482
+ };
483
+ /**
484
+ * 获取新增加的数据默认值
485
+ * @param {Record<string, any>} item - 当前项数据
486
+ * @returns {Record<string, any>} 新增项的默认数据
487
+ * @default () => (item) => item
488
+ */
489
+ getNewItemData: {
490
+ type: FunctionConstructor;
491
+ default: () => (item: Record<string, any>) => Record<string, any>;
492
+ };
493
+ }>> & Readonly<{
494
+ onAdd?: ((...args: any[]) => any) | undefined;
495
+ onChange?: ((...args: any[]) => any) | undefined;
496
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
497
+ onRemove?: ((...args: any[]) => any) | undefined;
498
+ }>, {
499
+ value: Record<string, any>[];
500
+ itemKey: string;
501
+ maxLength: number;
502
+ className: string;
503
+ itemClassName: string;
504
+ addButtonProps: Function | Record<string, any>;
505
+ addButtonText: string;
506
+ deleteButtonProps: Function | Record<string, any>;
507
+ deleteButtonText: string;
508
+ sortButtonProps: Function | Record<string, any>;
509
+ sortable: boolean;
510
+ getNewItemData: Function;
511
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
512
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
513
+ export default _default;
514
+ type __VLS_WithSlots<T, S> = T & {
515
+ new (): {
516
+ $slots: S;
517
+ };
518
+ };