vxe-table 3.11.9 → 3.11.12

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 (56) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/table/module/edit/mixin.js +57 -30
  6. package/es/table/module/export/import-panel.js +3 -3
  7. package/es/table/src/body.js +12 -12
  8. package/es/table/src/columnInfo.js +3 -1
  9. package/es/table/src/methods.js +17 -7
  10. package/es/table/src/table.js +0 -1
  11. package/es/table/style.css +1 -1
  12. package/es/table/style.min.css +1 -1
  13. package/es/ui/index.js +1 -1
  14. package/es/ui/src/log.js +1 -1
  15. package/es/vxe-table/style.css +1 -1
  16. package/es/vxe-table/style.min.css +1 -1
  17. package/lib/index.css +1 -1
  18. package/lib/index.min.css +1 -1
  19. package/lib/index.umd.js +134 -66
  20. package/lib/index.umd.min.js +1 -1
  21. package/lib/style.css +1 -1
  22. package/lib/style.min.css +1 -1
  23. package/lib/table/module/edit/mixin.js +93 -42
  24. package/lib/table/module/edit/mixin.min.js +1 -1
  25. package/lib/table/module/export/import-panel.js +3 -2
  26. package/lib/table/module/export/import-panel.min.js +1 -1
  27. package/lib/table/src/body.js +12 -12
  28. package/lib/table/src/body.min.js +1 -1
  29. package/lib/table/src/columnInfo.js +5 -1
  30. package/lib/table/src/columnInfo.min.js +1 -1
  31. package/lib/table/src/methods.js +19 -6
  32. package/lib/table/src/methods.min.js +1 -1
  33. package/lib/table/src/table.js +0 -1
  34. package/lib/table/src/table.min.js +1 -1
  35. package/lib/table/style/style.css +1 -1
  36. package/lib/table/style/style.min.css +1 -1
  37. package/lib/ui/index.js +1 -1
  38. package/lib/ui/index.min.js +1 -1
  39. package/lib/ui/src/log.js +1 -1
  40. package/lib/ui/src/log.min.js +1 -1
  41. package/lib/vxe-table/style/style.css +1 -1
  42. package/lib/vxe-table/style/style.min.css +1 -1
  43. package/package.json +2 -2
  44. package/packages/table/module/edit/mixin.ts +61 -31
  45. package/packages/table/module/export/import-panel.ts +3 -3
  46. package/packages/table/src/body.ts +12 -12
  47. package/packages/table/src/columnInfo.ts +3 -1
  48. package/packages/table/src/methods.ts +20 -7
  49. package/packages/table/src/table.ts +0 -1
  50. package/styles/components/table.scss +1 -1
  51. /package/es/{iconfont.1732607941851.ttf → iconfont.1732797517080.ttf} +0 -0
  52. /package/es/{iconfont.1732607941851.woff → iconfont.1732797517080.woff} +0 -0
  53. /package/es/{iconfont.1732607941851.woff2 → iconfont.1732797517080.woff2} +0 -0
  54. /package/lib/{iconfont.1732607941851.ttf → iconfont.1732797517080.ttf} +0 -0
  55. /package/lib/{iconfont.1732607941851.woff → iconfont.1732797517080.woff} +0 -0
  56. /package/lib/{iconfont.1732607941851.woff2 → iconfont.1732797517080.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
2220
2220
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2221
2221
 
2222
2222
 
2223
- const version = "3.11.9";
2223
+ const version = "3.11.12";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2774,7 +2774,7 @@ function isNodeElement(elem) {
2774
2774
  const {
2775
2775
  log: log_log
2776
2776
  } = core_.VxeUI;
2777
- const log_version = `table v${"3.11.9"}`;
2777
+ const log_version = `table v${"3.11.12"}`;
2778
2778
  const warnLog = log_log.create('warn', log_version);
2779
2779
  const errLog = log_log.create('error', log_version);
2780
2780
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -2799,6 +2799,7 @@ class ColumnInfo {
2799
2799
  const proxyOpts = $xegrid ? $xegrid.proxyOpts : null;
2800
2800
  const formatter = _vm.formatter;
2801
2801
  const visible = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(_vm.visible) ? _vm.visible : true;
2802
+ const tableProps = $xetable;
2802
2803
  if (true) {
2803
2804
  const types = ['seq', 'checkbox', 'radio', 'expand', 'html'];
2804
2805
  if (_vm.type && types.indexOf(_vm.type) === -1) {
@@ -2814,7 +2815,10 @@ class ColumnInfo {
2814
2815
  warnLog('vxe.error.errConflicts', ['column.cell-render', 'column.edit-render']);
2815
2816
  }
2816
2817
  if (_vm.type === 'expand') {
2817
- if ($xetable.treeConfig && ($xetable.treeOpts.showLine || $xetable.treeOpts.line)) {
2818
+ const {
2819
+ treeConfig
2820
+ } = tableProps;
2821
+ if (treeConfig && ($xetable.treeOpts.showLine || $xetable.treeOpts.line)) {
2818
2822
  errLog('vxe.error.errConflicts', ['tree-config.line', 'column.type=expand']);
2819
2823
  }
2820
2824
  }
@@ -5577,6 +5581,7 @@ const Methods = {
5577
5581
  loadTableData(datas) {
5578
5582
  const {
5579
5583
  keepSource,
5584
+ showOverflow,
5580
5585
  treeConfig,
5581
5586
  treeOpts,
5582
5587
  editStore,
@@ -5631,7 +5636,6 @@ const Methods = {
5631
5636
  scrollYStore.endIndex = 1;
5632
5637
  scrollXStore.startIndex = 0;
5633
5638
  scrollXStore.endIndex = 1;
5634
- editStore.insertList = [];
5635
5639
  editStore.insertMaps = {};
5636
5640
  editStore.removeList = [];
5637
5641
  editStore.removeMaps = {};
@@ -5649,8 +5653,14 @@ const Methods = {
5649
5653
  if (keepSource) {
5650
5654
  this.cacheSourceMap(fullData);
5651
5655
  }
5652
- if (true) {
5653
- if (sYLoad) {
5656
+ if (sYLoad) {
5657
+ if (showOverflow) {
5658
+ const errColumn = this.tableFullColumn.find(column => column.showOverflow === false);
5659
+ if (errColumn) {
5660
+ errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true']);
5661
+ }
5662
+ }
5663
+ if (true) {
5654
5664
  if (!(this.height || this.maxHeight)) {
5655
5665
  errLog('vxe.error.reqProp', ['table.height | table.max-height | table.scroll-y={enabled: false}']);
5656
5666
  }
@@ -6609,14 +6619,20 @@ const Methods = {
6609
6619
  editStore
6610
6620
  } = this;
6611
6621
  const rowid = getRowid(this, row);
6612
- return editStore.insertList.length && editStore.insertMaps[rowid];
6622
+ return !!editStore.insertMaps[rowid];
6613
6623
  },
6614
6624
  /**
6615
6625
  * 删除所有新增的临时数据
6616
6626
  * @returns
6617
6627
  */
6618
6628
  removeInsertRow() {
6619
- return this.remove(this.editStore.insertList);
6629
+ const $xeTable = this;
6630
+ const reactData = $xeTable;
6631
+ const {
6632
+ editStore
6633
+ } = reactData;
6634
+ editStore.insertMaps = {};
6635
+ return $xeTable.remove($xeTable.getInsertRecords());
6620
6636
  },
6621
6637
  /**
6622
6638
  * 检查行或列数据是否发生改变
@@ -10837,6 +10853,7 @@ const Methods = {
10837
10853
  oldIndex: oafIndex
10838
10854
  }
10839
10855
  }, evnt);
10856
+ $xeTable.saveCustomStore('update:sort');
10840
10857
  }).catch(() => {});
10841
10858
  }
10842
10859
  }
@@ -11569,7 +11586,7 @@ const Methods = {
11569
11586
  const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
11570
11587
  const rowid = getRowid(this, row);
11571
11588
  if (lazy && row[hasChildField] && !treeExpandLazyLoadedMaps[rowid]) {
11572
- this.clearTreeExpandLoaded(row).then(() => {
11589
+ return this.clearTreeExpandLoaded(row).then(() => {
11573
11590
  return this.handleAsyncTreeExpandChilds(row);
11574
11591
  }).then(() => {
11575
11592
  if (transform) {
@@ -13318,18 +13335,6 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
13318
13335
  $xeTable.clearHoverRow();
13319
13336
  };
13320
13337
  }
13321
- // 拖拽行事件
13322
- if (rowOpts.drag) {
13323
- trOn.dragstart = evnt => {
13324
- $xeTable.handleRowDragDragstartEvent(evnt);
13325
- };
13326
- trOn.dragover = evnt => {
13327
- $xeTable.handleRowDragDragoverEvent(evnt);
13328
- };
13329
- trOn.dragend = evnt => {
13330
- $xeTable.handleRowDragDragendEvent(evnt);
13331
- };
13332
- }
13333
13338
  const rowid = getRowid($xeTable, row);
13334
13339
  const rest = fullAllDataRowIdData[rowid];
13335
13340
  const rowLevel = rest ? rest.level : 0;
@@ -13359,6 +13364,18 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
13359
13364
  rowChildren = row[childrenField];
13360
13365
  isExpandTree = rowChildren && rowChildren.length && !!treeExpandedMaps[rowid];
13361
13366
  }
13367
+ // 拖拽行事件
13368
+ if (rowOpts.drag && !rowLevel) {
13369
+ trOn.dragstart = evnt => {
13370
+ $xeTable.handleRowDragDragstartEvent(evnt);
13371
+ };
13372
+ trOn.dragover = evnt => {
13373
+ $xeTable.handleRowDragDragoverEvent(evnt);
13374
+ };
13375
+ trOn.dragend = evnt => {
13376
+ $xeTable.handleRowDragDragendEvent(evnt);
13377
+ };
13378
+ }
13362
13379
  const trClass = ['vxe-body--row', treeConfig ? `row--level-${rowLevel}` : '', {
13363
13380
  'row--stripe': stripe && ($xeTable.getVTRowIndex(row) + 1) % 2 === 0,
13364
13381
  'is--new': isNewRow,
@@ -16192,6 +16209,7 @@ const {
16192
16209
  const $xeTable = this.$xeTable;
16193
16210
  const {
16194
16211
  hasFile,
16212
+ loading,
16195
16213
  parseTypeLabel,
16196
16214
  defaultOptions,
16197
16215
  storeData,
@@ -16218,7 +16236,7 @@ const {
16218
16236
  maskClosable: true,
16219
16237
  showMaximize: true,
16220
16238
  resize: true,
16221
- loading: this.loading
16239
+ loading
16222
16240
  },
16223
16241
  on: {
16224
16242
  input(value) {
@@ -16298,7 +16316,7 @@ const {
16298
16316
  }, import_panel_getI18n('vxe.import.impCancel')), h('vxe-button', {
16299
16317
  props: {
16300
16318
  status: 'primary',
16301
- disabled: !hasFile
16319
+ disabled: !hasFile || loading
16302
16320
  },
16303
16321
  on: {
16304
16322
  click: this.importEvent
@@ -17757,17 +17775,25 @@ function insertTreeRow(_vm, newRecords, isAppend) {
17757
17775
  });
17758
17776
  }
17759
17777
  function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
17778
+ const $xeTable = _vm;
17779
+ const props = $xeTable;
17780
+ const reactData = $xeTable;
17781
+ const internalData = $xeTable;
17782
+ const {
17783
+ treeConfig
17784
+ } = props;
17760
17785
  const {
17761
- tableFullTreeData,
17762
17786
  mergeList,
17787
+ editStore
17788
+ } = reactData;
17789
+ const {
17790
+ tableFullTreeData,
17763
17791
  afterFullData,
17764
- editStore,
17765
17792
  tableFullData,
17766
- treeConfig,
17767
17793
  fullDataRowIdData,
17768
- fullAllDataRowIdData,
17769
- treeOpts
17770
- } = _vm;
17794
+ fullAllDataRowIdData
17795
+ } = internalData;
17796
+ const treeOpts = $xeTable.computeTreeOpts;
17771
17797
  const {
17772
17798
  transform,
17773
17799
  rowField,
@@ -17786,8 +17812,25 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
17786
17812
  if (treeConfig && transform) {
17787
17813
  insertTreeRow(_vm, newRecords, false);
17788
17814
  } else {
17789
- afterFullData.unshift(...newRecords);
17790
- tableFullData.unshift(...newRecords);
17815
+ newRecords.forEach(item => {
17816
+ const rowid = getRowid($xeTable, item);
17817
+ const rest = {
17818
+ row: item,
17819
+ rowid,
17820
+ seq: -1,
17821
+ index: -1,
17822
+ _index: -1,
17823
+ $index: -1,
17824
+ items: afterFullData,
17825
+ parent: null,
17826
+ level: 0,
17827
+ height: 0
17828
+ };
17829
+ fullDataRowIdData[rowid] = rest;
17830
+ fullAllDataRowIdData[rowid] = rest;
17831
+ afterFullData.push(item);
17832
+ tableFullData.push(item);
17833
+ });
17791
17834
  // 刷新单元格合并
17792
17835
  mergeList.forEach(mergeItem => {
17793
17836
  const {
@@ -17804,8 +17847,25 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
17804
17847
  if (treeConfig && transform) {
17805
17848
  insertTreeRow(_vm, newRecords, true);
17806
17849
  } else {
17807
- afterFullData.push(...newRecords);
17808
- tableFullData.push(...newRecords);
17850
+ newRecords.forEach(item => {
17851
+ const rowid = getRowid($xeTable, item);
17852
+ const rest = {
17853
+ row: item,
17854
+ rowid,
17855
+ seq: -1,
17856
+ index: -1,
17857
+ _index: -1,
17858
+ $index: -1,
17859
+ items: afterFullData,
17860
+ parent: null,
17861
+ level: 0,
17862
+ height: 0
17863
+ };
17864
+ fullDataRowIdData[rowid] = rest;
17865
+ fullAllDataRowIdData[rowid] = rest;
17866
+ afterFullData.push(item);
17867
+ tableFullData.push(item);
17868
+ });
17809
17869
  // 刷新单元格合并
17810
17870
  mergeList.forEach(mergeItem => {
17811
17871
  const {
@@ -17920,14 +17980,12 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
17920
17980
  }
17921
17981
  }
17922
17982
  const {
17923
- insertList,
17924
17983
  insertMaps
17925
17984
  } = editStore;
17926
17985
  newRecords.forEach(newRow => {
17927
- const rowid = getRowid(_vm, newRow);
17986
+ const rowid = getRowid($xeTable, newRow);
17928
17987
  insertMaps[rowid] = newRow;
17929
17988
  });
17930
- insertList.unshift(...newRecords);
17931
17989
  _vm.cacheRowMap();
17932
17990
  _vm.updateScrollYStatus();
17933
17991
  _vm.handleTableData(treeConfig && transform);
@@ -17981,18 +18039,25 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
17981
18039
  * 如果为空则删除所有
17982
18040
  */
17983
18041
  _remove(rows) {
18042
+ const $xeTable = this;
18043
+ const props = $xeTable;
18044
+ const reactData = $xeTable;
18045
+ const internalData = $xeTable;
18046
+ const {
18047
+ treeConfig
18048
+ } = props;
17984
18049
  const {
17985
- afterFullData,
17986
- tableFullData,
17987
- tableFullTreeData,
17988
- treeConfig,
17989
18050
  mergeList,
17990
18051
  editStore,
17991
- checkboxOpts,
17992
- selectCheckboxMaps,
17993
- isInsertByRow,
17994
- treeOpts
17995
- } = this;
18052
+ selectCheckboxMaps
18053
+ } = reactData;
18054
+ const {
18055
+ tableFullTreeData,
18056
+ afterFullData,
18057
+ tableFullData
18058
+ } = internalData;
18059
+ const checkboxOpts = $xeTable.computeCheckboxOpts;
18060
+ const treeOpts = $xeTable.computeTreeOpts;
17996
18061
  const {
17997
18062
  transform,
17998
18063
  mapChildrenField
@@ -18001,7 +18066,6 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
18001
18066
  const {
18002
18067
  actived,
18003
18068
  removeList,
18004
- insertList,
18005
18069
  insertMaps
18006
18070
  } = editStore;
18007
18071
  const {
@@ -18015,7 +18079,7 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
18015
18079
  }
18016
18080
  // 如果是新增,则保存记录
18017
18081
  rows.forEach(row => {
18018
- if (!isInsertByRow(row)) {
18082
+ if (!$xeTable.isInsertByRow(row)) {
18019
18083
  removeList.push(row);
18020
18084
  }
18021
18085
  });
@@ -18088,27 +18152,25 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
18088
18152
  }
18089
18153
  }
18090
18154
  // 如果当前行被激活编辑,则清除激活状态
18091
- if (actived.row && this.findRowIndexOf(rows, actived.row) > -1) {
18092
- this.clearEdit();
18155
+ if (actived.row && $xeTable.findRowIndexOf(rows, actived.row) > -1) {
18156
+ $xeTable.clearEdit();
18093
18157
  }
18094
18158
  // 从新增中移除已删除的数据
18095
18159
  rows.forEach(row => {
18096
- const rowid = getRowid(this, row);
18097
- const iIndex = this.findRowIndexOf(insertList, row);
18098
- if (iIndex > -1) {
18099
- insertList.splice(iIndex, 1);
18160
+ const rowid = getRowid($xeTable, row);
18161
+ if (insertMaps[rowid]) {
18162
+ delete insertMaps[rowid];
18100
18163
  }
18101
- delete insertMaps[rowid];
18102
18164
  });
18103
- this.handleTableData(treeConfig && transform);
18165
+ $xeTable.updateFooter();
18166
+ $xeTable.cacheRowMap();
18167
+ $xeTable.handleTableData(treeConfig && transform);
18104
18168
  if (!(treeConfig && transform)) {
18105
- this.updateAfterDataIndex();
18169
+ $xeTable.updateAfterDataIndex();
18106
18170
  }
18107
- this.updateFooter();
18108
- this.cacheRowMap();
18109
- this.checkSelectionStatus();
18110
- if (this.scrollYLoad) {
18111
- this.updateScrollYSpace();
18171
+ $xeTable.checkSelectionStatus();
18172
+ if (reactData.scrollYLoad) {
18173
+ $xeTable.updateScrollYSpace();
18112
18174
  }
18113
18175
  return this.$nextTick().then(() => {
18114
18176
  this.updateCellAreas();
@@ -18171,13 +18233,20 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
18171
18233
  * 获取新增的临时数据
18172
18234
  */
18173
18235
  _getInsertRecords() {
18236
+ const $xeTable = this;
18237
+ const reactData = $xeTable;
18238
+ const internalData = $xeTable;
18239
+ const {
18240
+ editStore
18241
+ } = reactData;
18174
18242
  const {
18175
18243
  fullAllDataRowIdData
18176
- } = this;
18177
- const insertList = this.editStore.insertList;
18244
+ } = internalData;
18245
+ const {
18246
+ insertMaps
18247
+ } = editStore;
18178
18248
  const insertRecords = [];
18179
- insertList.forEach(row => {
18180
- const rowid = getRowid(this, row);
18249
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(insertMaps, (row, rowid) => {
18181
18250
  if (fullAllDataRowIdData[rowid]) {
18182
18251
  insertRecords.push(row);
18183
18252
  }
@@ -22179,7 +22248,6 @@ function handleUupdateResize(_vm) {
22179
22248
  row: null,
22180
22249
  column: null
22181
22250
  },
22182
- insertList: [],
22183
22251
  insertMaps: {},
22184
22252
  removeList: [],
22185
22253
  removeMaps: {}