vxe-table 3.11.8 → 3.11.10

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 (37) hide show
  1. package/es/style.css +1 -1
  2. package/es/table/module/edit/mixin.js +57 -30
  3. package/es/table/src/body.js +4 -1
  4. package/es/table/src/footer.js +7 -1
  5. package/es/table/src/methods.js +6 -3
  6. package/es/table/src/table.js +0 -1
  7. package/es/ui/index.js +1 -1
  8. package/es/ui/src/log.js +1 -1
  9. package/lib/index.umd.js +114 -50
  10. package/lib/index.umd.min.js +1 -1
  11. package/lib/style.css +1 -1
  12. package/lib/table/module/edit/mixin.js +93 -42
  13. package/lib/table/module/edit/mixin.min.js +1 -1
  14. package/lib/table/src/body.js +4 -1
  15. package/lib/table/src/body.min.js +1 -1
  16. package/lib/table/src/footer.js +7 -1
  17. package/lib/table/src/footer.min.js +1 -1
  18. package/lib/table/src/methods.js +8 -3
  19. package/lib/table/src/methods.min.js +1 -1
  20. package/lib/table/src/table.js +0 -1
  21. package/lib/table/src/table.min.js +1 -1
  22. package/lib/ui/index.js +1 -1
  23. package/lib/ui/index.min.js +1 -1
  24. package/lib/ui/src/log.js +1 -1
  25. package/lib/ui/src/log.min.js +1 -1
  26. package/package.json +2 -2
  27. package/packages/table/module/edit/mixin.ts +61 -31
  28. package/packages/table/src/body.ts +11 -8
  29. package/packages/table/src/footer.ts +10 -4
  30. package/packages/table/src/methods.ts +7 -3
  31. package/packages/table/src/table.ts +0 -1
  32. /package/es/{iconfont.1732522562273.ttf → iconfont.1732698735693.ttf} +0 -0
  33. /package/es/{iconfont.1732522562273.woff → iconfont.1732698735693.woff} +0 -0
  34. /package/es/{iconfont.1732522562273.woff2 → iconfont.1732698735693.woff2} +0 -0
  35. /package/lib/{iconfont.1732522562273.ttf → iconfont.1732698735693.ttf} +0 -0
  36. /package/lib/{iconfont.1732522562273.woff → iconfont.1732698735693.woff} +0 -0
  37. /package/lib/{iconfont.1732522562273.woff2 → iconfont.1732698735693.woff2} +0 -0
