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
@@ -34,29 +34,33 @@ __export(cell_exports, {
34
34
  module.exports = __toCommonJS(cell_exports);
35
35
  var import_vue = require("vue");
36
36
  var import_xe_utils = __toESM(require("xe-utils"));
37
- var import_ui = require("../../ui");
37
+ var import_core = require("@vxe-ui/core");
38
38
  var import_utils = require("../../ui/src/utils");
39
39
  var import_dom = require("../../ui/src/dom");
40
40
  var import_util = require("./util");
41
41
  var import_vn = require("../../ui/src/vn");
42
- const { getConfig, getI18n, getIcon, renderer, renderEmptyElement } = import_ui.VxeUI;
42
+ const { getConfig, getI18n, getIcon, renderer, renderEmptyElement } = import_core.VxeUI;
43
43
  function renderTitlePrefixIcon(params) {
44
44
  const { $table, column } = params;
45
45
  const titlePrefix = column.titlePrefix || column.titleHelp;
46
46
  if (titlePrefix) {
47
- return (0, import_vue.h)("span", {
48
- class: ["vxe-cell-title-prefix-icon", titlePrefix.iconStatus ? `theme--${titlePrefix.iconStatus}` : ""],
49
- onMouseenter(evnt) {
50
- $table.triggerHeaderTitleEvent(evnt, titlePrefix, params);
47
+ return (0, import_vue.h)(
48
+ "span",
49
+ {
50
+ class: ["vxe-cell-title-prefix-icon", titlePrefix.iconStatus ? `theme--${titlePrefix.iconStatus}` : ""],
51
+ onMouseenter(evnt) {
52
+ $table.triggerHeaderTitleEvent(evnt, titlePrefix, params);
53
+ },
54
+ onMouseleave(evnt) {
55
+ $table.handleTargetLeaveEvent(evnt);
56
+ }
51
57
  },
52
- onMouseleave(evnt) {
53
- $table.handleTargetLeaveEvent(evnt);
54
- }
55
- }, [
56
- (0, import_vue.h)("i", {
57
- class: titlePrefix.icon || getIcon().TABLE_TITLE_PREFIX
58
- })
59
- ]);
58
+ [
59
+ (0, import_vue.h)("i", {
60
+ class: titlePrefix.icon || getIcon().TABLE_TITLE_PREFIX
61
+ })
62
+ ]
63
+ );
60
64
  }
61
65
  return renderEmptyElement($table);
62
66
  }
@@ -64,19 +68,23 @@ function renderTitleSuffixIcon(params) {
64
68
  const { $table, column } = params;
65
69
  const titleSuffix = column.titleSuffix;
66
70
  if (titleSuffix) {
67
- return (0, import_vue.h)("span", {
68
- class: ["vxe-cell-title-suffix-icon", titleSuffix.iconStatus ? `theme--${titleSuffix.iconStatus}` : ""],
69
- onMouseenter(evnt) {
70
- $table.triggerHeaderTitleEvent(evnt, titleSuffix, params);
71
+ return (0, import_vue.h)(
72
+ "span",
73
+ {
74
+ class: ["vxe-cell-title-suffix-icon", titleSuffix.iconStatus ? `theme--${titleSuffix.iconStatus}` : ""],
75
+ onMouseenter(evnt) {
76
+ $table.triggerHeaderTitleEvent(evnt, titleSuffix, params);
77
+ },
78
+ onMouseleave(evnt) {
79
+ $table.handleTargetLeaveEvent(evnt);
80
+ }
71
81
  },
72
- onMouseleave(evnt) {
73
- $table.handleTargetLeaveEvent(evnt);
74
- }
75
- }, [
76
- (0, import_vue.h)("i", {
77
- class: titleSuffix.icon || getIcon().TABLE_TITLE_SUFFIX
78
- })
79
- ]);
82
+ [
83
+ (0, import_vue.h)("i", {
84
+ class: titleSuffix.icon || getIcon().TABLE_TITLE_SUFFIX
85
+ })
86
+ ]
87
+ );
80
88
  }
81
89
  return renderEmptyElement($table);
82
90
  }
@@ -102,17 +110,24 @@ function renderCellDragIcon(params) {
102
110
  };
103
111
  ons.onMouseup = $table.handleCellDragMouseupEvent;
104
112
  }
105
- return (0, import_vue.h)("span", {
106
- key: "dg",
107
- class: ["vxe-cell--drag-handle", {
108
- "is--disabled": isDisabled
109
- }],
110
- ...ons
111
- }, rowDragIconSlot ? $table.callSlot(rowDragIconSlot, params) : [
112
- (0, import_vue.h)("i", {
113
- class: icon || (dragConfig ? dragConfig.rowIcon : "") || getIcon().TABLE_DRAG_ROW
114
- })
115
- ]);
113
+ return (0, import_vue.h)(
114
+ "span",
115
+ {
116
+ key: "dg",
117
+ class: [
118
+ "vxe-cell--drag-handle",
119
+ {
120
+ "is--disabled": isDisabled
121
+ }
122
+ ],
123
+ ...ons
124
+ },
125
+ rowDragIconSlot ? $table.callSlot(rowDragIconSlot, params) : [
126
+ (0, import_vue.h)("i", {
127
+ class: icon || (dragConfig ? dragConfig.rowIcon : "") || getIcon().TABLE_DRAG_ROW
128
+ })
129
+ ]
130
+ );
116
131
  }
117
132
  function renderCellBaseVNs(params, content) {
118
133
  const { $table, column, level } = params;
@@ -126,17 +141,13 @@ function renderCellBaseVNs(params, content) {
126
141
  const { showIcon, isPeerDrag, isCrossDrag, visibleMethod } = rowDragOpts;
127
142
  const rVisibleMethod = visibleMethod || (dragConfig ? dragConfig.rowVisibleMethod : null);
128
143
  const vns = [];
129
- if (dragSort && rowOpts.drag && ((showIcon || (dragConfig ? dragConfig.showRowIcon : false)) && (!rVisibleMethod || rVisibleMethod(params)))) {
144
+ if (dragSort && rowOpts.drag && (showIcon || (dragConfig ? dragConfig.showRowIcon : false)) && (!rVisibleMethod || rVisibleMethod(params))) {
130
145
  if (treeConfig) {
131
146
  if (treeOpts.transform && (isPeerDrag || isCrossDrag || !level)) {
132
- vns.push(
133
- renderCellDragIcon(params)
134
- );
147
+ vns.push(renderCellDragIcon(params));
135
148
  }
136
149
  } else {
137
- vns.push(
138
- renderCellDragIcon(params)
139
- );
150
+ vns.push(renderCellDragIcon(params));
140
151
  }
141
152
  }
142
153
  return vns.concat(import_xe_utils.default.isArray(content) ? content : [content]);
@@ -163,28 +174,30 @@ function renderHeaderCellDragIcon(params) {
163
174
  };
164
175
  ons.onMouseup = $table.handleHeaderCellDragMouseupEvent;
165
176
  }
166
- return (0, import_vue.h)("span", {
167
- key: "dg",
168
- class: ["vxe-cell--drag-handle", {
169
- "is--disabled": isDisabled
170
- }],
171
- ...ons
172
- }, columnDragIconSlot ? $table.callSlot(columnDragIconSlot, params) : [
173
- (0, import_vue.h)("i", {
174
- class: icon || getIcon().TABLE_DRAG_COLUMN
175
- })
176
- ]);
177
+ return (0, import_vue.h)(
178
+ "span",
179
+ {
180
+ key: "dg",
181
+ class: [
182
+ "vxe-cell--drag-handle",
183
+ {
184
+ "is--disabled": isDisabled
185
+ }
186
+ ],
187
+ ...ons
188
+ },
189
+ columnDragIconSlot ? $table.callSlot(columnDragIconSlot, params) : [
190
+ (0, import_vue.h)("i", {
191
+ class: icon || getIcon().TABLE_DRAG_COLUMN
192
+ })
193
+ ]
194
+ );
177
195
  }
178
196
  }
179
197
  return renderEmptyElement($table);
180
198
  }
181
199
  function renderHeaderCellBaseVNs(params, content) {
182
- const vns = [
183
- renderTitlePrefixIcon(params),
184
- renderHeaderCellDragIcon(params),
185
- ...import_xe_utils.default.isArray(content) ? content : [content],
186
- renderTitleSuffixIcon(params)
187
- ];
200
+ const vns = [renderTitlePrefixIcon(params), renderHeaderCellDragIcon(params), ...import_xe_utils.default.isArray(content) ? content : [content], renderTitleSuffixIcon(params)];
188
201
  return vns;
189
202
  }
190
203
  function getRenderDefaultColumnTitle(column, content) {
@@ -194,9 +207,13 @@ function getRenderDefaultColumnTitle(column, content) {
194
207
  innerHTML: content
195
208
  });
196
209
  }
