vxe-table 3.14.0-beta.2 → 3.14.0-beta.20

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 (157) hide show
  1. package/es/grid/src/grid.js +78 -48
  2. package/es/locale/lang/ar-EG.js +7 -1
  3. package/es/locale/lang/de-DE.js +7 -1
  4. package/es/locale/lang/en-US.js +7 -1
  5. package/es/locale/lang/es-ES.js +7 -1
  6. package/es/locale/lang/fr-FR.js +7 -1
  7. package/es/locale/lang/hu-HU.js +7 -1
  8. package/es/locale/lang/hy-AM.js +7 -1
  9. package/es/locale/lang/id-ID.js +7 -1
  10. package/es/locale/lang/it-IT.js +7 -1
  11. package/es/locale/lang/ja-JP.js +7 -1
  12. package/es/locale/lang/ko-KR.js +7 -1
  13. package/es/locale/lang/nb-NO.js +7 -1
  14. package/es/locale/lang/pt-BR.js +7 -1
  15. package/es/locale/lang/ru-RU.js +7 -1
  16. package/es/locale/lang/th-TH.js +7 -1
  17. package/es/locale/lang/ug-CN.js +7 -1
  18. package/es/locale/lang/uk-UA.js +7 -1
  19. package/es/locale/lang/vi-VN.js +7 -1
  20. package/es/locale/lang/zh-CHT.js +7 -1
  21. package/es/locale/lang/zh-CN.js +7 -1
  22. package/es/style.css +1 -1
  23. package/es/table/module/filter/panel.js +12 -2
  24. package/es/table/module/keyboard/mixin.js +86 -21
  25. package/es/table/render/index.js +90 -59
  26. package/es/table/src/body.js +12 -7
  27. package/es/table/src/cell.js +10 -9
  28. package/es/table/src/footer.js +9 -4
  29. package/es/table/src/header.js +2 -2
  30. package/es/table/src/methods.js +444 -231
  31. package/es/table/src/props.js +4 -0
  32. package/es/table/src/table.js +28 -6
  33. package/es/table/src/util.js +65 -7
  34. package/es/ui/index.js +1 -1
  35. package/es/ui/src/log.js +1 -1
  36. package/helper/vetur/attributes.json +1 -1
  37. package/helper/vetur/tags.json +1 -1
  38. package/lib/grid/src/grid.js +85 -65
  39. package/lib/grid/src/grid.min.js +1 -1
  40. package/lib/index.umd.js +922 -448
  41. package/lib/index.umd.min.js +1 -1
  42. package/lib/locale/lang/ar-EG.js +7 -1
  43. package/lib/locale/lang/ar-EG.min.js +1 -1
  44. package/lib/locale/lang/de-DE.js +7 -1
  45. package/lib/locale/lang/de-DE.min.js +1 -1
  46. package/lib/locale/lang/en-US.js +7 -1
  47. package/lib/locale/lang/en-US.min.js +1 -1
  48. package/lib/locale/lang/en-US.umd.js +7 -1
  49. package/lib/locale/lang/es-ES.js +7 -1
  50. package/lib/locale/lang/es-ES.min.js +1 -1
  51. package/lib/locale/lang/es-ES.umd.js +7 -1
  52. package/lib/locale/lang/fr-FR.js +7 -1
  53. package/lib/locale/lang/fr-FR.min.js +1 -1
  54. package/lib/locale/lang/hu-HU.js +7 -1
  55. package/lib/locale/lang/hu-HU.min.js +1 -1
  56. package/lib/locale/lang/hu-HU.umd.js +7 -1
  57. package/lib/locale/lang/hy-AM.js +7 -1
  58. package/lib/locale/lang/hy-AM.min.js +1 -1
  59. package/lib/locale/lang/id-ID.js +7 -1
  60. package/lib/locale/lang/id-ID.min.js +1 -1
  61. package/lib/locale/lang/it-IT.js +7 -1
  62. package/lib/locale/lang/it-IT.min.js +1 -1
  63. package/lib/locale/lang/ja-JP.js +7 -1
  64. package/lib/locale/lang/ja-JP.min.js +1 -1
  65. package/lib/locale/lang/ja-JP.umd.js +7 -1
  66. package/lib/locale/lang/ko-KR.js +7 -1
  67. package/lib/locale/lang/ko-KR.min.js +1 -1
  68. package/lib/locale/lang/ko-KR.umd.js +7 -1
  69. package/lib/locale/lang/nb-NO.js +7 -1
  70. package/lib/locale/lang/nb-NO.min.js +1 -1
  71. package/lib/locale/lang/pt-BR.js +7 -1
  72. package/lib/locale/lang/pt-BR.min.js +1 -1
  73. package/lib/locale/lang/pt-BR.umd.js +7 -1
  74. package/lib/locale/lang/ru-RU.js +7 -1
  75. package/lib/locale/lang/ru-RU.min.js +1 -1
  76. package/lib/locale/lang/ru-RU.umd.js +7 -1
  77. package/lib/locale/lang/th-TH.js +7 -1
  78. package/lib/locale/lang/th-TH.min.js +1 -1
  79. package/lib/locale/lang/ug-CN.js +7 -1
  80. package/lib/locale/lang/ug-CN.min.js +1 -1
  81. package/lib/locale/lang/uk-UA.js +7 -1
  82. package/lib/locale/lang/uk-UA.min.js +1 -1
  83. package/lib/locale/lang/uk-UA.umd.js +7 -1
  84. package/lib/locale/lang/vi-VN.js +7 -1
  85. package/lib/locale/lang/vi-VN.min.js +1 -1
  86. package/lib/locale/lang/zh-CHT.js +7 -1
  87. package/lib/locale/lang/zh-CHT.min.js +1 -1
  88. package/lib/locale/lang/zh-CHT.umd.js +7 -1
  89. package/lib/locale/lang/zh-CN.js +7 -1
  90. package/lib/locale/lang/zh-CN.min.js +1 -1
  91. package/lib/locale/lang/zh-CN.umd.js +7 -1
  92. package/lib/style.css +1 -1
  93. package/lib/table/module/filter/panel.js +8 -2
  94. package/lib/table/module/filter/panel.min.js +1 -1
  95. package/lib/table/module/keyboard/mixin.js +89 -25
  96. package/lib/table/module/keyboard/mixin.min.js +1 -1
  97. package/lib/table/render/index.js +99 -64
  98. package/lib/table/render/index.min.js +1 -1
  99. package/lib/table/src/body.js +11 -6
  100. package/lib/table/src/body.min.js +1 -1
  101. package/lib/table/src/cell.js +15 -8
  102. package/lib/table/src/cell.min.js +1 -1
  103. package/lib/table/src/footer.js +9 -3
  104. package/lib/table/src/footer.min.js +1 -1
  105. package/lib/table/src/header.js +2 -1
  106. package/lib/table/src/header.min.js +1 -1
  107. package/lib/table/src/methods.js +491 -252
  108. package/lib/table/src/methods.min.js +1 -1
  109. package/lib/table/src/props.js +4 -0
  110. package/lib/table/src/props.min.js +1 -1
  111. package/lib/table/src/table.js +28 -6
  112. package/lib/table/src/table.min.js +1 -1
  113. package/lib/table/src/util.js +72 -7
  114. package/lib/table/src/util.min.js +1 -1
  115. package/lib/ui/index.js +1 -1
  116. package/lib/ui/index.min.js +1 -1
  117. package/lib/ui/src/log.js +1 -1
  118. package/lib/ui/src/log.min.js +1 -1
  119. package/package.json +2 -2
  120. package/packages/grid/src/grid.ts +92 -57
  121. package/packages/locale/lang/ar-EG.ts +7 -1
  122. package/packages/locale/lang/de-DE.ts +7 -1
  123. package/packages/locale/lang/en-US.ts +7 -1
  124. package/packages/locale/lang/es-ES.ts +7 -1
  125. package/packages/locale/lang/fr-FR.ts +7 -1
  126. package/packages/locale/lang/hu-HU.ts +7 -1
  127. package/packages/locale/lang/hy-AM.ts +7 -1
  128. package/packages/locale/lang/id-ID.ts +7 -1
  129. package/packages/locale/lang/it-IT.ts +7 -1
  130. package/packages/locale/lang/ja-JP.ts +7 -1
  131. package/packages/locale/lang/ko-KR.ts +7 -1
  132. package/packages/locale/lang/nb-NO.ts +7 -1
  133. package/packages/locale/lang/pt-BR.ts +7 -1
  134. package/packages/locale/lang/ru-RU.ts +7 -1
  135. package/packages/locale/lang/th-TH.ts +7 -1
  136. package/packages/locale/lang/ug-CN.ts +7 -1
  137. package/packages/locale/lang/uk-UA.ts +7 -1
  138. package/packages/locale/lang/vi-VN.ts +7 -1
  139. package/packages/locale/lang/zh-CHT.ts +7 -1
  140. package/packages/locale/lang/zh-CN.ts +7 -1
  141. package/packages/table/module/filter/panel.ts +12 -2
  142. package/packages/table/module/keyboard/mixin.ts +94 -27
  143. package/packages/table/render/index.ts +89 -57
  144. package/packages/table/src/body.ts +11 -6
  145. package/packages/table/src/cell.ts +10 -9
  146. package/packages/table/src/footer.ts +9 -4
  147. package/packages/table/src/header.ts +2 -2
  148. package/packages/table/src/methods.ts +486 -249
  149. package/packages/table/src/props.ts +16 -12
  150. package/packages/table/src/table.ts +36 -6
  151. package/packages/table/src/util.ts +73 -7
  152. /package/es/{iconfont.1741079977180.ttf → iconfont.1742353673989.ttf} +0 -0
  153. /package/es/{iconfont.1741079977180.woff → iconfont.1742353673989.woff} +0 -0
  154. /package/es/{iconfont.1741079977180.woff2 → iconfont.1742353673989.woff2} +0 -0
  155. /package/lib/{iconfont.1741079977180.ttf → iconfont.1742353673989.ttf} +0 -0
  156. /package/lib/{iconfont.1741079977180.woff → iconfont.1742353673989.woff} +0 -0
  157. /package/lib/{iconfont.1741079977180.woff2 → iconfont.1742353673989.woff2} +0 -0
