vxe-table 3.11.38 → 3.12.0-beta.0

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/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/render/index.js +47 -12
  6. package/es/table/src/body.js +81 -35
  7. package/es/table/src/footer.js +54 -18
  8. package/es/table/src/header.js +58 -10
  9. package/es/table/src/methods.js +159 -118
  10. package/es/table/src/table.js +5 -13
  11. package/es/table/style.css +3 -5
  12. package/es/table/style.min.css +1 -1
  13. package/es/ui/index.js +5 -3
  14. package/es/ui/src/log.js +1 -1
  15. package/es/vxe-table/style.css +3 -5
  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 +464 -272
  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/render/index.js +47 -12
  24. package/lib/table/render/index.min.js +1 -1
  25. package/lib/table/src/body.js +101 -56
  26. package/lib/table/src/body.min.js +1 -1
  27. package/lib/table/src/footer.js +67 -30
  28. package/lib/table/src/footer.min.js +1 -1
  29. package/lib/table/src/header.js +71 -18
  30. package/lib/table/src/header.min.js +1 -1
  31. package/lib/table/src/methods.js +167 -137
  32. package/lib/table/src/methods.min.js +1 -1
  33. package/lib/table/src/table.js +5 -15
  34. package/lib/table/src/table.min.js +1 -1
  35. package/lib/table/style/style.css +3 -5
  36. package/lib/table/style/style.min.css +1 -1
  37. package/lib/ui/index.js +5 -3
  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 +3 -5
  42. package/lib/vxe-table/style/style.min.css +1 -1
  43. package/package.json +2 -2
  44. package/packages/table/render/index.ts +48 -12
  45. package/packages/table/src/body.ts +84 -35
  46. package/packages/table/src/footer.ts +58 -18
  47. package/packages/table/src/header.ts +62 -11
  48. package/packages/table/src/methods.ts +163 -126
  49. package/packages/table/src/table.ts +6 -15
  50. package/packages/ui/index.ts +4 -2
  51. package/styles/components/table.scss +1 -3
  52. /package/es/{iconfont.1735003904481.ttf → iconfont.1735106128767.ttf} +0 -0
  53. /package/es/{iconfont.1735003904481.woff → iconfont.1735106128767.woff} +0 -0
  54. /package/es/{iconfont.1735003904481.woff2 → iconfont.1735106128767.woff2} +0 -0
  55. /package/lib/{iconfont.1735003904481.ttf → iconfont.1735106128767.ttf} +0 -0
  56. /package/lib/{iconfont.1735003904481.woff → iconfont.1735106128767.woff} +0 -0
  57. /package/lib/{iconfont.1735003904481.woff2 → iconfont.1735106128767.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.38";
2223
+ const version = "3.12.0-beta.0";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2263,11 +2263,13 @@ core_.VxeUI.setConfig({
2263
2263
  },
2264
2264
  rowDragConfig: {
2265
2265
  showIcon: true,
2266
- animation: true
2266
+ animation: true,
2267
+ showGuidesStatus: true
2267
2268
  },
2268
2269
  columnDragConfig: {
2269
2270
  showIcon: true,
2270
- animation: true
2271
+ animation: true,
2272
+ showGuidesStatus: true
2271
2273
  },
2272
2274
  checkboxConfig: {
2273
2275
  // trigger: 'default',
@@ -2793,7 +2795,7 @@ function isNodeElement(elem) {
2793
2795
  const {
2794
2796
  log: log_log
2795
2797
  } = core_.VxeUI;
2796
- const log_version = `table v${"3.11.38"}`;
2798
+ const log_version = `table v${"3.12.0-beta.0"}`;
2797
2799
  const warnLog = log_log.create('warn', log_version);
2798
2800
  const errLog = log_log.create('error', log_version);
2799
2801
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -4916,8 +4918,6 @@ const {
4916
4918
  interceptor: methods_interceptor,
4917
4919
  createEvent
4918
4920
  } = core_.VxeUI;
4919
- // const isWebkit = browse['-webkit'] && !browse.edge
4920
- // const debounceScrollYDuration = browse.msie ? 80 : 20
4921
4921
  const customStorageKey = 'VXE_CUSTOM_STORE';
4922
4922
  // 获取所有的列,排除分组
4923
4923
  const getColumnList = columns => {
@@ -5251,7 +5251,7 @@ const calcCellHeight = $xeTable => {
5251
5251
  const {
5252
5252
  fullAllDataRowIdData
5253
5253
  } = internalData;
5254
- const el = $xeTable.$el;
5254
+ const el = $xeTable.$refs.refElem;
5255
5255
  if (!showOverflow && (scrollXLoad || scrollYLoad) && el) {
5256
5256
  let paddingTop = 0;
5257
5257
  let paddingBottom = 0;
@@ -5259,28 +5259,27 @@ const calcCellHeight = $xeTable => {
5259
5259
  tableData.forEach(row => {
5260
5260
  const rowid = getRowid($xeTable, row);
5261
5261
  const rowRest = fullAllDataRowIdData[rowid];
5262
- const trList = el.querySelectorAll(`.vxe-body--row[rowid="${rowid}"]`);
5263
- if (rowRest && trList.length) {
5262
+ const cellList = el.querySelectorAll(`.vxe-body--row[rowid="${rowid}"]>.vxe-body--column>.vxe-cell`);
5263
+ if (rowRest && cellList.length) {
5264
5264
  let height = 0;
5265
- for (let i = 0; i < trList.length; i++) {
5266
- const trEl = trList[i];
5267
- const tdList = trEl.children;
5268
- for (let j = 0; j < tdList.length; j++) {
5269
- const tdEl = tdList[j];
5270
- const cellElem = tdEl.querySelector('.vxe-cell');
5271
- if (!calcPadding) {
5272
- paddingTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(tdEl).paddingTop);
5273
- paddingBottom = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(tdEl).paddingBottom);
5274
- calcPadding = true;
5275
- }
5276
- let cellHeight = paddingTop + paddingBottom;
5277
- if (cellElem) {
5278
- cellHeight += cellElem.offsetHeight;
5279
- }
5280
- height = Math.max(height, cellHeight);
5265
+ for (let i = 0; i < cellList.length; i++) {
5266
+ const cellElem = cellList[i];
5267
+ const tdEl = cellElem.parentElement;
5268
+ if (!tdEl || !tdEl.clientWidth) {
5269
+ break;
5281
5270
  }
5271
+ if (!calcPadding) {
5272
+ paddingTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(tdEl).paddingTop);
5273
+ paddingBottom = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(tdEl).paddingBottom);
5274
+ calcPadding = true;
5275
+ }
5276
+ let cellHeight = paddingTop + paddingBottom;
5277
+ if (cellElem) {
5278
+ cellHeight += cellElem.clientHeight;
5279
+ }
5280
+ height = Math.max(height, cellHeight);
5282
5281
  }
5283
- rowRest.height = height;
5282
+ rowRest.height = scrollXLoad ? Math.max(rowRest.height, height) : height;
5284
5283
  }
5285
5284
  });
5286
5285
  }
@@ -5411,15 +5410,22 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
5411
5410
  prevDragToChild
5412
5411
  } = internalData;
5413
5412
  const wrapperRect = el.getBoundingClientRect();
5413
+ const tableWidth = el.clientWidth;
5414
+ const tableHeight = el.clientHeight;
5414
5415
  if (trEl) {
5415
5416
  const rdLineEl = $xeTable.$refs.refDragRowLineElem;
5416
5417
  if (rdLineEl) {
5417
5418
  if (showLine) {
5418
5419
  const trRect = trEl.getBoundingClientRect();
5420
+ let trHeight = trEl.clientHeight;
5421
+ const offsetTop = Math.max(1, trRect.y - wrapperRect.y);
5422
+ if (offsetTop + trHeight > tableHeight - scrollbarHeight) {
5423
+ trHeight = tableHeight - offsetTop - scrollbarHeight;
5424
+ }
5419
5425
  rdLineEl.style.display = 'block';
5420
- rdLineEl.style.top = `${Math.max(1, trRect.y - wrapperRect.y)}px`;
5421
- rdLineEl.style.height = `${trRect.height}px`;
5422
- rdLineEl.style.width = `${wrapperRect.width - scrollbarWidth}px`;
5426
+ rdLineEl.style.top = `${offsetTop}px`;
5427
+ rdLineEl.style.height = `${trHeight}px`;
5428
+ rdLineEl.style.width = `${tableWidth - scrollbarWidth}px`;
5423
5429
  rdLineEl.setAttribute('drag-pos', dragPos);
5424
5430
  rdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
5425
5431
  } else {
@@ -5430,16 +5436,31 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
5430
5436
  const cdLineEl = $xeTable.$refs.refDragColLineElem;
5431
5437
  if (cdLineEl) {
5432
5438
  if (showLine) {
5439
+ const leftContainerElem = $xeTable.$refs.leftContainer;
5440
+ const leftContainerWidth = leftContainerElem ? leftContainerElem.clientWidth : 0;
5441
+ const rightContainerElem = $xeTable.$refs.rightContainer;
5442
+ const rightContainerWidth = rightContainerElem ? rightContainerElem.clientWidth : 0;
5433
5443
  const thRect = thEl.getBoundingClientRect();
5444
+ let thWidth = thEl.clientWidth;
5434
5445
  const offsetTop = Math.max(0, thRect.y - wrapperRect.y);
5446
+ const startX = leftContainerWidth;
5447
+ let offsetLeft = thRect.x - wrapperRect.x;
5448
+ if (offsetLeft < startX) {
5449
+ thWidth -= startX - offsetLeft;
5450
+ offsetLeft = startX;
5451
+ }
5452
+ const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 : scrollbarWidth);
5453
+ if (offsetLeft + thWidth > endX) {
5454
+ thWidth = endX - offsetLeft;
5455
+ }
5435
5456
  cdLineEl.style.display = 'block';
5436
5457
  cdLineEl.style.top = `${offsetTop}px`;
5437
- cdLineEl.style.left = `${Math.max(1, thRect.x - wrapperRect.x)}px`;
5438
- cdLineEl.style.width = `${thRect.width}px`;
5458
+ cdLineEl.style.left = `${offsetLeft}px`;
5459
+ cdLineEl.style.width = `${thWidth}px`;
5439
5460
  if (prevDragToChild) {
5440
5461
  cdLineEl.style.height = `${thRect.height}px`;
5441
5462
  } else {
5442
- cdLineEl.style.height = `${wrapperRect.height - offsetTop - scrollbarHeight}px`;
5463
+ cdLineEl.style.height = `${tableHeight - offsetTop - scrollbarHeight}px`;
5443
5464
  }
5444
5465
  cdLineEl.setAttribute('drag-pos', dragPos);
5445
5466
  cdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
@@ -5927,7 +5948,7 @@ const Methods = {
5927
5948
  return Promise.resolve(this.restoreCustomStorage()).then(() => {
5928
5949
  this._isLoading = false;
5929
5950
  this.cacheColumnMap();
5930
- this.parseColumns().then(() => {
5951
+ this.parseColumns(true).then(() => {
5931
5952
  if (this.scrollXLoad) {
5932
5953
  this.loadScrollXData(true);
5933
5954
  }
@@ -7799,15 +7820,11 @@ const Methods = {
7799
7820
  /**
7800
7821
  * 刷新列配置
7801
7822
  */
7802
- refreshColumn(initOrder) {
7803
- if (initOrder) {
7804
- const columnList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(this.collectColumn, 'renderSortNumber');
7805
- this.collectColumn = columnList;
7806
- const tableFullColumn = getColumnList(columnList);
7807
- this.tableFullColumn = tableFullColumn;
7808
- this.cacheColumnMap();
7823
+ refreshColumn(initSort) {
7824
+ if (initSort) {
7825
+ this.handleUpdateColumn();
7809
7826
  }
7810
- return this.parseColumns().then(() => {
7827
+ return this.parseColumns(true).then(() => {
7811
7828
  return this.refreshScroll();
7812
7829
  }).then(() => {
7813
7830
  return this.recalculate();
@@ -7817,7 +7834,7 @@ const Methods = {
7817
7834
  * 刷新列信息
7818
7835
  * 将固定的列左边、右边分别靠边
7819
7836
  */
7820
- parseColumns() {
7837
+ parseColumns(isReset) {
7821
7838
  const $xeTable = this;
7822
7839
  const props = $xeTable;
7823
7840
  const internalData = $xeTable;
@@ -7921,12 +7938,14 @@ const Methods = {
7921
7938
  warnLog('vxe.error.scrollErrProp', ['footer-span-method']);
7922
7939
  }
7923
7940
  }
7924
- const {
7925
- visibleSize
7926
- } = handleVirtualXVisible(this);
7927
- scrollXStore.startIndex = 0;
7928
- scrollXStore.endIndex = visibleSize;
7929
- scrollXStore.visibleSize = visibleSize;
7941
+ if (isReset) {
7942
+ const {
7943
+ visibleSize
7944
+ } = handleVirtualXVisible(this);
7945
+ scrollXStore.startIndex = 0;
7946
+ scrollXStore.endIndex = visibleSize;
7947
+ scrollXStore.visibleSize = visibleSize;
7948
+ }
7930
7949
  }
7931
7950
  // 如果列被显示/隐藏,则清除合并状态
7932
7951
  // 如果列被设置为固定,则清除合并状态
@@ -7944,12 +7963,15 @@ const Methods = {
7944
7963
  });
7945
7964
  this.visibleColumn = visibleColumn;
7946
7965
  this.handleTableColumn();
7947
- return this.updateFooter().then(() => {
7948
- return this.recalculate();
7949
- }).then(() => {
7950
- this.updateCellAreas();
7951
- return this.recalculate();
7952
- });
7966
+ if (isReset) {
7967
+ return this.updateFooter().then(() => {
7968
+ return this.recalculate();
7969
+ }).then(() => {
7970
+ this.updateCellAreas();
7971
+ return this.recalculate();
7972
+ });
7973
+ }
7974
+ return this.updateFooter();
7953
7975
  },
7954
7976
  /**
7955
7977
  * 指定列宽的列进行拆分
@@ -8280,56 +8302,6 @@ const Methods = {
8280
8302
  this.checkScrolling();
8281
8303
  }
8282
8304
  },
8283
- calcCellHeight() {
8284
- const $xeTable = this;
8285
- const props = $xeTable;
8286
- const reactData = $xeTable;
8287
- const internalData = $xeTable;
8288
- const {
8289
- showOverflow
8290
- } = props;
8291
- const {
8292
- tableData,
8293
- scrollXLoad,
8294
- scrollYLoad
8295
- } = reactData;
8296
- const {
8297
- fullAllDataRowIdData
8298
- } = internalData;
8299
- const el = $xeTable.$el;
8300
- if (!showOverflow && (scrollXLoad || scrollYLoad) && el) {
8301
- let paddingTop = 0;
8302
- let paddingBottom = 0;
8303
- let calcPadding = false;
8304
- tableData.forEach(row => {
8305
- const rowid = getRowid($xeTable, row);
8306
- const rowRest = fullAllDataRowIdData[rowid];
8307
- const trList = el.querySelectorAll(`.vxe-body--row[rowid="${rowid}"]`);
8308
- if (rowRest && trList.length) {
8309
- let height = 0;
8310
- for (let i = 0; i < trList.length; i++) {
8311
- const trEl = trList[i];
8312
- const tdList = trEl.children;
8313
- for (let j = 0; j < tdList.length; j++) {
8314
- const tdEl = tdList[j];
8315
- const cellElem = tdEl.querySelector('.vxe-cell');
8316
- if (!calcPadding) {
8317
- paddingTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(tdEl).paddingTop);
8318
- paddingBottom = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(tdEl).paddingBottom);
8319
- calcPadding = true;
8320
- }
8321
- let cellHeight = paddingTop + paddingBottom;
8322
- if (cellElem) {
8323
- cellHeight += cellElem.offsetHeight;
8324
- }
8325
- height = Math.max(height, cellHeight);
8326
- }
8327
- }
8328
- rowRest.height = scrollXLoad ? Math.max(rowRest.height, height) : height;
8329
- }
8330
- });
8331
- }
8332
- },
8333
8305
  updateHeight() {
8334
8306
  this.customHeight = calcTableHeight(this, 'height');
8335
8307
  this.customMinHeight = calcTableHeight(this, 'minHeight');
@@ -8365,11 +8337,8 @@ const Methods = {
8365
8337
  editStore,
8366
8338
  currentRow,
8367
8339
  mouseConfig,
8368
- keyboardConfig,
8369
- keyboardOpts,
8370
8340
  spanMethod,
8371
- mergeList,
8372
- mergeFooterList,
8341
+ expandColumn,
8373
8342
  footerSpanMethod,
8374
8343
  isAllOverflow,
8375
8344
  visibleColumn
@@ -8426,10 +8395,17 @@ const Methods = {
8426
8395
  if (isGroup) {
8427
8396
  renderColumnList = visibleColumn;
8428
8397
  } else {
8429
- // 如果是使用优化模式
8430
8398
  if (fixedType) {
8431
- if (scrollXLoad || allColumnHeaderOverflow) {
8432
- renderColumnList = fixedColumn;
8399
+ // 如果是使用优化模式
8400
+ if (scrollXLoad || scrollYLoad || allColumnHeaderOverflow) {
8401
+ // 如果不支持优化模式
8402
+ if (spanMethod || footerSpanMethod) {
8403
+ renderColumnList = visibleColumn;
8404
+ } else {
8405
+ renderColumnList = fixedColumn || [];
8406
+ }
8407
+ } else {
8408
+ renderColumnList = visibleColumn;
8433
8409
  }
8434
8410
  }
8435
8411
  }
@@ -8516,14 +8492,14 @@ const Methods = {
8516
8492
  }
8517
8493
  let tWidth = tableWidth;
8518
8494
  let renderColumnList = tableColumn;
8519
- // 如果是使用优化模式
8520
8495
  if (fixedType) {
8521
- // 如果存在展开行使用全量渲染
8522
- if (!this.expandColumn && (scrollXLoad || scrollYLoad || (allColumnOverflow ? isAllOverflow : allColumnOverflow))) {
8523
- if (!mergeList.length && !spanMethod && !(keyboardConfig && keyboardOpts.isMerge)) {
8524
- renderColumnList = fixedColumn;
8525
- } else {
8496
+ // 如果是使用优化模式
8497
+ if (scrollXLoad || scrollYLoad || allColumnOverflow && isAllOverflow) {
8498
+ // 如果不支持优化模式
8499
+ if (expandColumn || spanMethod || footerSpanMethod) {
8526
8500
  renderColumnList = visibleColumn;
8501
+ } else {
8502
+ renderColumnList = fixedColumn || [];
8527
8503
  }
8528
8504
  } else {
8529
8505
  renderColumnList = visibleColumn;
@@ -8541,14 +8517,14 @@ const Methods = {
8541
8517
  } else if (layout === 'footer') {
8542
8518
  let tWidth = tableWidth;
8543
8519
  let renderColumnList = tableColumn;
8544
- // 如果是使用优化模式
8545
8520
  if (fixedType) {
8546
- // 如果存在展开行使用全量渲染
8547
- if (!this.expandColumn && (scrollXLoad || allColumnFooterOverflow)) {
8548
- if (!mergeFooterList.length || !footerSpanMethod) {
8549
- renderColumnList = fixedColumn;
8550
- } else {
8521
+ // 如果是使用优化模式
8522
+ if (scrollXLoad || scrollYLoad || allColumnFooterOverflow) {
8523
+ // 如果不支持优化模式
8524
+ if (spanMethod || footerSpanMethod) {
8551
8525
  renderColumnList = visibleColumn;
8526
+ } else {
8527
+ renderColumnList = fixedColumn || [];
8552
8528
  }
8553
8529
  } else {
8554
8530
  renderColumnList = visibleColumn;
@@ -10997,7 +10973,10 @@ const Methods = {
10997
10973
  const triggerFilter = getEventTargetNode(evnt, cell, 'vxe-cell--filter').flag;
10998
10974
  let triggerDrag = false;
10999
10975
  if (!(triggerInput || triggerCheckbox || triggerSort || triggerFilter)) {
11000
- if (columnOpts.drag && trigger === 'cell' && !(disabledMethod && disabledMethod(params))) {
10976
+ const {
10977
+ column
10978
+ } = params;
10979
+ if (columnOpts.drag && !column.fixed && trigger === 'cell' && !(disabledMethod && disabledMethod(params))) {
11001
10980
  triggerDrag = true;
11002
10981
  $xeTable.handleHeaderCellDragMousedownEvent(evnt, params);
11003
10982
  }
@@ -11373,7 +11352,7 @@ const Methods = {
11373
11352
  evnt.dataTransfer.setDragImage(img, 0, 0);
11374
11353
  }
11375
11354
  },
11376
- handleHeaderCellDragDragendEvent(evnt) {
11355
+ handleColDragSwapEvent(evnt, isSyncColumn, dragCol, prevDragCol, prevDragPos, prevDragToChild) {
11377
11356
  const $xeTable = this;
11378
11357
  const props = $xeTable;
11379
11358
  const reactData = $xeTable;
@@ -11389,13 +11368,7 @@ const Methods = {
11389
11368
  dragEndMethod
11390
11369
  } = columnDragOpts;
11391
11370
  const {
11392
- dragCol
11393
- } = reactData;
11394
- const {
11395
- collectColumn,
11396
- prevDragCol,
11397
- prevDragPos,
11398
- prevDragToChild
11371
+ collectColumn
11399
11372
  } = internalData;
11400
11373
  const dragOffsetIndex = prevDragPos === 'right' ? 1 : 0;
11401
11374
  if (prevDragCol && dragCol) {
@@ -11403,7 +11376,7 @@ const Methods = {
11403
11376
  if (prevDragCol !== dragCol) {
11404
11377
  const oldColumn = dragCol;
11405
11378
  const newColumn = prevDragCol;
11406
- Promise.resolve(dragEndMethod ? dragEndMethod({
11379
+ return Promise.resolve(dragEndMethod ? dragEndMethod({
11407
11380
  oldColumn,
11408
11381
  newColumn,
11409
11382
  dragPos: prevDragPos,
@@ -11524,9 +11497,6 @@ const Methods = {
11524
11497
  $xeTable.clearCopyCellArea();
11525
11498
  }
11526
11499
  }
11527
- $xeTable.refreshColumn(true).then(() => {
11528
- $xeTable.updateCellAreas();
11529
- });
11530
11500
  $xeTable.dispatchEvent('column-dragend', {
11531
11501
  oldColumn,
11532
11502
  newColumn,
@@ -11537,10 +11507,31 @@ const Methods = {
11537
11507
  oldIndex: oafIndex
11538
11508
  }
11539
11509
  }, evnt);
11540
- $xeTable.saveCustomStore('update:sort');
11510
+ if (isSyncColumn) {
11511
+ $xeTable.handleUpdateColumn();
11512
+ $xeTable.parseColumns(false).then(() => {
11513
+ $xeTable.updateCellAreas();
11514
+ return $xeTable.saveCustomStore('update:sort');
11515
+ });
11516
+ }
11541
11517
  }).catch(() => {});
11542
11518
  }
11543
11519
  }
11520
+ return Promise.resolve();
11521
+ },
11522
+ handleHeaderCellDragDragendEvent(evnt) {
11523
+ const $xeTable = this;
11524
+ const reactData = $xeTable;
11525
+ const internalData = $xeTable;
11526
+ const {
11527
+ dragCol
11528
+ } = reactData;
11529
+ const {
11530
+ prevDragCol,
11531
+ prevDragPos,
11532
+ prevDragToChild
11533
+ } = internalData;
11534
+ $xeTable.handleColDragSwapEvent(evnt, true, dragCol, prevDragCol, prevDragPos, prevDragToChild);
11544
11535
  hideDropTip($xeTable);
11545
11536
  clearColDropOrigin($xeTable);
11546
11537
  internalData.prevDragToChild = false;
@@ -11548,6 +11539,9 @@ const Methods = {
11548
11539
  reactData.dragCol = null;
11549
11540
  setTimeout(() => {
11550
11541
  reactData.isDragColMove = false;
11542
+ $xeTable.recalculate().then(() => {
11543
+ $xeTable.loadScrollXData();
11544
+ });
11551
11545
  }, 500);
11552
11546
  },
11553
11547
  handleHeaderCellDragDragoverEvent(evnt) {
@@ -11573,11 +11567,11 @@ const Methods = {
11573
11567
  if (column) {
11574
11568
  evnt.preventDefault();
11575
11569
  const {
11576
- dragCol
11577
- } = reactData;
11578
- const offsetX = evnt.clientX - thEl.getBoundingClientRect().x;
11570
+ clientX
11571
+ } = evnt;
11572
+ const offsetX = clientX - thEl.getBoundingClientRect().x;
11579
11573
  const dragPos = offsetX < thEl.clientWidth / 2 ? 'left' : 'right';
11580
- if (dragCol && dragCol.id === column.id || !isCrossDrag && column.parentId) {
11574
+ if (column.fixed || dragCol && dragCol.id === column.id || !isCrossDrag && column.parentId) {
11581
11575
  showDropTip($xeTable, evnt, null, thEl, false, dragPos);
11582
11576
  return;
11583
11577
  }
@@ -11590,6 +11584,35 @@ const Methods = {
11590
11584
  targetColumn: column,
11591
11585
  dragPos
11592
11586
  }, evnt);
11587
+ // 边缘滚动
11588
+ const el = $xeTable.$refs.refElem;
11589
+ if (!el) {
11590
+ return;
11591
+ }
11592
+ const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
11593
+ const tableBody = $xeTable.$refs.tableBody;
11594
+ const tableBodyElem = tableBody ? tableBody.$el : null;
11595
+ const scrollTargetEl = xHandleEl || tableBodyElem;
11596
+ if (scrollTargetEl) {
11597
+ const wrapperRect = el.getBoundingClientRect();
11598
+ const tableWidth = el.clientWidth;
11599
+ const leftContainerElem = $xeTable.$refs.leftContainer;
11600
+ const leftContainerWidth = leftContainerElem ? leftContainerElem.clientWidth : 0;
11601
+ const rightContainerElem = $xeTable.$refs.rightContainer;
11602
+ const rightContainerWidth = rightContainerElem ? rightContainerElem.clientWidth : 0;
11603
+ const srartX = wrapperRect.x + leftContainerWidth;
11604
+ const endX = wrapperRect.x + tableWidth - rightContainerWidth;
11605
+ const distSize = 28;
11606
+ const startDistSize = clientX - srartX;
11607
+ const endDistSize = endX - clientX;
11608
+ if (startDistSize > 0 && startDistSize <= distSize) {
11609
+ const scrollRatio = Math.floor(tableWidth / (startDistSize > distSize / 2 ? 240 : 120));
11610
+ scrollTargetEl.scrollLeft -= scrollRatio * (distSize - startDistSize);
11611
+ } else if (endDistSize > 0 && endDistSize <= distSize) {
11612
+ const scrollRatio = Math.floor(tableWidth / (endDistSize > distSize / 2 ? 240 : 120));
11613
+ scrollTargetEl.scrollLeft += scrollRatio * (distSize - endDistSize);
11614
+ }
11615
+ }
11593
11616
  }
11594
11617
  },
11595
11618
  handleHeaderCellDragMousedownEvent(evnt, params) {
@@ -13147,6 +13170,15 @@ const Methods = {
13147
13170
  });
13148
13171
  this.tableColumn = tableColumn;
13149
13172
  },
13173
+ handleUpdateColumn() {
13174
+ const $xeTable = this;
13175
+ const internalData = $xeTable;
13176
+ const columnList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(internalData.collectColumn, 'renderSortNumber');
13177
+ internalData.collectColumn = columnList;
13178
+ const tableFullColumn = getColumnList(columnList);
13179
+ internalData.tableFullColumn = tableFullColumn;
13180
+ $xeTable.cacheColumnMap();
13181
+ },
13150
13182
  updateScrollXData() {
13151
13183
  const $xeTable = this;
13152
13184
  const props = $xeTable;
@@ -14176,15 +14208,9 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
14176
14208
  }
14177
14209
  // 拖拽行事件
14178
14210
  if (rowOpts.drag && (!treeConfig || transform)) {
14179
- trOn.dragstart = evnt => {
14180
- $xeTable.handleRowDragDragstartEvent(evnt);
14181
- };
14182
- trOn.dragover = evnt => {
14183
- $xeTable.handleRowDragDragoverEvent(evnt);
14184
- };
14185
- trOn.dragend = evnt => {
14186
- $xeTable.handleRowDragDragendEvent(evnt);
14187
- };
14211
+ trOn.dragstart = $xeTable.handleRowDragDragstartEvent;
14212
+ trOn.dragend = $xeTable.handleRowDragDragendEvent;
14213
+ trOn.dragover = $xeTable.handleRowDragDragoverEvent;
14188
14214
  }
14189
14215
  const trClass = ['vxe-body--row', treeConfig ? `row--level-${rowLevel}` : '', {
14190
14216
  'row--stripe': stripe && (_rowIndex + 1) % 2 === 0,
@@ -14336,71 +14362,122 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
14336
14362
  elemStore[`${prefix}emptyBlock`] = null;
14337
14363
  },
14338
14364
  render(h) {
14365
+ const props = this;
14339
14366
  const $xeTable = this.$parent;
14367
+ const tableProps = $xeTable;
14368
+ const tableReactData = $xeTable;
14369
+ const tableInternalData = $xeTable;
14340
14370
  const {
14341
- _e,
14342
- $parent: $xetable,
14343
- fixedColumn,
14344
- fixedType
14345
- } = this;
14346
- const rowOpts = $xeTable.computeRowOpts;
14347
- const rowDragOpts = $xeTable.computeRowDragOpts;
14348
- let {
14349
- $scopedSlots,
14350
14371
  tId,
14351
- tableData,
14352
- tableColumn,
14353
- visibleColumn,
14354
- expandColumn,
14372
+ $scopedSlots
14373
+ } = $xeTable;
14374
+ const {
14375
+ fixedColumn,
14376
+ fixedType,
14377
+ tableColumn
14378
+ } = props;
14379
+ const {
14355
14380
  showOverflow: allColumnOverflow,
14356
- keyboardConfig,
14357
- keyboardOpts,
14358
- mergeList,
14359
14381
  spanMethod,
14382
+ footerSpanMethod,
14383
+ mouseConfig
14384
+ } = tableProps;
14385
+ const {
14386
+ tableData,
14360
14387
  scrollXLoad,
14361
14388
  scrollYLoad,
14362
14389
  isAllOverflow,
14363
- emptyOpts,
14364
- mouseConfig,
14365
- mouseOpts,
14366
- sYOpts,
14367
- isDragRowMove
14368
- } = $xetable;
14369
- // 如果是使用优化模式
14390
+ isDragRowMove,
14391
+ expandColumn,
14392
+ dragRow,
14393
+ dragCol
14394
+ } = tableReactData;
14395
+ const {
14396
+ visibleColumn,
14397
+ fullAllDataRowIdData,
14398
+ fullColumnIdData
14399
+ } = tableInternalData;
14400
+ const rowOpts = $xeTable.computeRowOpts;
14401
+ const sYOpts = $xeTable.computeSYOpts;
14402
+ const emptyOpts = $xeTable.computeEmptyOpts;
14403
+ const mouseOpts = $xeTable.computeMouseOpts;
14404
+ const rowDragOpts = $xeTable.computeRowDragOpts;
14405
+ let renderDataList = tableData;
14406
+ let renderColumnList = tableColumn;
14370
14407
  if (fixedType) {
14371
- // 如果存在展开行使用全量渲染
14372
- if (!expandColumn && (scrollXLoad || scrollYLoad || (allColumnOverflow ? isAllOverflow : allColumnOverflow))) {
14373
- if (!mergeList.length && !spanMethod && !(keyboardConfig && keyboardOpts.isMerge)) {
14374
- tableColumn = fixedColumn;
14408
+ // 如果是使用优化模式
14409
+ if (scrollXLoad || scrollYLoad || allColumnOverflow && isAllOverflow) {
14410
+ // 如果不支持优化模式
14411
+ if (expandColumn || spanMethod || footerSpanMethod) {
14412
+ renderColumnList = visibleColumn;
14375
14413
  } else {
14376
- tableColumn = visibleColumn;
14377
- // 检查固定列是否被合并,合并范围是否超出固定列
14378
- // if (mergeList.length && !isMergeLeftFixedExceeded && fixedType === 'left') {
14379
- // tableColumn = fixedColumn
14380
- // } else if (mergeList.length && !isMergeRightFixedExceeded && fixedType === 'right') {
14381
- // tableColumn = fixedColumn
14382
- // } else {
14383
- // tableColumn = visibleColumn
14384
- // }
14414
+ renderColumnList = fixedColumn || [];
14385
14415
  }
14386
14416
  } else {
14387
- tableColumn = visibleColumn;
14417
+ renderColumnList = visibleColumn;
14418
+ }
14419
+ }
14420
+ // 行拖拽
14421
+ if (scrollYLoad && dragRow) {
14422
+ if (renderDataList.length > 2) {
14423
+ const dRowRest = fullAllDataRowIdData[getRowid($xeTable, dragRow)];
14424
+ if (dRowRest) {
14425
+ const drIndex = dRowRest._index;
14426
+ const firstRow = renderDataList[0];
14427
+ const lastRow = renderDataList[renderDataList.length - 1];
14428
+ const firstRowRest = fullAllDataRowIdData[getRowid($xeTable, firstRow)];
14429
+ const lastRowRest = fullAllDataRowIdData[getRowid($xeTable, lastRow)];
14430
+ if (firstRowRest && lastRowRest) {
14431
+ const frIndex = firstRowRest._index;
14432
+ const lrIndex = lastRowRest._index;
14433
+ if (drIndex < frIndex) {
14434
+ renderDataList = [dragRow].concat(renderDataList);
14435
+ } else if (drIndex > lrIndex) {
14436
+ renderDataList = renderDataList.concat([dragRow]);
14437
+ }
14438
+ }
14439
+ }
14440
+ }
14441
+ }
14442
+ if (!fixedType) {
14443
+ // 列拖拽
14444
+ if (scrollXLoad && dragCol) {
14445
+ if (renderColumnList.length > 2) {
14446
+ const dCowRest = fullColumnIdData[dragCol.id];
14447
+ if (dCowRest) {
14448
+ const dcIndex = dCowRest._index;
14449
+ const firstCol = renderColumnList[0];
14450
+ const lastCol = renderColumnList[renderColumnList.length - 1];
14451
+ const firstColRest = fullColumnIdData[firstCol.id];
14452
+ const lastColRest = fullColumnIdData[lastCol.id];
14453
+ if (firstColRest && lastColRest) {
14454
+ const fcIndex = firstColRest._index;
14455
+ const lcIndex = lastColRest._index;
14456
+ if (dcIndex < fcIndex) {
14457
+ renderColumnList = [dragCol].concat(renderColumnList);
14458
+ } else if (dcIndex > lcIndex) {
14459
+ renderColumnList = renderColumnList.concat([dragCol]);
14460
+ }
14461
+ }
14462
+ }
14463
+ }
14388
14464
  }
14389
14465
  }
14390
14466
  let emptyContent;
14391
14467
  if ($scopedSlots.empty) {
14392
14468
  emptyContent = $scopedSlots.empty.call(this, {
14393
- $table: $xetable
14469
+ $table: $xeTable,
14470
+ $grid: $xeTable.xegrid
14394
14471
  }, h);
14395
14472
  } else {
14396
14473
  const compConf = emptyOpts.name ? body_renderer.get(emptyOpts.name) : null;
14397
14474
  const rtEmptyView = compConf ? compConf.renderTableEmpty || compConf.renderTableEmptyView || compConf.renderEmpty : null;
14398
14475
  if (rtEmptyView) {
14399
14476
  emptyContent = getSlotVNs(rtEmptyView.call(this, h, emptyOpts, {
14400
- $table: $xetable
14477
+ $table: $xeTable
14401
14478
  }));
14402
14479
  } else {
14403
- emptyContent = $xetable.emptyText || body_getI18n('vxe.table.emptyText');
14480
+ emptyContent = tableProps.emptyText || body_getI18n('vxe.table.emptyText');
14404
14481
  }
14405
14482
  }
14406
14483
  const ons = {
@@ -14416,7 +14493,7 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
14416
14493
  xid: tId
14417
14494
  },
14418
14495
  on: ons
14419
- }, [fixedType ? _e() : h('div', {
14496
+ }, [fixedType ? body_renderEmptyElement($xeTable) : h('div', {
14420
14497
  class: 'vxe-body--x-space',
14421
14498
  ref: 'xSpace'
14422
14499
  }), h('div', {
@@ -14437,7 +14514,7 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
14437
14514
  */
14438
14515
  h('colgroup', {
14439
14516
  ref: 'colgroup'
14440
- }, tableColumn.map((column, $columnIndex) => {
14517
+ }, renderColumnList.map((column, $columnIndex) => {
14441
14518
  return h('col', {
14442
14519
  attrs: {
14443
14520
  name: column.id
@@ -14453,9 +14530,9 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
14453
14530
  tag: 'tbody',
14454
14531
  name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`
14455
14532
  }
14456
- }, renderRows(h, this, $xetable, fixedType, tableData, tableColumn)) : h('tbody', {
14533
+ }, renderRows(h, this, $xeTable, fixedType, renderDataList, renderColumnList)) : h('tbody', {
14457
14534
  ref: 'tbody'
14458
- }, renderRows(h, this, $xetable, fixedType, tableData, tableColumn))]), h('div', {
14535
+ }, renderRows(h, this, $xeTable, fixedType, renderDataList, renderColumnList))]), h('div', {
14459
14536
  class: 'vxe-table--checkbox-range'
14460
14537
  }), mouseConfig && mouseOpts.area ? h('div', {
14461
14538
  class: 'vxe-table--cell-area'
@@ -14465,9 +14542,9 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
14465
14542
  class: 'vxe-table--cell-main-area-btn',
14466
14543
  on: {
14467
14544
  mousedown(evnt) {
14468
- if ($xetable.triggerCellAreaExtendMousedownEvent) {
14469
- $xetable.triggerCellAreaExtendMousedownEvent(evnt, {
14470
- $table: $xetable,
14545
+ if ($xeTable.triggerCellAreaExtendMousedownEvent) {
14546
+ $xeTable.triggerCellAreaExtendMousedownEvent(evnt, {
14547
+ $table: $xeTable,
14471
14548
  fixed: fixedType,
14472
14549
  type: renderType
14473
14550
  });
@@ -14703,7 +14780,8 @@ function renderRows(h, _vm, $xeTable, fixedType, tableData, tableColumn) {
14703
14780
 
14704
14781
 
14705
14782
  const {
14706
- renderer: header_renderer
14783
+ renderer: header_renderer,
14784
+ renderEmptyElement: header_renderEmptyElement
14707
14785
  } = core_.VxeUI;
14708
14786
  const cellType = 'header';
14709
14787
  const header_renderRows = (h, _vm, cols, $rowIndex) => {
@@ -14816,6 +14894,7 @@ const header_renderRows = (h, _vm, cols, $rowIndex) => {
14816
14894
  'is--sortable': column.sortable,
14817
14895
  'col--filter': !!column.filters,
14818
14896
  'is--filter-active': hasFilter,
14897
+ 'is--drag-active': !column.fixed && !isDisabledDrag,
14819
14898
  'is--drag-disabled': isDisabledDrag,
14820
14899
  'col--current': currentColumn === column
14821
14900
  }, getClass(headerClassName, params), getClass(headerCellClassName, params)],
@@ -14944,41 +15023,92 @@ function renderHeads(h, _vm, headerGroups) {
14944
15023
  elemStore[`${prefix}repair`] = null;
14945
15024
  },
14946
15025
  render(h) {
15026
+ const props = this;
15027
+ const $xeTable = this.$parent;
15028
+ const tableProps = $xeTable;
15029
+ const tableReactData = $xeTable;
15030
+ const tableInternalData = $xeTable;
15031
+ const {
15032
+ tId
15033
+ } = $xeTable;
14947
15034
  const {
14948
- _e,
14949
- $parent: $xetable,
14950
15035
  fixedType,
14951
- headerColumn,
14952
- tableColumn,
14953
- fixedColumn
15036
+ fixedColumn,
15037
+ tableColumn
15038
+ } = props;
15039
+ const {
15040
+ headerColumn
14954
15041
  } = this;
14955
15042
  const {
14956
- tId,
14957
- isGroup,
14958
- visibleColumn,
14959
15043
  showHeaderOverflow: allColumnHeaderOverflow,
15044
+ spanMethod,
15045
+ footerSpanMethod
15046
+ } = tableProps;
15047
+ const {
15048
+ isGroup,
14960
15049
  scrollXLoad,
14961
- scrollbarWidth
14962
- } = $xetable;
14963
- let headerGroups = headerColumn;
15050
+ scrollYLoad,
15051
+ scrollbarWidth,
15052
+ dragCol
15053
+ } = tableReactData;
15054
+ const {
15055
+ visibleColumn,
15056
+ fullColumnIdData
15057
+ } = tableInternalData;
15058
+ let renderHeaderList = headerColumn;
14964
15059
  let renderColumnList = tableColumn;
14965
15060
  if (isGroup) {
14966
15061
  renderColumnList = visibleColumn;
14967
15062
  } else {
14968
- // 如果是使用优化模式
14969
15063
  if (fixedType) {
14970
- if (scrollXLoad || allColumnHeaderOverflow) {
14971
- renderColumnList = fixedColumn;
15064
+ // 如果是使用优化模式
15065
+ if (scrollXLoad || scrollYLoad || allColumnHeaderOverflow) {
15066
+ // 如果不支持优化模式
15067
+ if (spanMethod || footerSpanMethod) {
15068
+ renderColumnList = visibleColumn;
15069
+ } else {
15070
+ renderColumnList = fixedColumn || [];
15071
+ }
15072
+ } else {
15073
+ renderColumnList = visibleColumn;
15074
+ }
15075
+ }
15076
+ renderHeaderList = [renderColumnList];
15077
+ }
15078
+ if (!fixedType) {
15079
+ // 列拖拽
15080
+ if (scrollXLoad && dragCol) {
15081
+ if (renderColumnList.length > 2) {
15082
+ const dCowRest = fullColumnIdData[dragCol.id];
15083
+ if (dCowRest) {
15084
+ const dcIndex = dCowRest._index;
15085
+ const firstCol = renderColumnList[0];
15086
+ const lastCol = renderColumnList[renderColumnList.length - 1];
15087
+ const firstColRest = fullColumnIdData[firstCol.id];
15088
+ const lastColRest = fullColumnIdData[lastCol.id];
15089
+ if (firstColRest && lastColRest) {
15090
+ const fcIndex = firstColRest._index;
15091
+ const lcIndex = lastColRest._index;
15092
+ console.log(dragCol.id, dcIndex, fcIndex, lcIndex, renderColumnList.length);
15093
+ if (dcIndex < fcIndex) {
15094
+ renderColumnList = [dragCol].concat(renderColumnList);
15095
+ renderHeaderList = [[dragCol].concat(renderHeaderList[0])].concat(renderHeaderList.slice(1));
15096
+ } else if (dcIndex > lcIndex) {
15097
+ renderColumnList = renderColumnList.concat([dragCol]);
15098
+ renderHeaderList = [renderHeaderList[0].concat([dragCol])].concat(renderHeaderList.slice(1));
15099
+ }
15100
+ console.log(renderColumnList.length);
15101
+ }
15102
+ }
14972
15103
  }
14973
15104
  }
14974
- headerGroups = [renderColumnList];
14975
15105
  }
14976
15106
  return h('div', {
14977
15107
  class: ['vxe-table--header-wrapper', fixedType ? `fixed-${fixedType}--wrapper` : 'body--wrapper'],
14978
15108
  attrs: {
14979
15109
  xid: tId
14980
15110
  }
14981
- }, [fixedType ? _e() : h('div', {
15111
+ }, [fixedType ? header_renderEmptyElement($xeTable) : h('div', {
14982
15112
  class: 'vxe-body--x-space',
14983
15113
  ref: 'xSpace'
14984
15114
  }), h('table', {
@@ -15013,7 +15143,7 @@ function renderHeads(h, _vm, headerGroups) {
15013
15143
  */
15014
15144
  h('thead', {
15015
15145
  ref: 'thead'
15016
- }, renderHeads(h, this, headerGroups))]),
15146
+ }, renderHeads(h, this, renderHeaderList))]),
15017
15147
  /**
15018
15148
  * 其他
15019
15149
  */
@@ -15169,7 +15299,8 @@ function renderHeads(h, _vm, headerGroups) {
15169
15299
 
15170
15300
  const footer_renderType = 'footer';
15171
15301
  const {
15172
- renderer: footer_renderer
15302
+ renderer: footer_renderer,
15303
+ renderEmptyElement: footer_renderEmptyElement
15173
15304
  } = core_.VxeUI;
15174
15305
  function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
15175
15306
  for (let mIndex = 0; mIndex < mergeFooterList.length; mIndex++) {
@@ -15357,24 +15488,24 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
15357
15488
  class: 'vxe-footer--gutter col--gutter'
15358
15489
  })] : []);
15359
15490
  }
15360
- function footer_renderHeads(h, _vm, footerTableData) {
15491
+ function footer_renderHeads(h, _vm, renderColumnList) {
15361
15492
  const $xeTable = _vm.$parent;
15493
+ const props = _vm;
15362
15494
  const columnOpts = $xeTable.computeColumnOpts;
15363
15495
  const columnDragOpts = $xeTable.computeColumnDragOpts;
15364
15496
  const {
15365
- $parent: $xetable,
15366
15497
  fixedType,
15367
- tableColumn
15368
- } = _vm;
15498
+ footerTableData
15499
+ } = props;
15369
15500
  const {
15370
15501
  footerRowClassName,
15371
15502
  footerRowStyle,
15372
15503
  isDragColMove
15373
- } = $xetable;
15504
+ } = $xeTable;
15374
15505
  return footerTableData.map((row, $rowIndex) => {
15375
15506
  const _rowIndex = $rowIndex;
15376
15507
  const rowParams = {
15377
- $table: $xetable,
15508
+ $table: $xeTable,
15378
15509
  row,
15379
15510
  _rowIndex,
15380
15511
  $rowIndex,
@@ -15390,13 +15521,13 @@ function footer_renderHeads(h, _vm, footerTableData) {
15390
15521
  class: ['vxe-footer--row', footerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''],
15391
15522
  style: footerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle : null
15392
15523
  }
15393
- }, footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIndex));
15524
+ }, footer_renderRows(h, _vm, renderColumnList, footerTableData, row, $rowIndex, _rowIndex));
15394
15525
  }
15395
15526
  return h('tr', {
15396
15527
  key: $rowIndex,
15397
15528
  class: ['vxe-footer--row', footerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''],
15398
15529
  style: footerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle : null
15399
- }, footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIndex));
15530
+ }, footer_renderRows(h, _vm, renderColumnList, footerTableData, row, $rowIndex, _rowIndex));
15400
15531
  });
15401
15532
  }
15402
15533
  /* harmony default export */ var footer = ({
@@ -15441,35 +15572,71 @@ function footer_renderHeads(h, _vm, footerTableData) {
15441
15572
  elemStore[`${prefix}xSpace`] = null;
15442
15573
  },
15443
15574
  render(h) {
15444
- let {
15445
- _e,
15446
- $parent: $xetable,
15575
+ const props = this;
15576
+ const $xeTable = this.$parent;
15577
+ const tableProps = $xeTable;
15578
+ const tableReactData = $xeTable;
15579
+ const tableInternalData = $xeTable;
15580
+ const {
15581
+ tId
15582
+ } = $xeTable;
15583
+ const {
15447
15584
  fixedType,
15448
15585
  fixedColumn,
15449
- tableColumn,
15450
- footerTableData
15451
- } = this;
15586
+ tableColumn
15587
+ } = props;
15452
15588
  const {
15453
- tId,
15454
- mergeFooterList,
15589
+ spanMethod,
15455
15590
  footerSpanMethod,
15591
+ showFooterOverflow: allColumnFooterOverflow
15592
+ } = tableProps;
15593
+ const {
15594
+ visibleColumn,
15595
+ fullColumnIdData
15596
+ } = tableInternalData;
15597
+ const {
15456
15598
  scrollXLoad,
15457
- showFooterOverflow: allColumnFooterOverflow,
15599
+ scrollYLoad,
15458
15600
  scrollbarWidth,
15459
- visibleColumn,
15460
- expandColumn
15461
- } = $xetable;
15601
+ dragCol
15602
+ } = tableReactData;
15603
+ let renderColumnList = tableColumn;
15462
15604
  // 如果是使用优化模式
15463
15605
  if (fixedType) {
15464
- // 如果存在展开行使用全量渲染
15465
- if (!expandColumn && (scrollXLoad || allColumnFooterOverflow)) {
15466
- if (!mergeFooterList.length || !footerSpanMethod) {
15467
- tableColumn = fixedColumn;
15606
+ // 如果是使用优化模式
15607
+ if (scrollXLoad || scrollYLoad || allColumnFooterOverflow) {
15608
+ // 如果不支持优化模式
15609
+ if (spanMethod || footerSpanMethod) {
15610
+ renderColumnList = visibleColumn;
15468
15611
  } else {
15469
- tableColumn = visibleColumn;
15612
+ renderColumnList = fixedColumn || [];
15470
15613
  }
15471
15614
  } else {
15472
- tableColumn = visibleColumn;
15615
+ renderColumnList = visibleColumn;
15616
+ }
15617
+ }
15618
+ if (!fixedType) {
15619
+ // 列拖拽
15620
+ if (scrollXLoad && dragCol) {
15621
+ if (renderColumnList.length > 2) {
15622
+ const dCowRest = fullColumnIdData[dragCol.id];
15623
+ if (dCowRest) {
15624
+ const dcIndex = dCowRest._index;
15625
+ const firstCol = renderColumnList[0];
15626
+ const lastCol = renderColumnList[renderColumnList.length - 1];
15627
+ const firstColRest = fullColumnIdData[firstCol.id];
15628
+ const lastColRest = fullColumnIdData[lastCol.id];
15629
+ if (firstColRest && lastColRest) {
15630
+ const fcIndex = firstColRest._index;
15631
+ const lcIndex = lastColRest._index;
15632
+ if (dcIndex < fcIndex) {
15633
+ renderColumnList = [dragCol].concat(renderColumnList);
15634
+ } else if (dcIndex > lcIndex) {
15635
+ renderColumnList = renderColumnList.concat([dragCol]);
15636
+ }
15637
+ }
15638
+ }
15639
+ }
15473
15640
  }
15474
15641
  }
15475
15642
  const ons = {};
@@ -15482,7 +15649,7 @@ function footer_renderHeads(h, _vm, footerTableData) {
15482
15649
  xid: tId
15483
15650
  },
15484
15651
  on: ons
15485
- }, [fixedType ? _e() : h('div', {
15652
+ }, [fixedType ? footer_renderEmptyElement($xeTable) : h('div', {
15486
15653
  class: 'vxe-body--x-space',
15487
15654
  ref: 'xSpace'
15488
15655
  }), h('table', {
@@ -15500,7 +15667,7 @@ function footer_renderHeads(h, _vm, footerTableData) {
15500
15667
  */
15501
15668
  h('colgroup', {
15502
15669
  ref: 'colgroup'
15503
- }, tableColumn.map((column, $columnIndex) => {
15670
+ }, renderColumnList.map((column, $columnIndex) => {
15504
15671
  return h('col', {
15505
15672
  attrs: {
15506
15673
  name: column.id
@@ -15517,7 +15684,7 @@ function footer_renderHeads(h, _vm, footerTableData) {
15517
15684
  */
15518
15685
  h('tfoot', {
15519
15686
  ref: 'tfoot'
15520
- }, footer_renderHeads(h, this, footerTableData))])]);
15687
+ }, footer_renderHeads(h, this, renderColumnList))])]);
15521
15688
  },
15522
15689
  methods: {
15523
15690
  /**
@@ -23889,19 +24056,6 @@ function handleUupdateResize(_vm) {
23889
24056
  y: overflowY && scrollYLoad
23890
24057
  };
23891
24058
  },
23892
- computeTableStyle() {
23893
- const $xeTable = this;
23894
- const reactData = $xeTable;
23895
- const {
23896
- tableData
23897
- } = reactData;
23898
- const columnOpts = $xeTable.computeColumnOpts;
23899
- const stys = {};
23900
- if (columnOpts.drag) {
23901
- stys['--vxe-ui-table-drag-column-move-delay'] = `${Math.max(0.06, Math.min(0.3, tableData.length / 800))}s`;
23902
- }
23903
- return stys;
23904
- },
23905
24059
  tabsResizeFlag() {
23906
24060
  const $xeTable = this;
23907
24061
  const $xeTabs = $xeTable.$xeTabs;
@@ -23957,6 +24111,11 @@ function handleUupdateResize(_vm) {
23957
24111
  maxHeight() {
23958
24112
  this.$nextTick(() => this.recalculate(true));
23959
24113
  },
24114
+ computeSize() {
24115
+ this.$nextTick(() => {
24116
+ this.recalculate(true).then(() => this.refreshScroll());
24117
+ });
24118
+ },
23960
24119
  syncResize(value) {
23961
24120
  if (value) {
23962
24121
  handleUupdateResize(this);
@@ -24376,7 +24535,6 @@ function handleUupdateResize(_vm) {
24376
24535
  const tableBorder = $xeTable.computeTableBorder;
24377
24536
  const virtualScrollBars = $xeTable.computeVirtualScrollBars;
24378
24537
  const isArea = mouseConfig && mouseOpts.area;
24379
- const tableStyle = $xeTable.computeTableStyle;
24380
24538
  const columnDragOpts = $xeTable.computeColumnDragOpts;
24381
24539
  return h('div', {
24382
24540
  ref: 'refElem',
@@ -24411,7 +24569,6 @@ function handleUupdateResize(_vm) {
24411
24569
  'is--virtual-x': scrollXLoad,
24412
24570
  'is--virtual-y': scrollYLoad
24413
24571
  }],
24414
- style: tableStyle,
24415
24572
  attrs: {
24416
24573
  spellcheck: false
24417
24574
  },
@@ -26937,6 +27094,9 @@ const {
26937
27094
  } = core_.VxeUI;
26938
27095
  const componentDefaultModelProp = 'value';
26939
27096
  const defaultCompProps = {};
27097
+ function handleDefaultValue(value, defaultVal, initVal) {
27098
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(value) ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(defaultVal) ? initVal : defaultVal : value;
27099
+ }
26940
27100
  function parseDate(value, props) {
26941
27101
  return value && props.valueFormat ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toStringDate(value, props.valueFormat) : value;
26942
27102
  }
@@ -27634,15 +27794,27 @@ render_renderer.mixin({
27634
27794
  if (cellValue) {
27635
27795
  const numberInputConfig = render_getConfig().numberInput || {};
27636
27796
  if (type === 'float') {
27637
- const digits = props.digits || numberInputConfig.digits || 1;
27797
+ const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
27798
+ const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
27638
27799
  cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().floor(cellValue, digits), digits);
27800
+ if (!autoFill) {
27801
+ cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);
27802
+ }
27639
27803
  } else if (type === 'amount') {
27640
- const digits = props.digits || numberInputConfig.digits || 2;
27804
+ const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
27805
+ const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
27806
+ const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
27641
27807
  cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().commafy(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue), {
27642
27808
  digits
27643
27809
  });
27644
- const showCurrency = props.showCurrency;
27645
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(showCurrency) ? showCurrency : numberInputConfig.showCurrency) {
27810
+ if (!autoFill) {
27811
+ const [iStr, dStr] = cellValue.split('.');
27812
+ if (dStr) {
27813
+ const dRest = dStr.replace(/0+$/, '');
27814
+ cellValue = dRest ? [iStr, '.', dRest].join('') : iStr;
27815
+ }
27816
+ }
27817
+ if (showCurrency) {
27646
27818
  cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || render_getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`;
27647
27819
  }
27648
27820
  }
@@ -27662,20 +27834,38 @@ render_renderer.mixin({
27662
27834
  type
27663
27835
  } = props;
27664
27836
  // 兼容老模式
27665
- const cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(row) ? row[_columnIndex] : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
27666
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(cellValue)) {
27837
+ const itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(row) ? row[_columnIndex] : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
27838
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(itemValue)) {
27667
27839
  const numberInputConfig = render_getConfig().numberInput || {};
27668
27840
  if (type === 'float') {
27669
- const digits = props.digits || numberInputConfig.digits || 1;
27670
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().floor(cellValue, digits), digits);
27841
+ const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
27842
+ const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
27843
+ let amountLabel = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().floor(itemValue, digits), digits);
27844
+ if (!autoFill) {
27845
+ amountLabel = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(amountLabel);
27846
+ }
27847
+ return amountLabel;
27671
27848
  } else if (type === 'amount') {
27672
- const digits = props.digits || numberInputConfig.digits || 2;
27673
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().commafy(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue), {
27849
+ const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
27850
+ const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
27851
+ const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
27852
+ let amountLabel = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().commafy(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(itemValue), {
27674
27853
  digits
27675
27854
  });
27855
+ if (!autoFill) {
27856
+ const [iStr, dStr] = amountLabel.split('.');
27857
+ if (dStr) {
27858
+ const dRest = dStr.replace(/0+$/, '');
27859
+ amountLabel = dRest ? [iStr, '.', dRest].join('') : iStr;
27860
+ }
27861
+ }
27862
+ if (showCurrency) {
27863
+ amountLabel = `${props.currencySymbol || numberInputConfig.currencySymbol || render_getI18n('vxe.numberInput.currencySymbol') || ''}${amountLabel}`;
27864
+ }
27865
+ return amountLabel;
27676
27866
  }
27677
27867
  }
27678
- return getFuncText(cellValue, 1);
27868
+ return getFuncText(itemValue, 1);
27679
27869
  },
27680
27870
  renderTableDefault: defaultEditRender,
27681
27871
  renderTableFilter: defaultFilterRender,
@@ -27702,7 +27892,9 @@ render_renderer.mixin({
27702
27892
  } = params;
27703
27893
  let cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
27704
27894
  if (cellValue) {
27705
- cellValue = getLabelFormatDate(cellValue, props);
27895
+ if (props.type !== 'time') {
27896
+ cellValue = getLabelFormatDate(cellValue, props);
27897
+ }
27706
27898
  }
27707
27899
  return getCellLabelVNs(h, renderOpts, params, cellValue);
27708
27900
  },