197
- return (0, import_vue.h)("span", {
198
- key: "ct"
199
- }, (0, import_vn.getSlotVNs)(content));
210
+ return (0, import_vue.h)(
211
+ "span",
212
+ {
213
+ key: "ct"
214
+ },
215
+ (0, import_vn.getSlotVNs)(content)
216
+ );
200
217
  }
201
218
  function renderTitleContent(params, content) {
202
219
  const { $table, column } = params;
@@ -237,12 +254,14 @@ function renderTitleContent(params, content) {
237
254
  }
238
255
  const titleVN = getRenderDefaultColumnTitle(column, content);
239
256
  return [
240
- (0, import_vue.h)("span", {
241
- class: "vxe-cell--title",
242
- ...ons
243
- }, isRowGroupStatus && column.aggFunc && $table.getPivotTableAggregateRenderColTitles ? $table.getPivotTableAggregateRenderColTitles(column, titleVN) : titleSlot ? $table.callSlot(titleSlot, params) : [
244
- titleVN
245
- ])
257
+ (0, import_vue.h)(
258
+ "span",
259
+ {
260
+ class: "vxe-cell--title",
261
+ ...ons
262
+ },
263
+ isRowGroupStatus && column.aggFunc && $table.getPivotTableAggregateRenderColTitles ? $table.getPivotTableAggregateRenderColTitles(column, titleVN) : titleSlot ? $table.callSlot(titleSlot, params) : [titleVN]
264
+ )
246
265
  ];
247
266
  }