@@ -298,7 +298,13 @@ export default {
298
298
  const { tableHeader, tableBody, tableFooter } = $xeTable.$refs;
299
299
  const headerElem = tableHeader ? tableHeader.$el : null;
300
300
  const footerElem = tableFooter ? tableFooter.$el : null;
301
- const bodyElem = tableBody.$el;
301
+ if (!footerElem) {
302
+ return;
303
+ }
304
+ const bodyElem = tableBody ? tableBody.$el : null;
305
+ if (!bodyElem) {
306
+ return;
307
+ }
302
308
  const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
303
309
  const scrollLeft = footerElem.scrollLeft;
304
310
  const isRollX = true;
@@ -676,7 +676,6 @@ const Methods = {
676
676
  scrollYStore.endIndex = 1;
677
677
  scrollXStore.startIndex = 0;
678
678
  scrollXStore.endIndex = 1;
679
- editStore.insertList = [];
680
679
  editStore.insertMaps = {};
681
680
  editStore.removeList = [];
682
681
  editStore.removeMaps = {};
@@ -1532,14 +1531,18 @@ const Methods = {
1532
1531
  isInsertByRow(row) {
1533
1532
  const { editStore } = this;
1534
1533
  const rowid = getRowid(this, row);
1535
- return editStore.insertList.length && editStore.insertMaps[rowid];
1534
+ return !!editStore.insertMaps[rowid];
1536
1535
  },
1537
1536
  /**
1538
1537
  * 删除所有新增的临时数据
1539
1538
  * @returns
1540
1539
  */
1541
1540
  removeInsertRow() {
1542
- return this.remove(this.editStore.insertList);
1541
+ const $xeTable = this;
1542
+ const reactData = $xeTable;
1543
+ const { editStore } = reactData;
1544
+ editStore.insertMaps = {};
1545
+ return $xeTable.remove($xeTable.getInsertRecords());
1543
1546
  },
1544
1547
  /**
1545
1548
  * 检查行或列数据是否发生改变
@@ -327,7 +327,6 @@ export default {
327
327
  row: null,
328
328
  column: null
329
329
  },
330
- insertList: [],
331
330
  insertMaps: {},
332
331
  removeList: [],
333
332
  removeMaps: {}
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.11.8";
3
+ export const version = "3.11.10";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
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.11.8"}`;
3
+ const version = `table v${"3.11.10"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
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.8";
2223
+ const version = "3.11.10";
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.8"}`;
2777
+ const log_version = `table v${"3.11.10"}`;
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
@@ -5631,7 +5631,6 @@ const Methods = {
5631
5631
  scrollYStore.endIndex = 1;
5632
5632
  scrollXStore.startIndex = 0;
5633
5633
  scrollXStore.endIndex = 1;
5634
- editStore.insertList = [];
5635
5634
  editStore.insertMaps = {};
5636
5635
  editStore.removeList = [];
5637
5636
  editStore.removeMaps = {};
@@ -6609,14 +6608,20 @@ const Methods = {
6609
6608
  editStore
6610
6609
  } = this;
6611
6610
  const rowid = getRowid(this, row);
6612
- return editStore.insertList.length && editStore.insertMaps[rowid];
6611
+ return !!editStore.insertMaps[rowid];
6613
6612
  },
6614
6613
  /**
6615
6614
  * 删除所有新增的临时数据
6616
6615
  * @returns
6617
6616
  */
6618
6617
  removeInsertRow() {
6619
- return this.remove(this.editStore.insertList);
6618
+ const $xeTable = this;
6619
+ const reactData = $xeTable;
6620
+ const {
6621
+ editStore
6622
+ } = reactData;
6623
+ editStore.insertMaps = {};
6624
+ return $xeTable.remove($xeTable.getInsertRecords());
6620
6625
  },
6621
6626
  /**
6622
6627
  * 检查行或列数据是否发生改变
@@ -13702,7 +13707,10 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
13702
13707
  const scrollBodyElem = this.$el;
13703
13708
  const headerElem = tableHeader ? tableHeader.$el : null;
13704
13709
  const footerElem = tableFooter ? tableFooter.$el : null;
13705
- const bodyElem = tableBody.$el;
13710
+ const bodyElem = tableBody ? tableBody.$el : null;
13711
+ if (!bodyElem) {
13712
+ return;
13713
+ }
13706
13714
  const leftElem = leftBody ? leftBody.$el : null;
13707
13715
  const rightElem = rightBody ? rightBody.$el : null;
13708
13716
  const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
@@ -14663,7 +14671,13 @@ function footer_renderHeads(h, _vm, footerTableData) {
14663
14671
  } = $xeTable.$refs;
14664
14672
  const headerElem = tableHeader ? tableHeader.$el : null;
14665
14673
  const footerElem = tableFooter ? tableFooter.$el : null;
14666
- const bodyElem = tableBody.$el;
14674
+ if (!footerElem) {
14675
+ return;
14676
+ }
14677
+ const bodyElem = tableBody ? tableBody.$el : null;
14678
+ if (!bodyElem) {
14679
+ return;
14680
+ }
14667
14681
  const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
14668
14682
  const scrollLeft = footerElem.scrollLeft;
14669
14683
  const isRollX = true;
@@ -17748,17 +17762,25 @@ function insertTreeRow(_vm, newRecords, isAppend) {
17748
17762
  });
17749
17763
  }
17750
17764
  function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
17765
+ const $xeTable = _vm;
17766
+ const props = $xeTable;
17767
+ const reactData = $xeTable;
17768
+ const internalData = $xeTable;
17769
+ const {
17770
+ treeConfig
17771
+ } = props;
17751
17772
  const {
17752
- tableFullTreeData,
17753
17773
  mergeList,
17774
+ editStore
17775
+ } = reactData;
17776
+ const {
17777
+ tableFullTreeData,
17754
17778
  afterFullData,
17755
- editStore,
17756
17779
  tableFullData,
17757
- treeConfig,
17758
17780
  fullDataRowIdData,
17759
- fullAllDataRowIdData,
17760
- treeOpts
17761
- } = _vm;
17781
+ fullAllDataRowIdData
17782
+ } = internalData;
17783
+ const treeOpts = $xeTable.computeTreeOpts;
17762
17784
  const {
17763
17785
  transform,
17764
17786
  rowField,
@@ -17777,8 +17799,25 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
17777
17799
  if (treeConfig && transform) {
17778
17800
  insertTreeRow(_vm, newRecords, false);
17779
17801
  } else {
17780
- afterFullData.unshift(...newRecords);
17781
- tableFullData.unshift(...newRecords);
17802
+ newRecords.forEach(item => {
17803
+ const rowid = getRowid($xeTable, item);
17804
+ const rest = {
17805
+ row: item,
17806
+ rowid,
17807
+ seq: -1,
17808
+ index: -1,
17809
+ _index: -1,
17810
+ $index: -1,
17811
+ items: afterFullData,
17812
+ parent: null,
17813
+ level: 0,
17814
+ height: 0
17815
+ };
17816
+ fullDataRowIdData[rowid] = rest;
17817
+ fullAllDataRowIdData[rowid] = rest;
17818
+ afterFullData.push(item);
17819
+ tableFullData.push(item);
17820
+ });
17782
17821
  // 刷新单元格合并
17783
17822
  mergeList.forEach(mergeItem => {
17784
17823
  const {
@@ -17795,8 +17834,25 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
17795
17834
  if (treeConfig && transform) {
17796
17835
  insertTreeRow(_vm, newRecords, true);
17797
17836
  } else {
17798
- afterFullData.push(...newRecords);
17799
- tableFullData.push(...newRecords);
17837
+ newRecords.forEach(item => {
17838
+ const rowid = getRowid($xeTable, item);
17839
+ const rest = {
17840
+ row: item,
17841
+ rowid,
17842
+ seq: -1,
17843
+ index: -1,
17844
+ _index: -1,
17845
+ $index: -1,
17846
+ items: afterFullData,
17847
+ parent: null,
17848
+ level: 0,
17849
+ height: 0
17850
+ };
17851
+ fullDataRowIdData[rowid] = rest;
17852
+ fullAllDataRowIdData[rowid] = rest;
17853
+ afterFullData.push(item);
17854
+ tableFullData.push(item);
17855
+ });
17800
17856
  // 刷新单元格合并
17801
17857
  mergeList.forEach(mergeItem => {
17802
17858
  const {
@@ -17911,14 +17967,12 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
17911
17967
  }
17912
17968
  }
17913
17969
  const {
17914
- insertList,
17915
17970
  insertMaps
17916
17971
  } = editStore;
17917
17972
  newRecords.forEach(newRow => {
17918
- const rowid = getRowid(_vm, newRow);
17973
+ const rowid = getRowid($xeTable, newRow);
17919
17974
  insertMaps[rowid] = newRow;
17920
17975
  });
17921
- insertList.unshift(...newRecords);
17922
17976
  _vm.cacheRowMap();
17923
17977
  _vm.updateScrollYStatus();
17924
17978
  _vm.handleTableData(treeConfig && transform);
@@ -17972,18 +18026,25 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
17972
18026
  * 如果为空则删除所有
17973
18027
  */
17974
18028
  _remove(rows) {
18029
+ const $xeTable = this;
18030
+ const props = $xeTable;
18031
+ const reactData = $xeTable;
18032
+ const internalData = $xeTable;
18033
+ const {
18034
+ treeConfig
18035
+ } = props;
17975
18036
  const {
17976
- afterFullData,
17977
- tableFullData,
17978
- tableFullTreeData,
17979
- treeConfig,
17980
18037
  mergeList,
17981
18038
  editStore,
17982
- checkboxOpts,
17983
- selectCheckboxMaps,
17984
- isInsertByRow,
17985
- treeOpts
17986
- } = this;
18039
+ selectCheckboxMaps
18040
+ } = reactData;
18041
+ const {
18042
+ tableFullTreeData,
18043
+ afterFullData,
18044
+ tableFullData
18045
+ } = internalData;
18046
+ const checkboxOpts = $xeTable.computeCheckboxOpts;
18047
+ const treeOpts = $xeTable.computeTreeOpts;
17987
18048
  const {
17988
18049
  transform,
17989
18050
  mapChildrenField
@@ -17992,7 +18053,6 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
17992
18053
  const {
17993
18054
  actived,
17994
18055
  removeList,
17995
- insertList,
17996
18056
  insertMaps
17997
18057
  } = editStore;
17998
18058
  const {
@@ -18006,7 +18066,7 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
18006
18066
  }
18007
18067
  // 如果是新增,则保存记录
18008
18068
  rows.forEach(row => {
18009
- if (!isInsertByRow(row)) {
18069
+ if (!$xeTable.isInsertByRow(row)) {
18010
18070
  removeList.push(row);
18011
18071
  }
18012
18072
  });
@@ -18079,27 +18139,25 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
18079
18139
  }
18080
18140
  }
18081
18141
  // 如果当前行被激活编辑,则清除激活状态
18082
- if (actived.row && this.findRowIndexOf(rows, actived.row) > -1) {
18083
- this.clearEdit();
18142
+ if (actived.row && $xeTable.findRowIndexOf(rows, actived.row) > -1) {
18143
+ $xeTable.clearEdit();
18084
18144
  }
18085
18145
  // 从新增中移除已删除的数据
18086
18146
  rows.forEach(row => {
18087
- const rowid = getRowid(this, row);
18088
- const iIndex = this.findRowIndexOf(insertList, row);
18089
- if (iIndex > -1) {
18090
- insertList.splice(iIndex, 1);
18147
+ const rowid = getRowid($xeTable, row);
18148
+ if (insertMaps[rowid]) {
18149
+ delete insertMaps[rowid];
18091
18150
  }
18092
- delete insertMaps[rowid];
18093
18151
  });
18094
- this.handleTableData(treeConfig && transform);
18152
+ $xeTable.updateFooter();
18153
+ $xeTable.cacheRowMap();
18154
+ $xeTable.handleTableData(treeConfig && transform);
18095
18155
  if (!(treeConfig && transform)) {
18096
- this.updateAfterDataIndex();
18156
+ $xeTable.updateAfterDataIndex();
18097
18157
  }
18098
- this.updateFooter();
18099
- this.cacheRowMap();
18100
- this.checkSelectionStatus();
18101
- if (this.scrollYLoad) {
18102
- this.updateScrollYSpace();
18158
+ $xeTable.checkSelectionStatus();
18159
+ if (reactData.scrollYLoad) {
18160
+ $xeTable.updateScrollYSpace();
18103
18161
  }
18104
18162
  return this.$nextTick().then(() => {
18105
18163
  this.updateCellAreas();
@@ -18162,13 +18220,20 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
18162
18220
  * 获取新增的临时数据
18163
18221
  */
18164
18222
  _getInsertRecords() {
18223
+ const $xeTable = this;
18224
+ const reactData = $xeTable;
18225
+ const internalData = $xeTable;
18226
+ const {
18227
+ editStore
18228
+ } = reactData;
18165
18229
  const {
18166
18230
  fullAllDataRowIdData
18167
- } = this;
18168
- const insertList = this.editStore.insertList;
18231
+ } = internalData;
18232
+ const {
18233
+ insertMaps
18234
+ } = editStore;
18169
18235
  const insertRecords = [];
18170
- insertList.forEach(row => {
18171
- const rowid = getRowid(this, row);
18236
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(insertMaps, (row, rowid) => {
18172
18237
  if (fullAllDataRowIdData[rowid]) {
18173
18238
  insertRecords.push(row);
18174
18239
  }
@@ -22170,7 +22235,6 @@ function handleUupdateResize(_vm) {
22170
22235
  row: null,
22171
22236
  column: null
22172
22237
  },
22173
- insertList: [],
22174
22238
  insertMaps: {},
22175
22239
  removeList: [],
22176
22240
  removeMaps: {}