@@ -99,13 +99,22 @@ export default {
99
99
  methods: {
100
100
  // 处理 Tab 键移动
101
101
  moveTabSelected(args, isLeft, evnt) {
102
- const { afterFullData, visibleColumn, editConfig, editOpts } = this;
102
+ const $xeTable = this;
103
+ const props = $xeTable;
104
+ const internalData = $xeTable;
105
+ const { editConfig } = props;
106
+ const { afterFullData, visibleColumn } = internalData;
107
+ const editOpts = $xeTable.computeEditOpts;
108
+ const rowOpts = $xeTable.computeRowOpts;
109
+ const currentRowOpts = $xeTable.computeCurrentRowOpts;
110
+ const columnOpts = $xeTable.computeColumnOpts;
111
+ const currentColumnOpts = $xeTable.computeCurrentColumnOpts;
103
112
  let targetRow;
104
113
  let targetRowIndex;
105
114
  let targetColumnIndex;
106
115
  const params = Object.assign({}, args);
107
- const _rowIndex = this.getVTRowIndex(params.row);
108
- const _columnIndex = this.getVTColumnIndex(params.column);
116
+ const _rowIndex = $xeTable.getVTRowIndex(params.row);
117
+ const _columnIndex = $xeTable.getVTColumnIndex(params.column);
109
118
  evnt.preventDefault();
110
119
  if (isLeft) {
111
120
  // 向左
@@ -145,30 +154,46 @@ export default {
145
154
  }
146
155
  params.columnIndex = targetColumnIndex;
147
156
  params.column = targetColumn;
148
- params.cell = this.getCellElement(params.row, params.column);
157
+ params.cell = $xeTable.getCellElement(params.row, params.column);
158
+ if (rowOpts.isCurrent && currentRowOpts.isFollowSelected) {
159
+ $xeTable.triggerCurrentRowEvent(evnt, params);
160
+ }
161
+ if (columnOpts.isCurrent && currentColumnOpts.isFollowSelected) {
162
+ $xeTable.triggerCurrentColumnEvent(evnt, params);
163
+ }
149
164
  if (editConfig) {
150
165
  if (editOpts.trigger === 'click' || editOpts.trigger === 'dblclick') {
151
166
  if (editOpts.mode === 'row') {
152
- this.handleEdit(params, evnt);
167
+ $xeTable.handleEdit(params, evnt);
153
168
  }
154
169
  else {
155
- this.scrollToRow(params.row, params.column)
156
- .then(() => this.handleSelected(params, evnt));
170
+ $xeTable.scrollToRow(params.row, params.column)
171
+ .then(() => {
172
+ $xeTable.handleSelected(params, evnt);
173
+ });
157
174
  }
158
175
  }
159
176
  }
160
177
  else {
161
- this.scrollToRow(params.row, params.column)
162
- .then(() => this.handleSelected(params, evnt));
178
+ $xeTable.scrollToRow(params.row, params.column)
179
+ .then(() => {
180
+ $xeTable.handleSelected(params, evnt);
181
+ });
163
182
  }
164
183
  }
165
184
  },
166
185
  // 处理当前行方向键移动
167
186
  moveCurrentRow(isUpArrow, isDwArrow, evnt) {
168
- const { currentRow, treeConfig, treeOpts, afterFullData } = this;
187
+ const $xeTable = this;
188
+ const props = $xeTable;
189
+ const reactData = $xeTable;
190
+ const internalData = $xeTable;
191
+ const { treeConfig } = props;
192
+ const { currentRow } = reactData;
193
+ const { afterFullData } = internalData;
194
+ const treeOpts = $xeTable.computeTreeOpts;
169
195
  const childrenField = treeOpts.children || treeOpts.childrenField;
170
196
  let targetRow;
171
- evnt.preventDefault();
172
197
  if (currentRow) {
173
198
  if (treeConfig) {
174
199
  const { index, items } = XEUtils.findTree(afterFullData, item => item === currentRow, { children: childrenField });
@@ -180,7 +205,7 @@ export default {
180
205
  }
181
206
  }
182
207
  else {
183
- const _rowIndex = this.getVTRowIndex(currentRow);
208
+ const _rowIndex = $xeTable.getVTRowIndex(currentRow);
184
209
  if (isUpArrow && _rowIndex > 0) {
185
210
  targetRow = afterFullData[_rowIndex - 1];
186
211
  }
@@ -193,17 +218,57 @@ export default {
193
218
  targetRow = afterFullData[0];
194
219
  }
195
220
  if (targetRow) {
196
- const params = { $table: this, row: targetRow };
197
- this.scrollToRow(targetRow)
198
- .then(() => this.triggerCurrentRowEvent(evnt, params));
221
+ evnt.preventDefault();
222
+ const params = {
223
+ $table: $xeTable,
224
+ row: targetRow,
225
+ rowIndex: $xeTable.getRowIndex(targetRow),
226
+ $rowIndex: $xeTable.getVMRowIndex(targetRow)
227
+ };
228
+ $xeTable.scrollToRow(targetRow)
229
+ .then(() => $xeTable.triggerCurrentRowEvent(evnt, params));
230
+ }
231
+ },
232
+ // 处理当前列方向键移动
233
+ moveCurrentColumn(isLeftArrow, isRightArrow, evnt) {
234
+ const $xeTable = this;
235
+ const reactData = $xeTable;
236
+ const internalData = $xeTable;
237
+ const { currentColumn } = reactData;
238
+ const { visibleColumn } = internalData;
239
+ let targetCol = null;
240
+ if (currentColumn) {
241
+ const _columnIndex = $xeTable.getVTColumnIndex(currentColumn);
242
+ if (isLeftArrow && _columnIndex > 0) {
243
+ targetCol = visibleColumn[_columnIndex - 1];
244
+ }
245
+ else if (isRightArrow && _columnIndex < visibleColumn.length - 1) {
246
+ targetCol = visibleColumn[_columnIndex + 1];
247
+ }
248
+ }
249
+ else {
250
+ targetCol = visibleColumn[0];
251
+ }
252
+ if (targetCol) {
253
+ evnt.preventDefault();
254
+ const params = {
255
+ $table: $xeTable,
256
+ column: targetCol,
257
+ columnIndex: $xeTable.getColumnIndex(targetCol),
258
+ $columnIndex: $xeTable.getVMColumnIndex(targetCol)
259
+ };
260
+ $xeTable.scrollToColumn(targetCol)
261
+ .then(() => $xeTable.triggerCurrentColumnEvent(evnt, params));
199
262
  }
200
263
  },
201
264
  // 处理可编辑方向键移动
202
265
  moveSelected(args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt) {
203
- const { afterFullData, visibleColumn } = this;
266
+ const $xeTable = this;
267
+ const internalData = $xeTable;
268
+ const { afterFullData, visibleColumn } = internalData;
204
269
  const params = Object.assign({}, args);
205
- const _rowIndex = this.getVTRowIndex(params.row);
206
- const _columnIndex = this.getVTColumnIndex(params.column);
270
+ const _rowIndex = $xeTable.getVTRowIndex(params.row);
271
+ const _columnIndex = $xeTable.getVTColumnIndex(params.column);
207
272
  evnt.preventDefault();
208
273
  if (isUpArrow && _rowIndex > 0) {
209
274
  // 移动到上一行
@@ -225,9 +290,9 @@ export default {
225
290
  params.columnIndex = _columnIndex + 1;
226
291
  params.column = visibleColumn[params.columnIndex];
227
292
  }
228
- this.scrollToRow(params.row, params.column).then(() => {
229
- params.cell = this.getCellElement(params.row, params.column);
230
- this.handleSelected(params, evnt);
293
+ $xeTable.scrollToRow(params.row, params.column).then(() => {
294
+ params.cell = $xeTable.getCellElement(params.row, params.column);
295
+ $xeTable.handleSelected(params, evnt);
231
296
  });
232
297
  },
233
298
  handleCellMousedownEvent(evnt, params) {
@@ -4,7 +4,7 @@ import { getCellValue, setCellValue } from '../src/util';
4
4
  import { getFuncText, formatText, isEmptyValue } from '../../ui/src/utils';
5
5
  import { getOnName, getModelEvent, getChangeEvent } from '../../ui/src/vn';
6
6
  import { errLog } from '../../ui/src/log';
7
- const { getConfig, renderer, getI18n } = VxeUI;
7
+ const { getConfig, renderer, getI18n, getComponent } = VxeUI;
8
8
  const componentDefaultModelProp = 'value';
9
9
  const defaultCompProps = {};
10
10
  function handleDefaultValue(value, defaultVal, initVal) {
@@ -35,7 +35,7 @@ function getOldComponent({ name }) {
35
35
  return getOldComponentName(name);
36
36
  }
37
37
  function getDefaultComponent({ name }) {
38
- return name;
38
+ return getComponent(name) || name;
39
39
  }
40
40
  function handleConfirmFilter(params, checked, option) {
41
41
  const { $panel } = params;
@@ -556,6 +556,63 @@ function handleExportTreeSelectMethod(params) {
556
556
  const { row, column, options } = params;
557
557
  return options.original ? getCellValue(row, column) : getTreeSelectCellValue(column.editRender || column.cellRender, params);
558
558
  }
559
+ function handleNumberCell(h, renderOpts, params) {
560
+ const { props = {}, showNegativeStatus } = renderOpts;
561
+ const { row, column } = params;
562
+ const { type } = props;
563
+ let cellValue = XEUtils.get(row, column.field);
564
+ let isNegative = false;
565
+ if (!isEmptyValue(cellValue)) {
566
+ const numberInputConfig = getConfig().numberInput || {};
567
+ if (type === 'float') {
568
+ const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
569
+ const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
570
+ cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
571
+ if (!autoFill) {
572
+ cellValue = XEUtils.toNumber(cellValue);
573
+ }
574
+ if (showNegativeStatus) {
575
+ if (cellValue < 0) {
576
+ isNegative = true;
577
+ }
578
+ }
579
+ }
580
+ else if (type === 'amount') {
581
+ const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
582
+ const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
583
+ const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
584
+ cellValue = XEUtils.toNumber(cellValue);
585
+ if (showNegativeStatus) {
586
+ if (cellValue < 0) {
587
+ isNegative = true;
588
+ }
589
+ }
590
+ cellValue = XEUtils.commafy(cellValue, { digits });
591
+ if (!autoFill) {
592
+ const [iStr, dStr] = cellValue.split('.');
593
+ if (dStr) {
594
+ const dRest = dStr.replace(/0+$/, '');
595
+ cellValue = dRest ? [iStr, '.', dRest].join('') : iStr;
596
+ }
597
+ }
598
+ if (showCurrency) {
599
+ cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`;
600
+ }
601
+ }
602
+ else {
603
+ if (showNegativeStatus) {
604
+ if (XEUtils.toNumber(cellValue) < 0) {
605
+ isNegative = true;
606
+ }
607
+ }
608
+ }
609
+ }
610
+ return getCellLabelVNs(h, renderOpts, params, cellValue, isNegative
611
+ ? {
612
+ class: 'is--negative'
613
+ }
614
+ : {});
615
+ }
559
616
  /**
560
617
  * 表格 - 渲染器
561
618
  */
@@ -620,66 +677,19 @@ renderer.mixin({
620
677
  renderTableFilter: defaultFilterRender,
621
678
  tableFilterDefaultMethod: handleInputFilterMethod
622
679
  },
680
+ FormatNumberInput: {
681
+ renderTableDefault: handleNumberCell,
682
+ tableFilterDefaultMethod: handleInputFilterMethod,
683
+ tableExportMethod(params) {
684
+ const { row, column } = params;
685
+ const cellValue = XEUtils.get(row, column.field);
686
+ return cellValue;
687
+ }
688
+ },
623
689
  VxeNumberInput: {
624
690
  tableAutoFocus: 'input',
625
691
  renderTableEdit: defaultEditRender,
626
- renderTableCell(h, renderOpts, params) {
627
- const { props = {}, showNegativeStatus } = renderOpts;
628
- const { row, column } = params;
629
- const { type } = props;
630
- let cellValue = XEUtils.get(row, column.field);
631
- let isNegative = false;
632
- if (!isEmptyValue(cellValue)) {
633
- const numberInputConfig = getConfig().numberInput || {};
634
- if (type === 'float') {
635
- const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
636
- const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
637
- cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
638
- if (!autoFill) {
639
- cellValue = XEUtils.toNumber(cellValue);
640
- }
641
- if (showNegativeStatus) {
642
- if (cellValue < 0) {
643
- isNegative = true;
644
- }
645
- }
646
- }
647
- else if (type === 'amount') {
648
- const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
649
- const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
650
- const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
651
- cellValue = XEUtils.toNumber(cellValue);
652
- if (showNegativeStatus) {
653
- if (cellValue < 0) {
654
- isNegative = true;
655
- }
656
- }
657
- cellValue = XEUtils.commafy(cellValue, { digits });
658
- if (!autoFill) {
659
- const [iStr, dStr] = cellValue.split('.');
660
- if (dStr) {
661
- const dRest = dStr.replace(/0+$/, '');
662
- cellValue = dRest ? [iStr, '.', dRest].join('') : iStr;
663
- }
664
- }
665
- if (showCurrency) {
666
- cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`;
667
- }
668
- }
669
- else {
670
- if (showNegativeStatus) {
671
- if (XEUtils.toNumber(cellValue) < 0) {
672
- isNegative = true;
673
- }
674
- }
675
- }
676
- }
677
- return getCellLabelVNs(h, renderOpts, params, cellValue, isNegative
678
- ? {
679
- class: 'is--negative'
680
- }
681
- : {});
682
- },
692
+ renderTableCell: handleNumberCell,
683
693
  renderTableFooter(h, renderOpts, params) {
684
694
  const { props = {} } = renderOpts;
685
695
  const { row, column, _columnIndex } = params;
@@ -784,11 +794,22 @@ renderer.mixin({
784
794
  tableFilterDefaultMethod: handleFilterMethod,
785
795
  tableExportMethod: handleExportSelectMethod
786
796
  },
797
+ /**
798
+ * 已废弃,被 FormatSelect 替换
799
+ * @deprecated
800
+ */
787
801
  formatOption: {
788
802
  renderTableDefault(h, renderOpts, params) {
789
803
  return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
790
804
  }
791
805
  },
806
+ FormatSelect: {
807
+ renderTableDefault(h, renderOpts, params) {
808
+ return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
809
+ },
810
+ tableFilterDefaultMethod: handleFilterMethod,
811
+ tableExportMethod: handleExportSelectMethod
812
+ },
792
813
  VxeTreeSelect: {
793
814
  tableAutoFocus: 'input',
794
815
  renderTableEdit: defaultTableOrTreeSelectEditRender,
@@ -805,11 +826,21 @@ renderer.mixin({
805
826
  },
806
827
  tableExportMethod: handleExportTreeSelectMethod
807
828
  },
829
+ /**
830
+ * 已废弃,被 FormatTreeSelect 替换
831
+ * @deprecated
832
+ */
808
833
  formatTree: {
809
834
  renderTableDefault(h, renderOpts, params) {
810
835
  return getCellLabelVNs(h, renderOpts, params, getTreeSelectCellValue(renderOpts, params));
811
836
  }
812
837
  },
838
+ FormatTreeSelect: {
839
+ renderTableDefault(h, renderOpts, params) {
840
+ return getCellLabelVNs(h, renderOpts, params, getTreeSelectCellValue(renderOpts, params));
841
+ },
842
+ tableExportMethod: handleExportTreeSelectMethod
843
+ },
813
844
  VxeColorPicker: {
814
845
  tableAutoFocus: 'input',
815
846
  renderTableEdit(h, renderOpts, params) {
@@ -189,6 +189,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
189
189
  tdOns.dblclick = (evnt) => {
190
190
  $xeTable.triggerCellDblclickEvent(evnt, cellParams);
191
191
  };
192
+ let isMergeCell = false;
192
193
  // 合并行或列
193
194
  if (mergeList.length) {
194
195
  const spanRest = mergeBodyMethod(mergeList, _rowIndex, _columnIndex);
@@ -198,9 +199,11 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
198
199
  return null;
199
200
  }
200
201
  if (rowspan > 1) {
202
+ isMergeCell = true;
201
203
  tdAttrs.rowspan = rowspan;
202
204
  }
203
205
  if (colspan > 1) {
206
+ isMergeCell = true;
204
207
  tdAttrs.colspan = colspan;
205
208
  }
206
209
  }
@@ -233,12 +236,14 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
233
236
  const isLastColumn = $columnIndex === columns.length - 1;
234
237
  const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
235
238
  let isVNPreEmptyStatus = false;
236
- if (!dragRow || getRowid($xeTable, dragRow) !== rowid) {
237
- if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
238
- isVNPreEmptyStatus = true;
239
- }
240
- else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
241
- isVNPreEmptyStatus = true;
239
+ if (!isMergeCell) {
240
+ if (!dragRow || getRowid($xeTable, dragRow) !== rowid) {
241
+ if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
242
+ isVNPreEmptyStatus = true;
243
+ }
244
+ else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
245
+ isVNPreEmptyStatus = true;
246
+ }
242
247
  }
243
248
  }
244
249
  const tcStyle = {};
@@ -632,7 +637,7 @@ export default {
632
637
  isOptimizeMode = true;
633
638
  }
634
639
  }
635
- if (fixedType || !overflowX) {
640
+ if (!isColLoading && (fixedType || !overflowX)) {
636
641
  renderColumnList = visibleColumn;
637
642
  }
638
643
  if (fixedType) {
@@ -551,7 +551,8 @@ export const Cell = {
551
551
  const headerSlot = slots ? slots.header : null;
552
552
  const titleSlot = slots ? slots.title : null;
553
553
  const checkboxOpts = $table.computeCheckboxOpts;
554
- const headerTitle = column.getTitle();
554
+ const { checkStrictly, showHeader, headerTitle } = checkboxOpts;
555
+ const colTitle = column.getTitle();
555
556
  const ons = {};
556
557
  if (!isHidden) {
557
558
  ons.click = (evnt) => {
@@ -564,11 +565,11 @@ export const Cell = {
564
565
  if (headerSlot) {
565
566
  return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, $table.callSlot(headerSlot, checkboxParams, h)));
566
567
  }
567
- if (checkboxOpts.checkStrictly ? !checkboxOpts.showHeader : checkboxOpts.showHeader === false) {
568
+ if (checkStrictly ? !showHeader : showHeader === false) {
568
569
  return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, [
569
570
  h('span', {
570
571
  class: 'vxe-checkbox--label'
571
- }, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : headerTitle)
572
+ }, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : colTitle)
572
573
  ]));
573
574
  }
574
575
  return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, [
@@ -579,18 +580,18 @@ export const Cell = {
579
580
  'is--indeterminate': isAllCheckboxIndeterminate
580
581
  }],
581
582
  attrs: {
582
- title: getI18n('vxe.table.allTitle')
583
+ title: XEUtils.eqNull(headerTitle) ? getI18n('vxe.table.allTitle') : `${headerTitle || ''}`
583
584
  },
584
585
  on: ons
585
586
  }, [
586
587
  h('span', {
587
588
  class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllCheckboxSelected ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
588
589
  })
589
- ].concat(titleSlot || headerTitle
590
+ ].concat(titleSlot || colTitle
590
591
  ? [
591
592
  h('span', {
592
593
  class: 'vxe-checkbox--label'
593
- }, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : headerTitle)
594
+ }, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : colTitle)
594
595
  ]
595
596
  : []))
596
597
  ]));
@@ -820,7 +821,7 @@ export const Cell = {
820
821
  renderSortIcon(h, params) {
821
822
  const { $table, column } = params;
822
823
  const sortOpts = $table.computeSortOpts;
823
- const { showIcon, allowBtn, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts;
824
+ const { showIcon, allowBtn, ascTitle, descTitle, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts;
824
825
  if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
825
826
  return [
826
827
  h('span', {
@@ -831,7 +832,7 @@ export const Cell = {
831
832
  'sort--active': column.order === 'asc'
832
833
  }],
833
834
  attrs: {
834
- title: getI18n('vxe.table.sortAsc')
835
+ title: XEUtils.eqNull(ascTitle) ? getI18n('vxe.table.sortAsc') : `${ascTitle || ''}`
835
836
  },
836
837
  on: allowBtn
837
838
  ? {
@@ -847,7 +848,7 @@ export const Cell = {
847
848
  'sort--active': column.order === 'desc'
848
849
  }],
849
850
  attrs: {
850
- title: getI18n('vxe.table.sortDesc')
851
+ title: XEUtils.eqNull(descTitle) ? getI18n('vxe.table.sortDesc') : `${descTitle || ''}`
851
852
  },
852
853
  on: allowBtn
853
854
  ? {
@@ -100,6 +100,7 @@ function renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIn
100
100
  tfOns.dblclick = (evnt) => {
101
101
  $xeTable.dispatchEvent('footer-cell-dblclick', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt);
102
102
  };
103
+ let isMergeCell = false;
103
104
  // 合并行或列
104
105
  if (mergeFooterList.length) {
105
106
  const spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
@@ -109,9 +110,11 @@ function renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIn
109
110
  return null;
110
111
  }
111
112
  if (rowspan > 1) {
113
+ isMergeCell = true;
112
114
  attrs.rowspan = rowspan;
113
115
  }
114
116
  if (colspan > 1) {
117
+ isMergeCell = true;
115
118
  attrs.colspan = colspan;
116
119
  }
117
120
  }
@@ -132,8 +135,10 @@ function renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIn
132
135
  const isLastColumn = $columnIndex === tableColumn.length - 1;
133
136
  const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
134
137
  let isVNPreEmptyStatus = false;
135
- if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
136
- isVNPreEmptyStatus = true;
138
+ if (!isMergeCell) {
139
+ if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
140
+ isVNPreEmptyStatus = true;
141
+ }
137
142
  }
138
143
  const tcStyle = {};
139
144
  if (hasEllipsis) {
@@ -288,7 +293,7 @@ export default {
288
293
  const { fixedType, fixedColumn, tableColumn } = props;
289
294
  const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = tableProps;
290
295
  const { visibleColumn, fullColumnIdData } = tableInternalData;
291
- const { isGroup, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData;
296
+ const { isGroup, isColLoading, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData;
292
297
  let renderColumnList = tableColumn;
293
298
  let isOptimizeMode = false;
294
299
  // 如果是使用优化模式
@@ -300,7 +305,7 @@ export default {
300
305
  isOptimizeMode = true;
301
306
  }
302
307
  }
303
- if (fixedType || !overflowX) {
308
+ if (!isColLoading && (fixedType || !overflowX)) {
304
309
  renderColumnList = visibleColumn;
305
310
  }
306
311
  if (fixedType) {
@@ -252,7 +252,7 @@ export default {
252
252
  const { fixedType, fixedColumn, tableColumn } = props;
253
253
  const { headerColumn } = this;
254
254
  const { mouseConfig, showHeaderOverflow: allColumnHeaderOverflow, spanMethod, footerSpanMethod } = tableProps;
255
- const { isGroup, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData;
255
+ const { isGroup, isColLoading, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData;
256
256
  const { visibleColumn, fullColumnIdData } = tableInternalData;
257
257
  const mouseOpts = $xeTable.computeMouseOpts;
258
258
  let renderHeaderList = headerColumn;
@@ -271,7 +271,7 @@ export default {
271
271
  isOptimizeMode = true;
272
272
  }
273
273
  }
274
- if (fixedType || !overflowX) {
274
+ if (!isColLoading && (fixedType || !overflowX)) {
275
275
  renderColumnList = visibleColumn;
276
276
  }
277
277
  if (fixedType) {