248
267
  function getFooterContent(params) {
@@ -275,9 +294,13 @@ function getFooterContent(params) {
275
294
  }
276
295
  }
277
296
  return [
278
- (0, import_vue.h)("span", {
279
- class: "vxe-cell--label"
280
- }, (0, import_utils.formatText)(itemValue, 1))
297
+ (0, import_vue.h)(
298
+ "span",
299
+ {
300
+ class: "vxe-cell--label"
301
+ },
302
+ (0, import_utils.formatText)(itemValue, 1)
303
+ )
281
304
  ];
282
305
  }
283
306
  function getDefaultCellLabel(params) {
@@ -497,7 +520,7 @@ const Cell = {
497
520
  }
498
521
  if (editRenderOpts) {
499
522
  const editCompConf = editRenderOpts && editRenderOpts.name ? rendererOpts[editRenderOpts.name] || renderer.get(editRenderOpts.name) : null;
500
- const editCellRenderFn = editCompConf ? editCompConf.renderTableCell || editCompConf.renderCell || (editCompConf.renderTableDefault || editCompConf.renderDefault) : null;
523
+ const editCellRenderFn = editCompConf ? editCompConf.renderTableCell || editCompConf.renderCell || editCompConf.renderTableDefault || editCompConf.renderDefault : null;
501
524
  if (editCellRenderFn) {
502
525
  return renderCellBaseVNs(params, (0, import_vn.getSlotVNs)(editCellRenderFn(editRenderOpts, Object.assign({ $type: editRenderOpts ? "edit" : "cell" }, params))));
503
526
  }
@@ -513,9 +536,13 @@ const Cell = {
513
536
  },
514
537
  [
515
538
  // 如果设置占位符
516
- editRenderOpts && (0, import_utils.eqEmptyValue)(cellValue) ? (0, import_vue.h)("span", {
517
- class: "vxe-cell--placeholder"
518
- }, (0, import_utils.formatText)((0, import_utils.getFuncText)(cellPlaceholder), 1)) : (0, import_vue.h)("span", (0, import_utils.formatText)(cellValue, 1))
539
+ editRenderOpts && (0, import_utils.eqEmptyValue)(cellValue) ? (0, import_vue.h)(
540
+ "span",
541
+ {
542
+ class: "vxe-cell--placeholder"
543
+ },
544
+ (0, import_utils.formatText)((0, import_utils.getFuncText)(cellPlaceholder), 1)
545
+ ) : (0, import_vue.h)("span", (0, import_utils.formatText)(cellValue, 1))
519
546
  ]
520
547
  )
521
548
  ]);
@@ -541,28 +568,43 @@ const Cell = {
541
568
  const { mode, padding, indent, showIcon, iconOpen, iconClose } = aggregateOpts;
542
569
  const rowid = (0, import_util.getRowid)($table, row);
543
570
  const isExpand = !!rowGroupExpandedFlag && !!rowGroupExpandedMaps[rowid];
544
- return (0, import_vue.h)("div", {
545
- class: ["vxe-row-group--tree-node", {
546
- "is--expanded": isExpand
547
- }],
548
- style: mode !== "column" && padding && indent ? {
549
- paddingLeft: `${level * indent}px`
550
- } : void 0
551
- }, [
552
- showIcon && row.isAggregate ? (0, import_vue.h)("span", {
553
- class: "vxe-row-group--node-btn",
554
- onClick(evnt) {
555
- $table.triggerRowGroupExpandEvent(evnt, params);
556
- }
557
- }, [
558
- (0, import_vue.h)("i", {
559
- class: isExpand ? iconOpen || getIcon().TABLE_ROW_GROUP_OPEN : iconClose || getIcon().TABLE_ROW_GROUP_CLOSE
560
- })
561
- ]) : renderEmptyElement($table),
562
- (0, import_vue.h)("div", {
563
- class: "vxe-row-group-cell"
564
- }, cellVNodes)
565
- ]);
571
+ return (0, import_vue.h)(
572
+ "div",
573
+ {
574
+ class: [
575
+ "vxe-row-group--tree-node",
576
+ {
577
+ "is--expanded": isExpand
578
+ }
579
+ ],
580
+ style: mode !== "column" && padding && indent ? {
581
+ paddingLeft: `${level * indent}px`
582
+ } : void 0
583
+ },
584
+ [
585
+ showIcon && row.isAggregate ? (0, import_vue.h)(
586
+ "span",
587
+ {
588
+ class: "vxe-row-group--node-btn",
589
+ onClick(evnt) {
590
+ $table.triggerRowGroupExpandEvent(evnt, params);
591
+ }
592
+ },
593
+ [
594
+ (0, import_vue.h)("i", {
595
+ class: isExpand ? iconOpen || getIcon().TABLE_ROW_GROUP_OPEN : iconClose || getIcon().TABLE_ROW_GROUP_CLOSE
596
+ })
597
+ ]
598
+ ) : renderEmptyElement($table),
599
+ (0, import_vue.h)(
600
+ "div",
601
+ {
602
+ class: "vxe-row-group-cell"
603
+ },
604
+ cellVNodes
605
+ )
606
+ ]
607
+ );
566
608
  },
