vxe-table 4.23.7 → 4.23.9

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.
Files changed (148) hide show
  1. package/dist/all.esm.js +5859 -4018
  2. package/es/colgroup/index.js +1 -1
  3. package/es/column/index.js +1 -1
  4. package/es/components.d.ts +3 -0
  5. package/es/components.js +4 -8
  6. package/es/grid/index.js +1 -1
  7. package/es/grid/src/emits.js +1 -15
  8. package/es/grid/src/grid.js +398 -121
  9. package/es/grid/src/props.js +1 -1
  10. package/es/index.esm.js +6 -0
  11. package/es/index.js +6 -0
  12. package/es/table/index.js +1 -1
  13. package/es/table/module/custom/hook.js +50 -43
  14. package/es/table/module/custom/panel.js +778 -528
  15. package/es/table/module/edit/hook.js +141 -63
  16. package/es/table/module/export/export-panel.js +400 -317
  17. package/es/table/module/export/hook.js +396 -338
  18. package/es/table/module/export/import-panel.js +153 -124
  19. package/es/table/module/filter/hook.js +17 -3
  20. package/es/table/module/filter/panel.js +147 -85
  21. package/es/table/module/keyboard/hook.js +9 -5
  22. package/es/table/module/menu/hook.js +1 -1
  23. package/es/table/module/menu/panel.js +198 -127
  24. package/es/table/module/validator/hook.js +1 -1
  25. package/es/table/render/index.js +152 -99
  26. package/es/table/src/body.js +356 -234
  27. package/es/table/src/cell.js +427 -270
  28. package/es/table/src/columnInfo.js +2 -1
  29. package/es/table/src/footer.js +145 -100
  30. package/es/table/src/group.js +7 -3
  31. package/es/table/src/header.js +230 -173
  32. package/es/table/src/props.js +1 -1
  33. package/es/table/src/table.js +1504 -1031
  34. package/es/table/src/util.js +15 -19
  35. package/es/toolbar/index.js +1 -1
  36. package/es/toolbar/src/toolbar.js +133 -76
  37. package/es/ui/index.d.ts +0 -1
  38. package/es/ui/index.js +1 -2
  39. package/es/ui/src/dom.js +9 -6
  40. package/es/ui/src/log.js +1 -1
  41. package/es/ui/src/utils.d.ts +1 -1
  42. package/es/v-x-e-table/index.d.ts +0 -1
  43. package/es/v-x-e-table/index.js +0 -1
  44. package/lib/colgroup/index.js +5 -5
  45. package/lib/column/index.js +5 -5
  46. package/lib/components.js +8 -12
  47. package/lib/grid/index.js +4 -4
  48. package/lib/grid/src/emits.js +1 -15
  49. package/lib/grid/src/grid.js +419 -142
  50. package/lib/grid/src/props.js +2 -2
  51. package/lib/index.common.js +6 -0
  52. package/lib/index.js +6 -0
  53. package/lib/index.umd.js +5825 -3945
  54. package/lib/index.umd.min.js +3 -3
  55. package/lib/table/index.js +5 -5
  56. package/lib/table/module/custom/hook.js +51 -44
  57. package/lib/table/module/custom/panel.js +790 -540
  58. package/lib/table/module/edit/hook.js +142 -64
  59. package/lib/table/module/export/export-panel.js +406 -323
  60. package/lib/table/module/export/hook.js +419 -361
  61. package/lib/table/module/export/import-panel.js +157 -128
  62. package/lib/table/module/filter/hook.js +18 -4
  63. package/lib/table/module/filter/panel.js +149 -87
  64. package/lib/table/module/keyboard/hook.js +10 -6
  65. package/lib/table/module/menu/hook.js +2 -2
  66. package/lib/table/module/menu/panel.js +199 -128
  67. package/lib/table/module/validator/hook.js +2 -2
  68. package/lib/table/render/index.js +153 -100
  69. package/lib/table/src/body.js +357 -235
  70. package/lib/table/src/cell.js +428 -271
  71. package/lib/table/src/columnInfo.js +3 -2
  72. package/lib/table/src/footer.js +146 -101
  73. package/lib/table/src/group.js +7 -3
  74. package/lib/table/src/header.js +231 -174
  75. package/lib/table/src/props.js +2 -2
  76. package/lib/table/src/table.js +1487 -1045
  77. package/lib/table/src/util.js +15 -19
  78. package/lib/toolbar/index.js +4 -4
  79. package/lib/toolbar/src/toolbar.js +135 -78
  80. package/lib/ui/index.js +1 -3
  81. package/lib/ui/src/dom.js +9 -6
  82. package/lib/ui/src/log.js +1 -1
  83. package/lib/v-x-e-table/index.js +0 -2
  84. package/package.json +8 -3
  85. package/packages/colgroup/index.ts +22 -22
  86. package/packages/column/index.ts +22 -22
  87. package/packages/components.ts +41 -43
  88. package/packages/grid/index.ts +18 -18
  89. package/packages/grid/src/emits.ts +5 -19
  90. package/packages/grid/src/grid.ts +2229 -1925
  91. package/packages/grid/src/props.ts +22 -23
  92. package/packages/index.ts +11 -4
  93. package/packages/locale/lang/fr-FR.ts +15 -15
  94. package/packages/locale/lang/it-IT.ts +4 -4
  95. package/packages/locale/lang/uk-UA.ts +1 -1
  96. package/packages/locale/lang/uz-UZ.ts +13 -13
  97. package/packages/locale/lang/zh-CN.ts +907 -907
  98. package/packages/table/index.ts +26 -26
  99. package/packages/table/module/custom/hook.ts +510 -503
  100. package/packages/table/module/custom/panel.ts +2002 -1743
  101. package/packages/table/module/edit/hook.ts +1224 -1131
  102. package/packages/table/module/export/export-panel.ts +697 -611
  103. package/packages/table/module/export/hook.ts +2160 -2059
  104. package/packages/table/module/export/import-panel.ts +319 -279
  105. package/packages/table/module/export/util.ts +25 -24
  106. package/packages/table/module/filter/hook.ts +519 -501
  107. package/packages/table/module/filter/panel.ts +368 -304
  108. package/packages/table/module/keyboard/hook.ts +498 -494
  109. package/packages/table/module/menu/hook.ts +330 -330
  110. package/packages/table/module/menu/panel.ts +272 -201
  111. package/packages/table/module/validator/hook.ts +653 -635
  112. package/packages/table/render/index.ts +1819 -1744
  113. package/packages/table/src/body.ts +1078 -955
  114. package/packages/table/src/cell.ts +1524 -1359
  115. package/packages/table/src/column.ts +192 -192
  116. package/packages/table/src/columnInfo.ts +232 -232
  117. package/packages/table/src/emits.ts +134 -134
  118. package/packages/table/src/footer.ts +425 -380
  119. package/packages/table/src/group.ts +67 -63
  120. package/packages/table/src/header.ts +642 -581
  121. package/packages/table/src/props.ts +336 -336
  122. package/packages/table/src/store.ts +14 -14
  123. package/packages/table/src/table.ts +16011 -15454
  124. package/packages/table/src/use/cell-view.ts +41 -44
  125. package/packages/table/src/use/index.ts +1 -1
  126. package/packages/table/src/util.ts +1206 -1216
  127. package/packages/toolbar/index.ts +18 -18
  128. package/packages/toolbar/src/toolbar.ts +768 -706
  129. package/packages/ui/index.ts +519 -521
  130. package/packages/ui/src/anime.ts +51 -52
  131. package/packages/ui/src/comp.ts +3 -3
  132. package/packages/ui/src/dom.ts +466 -463
  133. package/packages/ui/src/log.ts +19 -19
  134. package/packages/ui/src/utils.ts +66 -66
  135. package/packages/ui/src/vn.ts +55 -55
  136. package/packages/v-x-e-table/index.d.ts +3 -4
  137. package/packages/v-x-e-table/index.ts +3 -4
  138. package/types/all.d.ts +76 -76
  139. package/types/index.d.ts +4 -4
  140. /package/dist/{iconfont.1792979665397.ttf → iconfont.1793009263429.ttf} +0 -0
  141. /package/dist/{iconfont.1792979665397.woff → iconfont.1793009263429.woff} +0 -0
  142. /package/dist/{iconfont.1792979665397.woff2 → iconfont.1793009263429.woff2} +0 -0
  143. /package/es/{iconfont.1792979665397.ttf → iconfont.1793009263429.ttf} +0 -0
  144. /package/es/{iconfont.1792979665397.woff → iconfont.1793009263429.woff} +0 -0
  145. /package/es/{iconfont.1792979665397.woff2 → iconfont.1793009263429.woff2} +0 -0
  146. /package/lib/{iconfont.1792979665397.ttf → iconfont.1793009263429.ttf} +0 -0
  147. /package/lib/{iconfont.1792979665397.woff → iconfont.1793009263429.woff} +0 -0
  148. /package/lib/{iconfont.1792979665397.woff2 → iconfont.1793009263429.woff2} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { h } from "vue";
