vxe-table 3.12.0-beta.0 → 3.12.0-beta.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 (57) hide show
  1. package/es/style.css +1 -1
  2. package/es/table/module/custom/panel.js +10 -12
  3. package/es/table/module/edit/mixin.js +7 -1
  4. package/es/table/module/validator/mixin.js +2 -6
  5. package/es/table/src/body.js +31 -27
  6. package/es/table/src/footer.js +2 -2
  7. package/es/table/src/header.js +1 -1
  8. package/es/table/src/methods.js +77 -48
  9. package/es/table/src/table.js +7 -0
  10. package/es/table/src/util.js +10 -5
  11. package/es/ui/index.js +1 -1
  12. package/es/ui/src/dom.js +14 -1
  13. package/es/ui/src/log.js +1 -1
  14. package/lib/index.umd.js +163 -113
  15. package/lib/index.umd.min.js +1 -1
  16. package/lib/style.css +1 -1
  17. package/lib/table/module/custom/panel.js +9 -13
  18. package/lib/table/module/custom/panel.min.js +1 -1
  19. package/lib/table/module/edit/mixin.js +6 -1
  20. package/lib/table/module/edit/mixin.min.js +1 -1
  21. package/lib/table/module/validator/mixin.js +1 -6
  22. package/lib/table/module/validator/mixin.min.js +1 -1
  23. package/lib/table/src/body.js +32 -27
  24. package/lib/table/src/body.min.js +1 -1
  25. package/lib/table/src/footer.js +2 -1
  26. package/lib/table/src/footer.min.js +1 -1
  27. package/lib/table/src/header.js +1 -1
  28. package/lib/table/src/header.min.js +1 -1
  29. package/lib/table/src/methods.js +79 -56
  30. package/lib/table/src/methods.min.js +1 -1
  31. package/lib/table/src/table.js +7 -0
  32. package/lib/table/src/table.min.js +1 -1
  33. package/lib/table/src/util.js +10 -5
  34. package/lib/table/src/util.min.js +1 -1
  35. package/lib/ui/index.js +1 -1
  36. package/lib/ui/index.min.js +1 -1
  37. package/lib/ui/src/dom.js +16 -2
  38. package/lib/ui/src/dom.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/package.json +2 -2
  42. package/packages/table/module/custom/panel.ts +11 -12
  43. package/packages/table/module/edit/mixin.ts +6 -1
  44. package/packages/table/module/validator/mixin.ts +2 -6
  45. package/packages/table/src/body.ts +31 -27
  46. package/packages/table/src/footer.ts +2 -2
  47. package/packages/table/src/header.ts +1 -1
  48. package/packages/table/src/methods.ts +89 -54
  49. package/packages/table/src/table.ts +9 -0
  50. package/packages/table/src/util.ts +12 -5
  51. package/packages/ui/src/dom.ts +16 -1
  52. /package/es/{iconfont.1735106128767.ttf → iconfont.1735365427273.ttf} +0 -0
  53. /package/es/{iconfont.1735106128767.woff → iconfont.1735365427273.woff} +0 -0
  54. /package/es/{iconfont.1735106128767.woff2 → iconfont.1735365427273.woff2} +0 -0
  55. /package/lib/{iconfont.1735106128767.ttf → iconfont.1735365427273.ttf} +0 -0
  56. /package/lib/{iconfont.1735106128767.woff → iconfont.1735365427273.woff} +0 -0
  57. /package/lib/{iconfont.1735106128767.woff2 → iconfont.1735365427273.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.12.0-beta.0";
2223
+ const version = "3.12.0-beta.10";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2632,7 +2632,20 @@ var es_array_push = __webpack_require__(4114);
2632
2632
 
2633
2633
  const reClsMap = {};
2634
2634
  const browse = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();
2635
- const tpImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=';
2635
+ let tpImgEl;
2636
+ function initTpImg() {
2637
+ if (!tpImgEl) {
2638
+ tpImgEl = new Image();
2639
+ tpImgEl.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=';
2640
+ }
2641
+ return tpImgEl;
2642
+ }
2643
+ function getTpImg() {
2644
+ if (!tpImgEl) {
2645
+ return initTpImg();
2646
+ }
2647
+ return tpImgEl;
2648
+ }
2636
2649
  function getPropClass(property, params) {
2637
2650
  return property ? XEUtils.isFunction(property) ? property(params) : property : '';
2638
2651
  }
@@ -2795,7 +2808,7 @@ function isNodeElement(elem) {
2795
2808
  const {
2796
2809
  log: log_log
2797
2810
  } = core_.VxeUI;
2798
- const log_version = `table v${"3.12.0-beta.0"}`;
2811
+ const log_version = `table v${"3.12.0-beta.10"}`;
2799
2812
  const warnLog = log_log.create('warn', log_version);
2800
2813
  const errLog = log_log.create('error', log_version);
2801
2814
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -3041,14 +3054,19 @@ const lineOffsetSizes = {
3041
3054
  small: 2,
3042
3055
  medium: 1
3043
3056
  };
3044
- function restoreScrollLocation(_vm, scrollLeft, scrollTop) {
3045
- return _vm.clearScroll().then(() => {
3057
+ function restoreScrollLocation($xeTable, scrollLeft, scrollTop) {
3058
+ const internalData = $xeTable;
3059
+ return $xeTable.clearScroll().then(() => {
3046
3060
  if (scrollLeft || scrollTop) {
3047
3061
  // 重置最后滚动状态
3048
- _vm.lastScrollLeft = 0;
3049
- _vm.lastScrollTop = 0;
3062
+ internalData.lastScrollLeft = 0;
3063
+ internalData.lastScrollTop = 0;
3064
+ internalData.inVirtualScroll = false;
3065
+ internalData.inBodyScroll = false;
3066
+ internalData.inFooterScroll = false;
3067
+ internalData.bodyScrollType = '';
3050
3068
  // 还原滚动状态
3051
- return _vm.scrollTo(scrollLeft, scrollTop);
3069
+ return $xeTable.scrollTo(scrollLeft, scrollTop);
3052
3070
  }
3053
3071
  });
3054
3072
  }
@@ -4983,14 +5001,12 @@ function handleReserveRow(_vm, reserveRowMap) {
4983
5001
  });
4984
5002
  return reserveList;
4985
5003
  }
4986
- function handleVirtualXVisible(_vm) {
5004
+ function handleVirtualXVisible($xeTable) {
5005
+ const internalData = $xeTable;
4987
5006
  const {
4988
- $refs,
4989
5007
  visibleColumn
4990
- } = _vm;
4991
- const {
4992
- tableBody
4993
- } = $refs;
5008
+ } = internalData;
5009
+ const tableBody = $xeTable.$refs.tableBody;
4994
5010
  const tableBodyElem = tableBody ? tableBody.$el : null;
4995
5011
  if (tableBodyElem) {
4996
5012
  const {
@@ -5032,8 +5048,8 @@ const computeRowHeight = $xeTable => {
5032
5048
  const tableBody = $xeTable.$refs.tableBody;
5033
5049
  const tableBodyElem = tableBody ? tableBody.$el : null;
5034
5050
  const vSize = $xeTable.computeSize;
5035
- const rowHeightMaps = $xeTable.rowHeightMaps;
5036
- let rowHeight = 0;
5051
+ const rowHeightMaps = $xeTable.computeRowHeightMaps;
5052
+ let rowHeight = 24;
5037
5053
  if (showOverflow) {
5038
5054
  if (tableBodyElem) {
5039
5055
  const tableHeaderElem = tableHeader ? tableHeader.$el : null;
@@ -5053,13 +5069,13 @@ const computeRowHeight = $xeTable => {
5053
5069
  return rowHeight;
5054
5070
  };
5055
5071
  function handleVirtualYVisible($xeTable) {
5072
+ const internalData = $xeTable;
5056
5073
  const {
5057
- $refs,
5058
5074
  scrollYStore,
5059
5075
  afterFullData,
5060
5076
  fullAllDataRowIdData
5061
- } = $xeTable;
5062
- const tableBody = $refs.tableBody;
5077
+ } = internalData;
5078
+ const tableBody = $xeTable.$refs.tableBody;
5063
5079
  const tableBodyElem = tableBody ? tableBody.$el : null;
5064
5080
  const {
5065
5081
  rowHeight
@@ -5076,11 +5092,11 @@ function handleVirtualYVisible($xeTable) {
5076
5092
  for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
5077
5093
  const row = afterFullData[rIndex];
5078
5094
  const rowid = getRowid($xeTable, row);
5079
- const rest = fullAllDataRowIdData[rowid];
5080
- if (!rest) {
5095
+ const rowRest = fullAllDataRowIdData[rowid];
5096
+ if (!rowRest) {
5081
5097
  break;
5082
5098
  }
5083
- offsetTop += rest.height || rowHeight;
5099
+ offsetTop += rowRest.height || rowHeight;
5084
5100
  if (toVisibleIndex === -1 && scrollTop < offsetTop) {
5085
5101
  toVisibleIndex = rIndex;
5086
5102
  }
@@ -5309,6 +5325,22 @@ function getOrderField(_vm, column) {
5309
5325
  return cellValue;
5310
5326
  };
5311
5327
  }
5328
+ function clearDragStatus($xeTable) {
5329
+ const reactData = $xeTable;
5330
+ const {
5331
+ dragRow,
5332
+ dragCol
5333
+ } = reactData;
5334
+ if (dragRow || dragCol) {
5335
+ clearColDropOrigin($xeTable);
5336
+ clearRowDropOrigin($xeTable);
5337
+ hideDropTip($xeTable);
5338
+ reactData.dragRow = null;
5339
+ reactData.dragCol = null;
5340
+ reactData.isDragColMove = false;
5341
+ reactData.isDragRowMove = false;
5342
+ }
5343
+ }
5312
5344
  function clearRowDropOrigin($xeTable) {
5313
5345
  const el = $xeTable.$el;
5314
5346
  if (el) {
@@ -5751,7 +5783,6 @@ const Methods = {
5751
5783
  editStore.removeList = [];
5752
5784
  editStore.removeMaps = {};
5753
5785
  const sYLoad = this.updateScrollYStatus(fullData);
5754
- this.scrollYLoad = sYLoad;
5755
5786
  this.isDragRowMove = false;
5756
5787
  // 全量数据
5757
5788
  this.tableFullData = fullData;
@@ -8094,7 +8125,7 @@ const Methods = {
8094
8125
  internalData.rceTimeout = setTimeout(() => {
8095
8126
  internalData.rceTimeout = undefined;
8096
8127
  resolve(handleRecalculateLayout($xeTable, !!reFull));
8097
- }, 20);
8128
+ }, 15);
8098
8129
  });
8099
8130
  },
8100
8131
  calcCellWidth() {
@@ -11041,14 +11072,16 @@ const Methods = {
11041
11072
  $xeTable.closeMenu();
11042
11073
  }
11043
11074
  },
11075
+ triggerCellMouseupEvent() {
11076
+ const $xeTable = this;
11077
+ clearDragStatus($xeTable);
11078
+ },
11044
11079
  /**
11045
11080
  * 行拖拽
11046
11081
  */
11047
11082
  handleRowDragDragstartEvent(evnt) {
11048
11083
  if (evnt.dataTransfer) {
11049
- const img = new Image();
11050
- img.src = tpImg;
11051
- evnt.dataTransfer.setDragImage(img, 0, 0);
11084
+ evnt.dataTransfer.setDragImage(getTpImg(), 0, 0);
11052
11085
  }
11053
11086
  },
11054
11087
  handleRowDragDragendEvent(evnt) {
@@ -11335,23 +11368,24 @@ const Methods = {
11335
11368
  },
11336
11369
  handleCellDragMouseupEvent() {
11337
11370
  const $xeTable = this;
11338
- const reactData = $xeTable;
11339
- clearRowDropOrigin($xeTable);
11340
- hideDropTip($xeTable);
11341
- reactData.dragRow = null;
11342
- reactData.dragCol = null;
11343
- reactData.isDragRowMove = false;
11371
+ clearDragStatus($xeTable);
11344
11372
  },
11345
11373
  /**
11346
11374
  * 列拖拽
11347
11375
  */
11348
11376
  handleHeaderCellDragDragstartEvent(evnt) {
11349
11377
  if (evnt.dataTransfer) {
11350
- const img = new Image();
11351
- img.src = tpImg;
11352
- evnt.dataTransfer.setDragImage(img, 0, 0);
11378
+ evnt.dataTransfer.setDragImage(getTpImg(), 0, 0);
11353
11379
  }
11354
11380
  },
11381
+ handleColDragSwapColumn() {
11382
+ const $xeTable = this;
11383
+ $xeTable.handleUpdateColumn();
11384
+ $xeTable.parseColumns(false).then(() => {
11385
+ $xeTable.updateCellAreas();
11386
+ $xeTable.saveCustomStore('update:sort');
11387
+ });
11388
+ },
11355
11389
  handleColDragSwapEvent(evnt, isSyncColumn, dragCol, prevDragCol, prevDragPos, prevDragToChild) {
11356
11390
  const $xeTable = this;
11357
11391
  const props = $xeTable;
@@ -11508,11 +11542,7 @@ const Methods = {
11508
11542
  }
11509
11543
  }, evnt);
11510
11544
  if (isSyncColumn) {
11511
- $xeTable.handleUpdateColumn();
11512
- $xeTable.parseColumns(false).then(() => {
11513
- $xeTable.updateCellAreas();
11514
- return $xeTable.saveCustomStore('update:sort');
11515
- });
11545
+ $xeTable.handleColDragSwapColumn();
11516
11546
  }
11517
11547
  }).catch(() => {});
11518
11548
  }
@@ -12983,15 +13013,18 @@ const Methods = {
12983
13013
  const $xeTable = this;
12984
13014
  const internalData = $xeTable;
12985
13015
  const {
13016
+ intoRunScroll,
12986
13017
  inFooterScroll,
12987
13018
  inBodyScroll,
12988
13019
  lastScrollTop
12989
13020
  } = internalData;
12990
- if (inFooterScroll) {
12991
- return;
12992
- }
12993
- if (inBodyScroll) {
12994
- return;
13021
+ if (!intoRunScroll) {
13022
+ if (inFooterScroll) {
13023
+ return;
13024
+ }
13025
+ if (inBodyScroll) {
13026
+ return;
13027
+ }
12995
13028
  }
12996
13029
  const tableHeader = $xeTable.$refs.tableHeader;
12997
13030
  const tableBody = $xeTable.$refs.tableBody;
@@ -13025,15 +13058,18 @@ const Methods = {
13025
13058
  const $xeTable = this;
13026
13059
  const internalData = $xeTable;
13027
13060
  const {
13061
+ intoRunScroll,
13028
13062
  inFooterScroll,
13029
13063
  inBodyScroll,
13030
13064
  lastScrollLeft
13031
13065
  } = internalData;
13032
- if (inFooterScroll) {
13033
- return;
13034
- }
13035
- if (inBodyScroll) {
13036
- return;
13066
+ if (!intoRunScroll) {
13067
+ if (inFooterScroll) {
13068
+ return;
13069
+ }
13070
+ if (inBodyScroll) {
13071
+ return;
13072
+ }
13037
13073
  }
13038
13074
  const tableBody = $xeTable.$refs.tableBody;
13039
13075
  const leftBody = $xeTable.$refs.leftBody;
@@ -13185,7 +13221,6 @@ const Methods = {
13185
13221
  const {
13186
13222
  showOverflow
13187
13223
  } = props;
13188
- // this.tableColumn = []
13189
13224
  return $xeTable.$nextTick().then(() => {
13190
13225
  $xeTable.handleTableColumn();
13191
13226
  calcCellHeight($xeTable);
@@ -13251,7 +13286,6 @@ const Methods = {
13251
13286
  },
13252
13287
  updateScrollYData() {
13253
13288
  const $xeTable = this;
13254
- // this.tableData = []
13255
13289
  return $xeTable.$nextTick().then(() => {
13256
13290
  $xeTable.handleTableData();
13257
13291
  calcCellHeight($xeTable);
@@ -13329,6 +13363,7 @@ const Methods = {
13329
13363
  */
13330
13364
  scrollTo(scrollLeft, scrollTop) {
13331
13365
  const $xeTable = this;
13366
+ const internalData = $xeTable;
13332
13367
  const {
13333
13368
  $refs
13334
13369
  } = this;
@@ -13344,6 +13379,7 @@ const Methods = {
13344
13379
  const rightBodyElem = rightBody ? rightBody.$el : null;
13345
13380
  const tableHeaderElem = tableHeader ? tableHeader.$el : null;
13346
13381
  const tableFooterElem = tableFooter ? tableFooter.$el : null;
13382
+ internalData.intoRunScroll = true;
13347
13383
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(scrollLeft)) {
13348
13384
  const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
13349
13385
  if (xHandleEl) {
@@ -13365,7 +13401,14 @@ const Methods = {
13365
13401
  }
13366
13402
  }
13367
13403
  if (this.scrollXLoad || this.scrollYLoad) {
13368
- return new Promise(resolve => setTimeout(() => resolve(this.$nextTick()), 30));
13404
+ return new Promise(resolve => {
13405
+ setTimeout(() => {
13406
+ $xeTable.$nextTick(() => {
13407
+ internalData.intoRunScroll = false;
13408
+ resolve();
13409
+ });
13410
+ });
13411
+ });
13369
13412
  }
13370
13413
  return this.$nextTick();
13371
13414
  },
@@ -13430,20 +13473,18 @@ const Methods = {
13430
13473
  */
13431
13474
  clearScroll() {
13432
13475
  const $xeTable = this;
13476
+ const internalData = $xeTable;
13433
13477
  const {
13434
- $refs,
13435
13478
  scrollXStore,
13436
13479
  scrollYStore
13437
- } = $xeTable;
13438
- const {
13439
- tableBody,
13440
- tableHeader,
13441
- leftBody,
13442
- rightBody,
13443
- tableFooter
13444
- } = $refs;
13445
- const tableBodyElem = tableBody ? tableBody.$el : null;
13480
+ } = internalData;
13481
+ const tableBody = $xeTable.$refs.tableBody;
13482
+ const tableHeader = $xeTable.$refs.tableHeader;
13483
+ const tableFooter = $xeTable.$refs.tableFooter;
13484
+ const leftBody = $xeTable.$refs.leftBody;
13485
+ const rightBody = $xeTable.$refs.rightBody;
13446
13486
  const leftBodyElem = leftBody ? leftBody.$el : null;
13487
+ const tableBodyElem = tableBody ? tableBody.$el : null;
13447
13488
  const rightBodyElem = rightBody ? rightBody.$el : null;
13448
13489
  const tableHeaderElem = tableHeader ? tableHeader.$el : null;
13449
13490
  const tableFooterElem = tableFooter ? tableFooter.$el : null;
@@ -13798,7 +13839,7 @@ function renderLine(h, _vm, $xetable, params) {
13798
13839
  /**
13799
13840
  * 渲染列
13800
13841
  */
13801
- function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) {
13842
+ function renderColumn(h, _vm, $xeTable, seq, rowid, fixedType, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) {
13802
13843
  const {
13803
13844
  $listeners: tableListeners,
13804
13845
  fullAllDataRowIdData,
@@ -13836,15 +13877,15 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
13836
13877
  mouseOpts,
13837
13878
  areaOpts,
13838
13879
  validErrorMaps
13839
- } = $xetable;
13840
- const rowDragOpts = $xetable.computeRowDragOpts;
13880
+ } = $xeTable;
13881
+ const rowDragOpts = $xeTable.computeRowDragOpts;
13841
13882
  const {
13842
13883
  disabledMethod: dragDisabledMethod
13843
13884
  } = rowDragOpts;
13844
13885
  const {
13845
13886
  selectCellToRow
13846
13887
  } = areaOpts;
13847
- const cellOpts = $xetable.computeCellOpts;
13888
+ const cellOpts = $xeTable.computeCellOpts;
13848
13889
  const {
13849
13890
  type,
13850
13891
  cellRender,
@@ -13872,8 +13913,8 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
13872
13913
  const compCellClassName = compConf ? compConf.tableCellClassName || compConf.cellClassName : '';
13873
13914
  const compCellStyle = compConf ? compConf.tableCellStyle || compConf.cellStyle : '';
13874
13915
  const showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
13875
- const columnIndex = $xetable.getColumnIndex(column);
13876
- const _columnIndex = $xetable.getVTColumnIndex(column);
13916
+ const columnIndex = $xeTable.getColumnIndex(column);
13917
+ const _columnIndex = $xeTable.getVTColumnIndex(column);
13877
13918
  const isEdit = isEnableConf(editRender);
13878
13919
  let fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX;
13879
13920
  const cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showOverflow) ? allColumnOverflow : showOverflow;
@@ -13895,8 +13936,8 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
13895
13936
  const bindMouseleave = tableListeners['cell-mouseleave'];
13896
13937
  const triggerDblclick = editRender && editConfig && editOpts.trigger === 'dblclick';
13897
13938
  const params = {
13898
- $table: $xetable,
13899
- $grid: $xetable.$xegrid,
13939
+ $table: $xeTable,
13940
+ $grid: $xeTable.$xegrid,
13900
13941
  isEdit: false,
13901
13942
  seq,
13902
13943
  rowid,
@@ -13916,28 +13957,28 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
13916
13957
  data: tableData,
13917
13958
  items
13918
13959
  };
13919
- let isColDragCell = false;
13960
+ let isRowDragCell = false;
13920
13961
  let isDisabledDrag = false;
13921
13962
  if (rowOpts.drag) {
13922
- isColDragCell = rowDragOpts.trigger === 'row' || column.dragSort && rowDragOpts.trigger === 'cell';
13963
+ isRowDragCell = rowDragOpts.trigger === 'row' || column.dragSort && rowDragOpts.trigger === 'cell';
13923
13964
  }
13924
- if (isColDragCell) {
13965
+ if (isRowDragCell) {
13925
13966
  isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(params));
13926
13967
  }
13927
13968
  // hover 进入事件
13928
13969
  if (showTitle || showTooltip || showAllTip || bindMouseenter || tooltipConfig) {
13929
13970
  tdOns.mouseenter = evnt => {
13930
- if (isVMScrollProcess($xetable)) {
13971
+ if (isVMScrollProcess($xeTable)) {
13931
13972
  return;
13932
13973
  }
13933
13974
  if (showTitle) {
13934
13975
  updateCellTitle(evnt.currentTarget, column);
13935
13976
  } else if (showTooltip || showAllTip) {
13936
13977
  // 如果配置了显示 tooltip
13937
- $xetable.triggerBodyTooltipEvent(evnt, params);
13978
+ $xeTable.triggerBodyTooltipEvent(evnt, params);
13938
13979
  }
13939
13980
  if (bindMouseenter) {
13940
- $xetable.emitEvent('cell-mouseenter', Object.assign({
13981
+ $xeTable.emitEvent('cell-mouseenter', Object.assign({
13941
13982
  cell: evnt.currentTarget
13942
13983
  }, params), evnt);
13943
13984
  }
@@ -13946,35 +13987,39 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
13946
13987
  // hover 退出事件
13947
13988
  if (showTooltip || showAllTip || bindMouseleave || tooltipConfig) {
13948
13989
  tdOns.mouseleave = evnt => {
13949
- if (isVMScrollProcess($xetable)) {
13990
+ if (isVMScrollProcess($xeTable)) {
13950
13991
  return;
13951
13992
  }
13952
13993
  if (showTooltip || showAllTip) {
13953
- $xetable.handleTargetLeaveEvent(evnt);
13994
+ $xeTable.handleTargetLeaveEvent(evnt);
13954
13995
  }
13955
13996
  if (bindMouseleave) {
13956
- $xetable.emitEvent('cell-mouseleave', Object.assign({
13997
+ $xeTable.emitEvent('cell-mouseleave', Object.assign({
13957
13998
  cell: evnt.currentTarget
13958
13999
  }, params), evnt);
13959
14000
  }
13960
14001
  };
13961
14002
  }
13962
14003
  // 按下事件处理
13963
- if (isColDragCell || checkboxOpts.range || mouseConfig) {
14004
+ if (isRowDragCell || checkboxOpts.range || mouseConfig) {
13964
14005
  tdOns.mousedown = evnt => {
13965
- $xetable.triggerCellMousedownEvent(evnt, params);
14006
+ $xeTable.triggerCellMousedownEvent(evnt, params);
13966
14007
  };
13967
14008
  }
14009
+ // 拖拽列事件
14010
+ if (isRowDragCell) {
14011
+ tdOns.mouseup = $xeTable.triggerCellMouseupEvent;
14012
+ }
13968
14013
  // 点击事件处理
13969
14014
  if (rowOpts.isCurrent || highlightCurrentRow || tableListeners['cell-click'] || editRender && editConfig || expandOpts.trigger === 'row' || expandOpts.trigger === 'cell' || radioOpts.trigger === 'row' || column.type === 'radio' && radioOpts.trigger === 'cell' || checkboxOpts.trigger === 'row' || column.type === 'checkbox' && checkboxOpts.trigger === 'cell' || treeOpts.trigger === 'row' || column.treeNode && treeOpts.trigger === 'cell') {
13970
14015
  tdOns.click = evnt => {
13971
- $xetable.triggerCellClickEvent(evnt, params);
14016
+ $xeTable.triggerCellClickEvent(evnt, params);
13972
14017
  };
13973
14018
  }
13974
14019
  // 双击事件处理
13975
14020
  if (triggerDblclick || tableListeners['cell-dblclick']) {
13976
14021
  tdOns.dblclick = evnt => {
13977
- $xetable.triggerCellDblclickEvent(evnt, params);
14022
+ $xeTable.triggerCellDblclickEvent(evnt, params);
13978
14023
  };
13979
14024
  }
13980
14025
  // 合并行或列
@@ -14019,7 +14064,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
14019
14064
  }
14020
14065
  // 如果编辑列开启显示状态
14021
14066
  if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
14022
- isDirty = $xetable.isUpdateByRow(row, column.field);
14067
+ isDirty = $xeTable.isUpdateByRow(row, column.field);
14023
14068
  }
14024
14069
  const tdVNs = [];
14025
14070
  if (fixedHiddenColumn && (allColumnOverflow ? isAllOverflow : allColumnOverflow)) {
@@ -14035,7 +14080,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
14035
14080
  }));
14036
14081
  } else {
14037
14082
  // 渲染单元格
14038
- tdVNs.push(...renderLine(h, _vm, $xetable, params), h('div', {
14083
+ tdVNs.push(...renderLine(h, _vm, $xeTable, params), h('div', {
14039
14084
  class: ['vxe-cell', {
14040
14085
  'c--title': showTitle,
14041
14086
  'c--tooltip': showTooltip,
@@ -14045,7 +14090,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
14045
14090
  maxHeight: hasEllipsis && (scrollYRHeight || rowHeight) ? `${scrollYRHeight || rowHeight}px` : ''
14046
14091
  },
14047
14092
  attrs: {
14048
- title: showTitle ? $xetable.getCellLabel(row, column) : null
14093
+ title: showTitle ? $xeTable.getCellLabel(row, column) : null
14049
14094
  }
14050
14095
  }, column.renderCell(h, params)));
14051
14096
  if (showValidTip && errorValidItem) {
@@ -14063,7 +14108,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
14063
14108
  } : null
14064
14109
  }, [h('div', {
14065
14110
  class: `vxe-cell--valid-error-wrapper vxe-cell--valid-error-theme-${validOpts.theme || 'normal'}`
14066
- }, [validSlot ? $xetable.callSlot(validSlot, validParams, h) : [h('span', {
14111
+ }, [validSlot ? $xeTable.callSlot(validSlot, validParams, h) : [h('span', {
14067
14112
  class: 'vxe-cell--valid-error-msg'
14068
14113
  }, errorValidItem.content)]])]));
14069
14114
  }
@@ -14095,7 +14140,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
14095
14140
  'col--ellipsis': hasEllipsis,
14096
14141
  'fixed--width': !isAutoCellWidth,
14097
14142
  'fixed--hidden': fixedHiddenColumn,
14098
- 'is--drag-cell': isColDragCell,
14143
+ 'is--drag-cell': isRowDragCell,
14099
14144
  'is--drag-disabled': isDisabledDrag,
14100
14145
  'col--dirty': isDirty,
14101
14146
  'col--active': editConfig && isEdit && actived.row === row && (actived.column === column || editOpts.mode === 'row'),
@@ -14383,6 +14428,7 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
14383
14428
  mouseConfig
14384
14429
  } = tableProps;
14385
14430
  const {
14431
+ isGroup,
14386
14432
  tableData,
14387
14433
  scrollXLoad,
14388
14434
  scrollYLoad,
@@ -14439,7 +14485,7 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
14439
14485
  }
14440
14486
  }
14441
14487
  }
14442
- if (!fixedType) {
14488
+ if (!fixedType && !isGroup) {
14443
14489
  // 列拖拽
14444
14490
  if (scrollXLoad && dragCol) {
14445
14491
  if (renderColumnList.length > 2) {
@@ -15075,7 +15121,7 @@ function renderHeads(h, _vm, headerGroups) {
15075
15121
  }
15076
15122
  renderHeaderList = [renderColumnList];
15077
15123
  }
15078
- if (!fixedType) {
15124
+ if (!fixedType && !isGroup) {
15079
15125
  // 列拖拽
15080
15126
  if (scrollXLoad && dragCol) {
15081
15127
  if (renderColumnList.length > 2) {
@@ -15595,6 +15641,7 @@ function footer_renderHeads(h, _vm, renderColumnList) {
15595
15641
  fullColumnIdData
15596
15642
  } = tableInternalData;
15597
15643
  const {
15644
+ isGroup,
15598
15645
  scrollXLoad,
15599
15646
  scrollYLoad,
15600
15647
  scrollbarWidth,
@@ -15615,7 +15662,7 @@ function footer_renderHeads(h, _vm, renderColumnList) {
15615
15662
  renderColumnList = visibleColumn;
15616
15663
  }
15617
15664
  }
15618
- if (!fixedType) {
15665
+ if (!fixedType && !isGroup) {
15619
15666
  // 列拖拽
15620
15667
  if (scrollXLoad && dragCol) {
15621
15668
  if (renderColumnList.length > 2) {
@@ -16053,12 +16100,14 @@ function panel_hideDropTip(_vm) {
16053
16100
  }
16054
16101
  }
16055
16102
  const renderDragTip = (h, _vm) => {
16056
- const {
16057
- dragCol
16058
- } = _vm;
16103
+ const $xeTable = _vm.$xeTable;
16104
+ const dragCol = $xeTable.dragColumnRef;
16105
+ const columnDragOpts = $xeTable.computeColumnDragOpts;
16059
16106
  return h('div', {}, [h('div', {
16060
16107
  ref: 'refDragLineElem',
16061
- class: 'vxe-table-custom-popup--drag-line'
16108
+ class: ['vxe-table-custom-popup--drag-line', {
16109
+ 'is--guides': columnDragOpts.showGuidesStatus
16110
+ }]
16062
16111
  }), h('div', {
16063
16112
  ref: 'refDragTipElem',
16064
16113
  class: 'vxe-table-custom-popup--drag-tip'
@@ -16597,7 +16646,7 @@ const renderPopupPanel = (h, _vm) => {
16597
16646
  }
16598
16647
  }), immediate ? h(VxeUIButtonComponent, {
16599
16648
  props: {
16600
- content: customOpts.resetButtonText || panel_getI18n('vxe.custom.customClose')
16649
+ content: customOpts.resetButtonText || panel_getI18n('vxe.table.customClose')
16601
16650
  },
16602
16651
  on: {
16603
16652
  click: _vm.cancelCloseEvent
@@ -16950,9 +16999,7 @@ const renderPopupPanel = (h, _vm) => {
16950
16999
  },
16951
17000
  sortDragstartEvent(evnt) {
16952
17001
  if (evnt.dataTransfer) {
16953
- const img = new Image();
16954
- img.src = tpImg;
16955
- evnt.dataTransfer.setDragImage(img, 0, 0);
17002
+ evnt.dataTransfer.setDragImage(getTpImg(), 0, 0);
16956
17003
  }
16957
17004
  },
16958
17005
  sortDragendEvent(evnt) {
@@ -17134,11 +17181,7 @@ const renderPopupPanel = (h, _vm) => {
17134
17181
  }, evnt);
17135
17182
  if (immediate) {
17136
17183
  reactData.customColumnList = collectColumn.slice(0);
17137
- $xeTable.refreshColumn(true).then(() => {
17138
- $xeTable.updateCellAreas();
17139
- $xeTable.handleCustom();
17140
- $xeTable.saveCustomStore('update:sort');
17141
- });
17184
+ $xeTable.handleColDragSwapColumn();
17142
17185
  }
17143
17186
  }).catch(() => {});
17144
17187
  }
@@ -19264,7 +19307,12 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
19264
19307
  throw new Error(errLog('vxe.error.unableInsert'));
19265
19308
  }
19266
19309
  afterFullData.splice(afIndex, 0, ...newRecords);
19267
- tableFullData.splice($xeTable.findRowIndexOf(tableFullData, targetRow), 0, ...newRecords);
19310
+ const tfIndex = $xeTable.findRowIndexOf(tableFullData, targetRow);
19311
+ if (tfIndex > -1) {
19312
+ tableFullData.splice(tfIndex + (isInsertNextRow ? 1 : 0), 0, ...newRecords);
19313
+ } else {
19314
+ tableFullData.push(...newRecords);
19315
+ }
19268
19316
  // 刷新单元格合并
19269
19317
  mergeList.forEach(mergeItem => {
19270
19318
  const {
@@ -22523,7 +22571,6 @@ function validErrorRuleValue(rule, val) {
22523
22571
  const {
22524
22572
  editRules,
22525
22573
  afterFullData,
22526
- visibleColumn,
22527
22574
  treeConfig,
22528
22575
  treeOpts
22529
22576
  } = this;
@@ -22638,11 +22685,7 @@ function validErrorRuleValue(rule, val) {
22638
22685
  } else {
22639
22686
  const row = firstErrParams.row;
22640
22687
  const column = firstErrParams.column;
22641
- const rowIndex = afterFullData.indexOf(row);
22642
- const columnIndex = visibleColumn.indexOf(column);
22643
- const targetRow = rowIndex > 0 ? afterFullData[rowIndex - 1] : row;
22644
- const targetColumn = columnIndex > 0 ? visibleColumn[columnIndex - 1] : column;
22645
- this.scrollToRow(targetRow, targetColumn).then(posAndFinish);
22688
+ this.scrollToRow(row, column).then(posAndFinish);
22646
22689
  }
22647
22690
  });
22648
22691
  });
@@ -23272,6 +23315,7 @@ function validErrorRuleValue(rule, val) {
23272
23315
 
23273
23316
 
23274
23317
 
23318
+
23275
23319
 
23276
23320
 
23277
23321
  const {
@@ -24399,6 +24443,12 @@ function handleUupdateResize(_vm) {
24399
24443
  mounted() {
24400
24444
  const $xeTable = this;
24401
24445
  const props = $xeTable;
24446
+ const columnOpts = $xeTable.computeColumnOpts;
24447
+ const rowOpts = $xeTable.computeRowOpts;
24448
+ const customOpts = $xeTable.computeCustomOpts;
24449
+ if (columnOpts.drag || rowOpts.drag || customOpts.allowSort) {
24450
+ initTpImg();
24451
+ }
24402
24452
  if (true) {
24403
24453
  const {
24404
24454
  $listeners