567
609
  /**
568
610
  * 树
@@ -606,28 +648,43 @@ const Cell = {
606
648
  $table.triggerTreeExpandEvent(evnt, params);
607
649
  };
608
650
  }
609
- return (0, import_vue.h)("div", {
610
- class: ["vxe-cell--tree-node", {
611
- "is--active": isActive
612
- }],
613
- style: padding && indent ? {
614
- paddingLeft: `${level * indent}px`
615
- } : void 0
616
- }, [
617
- showIcon && (lazy ? isLazyLoaded ? hasChild : hasChild || hasLazyChilds : hasChild) && (!visibleMethod || visibleMethod(params)) ? [
618
- (0, import_vue.h)("div", {
619
- class: "vxe-cell--tree-btn",
620
- ...ons
621
- }, [
622
- (0, import_vue.h)("i", {
623
- class: isLazyLoading ? iconLoaded || getIcon().TABLE_TREE_LOADED : isActive ? iconOpen || getIcon().TABLE_TREE_OPEN : iconClose || getIcon().TABLE_TREE_CLOSE
624
- })
625
- ])
626
- ] : null,
627
- (0, import_vue.h)("div", {
628
- class: "vxe-tree-cell"
629
- }, cellVNodes)
630
- ]);
651
+ return (0, import_vue.h)(
652
+ "div",
653
+ {
654
+ class: [
655
+ "vxe-cell--tree-node",
656
+ {
657
+ "is--active": isActive
658
+ }
659
+ ],
660
+ style: padding && indent ? {
661
+ paddingLeft: `${level * indent}px`
662
+ } : void 0
663
+ },
664
+ [
665
+ showIcon && (lazy ? isLazyLoaded ? hasChild : hasChild || hasLazyChilds : hasChild) && (!visibleMethod || visibleMethod(params)) ? [
666
+ (0, import_vue.h)(
667
+ "div",
668
+ {
669
+ class: "vxe-cell--tree-btn",
670
+ ...ons
671
+ },
672
+ [
673
+ (0, import_vue.h)("i", {
674
+ class: isLazyLoading ? iconLoaded || getIcon().TABLE_TREE_LOADED : isActive ? iconOpen || getIcon().TABLE_TREE_OPEN : iconClose || getIcon().TABLE_TREE_CLOSE
675
+ })
676
+ ]
677
+ )
678
+ ] : null,
679
+ (0, import_vue.h)(
680
+ "div",
681
+ {
682
+ class: "vxe-tree-cell"
683
+ },
684
+ cellVNodes
685
+ )
686
+ ]
687
+ );
631
688
  },
632
689
  /**
633
690
  * 层级节点。
@@ -678,9 +735,7 @@ const Cell = {
678
735
  }
679
736
  const { seq } = params;
680
737
  const seqMd = seqOpts.seqMethod;
681
- return renderCellBaseVNs(params, [
682
- (0, import_vue.h)("span", `${(0, import_utils.formatText)(seqMd ? seqMd(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)}`)
683
- ]);
738
+ return renderCellBaseVNs(params, [(0, import_vue.h)("span", `${(0, import_utils.formatText)(seqMd ? seqMd(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)}`)]);
684
739
  },
685
740
  renderDeepIndexCell(params) {
686
741
  return Cell.renderDeepNodeBtn(params, Cell.renderSeqCell(params));
@@ -696,19 +751,30 @@ const Cell = {
696
751
  const headerSlot = slots ? slots.header : null;
697
752
  return renderHeaderCellBaseVNs(
698
753
  params,
699
- renderTitleContent(params, headerSlot ? $table.callSlot(headerSlot, params) : [
700
- (0, import_vue.h)("span", {
701
- class: "vxe-radio--label"
702
- }, titleSlot ? $table.callSlot(titleSlot, params) : $table.getHeaderCellLabel(column))
703
- ])
754
+ renderTitleContent(
755
+ params,
756
+ headerSlot ? $table.callSlot(headerSlot, params) : [
757
+ (0, import_vue.h)(
758
+ "span",
759
+ {
760
+ class: "vxe-radio--label"
761
+ },
762
+ titleSlot ? $table.callSlot(titleSlot, params) : $table.getHeaderCellLabel(column)
763
+ )
764
+ ]
765
+ )
704
766
  );
705
767
  }
706
768
  return renderHeaderCellBaseVNs(
707
769
  params,
708
770
  renderTitleContent(params, [
709
- (0, import_vue.h)("span", {
710
- class: "vxe-radio--label"
711
- }, titleSlot ? $table.callSlot(titleSlot, params) : $table.getHeaderCellLabel(column))
771
+ (0, import_vue.h)(
772
+ "span",
773
+ {
774
+ class: "vxe-radio--label"
775
+ },
776
+ titleSlot ? $table.callSlot(titleSlot, params) : $table.getHeaderCellLabel(column)
777
+ )
712
778
  ])
713
779
  );
714
780
  },
@@ -753,19 +819,30 @@ const Cell = {
753
819
  }
754
820
  if (defaultSlot || labelField) {
755
821
  radioVNs.push(
756
- (0, import_vue.h)("span", {
757
- class: "vxe-radio--label"
758
- }, defaultSlot ? $table.callSlot(defaultSlot, radioParams) : import_xe_utils.default.get(row, labelField))
822
+ (0, import_vue.h)(
823
+ "span",
824
+ {
825
+ class: "vxe-radio--label"
826
+ },
827
+ defaultSlot ? $table.callSlot(defaultSlot, radioParams) : import_xe_utils.default.get(row, labelField)
828
+ )
759
829
  );
760
830
  }
761
831
  return renderCellBaseVNs(params, [
762
- (0, import_vue.h)("span", {
763
- class: ["vxe-cell--radio", {
764
- "is--checked": isChecked,
765
- "is--disabled": isDisabled
766
- }],
767
- ...ons
768
- }, radioVNs)
832
+ (0, import_vue.h)(
833
+ "span",
834
+ {
835
+ class: [
836
+ "vxe-cell--radio",
837
+ {
838
+ "is--checked": isChecked,
839
+ "is--disabled": isDisabled
840
+ }
841
+ ],
842
+ ...ons
843
+ },
844
+ radioVNs
845
+ )
769
846
  ]);
770
847
  },
771
848
  renderDeepRadioCell(params) {
@@ -801,32 +878,52 @@ const Cell = {
801
878
  }
802
879
  }
803
880
  if (checkStrictly ? !showHeader : showHeader === false) {
804
- return renderHeaderCellBaseVNs(params, renderTitleContent(checkboxParams, [
805
- (0, import_vue.h)("span", {
806
- class: "vxe-checkbox--label"
807
- }, titleSlot ? $table.callSlot(titleSlot, checkboxParams) : colTitle)
808
- ]));
881
+ return renderHeaderCellBaseVNs(
882
+ params,
883
+ renderTitleContent(checkboxParams, [
884
+ (0, import_vue.h)(
885
+ "span",
886
+ {
887
+ class: "vxe-checkbox--label"
888
+ },
889
+ titleSlot ? $table.callSlot(titleSlot, checkboxParams) : colTitle
890
+ )
891
+ ])
892
+ );
809
893
  }
810
894
  return renderHeaderCellBaseVNs(
811
895
  params,
812
896
  renderTitleContent(checkboxParams, [
813
- (0, import_vue.h)("span", {
814
- class: ["vxe-cell--checkbox", {
815
- "is--checked": isAllCheckboxSelected,
816
- "is--disabled": isAllCheckboxDisabled,
817
- "is--indeterminate": isAllCheckboxIndeterminate
818
- }],
819
- title: import_xe_utils.default.eqNull(headerTitle) ? getI18n("vxe.table.allTitle") : `${headerTitle || ""}`,
820
- ...ons
821
- }, [
822
- (0, import_vue.h)("span", {
823
- class: ["vxe-checkbox--icon", isAllCheckboxIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllCheckboxSelected ? getIcon().TABLE_CHECKBOX_CHECKED : isAllCheckboxDisabled ? getIcon().TABLE_CHECKBOX_DISABLED_UNCHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
824
- })
825
- ].concat(titleSlot || colTitle ? [
826
- (0, import_vue.h)("span", {
827
- class: "vxe-checkbox--label"
828
- }, titleSlot ? $table.callSlot(titleSlot, checkboxParams) : colTitle)
829
- ] : []))
897
+ (0, import_vue.h)(
898
+ "span",
899
+ {
900
+ class: [
901
+ "vxe-cell--checkbox",
902
+ {
903
+ "is--checked": isAllCheckboxSelected,
904
+ "is--disabled": isAllCheckboxDisabled,
905
+ "is--indeterminate": isAllCheckboxIndeterminate
906
+ }
907
+ ],
908
+ title: import_xe_utils.default.eqNull(headerTitle) ? getI18n("vxe.table.allTitle") : `${headerTitle || ""}`,
909
+ ...ons
910
+ },
911
+ [
912
+ (0, import_vue.h)("span", {
913
+ class: ["vxe-checkbox--icon", isAllCheckboxIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllCheckboxSelected ? getIcon().TABLE_CHECKBOX_CHECKED : isAllCheckboxDisabled ? getIcon().TABLE_CHECKBOX_DISABLED_UNCHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
914
+ })
915
+ ].concat(
916
+ titleSlot || colTitle ? [
917
+ (0, import_vue.h)(
918
+ "span",
919
+ {
920
+ class: "vxe-checkbox--label"
921
+ },
922
+ titleSlot ? $table.callSlot(titleSlot, checkboxParams) : colTitle
923
+ )
924
+ ] : []
925
+ )
926
+ )
830
927
  ])
831
928
  );
832
929
  },
@@ -886,21 +983,32 @@ const Cell = {
886
983
  }
887
984
  if (defaultSlot || labelField) {
888
985
  checkVNs.push(
889
- (0, import_vue.h)("span", {
890
- class: "vxe-checkbox--label"
891
- }, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : import_xe_utils.default.get(row, labelField))
986
+ (0, import_vue.h)(
987
+ "span",
988
+ {
989
+ class: "vxe-checkbox--label"
990
+ },
991
+ defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : import_xe_utils.default.get(row, labelField)
992
+ )
892
993
  );
893
994
  }
894
995
  return renderCellBaseVNs(params, [
895
- (0, import_vue.h)("span", {
896
- class: ["vxe-cell--checkbox", {
897
- "is--checked": isChecked,
898
- "is--disabled": isDisabled,
899
- "is--indeterminate": indeterminate,
900
- "is--hidden": !isVisible
901
- }],
902
- ...ons
903
- }, checkVNs)
996
+ (0, import_vue.h)(
997
+ "span",
998
+ {
999
+ class: [
1000
+ "vxe-cell--checkbox",
1001
+ {
1002
+ "is--checked": isChecked,
1003
+ "is--disabled": isDisabled,
1004
+ "is--indeterminate": indeterminate,
1005
+ "is--hidden": !isVisible
1006
+ }
1007
+ ],
1008
+ ...ons
1009
+ },
1010
+ checkVNs
1011
+ )
904
1012
  ]);
905
1013
  },
906
1014
  renderDeepSelectionCell(params) {
@@ -962,22 +1070,33 @@ const Cell = {
962
1070
  );
963
1071
  if (defaultSlot || labelField) {
964
1072
  checkVNs.push(
965
- (0, import_vue.h)("span", {
966
- class: "vxe-checkbox--label"
967
- }, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : import_xe_utils.default.get(row, labelField))
1073
+ (0, import_vue.h)(
1074
+ "span",
1075
+ {
1076
+ class: "vxe-checkbox--label"
1077
+ },
1078
+ defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : import_xe_utils.default.get(row, labelField)
1079
+ )
968
1080
  );
969
1081
  }
970
1082
  }
971
1083
  return renderCellBaseVNs(params, [
972
- (0, import_vue.h)("span", {
973
- class: ["vxe-cell--checkbox", {
974
- "is--checked": isChecked,
975
- "is--disabled": isDisabled,
976
- "is--indeterminate": indeterminateField && !isChecked ? row[indeterminateField] : indeterminate,
977
- "is--hidden": !isVisible
978
- }],
979
- ...ons
980
- }, checkVNs)
1084
+ (0, import_vue.h)(
1085
+ "span",
1086
+ {
1087
+ class: [
1088
+ "vxe-cell--checkbox",
1089
+ {
1090
+ "is--checked": isChecked,
1091
+ "is--disabled": isDisabled,
1092
+ "is--indeterminate": indeterminateField && !isChecked ? row[indeterminateField] : indeterminate,
1093
+ "is--hidden": !isVisible
1094
+ }
1095
+ ],
1096
+ ...ons
1097
+ },
1098
+ checkVNs
1099
+ )
981
1100
  ]);
982
1101
  },
983
1102
  renderDeepSelectionCellByProp(params) {
@@ -1014,28 +1133,43 @@ const Cell = {
1014
1133
  }
1015
1134
  }
1016
1135
  return renderCellBaseVNs(params, [
1017
- showIcon && (!visibleMethod || visibleMethod(params)) ? (0, import_vue.h)("div", {
1018
- class: ["vxe-table--expanded", {
1019
- "is--active": isActive
1020
- }]
1021
- }, [
1022
- (0, import_vue.h)("span", {
1023
- class: "vxe-table--expand-btn",
1024
- onMousedown(evnt) {
1025
- evnt.stopPropagation();
1026
- },
1027
- onClick(evnt) {
1028
- $table.triggerRowExpandEvent(evnt, params);
1029
- }
1030
- }, [
1031
- (0, import_vue.h)("i", {
1032
- class: isLazyLoading ? iconLoaded || getIcon().TABLE_EXPAND_LOADED : isActive ? iconOpen || getIcon().TABLE_EXPAND_OPEN : iconClose || getIcon().TABLE_EXPAND_CLOSE
1033
- })
1034
- ])
1035
- ]) : renderEmptyElement($table),
1036
- defaultSlot || labelField ? (0, import_vue.h)("div", {
1037
- class: "vxe-table--expand-label"
1038
- }, defaultSlot ? $table.callSlot(defaultSlot, params) : import_xe_utils.default.get(row, labelField)) : renderEmptyElement($table)
1136
+ showIcon && (!visibleMethod || visibleMethod(params)) ? (0, import_vue.h)(
1137
+ "div",
1138
+ {
1139
+ class: [
1140
+ "vxe-table--expanded",
1141
+ {
1142
+ "is--active": isActive
1143
+ }
1144
+ ]
1145
+ },
1146
+ [
1147
+ (0, import_vue.h)(
1148
+ "span",
1149
+ {
1150
+ class: "vxe-table--expand-btn",
1151
+ onMousedown(evnt) {
1152
+ evnt.stopPropagation();
1153
+ },
1154
+ onClick(evnt) {
1155
+ $table.triggerRowExpandEvent(evnt, params);
1156
+ }
1157
+ },
1158
+ [
1159
+ (0, import_vue.h)("i", {
1160
+ class: isLazyLoading ? iconLoaded || getIcon().TABLE_EXPAND_LOADED : isActive ? iconOpen || getIcon().TABLE_EXPAND_OPEN : iconClose || getIcon().TABLE_EXPAND_CLOSE
1161
+ })
1162
+ ]
1163
+ )
1164
+ ]
1165
+ ) : renderEmptyElement($table),
1166
+ defaultSlot || labelField ? (0, import_vue.h)(
1167
+ "div",
1168
+ {
1169
+ class: "vxe-table--expand-label"
1170
+ },
1171
+ defaultSlot ? $table.callSlot(defaultSlot, params) : import_xe_utils.default.get(row, labelField)
1172
+ ) : renderEmptyElement($table)
1039
1173
  ]);
1040
1174
  },
1041
1175
  renderExpandData(params) {
@@ -1082,19 +1216,13 @@ const Cell = {
1082
1216
  * 排序和筛选
1083
1217
  */