2
2
  import XEUtils from "xe-utils";
3
- import { VxeUI } from "../../ui";
3
+ import { VxeUI } from "@vxe-ui/core";
4
4
  import { getFuncText, isEnableConf, formatText, eqEmptyValue } from "../../ui/src/utils";
5
5
  import { updateCellTitle } from "../../ui/src/dom";
6
6
  import { createColumn, getRowid } from "./util";
@@ -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("span", {
14
- class: ["vxe-cell-title-prefix-icon", titlePrefix.iconStatus ? `theme--${titlePrefix.iconStatus}` : ""],
15
- onMouseenter(evnt) {
16
- $table.triggerHeaderTitleEvent(evnt, titlePrefix, params);
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
- onMouseleave(evnt) {
19
- $table.handleTargetLeaveEvent(evnt);
20
- }
21
- }, [
22
- h("i", {
23
- class: titlePrefix.icon || getIcon().TABLE_TITLE_PREFIX
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("span", {
34
- class: ["vxe-cell-title-suffix-icon", titleSuffix.iconStatus ? `theme--${titleSuffix.iconStatus}` : ""],
35
- onMouseenter(evnt) {
36
- $table.triggerHeaderTitleEvent(evnt, titleSuffix, params);
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
- onMouseleave(evnt) {
39
- $table.handleTargetLeaveEvent(evnt);
40
- }
41
- }, [
42
- h("i", {
43
- class: titleSuffix.icon || getIcon().TABLE_TITLE_SUFFIX
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("span", {
72
- key: "dg",
73
- class: ["vxe-cell--drag-handle", {
74
- "is--disabled": isDisabled
75
- }],
76
- ...ons
77
- }, rowDragIconSlot ? $table.callSlot(rowDragIconSlot, params) : [
78
- h("i", {
79
- class: icon || (dragConfig ? dragConfig.rowIcon : "") || getIcon().TABLE_DRAG_ROW
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 && ((showIcon || (dragConfig ? dragConfig.showRowIcon : false)) && (!rVisibleMethod || rVisibleMethod(params)))) {
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("span", {
133
- key: "dg",
134
- class: ["vxe-cell--drag-handle", {
135
- "is--disabled": isDisabled
136
- }],
137
- ...ons
138
- }, columnDragIconSlot ? $table.callSlot(columnDragIconSlot, params) : [
139
- h("i", {
140
- class: icon || getIcon().TABLE_DRAG_COLUMN
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("span", {
164
- key: "ct"
165
- }, getSlotVNs(content));
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("span", {
207
- class: "vxe-cell--title",
208
- ...ons
209
- }, isRowGroupStatus && column.aggFunc && $table.getPivotTableAggregateRenderColTitles ? $table.getPivotTableAggregateRenderColTitles(column, titleVN) : titleSlot ? $table.callSlot(titleSlot, params) : [
210
- titleVN
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("span", {
245
- class: "vxe-cell--label"
246
- }, formatText(itemValue, 1))
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 || (editCompConf.renderTableDefault || editCompConf.renderDefault) : null;
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("span", {
483
- class: "vxe-cell--placeholder"
484
- }, formatText(getFuncText(cellPlaceholder), 1)) : h("span", formatText(cellValue, 1))
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("div", {
511
- class: ["vxe-row-group--tree-node", {
512
- "is--expanded": isExpand
513
- }],
514
- style: mode !== "column" && padding && indent ? {
515
- paddingLeft: `${level * indent}px`
516
- } : void 0
517
- }, [
518
- showIcon && row.isAggregate ? h("span", {
519
- class: "vxe-row-group--node-btn",
520
- onClick(evnt) {
521
- $table.triggerRowGroupExpandEvent(evnt, params);
522
- }
523
- }, [
524
- h("i", {
525
- class: isExpand ? iconOpen || getIcon().TABLE_ROW_GROUP_OPEN : iconClose || getIcon().TABLE_ROW_GROUP_CLOSE
526
- })
527
- ]) : renderEmptyElement($table),
528
- h("div", {
529
- class: "vxe-row-group-cell"
530
- }, cellVNodes)
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("div", {
576
- class: ["vxe-cell--tree-node", {
577
- "is--active": isActive
578
- }],
579
- style: padding && indent ? {
580
- paddingLeft: `${level * indent}px`
581
- } : void 0
582
- }, [
583
- showIcon && (lazy ? isLazyLoaded ? hasChild : hasChild || hasLazyChilds : hasChild) && (!visibleMethod || visibleMethod(params)) ? [
584
- h("div", {
585
- class: "vxe-cell--tree-btn",
586
- ...ons
587
- }, [
588
- h("i", {
589
- class: isLazyLoading ? iconLoaded || getIcon().TABLE_TREE_LOADED : isActive ? iconOpen || getIcon().TABLE_TREE_OPEN : iconClose || getIcon().TABLE_TREE_CLOSE
590
- })
591
- ])
592
- ] : null,
593
- h("div", {
594
- class: "vxe-tree-cell"
595
- }, cellVNodes)
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(params, headerSlot ? $table.callSlot(headerSlot, params) : [
666
- h("span", {
667
- class: "vxe-radio--label"
668
- }, titleSlot ? $table.callSlot(titleSlot, params) : $table.getHeaderCellLabel(column))
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("span", {
676
- class: "vxe-radio--label"
677
- }, titleSlot ? $table.callSlot(titleSlot, params) : $table.getHeaderCellLabel(column))
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("span", {
723
- class: "vxe-radio--label"
724
- }, defaultSlot ? $table.callSlot(defaultSlot, radioParams) : XEUtils.get(row, labelField))
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("span", {
729
- class: ["vxe-cell--radio", {
730
- "is--checked": isChecked,
731
- "is--disabled": isDisabled
732
- }],
733
- ...ons
734
- }, radioVNs)
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(params, renderTitleContent(checkboxParams, [
771
- h("span", {
772
- class: "vxe-checkbox--label"
773
- }, titleSlot ? $table.callSlot(titleSlot, checkboxParams) : colTitle)
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("span", {
780
- class: ["vxe-cell--checkbox", {
781
- "is--checked": isAllCheckboxSelected,
782
- "is--disabled": isAllCheckboxDisabled,
783
- "is--indeterminate": isAllCheckboxIndeterminate
784
- }],
785
- title: XEUtils.eqNull(headerTitle) ? getI18n("vxe.table.allTitle") : `${headerTitle || ""}`,
786
- ...ons
787
- }, [
788
- h("span", {
789
- class: ["vxe-checkbox--icon", isAllCheckboxIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllCheckboxSelected ? getIcon().TABLE_CHECKBOX_CHECKED : isAllCheckboxDisabled ? getIcon().TABLE_CHECKBOX_DISABLED_UNCHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
790
- })
791
- ].concat(titleSlot || colTitle ? [
792
- h("span", {
793
- class: "vxe-checkbox--label"
794
- }, titleSlot ? $table.callSlot(titleSlot, checkboxParams) : colTitle)
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("span", {
856
- class: "vxe-checkbox--label"
857
- }, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : XEUtils.get(row, labelField))
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("span", {
862
- class: ["vxe-cell--checkbox", {
863
- "is--checked": isChecked,
864
- "is--disabled": isDisabled,
865
- "is--indeterminate": indeterminate,
866
- "is--hidden": !isVisible
867
- }],
868
- ...ons
869
- }, checkVNs)
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("span", {
932
- class: "vxe-checkbox--label"
933
- }, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : XEUtils.get(row, labelField))
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("span", {
939
- class: ["vxe-cell--checkbox", {
940
- "is--checked": isChecked,
941
- "is--disabled": isDisabled,
942
- "is--indeterminate": indeterminateField && !isChecked ? row[indeterminateField] : indeterminate,
943
- "is--hidden": !isVisible
944
- }],
945
- ...ons
946
- }, checkVNs)
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("div", {
984
- class: ["vxe-table--expanded", {
985
- "is--active": isActive
986
- }]
987
- }, [
988
- h("span", {
989
- class: "vxe-table--expand-btn",
990
- onMousedown(evnt) {
991
- evnt.stopPropagation();
992
- },
993
- onClick(evnt) {
994
- $table.triggerRowExpandEvent(evnt, params);
995
- }
996
- }, [
997
- h("i", {
998
- class: isLazyLoading ? iconLoaded || getIcon().TABLE_EXPAND_LOADED : isActive ? iconOpen || getIcon().TABLE_EXPAND_OPEN : iconClose || getIcon().TABLE_EXPAND_CLOSE
999
- })
1000
- ])
1001
- ]) : renderEmptyElement($table),
1002
- defaultSlot || labelField ? h("div", {
1003
- class: "vxe-table--expand-label"
1004
- }, defaultSlot ? $table.callSlot(defaultSlot, params) : XEUtils.get(row, labelField)) : renderEmptyElement($table)
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("span", {
1075
- class: ["vxe-cell--sort", `vxe-cell--sort-${iconLayout}-layout`]
1076
- }, [
1077
- h("i", {
1078
- class: ["vxe-sort--asc-btn", iconAsc || getIcon().TABLE_SORT_ASC, {
1079
- "sort--active": order === "asc"
1080
- }],
1081
- title: XEUtils.eqNull(ascTitle) ? getI18n("vxe.table.sortAsc") : `${ascTitle || ""}`,
1082
- onClick: allowBtn ? (evnt) => {
1083
- evnt.stopPropagation();
1084
- $table.triggerSortEvent(evnt, column, "asc");
1085
- } : void 0
1086
- }),
1087
- h("i", {
1088
- class: ["vxe-sort--desc-btn", iconDesc || getIcon().TABLE_SORT_DESC, {
1089
- "sort--active": order === "desc"
1090
- }],
1091
- title: XEUtils.eqNull(descTitle) ? getI18n("vxe.table.sortDesc") : `${descTitle || ""}`,
1092
- onClick: allowBtn ? (evnt) => {
1093
- evnt.stopPropagation();
1094
- $table.triggerSortEvent(evnt, column, "desc");
1095
- } : void 0
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("span", {
1118
- class: ["vxe-cell--filter", {
1119
- "is--active": filterStore.visible && filterStore.column === column
1120
- }],
1121
- onClick(evnt) {
1122
- if ($table.triggerFilterEvent) {
1123
- $table.triggerFilterEvent(evnt, params.column, params);
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
- h("i", {
1128
- class: ["vxe-filter--btn", hasFilter ? iconMatch || getIcon().TABLE_FILTER_MATCH : iconNone || getIcon().TABLE_FILTER_NONE],
1129
- title: getI18n("vxe.table.filter")
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("span", {
1160
- class: "vxe-cell--required-icon"
1161
- }, [
1162
- h("i")
1163
- ]) : renderEmptyElement($table),
1164
- editRenderOpts && showIcon ? h("span", {
1165
- class: "vxe-cell--edit-icon"
1166
- }, XEUtils.isFunction(icon) ? getSlotVNs(icon({})) : [
1167
- h("i", {
1168
- class: icon || getIcon().TABLE_EDIT
1169
- })
1170
- ]) : renderEmptyElement($table)
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("span", {
1257
- class: "vxe-cell--label"
1258
- }, getDefaultCellLabel(cellParams))
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);