vxe-table 3.12.16 → 3.13.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 (51) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/table/module/edit/mixin.js +5 -5
  6. package/es/table/src/body.js +60 -47
  7. package/es/table/src/methods.js +123 -24
  8. package/es/table/src/table.js +101 -23
  9. package/es/table/style.css +26 -0
  10. package/es/table/style.min.css +1 -1
  11. package/es/ui/index.js +3 -2
  12. package/es/ui/src/log.js +1 -1
  13. package/es/vxe-table/style.css +26 -0
  14. package/es/vxe-table/style.min.css +1 -1
  15. package/helper/vetur/attributes.json +1 -1
  16. package/helper/vetur/tags.json +1 -1
  17. package/lib/index.css +1 -1
  18. package/lib/index.min.css +1 -1
  19. package/lib/index.umd.js +352 -114
  20. package/lib/index.umd.min.js +1 -1
  21. package/lib/style.css +1 -1
  22. package/lib/style.min.css +1 -1
  23. package/lib/table/module/edit/mixin.js +10 -5
  24. package/lib/table/module/edit/mixin.min.js +1 -1
  25. package/lib/table/src/body.js +71 -59
  26. package/lib/table/src/body.min.js +1 -1
  27. package/lib/table/src/methods.js +141 -23
  28. package/lib/table/src/methods.min.js +1 -1
  29. package/lib/table/src/table.js +126 -24
  30. package/lib/table/src/table.min.js +1 -1
  31. package/lib/table/style/style.css +26 -0
  32. package/lib/table/style/style.min.css +1 -1
  33. package/lib/ui/index.js +3 -2
  34. package/lib/ui/index.min.js +1 -1
  35. package/lib/ui/src/log.js +1 -1
  36. package/lib/ui/src/log.min.js +1 -1
  37. package/lib/vxe-table/style/style.css +26 -0
  38. package/lib/vxe-table/style/style.min.css +1 -1
  39. package/package.json +2 -2
  40. package/packages/table/module/edit/mixin.ts +5 -5
  41. package/packages/table/src/body.ts +62 -48
  42. package/packages/table/src/methods.ts +125 -24
  43. package/packages/table/src/table.ts +108 -24
  44. package/packages/ui/index.ts +2 -1
  45. package/styles/components/table.scss +26 -0
  46. /package/es/{iconfont.1739333092714.ttf → iconfont.1739430844646.ttf} +0 -0
  47. /package/es/{iconfont.1739333092714.woff → iconfont.1739430844646.woff} +0 -0
  48. /package/es/{iconfont.1739333092714.woff2 → iconfont.1739430844646.woff2} +0 -0
  49. /package/lib/{iconfont.1739333092714.ttf → iconfont.1739430844646.ttf} +0 -0
  50. /package/lib/{iconfont.1739333092714.woff → iconfont.1739430844646.woff} +0 -0
  51. /package/lib/{iconfont.1739333092714.woff2 → iconfont.1739430844646.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.16";
2223
+ const version = "3.13.0-beta.0";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2357,7 +2357,8 @@ core_.VxeUI.setConfig({
2357
2357
  },
2358
2358
  expandConfig: {
2359
2359
  // trigger: 'default',
2360
- showIcon: true
2360
+ showIcon: true,
2361
+ mode: 'fixed'
2361
2362
  },
2362
2363
  editConfig: {
2363
2364
  // mode: 'cell',
@@ -2842,7 +2843,7 @@ function isNodeElement(elem) {
2842
2843
  const {
2843
2844
  log: log_log
2844
2845
  } = core_.VxeUI;
2845
- const log_version = `table v${"3.12.16"}`;
2846
+ const log_version = `table v${"3.13.0-beta.0"}`;
2846
2847
  const warnLog = log_log.create('warn', log_version);
2847
2848
  const errLog = log_log.create('error', log_version);
2848
2849
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -5450,7 +5451,8 @@ function updateAfterListIndex($xeTable) {
5450
5451
  level: 0,
5451
5452
  height: 0,
5452
5453
  resizeHeight: 0,
5453
- oTop: 0
5454
+ oTop: 0,
5455
+ expandHeight: 0
5454
5456
  };
5455
5457
  fullAllDataRowIdData[rowid] = rest;
5456
5458
  fullDataRowIdData[rowid] = rest;
@@ -5502,7 +5504,8 @@ function updateAfterDataIndex($xeTable) {
5502
5504
  level: 0,
5503
5505
  height: 0,
5504
5506
  resizeHeight: 0,
5505
- oTop: 0
5507
+ oTop: 0,
5508
+ expandHeight: 0
5506
5509
  };
5507
5510
  fullAllDataRowIdData[rowid] = rest;
5508
5511
  fullDataRowIdData[rowid] = rest;
@@ -5608,6 +5611,7 @@ function updateStyle($xeTable) {
5608
5611
  const emptyPlaceholderElem = $xeTable.$refs.refEmptyPlaceholder;
5609
5612
  const cellOffsetWidth = $xeTable.computeCellOffsetWidth;
5610
5613
  const mouseOpts = $xeTable.computeMouseOpts;
5614
+ const expandOpts = $xeTable.computeExpandOpts;
5611
5615
  const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper']);
5612
5616
  const bodyTableElem = getRefElem(elemStore['main-body-table']);
5613
5617
  if (emptyPlaceholderElem) {
@@ -5677,6 +5681,11 @@ function updateStyle($xeTable) {
5677
5681
  yBottomCornerEl.style.top = `${headerHeight + bodyHeight}px`;
5678
5682
  yBottomCornerEl.style.display = footerHeight ? 'block' : '';
5679
5683
  }
5684
+ const rowExpandEl = $xeTable.$refs.refRowExpandElem;
5685
+ if (rowExpandEl) {
5686
+ rowExpandEl.style.height = `${bodyHeight}px`;
5687
+ rowExpandEl.style.top = `${headerHeight}px`;
5688
+ }
5680
5689
  containerList.forEach((name, index) => {
5681
5690
  const fixedType = index > 0 ? name : '';
5682
5691
  const layoutList = ['header', 'body', 'footer'];
@@ -5786,7 +5795,7 @@ function updateStyle($xeTable) {
5786
5795
  let isOptimizeMode = false;
5787
5796
  // 如果是使用优化模式
5788
5797
  if (scrollXLoad || scrollYLoad || isAllOverflow) {
5789
- if (expandColumn || spanMethod || footerSpanMethod) {
5798
+ if (expandColumn && expandOpts.mode !== 'fixed' || spanMethod || footerSpanMethod) {
5790
5799
  // 如果不支持优化模式
5791
5800
  } else {
5792
5801
  isOptimizeMode = true;
@@ -5912,6 +5921,15 @@ function updateStyle($xeTable) {
5912
5921
  }
5913
5922
  return $xeTable.$nextTick();
5914
5923
  }
5924
+ function calcVarRowHeightConfig($xeTable, sizeKey, sizeEl) {
5925
+ const reactData = $xeTable;
5926
+ const {
5927
+ rowHeightStore
5928
+ } = reactData;
5929
+ if (sizeEl && sizeEl.clientHeight) {
5930
+ rowHeightStore[sizeKey] = sizeEl.clientHeight;
5931
+ }
5932
+ }
5915
5933
  function computeRowHeight($xeTable) {
5916
5934
  const reactData = $xeTable;
5917
5935
  const {
@@ -5947,7 +5965,9 @@ function handleVirtualYVisible($xeTable, currScrollTop) {
5947
5965
  const reactData = $xeTable;
5948
5966
  const internalData = $xeTable;
5949
5967
  const {
5950
- isAllOverflow
5968
+ isAllOverflow,
5969
+ expandColumn,
5970
+ rowExpandedMaps
5951
5971
  } = reactData;
5952
5972
  const {
5953
5973
  elemStore,
@@ -5955,6 +5975,7 @@ function handleVirtualYVisible($xeTable, currScrollTop) {
5955
5975
  afterFullData,
5956
5976
  fullAllDataRowIdData
5957
5977
  } = internalData;
5978
+ const expandOpts = $xeTable.computeExpandOpts;
5958
5979
  const rowOpts = $xeTable.computeRowOpts;
5959
5980
  const cellOpts = $xeTable.computeCellOpts;
5960
5981
  const defaultRowHeight = $xeTable.computeDefaultRowHeight;
@@ -5967,7 +5988,7 @@ function handleVirtualYVisible($xeTable, currScrollTop) {
5967
5988
  let offsetTop = 0;
5968
5989
  let visibleSize = 0;
5969
5990
  const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
5970
- if (!isCustomCellHeight && isAllOverflow) {
5991
+ if (!isCustomCellHeight && !expandColumn && isAllOverflow) {
5971
5992
  toVisibleIndex = Math.floor(scrollTop / defaultRowHeight);
5972
5993
  visibleSize = Math.ceil(clientHeight / defaultRowHeight) + 1;
5973
5994
  } else {
@@ -5985,6 +6006,10 @@ function handleVirtualYVisible($xeTable, currScrollTop) {
5985
6006
  break;
5986
6007
  }
5987
6008
  }
6009
+ // 是否展开行
6010
+ if (expandColumn && rowExpandedMaps[rowid]) {
6011
+ offsetTop += rowRest.expandHeight || expandOpts.height || 0;
6012
+ }
5988
6013
  }
5989
6014
  }
5990
6015
  return {
@@ -6684,9 +6709,18 @@ function handleRecalculateLayout($xeTable, reFull) {
6684
6709
  if (!el || !el.clientWidth) {
6685
6710
  return $xeTable.$nextTick();
6686
6711
  }
6712
+ const varEl = $xeTable.$refs.refVarElem;
6713
+ if (varEl) {
6714
+ const [defEl, mediumEl, smallEl, miniEl] = varEl.children;
6715
+ calcVarRowHeightConfig($xeTable, 'default', defEl);
6716
+ calcVarRowHeightConfig($xeTable, 'medium', mediumEl);
6717
+ calcVarRowHeightConfig($xeTable, 'small', smallEl);
6718
+ calcVarRowHeightConfig($xeTable, 'mini', miniEl);
6719
+ }
6687
6720
  calcCellWidth($xeTable);
6688
6721
  autoCellWidth($xeTable);
6689
6722
  updateStyle($xeTable);
6723
+ updateRowExpandStyle($xeTable);
6690
6724
  return computeScrollLoad($xeTable).then(() => {
6691
6725
  if (reFull === true) {
6692
6726
  // 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
@@ -6694,6 +6728,7 @@ function handleRecalculateLayout($xeTable, reFull) {
6694
6728
  calcCellWidth($xeTable);
6695
6729
  autoCellWidth($xeTable);
6696
6730
  updateStyle($xeTable);
6731
+ updateRowExpandStyle($xeTable);
6697
6732
  return computeScrollLoad($xeTable);
6698
6733
  }
6699
6734
  });
@@ -7176,7 +7211,7 @@ function calcCellWidth($xeTable) {
7176
7211
  el.removeAttribute('data-calc-col');
7177
7212
  }
7178
7213
  }
7179
- const handleUpdateColResize = ($xeTable, evnt, params) => {
7214
+ function handleUpdateColResize($xeTable, evnt, params) {
7180
7215
  $xeTable.analyColumnWidth();
7181
7216
  $xeTable.recalculate(true).then(() => {
7182
7217
  $xeTable.saveCustomStore('update:width');
@@ -7186,8 +7221,8 @@ const handleUpdateColResize = ($xeTable, evnt, params) => {
7186
7221
  $xeTable.dispatchEvent('resizable-change', params, evnt);
7187
7222
  setTimeout(() => $xeTable.recalculate(true), 300);
7188
7223
  });
7189
- };
7190
- const handleUpdateRowResize = ($xeTable, evnt, params) => {
7224
+ }
7225
+ function handleUpdateRowResize($xeTable, evnt, params) {
7191
7226
  const reactData = $xeTable;
7192
7227
  reactData.resizeHeightFlag++;
7193
7228
  $xeTable.recalculate(true).then(() => {
@@ -7195,7 +7230,74 @@ const handleUpdateRowResize = ($xeTable, evnt, params) => {
7195
7230
  $xeTable.dispatchEvent('row-resizable-change', params, evnt);
7196
7231
  setTimeout(() => $xeTable.recalculate(true), 300);
7197
7232
  });
7198
- };
7233
+ }
7234
+ function updateRowExpandStyle($xeTable) {
7235
+ const reactData = $xeTable;
7236
+ const internalData = $xeTable;
7237
+ const {
7238
+ expandColumn,
7239
+ scrollYLoad,
7240
+ rowExpandedMaps
7241
+ } = reactData;
7242
+ const expandOpts = $xeTable.computeExpandOpts;
7243
+ const rowOpts = $xeTable.computeRowOpts;
7244
+ const cellOpts = $xeTable.computeCellOpts;
7245
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight;
7246
+ const {
7247
+ mode
7248
+ } = expandOpts;
7249
+ if (expandColumn && mode === 'fixed') {
7250
+ const {
7251
+ elemStore,
7252
+ afterFullData,
7253
+ fullAllDataRowIdData
7254
+ } = internalData;
7255
+ const rowExpandEl = $xeTable.$refs.refRowExpandElem;
7256
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
7257
+ if (rowExpandEl && bodyScrollElem) {
7258
+ let isUpdateHeight = false;
7259
+ if (scrollYLoad) {
7260
+ let offsetTop = 0;
7261
+ for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
7262
+ const row = afterFullData[rIndex];
7263
+ const rowid = getRowid($xeTable, row);
7264
+ const rowRest = fullAllDataRowIdData[rowid] || {};
7265
+ rowRest.oTop = offsetTop;
7266
+ offsetTop += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
7267
+ // 是否展开行
7268
+ if (expandColumn && rowExpandedMaps[rowid]) {
7269
+ offsetTop += rowRest.expandHeight || expandOpts.height || 0;
7270
+ }
7271
+ }
7272
+ }
7273
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(rowExpandEl.children, reEl => {
7274
+ const expandEl = reEl;
7275
+ const rowid = expandEl.getAttribute('rowid') || '';
7276
+ const rowRest = fullAllDataRowIdData[rowid];
7277
+ if (rowRest) {
7278
+ const expandHeight = expandEl.offsetHeight + 1;
7279
+ if (scrollYLoad) {
7280
+ expandEl.style.top = toCssUnit(rowRest.oTop + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight));
7281
+ } else {
7282
+ const trEl = bodyScrollElem.querySelector(`.vxe-body--row[rowid="${rowid}"]`);
7283
+ if (trEl) {
7284
+ expandEl.style.top = toCssUnit(trEl.offsetTop + trEl.offsetHeight);
7285
+ }
7286
+ }
7287
+ if (!isUpdateHeight) {
7288
+ if (rowRest.expandHeight !== expandHeight) {
7289
+ isUpdateHeight = true;
7290
+ }
7291
+ }
7292
+ rowRest.expandHeight = expandHeight;
7293
+ }
7294
+ });
7295
+ if (isUpdateHeight) {
7296
+ reactData.rowExpandHeightFlag++;
7297
+ }
7298
+ }
7299
+ }
7300
+ }
7199
7301
  const Methods = {
7200
7302
  callSlot(slotFunc, params, h, vNodes) {
7201
7303
  if (slotFunc) {
@@ -7626,7 +7728,8 @@ const Methods = {
7626
7728
  level,
7627
7729
  height: 0,
7628
7730
  resizeHeight: 0,
7629
- oTop: 0
7731
+ oTop: 0,
7732
+ expandHeight: 0
7630
7733
  };
7631
7734
  }
7632
7735
  cacheItem.row = row;
@@ -7732,7 +7835,8 @@ const Methods = {
7732
7835
  level: parentLevel + nodes.length,
7733
7836
  height: 0,
7734
7837
  resizeHeight: 0,
7735
- oTop: 0
7838
+ oTop: 0,
7839
+ expandHeight: 0
7736
7840
  };
7737
7841
  fullDataRowIdData[rowid] = rest;
7738
7842
  fullAllDataRowIdData[rowid] = rest;
@@ -9841,6 +9945,7 @@ const Methods = {
9841
9945
  const el = $xeTable.$refs.refElem;
9842
9946
  if (el && el.clientWidth) {
9843
9947
  autoCellWidth($xeTable);
9948
+ updateRowExpandStyle($xeTable);
9844
9949
  }
9845
9950
  if (rceTimeout) {
9846
9951
  clearTimeout(rceTimeout);
@@ -14236,6 +14341,7 @@ const Methods = {
14236
14341
  direction,
14237
14342
  ...params
14238
14343
  };
14344
+ updateRowExpandStyle($xeTable);
14239
14345
  checkLastSyncScroll($xeTable, isRollX, isRollY);
14240
14346
  if (rowOpts.isHover || highlightHoverRow) {
14241
14347
  $xeTable.clearHoverRow();
@@ -14302,6 +14408,7 @@ const Methods = {
14302
14408
  const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
14303
14409
  const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
14304
14410
  const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
14411
+ const rowExpandEl = $xeTable.$refs.refRowExpandElem;
14305
14412
  if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
14306
14413
  return;
14307
14414
  }
@@ -14348,6 +14455,7 @@ const Methods = {
14348
14455
  setScrollTop(rightScrollElem, scrollTop);
14349
14456
  }
14350
14457
  setScrollTop(yHandleEl, scrollTop);
14458
+ setScrollTop(rowExpandEl, scrollTop);
14351
14459
  if (scrollYLoad) {
14352
14460
  $xeTable.triggerScrollYEvent(evnt);
14353
14461
  }
@@ -14497,6 +14605,7 @@ const Methods = {
14497
14605
  const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
14498
14606
  const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
14499
14607
  const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
14608
+ const rowExpandEl = $xeTable.$refs.refRowExpandElem;
14500
14609
  if (!xHandleEl) {
14501
14610
  return;
14502
14611
  }
@@ -14532,6 +14641,7 @@ const Methods = {
14532
14641
  setScrollTop(bodyScrollElem, currTopNum);
14533
14642
  setScrollTop(leftScrollElem, currTopNum);
14534
14643
  setScrollTop(rightScrollElem, currTopNum);
14644
+ setScrollTop(rowExpandEl, currTopNum);
14535
14645
  if (scrollYLoad) {
14536
14646
  $xeTable.triggerScrollYEvent(evnt);
14537
14647
  }
@@ -14540,16 +14650,6 @@ const Methods = {
14540
14650
  fixed: ''
14541
14651
  });
14542
14652
  });
14543
- // internalData.inWheelScroll = true
14544
- // setScrollTop(yHandleEl, scrollTop)
14545
- // setScrollTop(bodyScrollElem, scrollTop)
14546
- // setScrollTop(leftScrollElem, scrollTop)
14547
- // setScrollTop(rightScrollElem, scrollTop)
14548
- // loadScrollYData($xeTable, scrollTop)
14549
- // $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
14550
- // type: 'footer',
14551
- // fixed: ''
14552
- // })
14553
14653
  }
14554
14654
  },
14555
14655
  triggerVirtualScrollXEvent(evnt) {
@@ -14624,6 +14724,7 @@ const Methods = {
14624
14724
  const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
14625
14725
  const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
14626
14726
  const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
14727
+ const rowExpandEl = $xeTable.$refs.refRowExpandElem;
14627
14728
  const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
14628
14729
  const wrapperEl = evnt.currentTarget;
14629
14730
  const {
@@ -14640,6 +14741,7 @@ const Methods = {
14640
14741
  setScrollTop(bodyScrollElem, scrollTop);
14641
14742
  setScrollTop(leftScrollElem, scrollTop);
14642
14743
  setScrollTop(rightScrollElem, scrollTop);
14744
+ setScrollTop(rowExpandEl, scrollTop);
14643
14745
  if (scrollYLoad) {
14644
14746
  $xeTable.triggerScrollYEvent(evnt);
14645
14747
  }
@@ -14655,6 +14757,7 @@ const Methods = {
14655
14757
  isAllOverflow
14656
14758
  } = reactData;
14657
14759
  handleTableColumn($xeTable);
14760
+ $xeTable.updateScrollXSpace();
14658
14761
  return $xeTable.$nextTick().then(() => {
14659
14762
  handleTableColumn($xeTable);
14660
14763
  $xeTable.updateScrollXSpace();
@@ -14722,6 +14825,7 @@ const Methods = {
14722
14825
  updateScrollYData() {
14723
14826
  const $xeTable = this;
14724
14827
  $xeTable.handleTableData();
14828
+ $xeTable.updateScrollYSpace();
14725
14829
  return $xeTable.$nextTick().then(() => {
14726
14830
  $xeTable.handleTableData();
14727
14831
  $xeTable.updateScrollYSpace();
@@ -14734,7 +14838,9 @@ const Methods = {
14734
14838
  const internalData = $xeTable;
14735
14839
  const {
14736
14840
  isAllOverflow,
14737
- scrollYLoad
14841
+ scrollYLoad,
14842
+ expandColumn,
14843
+ rowExpandedMaps
14738
14844
  } = reactData;
14739
14845
  const {
14740
14846
  scrollYStore,
@@ -14746,6 +14852,7 @@ const Methods = {
14746
14852
  const {
14747
14853
  startIndex
14748
14854
  } = scrollYStore;
14855
+ const expandOpts = $xeTable.computeExpandOpts;
14749
14856
  const rowOpts = $xeTable.computeRowOpts;
14750
14857
  const cellOpts = $xeTable.computeCellOpts;
14751
14858
  const defaultRowHeight = $xeTable.computeDefaultRowHeight;
@@ -14755,7 +14862,7 @@ const Methods = {
14755
14862
  let ySpaceHeight = 0;
14756
14863
  if (scrollYLoad) {
14757
14864
  const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
14758
- if (!isCustomCellHeight && isAllOverflow) {
14865
+ if (!isCustomCellHeight && !expandColumn && isAllOverflow) {
14759
14866
  ySpaceHeight = afterFullData.length * defaultRowHeight;
14760
14867
  topSpaceHeight = Math.max(0, startIndex * defaultRowHeight);
14761
14868
  } else {
@@ -14764,12 +14871,20 @@ const Methods = {
14764
14871
  const rowid = getRowid($xeTable, row);
14765
14872
  const rowRest = fullAllDataRowIdData[rowid] || {};
14766
14873
  ySpaceHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
14874
+ // 是否展开行
14875
+ if (expandColumn && rowExpandedMaps[rowid]) {
14876
+ ySpaceHeight += rowRest.expandHeight || expandOpts.height || 0;
14877
+ }
14767
14878
  }
14768
14879
  for (let i = 0; i < startIndex; i++) {
14769
14880
  const row = afterFullData[i];
14770
14881
  const rowid = getRowid($xeTable, row);
14771
14882
  const rowRest = fullAllDataRowIdData[rowid] || {};
14772
14883
  topSpaceHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
14884
+ // 是否展开行
14885
+ if (expandColumn && rowExpandedMaps[rowid]) {
14886
+ topSpaceHeight += rowRest.expandHeight || expandOpts.height || 0;
14887
+ }
14773
14888
  }
14774
14889
  }
14775
14890
  } else {
@@ -14794,6 +14909,10 @@ const Methods = {
14794
14909
  if (scrollYSpaceEl) {
14795
14910
  scrollYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
14796
14911
  }
14912
+ const rowExpandYSpaceEl = $xeTable.$refs.refRowExpandYSpaceElem;
14913
+ if (rowExpandYSpaceEl) {
14914
+ rowExpandYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
14915
+ }
14797
14916
  return $xeTable.$nextTick().then(() => {
14798
14917
  updateStyle($xeTable);
14799
14918
  });
@@ -15665,7 +15784,8 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
15665
15784
  expandColumn,
15666
15785
  selectRadioRow,
15667
15786
  pendingRowMaps,
15668
- isDragColMove
15787
+ isDragColMove,
15788
+ rowExpandHeightFlag
15669
15789
  } = tableReactData;
15670
15790
  const {
15671
15791
  fullAllDataRowIdData
@@ -15707,18 +15827,18 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
15707
15827
  };
15708
15828
  }
15709
15829
  const rowid = getRowid($xeTable, row);
15710
- const rest = fullAllDataRowIdData[rowid];
15830
+ const rowRest = fullAllDataRowIdData[rowid];
15711
15831
  let rowLevel = 0;
15712
15832
  let seq = -1;
15713
15833
  let _rowIndex = 0;
15714
- if (rest) {
15715
- rowLevel = rest.level;
15834
+ if (rowRest) {
15835
+ rowLevel = rowRest.level;
15716
15836
  if (treeConfig && transform && seqMode === 'increasing') {
15717
- seq = rest._index + 1;
15837
+ seq = rowRest._index + 1;
15718
15838
  } else {
15719
- seq = rest.seq;
15839
+ seq = rowRest.seq;
15720
15840
  }
15721
- _rowIndex = rest._index;
15841
+ _rowIndex = rowRest._index;
15722
15842
  }
15723
15843
  const params = {
15724
15844
  $table: $xeTable,
@@ -15791,54 +15911,69 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
15791
15911
  const expandOpts = $xeTable.computeExpandOpts;
15792
15912
  const {
15793
15913
  height: expandHeight,
15794
- padding
15914
+ padding,
15915
+ mode: expandMode
15795
15916
  } = expandOpts;
15796
- const cellStyle = {};
15797
- if (expandHeight) {
15798
- cellStyle.height = `${expandHeight}px`;
15799
- }
15800
- if (treeConfig) {
15801
- cellStyle.paddingLeft = `${rowLevel * treeOpts.indent + 30}px`;
15802
- }
15803
- const {
15804
- showOverflow
15805
- } = expandColumn;
15806
- const hasEllipsis = 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) ? isAllOverflow : showOverflow;
15807
- const expandParams = {
15808
- $table: $xeTable,
15809
- seq,
15810
- column: expandColumn,
15811
- fixed: fixedType,
15812
- type: renderType,
15813
- level: rowLevel,
15814
- row,
15815
- rowIndex,
15816
- $rowIndex,
15817
- _rowIndex
15818
- };
15819
- rows.push(h('tr', {
15820
- class: ['vxe-body--expanded-row', {
15821
- 'is--padding': padding
15822
- }],
15823
- key: `expand_${rowid}`,
15824
- style: rowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(rowStyle) ? rowStyle(expandParams) : rowStyle : undefined,
15825
- on: trOn
15826
- }, [h('td', {
15827
- class: {
15828
- 'vxe-body--expanded-column': 1,
15829
- 'fixed--hidden': fixedType && !hasFixedColumn,
15830
- 'col--ellipsis': hasEllipsis
15831
- },
15832
- attrs: {
15833
- colspan: tableColumn.length
15917
+ if (expandMode === 'fixed') {
15918
+ rows.push(h('tr', {
15919
+ class: 'vxe-body--row-expanded-place',
15920
+ key: `expand_${rowid}`,
15921
+ attrs: {
15922
+ rowid
15923
+ }
15924
+ }, [h('td', {
15925
+ class: 'vxe-body--row-expanded-place-column',
15926
+ attrs: {
15927
+ colspan: tableColumn.length
15928
+ },
15929
+ style: {
15930
+ height: `${rowExpandHeightFlag ? rowRest.expandHeight || expandHeight : 0}px`
15931
+ }
15932
+ })]));
15933
+ } else {
15934
+ const cellStyle = {};
15935
+ if (expandHeight) {
15936
+ cellStyle.height = `${expandHeight}px`;
15834
15937
  }
15835
- }, [h('div', {
15836
- class: {
15837
- 'vxe-body--expanded-cell': 1,
15838
- 'is--ellipsis': expandHeight
15839
- },
15840
- style: cellStyle
15841
- }, [expandColumn.renderData(h, expandParams)])])]));
15938
+ if (treeConfig) {
15939
+ cellStyle.paddingLeft = `${rowLevel * treeOpts.indent + 30}px`;
15940
+ }
15941
+ const {
15942
+ showOverflow
15943
+ } = expandColumn;
15944
+ const hasEllipsis = 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) ? isAllOverflow : showOverflow;
15945
+ const expandParams = {
15946
+ $table: $xeTable,
15947
+ seq,
15948
+ column: expandColumn,
15949
+ fixed: fixedType,
15950
+ type: renderType,
15951
+ level: rowLevel,
15952
+ row,
15953
+ rowIndex,
15954
+ $rowIndex,
15955
+ _rowIndex
15956
+ };
15957
+ rows.push(h('tr', {
15958
+ class: ['vxe-body--expanded-row', {
15959
+ 'is--padding': padding
15960
+ }],
15961
+ key: `expand_${rowid}`
15962
+ }, [h('td', {
15963
+ class: ['vxe-body--expanded-column', {
15964
+ 'fixed--hidden': fixedType && !hasFixedColumn,
15965
+ 'col--ellipsis': hasEllipsis
15966
+ }],
15967
+ attrs: {
15968
+ colspan: tableColumn.length
15969
+ }
15970
+ }, [h('div', {
15971
+ class: ['vxe-body--expanded-cell', {
15972
+ 'is--ellipsis': expandHeight
15973
+ }],
15974
+ style: cellStyle
15975
+ }, [expandColumn.renderData(h, expandParams)])])]));
15976
+ }
15842
15977
  }
15843
15978
  // 如果是树形表格
15844
15979
  if (isExpandTree) {
@@ -15941,14 +16076,13 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
15941
16076
  const emptyOpts = $xeTable.computeEmptyOpts;
15942
16077
  const mouseOpts = $xeTable.computeMouseOpts;
15943
16078
  const rowDragOpts = $xeTable.computeRowDragOpts;
15944
- const leftFixedWidth = $xeTable.computeLeftFixedWidth;
15945
- const rightFixedWidth = $xeTable.computeRightFixedWidth;
16079
+ const expandOpts = $xeTable.computeExpandOpts;
15946
16080
  let renderDataList = tableData;
15947
16081
  let renderColumnList = tableColumn;
15948
16082
  let isOptimizeMode = false;
15949
16083
  // 如果是使用优化模式
15950
16084
  if (scrollXLoad || scrollYLoad || isAllOverflow) {
15951
- if (expandColumn || spanMethod || footerSpanMethod) {
16085
+ if (expandColumn && expandOpts.mode !== 'fixed' || spanMethod || footerSpanMethod) {
15952
16086
  // 如果不支持优化模式
15953
16087
  } else {
15954
16088
  isOptimizeMode = true;
@@ -16028,9 +16162,6 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
16028
16162
  $xeTable.triggerBodyScrollEvent(evnt, fixedType);
16029
16163
  }
16030
16164
  };
16031
- if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
16032
- ons.wheel = $xeTable.triggerBodyWheelEvent;
16033
- }
16034
16165
  return h('div', {
16035
16166
  ref: 'refElem',
16036
16167
  class: ['vxe-table--body-wrapper', fixedType ? `fixed-${fixedType}--wrapper` : 'body--wrapper'],
@@ -20409,7 +20540,8 @@ function insertTreeRow(_vm, newRecords, isAppend) {
20409
20540
  level: parentLevel + 1,
20410
20541
  height: 0,
20411
20542
  resizeHeight: 0,
20412
- oTop: 0
20543
+ oTop: 0,
20544
+ expandHeight: 0
20413
20545
  };
20414
20546
  fullDataRowIdData[rowid] = rest;
20415
20547
  fullAllDataRowIdData[rowid] = rest;
@@ -20434,7 +20566,8 @@ function insertTreeRow(_vm, newRecords, isAppend) {
20434
20566
  level: 0,
20435
20567
  height: 0,
20436
20568
  resizeHeight: 0,
20437
- oTop: 0
20569
+ oTop: 0,
20570
+ expandHeight: 0
20438
20571
  };
20439
20572
  fullDataRowIdData[rowid] = rest;
20440
20573
  fullAllDataRowIdData[rowid] = rest;
@@ -20493,7 +20626,8 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
20493
20626
  level: 0,
20494
20627
  height: 0,
20495
20628
  resizeHeight: 0,
20496
- oTop: 0
20629
+ oTop: 0,
20630
+ expandHeight: 0
20497
20631
  };
20498
20632
  fullDataRowIdData[rowid] = rest;
20499
20633
  fullAllDataRowIdData[rowid] = rest;
@@ -20531,7 +20665,8 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
20531
20665
  level: 0,
20532
20666
  height: 0,
20533
20667
  resizeHeight: 0,
20534
- oTop: 0
20668
+ oTop: 0,
20669
+ expandHeight: 0
20535
20670
  };
20536
20671
  fullDataRowIdData[rowid] = rest;
20537
20672
  fullAllDataRowIdData[rowid] = rest;
@@ -20592,7 +20727,8 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
20592
20727
  level: parentLevel + 1,
20593
20728
  height: 0,
20594
20729
  resizeHeight: 0,
20595
- oTop: 0
20730
+ oTop: 0,
20731
+ expandHeight: 0
20596
20732
  };
20597
20733
  fullDataRowIdData[rowid] = rest;
20598
20734
  fullAllDataRowIdData[rowid] = rest;
@@ -24857,6 +24993,7 @@ function validErrorRuleValue(rule, val) {
24857
24993
 
24858
24994
 
24859
24995
 
24996
+
24860
24997
 
24861
24998
 
24862
24999
  const {
@@ -25025,6 +25162,96 @@ function handleUpdateResize(_vm) {
25025
25162
  _vm.recalculate();
25026
25163
  }
25027
25164
  }
25165
+ function renderRowExpandedVNs(h, $xeTable) {
25166
+ const props = $xeTable;
25167
+ const reactData = $xeTable;
25168
+ const internalData = $xeTable;
25169
+ const {
25170
+ treeConfig
25171
+ } = props;
25172
+ const {
25173
+ expandColumn
25174
+ } = reactData;
25175
+ const tableRowExpandedList = $xeTable.computeTableRowExpandedList;
25176
+ const expandOpts = $xeTable.computeExpandOpts;
25177
+ const {
25178
+ mode
25179
+ } = expandOpts;
25180
+ if (mode !== 'fixed') {
25181
+ return table_renderEmptyElement($xeTable);
25182
+ }
25183
+ const expandVNs = [h('div', {
25184
+ key: 'repY',
25185
+ ref: 'refRowExpandYSpaceElem'
25186
+ })];
25187
+ if (expandColumn) {
25188
+ tableRowExpandedList.forEach(row => {
25189
+ const expandOpts = $xeTable.computeExpandOpts;
25190
+ const {
25191
+ height: expandHeight,
25192
+ padding
25193
+ } = expandOpts;
25194
+ const {
25195
+ fullAllDataRowIdData
25196
+ } = internalData;
25197
+ const treeOpts = $xeTable.computeTreeOpts;
25198
+ const {
25199
+ transform,
25200
+ seqMode
25201
+ } = treeOpts;
25202
+ const cellStyle = {};
25203
+ const rowid = getRowid($xeTable, row);
25204
+ const rest = fullAllDataRowIdData[rowid];
25205
+ let rowLevel = 0;
25206
+ let seq = -1;
25207
+ let _rowIndex = 0;
25208
+ const rowIndex = $xeTable.getRowIndex(row);
25209
+ const $rowIndex = $xeTable.getVMRowIndex(row);
25210
+ if (rest) {
25211
+ rowLevel = rest.level;
25212
+ if (treeConfig && transform && seqMode === 'increasing') {
25213
+ seq = rest._index + 1;
25214
+ } else {
25215
+ seq = rest.seq;
25216
+ }
25217
+ _rowIndex = rest._index;
25218
+ }
25219
+ if (expandHeight) {
25220
+ cellStyle.height = `${expandHeight}px`;
25221
+ }
25222
+ if (treeConfig) {
25223
+ cellStyle.paddingLeft = `${rowLevel * treeOpts.indent + 30}px`;
25224
+ }
25225
+ const expandParams = {
25226
+ $table: $xeTable,
25227
+ seq,
25228
+ column: expandColumn,
25229
+ fixed: '',
25230
+ type: 'body',
25231
+ level: rowLevel,
25232
+ row,
25233
+ rowIndex,
25234
+ $rowIndex,
25235
+ _rowIndex
25236
+ };
25237
+ expandVNs.push(h('div', {
25238
+ key: rowid,
25239
+ class: ['vxe-body--row-expanded-cell', {
25240
+ 'is--padding': padding,
25241
+ 'is--ellipsis': expandHeight
25242
+ }],
25243
+ attrs: {
25244
+ rowid
25245
+ },
25246
+ style: cellStyle
25247
+ }, expandColumn.renderData(h, expandParams)));
25248
+ });
25249
+ }
25250
+ return h('div', {
25251
+ ref: 'refRowExpandElem',
25252
+ class: 'vxe-table--row-expanded-wrapper'
25253
+ }, expandVNs);
25254
+ }
25028
25255
  function renderScrollX(h, $xeTable) {
25029
25256
  return h('div', {
25030
25257
  key: 'vsx',
@@ -25083,6 +25310,7 @@ function renderViewport(h, $xeTable) {
25083
25310
  } = props;
25084
25311
  const {
25085
25312
  overflowX,
25313
+ scrollYLoad,
25086
25314
  tableData,
25087
25315
  tableColumn,
25088
25316
  tableGroupColumn,
@@ -25093,9 +25321,16 @@ function renderViewport(h, $xeTable) {
25093
25321
  leftList,
25094
25322
  rightList
25095
25323
  } = columnStore;
25324
+ const leftFixedWidth = $xeTable.computeLeftFixedWidth;
25325
+ const rightFixedWidth = $xeTable.computeRightFixedWidth;
25326
+ const ons = {};
25327
+ if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
25328
+ ons.onWheel = $xeTable.triggerBodyWheelEvent;
25329
+ }
25096
25330
  return h('div', {
25097
25331
  ref: 'refTableViewportElem',
25098
- class: 'vxe-table--viewport-wrapper'
25332
+ class: 'vxe-table--viewport-wrapper',
25333
+ on: ons
25099
25334
  }, [h('div', {
25100
25335
  class: 'vxe-table--main-wrapper'
25101
25336
  }, [
@@ -25131,7 +25366,7 @@ function renderViewport(h, $xeTable) {
25131
25366
  }
25132
25367
  }) : table_renderEmptyElement($xeTable)]), h('div', {
25133
25368
  class: 'vxe-table--fixed-wrapper'
25134
- }, [leftList && leftList.length && overflowX ? renderFixed(h, $xeTable, 'left') : table_renderEmptyElement($xeTable), rightList && rightList.length && overflowX ? renderFixed(h, $xeTable, 'right') : table_renderEmptyElement($xeTable)])]);
25369
+ }, [leftList && leftList.length && overflowX ? renderFixed(h, $xeTable, 'left') : table_renderEmptyElement($xeTable), rightList && rightList.length && overflowX ? renderFixed(h, $xeTable, 'right') : table_renderEmptyElement($xeTable)]), renderRowExpandedVNs(h, $xeTable)]);
25135
25370
  }
25136
25371
  function renderBody(h, $xeTable) {
25137
25372
  const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft;
@@ -25381,8 +25616,9 @@ function renderBody(h, $xeTable) {
25381
25616
  mini: 36
25382
25617
  },
25383
25618
  scrollVMLoading: false,
25384
- calcCellHeightFlag: 0,
25385
- resizeHeightFlag: 0,
25619
+ rowExpandHeightFlag: 1,
25620
+ calcCellHeightFlag: 1,
25621
+ resizeHeightFlag: 1,
25386
25622
  isCustomStatus: false,
25387
25623
  isDragRowMove: false,
25388
25624
  dragRow: null,
@@ -25787,6 +26023,28 @@ function renderBody(h, $xeTable) {
25787
26023
  computeCustomOpts() {
25788
26024
  return Object.assign({}, table_getConfig().table.customConfig, this.customConfig);
25789
26025
  },
26026
+ computeTableRowExpandedList() {
26027
+ const $xeTable = this;
26028
+ const reactData = $xeTable;
26029
+ const {
26030
+ rowExpandedMaps,
26031
+ tableData,
26032
+ expandColumn
26033
+ } = reactData;
26034
+ const expandList = [];
26035
+ if (expandColumn) {
26036
+ const rowKeys = {};
26037
+ tableData.forEach(row => {
26038
+ rowKeys[getRowid($xeTable, row)] = true;
26039
+ });
26040
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(rowExpandedMaps, (row, rowid) => {
26041
+ if (rowKeys[rowid]) {
26042
+ expandList.push(row);
26043
+ }
26044
+ });
26045
+ }
26046
+ return expandList;
26047
+ },
25790
26048
  computeAutoWidthColumnList() {
25791
26049
  const {
25792
26050
  tableColumn,
@@ -26264,29 +26522,9 @@ function renderBody(h, $xeTable) {
26264
26522
  mounted() {
26265
26523
  const $xeTable = this;
26266
26524
  const props = $xeTable;
26267
- const reactData = $xeTable;
26268
- const {
26269
- rowHeightStore
26270
- } = reactData;
26271
- const varEl = $xeTable.$refs.refVarElem;
26272
26525
  const columnOpts = $xeTable.computeColumnOpts;
26273
26526
  const rowOpts = $xeTable.computeRowOpts;
26274
26527
  const customOpts = $xeTable.computeCustomOpts;
26275
- if (varEl) {
26276
- const [defEl, mediumEl, smallEl, miniEl] = varEl.children;
26277
- if (defEl) {
26278
- rowHeightStore.default = defEl.clientHeight;
26279
- }
26280
- if (mediumEl) {
26281
- rowHeightStore.medium = mediumEl.clientHeight;
26282
- }
26283
- if (smallEl) {
26284
- rowHeightStore.small = smallEl.clientHeight;
26285
- }
26286
- if (miniEl) {
26287
- rowHeightStore.mini = miniEl.clientHeight;
26288
- }
26289
- }
26290
26528
  if (columnOpts.drag || rowOpts.drag || customOpts.allowSort) {
26291
26529
  initTpImg();
26292
26530
  }