vxe-table 3.14.0-beta.9 → 3.14.1

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 (209) hide show
  1. package/es/grid/src/grid.js +62 -42
  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/custom/mixin.js +4 -2
  24. package/es/table/module/custom/panel.js +24 -23
  25. package/es/table/module/edit/mixin.js +103 -68
  26. package/es/table/module/export/export-panel.js +5 -4
  27. package/es/table/module/export/import-panel.js +8 -7
  28. package/es/table/module/export/mixin.js +30 -27
  29. package/es/table/module/filter/panel.js +21 -10
  30. package/es/table/module/keyboard/mixin.js +141 -41
  31. package/es/table/module/menu/mixin.js +6 -3
  32. package/es/table/module/menu/panel.js +7 -7
  33. package/es/table/module/validator/mixin.js +2 -5
  34. package/es/table/render/index.js +2 -2
  35. package/es/table/src/body.js +43 -25
  36. package/es/table/src/cell.js +27 -22
  37. package/es/table/src/column.js +11 -9
  38. package/es/table/src/columnInfo.js +6 -6
  39. package/es/table/src/footer.js +12 -7
  40. package/es/table/src/group.js +6 -5
  41. package/es/table/src/header.js +15 -9
  42. package/es/table/src/methods.js +1047 -971
  43. package/es/table/src/props.js +4 -0
  44. package/es/table/src/table.js +100 -64
  45. package/es/table/src/util.js +55 -20
  46. package/es/toolbar/src/toolbar.js +3 -3
  47. package/es/ui/index.js +2 -1
  48. package/es/ui/src/log.js +1 -1
  49. package/helper/vetur/attributes.json +1 -1
  50. package/helper/vetur/tags.json +1 -1
  51. package/lib/grid/src/grid.js +69 -59
  52. package/lib/grid/src/grid.min.js +1 -1
  53. package/lib/index.umd.js +2006 -1686
  54. package/lib/index.umd.min.js +1 -1
  55. package/lib/locale/lang/ar-EG.js +7 -1
  56. package/lib/locale/lang/ar-EG.min.js +1 -1
  57. package/lib/locale/lang/de-DE.js +7 -1
  58. package/lib/locale/lang/de-DE.min.js +1 -1
  59. package/lib/locale/lang/en-US.js +7 -1
  60. package/lib/locale/lang/en-US.min.js +1 -1
  61. package/lib/locale/lang/en-US.umd.js +7 -1
  62. package/lib/locale/lang/es-ES.js +7 -1
  63. package/lib/locale/lang/es-ES.min.js +1 -1
  64. package/lib/locale/lang/es-ES.umd.js +7 -1
  65. package/lib/locale/lang/fr-FR.js +7 -1
  66. package/lib/locale/lang/fr-FR.min.js +1 -1
  67. package/lib/locale/lang/hu-HU.js +7 -1
  68. package/lib/locale/lang/hu-HU.min.js +1 -1
  69. package/lib/locale/lang/hu-HU.umd.js +7 -1
  70. package/lib/locale/lang/hy-AM.js +7 -1
  71. package/lib/locale/lang/hy-AM.min.js +1 -1
  72. package/lib/locale/lang/id-ID.js +7 -1
  73. package/lib/locale/lang/id-ID.min.js +1 -1
  74. package/lib/locale/lang/it-IT.js +7 -1
  75. package/lib/locale/lang/it-IT.min.js +1 -1
  76. package/lib/locale/lang/ja-JP.js +7 -1
  77. package/lib/locale/lang/ja-JP.min.js +1 -1
  78. package/lib/locale/lang/ja-JP.umd.js +7 -1
  79. package/lib/locale/lang/ko-KR.js +7 -1
  80. package/lib/locale/lang/ko-KR.min.js +1 -1
  81. package/lib/locale/lang/ko-KR.umd.js +7 -1
  82. package/lib/locale/lang/nb-NO.js +7 -1
  83. package/lib/locale/lang/nb-NO.min.js +1 -1
  84. package/lib/locale/lang/pt-BR.js +7 -1
  85. package/lib/locale/lang/pt-BR.min.js +1 -1
  86. package/lib/locale/lang/pt-BR.umd.js +7 -1
  87. package/lib/locale/lang/ru-RU.js +7 -1
  88. package/lib/locale/lang/ru-RU.min.js +1 -1
  89. package/lib/locale/lang/ru-RU.umd.js +7 -1
  90. package/lib/locale/lang/th-TH.js +7 -1
  91. package/lib/locale/lang/th-TH.min.js +1 -1
  92. package/lib/locale/lang/ug-CN.js +7 -1
  93. package/lib/locale/lang/ug-CN.min.js +1 -1
  94. package/lib/locale/lang/uk-UA.js +7 -1
  95. package/lib/locale/lang/uk-UA.min.js +1 -1
  96. package/lib/locale/lang/uk-UA.umd.js +7 -1
  97. package/lib/locale/lang/vi-VN.js +7 -1
  98. package/lib/locale/lang/vi-VN.min.js +1 -1
  99. package/lib/locale/lang/zh-CHT.js +7 -1
  100. package/lib/locale/lang/zh-CHT.min.js +1 -1
  101. package/lib/locale/lang/zh-CHT.umd.js +7 -1
  102. package/lib/locale/lang/zh-CN.js +7 -1
  103. package/lib/locale/lang/zh-CN.min.js +1 -1
  104. package/lib/locale/lang/zh-CN.umd.js +7 -1
  105. package/lib/style.css +1 -1
  106. package/lib/table/module/custom/mixin.js +5 -3
  107. package/lib/table/module/custom/mixin.min.js +1 -1
  108. package/lib/table/module/custom/panel.js +22 -29
  109. package/lib/table/module/custom/panel.min.js +1 -1
  110. package/lib/table/module/edit/mixin.js +119 -105
  111. package/lib/table/module/edit/mixin.min.js +1 -1
  112. package/lib/table/module/export/export-panel.js +5 -4
  113. package/lib/table/module/export/export-panel.min.js +1 -1
  114. package/lib/table/module/export/import-panel.js +8 -7
  115. package/lib/table/module/export/import-panel.min.js +1 -1
  116. package/lib/table/module/export/mixin.js +35 -34
  117. package/lib/table/module/export/mixin.min.js +1 -1
  118. package/lib/table/module/filter/panel.js +16 -16
  119. package/lib/table/module/filter/panel.min.js +1 -1
  120. package/lib/table/module/keyboard/mixin.js +149 -47
  121. package/lib/table/module/keyboard/mixin.min.js +1 -1
  122. package/lib/table/module/menu/mixin.js +6 -3
  123. package/lib/table/module/menu/mixin.min.js +1 -1
  124. package/lib/table/module/menu/panel.js +7 -7
  125. package/lib/table/module/menu/panel.min.js +1 -1
  126. package/lib/table/module/validator/mixin.js +4 -10
  127. package/lib/table/module/validator/mixin.min.js +1 -1
  128. package/lib/table/render/index.js +3 -2
  129. package/lib/table/render/index.min.js +1 -1
  130. package/lib/table/src/body.js +51 -25
  131. package/lib/table/src/body.min.js +1 -1
  132. package/lib/table/src/cell.js +39 -23
  133. package/lib/table/src/cell.min.js +1 -1
  134. package/lib/table/src/column.js +11 -9
  135. package/lib/table/src/column.min.js +1 -1
  136. package/lib/table/src/columnInfo.js +6 -6
  137. package/lib/table/src/columnInfo.min.js +1 -1
  138. package/lib/table/src/footer.js +12 -5
  139. package/lib/table/src/footer.min.js +1 -1
  140. package/lib/table/src/group.js +6 -5
  141. package/lib/table/src/group.min.js +1 -1
  142. package/lib/table/src/header.js +16 -8
  143. package/lib/table/src/header.min.js +1 -1
  144. package/lib/table/src/methods.js +1219 -1151
  145. package/lib/table/src/methods.min.js +1 -1
  146. package/lib/table/src/props.js +4 -0
  147. package/lib/table/src/props.min.js +1 -1
  148. package/lib/table/src/table.js +108 -67
  149. package/lib/table/src/table.min.js +1 -1
  150. package/lib/table/src/util.js +62 -21
  151. package/lib/table/src/util.min.js +1 -1
  152. package/lib/toolbar/src/toolbar.js +3 -3
  153. package/lib/ui/index.js +2 -1
  154. package/lib/ui/index.min.js +1 -1
  155. package/lib/ui/src/log.js +1 -1
  156. package/lib/ui/src/log.min.js +1 -1
  157. package/package.json +2 -2
  158. package/packages/grid/src/grid.ts +75 -51
  159. package/packages/locale/lang/ar-EG.ts +7 -1
  160. package/packages/locale/lang/de-DE.ts +7 -1
  161. package/packages/locale/lang/en-US.ts +7 -1
  162. package/packages/locale/lang/es-ES.ts +7 -1
  163. package/packages/locale/lang/fr-FR.ts +7 -1
  164. package/packages/locale/lang/hu-HU.ts +7 -1
  165. package/packages/locale/lang/hy-AM.ts +7 -1
  166. package/packages/locale/lang/id-ID.ts +7 -1
  167. package/packages/locale/lang/it-IT.ts +7 -1
  168. package/packages/locale/lang/ja-JP.ts +7 -1
  169. package/packages/locale/lang/ko-KR.ts +7 -1
  170. package/packages/locale/lang/nb-NO.ts +7 -1
  171. package/packages/locale/lang/pt-BR.ts +7 -1
  172. package/packages/locale/lang/ru-RU.ts +7 -1
  173. package/packages/locale/lang/th-TH.ts +7 -1
  174. package/packages/locale/lang/ug-CN.ts +7 -1
  175. package/packages/locale/lang/uk-UA.ts +7 -1
  176. package/packages/locale/lang/vi-VN.ts +7 -1
  177. package/packages/locale/lang/zh-CHT.ts +7 -1
  178. package/packages/locale/lang/zh-CN.ts +7 -1
  179. package/packages/table/module/custom/mixin.ts +6 -3
  180. package/packages/table/module/custom/panel.ts +42 -37
  181. package/packages/table/module/edit/mixin.ts +139 -95
  182. package/packages/table/module/export/export-panel.ts +8 -5
  183. package/packages/table/module/export/import-panel.ts +11 -7
  184. package/packages/table/module/export/mixin.ts +37 -32
  185. package/packages/table/module/filter/panel.ts +25 -10
  186. package/packages/table/module/keyboard/mixin.ts +155 -49
  187. package/packages/table/module/menu/mixin.ts +12 -6
  188. package/packages/table/module/menu/panel.ts +10 -7
  189. package/packages/table/module/validator/mixin.ts +3 -6
  190. package/packages/table/render/index.ts +2 -2
  191. package/packages/table/src/body.ts +43 -25
  192. package/packages/table/src/cell.ts +27 -22
  193. package/packages/table/src/column.ts +14 -10
  194. package/packages/table/src/columnInfo.ts +9 -6
  195. package/packages/table/src/footer.ts +12 -7
  196. package/packages/table/src/group.ts +9 -5
  197. package/packages/table/src/header.ts +16 -9
  198. package/packages/table/src/methods.ts +1174 -1027
  199. package/packages/table/src/props.ts +16 -12
  200. package/packages/table/src/table.ts +117 -70
  201. package/packages/table/src/util.ts +65 -23
  202. package/packages/toolbar/src/toolbar.ts +3 -3
  203. package/packages/ui/index.ts +1 -0
  204. /package/es/{iconfont.1741336976538.ttf → iconfont.1743045564244.ttf} +0 -0
  205. /package/es/{iconfont.1741336976538.woff → iconfont.1743045564244.woff} +0 -0
  206. /package/es/{iconfont.1741336976538.woff2 → iconfont.1743045564244.woff2} +0 -0
  207. /package/lib/{iconfont.1741336976538.ttf → iconfont.1743045564244.ttf} +0 -0
  208. /package/lib/{iconfont.1741336976538.woff → iconfont.1743045564244.woff} +0 -0
  209. /package/lib/{iconfont.1741336976538.woff2 → iconfont.1743045564244.woff2} +0 -0
