vxe-table 3.15.36 → 3.15.38

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 (34) hide show
  1. package/es/style.css +1 -1
  2. package/es/table/module/edit/mixin.js +2 -2
  3. package/es/table/module/keyboard/mixin.js +4 -1
  4. package/es/table/src/methods.js +41 -16
  5. package/es/toolbar/src/toolbar.js +0 -6
  6. package/es/ui/index.js +2 -1
  7. package/es/ui/src/log.js +1 -1
  8. package/lib/index.umd.js +51 -26
  9. package/lib/index.umd.min.js +1 -1
  10. package/lib/style.css +1 -1
  11. package/lib/table/module/edit/mixin.js +2 -2
  12. package/lib/table/module/edit/mixin.min.js +1 -1
  13. package/lib/table/module/keyboard/mixin.js +2 -2
  14. package/lib/table/module/keyboard/mixin.min.js +1 -1
  15. package/lib/table/src/methods.js +44 -16
  16. package/lib/table/src/methods.min.js +1 -1
  17. package/lib/toolbar/src/toolbar.js +0 -4
  18. package/lib/toolbar/src/toolbar.min.js +1 -1
  19. package/lib/ui/index.js +2 -1
  20. package/lib/ui/index.min.js +1 -1
  21. package/lib/ui/src/log.js +1 -1
  22. package/lib/ui/src/log.min.js +1 -1
  23. package/package.json +1 -1
  24. package/packages/table/module/edit/mixin.ts +2 -2
  25. package/packages/table/module/keyboard/mixin.ts +4 -1
  26. package/packages/table/src/methods.ts +42 -15
  27. package/packages/toolbar/src/toolbar.ts +0 -4
  28. package/packages/ui/index.ts +1 -0
  29. /package/es/{iconfont.1749440099787.ttf → iconfont.1749796837661.ttf} +0 -0
  30. /package/es/{iconfont.1749440099787.woff → iconfont.1749796837661.woff} +0 -0
  31. /package/es/{iconfont.1749440099787.woff2 → iconfont.1749796837661.woff2} +0 -0
  32. /package/lib/{iconfont.1749440099787.ttf → iconfont.1749796837661.ttf} +0 -0
  33. /package/lib/{iconfont.1749440099787.woff → iconfont.1749796837661.woff} +0 -0
  34. /package/lib/{iconfont.1749440099787.woff2 → iconfont.1749796837661.woff2} +0 -0
@@ -305,7 +305,17 @@ function cacheColumnMap($xeTable) {
305
305
  reactData.expandColumn = expandColumn;
306
306
  reactData.isAllOverflow = isAllOverflow;
307
307
  }
