cosey 0.3.11 → 0.3.12
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.
|
@@ -5,7 +5,7 @@ export * from './useTable';
|
|
|
5
5
|
declare const _Table: {
|
|
6
6
|
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
7
7
|
api: {
|
|
8
|
-
type: import("vue").PropType<(...args: any[]) => Promise<any
|
|
8
|
+
type: import("vue").PropType<(...args: any[]) => Promise<any> | any>;
|
|
9
9
|
};
|
|
10
10
|
immediate: {
|
|
11
11
|
type: BooleanConstructor;
|
|
@@ -167,12 +167,15 @@ declare const _Table: {
|
|
|
167
167
|
disabled: BooleanConstructor;
|
|
168
168
|
}>>>;
|
|
169
169
|
};
|
|
170
|
-
|
|
170
|
+
transformParams: {
|
|
171
171
|
type: import("vue").PropType<(params: Record<string, any>) => any>;
|
|
172
172
|
};
|
|
173
|
-
|
|
173
|
+
transformResponse: {
|
|
174
174
|
type: import("vue").PropType<(res: any) => any>;
|
|
175
175
|
};
|
|
176
|
+
parallelFetch: {
|
|
177
|
+
type: import("vue").PropType<(...args: any[]) => Promise<any> | any>;
|
|
178
|
+
};
|
|
176
179
|
toolbarConfig: {
|
|
177
180
|
type: import("vue").PropType<import("./table").ToolbarConfig | boolean>;
|
|
178
181
|
default: boolean;
|
|
@@ -328,7 +331,7 @@ declare const _Table: {
|
|
|
328
331
|
Defaults: {};
|
|
329
332
|
}, Readonly<import("vue").ExtractPropTypes<{
|
|
330
333
|
api: {
|
|
331
|
-
type: import("vue").PropType<(...args: any[]) => Promise<any
|
|
334
|
+
type: import("vue").PropType<(...args: any[]) => Promise<any> | any>;
|
|
332
335
|
};
|
|
333
336
|
immediate: {
|
|
334
337
|
type: BooleanConstructor;
|
|
@@ -490,12 +493,15 @@ declare const _Table: {
|
|
|
490
493
|
disabled: BooleanConstructor;
|
|
491
494
|
}>>>;
|
|
492
495
|
};
|
|
493
|
-
|
|
496
|
+
transformParams: {
|
|
494
497
|
type: import("vue").PropType<(params: Record<string, any>) => any>;
|
|
495
498
|
};
|
|
496
|
-
|
|
499
|
+
transformResponse: {
|
|
497
500
|
type: import("vue").PropType<(res: any) => any>;
|
|
498
501
|
};
|
|
502
|
+
parallelFetch: {
|
|
503
|
+
type: import("vue").PropType<(...args: any[]) => Promise<any> | any>;
|
|
504
|
+
};
|
|
499
505
|
toolbarConfig: {
|
|
500
506
|
type: import("vue").PropType<import("./table").ToolbarConfig | boolean>;
|
|
501
507
|
default: boolean;
|
|
@@ -648,7 +654,7 @@ declare const _Table: {
|
|
|
648
654
|
__isSuspense?: never;
|
|
649
655
|
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
650
656
|
api: {
|
|
651
|
-
type: import("vue").PropType<(...args: any[]) => Promise<any
|
|
657
|
+
type: import("vue").PropType<(...args: any[]) => Promise<any> | any>;
|
|
652
658
|
};
|
|
653
659
|
immediate: {
|
|
654
660
|
type: BooleanConstructor;
|
|
@@ -671,12 +677,15 @@ declare const _Table: {
|
|
|
671
677
|
formProps: {
|
|
672
678
|
type: import("vue").PropType<import("..").TableQueryProps>;
|
|
673
679
|
};
|
|
674
|
-
|
|
680
|
+
transformParams: {
|
|
675
681
|
type: import("vue").PropType<(params: Record<string, any>) => any>;
|
|
676
682
|
};
|
|
677
|
-
|
|
683
|
+
transformResponse: {
|
|
678
684
|
type: import("vue").PropType<(res: any) => any>;
|
|
679
685
|
};
|
|
686
|
+
parallelFetch: {
|
|
687
|
+
type: import("vue").PropType<(...args: any[]) => Promise<any> | any>;
|
|
688
|
+
};
|
|
680
689
|
toolbarConfig: {
|
|
681
690
|
type: import("vue").PropType<import("./table").ToolbarConfig | boolean>;
|
|
682
691
|
default: boolean;
|
|
@@ -16,7 +16,7 @@ const getTableStyle = (token) => {
|
|
|
16
16
|
},
|
|
17
17
|
[`${componentCls}-header`]: {
|
|
18
18
|
flex: "none",
|
|
19
|
-
paddingInline: token.
|
|
19
|
+
paddingInline: token.paddingSM,
|
|
20
20
|
paddingBlockStart: token.size
|
|
21
21
|
},
|
|
22
22
|
[`${componentCls}-body`]: {
|
|
@@ -30,8 +30,8 @@ const getTableStyle = (token) => {
|
|
|
30
30
|
flex: "none",
|
|
31
31
|
alignItems: "center",
|
|
32
32
|
justifyContent: "center",
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
paddingBlockStart: token.paddingSM,
|
|
34
|
+
paddingInline: token.paddingSM
|
|
35
35
|
},
|
|
36
36
|
[`${componentCls}-toolbar-left`]: {},
|
|
37
37
|
[`${componentCls}-toolbar-right`]: {
|
|
@@ -49,6 +49,10 @@ const getTableStyle = (token) => {
|
|
|
49
49
|
animationIterationCount: "infinite"
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
|
+
[`${componentCls}-before-table`]: {
|
|
53
|
+
paddingBlockStart: token.paddingSM,
|
|
54
|
+
paddingInline: token.paddingSM
|
|
55
|
+
},
|
|
52
56
|
[`${componentCls}-table`]: {
|
|
53
57
|
minHeight: 0,
|
|
54
58
|
flex: 1,
|
|
@@ -61,8 +65,8 @@ const getTableStyle = (token) => {
|
|
|
61
65
|
flex: "none",
|
|
62
66
|
flexWrap: "wrap",
|
|
63
67
|
justifyContent: "flex-end",
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
paddingBlockEnd: token.paddingSM,
|
|
69
|
+
paddingInline: token.paddingSM
|
|
66
70
|
}
|
|
67
71
|
}
|
|
68
72
|
};
|
|
@@ -17,7 +17,7 @@ export declare const tableEmitOnProps: Record<string, {
|
|
|
17
17
|
}>;
|
|
18
18
|
export declare const tableProps: {
|
|
19
19
|
api: {
|
|
20
|
-
type: PropType<(...args: any[]) => Promise<any
|
|
20
|
+
type: PropType<(...args: any[]) => Promise<any> | any>;
|
|
21
21
|
};
|
|
22
22
|
immediate: {
|
|
23
23
|
type: BooleanConstructor;
|
|
@@ -40,12 +40,15 @@ export declare const tableProps: {
|
|
|
40
40
|
formProps: {
|
|
41
41
|
type: PropType<TableQueryProps>;
|
|
42
42
|
};
|
|
43
|
-
|
|
43
|
+
transformParams: {
|
|
44
44
|
type: PropType<(params: Record<string, any>) => any>;
|
|
45
45
|
};
|
|
46
|
-
|
|
46
|
+
transformResponse: {
|
|
47
47
|
type: PropType<(res: any) => any>;
|
|
48
48
|
};
|
|
49
|
+
parallelFetch: {
|
|
50
|
+
type: PropType<(...args: any[]) => Promise<any> | any>;
|
|
51
|
+
};
|
|
49
52
|
toolbarConfig: {
|
|
50
53
|
type: PropType<ToolbarConfig | boolean>;
|
|
51
54
|
default: boolean;
|
|
@@ -146,6 +149,7 @@ export interface TableSlots {
|
|
|
146
149
|
empty?: (props: Record<string, never>) => any;
|
|
147
150
|
'toolbar-left'?: (props: Record<string, never>) => any;
|
|
148
151
|
'toolbar-right'?: (props: Record<string, never>) => any;
|
|
152
|
+
'before-table'?: (props: Record<string, never>) => any;
|
|
149
153
|
}
|
|
150
154
|
export declare const elSlotsName: readonly ["default", "append", "empty"];
|
|
151
155
|
export interface TableCustomExpose {
|
|
@@ -60,10 +60,13 @@ const tableExtraProps = {
|
|
|
60
60
|
formProps: {
|
|
61
61
|
type: Object
|
|
62
62
|
},
|
|
63
|
-
|
|
63
|
+
transformParams: {
|
|
64
64
|
type: Function
|
|
65
65
|
},
|
|
66
|
-
|
|
66
|
+
transformResponse: {
|
|
67
|
+
type: Function
|
|
68
|
+
},
|
|
69
|
+
parallelFetch: {
|
|
67
70
|
type: Function
|
|
68
71
|
},
|
|
69
72
|
toolbarConfig: {
|
|
@@ -4,7 +4,7 @@ import { type TableColumnProps } from './table-column/table-column';
|
|
|
4
4
|
type __VLS_Slots = TableSlots;
|
|
5
5
|
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
6
|
api: {
|
|
7
|
-
type: import("vue").PropType<(...args: any[]) => Promise<any
|
|
7
|
+
type: import("vue").PropType<(...args: any[]) => Promise<any> | any>;
|
|
8
8
|
};
|
|
9
9
|
immediate: {
|
|
10
10
|
type: BooleanConstructor;
|
|
@@ -27,12 +27,15 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
27
27
|
formProps: {
|
|
28
28
|
type: import("vue").PropType<import("..").TableQueryProps>;
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
transformParams: {
|
|
31
31
|
type: import("vue").PropType<(params: Record<string, any>) => any>;
|
|
32
32
|
};
|
|
33
|
-
|
|
33
|
+
transformResponse: {
|
|
34
34
|
type: import("vue").PropType<(res: any) => any>;
|
|
35
35
|
};
|
|
36
|
+
parallelFetch: {
|
|
37
|
+
type: import("vue").PropType<(...args: any[]) => Promise<any> | any>;
|
|
38
|
+
};
|
|
36
39
|
toolbarConfig: {
|
|
37
40
|
type: import("vue").PropType<ToolbarConfig | boolean>;
|
|
38
41
|
default: boolean;
|
|
@@ -157,7 +160,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
157
160
|
updateKeyChildren: (key: string, data: any[]) => void;
|
|
158
161
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
159
162
|
api: {
|
|
160
|
-
type: import("vue").PropType<(...args: any[]) => Promise<any
|
|
163
|
+
type: import("vue").PropType<(...args: any[]) => Promise<any> | any>;
|
|
161
164
|
};
|
|
162
165
|
immediate: {
|
|
163
166
|
type: BooleanConstructor;
|
|
@@ -180,12 +183,15 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
180
183
|
formProps: {
|
|
181
184
|
type: import("vue").PropType<import("..").TableQueryProps>;
|
|
182
185
|
};
|
|
183
|
-
|
|
186
|
+
transformParams: {
|
|
184
187
|
type: import("vue").PropType<(params: Record<string, any>) => any>;
|
|
185
188
|
};
|
|
186
|
-
|
|
189
|
+
transformResponse: {
|
|
187
190
|
type: import("vue").PropType<(res: any) => any>;
|
|
188
191
|
};
|
|
192
|
+
parallelFetch: {
|
|
193
|
+
type: import("vue").PropType<(...args: any[]) => Promise<any> | any>;
|
|
194
|
+
};
|
|
189
195
|
toolbarConfig: {
|
|
190
196
|
type: import("vue").PropType<ToolbarConfig | boolean>;
|
|
191
197
|
default: boolean;
|
|
@@ -151,7 +151,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
151
151
|
...orderParams,
|
|
152
152
|
...filterEmptyFormValue(tableQueryRef.value?.getFieldsValue() || {})
|
|
153
153
|
};
|
|
154
|
-
return filterEmptyFormValue(props.
|
|
154
|
+
return filterEmptyFormValue(props.transformParams?.(params) || params);
|
|
155
155
|
};
|
|
156
156
|
const getFullFetchParams = () => {
|
|
157
157
|
return {
|
|
@@ -163,10 +163,17 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
163
163
|
const {
|
|
164
164
|
isFetching,
|
|
165
165
|
execute
|
|
166
|
-
} = useFetch(() =>
|
|
166
|
+
} = useFetch(() => {
|
|
167
|
+
const params = getFullFetchParams();
|
|
168
|
+
return Promise.all([props.api?.({
|
|
169
|
+
...params
|
|
170
|
+
}), props.parallelFetch?.({
|
|
171
|
+
...params
|
|
172
|
+
})]);
|
|
173
|
+
}, {
|
|
167
174
|
immediate: false,
|
|
168
|
-
onSuccess(res) {
|
|
169
|
-
res = props.
|
|
175
|
+
onSuccess([res]) {
|
|
176
|
+
res = props.transformResponse?.(res) || res;
|
|
170
177
|
tableData.value = (tableKeys.list ? get(res, tableKeys.list) : res) || [];
|
|
171
178
|
total.value = +get(res, tableKeys.total) || 0;
|
|
172
179
|
elTableRef.value?.setScrollTop(0);
|
|
@@ -462,6 +469,10 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
462
469
|
}, null, 8, ["modelValue", "virtual-ref"])])) : createCommentVNode("v-if", true)], 2
|
|
463
470
|
/* CLASS */)) : createCommentVNode("v-if", true)], 2
|
|
464
471
|
/* CLASS */)], 2
|
|
472
|
+
/* CLASS */)) : createCommentVNode("v-if", true), _ctx.$slots["before-table"] ? (openBlock(), createElementBlock("div", {
|
|
473
|
+
key: 1,
|
|
474
|
+
class: normalizeClass(`${unref(prefixCls)}-before-table`)
|
|
475
|
+
}, [renderSlot(_ctx.$slots, "before-table")], 2
|
|
465
476
|
/* CLASS */)) : createCommentVNode("v-if", true), createElementVNode("div", {
|
|
466
477
|
class: normalizeClass(`${unref(prefixCls)}-table`)
|
|
467
478
|
}, [createVNode(_component_el_table, mergeProps({
|
|
@@ -524,7 +535,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
524
535
|
};
|
|
525
536
|
})]), 1040, ["class", "data", "expand-row-keys"])], 2
|
|
526
537
|
/* CLASS */), paginationProps.value ? (openBlock(), createBlock(_component_el_pagination, mergeProps({
|
|
527
|
-
key:
|
|
538
|
+
key: 2
|
|
528
539
|
}, paginationProps.value, {
|
|
529
540
|
"current-page": page.value,
|
|
530
541
|
"onUpdate:currentPage": _cache[3] || (_cache[3] = $event => page.value = $event),
|