vxe-table 4.23.8 → 4.23.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all.esm.js +5683 -3798
- package/es/components.d.ts +1 -0
- package/es/components.js +2 -7
- package/es/grid/src/emits.js +1 -15
- package/es/grid/src/grid.js +397 -120
- package/es/index.esm.js +5 -3
- package/es/index.js +5 -3
- package/es/table/module/custom/hook.js +49 -42
- package/es/table/module/custom/panel.js +777 -527
- package/es/table/module/edit/hook.js +140 -62
- package/es/table/module/export/export-panel.js +399 -316
- package/es/table/module/export/hook.js +395 -337
- package/es/table/module/export/import-panel.js +152 -123
- package/es/table/module/filter/hook.js +16 -2
- package/es/table/module/filter/panel.js +146 -84
- package/es/table/module/keyboard/hook.js +8 -4
- package/es/table/module/menu/panel.js +197 -126
- package/es/table/render/index.js +151 -98
- package/es/table/src/body.js +355 -233
- package/es/table/src/cell.js +426 -269
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/footer.js +144 -99
- package/es/table/src/group.js +7 -3
- package/es/table/src/header.js +229 -172
- package/es/table/src/table.js +1503 -1030
- package/es/table/src/util.js +15 -19
- package/es/toolbar/src/toolbar.js +132 -75
- package/es/ui/index.js +1 -1
- package/es/ui/src/dom.js +9 -6
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/utils.d.ts +1 -1
- package/lib/components.js +2 -7
- package/lib/grid/src/emits.js +1 -15
- package/lib/grid/src/grid.js +397 -120
- package/lib/index.common.js +5 -3
- package/lib/index.js +5 -3
- package/lib/index.umd.js +5652 -3797
- package/lib/index.umd.min.js +3 -3
- package/lib/table/module/custom/hook.js +49 -42
- package/lib/table/module/custom/panel.js +777 -527
- package/lib/table/module/edit/hook.js +140 -62
- package/lib/table/module/export/export-panel.js +399 -316
- package/lib/table/module/export/hook.js +395 -337
- package/lib/table/module/export/import-panel.js +152 -123
- package/lib/table/module/filter/hook.js +16 -2
- package/lib/table/module/filter/panel.js +146 -84
- package/lib/table/module/keyboard/hook.js +8 -4
- package/lib/table/module/menu/panel.js +197 -126
- package/lib/table/render/index.js +151 -98
- package/lib/table/src/body.js +355 -233
- package/lib/table/src/cell.js +426 -269
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/footer.js +144 -99
- package/lib/table/src/group.js +7 -3
- package/lib/table/src/header.js +229 -172
- package/lib/table/src/table.js +1471 -1029
- package/lib/table/src/util.js +15 -19
- package/lib/toolbar/src/toolbar.js +132 -75
- package/lib/ui/index.js +1 -1
- package/lib/ui/src/dom.js +9 -6
- package/lib/ui/src/log.js +1 -1
- package/package.json +2 -2
- package/packages/colgroup/index.ts +22 -22
- package/packages/column/index.ts +22 -22
- package/packages/components.ts +42 -44
- package/packages/grid/index.ts +18 -18
- package/packages/grid/src/emits.ts +5 -19
- package/packages/grid/src/grid.ts +2229 -1925
- package/packages/grid/src/props.ts +22 -23
- package/packages/index.ts +13 -11
- package/packages/locale/lang/fr-FR.ts +15 -15
- package/packages/locale/lang/it-IT.ts +4 -4
- package/packages/locale/lang/uk-UA.ts +1 -1
- package/packages/locale/lang/uz-UZ.ts +13 -13
- package/packages/locale/lang/zh-CN.ts +907 -907
- package/packages/table/index.ts +26 -26
- package/packages/table/module/custom/hook.ts +510 -503
- package/packages/table/module/custom/panel.ts +2002 -1743
- package/packages/table/module/edit/hook.ts +1224 -1131
- package/packages/table/module/export/export-panel.ts +697 -611
- package/packages/table/module/export/hook.ts +2160 -2059
- package/packages/table/module/export/import-panel.ts +319 -279
- package/packages/table/module/export/util.ts +25 -24
- package/packages/table/module/filter/hook.ts +519 -501
- package/packages/table/module/filter/panel.ts +368 -304
- package/packages/table/module/keyboard/hook.ts +498 -494
- package/packages/table/module/menu/hook.ts +330 -330
- package/packages/table/module/menu/panel.ts +272 -201
- package/packages/table/module/validator/hook.ts +653 -635
- package/packages/table/render/index.ts +1819 -1744
- package/packages/table/src/body.ts +1078 -955
- package/packages/table/src/cell.ts +1524 -1359
- package/packages/table/src/column.ts +192 -192
- package/packages/table/src/columnInfo.ts +232 -232
- package/packages/table/src/emits.ts +134 -134
- package/packages/table/src/footer.ts +425 -380
- package/packages/table/src/group.ts +67 -63
- package/packages/table/src/header.ts +642 -581
- package/packages/table/src/props.ts +336 -336
- package/packages/table/src/store.ts +14 -14
- package/packages/table/src/table.ts +16011 -15454
- package/packages/table/src/use/cell-view.ts +41 -44
- package/packages/table/src/use/index.ts +1 -1
- package/packages/table/src/util.ts +1206 -1216
- package/packages/toolbar/index.ts +18 -18
- package/packages/toolbar/src/toolbar.ts +768 -706
- package/packages/ui/index.ts +519 -520
- package/packages/ui/src/anime.ts +51 -52
- package/packages/ui/src/comp.ts +3 -3
- package/packages/ui/src/dom.ts +466 -463
- package/packages/ui/src/log.ts +19 -19
- package/packages/ui/src/utils.ts +66 -66
- package/packages/ui/src/vn.ts +55 -55
- package/packages/v-x-e-table/index.d.ts +3 -3
- package/packages/v-x-e-table/index.ts +3 -3
- package/types/all.d.ts +76 -76
- package/types/index.d.ts +4 -4
- /package/dist/{iconfont.1793007753347.ttf → iconfont.1793015256719.ttf} +0 -0
- /package/dist/{iconfont.1793007753347.woff → iconfont.1793015256719.woff} +0 -0
- /package/dist/{iconfont.1793007753347.woff2 → iconfont.1793015256719.woff2} +0 -0
- /package/es/{iconfont.1793007753347.ttf → iconfont.1793015256719.ttf} +0 -0
- /package/es/{iconfont.1793007753347.woff → iconfont.1793015256719.woff} +0 -0
- /package/es/{iconfont.1793007753347.woff2 → iconfont.1793015256719.woff2} +0 -0
- /package/lib/{iconfont.1793007753347.ttf → iconfont.1793015256719.ttf} +0 -0
- /package/lib/{iconfont.1793007753347.woff → iconfont.1793015256719.woff} +0 -0
- /package/lib/{iconfont.1793007753347.woff2 → iconfont.1793015256719.woff2} +0 -0
package/es/table/src/cell.js
CHANGED
|
@@ -10,19 +10,23 @@ function renderTitlePrefixIcon(params) {
|
|
|
10
10
|
const { $table, column } = params;
|
|
11
11
|
const titlePrefix = column.titlePrefix || column.titleHelp;
|
|
12
12
|
if (titlePrefix) {
|
|
13
|
-
return h(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
return h(
|
|
14
|
+
"span",
|
|
15
|
+
{
|
|
16
|
+
class: ["vxe-cell-title-prefix-icon", titlePrefix.iconStatus ? `theme--${titlePrefix.iconStatus}` : ""],
|
|
17
|
+
onMouseenter(evnt) {
|
|
18
|
+
$table.triggerHeaderTitleEvent(evnt, titlePrefix, params);
|
|
19
|
+
},
|
|
20
|
+
onMouseleave(evnt) {
|
|
21
|
+
$table.handleTargetLeaveEvent(evnt);
|
|
22
|
+
}
|
|
17
23
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
})
|
|
25
|
-
]);
|
|
24
|
+
[
|
|
25
|
+
h("i", {
|
|
26
|
+
class: titlePrefix.icon || getIcon().TABLE_TITLE_PREFIX
|
|
27
|
+
})
|
|
28
|
+
]
|
|
29
|
+
);
|
|
26
30
|
}
|
|
27
31
|
return renderEmptyElement($table);
|
|
28
32
|
}
|
|
@@ -30,19 +34,23 @@ function renderTitleSuffixIcon(params) {
|
|
|
30
34
|
const { $table, column } = params;
|
|
31
35
|
const titleSuffix = column.titleSuffix;
|
|
32
36
|
if (titleSuffix) {
|
|
33
|
-
return h(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
return h(
|
|
38
|
+
"span",
|
|
39
|
+
{
|
|
40
|
+
class: ["vxe-cell-title-suffix-icon", titleSuffix.iconStatus ? `theme--${titleSuffix.iconStatus}` : ""],
|
|
41
|
+
onMouseenter(evnt) {
|
|
42
|
+
$table.triggerHeaderTitleEvent(evnt, titleSuffix, params);
|
|
43
|
+
},
|
|
44
|
+
onMouseleave(evnt) {
|
|
45
|
+
$table.handleTargetLeaveEvent(evnt);
|
|
46
|
+
}
|
|
37
47
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
})
|
|
45
|
-
]);
|
|
48
|
+
[
|
|
49
|
+
h("i", {
|
|
50
|
+
class: titleSuffix.icon || getIcon().TABLE_TITLE_SUFFIX
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
);
|
|
46
54
|
}
|
|
47
55
|
return renderEmptyElement($table);
|
|
48
56
|
}
|
|
@@ -68,17 +76,24 @@ function renderCellDragIcon(params) {
|
|
|
68
76
|
};
|
|
69
77
|
ons.onMouseup = $table.handleCellDragMouseupEvent;
|
|
70
78
|
}
|
|
71
|
-
return h(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
return h(
|
|
80
|
+
"span",
|
|
81
|
+
{
|
|
82
|
+
key: "dg",
|
|
83
|
+
class: [
|
|
84
|
+
"vxe-cell--drag-handle",
|
|
85
|
+
{
|
|
86
|
+
"is--disabled": isDisabled
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
...ons
|
|
90
|
+
},
|
|
91
|
+
rowDragIconSlot ? $table.callSlot(rowDragIconSlot, params) : [
|
|
92
|
+
h("i", {
|
|
93
|
+
class: icon || (dragConfig ? dragConfig.rowIcon : "") || getIcon().TABLE_DRAG_ROW
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
);
|
|
82
97
|
}
|
|
83
98
|
function renderCellBaseVNs(params, content) {
|
|
84
99
|
const { $table, column, level } = params;
|
|
@@ -92,17 +107,13 @@ function renderCellBaseVNs(params, content) {
|
|
|
92
107
|
const { showIcon, isPeerDrag, isCrossDrag, visibleMethod } = rowDragOpts;
|
|
93
108
|
const rVisibleMethod = visibleMethod || (dragConfig ? dragConfig.rowVisibleMethod : null);
|
|
94
109
|
const vns = [];
|
|
95
|
-
if (dragSort && rowOpts.drag && (
|
|
110
|
+
if (dragSort && rowOpts.drag && (showIcon || (dragConfig ? dragConfig.showRowIcon : false)) && (!rVisibleMethod || rVisibleMethod(params))) {
|
|
96
111
|
if (treeConfig) {
|
|
97
112
|
if (treeOpts.transform && (isPeerDrag || isCrossDrag || !level)) {
|
|
98
|
-
vns.push(
|
|
99
|
-
renderCellDragIcon(params)
|
|
100
|
-
);
|
|
113
|
+
vns.push(renderCellDragIcon(params));
|
|
101
114
|
}
|
|
102
115
|
} else {
|
|
103
|
-
vns.push(
|
|
104
|
-
renderCellDragIcon(params)
|
|
105
|
-
);
|
|
116
|
+
vns.push(renderCellDragIcon(params));
|
|
106
117
|
}
|
|
107
118
|
}
|
|
108
119
|
return vns.concat(XEUtils.isArray(content) ? content : [content]);
|
|
@@ -129,28 +140,30 @@ function renderHeaderCellDragIcon(params) {
|
|
|
129
140
|
};
|
|
130
141
|
ons.onMouseup = $table.handleHeaderCellDragMouseupEvent;
|
|
131
142
|
}
|
|
132
|
-
return h(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
"
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
+
return h(
|
|
144
|
+
"span",
|
|
145
|
+
{
|
|
146
|
+
key: "dg",
|
|
147
|
+
class: [
|
|
148
|
+
"vxe-cell--drag-handle",
|
|
149
|
+
{
|
|
150
|
+
"is--disabled": isDisabled
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
...ons
|
|
154
|
+
},
|
|
155
|
+
columnDragIconSlot ? $table.callSlot(columnDragIconSlot, params) : [
|
|
156
|
+
h("i", {
|
|
157
|
+
class: icon || getIcon().TABLE_DRAG_COLUMN
|
|
158
|
+
})
|
|
159
|
+
]
|
|
160
|
+
);
|
|
143
161
|
}
|
|
144
162
|
}
|
|
145
163
|
return renderEmptyElement($table);
|
|
146
164
|
}
|
|
147
165
|
function renderHeaderCellBaseVNs(params, content) {
|
|
148
|
-
const vns = [
|
|
149
|
-
renderTitlePrefixIcon(params),
|
|
150
|
-
renderHeaderCellDragIcon(params),
|
|
151
|
-
...XEUtils.isArray(content) ? content : [content],
|
|
152
|
-
renderTitleSuffixIcon(params)
|
|
153
|
-
];
|
|
166
|
+
const vns = [renderTitlePrefixIcon(params), renderHeaderCellDragIcon(params), ...XEUtils.isArray(content) ? content : [content], renderTitleSuffixIcon(params)];
|
|
154
167
|
return vns;
|
|
155
168
|
}
|
|
156
169
|
function getRenderDefaultColumnTitle(column, content) {
|
|
@@ -160,9 +173,13 @@ function getRenderDefaultColumnTitle(column, content) {
|
|
|
160
173
|
innerHTML: content
|
|
161
174
|
});
|
|
162
175
|
}
|
|
163
|
-
return h(
|
|
164
|
-
|
|
165
|
-
|
|
176
|
+
return h(
|
|
177
|
+
"span",
|
|
178
|
+
{
|
|
179
|
+
key: "ct"
|
|
180
|
+
},
|
|
181
|
+
getSlotVNs(content)
|
|
182
|
+
);
|
|
166
183
|
}
|
|
167
184
|
function renderTitleContent(params, content) {
|
|
168
185
|
const { $table, column } = params;
|
|
@@ -203,12 +220,14 @@ function renderTitleContent(params, content) {
|
|
|
203
220
|
}
|
|
204
221
|
const titleVN = getRenderDefaultColumnTitle(column, content);
|
|
205
222
|
return [
|
|
206
|
-
h(
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
223
|
+
h(
|
|
224
|
+
"span",
|
|
225
|
+
{
|
|
226
|
+
class: "vxe-cell--title",
|
|
227
|
+
...ons
|
|
228
|
+
},
|
|
229
|
+
isRowGroupStatus && column.aggFunc && $table.getPivotTableAggregateRenderColTitles ? $table.getPivotTableAggregateRenderColTitles(column, titleVN) : titleSlot ? $table.callSlot(titleSlot, params) : [titleVN]
|
|
230
|
+
)
|
|
212
231
|
];
|
|
213
232
|
}
|
|
214
233
|
function getFooterContent(params) {
|
|
@@ -241,9 +260,13 @@ function getFooterContent(params) {
|
|
|
241
260
|
}
|
|
242
261
|
}
|
|
243
262
|
return [
|
|
244
|
-
h(
|
|
245
|
-
|
|
246
|
-
|
|
263
|
+
h(
|
|
264
|
+
"span",
|
|
265
|
+
{
|
|
266
|
+
class: "vxe-cell--label"
|
|
267
|
+
},
|
|
268
|
+
formatText(itemValue, 1)
|
|
269
|
+
)
|
|
247
270
|
];
|
|
248
271
|
}
|
|
249
272
|
function getDefaultCellLabel(params) {
|
|
@@ -463,7 +486,7 @@ const Cell = {
|
|
|
463
486
|
}
|
|
464
487
|
if (editRenderOpts) {
|
|
465
488
|
const editCompConf = editRenderOpts && editRenderOpts.name ? rendererOpts[editRenderOpts.name] || renderer.get(editRenderOpts.name) : null;
|
|
466
|
-
const editCellRenderFn = editCompConf ? editCompConf.renderTableCell || editCompConf.renderCell ||
|
|
489
|
+
const editCellRenderFn = editCompConf ? editCompConf.renderTableCell || editCompConf.renderCell || editCompConf.renderTableDefault || editCompConf.renderDefault : null;
|
|
467
490
|
if (editCellRenderFn) {
|
|
468
491
|
return renderCellBaseVNs(params, getSlotVNs(editCellRenderFn(editRenderOpts, Object.assign({ $type: editRenderOpts ? "edit" : "cell" }, params))));
|
|
469
492
|
}
|
|
@@ -479,9 +502,13 @@ const Cell = {
|
|
|
479
502
|
},
|
|
480
503
|
[
|
|
481
504
|
// 如果设置占位符
|
|
482
|
-
editRenderOpts && eqEmptyValue(cellValue) ? h(
|
|
483
|
-
|
|
484
|
-
|
|
505
|
+
editRenderOpts && eqEmptyValue(cellValue) ? h(
|
|
506
|
+
"span",
|
|
507
|
+
{
|
|
508
|
+
class: "vxe-cell--placeholder"
|
|
509
|
+
},
|
|
510
|
+
formatText(getFuncText(cellPlaceholder), 1)
|
|
511
|
+
) : h("span", formatText(cellValue, 1))
|
|
485
512
|
]
|
|
486
513
|
)
|
|
487
514
|
]);
|
|
@@ -507,28 +534,43 @@ const Cell = {
|
|
|
507
534
|
const { mode, padding, indent, showIcon, iconOpen, iconClose } = aggregateOpts;
|
|
508
535
|
const rowid = getRowid($table, row);
|
|
509
536
|
const isExpand = !!rowGroupExpandedFlag && !!rowGroupExpandedMaps[rowid];
|
|
510
|
-
return h(
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
h(
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
537
|
+
return h(
|
|
538
|
+
"div",
|
|
539
|
+
{
|
|
540
|
+
class: [
|
|
541
|
+
"vxe-row-group--tree-node",
|
|
542
|
+
{
|
|
543
|
+
"is--expanded": isExpand
|
|
544
|
+
}
|
|
545
|
+
],
|
|
546
|
+
style: mode !== "column" && padding && indent ? {
|
|
547
|
+
paddingLeft: `${level * indent}px`
|
|
548
|
+
} : void 0
|
|
549
|
+
},
|
|
550
|
+
[
|
|
551
|
+
showIcon && row.isAggregate ? h(
|
|
552
|
+
"span",
|
|
553
|
+
{
|
|
554
|
+
class: "vxe-row-group--node-btn",
|
|
555
|
+
onClick(evnt) {
|
|
556
|
+
$table.triggerRowGroupExpandEvent(evnt, params);
|
|
557
|
+
}
|
|
558
|
+
},
|
|
559
|
+
[
|
|
560
|
+
h("i", {
|
|
561
|
+
class: isExpand ? iconOpen || getIcon().TABLE_ROW_GROUP_OPEN : iconClose || getIcon().TABLE_ROW_GROUP_CLOSE
|
|
562
|
+
})
|
|
563
|
+
]
|
|
564
|
+
) : renderEmptyElement($table),
|
|
565
|
+
h(
|
|
566
|
+
"div",
|
|
567
|
+
{
|
|
568
|
+
class: "vxe-row-group-cell"
|
|
569
|
+
},
|
|
570
|
+
cellVNodes
|
|
571
|
+
)
|
|
572
|
+
]
|
|
573
|
+
);
|
|
532
574
|
},
|
|
533
575
|
/**
|
|
534
576
|
* 树
|
|
@@ -572,28 +614,43 @@ const Cell = {
|
|
|
572
614
|
$table.triggerTreeExpandEvent(evnt, params);
|
|
573
615
|
};
|
|
574
616
|
}
|
|
575
|
-
return h(
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
617
|
+
return h(
|
|
618
|
+
"div",
|
|
619
|
+
{
|
|
620
|
+
class: [
|
|
621
|
+
"vxe-cell--tree-node",
|
|
622
|
+
{
|
|
623
|
+
"is--active": isActive
|
|
624
|
+
}
|
|
625
|
+
],
|
|
626
|
+
style: padding && indent ? {
|
|
627
|
+
paddingLeft: `${level * indent}px`
|
|
628
|
+
} : void 0
|
|
629
|
+
},
|
|
630
|
+
[
|
|
631
|
+
showIcon && (lazy ? isLazyLoaded ? hasChild : hasChild || hasLazyChilds : hasChild) && (!visibleMethod || visibleMethod(params)) ? [
|
|
632
|
+
h(
|
|
633
|
+
"div",
|
|
634
|
+
{
|
|
635
|
+
class: "vxe-cell--tree-btn",
|
|
636
|
+
...ons
|
|
637
|
+
},
|
|
638
|
+
[
|
|
639
|
+
h("i", {
|
|
640
|
+
class: isLazyLoading ? iconLoaded || getIcon().TABLE_TREE_LOADED : isActive ? iconOpen || getIcon().TABLE_TREE_OPEN : iconClose || getIcon().TABLE_TREE_CLOSE
|
|
641
|
+
})
|
|
642
|
+
]
|
|
643
|
+
)
|
|
644
|
+
] : null,
|
|
645
|
+
h(
|
|
646
|
+
"div",
|
|
647
|
+
{
|
|
648
|
+
class: "vxe-tree-cell"
|
|
649
|
+
},
|
|
650
|
+
cellVNodes
|
|
651
|
+
)
|
|
652
|
+
]
|
|
653
|
+
);
|
|
597
654
|
},
|
|
598
655
|
/**
|
|
599
656
|
* 层级节点。
|
|
@@ -644,9 +701,7 @@ const Cell = {
|
|
|
644
701
|
}
|
|
645
702
|
const { seq } = params;
|
|
646
703
|
const seqMd = seqOpts.seqMethod;
|
|
647
|
-
return renderCellBaseVNs(params, [
|
|
648
|
-
h("span", `${formatText(seqMd ? seqMd(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)}`)
|
|
649
|
-
]);
|
|
704
|
+
return renderCellBaseVNs(params, [h("span", `${formatText(seqMd ? seqMd(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)}`)]);
|
|
650
705
|
},
|
|
651
706
|
renderDeepIndexCell(params) {
|
|
652
707
|
return Cell.renderDeepNodeBtn(params, Cell.renderSeqCell(params));
|
|
@@ -662,19 +717,30 @@ const Cell = {
|
|
|
662
717
|
const headerSlot = slots ? slots.header : null;
|
|
663
718
|
return renderHeaderCellBaseVNs(
|
|
664
719
|
params,
|
|
665
|
-
renderTitleContent(
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
720
|
+
renderTitleContent(
|
|
721
|
+
params,
|
|
722
|
+
headerSlot ? $table.callSlot(headerSlot, params) : [
|
|
723
|
+
h(
|
|
724
|
+
"span",
|
|
725
|
+
{
|
|
726
|
+
class: "vxe-radio--label"
|
|
727
|
+
},
|
|
728
|
+
titleSlot ? $table.callSlot(titleSlot, params) : $table.getHeaderCellLabel(column)
|
|
729
|
+
)
|
|
730
|
+
]
|
|
731
|
+
)
|
|
670
732
|
);
|
|
671
733
|
}
|
|
672
734
|
return renderHeaderCellBaseVNs(
|
|
673
735
|
params,
|
|
674
736
|
renderTitleContent(params, [
|
|
675
|
-
h(
|
|
676
|
-
|
|
677
|
-
|
|
737
|
+
h(
|
|
738
|
+
"span",
|
|
739
|
+
{
|
|
740
|
+
class: "vxe-radio--label"
|
|
741
|
+
},
|
|
742
|
+
titleSlot ? $table.callSlot(titleSlot, params) : $table.getHeaderCellLabel(column)
|
|
743
|
+
)
|
|
678
744
|
])
|
|
679
745
|
);
|
|
680
746
|
},
|
|
@@ -719,19 +785,30 @@ const Cell = {
|
|
|
719
785
|
}
|
|
720
786
|
if (defaultSlot || labelField) {
|
|
721
787
|
radioVNs.push(
|
|
722
|
-
h(
|
|
723
|
-
|
|
724
|
-
|
|
788
|
+
h(
|
|
789
|
+
"span",
|
|
790
|
+
{
|
|
791
|
+
class: "vxe-radio--label"
|
|
792
|
+
},
|
|
793
|
+
defaultSlot ? $table.callSlot(defaultSlot, radioParams) : XEUtils.get(row, labelField)
|
|
794
|
+
)
|
|
725
795
|
);
|
|
726
796
|
}
|
|
727
797
|
return renderCellBaseVNs(params, [
|
|
728
|
-
h(
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
798
|
+
h(
|
|
799
|
+
"span",
|
|
800
|
+
{
|
|
801
|
+
class: [
|
|
802
|
+
"vxe-cell--radio",
|
|
803
|
+
{
|
|
804
|
+
"is--checked": isChecked,
|
|
805
|
+
"is--disabled": isDisabled
|
|
806
|
+
}
|
|
807
|
+
],
|
|
808
|
+
...ons
|
|
809
|
+
},
|
|
810
|
+
radioVNs
|
|
811
|
+
)
|
|
735
812
|
]);
|
|
736
813
|
},
|
|
737
814
|
renderDeepRadioCell(params) {
|
|
@@ -767,32 +844,52 @@ const Cell = {
|
|
|
767
844
|
}
|
|
768
845
|
}
|
|
769
846
|
if (checkStrictly ? !showHeader : showHeader === false) {
|
|
770
|
-
return renderHeaderCellBaseVNs(
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
847
|
+
return renderHeaderCellBaseVNs(
|
|
848
|
+
params,
|
|
849
|
+
renderTitleContent(checkboxParams, [
|
|
850
|
+
h(
|
|
851
|
+
"span",
|
|
852
|
+
{
|
|
853
|
+
class: "vxe-checkbox--label"
|
|
854
|
+
},
|
|
855
|
+
titleSlot ? $table.callSlot(titleSlot, checkboxParams) : colTitle
|
|
856
|
+
)
|
|
857
|
+
])
|
|
858
|
+
);
|
|
775
859
|
}
|
|
776
860
|
return renderHeaderCellBaseVNs(
|
|
777
861
|
params,
|
|
778
862
|
renderTitleContent(checkboxParams, [
|
|
779
|
-
h(
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
863
|
+
h(
|
|
864
|
+
"span",
|
|
865
|
+
{
|
|
866
|
+
class: [
|
|
867
|
+
"vxe-cell--checkbox",
|
|
868
|
+
{
|
|
869
|
+
"is--checked": isAllCheckboxSelected,
|
|
870
|
+
"is--disabled": isAllCheckboxDisabled,
|
|
871
|
+
"is--indeterminate": isAllCheckboxIndeterminate
|
|
872
|
+
}
|
|
873
|
+
],
|
|
874
|
+
title: XEUtils.eqNull(headerTitle) ? getI18n("vxe.table.allTitle") : `${headerTitle || ""}`,
|
|
875
|
+
...ons
|
|
876
|
+
},
|
|
877
|
+
[
|
|
878
|
+
h("span", {
|
|
879
|
+
class: ["vxe-checkbox--icon", isAllCheckboxIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllCheckboxSelected ? getIcon().TABLE_CHECKBOX_CHECKED : isAllCheckboxDisabled ? getIcon().TABLE_CHECKBOX_DISABLED_UNCHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
880
|
+
})
|
|
881
|
+
].concat(
|
|
882
|
+
titleSlot || colTitle ? [
|
|
883
|
+
h(
|
|
884
|
+
"span",
|
|
885
|
+
{
|
|
886
|
+
class: "vxe-checkbox--label"
|
|
887
|
+
},
|
|
888
|
+
titleSlot ? $table.callSlot(titleSlot, checkboxParams) : colTitle
|
|
889
|
+
)
|
|
890
|
+
] : []
|
|
891
|
+
)
|
|
892
|
+
)
|
|
796
893
|
])
|
|
797
894
|
);
|
|
798
895
|
},
|
|
@@ -852,21 +949,32 @@ const Cell = {
|
|
|
852
949
|
}
|
|
853
950
|
if (defaultSlot || labelField) {
|
|
854
951
|
checkVNs.push(
|
|
855
|
-
h(
|
|
856
|
-
|
|
857
|
-
|
|
952
|
+
h(
|
|
953
|
+
"span",
|
|
954
|
+
{
|
|
955
|
+
class: "vxe-checkbox--label"
|
|
956
|
+
},
|
|
957
|
+
defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : XEUtils.get(row, labelField)
|
|
958
|
+
)
|
|
858
959
|
);
|
|
859
960
|
}
|
|
860
961
|
return renderCellBaseVNs(params, [
|
|
861
|
-
h(
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
962
|
+
h(
|
|
963
|
+
"span",
|
|
964
|
+
{
|
|
965
|
+
class: [
|
|
966
|
+
"vxe-cell--checkbox",
|
|
967
|
+
{
|
|
968
|
+
"is--checked": isChecked,
|
|
969
|
+
"is--disabled": isDisabled,
|
|
970
|
+
"is--indeterminate": indeterminate,
|
|
971
|
+
"is--hidden": !isVisible
|
|
972
|
+
}
|
|
973
|
+
],
|
|
974
|
+
...ons
|
|
975
|
+
},
|
|
976
|
+
checkVNs
|
|
977
|
+
)
|
|
870
978
|
]);
|
|
871
979
|
},
|
|
872
980
|
renderDeepSelectionCell(params) {
|
|
@@ -928,22 +1036,33 @@ const Cell = {
|
|
|
928
1036
|
);
|
|
929
1037
|
if (defaultSlot || labelField) {
|
|
930
1038
|
checkVNs.push(
|
|
931
|
-
h(
|
|
932
|
-
|
|
933
|
-
|
|
1039
|
+
h(
|
|
1040
|
+
"span",
|
|
1041
|
+
{
|
|
1042
|
+
class: "vxe-checkbox--label"
|
|
1043
|
+
},
|
|
1044
|
+
defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : XEUtils.get(row, labelField)
|
|
1045
|
+
)
|
|
934
1046
|
);
|
|
935
1047
|
}
|
|
936
1048
|
}
|
|
937
1049
|
return renderCellBaseVNs(params, [
|
|
938
|
-
h(
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
1050
|
+
h(
|
|
1051
|
+
"span",
|
|
1052
|
+
{
|
|
1053
|
+
class: [
|
|
1054
|
+
"vxe-cell--checkbox",
|
|
1055
|
+
{
|
|
1056
|
+
"is--checked": isChecked,
|
|
1057
|
+
"is--disabled": isDisabled,
|
|
1058
|
+
"is--indeterminate": indeterminateField && !isChecked ? row[indeterminateField] : indeterminate,
|
|
1059
|
+
"is--hidden": !isVisible
|
|
1060
|
+
}
|
|
1061
|
+
],
|
|
1062
|
+
...ons
|
|
1063
|
+
},
|
|
1064
|
+
checkVNs
|
|
1065
|
+
)
|
|
947
1066
|
]);
|
|
948
1067
|
},
|
|
949
1068
|
renderDeepSelectionCellByProp(params) {
|
|
@@ -980,28 +1099,43 @@ const Cell = {
|
|
|
980
1099
|
}
|
|
981
1100
|
}
|
|
982
1101
|
return renderCellBaseVNs(params, [
|
|
983
|
-
showIcon && (!visibleMethod || visibleMethod(params)) ? h(
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1102
|
+
showIcon && (!visibleMethod || visibleMethod(params)) ? h(
|
|
1103
|
+
"div",
|
|
1104
|
+
{
|
|
1105
|
+
class: [
|
|
1106
|
+
"vxe-table--expanded",
|
|
1107
|
+
{
|
|
1108
|
+
"is--active": isActive
|
|
1109
|
+
}
|
|
1110
|
+
]
|
|
1111
|
+
},
|
|
1112
|
+
[
|
|
1113
|
+
h(
|
|
1114
|
+
"span",
|
|
1115
|
+
{
|
|
1116
|
+
class: "vxe-table--expand-btn",
|
|
1117
|
+
onMousedown(evnt) {
|
|
1118
|
+
evnt.stopPropagation();
|
|
1119
|
+
},
|
|
1120
|
+
onClick(evnt) {
|
|
1121
|
+
$table.triggerRowExpandEvent(evnt, params);
|
|
1122
|
+
}
|
|
1123
|
+
},
|
|
1124
|
+
[
|
|
1125
|
+
h("i", {
|
|
1126
|
+
class: isLazyLoading ? iconLoaded || getIcon().TABLE_EXPAND_LOADED : isActive ? iconOpen || getIcon().TABLE_EXPAND_OPEN : iconClose || getIcon().TABLE_EXPAND_CLOSE
|
|
1127
|
+
})
|
|
1128
|
+
]
|
|
1129
|
+
)
|
|
1130
|
+
]
|
|
1131
|
+
) : renderEmptyElement($table),
|
|
1132
|
+
defaultSlot || labelField ? h(
|
|
1133
|
+
"div",
|
|
1134
|
+
{
|
|
1135
|
+
class: "vxe-table--expand-label"
|
|
1136
|
+
},
|
|
1137
|
+
defaultSlot ? $table.callSlot(defaultSlot, params) : XEUtils.get(row, labelField)
|
|
1138
|
+
) : renderEmptyElement($table)
|
|
1005
1139
|
]);
|
|
1006
1140
|
},
|
|
1007
1141
|
renderExpandData(params) {
|
|
@@ -1048,19 +1182,13 @@ const Cell = {
|
|
|
1048
1182
|
* 排序和筛选
|
|
1049
1183
|
*/
|
|
1050
1184
|
renderSortAndFilterHeader(params) {
|
|
1051
|
-
return renderHeaderCellBaseVNs(
|
|
1052
|
-
params,
|
|
1053
|
-
Cell.renderHeaderTitle(params).concat(Cell.renderSortIcon(params).concat(Cell.renderFilterIcon(params)))
|
|
1054
|
-
);
|
|
1185
|
+
return renderHeaderCellBaseVNs(params, Cell.renderHeaderTitle(params).concat(Cell.renderSortIcon(params).concat(Cell.renderFilterIcon(params))));
|
|
1055
1186
|
},
|
|
1056
1187
|
/**
|
|
1057
1188
|
* 排序
|
|
1058
1189
|
*/
|
|
1059
1190
|
renderSortHeader(params) {
|
|
1060
|
-
return renderHeaderCellBaseVNs(
|
|
1061
|
-
params,
|
|
1062
|
-
Cell.renderHeaderTitle(params).concat(Cell.renderSortIcon(params))
|
|
1063
|
-
);
|
|
1191
|
+
return renderHeaderCellBaseVNs(params, Cell.renderHeaderTitle(params).concat(Cell.renderSortIcon(params)));
|
|
1064
1192
|
},
|
|
1065
1193
|
renderSortIcon(params) {
|
|
1066
1194
|
const { $table, column } = params;
|
|
@@ -1071,30 +1199,42 @@ const Cell = {
|
|
|
1071
1199
|
if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
|
|
1072
1200
|
const sortSlot = slots ? slots.sort : null;
|
|
1073
1201
|
return sortSlot ? getSlotVNs($table.callSlot(sortSlot, params)) : [
|
|
1074
|
-
h(
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1202
|
+
h(
|
|
1203
|
+
"span",
|
|
1204
|
+
{
|
|
1205
|
+
class: ["vxe-cell--sort", `vxe-cell--sort-${iconLayout}-layout`]
|
|
1206
|
+
},
|
|
1207
|
+
[
|
|
1208
|
+
h("i", {
|
|
1209
|
+
class: [
|
|
1210
|
+
"vxe-sort--asc-btn",
|
|
1211
|
+
iconAsc || getIcon().TABLE_SORT_ASC,
|
|
1212
|
+
{
|
|
1213
|
+
"sort--active": order === "asc"
|
|
1214
|
+
}
|
|
1215
|
+
],
|
|
1216
|
+
title: XEUtils.eqNull(ascTitle) ? getI18n("vxe.table.sortAsc") : `${ascTitle || ""}`,
|
|
1217
|
+
onClick: allowBtn ? (evnt) => {
|
|
1218
|
+
evnt.stopPropagation();
|
|
1219
|
+
$table.triggerSortEvent(evnt, column, "asc");
|
|
1220
|
+
} : void 0
|
|
1221
|
+
}),
|
|
1222
|
+
h("i", {
|
|
1223
|
+
class: [
|
|
1224
|
+
"vxe-sort--desc-btn",
|
|
1225
|
+
iconDesc || getIcon().TABLE_SORT_DESC,
|
|
1226
|
+
{
|
|
1227
|
+
"sort--active": order === "desc"
|
|
1228
|
+
}
|
|
1229
|
+
],
|
|
1230
|
+
title: XEUtils.eqNull(descTitle) ? getI18n("vxe.table.sortDesc") : `${descTitle || ""}`,
|
|
1231
|
+
onClick: allowBtn ? (evnt) => {
|
|
1232
|
+
evnt.stopPropagation();
|
|
1233
|
+
$table.triggerSortEvent(evnt, column, "desc");
|
|
1234
|
+
} : void 0
|
|
1235
|
+
})
|
|
1236
|
+
]
|
|
1237
|
+
)
|
|
1098
1238
|
];
|
|
1099
1239
|
}
|
|
1100
1240
|
return [];
|
|
@@ -1114,21 +1254,28 @@ const Cell = {
|
|
|
1114
1254
|
const { showIcon, iconNone, iconMatch, iconVisibleMethod } = filterOpts;
|
|
1115
1255
|
if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
|
|
1116
1256
|
return [
|
|
1117
|
-
h(
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1257
|
+
h(
|
|
1258
|
+
"span",
|
|
1259
|
+
{
|
|
1260
|
+
class: [
|
|
1261
|
+
"vxe-cell--filter",
|
|
1262
|
+
{
|
|
1263
|
+
"is--active": filterStore.visible && filterStore.column === column
|
|
1264
|
+
}
|
|
1265
|
+
],
|
|
1266
|
+
onClick(evnt) {
|
|
1267
|
+
if ($table.triggerFilterEvent) {
|
|
1268
|
+
$table.triggerFilterEvent(evnt, params.column, params);
|
|
1269
|
+
}
|
|
1124
1270
|
}
|
|
1125
|
-
}
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1271
|
+
},
|
|
1272
|
+
[
|
|
1273
|
+
h("i", {
|
|
1274
|
+
class: ["vxe-filter--btn", hasFilter ? iconMatch || getIcon().TABLE_FILTER_MATCH : iconNone || getIcon().TABLE_FILTER_NONE],
|
|
1275
|
+
title: getI18n("vxe.table.filter")
|
|
1276
|
+
})
|
|
1277
|
+
]
|
|
1278
|
+
)
|
|
1132
1279
|
];
|
|
1133
1280
|
}
|
|
1134
1281
|
return [];
|
|
@@ -1156,18 +1303,24 @@ const Cell = {
|
|
|
1156
1303
|
if (isEnableEdit) {
|
|
1157
1304
|
const { showAsterisk, showIcon, icon } = editOpts;
|
|
1158
1305
|
editIconVNs = [
|
|
1159
|
-
isRequired && showAsterisk ? h(
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1306
|
+
isRequired && showAsterisk ? h(
|
|
1307
|
+
"span",
|
|
1308
|
+
{
|
|
1309
|
+
class: "vxe-cell--required-icon"
|
|
1310
|
+
},
|
|
1311
|
+
[h("i")]
|
|
1312
|
+
) : renderEmptyElement($table),
|
|
1313
|
+
editRenderOpts && showIcon ? h(
|
|
1314
|
+
"span",
|
|
1315
|
+
{
|
|
1316
|
+
class: "vxe-cell--edit-icon"
|
|
1317
|
+
},
|
|
1318
|
+
XEUtils.isFunction(icon) ? getSlotVNs(icon({})) : [
|
|
1319
|
+
h("i", {
|
|
1320
|
+
class: icon || getIcon().TABLE_EDIT
|
|
1321
|
+
})
|
|
1322
|
+
]
|
|
1323
|
+
) : renderEmptyElement($table)
|
|
1171
1324
|
];
|
|
1172
1325
|
}
|
|
1173
1326
|
return renderHeaderCellBaseVNs(
|
|
@@ -1253,9 +1406,13 @@ const Cell = {
|
|
|
1253
1406
|
}
|
|
1254
1407
|
if (formatter) {
|
|
1255
1408
|
return renderCellBaseVNs(params, [
|
|
1256
|
-
h(
|
|
1257
|
-
|
|
1258
|
-
|
|
1409
|
+
h(
|
|
1410
|
+
"span",
|
|
1411
|
+
{
|
|
1412
|
+
class: "vxe-cell--label"
|
|
1413
|
+
},
|
|
1414
|
+
getDefaultCellLabel(cellParams)
|
|
1415
|
+
)
|
|
1259
1416
|
]);
|
|
1260
1417
|
}
|
|
1261
1418
|
return Cell.renderDefaultCell(cellParams);
|