@@ -89,6 +89,7 @@ const renderSimplePanel = (h, _vm) => {
89
89
  const props = _vm;
90
90
  const $xeTable = _vm.$xeTable;
91
91
  const reactData = $xeTable;
92
+ const $xeGrid = $xeTable.$xeGrid;
92
93
  const { customStore } = props;
93
94
  const { isCustomStatus, customColumnList } = reactData;
94
95
  const customOpts = $xeTable.computeCustomOpts;
@@ -115,7 +116,7 @@ const renderSimplePanel = (h, _vm) => {
115
116
  }
116
117
  const params = {
117
118
  $table: $xeTable,
118
- $grid: $xeTable.xegrid,
119
+ $grid: $xeGrid,
119
120
  columns: customColumnList,
120
121
  isAllChecked,
121
122
  isAllIndeterminate,
@@ -253,7 +254,7 @@ const renderSimplePanel = (h, _vm) => {
253
254
  class: ['vxe-table-custom-wrapper', `placement--${placement}`, {
254
255
  'is--active': customStore.visible
255
256
  }],
256
- style: maxHeight && !['left', 'right'].includes(placement)
257
+ style: maxHeight && !['left', 'right'].includes(placement || '')
257
258
  ? {
258
259
  maxHeight: `${maxHeight}px`
259
260
  }
@@ -391,6 +392,7 @@ const renderPopupPanel = (h, _vm) => {
391
392
  const $xeTable = _vm.$xeTable;
392
393
  const tableProps = $xeTable;
393
394
  const reactData = $xeTable;
395
+ const $xeGrid = $xeTable.$xeGrid;
394
396
  const { customStore } = props;
395
397
  const { resizable: allResizable } = tableProps;
396
398
  const { isCustomStatus, customColumnList } = reactData;
@@ -417,7 +419,7 @@ const renderPopupPanel = (h, _vm) => {
417
419
  const isAllIndeterminate = customStore.isIndeterminate;
418
420
  const params = {
419
421
  $table: $xeTable,
420
- $grid: $xeTable.xegrid,
422
+ $grid: $xeGrid,
421
423
  columns: customColumnList,
422
424
  isAllChecked,
423
425
  isAllIndeterminate,
@@ -802,9 +804,6 @@ export default {
802
804
  inject: {
803
805
  $xeTable: {
804
806
  default: null
805
- },
806
- $xetable: {
807
- default: null
808
807
  }
809
808
  },
810
809
  data() {
@@ -822,8 +821,8 @@ export default {
822
821
  const VxeUINumberInputComponent = VxeUI.getComponent('VxeNumberInput');
823
822
  const VxeUIRadioGroupComponent = VxeUI.getComponent('VxeRadioGroup');
824
823
  this.$nextTick(() => {
825
- const { $xetable } = this;
826
- const { customOpts } = $xetable;
824
+ const $xeTable = this.$xeTable;
825
+ const { customOpts } = $xeTable;
827
826
  const { mode } = customOpts;
828
827
  if (!VxeUIModalComponent) {
829
828
  errLog('vxe.error.reqComp', ['vxe-modal']);
@@ -852,16 +851,18 @@ export default {
852
851
  },
853
852
  methods: {
854
853
  handleWrapperMouseenterEvent(evnt) {
855
- const { $xetable, customStore } = this;
854
+ const $xeTable = this.$xeTable;
855
+ const { customStore } = this;
856
856
  customStore.activeWrapper = true;
857
- $xetable.customOpenEvent(evnt);
857
+ $xeTable.customOpenEvent(evnt);
858
858
  },
859
859
  handleWrapperMouseleaveEvent(evnt) {
860
- const { $xetable, customStore } = this;
860
+ const $xeTable = this.$xeTable;
861
+ const { customStore } = this;
861
862
  customStore.activeWrapper = false;
862
863
  setTimeout(() => {
863
864
  if (!customStore.activeBtn && !customStore.activeWrapper) {
864
- $xetable.customCloseEvent(evnt);
865
+ $xeTable.customCloseEvent(evnt);
865
866
  }
866
867
  }, 300);
867
868
  },
@@ -888,10 +889,10 @@ export default {
888
889
  $xeTable.emitCustomEvent('cancel', $event);
889
890
  },
890
891
  handleResetCustomEvent(evnt) {
891
- const { $xetable } = this;
892
- $xetable.resetCustom(true);
893
- $xetable.closeCustom();
894
- $xetable.emitCustomEvent('reset', evnt);
892
+ const $xeTable = this.$xeTable;
893
+ $xeTable.resetCustom(true);
894
+ $xeTable.closeCustom();
895
+ $xeTable.emitCustomEvent('reset', evnt);
895
896
  },
896
897
  resetCustomEvent(evnt) {
897
898
  if (VxeUI.modal) {
@@ -964,7 +965,7 @@ export default {
964
965
  $xeTable.checkCustomStatus();
965
966
  },
966
967
  changeColumnWidth(column) {
967
- const $xeTable = this.$xetable;
968
+ const $xeTable = this.$xeTable;
968
969
  const reactData = $xeTable;
969
970
  const customOpts = $xeTable.computeCustomOpts;
970
971
  if (customOpts.immediate) {
@@ -978,7 +979,7 @@ export default {
978
979
  }
979
980
  },
980
981
  changeFixedOption(column, colFixed) {
981
- const $xeTable = this.$xetable;
982
+ const $xeTable = this.$xeTable;
982
983
  const reactData = $xeTable;
983
984
  const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
984
985
  const customOpts = $xeTable.computeCustomOpts;
@@ -1017,11 +1018,11 @@ export default {
1017
1018
  }
1018
1019
  },
1019
1020
  allOptionEvent() {
1020
- const { $xetable } = this;
1021
- $xetable.toggleCustomAllCheckbox();
1021
+ const $xeTable = this.$xeTable;
1022
+ $xeTable.toggleCustomAllCheckbox();
1022
1023
  },
1023
1024
  sortMousedownEvent(evnt) {
1024
- const $xeTable = this.$xetable;
1025
+ const $xeTable = this.$xeTable;
1025
1026
  const btnEl = evnt.currentTarget;
1026
1027
  const cellEl = btnEl.parentElement;
1027
1028
  const tdEl = cellEl.parentElement;
@@ -1048,7 +1049,7 @@ export default {
1048
1049
  }
1049
1050
  },
1050
1051
  sortDragendEvent(evnt) {
1051
- const $xeTable = this.$xetable;
1052
+ const $xeTable = this.$xeTable;
1052
1053
  const tableProps = $xeTable;
1053
1054
  const reactData = $xeTable;
1054
1055
  const internalData = $xeTable;
@@ -1222,7 +1223,7 @@ export default {
1222
1223
  removeClass(trEl, 'active--drag-origin');
1223
1224
  },
1224
1225
  sortDragoverEvent(evnt) {
1225
- const $xeTable = this.$xetable;
1226
+ const $xeTable = this.$xeTable;
1226
1227
  const { dragCol } = this;
1227
1228
  const customOpts = $xeTable.computeCustomOpts;
1228
1229
  const { immediate } = customOpts;
@@ -44,18 +44,20 @@ function syncActivedCell($xeTable) {
44
44
  }
45
45
  }
46
46
  }
47
- function insertTreeRow(_vm, newRecords, isAppend) {
48
- const { tableFullTreeData, afterFullData, fullDataRowIdData, fullAllDataRowIdData, treeOpts } = _vm;
47
+ function insertTreeRow($xeTable, newRecords, isAppend) {
48
+ const internalData = $xeTable;
49
+ const { tableFullTreeData, afterFullData, fullDataRowIdData, fullAllDataRowIdData } = internalData;
50
+ const treeOpts = $xeTable.computeTreeOpts;
49
51
  const { rowField, parentField, mapChildrenField } = treeOpts;
50
52
  const childrenField = treeOpts.children || treeOpts.childrenField;
51
53
  const funcName = isAppend ? 'push' : 'unshift';
52
54
  newRecords.forEach((item) => {
53
55
  const parentRowId = item[parentField];
54
- const rowid = getRowid(_vm, item);
56
+ const rowid = getRowid($xeTable, item);
55
57
  const matchObj = parentRowId ? XEUtils.findTree(tableFullTreeData, (item) => parentRowId === item[rowField], { children: mapChildrenField }) : null;
56
58
  if (matchObj) {
57
59
  const { item: parentRow } = matchObj;
58
- const parentRest = fullAllDataRowIdData[getRowid(_vm, parentRow)];
60
+ const parentRest = fullAllDataRowIdData[getRowid($xeTable, parentRow)];
59
61
  const parentLevel = parentRest ? parentRest.level : 0;
60
62
  let parentChilds = parentRow[childrenField];
61
63
  let mapChilds = parentRow[mapChildrenField];
@@ -90,8 +92,8 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
90
92
  const reactData = $xeTable;
91
93
  const internalData = $xeTable;
92
94
  const { treeConfig } = props;
93
- const { mergeList, editStore } = reactData;
94
- const { tableFullTreeData, afterFullData, tableFullData, fullDataRowIdData, fullAllDataRowIdData } = internalData;
95
+ const { mergeList } = reactData;
96
+ const { tableFullTreeData, afterFullData, tableFullData, fullDataRowIdData, fullAllDataRowIdData, insertRowMaps } = internalData;
95
97
  const treeOpts = $xeTable.computeTreeOpts;
96
98
  const { transform, rowField, mapChildrenField } = treeOpts;
97
99
  const childrenField = treeOpts.children || treeOpts.childrenField;
@@ -238,11 +240,11 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
238
240
  }
239
241
  }
240
242
  }
241
- const { insertMaps } = editStore;
242
243
  newRecords.forEach(newRow => {
243
244
  const rowid = getRowid($xeTable, newRow);
244
- insertMaps[rowid] = newRow;
245
+ insertRowMaps[rowid] = newRow;
245
246
  });
247
+ reactData.insertRowFlag++;
246
248
  $xeTable.cacheRowMap(false);
247
249
  $xeTable.updateScrollYStatus();
248
250
  $xeTable.handleTableData(treeConfig && transform);
@@ -251,7 +253,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
251
253
  }
252
254
  $xeTable.updateFooter();
253
255
  $xeTable.checkSelectionStatus();
254
- if ($xeTable.scrollYLoad) {
256
+ if (reactData.scrollYLoad) {
255
257
  $xeTable.updateScrollYSpace();
256
258
  }
257
259
  return $xeTable.$nextTick().then(() => {
@@ -318,6 +320,7 @@ function handleClearEdit($xeTable, evnt, targetRow) {
318
320
  function handleEditActive($xeTable, params, evnt, isFocus, isPos) {
319
321
  const props = $xeTable;
320
322
  const reactData = $xeTable;
323
+ const $xeGrid = $xeTable.$xeGrid;
321
324
  const { editConfig, mouseConfig } = props;
322
325
  const { editStore, tableColumn } = reactData;
323
326
  const editOpts = $xeTable.computeEditOpts;
@@ -334,7 +337,7 @@ function handleEditActive($xeTable, params, evnt, isFocus, isPos) {
334
337
  if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
335
338
  // 判断是否禁用编辑
336
339
  let type = 'edit-disabled';
337
- if (!beforeEditMethod || beforeEditMethod(Object.assign(Object.assign({}, params), { $table: $xeTable, $grid: $xeTable.xegrid }))) {
340
+ if (!beforeEditMethod || beforeEditMethod(Object.assign(Object.assign({}, params), { $table: $xeTable, $grid: $xeGrid }))) {
338
341
  if (mouseConfig) {
339
342
  $xeTable.clearSelected();
340
343
  if ($xeTable.clearCellAreas) {
@@ -363,7 +366,7 @@ function handleEditActive($xeTable, params, evnt, isFocus, isPos) {
363
366
  $xeTable.handleFocus(params, evnt);
364
367
  }
365
368
  if (afterEditMethod) {
366
- afterEditMethod(Object.assign(Object.assign({}, params), { $table: $xeTable, $grid: $xeTable.xegrid }));
369
+ afterEditMethod(Object.assign(Object.assign({}, params), { $table: $xeTable, $grid: $xeGrid }));
367
370
  }
368
371
  });
369
372
  }
@@ -491,13 +494,13 @@ export default {
491
494
  const reactData = $xeTable;
492
495
  const internalData = $xeTable;
493
496
  const { treeConfig } = props;
494
- const { mergeList, editStore, selectCheckboxMaps } = reactData;
495
- const { tableFullTreeData, afterFullData, tableFullData } = internalData;
497
+ const { mergeList, editStore } = reactData;
498
+ const { tableFullTreeData, selectCheckboxMaps, afterFullData, tableFullData, pendingRowMaps, insertRowMaps, removeRowMaps } = internalData;
496
499
  const checkboxOpts = $xeTable.computeCheckboxOpts;
497
500
  const treeOpts = $xeTable.computeTreeOpts;
498
501
  const { transform, mapChildrenField } = treeOpts;
499
502
  const childrenField = treeOpts.children || treeOpts.childrenField;
500
- const { actived, removeMaps, insertMaps } = editStore;
503
+ const { actived } = editStore;
501
504
  const { checkField } = checkboxOpts;
502
505
  let delList = [];
503
506
  if (!rows) {
@@ -510,19 +513,18 @@ export default {
510
513
  rows.forEach(row => {
511
514
  if (!$xeTable.isInsertByRow(row)) {
512
515
  const rowid = getRowid($xeTable, row);
513
- removeMaps[rowid] = row;
516
+ removeRowMaps[rowid] = row;
514
517
  }
515
518
  });
516
519
  // 如果绑定了多选属性,则更新状态
517
520
  if (!checkField) {
518
- const selectRowMaps = Object.assign({}, selectCheckboxMaps);
519
521
  rows.forEach((row) => {
520
522
  const rowid = getRowid(this, row);
521
- if (selectRowMaps[rowid]) {
522
- delete selectRowMaps[rowid];
523
+ if (selectCheckboxMaps[rowid]) {
524
+ delete selectCheckboxMaps[rowid];
523
525
  }
524
526
  });
525
- this.selectCheckboxMaps = selectRowMaps;
527
+ reactData.updateCheckboxFlag++;
526
528
  }
527
529
  // 从数据源中移除
528
530
  if (tableFullData === rows) {
@@ -582,10 +584,16 @@ export default {
582
584
  // 从新增中移除已删除的数据
583
585
  rows.forEach((row) => {
584
586
  const rowid = getRowid($xeTable, row);
585
- if (insertMaps[rowid]) {
586
- delete insertMaps[rowid];
587
+ if (insertRowMaps[rowid]) {
588
+ delete insertRowMaps[rowid];
589
+ }
590
+ if (pendingRowMaps[rowid]) {
591
+ delete pendingRowMaps[rowid];
587
592
  }
588
593
  });
594
+ reactData.removeRowFlag++;
595
+ reactData.insertRowFlag++;
596
+ reactData.pendingRowFlag++;
589
597
  $xeTable.updateFooter();
590
598
  $xeTable.cacheRowMap(false);
591
599
  $xeTable.handleTableData(treeConfig && transform);
@@ -655,13 +663,10 @@ export default {
655
663
  */
656
664
  _getInsertRecords() {
657
665
  const $xeTable = this;
658
- const reactData = $xeTable;
659
666
  const internalData = $xeTable;
660
- const { editStore } = reactData;
661
- const { fullAllDataRowIdData } = internalData;
662
- const { insertMaps } = editStore;
667
+ const { fullAllDataRowIdData, insertRowMaps } = internalData;
663
668
  const insertRecords = [];
664
- XEUtils.each(insertMaps, (row, rowid) => {
669
+ XEUtils.each(insertRowMaps, (row, rowid) => {
665
670
  if (fullAllDataRowIdData[rowid]) {
666
671
  insertRecords.push(row);
667
672
  }
@@ -673,11 +678,10 @@ export default {
673
678
  */
674
679
  _getRemoveRecords() {
675
680
  const $xeTable = this;
676
- const reactData = $xeTable;
677
- const { editStore } = reactData;
678
- const { removeMaps } = editStore;
681
+ const internalData = $xeTable;
682
+ const { removeRowMaps } = internalData;
679
683
  const removeRecords = [];
680
- XEUtils.each(removeMaps, (row) => {
684
+ XEUtils.each(removeRowMaps, (row) => {
681
685
  removeRecords.push(row);
682
686
  });
683
687
  return removeRecords;
@@ -689,17 +693,17 @@ export default {
689
693
  */
690
694
  _getUpdateRecords() {
691
695
  const $xeTable = this;
692
- const { keepSource, tableFullData, isUpdateByRow, treeConfig, treeOpts, editStore } = this;
696
+ const props = $xeTable;
697
+ const internalData = $xeTable;
698
+ const { keepSource, treeConfig } = props;
699
+ const { tableFullData } = internalData;
700
+ const treeOpts = $xeTable.computeTreeOpts;
693
701
  if (keepSource) {
694
- const { actived } = editStore;
695
- const { row, column } = actived;
696
- if (row || column) {
697
- syncActivedCell($xeTable);
698
- }
702
+ syncActivedCell($xeTable);
699
703
  if (treeConfig) {
700
- return XEUtils.filterTree(tableFullData, row => isUpdateByRow(row), treeOpts);
704
+ return XEUtils.filterTree(tableFullData, row => $xeTable.isUpdateByRow(row), treeOpts);
701
705
  }
702
- return tableFullData.filter((row) => isUpdateByRow(row));
706
+ return tableFullData.filter((row) => $xeTable.isUpdateByRow(row));
703
707
  }
704
708
  return [];
705
709
  },
@@ -748,42 +752,52 @@ export default {
748
752
  return handleClearEdit($xeTable, evnt, targetRow);
749
753
  },
750
754
  _getActiveRecord() {
755
+ const $xeTable = this;
751
756
  if (process.env.NODE_ENV === 'development') {
752
757
  warnLog('vxe.error.delFunc', ['getActiveRecord', 'getEditRecord']);
753
758
  }
754
759
  // 即将废弃
755
- return this.getEditRecord();
760
+ return $xeTable.getEditRecord();
756
761
  },
757
762
  _getEditRecord() {
758
- const { $el, editStore, afterFullData } = this;
759
- const { actived } = editStore;
760
- const { args, row } = actived;
761
- if (args && this.findRowIndexOf(afterFullData, row) > -1 && $el.querySelectorAll('.vxe-body--column.col--active').length) {
763
+ const $xeTable = this;
764
+ const reactData = $xeTable;
765
+ const internalData = $xeTable;
766
+ const { editStore } = reactData;
767
+ const { afterFullData } = internalData;
768
+ const el = $xeTable.$refs.refElem;
769
+ const { args, row } = editStore.actived;
770
+ if (args && $xeTable.findRowIndexOf(afterFullData, row) > -1 && el.querySelectorAll('.vxe-body--column.col--active').length) {
762
771
  return Object.assign({}, args);
763
772
  }
764
773
  return null;
765
774
  },
766
775
  _isActiveByRow(row) {
776
+ const $xeTable = this;
767
777
  if (process.env.NODE_ENV === 'development') {
768
778
  warnLog('vxe.error.delFunc', ['isActiveByRow', 'isEditByRow']);
769
779
  }
770
780
  // 即将废弃
771
- return this.isEditByRow(row);
781
+ return $xeTable.isEditByRow(row);
772
782
  },
773
783
  /**
774
784
  * 判断行是否为激活编辑状态
775
785
  * @param {Row} row 行对象
776
786
  */
777
787
  _isEditByRow(row) {
778
- return this.editStore.actived.row === row;
788
+ const $xeTable = this;
789
+ const reactData = $xeTable;
790
+ const { editStore } = reactData;
791
+ return editStore.actived.row === row;
779
792
  },
780
793
  /**
781
794
  * 处理聚焦
782
795
  */
783
796
  handleFocus(params) {
784
- const { editOpts } = this;
797
+ const $xeTable = this;
785
798
  const { row, column, cell } = params;
786
799
  const { editRender } = column;
800
+ const editOpts = $xeTable.computeEditOpts;
787
801
  if (isEnableConf(editRender)) {
788
802
  const compRender = renderer.get(editRender.name);
789
803
  let autoFocus = editRender.autofocus || editRender.autoFocus;
@@ -799,7 +813,7 @@ export default {
799
813
  }
800
814
  // 如果指定了聚焦 class
801
815
  if (XEUtils.isFunction(autoFocus)) {
802
- inputElem = autoFocus.call(this, params);
816
+ inputElem = autoFocus.call($xeTable, params);
803
817
  }
804
818
  else if (autoFocus) {
805
819
  if (autoFocus === true) {
@@ -832,18 +846,19 @@ export default {
832
846
  if (editOpts.autoPos) {
833
847
  if (!column.fixed) {
834
848
  // 显示到可视区中
835
- this.scrollToRow(row, column);
849
+ $xeTable.scrollToRow(row, column);
836
850
  }
837
851
  }
838
852
  }
839
853
  }
840
854
  },
841
855
  _setActiveRow(row) {
856
+ const $xeTable = this;
842
857
  if (process.env.NODE_ENV === 'development') {
843
858
  warnLog('vxe.error.delFunc', ['setActiveRow', 'setEditRow']);
844
859
  }
845
860
  // 即将废弃
846
- return this.setEditRow(row);
861
+ return $xeTable.setEditRow(row);
847
862
  },
848
863
  /**
849
864
  * 激活行编辑
@@ -855,7 +870,7 @@ export default {
855
870
  if (fieldOrColumn) {
856
871
  isPos = true;
857
872
  if (fieldOrColumn !== true) {
858
- column = XEUtils.isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
873
+ column = XEUtils.isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
859
874
  }
860
875
  }
861
876
  return handleEditCell($xeTable, row, column, isPos);
@@ -878,24 +893,38 @@ export default {
878
893
  * 只对 trigger=dblclick 有效,选中单元格
879
894
  */
880
895
  _setSelectCell(row, fieldOrColumn) {
881
- const { tableData, editOpts, visibleColumn } = this;
882
- const column = XEUtils.isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
896
+ const $xeTable = this;
897
+ const reactData = $xeTable;
898
+ const { tableData } = reactData;
899
+ const editOpts = $xeTable.computeEditOpts;
900
+ const column = XEUtils.isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
883
901
  if (row && column && editOpts.trigger !== 'manual') {
884
- const rowIndex = this.findRowIndexOf(tableData, row);
902
+ const rowIndex = $xeTable.findRowIndexOf(tableData, row);
885
903
  if (rowIndex > -1) {
886
- const cell = this.getCellElement(row, column);
887
- const params = { row, rowIndex, column, columnIndex: visibleColumn.indexOf(column), cell };
888
- this.handleSelected(params, {});
904
+ const cell = $xeTable.getCellElement(row, column);
905
+ const params = {
906
+ row,
907
+ rowIndex,
908
+ column,
909
+ columnIndex: $xeTable.getColumnIndex(column),
910
+ cell
911
+ };
912
+ $xeTable.handleSelected(params, {});
889
913
  }
890
914
  }
891
- return this.$nextTick();
915
+ return $xeTable.$nextTick();
892
916
  },
893
917
  /**
894
918
  * 处理选中源
895
919
  */
896
920
  handleSelected(params, evnt) {
897
921
  const $xeTable = this;
898
- const { mouseConfig, mouseOpts, editOpts, editStore } = this;
922
+ const props = $xeTable;
923
+ const reactData = $xeTable;
924
+ const { mouseConfig } = props;
925
+ const { editStore } = reactData;
926
+ const mouseOpts = $xeTable.computeMouseOpts;
927
+ const editOpts = $xeTable.computeEditOpts;
899
928
  const { actived, selected } = editStore;
900
929
  const { row, column } = params;
901
930
  const isMouseSelected = mouseConfig && mouseOpts.selected;
@@ -903,22 +932,24 @@ export default {
903
932
  if (isMouseSelected && (selected.row !== row || selected.column !== column)) {
904
933
  if (actived.row !== row || (editOpts.mode === 'cell' ? actived.column !== column : false)) {
905
934
  handleClearEdit($xeTable, evnt);
906
- this.clearSelected(evnt);
907
- this.clearCellAreas(evnt);
908
- this.clearCopyCellArea(evnt);
935
+ $xeTable.clearSelected();
936
+ if ($xeTable.clearCellAreas) {
937
+ $xeTable.clearCellAreas();
938
+ $xeTable.clearCopyCellArea();
939
+ }
909
940
  selected.args = params;
910
941
  selected.row = row;
911
942
  selected.column = column;
912
943
  if (isMouseSelected) {
913
944
  this.addCellSelectedClass();
914
945
  }
915
- this.focus();
946
+ $xeTable.focus();
916
947
  if (evnt) {
917
- this.emitEvent('cell-selected', params, evnt);
948
+ $xeTable.dispatchEvent('cell-selected', params, evnt);
918
949
  }
919
950
  }
920
951
  }
921
- return this.$nextTick();
952
+ return $xeTable.$nextTick();
922
953
  };
923
954
  return selectMethod();
924
955
  },
@@ -926,7 +957,10 @@ export default {
926
957
  * 获取选中的单元格
927
958
  */
928
959
  _getSelectedCell() {
929
- const { args, column } = this.editStore.selected;
960
+ const $xeTable = this;
961
+ const reactData = $xeTable;
962
+ const { editStore } = reactData;
963
+ const { args, column } = editStore.selected;
930
964
  if (args && column) {
931
965
  return Object.assign({}, args);
932
966
  }
@@ -937,12 +971,13 @@ export default {
937
971
  */
938
972
  _clearSelected() {
939
973
  const $xeTable = this;
940
- const { selected } = this.editStore;
974
+ const reactData = $xeTable;
975
+ const { editStore } = reactData;
976
+ const { selected } = editStore;
941
977
  selected.row = null;
942
978
  selected.column = null;
943
- this.reColTitleSdCls();
944
979
  removeCellSelectedClass($xeTable);
945
- return this.$nextTick();
980
+ return $xeTable.$nextTick();
946
981
  },
947
982
  reColTitleSdCls() {
948
983
  const headerElem = this.elemStore['main-header-list'];
@@ -78,6 +78,7 @@ export default {
78
78
  },
79
79
  render(h) {
80
80
  const $xeTable = this.$xeTable;
81
+ const $xeGrid = $xeTable.$xeGrid;
81
82
  const { _e, checkedAll, isAll: isAllChecked, isIndeterminate: isAllIndeterminate, showSheet, supportMerge, supportStyle, defaultOptions, storeData } = this;
82
83
  const { hasTree, hasMerge, isPrint, hasColgroup, columns } = storeData;
83
84
  const { isHeader } = defaultOptions;
@@ -158,7 +159,7 @@ export default {
158
159
  default: () => {
159
160
  const params = {
160
161
  $table: $xeTable,
161
- $grid: $xeTable.xegrid,
162
+ $grid: $xeGrid,
162
163
  options: defaultOptions,
163
164
  columns,
164
165
  params: defaultOptions.params
@@ -426,7 +427,7 @@ export default {
426
427
  footer: () => {
427
428
  const params = {
428
429
  $table: $xeTable,
429
- $grid: $xeTable.xegrid,
430
+ $grid: $xeGrid,
430
431
  options: defaultOptions,
431
432
  columns,
432
433
  params: defaultOptions.params
@@ -531,9 +532,9 @@ export default {
531
532
  }
532
533
  },
533
534
  printEvent() {
534
- const $xetable = this.$parent;
535
+ const $xeTable = this.$parent;
535
536
  this.storeData.visible = false;
536
- $xetable.print(Object.assign({}, $xetable.printOpts, this.getExportOption()));
537
+ $xeTable.print(Object.assign({}, $xeTable.printOpts, this.getExportOption()));
537
538
  },
538
539
  exportEvent() {
539
540
  const $xeTable = this.$xeTable;
@@ -61,7 +61,8 @@ export default {
61
61
  });
62
62
  },
63
63
  render(h) {
64
- const $xeTable = this.$xeTable;
64
+ const $xeTable = this.$parent;
65
+ const $xeGrid = $xeTable.$xeGrid;
65
66
  const { hasFile, loading, parseTypeLabel, defaultOptions, storeData, selectName } = this;
66
67
  const slots = defaultOptions.slots || {};
67
68
  const topSlot = slots.top;
@@ -96,7 +97,7 @@ export default {
96
97
  default: () => {
97
98
  const params = {
98
99
  $table: $xeTable,
99
- $grid: $xeTable.xegrid,
100
+ $grid: $xeGrid,
100
101
  options: defaultOptions,
101
102
  params: defaultOptions.params
102
103
  };
@@ -185,7 +186,7 @@ export default {
185
186
  footer: () => {
186
187
  const params = {
187
188
  $table: $xeTable,
188
- $grid: $xeTable.xegrid,
189
+ $grid: $xeGrid,
189
190
  options: defaultOptions,
190
191
  params: defaultOptions.params
191
192
  };
@@ -226,8 +227,8 @@ export default {
226
227
  });
227
228
  },
228
229
  selectFileEvent() {
229
- const $xetable = this.$parent;
230
- $xetable.readFile(this.defaultOptions).then((params) => {
230
+ const $xeTable = this.$parent;
231
+ $xeTable.readFile(this.defaultOptions).then((params) => {
231
232
  const { file } = params;
232
233
  Object.assign(this.storeData, parseFile(file), { file });
233
234
  }).catch((e) => e);
@@ -245,9 +246,9 @@ export default {
245
246
  this.storeData.visible = false;
246
247
  },
247
248
  importEvent() {
248
- const $xetable = this.$parent;
249
+ const $xeTable = this.$parent;
249
250
  this.loading = true;
250
- $xetable.importByFile(this.storeData.file, Object.assign({}, $xetable.importOpts, this.defaultOptions)).then(() => {
251
+ $xeTable.importByFile(this.storeData.file, Object.assign({}, $xeTable.importOpts, this.defaultOptions)).then(() => {
251
252
  this.loading = false;
252
253
  this.storeData.visible = false;
253
254
  }).catch(() => {