cosey 0.2.24 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/table/index.d.ts +54 -54
- package/components/table/table-column/table-column.d.ts +13 -13
- package/components/table/table-column/table-column.vue.d.ts +7 -7
- package/components/table/table-footer/index.d.ts +80 -0
- package/components/table/table-footer/index.js +92 -0
- package/components/table/table-footer/style-helper.d.ts +8 -0
- package/components/table/table-footer/style-helper.js +36 -0
- package/components/table/table-footer/utils.d.ts +15 -0
- package/components/table/table-footer/utils.js +123 -0
- package/components/table/table.d.ts +18 -18
- package/components/table/table.vue.d.ts +36 -36
- package/components/table/table.vue.js +96 -28
- package/package.json +1 -1
|
@@ -198,14 +198,14 @@ declare const _Table: {
|
|
|
198
198
|
type: import("vue").PropType<any[]>;
|
|
199
199
|
default: () => never[];
|
|
200
200
|
};
|
|
201
|
-
load: import("vue").PropType<import("element-plus/es/components/
|
|
201
|
+
load: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["load"]>;
|
|
202
202
|
className: {
|
|
203
203
|
type: StringConstructor;
|
|
204
204
|
default: string;
|
|
205
205
|
};
|
|
206
206
|
emptyText: StringConstructor;
|
|
207
207
|
sumText: StringConstructor;
|
|
208
|
-
cellClassName: import("vue").PropType<import("element-plus/es/components/
|
|
208
|
+
cellClassName: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["cellClassName"]>;
|
|
209
209
|
scrollbarAlwaysOn: BooleanConstructor;
|
|
210
210
|
defaultExpandAll: BooleanConstructor;
|
|
211
211
|
lazy: BooleanConstructor;
|
|
@@ -217,36 +217,36 @@ declare const _Table: {
|
|
|
217
217
|
type: BooleanConstructor;
|
|
218
218
|
default: boolean;
|
|
219
219
|
};
|
|
220
|
-
showOverflowTooltip: import("vue").PropType<import("element-plus/es/components/
|
|
221
|
-
tooltipFormatter: import("vue").PropType<import("element-plus/es/components/
|
|
220
|
+
showOverflowTooltip: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["showOverflowTooltip"]>;
|
|
221
|
+
tooltipFormatter: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["tooltipFormatter"]>;
|
|
222
222
|
stripe: BooleanConstructor;
|
|
223
|
-
rowKey: import("vue").PropType<import("element-plus/es/components/
|
|
223
|
+
rowKey: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["rowKey"]>;
|
|
224
224
|
showHeader: {
|
|
225
225
|
type: BooleanConstructor;
|
|
226
226
|
default: boolean;
|
|
227
227
|
};
|
|
228
228
|
showSummary: BooleanConstructor;
|
|
229
|
-
summaryMethod: import("vue").PropType<import("element-plus/es/components/
|
|
230
|
-
rowClassName: import("vue").PropType<import("element-plus/es/components/
|
|
231
|
-
rowStyle: import("vue").PropType<import("element-plus/es/components/
|
|
232
|
-
cellStyle: import("vue").PropType<import("element-plus/es/components/
|
|
233
|
-
headerRowClassName: import("vue").PropType<import("element-plus/es/components/
|
|
234
|
-
headerRowStyle: import("vue").PropType<import("element-plus/es/components/
|
|
235
|
-
headerCellClassName: import("vue").PropType<import("element-plus/es/components/
|
|
236
|
-
headerCellStyle: import("vue").PropType<import("element-plus/es/components/
|
|
229
|
+
summaryMethod: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["summaryMethod"]>;
|
|
230
|
+
rowClassName: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["rowClassName"]>;
|
|
231
|
+
rowStyle: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["rowStyle"]>;
|
|
232
|
+
cellStyle: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["cellStyle"]>;
|
|
233
|
+
headerRowClassName: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerRowClassName"]>;
|
|
234
|
+
headerRowStyle: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerRowStyle"]>;
|
|
235
|
+
headerCellClassName: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerCellClassName"]>;
|
|
236
|
+
headerCellStyle: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerCellStyle"]>;
|
|
237
237
|
highlightCurrentRow: BooleanConstructor;
|
|
238
238
|
currentRowKey: (NumberConstructor | StringConstructor)[];
|
|
239
|
-
expandRowKeys: import("vue").PropType<import("element-plus/es/components/
|
|
240
|
-
defaultSort: import("vue").PropType<import("element-plus/es/components/
|
|
239
|
+
expandRowKeys: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["expandRowKeys"]>;
|
|
240
|
+
defaultSort: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["defaultSort"]>;
|
|
241
241
|
tooltipEffect: StringConstructor;
|
|
242
|
-
tooltipOptions: import("vue").PropType<import("element-plus/es/components/
|
|
243
|
-
spanMethod: import("vue").PropType<import("element-plus/es/components/
|
|
242
|
+
tooltipOptions: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["tooltipOptions"]>;
|
|
243
|
+
spanMethod: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["spanMethod"]>;
|
|
244
244
|
selectOnIndeterminate: {
|
|
245
245
|
type: BooleanConstructor;
|
|
246
246
|
default: boolean;
|
|
247
247
|
};
|
|
248
248
|
treeProps: {
|
|
249
|
-
type: import("vue").PropType<import("element-plus/es/components/
|
|
249
|
+
type: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["treeProps"]>;
|
|
250
250
|
default: () => {
|
|
251
251
|
hasChildren: string;
|
|
252
252
|
children: string;
|
|
@@ -521,14 +521,14 @@ declare const _Table: {
|
|
|
521
521
|
type: import("vue").PropType<any[]>;
|
|
522
522
|
default: () => never[];
|
|
523
523
|
};
|
|
524
|
-
load: import("vue").PropType<import("element-plus/es/components/
|
|
524
|
+
load: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["load"]>;
|
|
525
525
|
className: {
|
|
526
526
|
type: StringConstructor;
|
|
527
527
|
default: string;
|
|
528
528
|
};
|
|
529
529
|
emptyText: StringConstructor;
|
|
530
530
|
sumText: StringConstructor;
|
|
531
|
-
cellClassName: import("vue").PropType<import("element-plus/es/components/
|
|
531
|
+
cellClassName: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["cellClassName"]>;
|
|
532
532
|
scrollbarAlwaysOn: BooleanConstructor;
|
|
533
533
|
defaultExpandAll: BooleanConstructor;
|
|
534
534
|
lazy: BooleanConstructor;
|
|
@@ -540,36 +540,36 @@ declare const _Table: {
|
|
|
540
540
|
type: BooleanConstructor;
|
|
541
541
|
default: boolean;
|
|
542
542
|
};
|
|
543
|
-
showOverflowTooltip: import("vue").PropType<import("element-plus/es/components/
|
|
544
|
-
tooltipFormatter: import("vue").PropType<import("element-plus/es/components/
|
|
543
|
+
showOverflowTooltip: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["showOverflowTooltip"]>;
|
|
544
|
+
tooltipFormatter: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["tooltipFormatter"]>;
|
|
545
545
|
stripe: BooleanConstructor;
|
|
546
|
-
rowKey: import("vue").PropType<import("element-plus/es/components/
|
|
546
|
+
rowKey: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["rowKey"]>;
|
|
547
547
|
showHeader: {
|
|
548
548
|
type: BooleanConstructor;
|
|
549
549
|
default: boolean;
|
|
550
550
|
};
|
|
551
551
|
showSummary: BooleanConstructor;
|
|
552
|
-
summaryMethod: import("vue").PropType<import("element-plus/es/components/
|
|
553
|
-
rowClassName: import("vue").PropType<import("element-plus/es/components/
|
|
554
|
-
rowStyle: import("vue").PropType<import("element-plus/es/components/
|
|
555
|
-
cellStyle: import("vue").PropType<import("element-plus/es/components/
|
|
556
|
-
headerRowClassName: import("vue").PropType<import("element-plus/es/components/
|
|
557
|
-
headerRowStyle: import("vue").PropType<import("element-plus/es/components/
|
|
558
|
-
headerCellClassName: import("vue").PropType<import("element-plus/es/components/
|
|
559
|
-
headerCellStyle: import("vue").PropType<import("element-plus/es/components/
|
|
552
|
+
summaryMethod: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["summaryMethod"]>;
|
|
553
|
+
rowClassName: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["rowClassName"]>;
|
|
554
|
+
rowStyle: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["rowStyle"]>;
|
|
555
|
+
cellStyle: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["cellStyle"]>;
|
|
556
|
+
headerRowClassName: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerRowClassName"]>;
|
|
557
|
+
headerRowStyle: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerRowStyle"]>;
|
|
558
|
+
headerCellClassName: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerCellClassName"]>;
|
|
559
|
+
headerCellStyle: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerCellStyle"]>;
|
|
560
560
|
highlightCurrentRow: BooleanConstructor;
|
|
561
561
|
currentRowKey: (NumberConstructor | StringConstructor)[];
|
|
562
|
-
expandRowKeys: import("vue").PropType<import("element-plus/es/components/
|
|
563
|
-
defaultSort: import("vue").PropType<import("element-plus/es/components/
|
|
562
|
+
expandRowKeys: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["expandRowKeys"]>;
|
|
563
|
+
defaultSort: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["defaultSort"]>;
|
|
564
564
|
tooltipEffect: StringConstructor;
|
|
565
|
-
tooltipOptions: import("vue").PropType<import("element-plus/es/components/
|
|
566
|
-
spanMethod: import("vue").PropType<import("element-plus/es/components/
|
|
565
|
+
tooltipOptions: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["tooltipOptions"]>;
|
|
566
|
+
spanMethod: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["spanMethod"]>;
|
|
567
567
|
selectOnIndeterminate: {
|
|
568
568
|
type: BooleanConstructor;
|
|
569
569
|
default: boolean;
|
|
570
570
|
};
|
|
571
571
|
treeProps: {
|
|
572
|
-
type: import("vue").PropType<import("element-plus/es/components/
|
|
572
|
+
type: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["treeProps"]>;
|
|
573
573
|
default: () => {
|
|
574
574
|
hasChildren: string;
|
|
575
575
|
children: string;
|
|
@@ -702,14 +702,14 @@ declare const _Table: {
|
|
|
702
702
|
type: import("vue").PropType<any[]>;
|
|
703
703
|
default: () => never[];
|
|
704
704
|
};
|
|
705
|
-
load: import("vue").PropType<import("element-plus/es/components/
|
|
705
|
+
load: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["load"]>;
|
|
706
706
|
className: {
|
|
707
707
|
type: StringConstructor;
|
|
708
708
|
default: string;
|
|
709
709
|
};
|
|
710
710
|
emptyText: StringConstructor;
|
|
711
711
|
sumText: StringConstructor;
|
|
712
|
-
cellClassName: import("vue").PropType<import("element-plus/es/components/
|
|
712
|
+
cellClassName: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["cellClassName"]>;
|
|
713
713
|
scrollbarAlwaysOn: BooleanConstructor;
|
|
714
714
|
defaultExpandAll: BooleanConstructor;
|
|
715
715
|
lazy: BooleanConstructor;
|
|
@@ -721,36 +721,36 @@ declare const _Table: {
|
|
|
721
721
|
type: BooleanConstructor;
|
|
722
722
|
default: boolean;
|
|
723
723
|
};
|
|
724
|
-
showOverflowTooltip: import("vue").PropType<import("element-plus/es/components/
|
|
725
|
-
tooltipFormatter: import("vue").PropType<import("element-plus/es/components/
|
|
724
|
+
showOverflowTooltip: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["showOverflowTooltip"]>;
|
|
725
|
+
tooltipFormatter: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["tooltipFormatter"]>;
|
|
726
726
|
stripe: BooleanConstructor;
|
|
727
|
-
rowKey: import("vue").PropType<import("element-plus/es/components/
|
|
727
|
+
rowKey: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["rowKey"]>;
|
|
728
728
|
showHeader: {
|
|
729
729
|
type: BooleanConstructor;
|
|
730
730
|
default: boolean;
|
|
731
731
|
};
|
|
732
732
|
showSummary: BooleanConstructor;
|
|
733
|
-
summaryMethod: import("vue").PropType<import("element-plus/es/components/
|
|
734
|
-
rowClassName: import("vue").PropType<import("element-plus/es/components/
|
|
735
|
-
rowStyle: import("vue").PropType<import("element-plus/es/components/
|
|
736
|
-
cellStyle: import("vue").PropType<import("element-plus/es/components/
|
|
737
|
-
headerRowClassName: import("vue").PropType<import("element-plus/es/components/
|
|
738
|
-
headerRowStyle: import("vue").PropType<import("element-plus/es/components/
|
|
739
|
-
headerCellClassName: import("vue").PropType<import("element-plus/es/components/
|
|
740
|
-
headerCellStyle: import("vue").PropType<import("element-plus/es/components/
|
|
733
|
+
summaryMethod: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["summaryMethod"]>;
|
|
734
|
+
rowClassName: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["rowClassName"]>;
|
|
735
|
+
rowStyle: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["rowStyle"]>;
|
|
736
|
+
cellStyle: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["cellStyle"]>;
|
|
737
|
+
headerRowClassName: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerRowClassName"]>;
|
|
738
|
+
headerRowStyle: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerRowStyle"]>;
|
|
739
|
+
headerCellClassName: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerCellClassName"]>;
|
|
740
|
+
headerCellStyle: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerCellStyle"]>;
|
|
741
741
|
highlightCurrentRow: BooleanConstructor;
|
|
742
742
|
currentRowKey: (NumberConstructor | StringConstructor)[];
|
|
743
|
-
expandRowKeys: import("vue").PropType<import("element-plus/es/components/
|
|
744
|
-
defaultSort: import("vue").PropType<import("element-plus/es/components/
|
|
743
|
+
expandRowKeys: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["expandRowKeys"]>;
|
|
744
|
+
defaultSort: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["defaultSort"]>;
|
|
745
745
|
tooltipEffect: StringConstructor;
|
|
746
|
-
tooltipOptions: import("vue").PropType<import("element-plus/es/components/
|
|
747
|
-
spanMethod: import("vue").PropType<import("element-plus/es/components/
|
|
746
|
+
tooltipOptions: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["tooltipOptions"]>;
|
|
747
|
+
spanMethod: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["spanMethod"]>;
|
|
748
748
|
selectOnIndeterminate: {
|
|
749
749
|
type: BooleanConstructor;
|
|
750
750
|
default: boolean;
|
|
751
751
|
};
|
|
752
752
|
treeProps: {
|
|
753
|
-
type: import("vue").PropType<import("element-plus/es/components/
|
|
753
|
+
type: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["treeProps"]>;
|
|
754
754
|
default: () => {
|
|
755
755
|
hasChildren: string;
|
|
756
756
|
children: string;
|
|
@@ -76,13 +76,13 @@ export declare const tableColumnProps: {
|
|
|
76
76
|
type: (NumberConstructor | StringConstructor)[];
|
|
77
77
|
default: string;
|
|
78
78
|
};
|
|
79
|
-
renderHeader: PropType<import("element-plus/es/components/
|
|
79
|
+
renderHeader: PropType<import("element-plus/es/components/index.mjs").TableColumnCtx<any>["renderHeader"]>;
|
|
80
80
|
sortable: {
|
|
81
81
|
type: (BooleanConstructor | StringConstructor)[];
|
|
82
82
|
default: boolean;
|
|
83
83
|
};
|
|
84
|
-
sortMethod: PropType<import("element-plus/es/components/
|
|
85
|
-
sortBy: PropType<import("element-plus/es/components/
|
|
84
|
+
sortMethod: PropType<import("element-plus/es/components/index.mjs").TableColumnCtx<any>["sortMethod"]>;
|
|
85
|
+
sortBy: PropType<import("element-plus/es/components/index.mjs").TableColumnCtx<any>["sortBy"]>;
|
|
86
86
|
resizable: {
|
|
87
87
|
type: BooleanConstructor;
|
|
88
88
|
default: boolean;
|
|
@@ -90,28 +90,28 @@ export declare const tableColumnProps: {
|
|
|
90
90
|
columnKey: StringConstructor;
|
|
91
91
|
headerAlign: StringConstructor;
|
|
92
92
|
showOverflowTooltip: {
|
|
93
|
-
type: PropType<import("element-plus/es/components/
|
|
93
|
+
type: PropType<import("element-plus/es/components/index.mjs").TableColumnCtx<any>["showOverflowTooltip"]>;
|
|
94
94
|
default: undefined;
|
|
95
95
|
};
|
|
96
|
-
tooltipFormatter: PropType<import("element-plus/es/components/
|
|
96
|
+
tooltipFormatter: PropType<import("element-plus/es/components/index.mjs").TableColumnCtx<any>["tooltipFormatter"]>;
|
|
97
97
|
fixed: (BooleanConstructor | StringConstructor)[];
|
|
98
|
-
formatter: PropType<import("element-plus/es/components/
|
|
99
|
-
selectable: PropType<import("element-plus/es/components/
|
|
98
|
+
formatter: PropType<import("element-plus/es/components/index.mjs").TableColumnCtx<any>["formatter"]>;
|
|
99
|
+
selectable: PropType<import("element-plus/es/components/index.mjs").TableColumnCtx<any>["selectable"]>;
|
|
100
100
|
reserveSelection: BooleanConstructor;
|
|
101
|
-
filterMethod: PropType<import("element-plus/es/components/
|
|
102
|
-
filteredValue: PropType<import("element-plus/es/components/
|
|
103
|
-
filters: PropType<import("element-plus/es/components/
|
|
101
|
+
filterMethod: PropType<import("element-plus/es/components/index.mjs").TableColumnCtx<any>["filterMethod"]>;
|
|
102
|
+
filteredValue: PropType<import("element-plus/es/components/index.mjs").TableColumnCtx<any>["filteredValue"]>;
|
|
103
|
+
filters: PropType<import("element-plus/es/components/index.mjs").TableColumnCtx<any>["filters"]>;
|
|
104
104
|
filterPlacement: StringConstructor;
|
|
105
105
|
filterMultiple: {
|
|
106
106
|
type: BooleanConstructor;
|
|
107
107
|
default: boolean;
|
|
108
108
|
};
|
|
109
109
|
filterClassName: StringConstructor;
|
|
110
|
-
index: PropType<import("element-plus/es/components/
|
|
110
|
+
index: PropType<import("element-plus/es/components/index.mjs").TableColumnCtx<any>["index"]>;
|
|
111
111
|
sortOrders: {
|
|
112
|
-
type: PropType<import("element-plus/es/components/
|
|
112
|
+
type: PropType<import("element-plus/es/components/index.mjs").TableColumnCtx<any>["sortOrders"]>;
|
|
113
113
|
default: () => (string | null)[];
|
|
114
|
-
validator: (val: import("element-plus/es/components/
|
|
114
|
+
validator: (val: import("element-plus/es/components/index.mjs").TableColumnCtx<any>["sortOrders"]) => boolean;
|
|
115
115
|
};
|
|
116
116
|
};
|
|
117
117
|
export interface TableColumnSlots {
|
|
@@ -6,14 +6,14 @@ declare const TableColumn: import("vue").DefineComponent<{
|
|
|
6
6
|
fixed?: string | boolean | undefined;
|
|
7
7
|
type?: string | undefined;
|
|
8
8
|
filters?: import("element-plus/es/components/table/src/table-column/defaults.mjs").Filters | undefined;
|
|
9
|
-
formatter?: ((row: any, column: import("element-plus/es/components/
|
|
9
|
+
formatter?: ((row: any, column: import("element-plus/es/components/index.mjs").TableColumnCtx<any>, cellValue: any, index: number) => import("vue").VNode | string) | undefined;
|
|
10
10
|
className?: string | undefined;
|
|
11
11
|
filterMethod?: import("element-plus/es/components/table/src/table-column/defaults.mjs").FilterMethods<any> | undefined;
|
|
12
12
|
prop?: string | undefined;
|
|
13
13
|
labelClassName?: string | undefined;
|
|
14
14
|
property?: string | undefined;
|
|
15
15
|
renderHeader?: ((data: {
|
|
16
|
-
column: import("element-plus/es/components/
|
|
16
|
+
column: import("element-plus/es/components/index.mjs").TableColumnCtx<any>;
|
|
17
17
|
$index: number;
|
|
18
18
|
store: import("element-plus/es/components/table/src/store/index.mjs").Store<any>;
|
|
19
19
|
_self: any;
|
|
@@ -24,7 +24,7 @@ declare const TableColumn: import("vue").DefineComponent<{
|
|
|
24
24
|
resizable?: boolean | undefined;
|
|
25
25
|
columnKey?: string | undefined;
|
|
26
26
|
headerAlign?: string | undefined;
|
|
27
|
-
showOverflowTooltip?: boolean | Partial<Pick<import("element-plus/es/components/
|
|
27
|
+
showOverflowTooltip?: boolean | Partial<Pick<import("element-plus/es/components/index.mjs").ElTooltipProps, "offset" | "transition" | "enterable" | "appendTo" | "placement" | "popperClass" | "popperOptions" | "showArrow" | "effect" | "showAfter" | "hideAfter">> | undefined;
|
|
28
28
|
selectable?: ((row: any, index: number) => boolean) | undefined;
|
|
29
29
|
reserveSelection?: boolean | undefined;
|
|
30
30
|
filteredValue?: string[] | undefined;
|
|
@@ -50,14 +50,14 @@ declare const TableColumn: import("vue").DefineComponent<{
|
|
|
50
50
|
fixed?: string | boolean | undefined;
|
|
51
51
|
type?: string | undefined;
|
|
52
52
|
filters?: import("element-plus/es/components/table/src/table-column/defaults.mjs").Filters | undefined;
|
|
53
|
-
formatter?: ((row: any, column: import("element-plus/es/components/
|
|
53
|
+
formatter?: ((row: any, column: import("element-plus/es/components/index.mjs").TableColumnCtx<any>, cellValue: any, index: number) => import("vue").VNode | string) | undefined;
|
|
54
54
|
className?: string | undefined;
|
|
55
55
|
filterMethod?: import("element-plus/es/components/table/src/table-column/defaults.mjs").FilterMethods<any> | undefined;
|
|
56
56
|
prop?: string | undefined;
|
|
57
57
|
labelClassName?: string | undefined;
|
|
58
58
|
property?: string | undefined;
|
|
59
59
|
renderHeader?: ((data: {
|
|
60
|
-
column: import("element-plus/es/components/
|
|
60
|
+
column: import("element-plus/es/components/index.mjs").TableColumnCtx<any>;
|
|
61
61
|
$index: number;
|
|
62
62
|
store: import("element-plus/es/components/table/src/store/index.mjs").Store<any>;
|
|
63
63
|
_self: any;
|
|
@@ -68,7 +68,7 @@ declare const TableColumn: import("vue").DefineComponent<{
|
|
|
68
68
|
resizable?: boolean | undefined;
|
|
69
69
|
columnKey?: string | undefined;
|
|
70
70
|
headerAlign?: string | undefined;
|
|
71
|
-
showOverflowTooltip?: boolean | Partial<Pick<import("element-plus/es/components/
|
|
71
|
+
showOverflowTooltip?: boolean | Partial<Pick<import("element-plus/es/components/index.mjs").ElTooltipProps, "offset" | "transition" | "enterable" | "appendTo" | "placement" | "popperClass" | "popperOptions" | "showArrow" | "effect" | "showAfter" | "hideAfter">> | undefined;
|
|
72
72
|
selectable?: ((row: any, index: number) => boolean) | undefined;
|
|
73
73
|
reserveSelection?: boolean | undefined;
|
|
74
74
|
filteredValue?: string[] | undefined;
|
|
@@ -95,7 +95,7 @@ declare const TableColumn: import("vue").DefineComponent<{
|
|
|
95
95
|
align: "left" | "right" | "center" | undefined;
|
|
96
96
|
sortable: string | boolean;
|
|
97
97
|
resizable: boolean;
|
|
98
|
-
showOverflowTooltip: boolean | Partial<Pick<import("element-plus/es/components/
|
|
98
|
+
showOverflowTooltip: boolean | Partial<Pick<import("element-plus/es/components/index.mjs").ElTooltipProps, "offset" | "transition" | "enterable" | "appendTo" | "placement" | "popperClass" | "popperOptions" | "showArrow" | "effect" | "showAfter" | "hideAfter">> | undefined;
|
|
99
99
|
reserveSelection: boolean;
|
|
100
100
|
filterMultiple: boolean;
|
|
101
101
|
sortOrders: (import("element-plus/es/components/table/src/table/defaults.mjs").TableSortOrder | null)[];
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
import { Store } from 'element-plus/es/components/table/src/store/index.mjs';
|
|
3
|
+
import { Sort, SummaryMethod } from 'element-plus/es/components/index.mjs';
|
|
4
|
+
import { DefaultRow } from 'element-plus/es/components/table/src/table/defaults.mjs';
|
|
5
|
+
export interface TableFooter<T extends DefaultRow> {
|
|
6
|
+
fixed: string;
|
|
7
|
+
store: Store<T>;
|
|
8
|
+
summaryMethod: SummaryMethod<T>;
|
|
9
|
+
sumText: string;
|
|
10
|
+
border: boolean;
|
|
11
|
+
defaultSort: Sort;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
14
|
+
fixed: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
store: {
|
|
19
|
+
required: true;
|
|
20
|
+
type: PropType<TableFooter<DefaultRow>["store"]>;
|
|
21
|
+
};
|
|
22
|
+
summaryMethod: PropType<TableFooter<DefaultRow>["summaryMethod"]>;
|
|
23
|
+
sumText: StringConstructor;
|
|
24
|
+
border: BooleanConstructor;
|
|
25
|
+
defaultSort: {
|
|
26
|
+
type: PropType<TableFooter<DefaultRow>["defaultSort"]>;
|
|
27
|
+
default: () => {
|
|
28
|
+
prop: string;
|
|
29
|
+
order: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}>, {
|
|
33
|
+
ns: {
|
|
34
|
+
namespace: import("vue").ComputedRef<string>;
|
|
35
|
+
b: (blockSuffix?: string) => string;
|
|
36
|
+
e: (element?: string) => string;
|
|
37
|
+
m: (modifier?: string) => string;
|
|
38
|
+
be: (blockSuffix?: string, element?: string) => string;
|
|
39
|
+
em: (element?: string, modifier?: string) => string;
|
|
40
|
+
bm: (blockSuffix?: string, modifier?: string) => string;
|
|
41
|
+
bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
|
|
42
|
+
is: {
|
|
43
|
+
(name: string, state: boolean | undefined): string;
|
|
44
|
+
(name: string): string;
|
|
45
|
+
};
|
|
46
|
+
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
47
|
+
cssVarName: (name: string) => string;
|
|
48
|
+
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
49
|
+
cssVarBlockName: (name: string) => string;
|
|
50
|
+
};
|
|
51
|
+
onScrollableChange: (layout: import("element-plus/es/components/table/src/table-layout.mjs").default<DefaultRow>) => void;
|
|
52
|
+
onColumnsChange: (layout: import("element-plus/es/components/table/src/table-layout.mjs").default<DefaultRow>) => void;
|
|
53
|
+
getCellClasses: (columns: import("element-plus/es/components/index.mjs").TableColumnCtx<DefaultRow>[], cellIndex: number) => string[];
|
|
54
|
+
getCellStyles: (column: import("element-plus/es/components/index.mjs").TableColumnCtx<DefaultRow>, cellIndex: number) => any;
|
|
55
|
+
columns: import("vue").Ref<import("element-plus/es/components/index.mjs").TableColumnCtx<DefaultRow>[], import("element-plus/es/components/index.mjs").TableColumnCtx<DefaultRow>[]>;
|
|
56
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
57
|
+
fixed: {
|
|
58
|
+
type: StringConstructor;
|
|
59
|
+
default: string;
|
|
60
|
+
};
|
|
61
|
+
store: {
|
|
62
|
+
required: true;
|
|
63
|
+
type: PropType<TableFooter<DefaultRow>["store"]>;
|
|
64
|
+
};
|
|
65
|
+
summaryMethod: PropType<TableFooter<DefaultRow>["summaryMethod"]>;
|
|
66
|
+
sumText: StringConstructor;
|
|
67
|
+
border: BooleanConstructor;
|
|
68
|
+
defaultSort: {
|
|
69
|
+
type: PropType<TableFooter<DefaultRow>["defaultSort"]>;
|
|
70
|
+
default: () => {
|
|
71
|
+
prop: string;
|
|
72
|
+
order: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
}>> & Readonly<{}>, {
|
|
76
|
+
border: boolean;
|
|
77
|
+
fixed: string;
|
|
78
|
+
defaultSort: Sort;
|
|
79
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
80
|
+
export default _default;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { defineComponent, unref, h, inject } from 'vue';
|
|
2
|
+
import { TABLE_INJECTION_KEY } from 'element-plus/es/components/table/src/tokens.mjs';
|
|
3
|
+
import { useNamespace } from 'element-plus';
|
|
4
|
+
import useLayoutObserver from 'element-plus/es/components/table/src/layout-observer.mjs';
|
|
5
|
+
import stdin_default$1 from './style-helper.js';
|
|
6
|
+
import { defaultSummaryMethod } from './utils.js';
|
|
7
|
+
|
|
8
|
+
var stdin_default = defineComponent({
|
|
9
|
+
name: "ElTableFooter",
|
|
10
|
+
props: {
|
|
11
|
+
fixed: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: ""
|
|
14
|
+
},
|
|
15
|
+
store: {
|
|
16
|
+
required: true,
|
|
17
|
+
type: Object
|
|
18
|
+
},
|
|
19
|
+
summaryMethod: Function,
|
|
20
|
+
sumText: String,
|
|
21
|
+
border: Boolean,
|
|
22
|
+
defaultSort: {
|
|
23
|
+
type: Object,
|
|
24
|
+
default: () => {
|
|
25
|
+
return {
|
|
26
|
+
prop: "",
|
|
27
|
+
order: ""
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
setup(props) {
|
|
33
|
+
const parent = inject(TABLE_INJECTION_KEY);
|
|
34
|
+
const ns = useNamespace("table");
|
|
35
|
+
const { getCellClasses, getCellStyles } = stdin_default$1(props);
|
|
36
|
+
const { onScrollableChange, onColumnsChange } = useLayoutObserver(parent);
|
|
37
|
+
return {
|
|
38
|
+
ns,
|
|
39
|
+
onScrollableChange,
|
|
40
|
+
onColumnsChange,
|
|
41
|
+
getCellClasses,
|
|
42
|
+
getCellStyles,
|
|
43
|
+
columns: parent.store.states.columns
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
render() {
|
|
47
|
+
const { columns, getCellStyles, getCellClasses, summaryMethod, sumText } = this;
|
|
48
|
+
const data = unref(this.store.states.data) || [];
|
|
49
|
+
let sums = [];
|
|
50
|
+
if (summaryMethod) {
|
|
51
|
+
sums = summaryMethod({
|
|
52
|
+
columns,
|
|
53
|
+
data
|
|
54
|
+
});
|
|
55
|
+
} else {
|
|
56
|
+
sums = defaultSummaryMethod(columns, data, sumText);
|
|
57
|
+
}
|
|
58
|
+
if (!Array.isArray(sums[0])) {
|
|
59
|
+
sums = [sums];
|
|
60
|
+
}
|
|
61
|
+
return h(
|
|
62
|
+
h(
|
|
63
|
+
"tfoot",
|
|
64
|
+
sums.map((sum) => {
|
|
65
|
+
return h("tr", {}, [
|
|
66
|
+
...columns.map((column, cellIndex) => {
|
|
67
|
+
return h(
|
|
68
|
+
"td",
|
|
69
|
+
{
|
|
70
|
+
key: cellIndex,
|
|
71
|
+
class: getCellClasses(columns, cellIndex),
|
|
72
|
+
style: getCellStyles(column, cellIndex)
|
|
73
|
+
},
|
|
74
|
+
[
|
|
75
|
+
h(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
class: ["cell", column.labelClassName]
|
|
79
|
+
},
|
|
80
|
+
[sum[cellIndex]]
|
|
81
|
+
)
|
|
82
|
+
]
|
|
83
|
+
);
|
|
84
|
+
})
|
|
85
|
+
]);
|
|
86
|
+
})
|
|
87
|
+
)
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
export { stdin_default as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TableFooter } from '.';
|
|
2
|
+
import { TableColumnCtx } from 'element-plus/es/components/index.mjs';
|
|
3
|
+
import { DefaultRow } from 'element-plus/es/components/table/src/table/defaults.mjs';
|
|
4
|
+
declare function useStyle<T extends DefaultRow>(props: TableFooter<T>): {
|
|
5
|
+
getCellClasses: (columns: TableColumnCtx<T>[], cellIndex: number) => string[];
|
|
6
|
+
getCellStyles: (column: TableColumnCtx<T>, cellIndex: number) => any;
|
|
7
|
+
};
|
|
8
|
+
export default useStyle;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useNamespace } from 'element-plus';
|
|
2
|
+
import { getFixedColumnOffset, ensurePosition, getFixedColumnsClass } from './utils.js';
|
|
3
|
+
|
|
4
|
+
function useStyle(props) {
|
|
5
|
+
const ns = useNamespace("table");
|
|
6
|
+
const getCellClasses = (columns, cellIndex) => {
|
|
7
|
+
const column = columns[cellIndex];
|
|
8
|
+
const classes = [
|
|
9
|
+
ns.e("cell"),
|
|
10
|
+
column.id,
|
|
11
|
+
column.align,
|
|
12
|
+
column.labelClassName,
|
|
13
|
+
...getFixedColumnsClass(ns.b(), cellIndex, column.fixed, props.store)
|
|
14
|
+
];
|
|
15
|
+
if (column.className) {
|
|
16
|
+
classes.push(column.className);
|
|
17
|
+
}
|
|
18
|
+
if (!column.children) {
|
|
19
|
+
classes.push(ns.is("leaf"));
|
|
20
|
+
}
|
|
21
|
+
return classes;
|
|
22
|
+
};
|
|
23
|
+
const getCellStyles = (column, cellIndex) => {
|
|
24
|
+
const fixedStyle = getFixedColumnOffset(cellIndex, column.fixed, props.store);
|
|
25
|
+
ensurePosition(fixedStyle, "left");
|
|
26
|
+
ensurePosition(fixedStyle, "right");
|
|
27
|
+
return fixedStyle;
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
getCellClasses,
|
|
31
|
+
getCellStyles
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
var stdin_default = useStyle;
|
|
35
|
+
|
|
36
|
+
export { stdin_default as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type TableColumnCtx } from 'element-plus/es/components/index.mjs';
|
|
2
|
+
import { type DefaultRow } from 'element-plus/es/components/table/src/table/defaults.mjs';
|
|
3
|
+
export declare const isFixedColumn: <T extends DefaultRow>(index: number, fixed: string | boolean, store: any, realColumns?: TableColumnCtx<T>[]) => {
|
|
4
|
+
direction: any;
|
|
5
|
+
start: number;
|
|
6
|
+
after: number;
|
|
7
|
+
} | {
|
|
8
|
+
direction?: undefined;
|
|
9
|
+
start?: undefined;
|
|
10
|
+
after?: undefined;
|
|
11
|
+
};
|
|
12
|
+
export declare const getFixedColumnsClass: <T extends DefaultRow>(namespace: string, index: number, fixed: string | boolean, store: any, realColumns?: TableColumnCtx<T>[], offset?: number) => string[];
|
|
13
|
+
export declare const getFixedColumnOffset: <T extends DefaultRow>(index: number, fixed: string | boolean, store: any, realColumns?: TableColumnCtx<T>[]) => any;
|
|
14
|
+
export declare const ensurePosition: (style: any, key: string) => void;
|
|
15
|
+
export declare function defaultSummaryMethod(columns: TableColumnCtx<DefaultRow>[], data: any[], sumText?: string): any[];
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { flatMap } from 'lodash-es';
|
|
2
|
+
import { unref } from 'vue';
|
|
3
|
+
|
|
4
|
+
function getColSpan(colSpan, column) {
|
|
5
|
+
return colSpan + column.colSpan;
|
|
6
|
+
}
|
|
7
|
+
function getCurrentColumns(column) {
|
|
8
|
+
if (column.children) {
|
|
9
|
+
return flatMap(column.children, getCurrentColumns);
|
|
10
|
+
} else {
|
|
11
|
+
return [column];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const isFixedColumn = (index, fixed, store, realColumns) => {
|
|
15
|
+
let start = 0;
|
|
16
|
+
let after = index;
|
|
17
|
+
const columns = unref(store.states.columns);
|
|
18
|
+
if (realColumns) {
|
|
19
|
+
const curColumns = getCurrentColumns(realColumns[index]);
|
|
20
|
+
const preColumns = columns.slice(0, columns.indexOf(curColumns[0]));
|
|
21
|
+
start = preColumns.reduce(getColSpan, 0);
|
|
22
|
+
after = start + curColumns.reduce(getColSpan, 0) - 1;
|
|
23
|
+
} else {
|
|
24
|
+
start = index;
|
|
25
|
+
}
|
|
26
|
+
let fixedLayout;
|
|
27
|
+
switch (fixed) {
|
|
28
|
+
case "left":
|
|
29
|
+
if (after < unref(store.states.fixedLeafColumnsLength)) {
|
|
30
|
+
fixedLayout = "left";
|
|
31
|
+
}
|
|
32
|
+
break;
|
|
33
|
+
case "right":
|
|
34
|
+
if (start >= columns.length - unref(store.states.rightFixedLeafColumnsLength)) {
|
|
35
|
+
fixedLayout = "right";
|
|
36
|
+
}
|
|
37
|
+
break;
|
|
38
|
+
default:
|
|
39
|
+
if (after < unref(store.states.fixedLeafColumnsLength)) {
|
|
40
|
+
fixedLayout = "left";
|
|
41
|
+
} else if (start >= columns.length - unref(store.states.rightFixedLeafColumnsLength)) {
|
|
42
|
+
fixedLayout = "right";
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return fixedLayout ? {
|
|
46
|
+
direction: fixedLayout,
|
|
47
|
+
start,
|
|
48
|
+
after
|
|
49
|
+
} : {};
|
|
50
|
+
};
|
|
51
|
+
const getFixedColumnsClass = (namespace, index, fixed, store, realColumns, offset = 0) => {
|
|
52
|
+
const classes = [];
|
|
53
|
+
const { direction, start, after } = isFixedColumn(index, fixed, store, realColumns);
|
|
54
|
+
if (direction && start && after) {
|
|
55
|
+
const isLeft = direction === "left";
|
|
56
|
+
classes.push(`${namespace}-fixed-column--${direction}`);
|
|
57
|
+
if (isLeft && after + offset === unref(store.states.fixedLeafColumnsLength) - 1) {
|
|
58
|
+
classes.push("is-last-column");
|
|
59
|
+
} else if (!isLeft && start - offset === unref(store.states.columns).length - unref(store.states.rightFixedLeafColumnsLength)) {
|
|
60
|
+
classes.push("is-first-column");
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return classes;
|
|
64
|
+
};
|
|
65
|
+
function getOffset(offset, column) {
|
|
66
|
+
return offset + (column.realWidth === null || Number.isNaN(column.realWidth) ? Number(column.width) : column.realWidth);
|
|
67
|
+
}
|
|
68
|
+
const getFixedColumnOffset = (index, fixed, store, realColumns) => {
|
|
69
|
+
const { direction, start = 0, after = 0 } = isFixedColumn(index, fixed, store, realColumns);
|
|
70
|
+
if (!direction) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const styles = {};
|
|
74
|
+
const isLeft = direction === "left";
|
|
75
|
+
const columns = unref(store.states.columns);
|
|
76
|
+
if (isLeft) {
|
|
77
|
+
styles.left = columns.slice(0, start).reduce(getOffset, 0);
|
|
78
|
+
} else {
|
|
79
|
+
styles.right = columns.slice(after + 1).reverse().reduce(getOffset, 0);
|
|
80
|
+
}
|
|
81
|
+
return styles;
|
|
82
|
+
};
|
|
83
|
+
const ensurePosition = (style, key) => {
|
|
84
|
+
if (!style) return;
|
|
85
|
+
if (!Number.isNaN(style[key])) {
|
|
86
|
+
style[key] = `${style[key]}px`;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
function defaultSummaryMethod(columns, data, sumText) {
|
|
90
|
+
const sums = [];
|
|
91
|
+
columns.forEach((column, index) => {
|
|
92
|
+
if (index === 0) {
|
|
93
|
+
sums[index] = sumText;
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const values = data.map((item) => Number(item[column.property]));
|
|
97
|
+
const precisions = [];
|
|
98
|
+
let notNumber = true;
|
|
99
|
+
values.forEach((value) => {
|
|
100
|
+
if (!Number.isNaN(+value)) {
|
|
101
|
+
notNumber = false;
|
|
102
|
+
const decimal = `${value}`.split(".")[1];
|
|
103
|
+
precisions.push(decimal ? decimal.length : 0);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
const precision = Math.max.apply(null, precisions);
|
|
107
|
+
if (!notNumber) {
|
|
108
|
+
sums[index] = values.reduce((prev, curr) => {
|
|
109
|
+
const value = Number(curr);
|
|
110
|
+
if (!Number.isNaN(+value)) {
|
|
111
|
+
return Number.parseFloat((prev + curr).toFixed(Math.min(precision, 20)));
|
|
112
|
+
} else {
|
|
113
|
+
return prev;
|
|
114
|
+
}
|
|
115
|
+
}, 0);
|
|
116
|
+
} else {
|
|
117
|
+
sums[index] = "";
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
return sums;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export { defaultSummaryMethod, ensurePosition, getFixedColumnOffset, getFixedColumnsClass, isFixedColumn };
|
|
@@ -71,14 +71,14 @@ export declare const tableProps: {
|
|
|
71
71
|
type: PropType<any[]>;
|
|
72
72
|
default: () => never[];
|
|
73
73
|
};
|
|
74
|
-
load: PropType<import("element-plus/es/components/
|
|
74
|
+
load: PropType<import("element-plus/es/components/index.mjs").TableProps<any>["load"]>;
|
|
75
75
|
className: {
|
|
76
76
|
type: StringConstructor;
|
|
77
77
|
default: string;
|
|
78
78
|
};
|
|
79
79
|
emptyText: StringConstructor;
|
|
80
80
|
sumText: StringConstructor;
|
|
81
|
-
cellClassName: PropType<import("element-plus/es/components/
|
|
81
|
+
cellClassName: PropType<import("element-plus/es/components/index.mjs").TableProps<any>["cellClassName"]>;
|
|
82
82
|
scrollbarAlwaysOn: BooleanConstructor;
|
|
83
83
|
defaultExpandAll: BooleanConstructor;
|
|
84
84
|
lazy: BooleanConstructor;
|
|
@@ -90,36 +90,36 @@ export declare const tableProps: {
|
|
|
90
90
|
type: BooleanConstructor;
|
|
91
91
|
default: boolean;
|
|
92
92
|
};
|
|
93
|
-
showOverflowTooltip: PropType<import("element-plus/es/components/
|
|
94
|
-
tooltipFormatter: PropType<import("element-plus/es/components/
|
|
93
|
+
showOverflowTooltip: PropType<import("element-plus/es/components/index.mjs").TableProps<any>["showOverflowTooltip"]>;
|
|
94
|
+
tooltipFormatter: PropType<import("element-plus/es/components/index.mjs").TableProps<any>["tooltipFormatter"]>;
|
|
95
95
|
stripe: BooleanConstructor;
|
|
96
|
-
rowKey: PropType<import("element-plus/es/components/
|
|
96
|
+
rowKey: PropType<import("element-plus/es/components/index.mjs").TableProps<any>["rowKey"]>;
|
|
97
97
|
showHeader: {
|
|
98
98
|
type: BooleanConstructor;
|
|
99
99
|
default: boolean;
|
|
100
100
|
};
|
|
101
101
|
showSummary: BooleanConstructor;
|
|
102
|
-
summaryMethod: PropType<import("element-plus/es/components/
|
|
103
|
-
rowClassName: PropType<import("element-plus/es/components/
|
|
104
|
-
rowStyle: PropType<import("element-plus/es/components/
|
|
105
|
-
cellStyle: PropType<import("element-plus/es/components/
|
|
106
|
-
headerRowClassName: PropType<import("element-plus/es/components/
|
|
107
|
-
headerRowStyle: PropType<import("element-plus/es/components/
|
|
108
|
-
headerCellClassName: PropType<import("element-plus/es/components/
|
|
109
|
-
headerCellStyle: PropType<import("element-plus/es/components/
|
|
102
|
+
summaryMethod: PropType<import("element-plus/es/components/index.mjs").TableProps<any>["summaryMethod"]>;
|
|
103
|
+
rowClassName: PropType<import("element-plus/es/components/index.mjs").TableProps<any>["rowClassName"]>;
|
|
104
|
+
rowStyle: PropType<import("element-plus/es/components/index.mjs").TableProps<any>["rowStyle"]>;
|
|
105
|
+
cellStyle: PropType<import("element-plus/es/components/index.mjs").TableProps<any>["cellStyle"]>;
|
|
106
|
+
headerRowClassName: PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerRowClassName"]>;
|
|
107
|
+
headerRowStyle: PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerRowStyle"]>;
|
|
108
|
+
headerCellClassName: PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerCellClassName"]>;
|
|
109
|
+
headerCellStyle: PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerCellStyle"]>;
|
|
110
110
|
highlightCurrentRow: BooleanConstructor;
|
|
111
111
|
currentRowKey: (NumberConstructor | StringConstructor)[];
|
|
112
|
-
expandRowKeys: PropType<import("element-plus/es/components/
|
|
113
|
-
defaultSort: PropType<import("element-plus/es/components/
|
|
112
|
+
expandRowKeys: PropType<import("element-plus/es/components/index.mjs").TableProps<any>["expandRowKeys"]>;
|
|
113
|
+
defaultSort: PropType<import("element-plus/es/components/index.mjs").TableProps<any>["defaultSort"]>;
|
|
114
114
|
tooltipEffect: StringConstructor;
|
|
115
|
-
tooltipOptions: PropType<import("element-plus/es/components/
|
|
116
|
-
spanMethod: PropType<import("element-plus/es/components/
|
|
115
|
+
tooltipOptions: PropType<import("element-plus/es/components/index.mjs").TableProps<any>["tooltipOptions"]>;
|
|
116
|
+
spanMethod: PropType<import("element-plus/es/components/index.mjs").TableProps<any>["spanMethod"]>;
|
|
117
117
|
selectOnIndeterminate: {
|
|
118
118
|
type: BooleanConstructor;
|
|
119
119
|
default: boolean;
|
|
120
120
|
};
|
|
121
121
|
treeProps: {
|
|
122
|
-
type: PropType<import("element-plus/es/components/
|
|
122
|
+
type: PropType<import("element-plus/es/components/index.mjs").TableProps<any>["treeProps"]>;
|
|
123
123
|
default: () => {
|
|
124
124
|
hasChildren: string;
|
|
125
125
|
children: string;
|
|
@@ -58,14 +58,14 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
58
58
|
type: import("vue").PropType<any[]>;
|
|
59
59
|
default: () => never[];
|
|
60
60
|
};
|
|
61
|
-
load: import("vue").PropType<import("element-plus/es/components/
|
|
61
|
+
load: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["load"]>;
|
|
62
62
|
className: {
|
|
63
63
|
type: StringConstructor;
|
|
64
64
|
default: string;
|
|
65
65
|
};
|
|
66
66
|
emptyText: StringConstructor;
|
|
67
67
|
sumText: StringConstructor;
|
|
68
|
-
cellClassName: import("vue").PropType<import("element-plus/es/components/
|
|
68
|
+
cellClassName: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["cellClassName"]>;
|
|
69
69
|
scrollbarAlwaysOn: BooleanConstructor;
|
|
70
70
|
defaultExpandAll: BooleanConstructor;
|
|
71
71
|
lazy: BooleanConstructor;
|
|
@@ -77,36 +77,36 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
77
77
|
type: BooleanConstructor;
|
|
78
78
|
default: boolean;
|
|
79
79
|
};
|
|
80
|
-
showOverflowTooltip: import("vue").PropType<import("element-plus/es/components/
|
|
81
|
-
tooltipFormatter: import("vue").PropType<import("element-plus/es/components/
|
|
80
|
+
showOverflowTooltip: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["showOverflowTooltip"]>;
|
|
81
|
+
tooltipFormatter: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["tooltipFormatter"]>;
|
|
82
82
|
stripe: BooleanConstructor;
|
|
83
|
-
rowKey: import("vue").PropType<import("element-plus/es/components/
|
|
83
|
+
rowKey: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["rowKey"]>;
|
|
84
84
|
showHeader: {
|
|
85
85
|
type: BooleanConstructor;
|
|
86
86
|
default: boolean;
|
|
87
87
|
};
|
|
88
88
|
showSummary: BooleanConstructor;
|
|
89
|
-
summaryMethod: import("vue").PropType<import("element-plus/es/components/
|
|
90
|
-
rowClassName: import("vue").PropType<import("element-plus/es/components/
|
|
91
|
-
rowStyle: import("vue").PropType<import("element-plus/es/components/
|
|
92
|
-
cellStyle: import("vue").PropType<import("element-plus/es/components/
|
|
93
|
-
headerRowClassName: import("vue").PropType<import("element-plus/es/components/
|
|
94
|
-
headerRowStyle: import("vue").PropType<import("element-plus/es/components/
|
|
95
|
-
headerCellClassName: import("vue").PropType<import("element-plus/es/components/
|
|
96
|
-
headerCellStyle: import("vue").PropType<import("element-plus/es/components/
|
|
89
|
+
summaryMethod: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["summaryMethod"]>;
|
|
90
|
+
rowClassName: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["rowClassName"]>;
|
|
91
|
+
rowStyle: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["rowStyle"]>;
|
|
92
|
+
cellStyle: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["cellStyle"]>;
|
|
93
|
+
headerRowClassName: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerRowClassName"]>;
|
|
94
|
+
headerRowStyle: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerRowStyle"]>;
|
|
95
|
+
headerCellClassName: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerCellClassName"]>;
|
|
96
|
+
headerCellStyle: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerCellStyle"]>;
|
|
97
97
|
highlightCurrentRow: BooleanConstructor;
|
|
98
98
|
currentRowKey: (NumberConstructor | StringConstructor)[];
|
|
99
|
-
expandRowKeys: import("vue").PropType<import("element-plus/es/components/
|
|
100
|
-
defaultSort: import("vue").PropType<import("element-plus/es/components/
|
|
99
|
+
expandRowKeys: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["expandRowKeys"]>;
|
|
100
|
+
defaultSort: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["defaultSort"]>;
|
|
101
101
|
tooltipEffect: StringConstructor;
|
|
102
|
-
tooltipOptions: import("vue").PropType<import("element-plus/es/components/
|
|
103
|
-
spanMethod: import("vue").PropType<import("element-plus/es/components/
|
|
102
|
+
tooltipOptions: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["tooltipOptions"]>;
|
|
103
|
+
spanMethod: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["spanMethod"]>;
|
|
104
104
|
selectOnIndeterminate: {
|
|
105
105
|
type: BooleanConstructor;
|
|
106
106
|
default: boolean;
|
|
107
107
|
};
|
|
108
108
|
treeProps: {
|
|
109
|
-
type: import("vue").PropType<import("element-plus/es/components/
|
|
109
|
+
type: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["treeProps"]>;
|
|
110
110
|
default: () => {
|
|
111
111
|
hasChildren: string;
|
|
112
112
|
children: string;
|
|
@@ -211,14 +211,14 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
211
211
|
type: import("vue").PropType<any[]>;
|
|
212
212
|
default: () => never[];
|
|
213
213
|
};
|
|
214
|
-
load: import("vue").PropType<import("element-plus/es/components/
|
|
214
|
+
load: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["load"]>;
|
|
215
215
|
className: {
|
|
216
216
|
type: StringConstructor;
|
|
217
217
|
default: string;
|
|
218
218
|
};
|
|
219
219
|
emptyText: StringConstructor;
|
|
220
220
|
sumText: StringConstructor;
|
|
221
|
-
cellClassName: import("vue").PropType<import("element-plus/es/components/
|
|
221
|
+
cellClassName: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["cellClassName"]>;
|
|
222
222
|
scrollbarAlwaysOn: BooleanConstructor;
|
|
223
223
|
defaultExpandAll: BooleanConstructor;
|
|
224
224
|
lazy: BooleanConstructor;
|
|
@@ -230,36 +230,36 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
230
230
|
type: BooleanConstructor;
|
|
231
231
|
default: boolean;
|
|
232
232
|
};
|
|
233
|
-
showOverflowTooltip: import("vue").PropType<import("element-plus/es/components/
|
|
234
|
-
tooltipFormatter: import("vue").PropType<import("element-plus/es/components/
|
|
233
|
+
showOverflowTooltip: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["showOverflowTooltip"]>;
|
|
234
|
+
tooltipFormatter: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["tooltipFormatter"]>;
|
|
235
235
|
stripe: BooleanConstructor;
|
|
236
|
-
rowKey: import("vue").PropType<import("element-plus/es/components/
|
|
236
|
+
rowKey: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["rowKey"]>;
|
|
237
237
|
showHeader: {
|
|
238
238
|
type: BooleanConstructor;
|
|
239
239
|
default: boolean;
|
|
240
240
|
};
|
|
241
241
|
showSummary: BooleanConstructor;
|
|
242
|
-
summaryMethod: import("vue").PropType<import("element-plus/es/components/
|
|
243
|
-
rowClassName: import("vue").PropType<import("element-plus/es/components/
|
|
244
|
-
rowStyle: import("vue").PropType<import("element-plus/es/components/
|
|
245
|
-
cellStyle: import("vue").PropType<import("element-plus/es/components/
|
|
246
|
-
headerRowClassName: import("vue").PropType<import("element-plus/es/components/
|
|
247
|
-
headerRowStyle: import("vue").PropType<import("element-plus/es/components/
|
|
248
|
-
headerCellClassName: import("vue").PropType<import("element-plus/es/components/
|
|
249
|
-
headerCellStyle: import("vue").PropType<import("element-plus/es/components/
|
|
242
|
+
summaryMethod: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["summaryMethod"]>;
|
|
243
|
+
rowClassName: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["rowClassName"]>;
|
|
244
|
+
rowStyle: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["rowStyle"]>;
|
|
245
|
+
cellStyle: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["cellStyle"]>;
|
|
246
|
+
headerRowClassName: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerRowClassName"]>;
|
|
247
|
+
headerRowStyle: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerRowStyle"]>;
|
|
248
|
+
headerCellClassName: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerCellClassName"]>;
|
|
249
|
+
headerCellStyle: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["headerCellStyle"]>;
|
|
250
250
|
highlightCurrentRow: BooleanConstructor;
|
|
251
251
|
currentRowKey: (NumberConstructor | StringConstructor)[];
|
|
252
|
-
expandRowKeys: import("vue").PropType<import("element-plus/es/components/
|
|
253
|
-
defaultSort: import("vue").PropType<import("element-plus/es/components/
|
|
252
|
+
expandRowKeys: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["expandRowKeys"]>;
|
|
253
|
+
defaultSort: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["defaultSort"]>;
|
|
254
254
|
tooltipEffect: StringConstructor;
|
|
255
|
-
tooltipOptions: import("vue").PropType<import("element-plus/es/components/
|
|
256
|
-
spanMethod: import("vue").PropType<import("element-plus/es/components/
|
|
255
|
+
tooltipOptions: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["tooltipOptions"]>;
|
|
256
|
+
spanMethod: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["spanMethod"]>;
|
|
257
257
|
selectOnIndeterminate: {
|
|
258
258
|
type: BooleanConstructor;
|
|
259
259
|
default: boolean;
|
|
260
260
|
};
|
|
261
261
|
treeProps: {
|
|
262
|
-
type: import("vue").PropType<import("element-plus/es/components/
|
|
262
|
+
type: import("vue").PropType<import("element-plus/es/components/index.mjs").TableProps<any>["treeProps"]>;
|
|
263
263
|
default: () => {
|
|
264
264
|
hasChildren: string;
|
|
265
265
|
children: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent, useSlots, unref, computed, ref, useTemplateRef, mergeProps, watch, onMounted, resolveComponent, resolveDirective, withDirectives, createElementBlock, openBlock, normalizeStyle, normalizeClass, createCommentVNode, createElementVNode, createVNode, createBlock, renderSlot, withCtx, createSlots, Fragment, renderList, normalizeProps, guardReactiveProps } from 'vue';
|
|
1
|
+
import { defineComponent, useSlots, unref, computed, ref, useTemplateRef, mergeProps, watch, onMounted, onBeforeUnmount, resolveComponent, resolveDirective, withDirectives, createElementBlock, openBlock, normalizeStyle, normalizeClass, createCommentVNode, createElementVNode, createVNode, createBlock, renderSlot, withCtx, createSlots, Fragment, renderList, Teleport, vShow, normalizeProps, guardReactiveProps } from 'vue';
|
|
2
2
|
import { merge, cloneDeep, get } from 'lodash-es';
|
|
3
3
|
import { reactiveComputed, reactiveOmit } from '@vueuse/core';
|
|
4
|
-
import { useZIndex, ElButton } from 'element-plus';
|
|
4
|
+
import { useNamespace, useZIndex, ElButton, Mousewheel } from 'element-plus';
|
|
5
5
|
import { tableEmitEvents, tableProps, tableEmitOnEvents, defaultTableConfig, elSlotsName, omittedTableProps, tableExposeKeys } from './table.js';
|
|
6
6
|
import stdin_default$6 from './table-column/table-column.vue.js';
|
|
7
7
|
import stdin_default$5 from './table-column-editor/table-column-editor.vue.js';
|
|
@@ -10,6 +10,10 @@ import stdin_default$4 from './table-export/table-export.vue.js';
|
|
|
10
10
|
import stdin_default$3 from '../icon/icon.vue.js';
|
|
11
11
|
import { filterEmptyFormValue } from './utils.js';
|
|
12
12
|
import stdin_default$1 from './style/index.js';
|
|
13
|
+
import { hColgroup } from 'element-plus/es/components/table/src/h-helper.mjs';
|
|
14
|
+
import stdin_default$7 from './table-footer/index.js';
|
|
15
|
+
import { defaultSummaryMethod } from './table-footer/utils.js';
|
|
16
|
+
import { uniqid } from '../../utils/string.js';
|
|
13
17
|
import { useComponentConfig, useConfig } from '../config-provider/config-provider.js';
|
|
14
18
|
import { isNullish, isObject, isFunction } from '../../utils/is.js';
|
|
15
19
|
import { flatColumns } from '../../utils/excel/index.js';
|
|
@@ -18,6 +22,7 @@ import { useFetch } from '../../hooks/useFetch.js';
|
|
|
18
22
|
import { useFullPage } from '../../hooks/useFullPage.js';
|
|
19
23
|
import { useLocale } from '../../hooks/useLocale.js';
|
|
20
24
|
import { addPxUnit } from '../../utils/css.js';
|
|
25
|
+
import { useResizeObserver } from '../../hooks/useResizeObserver.js';
|
|
21
26
|
import { walkTree } from '../../utils/tree.js';
|
|
22
27
|
|
|
23
28
|
const _hoisted_1 = {
|
|
@@ -55,6 +60,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
55
60
|
const {
|
|
56
61
|
t
|
|
57
62
|
} = useLocale();
|
|
63
|
+
const tableId = uniqid();
|
|
58
64
|
const {
|
|
59
65
|
prefixCls
|
|
60
66
|
} = useComponentConfig("table");
|
|
@@ -104,7 +110,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
104
110
|
};
|
|
105
111
|
const exportColumns = computed(() => {
|
|
106
112
|
return renderedColumns.value?.filter(column => {
|
|
107
|
-
return !isNullish(column.prop) && column.prop !== "" || column.columns && column.columns.length > 0;
|
|
113
|
+
return !isNullish(column.prop || column.property) && (column.prop || column.property) !== "" || column.columns && column.columns.length > 0;
|
|
108
114
|
});
|
|
109
115
|
});
|
|
110
116
|
watch([() => props.columns, () => props.actionColumn], () => {
|
|
@@ -115,37 +121,30 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
115
121
|
const onColumnReset = () => {
|
|
116
122
|
setRenderedColumns();
|
|
117
123
|
};
|
|
124
|
+
const flattedColumns = computed(() => flatColumns(props.columns));
|
|
118
125
|
const tableData = ref(props.data || []);
|
|
119
126
|
const tableDataWithSummary = computed(() => {
|
|
120
|
-
const columns =
|
|
127
|
+
const columns = flattedColumns.value.map(column => {
|
|
121
128
|
return {
|
|
122
129
|
...column,
|
|
123
|
-
property: column.prop
|
|
130
|
+
property: column.property || column.prop
|
|
124
131
|
};
|
|
125
132
|
});
|
|
126
133
|
const data = [...tableData.value];
|
|
127
|
-
if (props.
|
|
128
|
-
|
|
134
|
+
if (props.showSummary) {
|
|
135
|
+
let sums = props.summaryMethod ? props.summaryMethod({
|
|
129
136
|
columns,
|
|
130
137
|
data: tableData.value
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
return String(data2.reduce((sum2, num) => sum2 + num, 0));
|
|
143
|
-
});
|
|
144
|
-
sum[0] = props.sumText || t("co.table.total");
|
|
145
|
-
data.push(columns.reduce((row, column, index) => {
|
|
146
|
-
row[column.prop] = sum[index];
|
|
147
|
-
return row;
|
|
148
|
-
}, {}));
|
|
138
|
+
}) : defaultSummaryMethod(columns, data, props.sumText || t("co.table.total"));
|
|
139
|
+
if (!Array.isArray(sums[0])) {
|
|
140
|
+
sums = [sums];
|
|
141
|
+
}
|
|
142
|
+
data.push(...sums.map(sum => {
|
|
143
|
+
return columns.reduce((row, column, index) => {
|
|
144
|
+
row[column.prop || column.property] = getVNodeText(sum[index]);
|
|
145
|
+
return row;
|
|
146
|
+
}, {});
|
|
147
|
+
}));
|
|
149
148
|
}
|
|
150
149
|
return data;
|
|
151
150
|
});
|
|
@@ -183,6 +182,45 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
183
182
|
execute();
|
|
184
183
|
}
|
|
185
184
|
});
|
|
185
|
+
const ns = useNamespace("table");
|
|
186
|
+
const isEmpty = computed(() => (tableData.value || []).length === 0);
|
|
187
|
+
const handleHeaderFooterMousewheel = (_, data) => {
|
|
188
|
+
const {
|
|
189
|
+
pixelX,
|
|
190
|
+
pixelY
|
|
191
|
+
} = data;
|
|
192
|
+
if (Math.abs(pixelX) >= Math.abs(pixelY)) {
|
|
193
|
+
elTableRef.value.$refs.bodyWrapper.scrollLeft += data.pixelX / 5;
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
const tableBodyStyles = ref({});
|
|
197
|
+
const store = ref(null);
|
|
198
|
+
const computedSumText = ref("");
|
|
199
|
+
const tableBodyRef = ref(null);
|
|
200
|
+
useResizeObserver(tableBodyRef, ({
|
|
201
|
+
inlineSize
|
|
202
|
+
}) => {
|
|
203
|
+
tableBodyStyles.value.width = inlineSize + "px";
|
|
204
|
+
});
|
|
205
|
+
onMounted(() => {
|
|
206
|
+
store.value = elTableRef.value.store;
|
|
207
|
+
computedSumText.value = elTableRef.value.computedSumText;
|
|
208
|
+
bindScrollEvent();
|
|
209
|
+
tableBodyRef.value = document.querySelector(`.${tableId} .el-table__body`);
|
|
210
|
+
});
|
|
211
|
+
onBeforeUnmount(() => {
|
|
212
|
+
unbindScrollEvent();
|
|
213
|
+
});
|
|
214
|
+
const footerWrapper2 = ref(null);
|
|
215
|
+
const scrollHander = event => {
|
|
216
|
+
footerWrapper2.value.scrollLeft = event.target.scrollLeft;
|
|
217
|
+
};
|
|
218
|
+
const bindScrollEvent = () => {
|
|
219
|
+
document.querySelector(`.${tableId} .el-scrollbar__wrap`)?.addEventListener("scroll", scrollHander);
|
|
220
|
+
};
|
|
221
|
+
const unbindScrollEvent = () => {
|
|
222
|
+
document.querySelector(`.${tableId} .el-scrollbar__wrap`)?.removeEventListener("scroll", scrollHander);
|
|
223
|
+
};
|
|
186
224
|
const pagination = reactiveComputed(() => {
|
|
187
225
|
return merge({}, defaultTableConfig.pagination, unref(tableConfig)?.pagination, isObject(props.pagination) ? props.pagination : null);
|
|
188
226
|
});
|
|
@@ -429,8 +467,11 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
429
467
|
ref_key: "elTableRef",
|
|
430
468
|
ref: elTableRef
|
|
431
469
|
}, elTableProps.value, {
|
|
470
|
+
class: unref(tableId),
|
|
432
471
|
data: tableData.value,
|
|
433
472
|
"expand-row-keys": innerExpandRowKeys.value,
|
|
473
|
+
"show-summary": false,
|
|
474
|
+
"summary-method": void 0,
|
|
434
475
|
style: {
|
|
435
476
|
"width": "100%"
|
|
436
477
|
},
|
|
@@ -439,13 +480,40 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
439
480
|
}), createSlots({
|
|
440
481
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(renderedColumns.value, column => {
|
|
441
482
|
return openBlock(), createBlock(stdin_default$6, mergeProps({
|
|
442
|
-
key: column.prop,
|
|
483
|
+
key: column.prop || column.property,
|
|
443
484
|
ref_for: true
|
|
444
485
|
}, column, {
|
|
445
486
|
"internal-slot": _ctx.$slots
|
|
446
487
|
}), null, 16, ["internal-slot"]);
|
|
447
488
|
}), 128
|
|
448
|
-
/* KEYED_FRAGMENT */))
|
|
489
|
+
/* KEYED_FRAGMENT */)), (openBlock(), createBlock(Teleport, {
|
|
490
|
+
to: `.${unref(tableId)} .el-table__inner-wrapper`,
|
|
491
|
+
defer: ""
|
|
492
|
+
}, [_ctx.showSummary && _ctx.tableLayout === "fixed" ? withDirectives((openBlock(), createElementBlock("div", {
|
|
493
|
+
key: 0,
|
|
494
|
+
ref_key: "footerWrapper2",
|
|
495
|
+
ref: footerWrapper2,
|
|
496
|
+
class: normalizeClass(unref(ns).e("footer-wrapper"))
|
|
497
|
+
}, [createElementVNode("table", {
|
|
498
|
+
class: normalizeClass(unref(ns).e("footer")),
|
|
499
|
+
cellspacing: "0",
|
|
500
|
+
cellpadding: "0",
|
|
501
|
+
border: "0",
|
|
502
|
+
style: normalizeStyle(tableBodyStyles.value)
|
|
503
|
+
}, [store.value ? (openBlock(), createBlock(unref(hColgroup), {
|
|
504
|
+
key: 0,
|
|
505
|
+
columns: store.value.states.columns,
|
|
506
|
+
"table-layout": _ctx.tableLayout
|
|
507
|
+
}, null, 8, ["columns", "table-layout"])) : createCommentVNode("v-if", true), store.value ? (openBlock(), createBlock(unref(stdin_default$7), {
|
|
508
|
+
key: 1,
|
|
509
|
+
border: _ctx.border,
|
|
510
|
+
"default-sort": _ctx.defaultSort,
|
|
511
|
+
store: store.value,
|
|
512
|
+
"sum-text": computedSumText.value,
|
|
513
|
+
"summary-method": _ctx.summaryMethod
|
|
514
|
+
}, null, 8, ["border", "default-sort", "store", "sum-text", "summary-method"])) : createCommentVNode("v-if", true)], 6
|
|
515
|
+
/* CLASS, STYLE */)], 2
|
|
516
|
+
/* CLASS */)), [[vShow, !isEmpty.value], [unref(Mousewheel), handleHeaderFooterMousewheel]]) : createCommentVNode("v-if", true)], 8, ["to"]))]),
|
|
449
517
|
_: 2
|
|
450
518
|
/* DYNAMIC */
|
|
451
519
|
}, [renderList(passedElSlotsName.value, name => {
|
|
@@ -453,7 +521,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
453
521
|
name,
|
|
454
522
|
fn: withCtx(slotProps => [renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps)))])
|
|
455
523
|
};
|
|
456
|
-
})]), 1040, ["data", "expand-row-keys"])], 2
|
|
524
|
+
})]), 1040, ["class", "data", "expand-row-keys"])], 2
|
|
457
525
|
/* CLASS */), paginationProps.value ? (openBlock(), createBlock(_component_el_pagination, mergeProps({
|
|
458
526
|
key: 1
|
|
459
527
|
}, paginationProps.value, {
|