1084
1218
  renderSortAndFilterHeader(params) {
1085
- return renderHeaderCellBaseVNs(
1086
- params,
1087
- Cell.renderHeaderTitle(params).concat(Cell.renderSortIcon(params).concat(Cell.renderFilterIcon(params)))
1088
- );
1219
+ return renderHeaderCellBaseVNs(params, Cell.renderHeaderTitle(params).concat(Cell.renderSortIcon(params).concat(Cell.renderFilterIcon(params))));
1089
1220
  },
1090
1221
  /**
1091
1222
  * 排序
1092
1223
  */
1093
1224
  renderSortHeader(params) {
1094
- return renderHeaderCellBaseVNs(
1095
- params,
1096
- Cell.renderHeaderTitle(params).concat(Cell.renderSortIcon(params))
1097
- );
1225
+ return renderHeaderCellBaseVNs(params, Cell.renderHeaderTitle(params).concat(Cell.renderSortIcon(params)));
1098
1226
  },
1099
1227
  renderSortIcon(params) {
1100
1228
  const { $table, column } = params;
@@ -1105,30 +1233,42 @@ const Cell = {
1105
1233
  if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
1106
1234
  const sortSlot = slots ? slots.sort : null;
1107
1235
  return sortSlot ? (0, import_vn.getSlotVNs)($table.callSlot(sortSlot, params)) : [
1108
- (0, import_vue.h)("span", {
1109
- class: ["vxe-cell--sort", `vxe-cell--sort-${iconLayout}-layout`]
1110
- }, [
1111
- (0, import_vue.h)("i", {
1112
- class: ["vxe-sort--asc-btn", iconAsc || getIcon().TABLE_SORT_ASC, {
1113
- "sort--active": order === "asc"
1114
- }],
1115
- title: import_xe_utils.default.eqNull(ascTitle) ? getI18n("vxe.table.sortAsc") : `${ascTitle || ""}`,
1116
- onClick: allowBtn ? (evnt) => {
1117
- evnt.stopPropagation();
1118
- $table.triggerSortEvent(evnt, column, "asc");
1119
- } : void 0
1120
- }),
1121
- (0, import_vue.h)("i", {
1122
- class: ["vxe-sort--desc-btn", iconDesc || getIcon().TABLE_SORT_DESC, {
1123
- "sort--active": order === "desc"
1124
- }],
1125
- title: import_xe_utils.default.eqNull(descTitle) ? getI18n("vxe.table.sortDesc") : `${descTitle || ""}`,
1126
- onClick: allowBtn ? (evnt) => {
1127
- evnt.stopPropagation();
1128
- $table.triggerSortEvent(evnt, column, "desc");
1129
- } : void 0
1130
- })
1131
- ])
1236
+ (0, import_vue.h)(
1237
+ "span",
1238
+ {
1239
+ class: ["vxe-cell--sort", `vxe-cell--sort-${iconLayout}-layout`]
1240
+ },
1241
+ [
1242
+ (0, import_vue.h)("i", {
1243
+ class: [
1244
+ "vxe-sort--asc-btn",
1245
+ iconAsc || getIcon().TABLE_SORT_ASC,
1246
+ {
1247
+ "sort--active": order === "asc"
1248
+ }
1249
+ ],
1250
+ title: import_xe_utils.default.eqNull(ascTitle) ? getI18n("vxe.table.sortAsc") : `${ascTitle || ""}`,
1251
+ onClick: allowBtn ? (evnt) => {
1252
+ evnt.stopPropagation();
1253
+ $table.triggerSortEvent(evnt, column, "asc");
1254
+ } : void 0
1255
+ }),
1256
+ (0, import_vue.h)("i", {
1257
+ class: [
1258
+ "vxe-sort--desc-btn",
1259
+ iconDesc || getIcon().TABLE_SORT_DESC,
1260
+ {
1261
+ "sort--active": order === "desc"
1262
+ }
1263
+ ],
1264
+ title: import_xe_utils.default.eqNull(descTitle) ? getI18n("vxe.table.sortDesc") : `${descTitle || ""}`,
1265
+ onClick: allowBtn ? (evnt) => {
1266
+ evnt.stopPropagation();
1267
+ $table.triggerSortEvent(evnt, column, "desc");
1268
+ } : void 0
1269
+ })
1270
+ ]
1271
+ )
1132
1272
  ];
1133
1273
  }
1134
1274
  return [];
@@ -1148,21 +1288,28 @@ const Cell = {
1148
1288
  const { showIcon, iconNone, iconMatch, iconVisibleMethod } = filterOpts;
1149
1289
  if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
1150
1290
  return [
1151
- (0, import_vue.h)("span", {
1152
- class: ["vxe-cell--filter", {
1153
- "is--active": filterStore.visible && filterStore.column === column
1154
- }],
1155
- onClick(evnt) {
1156
- if ($table.triggerFilterEvent) {
1157
- $table.triggerFilterEvent(evnt, params.column, params);
1291
+ (0, import_vue.h)(
1292
+ "span",
1293
+ {
1294
+ class: [
1295
+ "vxe-cell--filter",
1296
+ {
1297
+ "is--active": filterStore.visible && filterStore.column === column
1298
+ }
1299
+ ],
1300
+ onClick(evnt) {
1301
+ if ($table.triggerFilterEvent) {
1302
+ $table.triggerFilterEvent(evnt, params.column, params);
1303
+ }
1158
1304
  }
1159
- }
1160
- }, [
1161
- (0, import_vue.h)("i", {
1162
- class: ["vxe-filter--btn", hasFilter ? iconMatch || getIcon().TABLE_FILTER_MATCH : iconNone || getIcon().TABLE_FILTER_NONE],
1163
- title: getI18n("vxe.table.filter")
1164
- })
1165
- ])
1305
+ },
1306
+ [
1307
+ (0, import_vue.h)("i", {
1308
+ class: ["vxe-filter--btn", hasFilter ? iconMatch || getIcon().TABLE_FILTER_MATCH : iconNone || getIcon().TABLE_FILTER_NONE],
1309
+ title: getI18n("vxe.table.filter")
1310
+ })
1311
+ ]
1312
+ )
1166
1313
  ];
1167
1314
  }
1168
1315
  return [];
@@ -1190,18 +1337,24 @@ const Cell = {
1190
1337
  if (isEnableEdit) {
1191
1338
  const { showAsterisk, showIcon, icon } = editOpts;
1192
1339
  editIconVNs = [
1193
- isRequired && showAsterisk ? (0, import_vue.h)("span", {
1194
- class: "vxe-cell--required-icon"
1195
- }, [
1196
- (0, import_vue.h)("i")
1197
- ]) : renderEmptyElement($table),
1198
- editRenderOpts && showIcon ? (0, import_vue.h)("span", {
1199
- class: "vxe-cell--edit-icon"
1200
- }, import_xe_utils.default.isFunction(icon) ? (0, import_vn.getSlotVNs)(icon({})) : [
1201
- (0, import_vue.h)("i", {
1202
- class: icon || getIcon().TABLE_EDIT
1203
- })
1204
- ]) : renderEmptyElement($table)
1340
+ isRequired && showAsterisk ? (0, import_vue.h)(
1341
+ "span",
1342
+ {
1343
+ class: "vxe-cell--required-icon"
1344
+ },
1345
+ [(0, import_vue.h)("i")]
1346
+ ) : renderEmptyElement($table),
1347
+ editRenderOpts && showIcon ? (0, import_vue.h)(
1348
+ "span",
1349
+ {
1350
+ class: "vxe-cell--edit-icon"
1351
+ },
1352
+ import_xe_utils.default.isFunction(icon) ? (0, import_vn.getSlotVNs)(icon({})) : [
1353
+ (0, import_vue.h)("i", {
1354
+ class: icon || getIcon().TABLE_EDIT
1355
+ })
1356
+ ]
1357
+ ) : renderEmptyElement($table)
1205
1358
  ];
1206
1359
  }
1207
1360
  return renderHeaderCellBaseVNs(
@@ -1287,9 +1440,13 @@ const Cell = {
1287
1440
  }
1288
1441
  if (formatter) {
1289
1442
  return renderCellBaseVNs(params, [
1290
- (0, import_vue.h)("span", {
1291
- class: "vxe-cell--label"
1292
- }, getDefaultCellLabel(cellParams))
1443
+ (0, import_vue.h)(
1444
+ "span",
1445
+ {
1446
+ class: "vxe-cell--label"
1447
+ },
1448
+ getDefaultCellLabel(cellParams)
1449
+ )
1293
1450
  ]);
1294
1451
  }
1295
1452
  return Cell.renderDefaultCell(cellParams);