308
- const updateScrollYStatus = ($xeTable, fullData) => {
308
+ function updateScrollXStatus($xeTable, fullColumn) {
309
+ const reactData = $xeTable;
310
+ const internalData = $xeTable;
311
+ const virtualXOpts = $xeTable.computeVirtualXOpts;
312
+ const allCols = fullColumn || internalData.tableFullColumn;
313
+ // 如果gt为0,则总是启用
314
+ const scrollXLoad = !!virtualXOpts.enabled && virtualXOpts.gt > -1 && (virtualXOpts.gt === 0 || virtualXOpts.gt < allCols.length);
315
+ reactData.scrollXLoad = scrollXLoad;
316
+ return scrollXLoad;
317
+ }
318
+ function updateScrollYStatus($xeTable, fullData) {
309
319
  const props = $xeTable;
310
320
  const reactData = $xeTable;
311
321
  const internalData = $xeTable;
@@ -318,7 +328,7 @@ const updateScrollYStatus = ($xeTable, fullData) => {
318
328
  const scrollYLoad = (transform || !treeConfig) && !!virtualYOpts.enabled && virtualYOpts.gt > -1 && (virtualYOpts.gt === 0 || virtualYOpts.gt < allList.length);
319
329
  reactData.scrollYLoad = scrollYLoad;
320
330
  return scrollYLoad;
321
- };
331
+ }
322
332
  /**
323
333
  * 展开与收起树节点
324
334
  * @param rows
@@ -2992,7 +3002,6 @@ function parseColumns($xeTable, isReset) {
2992
3002
  const centerList = [];
2993
3003
  const rightList = [];
2994
3004
  const { isGroup, columnStore } = reactData;
2995
- const virtualXOpts = $xeTable.computeVirtualXOpts;
2996
3005
  const { collectColumn, tableFullColumn, scrollXStore, fullColumnIdData } = internalData;
2997
3006
  // 如果是分组表头,如果子列全部被隐藏,则根列也隐藏
2998
3007
  if (isGroup) {
@@ -3055,11 +3064,12 @@ function parseColumns($xeTable, isReset) {
3055
3064
  });
3056
3065
  }
3057
3066
  const visibleColumn = leftList.concat(centerList).concat(rightList);
3058
- // 如果gt为0,则总是启用
3059
- const scrollXLoad = !!virtualXOpts.enabled && virtualXOpts.gt > -1 && (virtualXOpts.gt === 0 || virtualXOpts.gt < tableFullColumn.length);
3067
+ internalData.visibleColumn = visibleColumn;
3068
+ updateColumnOffsetLeft($xeTable);
3069
+ const sXLoad = updateScrollXStatus($xeTable);
3060
3070
  reactData.hasFixedColumn = leftList.length > 0 || rightList.length > 0;
3061
3071
  Object.assign(columnStore, { leftList, centerList, rightList });
3062
- if (scrollXLoad) {
3072
+ if (sXLoad) {
3063
3073
  // if (showOverflow) {
3064
3074
  // if (!rowOpts.height) {
3065
3075
  // const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false)
@@ -3095,7 +3105,6 @@ function parseColumns($xeTable, isReset) {
3095
3105
  $xeTable.clearMergeCells();
3096
3106
  $xeTable.clearMergeFooterItems();
3097
3107
  }
3098
- reactData.scrollXLoad = scrollXLoad;
3099
3108
  visibleColumn.forEach((column, index) => {
3100
3109
  const colid = column.id;
3101
3110
  const colRest = fullColumnIdData[colid];
@@ -3103,7 +3112,6 @@ function parseColumns($xeTable, isReset) {
3103
3112
  colRest._index = index;
3104
3113
  }
3105
3114
  });
3106
- internalData.visibleColumn = visibleColumn;
3107
3115
  handleTableColumn($xeTable);
3108
3116
  if (isReset) {
3109
3117
  return $xeTable.updateFooter().then(() => {
@@ -3758,8 +3766,23 @@ const Methods = {
3758
3766
  */
3759
3767
  loadColumn(columns) {
3760
3768
  const $xeTable = this;
3769
+ const internalData = $xeTable;
3770
+ const { lastScrollLeft, lastScrollTop } = internalData;
3761
3771
  const collectColumn = XEUtils.mapTree(columns, column => Cell.createColumn($xeTable, column), { children: 'children' });
3762
- return handleColumn($xeTable, collectColumn);
3772
+ return handleColumn($xeTable, collectColumn).then(() => {
3773
+ let targetScrollLeft = lastScrollLeft;
3774
+ let targetScrollTop = lastScrollTop;
3775
+ const virtualXOpts = $xeTable.computeVirtualXOpts;
3776
+ const virtualYOpts = $xeTable.computeVirtualYOpts;
3777
+ // 是否在更新数据之后自动滚动重置滚动条
3778
+ if (virtualXOpts.scrollToLeftOnChange) {
3779
+ targetScrollLeft = 0;
3780
+ }
3781
+ if (virtualYOpts.scrollToTopOnChange) {
3782
+ targetScrollTop = 0;
3783
+ }
3784
+ restoreScrollLocation($xeTable, targetScrollLeft, targetScrollTop);
3785
+ });
3763
3786
  },
3764
3787
  /**
3765
3788
  * 加载列配置并恢复到初始状态
@@ -5551,7 +5574,7 @@ const Methods = {
5551
5574
  return new Promise(resolve => {
5552
5575
  // 还原滚动条位置
5553
5576
  if (lastScrollLeft || lastScrollTop) {
5554
- return restoreScrollLocation($xeTable, lastScrollLeft, lastScrollTop).then().then(() => {
5577
+ return restoreScrollLocation($xeTable, lastScrollLeft, lastScrollTop).then(() => {
5555
5578
  // 存在滚动行为未结束情况
5556
5579
  setTimeout(resolve, 10);
5557
5580
  });
@@ -9930,7 +9953,9 @@ const Methods = {
9930
9953
  }, 30);
9931
9954
  });
9932
9955
  }
9933
- return $xeTable.$nextTick();
9956
+ return $xeTable.$nextTick().then(() => {
9957
+ internalData.intoRunScroll = false;
9958
+ });
9934
9959
  },
9935
9960
  /**
9936
9961
  * 如果有滚动条,则滚动到对应的行
@@ -10265,19 +10290,19 @@ funcs.forEach(name => {
10265
10290
  Methods[name] = function (...args) {
10266
10291
  if (!this[`_${name}`]) {
10267
10292
  if ('openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',').includes(name)) {
10268
- errLog('vxe.error.reqModule', ['VxeTableExportModule']);
10293
+ errLog('vxe.error.reqModule', ['Export']);
10269
10294
  }
10270
10295
  else if ('fullValidate,validate'.split(',').includes(name)) {
10271
- errLog('vxe.error.reqModule', ['VxeTableValidatorModule']);
10296
+ errLog('vxe.error.reqModule', ['Validator']);
10272
10297
  }
10273
10298
  else if ('setFilter,openFilter,clearFilter,getCheckedFilters'.split(',').includes(name)) {
10274
- errLog('vxe.error.reqModule', ['VxeTableFilterModule']);
10299
+ errLog('vxe.error.reqModule', ['Filter']);
10275
10300
  }
10276
10301
  else if ('insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell'.split(',').includes(name)) {
10277
- errLog('vxe.error.reqModule', ['VxeTableEditModule']);
10302
+ errLog('vxe.error.reqModule', ['Edit']);
10278
10303
  }
10279
10304
  else if ('openCustom'.split(',').includes(name)) {
10280
- errLog('vxe.error.reqModule', ['VxeTableCustomModule']);
10305
+ errLog('vxe.error.reqModule', ['Custom']);
10281
10306
  }
10282
10307
  }
10283
10308
  return this[`_${name}`] ? this[`_${name}`](...args) : null;
@@ -144,9 +144,6 @@ export default {
144
144
  if ($table.triggerCustomEvent) {
145
145
  $table.triggerCustomEvent($event);
146
146
  }
147
- else {
148
- errLog('vxe.error.reqModule', ['VxeTableCustomModule']);
149
- }
150
147
  }
151
148
  },
152
149
  handleMouseenterSettingEvent({ $event }) {
@@ -157,9 +154,6 @@ export default {
157
154
  if ($table) {
158
155
  $table.customOpenEvent($event);
159
156
  }
160
- else {
161
- errLog('vxe.error.reqModule', ['VxeTableCustomModule']);
162
- }
163
157
  },
164
158
  handleMouseleaveSettingEvent({ $event }) {
165
159
  const $xeToolbar = this;
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "3.15.36";
3
+ export const version = "3.15.38";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
@@ -178,6 +178,7 @@ VxeUI.setConfig({
178
178
  extension: true
179
179
  },
180
180
  keyboardConfig: {
181
+ isAll: true,
181
182
  isEsc: true
182
183
  },
183
184
  areaConfig: {
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"3.15.36"}`;
3
+ const version = `table v${"3.15.38"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -2002,7 +2002,7 @@ function getClass(property, params) {
2002
2002
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2003
2003
 
2004
2004
 
2005
- const version = "3.15.36";
2005
+ const version = "3.15.38";
2006
2006
  core_.VxeUI.version = version;
2007
2007
  core_.VxeUI.tableVersion = version;
2008
2008
  core_.VxeUI.setConfig({
@@ -2180,6 +2180,7 @@ core_.VxeUI.setConfig({
2180
2180
  extension: true
2181
2181
  },
2182
2182
  keyboardConfig: {
2183
+ isAll: true,
2183
2184
  isEsc: true
2184
2185
  },
2185
2186
  areaConfig: {
@@ -2646,7 +2647,7 @@ function isNodeElement(elem) {
2646
2647
  const {
2647
2648
  log: log_log
2648
2649
  } = core_.VxeUI;
2649
- const log_version = `table v${"3.15.36"}`;
2650
+ const log_version = `table v${"3.15.38"}`;
2650
2651
  const warnLog = log_log.create('warn', log_version);
2651
2652
  const errLog = log_log.create('error', log_version);
2652
2653
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -5497,7 +5498,17 @@ function cacheColumnMap($xeTable) {
5497
5498
  reactData.expandColumn = expandColumn;
5498
5499
  reactData.isAllOverflow = isAllOverflow;
5499
5500
  }
5500
- const updateScrollYStatus = ($xeTable, fullData) => {
5501
+ function updateScrollXStatus($xeTable, fullColumn) {
5502
+ const reactData = $xeTable;
5503
+ const internalData = $xeTable;
5504
+ const virtualXOpts = $xeTable.computeVirtualXOpts;
5505
+ const allCols = fullColumn || internalData.tableFullColumn;
5506
+ // 如果gt为0,则总是启用
5507
+ const scrollXLoad = !!virtualXOpts.enabled && virtualXOpts.gt > -1 && (virtualXOpts.gt === 0 || virtualXOpts.gt < allCols.length);
5508
+ reactData.scrollXLoad = scrollXLoad;
5509
+ return scrollXLoad;
5510
+ }
5511
+ function updateScrollYStatus($xeTable, fullData) {
5501
5512
  const props = $xeTable;
5502
5513
  const reactData = $xeTable;
5503
5514
  const internalData = $xeTable;
@@ -5514,7 +5525,7 @@ const updateScrollYStatus = ($xeTable, fullData) => {
5514
5525
  const scrollYLoad = (transform || !treeConfig) && !!virtualYOpts.enabled && virtualYOpts.gt > -1 && (virtualYOpts.gt === 0 || virtualYOpts.gt < allList.length);
5515
5526
  reactData.scrollYLoad = scrollYLoad;
5516
5527
  return scrollYLoad;
5517
- };
5528
+ }
5518
5529
  /**
5519
5530
  * 展开与收起树节点
5520
5531
  * @param rows
@@ -8692,7 +8703,6 @@ function parseColumns($xeTable, isReset) {
8692
8703
  isGroup,
8693
8704
  columnStore
8694
8705
  } = reactData;
8695
- const virtualXOpts = $xeTable.computeVirtualXOpts;
8696
8706
  const {
8697
8707
  collectColumn,
8698
8708
  tableFullColumn,
@@ -8752,15 +8762,16 @@ function parseColumns($xeTable, isReset) {
8752
8762
  });
8753
8763
  }
8754
8764
  const visibleColumn = leftList.concat(centerList).concat(rightList);
8755
- // 如果gt为0,则总是启用
8756
- const scrollXLoad = !!virtualXOpts.enabled && virtualXOpts.gt > -1 && (virtualXOpts.gt === 0 || virtualXOpts.gt < tableFullColumn.length);
8765
+ internalData.visibleColumn = visibleColumn;
8766
+ updateColumnOffsetLeft($xeTable);
8767
+ const sXLoad = updateScrollXStatus($xeTable);
8757
8768
  reactData.hasFixedColumn = leftList.length > 0 || rightList.length > 0;
8758
8769
  Object.assign(columnStore, {
8759
8770
  leftList,
8760
8771
  centerList,
8761
8772
  rightList
8762
8773
  });
8763
- if (scrollXLoad) {
8774
+ if (sXLoad) {
8764
8775
  // if (showOverflow) {
8765
8776
  // if (!rowOpts.height) {
8766
8777
  // const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false)
@@ -8798,7 +8809,6 @@ function parseColumns($xeTable, isReset) {
8798
8809
  $xeTable.clearMergeCells();
8799
8810
  $xeTable.clearMergeFooterItems();
8800
8811
  }
8801
- reactData.scrollXLoad = scrollXLoad;
8802
8812
  visibleColumn.forEach((column, index) => {
8803
8813
  const colid = column.id;
8804
8814
  const colRest = fullColumnIdData[colid];
@@ -8806,7 +8816,6 @@ function parseColumns($xeTable, isReset) {
8806
8816
  colRest._index = index;
8807
8817
  }
8808
8818
  });
8809
- internalData.visibleColumn = visibleColumn;
8810
8819
  handleTableColumn($xeTable);
8811
8820
  if (isReset) {
8812
8821
  return $xeTable.updateFooter().then(() => {
@@ -9539,10 +9548,28 @@ const Methods = {
9539
9548
  */
9540
9549
  loadColumn(columns) {
9541
9550
  const $xeTable = this;
9551
+ const internalData = $xeTable;
9552
+ const {
9553
+ lastScrollLeft,
9554
+ lastScrollTop
9555
+ } = internalData;
9542
9556
  const collectColumn = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().mapTree(columns, column => cell.createColumn($xeTable, column), {
9543
9557
  children: 'children'
9544
9558
  });
9545
- return handleColumn($xeTable, collectColumn);
9559
+ return handleColumn($xeTable, collectColumn).then(() => {
9560
+ let targetScrollLeft = lastScrollLeft;
9561
+ let targetScrollTop = lastScrollTop;
9562
+ const virtualXOpts = $xeTable.computeVirtualXOpts;
9563
+ const virtualYOpts = $xeTable.computeVirtualYOpts;
9564
+ // 是否在更新数据之后自动滚动重置滚动条
9565
+ if (virtualXOpts.scrollToLeftOnChange) {
9566
+ targetScrollLeft = 0;
9567
+ }
9568
+ if (virtualYOpts.scrollToTopOnChange) {
9569
+ targetScrollTop = 0;
9570
+ }
9571
+ restoreScrollLocation($xeTable, targetScrollLeft, targetScrollTop);
9572
+ });
9546
9573
  },
9547
9574
  /**
9548
9575
  * 加载列配置并恢复到初始状态
@@ -11620,7 +11647,7 @@ const Methods = {
11620
11647
  return new Promise(resolve => {
11621
11648
  // 还原滚动条位置
11622
11649
  if (lastScrollLeft || lastScrollTop) {
11623
- return restoreScrollLocation($xeTable, lastScrollLeft, lastScrollTop).then().then(() => {
11650
+ return restoreScrollLocation($xeTable, lastScrollLeft, lastScrollTop).then(() => {
11624
11651
  // 存在滚动行为未结束情况
11625
11652
  setTimeout(resolve, 10);
11626
11653
  });
@@ -16747,7 +16774,9 @@ const Methods = {
16747
16774
  }, 30);
16748
16775
  });
16749
16776
  }
16750
- return $xeTable.$nextTick();
16777
+ return $xeTable.$nextTick().then(() => {
16778
+ internalData.intoRunScroll = false;
16779
+ });
16751
16780
  },
16752
16781
  /**
16753
16782
  * 如果有滚动条,则滚动到对应的行
@@ -17120,15 +17149,15 @@ funcs.forEach(name => {
17120
17149
  Methods[name] = function (...args) {
17121
17150
  if (!this[`_${name}`]) {
17122
17151
  if ('openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',').includes(name)) {
17123
- errLog('vxe.error.reqModule', ['VxeTableExportModule']);
17152
+ errLog('vxe.error.reqModule', ['Export']);
17124
17153
  } else if ('fullValidate,validate'.split(',').includes(name)) {
17125
- errLog('vxe.error.reqModule', ['VxeTableValidatorModule']);
17154
+ errLog('vxe.error.reqModule', ['Validator']);
17126
17155
  } else if ('setFilter,openFilter,clearFilter,getCheckedFilters'.split(',').includes(name)) {
17127
- errLog('vxe.error.reqModule', ['VxeTableFilterModule']);
17156
+ errLog('vxe.error.reqModule', ['Filter']);
17128
17157
  } else if ('insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell'.split(',').includes(name)) {
17129
- errLog('vxe.error.reqModule', ['VxeTableEditModule']);
17158
+ errLog('vxe.error.reqModule', ['Edit']);
17130
17159
  } else if ('openCustom'.split(',').includes(name)) {
17131
- errLog('vxe.error.reqModule', ['VxeTableCustomModule']);
17160
+ errLog('vxe.error.reqModule', ['Custom']);
17132
17161
  }
17133
17162
  }
17134
17163
  return this[`_${name}`] ? this[`_${name}`](...args) : null;
@@ -22804,7 +22833,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
22804
22833
  }
22805
22834
  return $xeTable.$nextTick().then(() => {
22806
22835
  $xeTable.updateCellAreas();
22807
- return $xeTable.recalculate();
22836
+ return $xeTable.recalculate(true);
22808
22837
  }).then(() => {
22809
22838
  return {
22810
22839
  row: newRecords.length ? newRecords[newRecords.length - 1] : null,
@@ -23222,7 +23251,7 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
23222
23251
  }
23223
23252
  return this.$nextTick().then(() => {
23224
23253
  this.updateCellAreas();
23225
- return this.recalculate();
23254
+ return this.recalculate(true);
23226
23255
  }).then(() => {
23227
23256
  return {
23228
23257
  row: delList.length ? delList[delList.length - 1] : null,
@@ -25951,8 +25980,8 @@ function handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRigh
25951
25980
  let mouseScrollSpaceSize = 1;
25952
25981
  const triggerEvent = (type, evnt) => {
25953
25982
  this.emitEvent(`checkbox-range-${type}`, {
25954
- records: this.getCheckboxRecords(),
25955
- reserves: this.getCheckboxReserveRecords()
25983
+ records: () => this.getCheckboxRecords(),
25984
+ reserves: () => this.getCheckboxReserveRecords()
25956
25985
  }, evnt);
25957
25986
  };
25958
25987
  const handleChecked = evnt => {
@@ -29461,8 +29490,6 @@ const {
29461
29490
  if ($table) {
29462
29491
  if ($table.triggerCustomEvent) {
29463
29492
  $table.triggerCustomEvent($event);
29464
- } else {
29465
- errLog('vxe.error.reqModule', ['VxeTableCustomModule']);
29466
29493
  }
29467
29494
  }
29468
29495
  },
@@ -29477,8 +29504,6 @@ const {
29477
29504
  const $table = connectTable;
29478
29505
  if ($table) {
29479
29506
  $table.customOpenEvent($event);
29480
- } else {
29481
- errLog('vxe.error.reqModule', ['VxeTableCustomModule']);
29482
29507
  }
29483
29508
  },
29484
29509
  handleMouseleaveSettingEvent({