vxe-table 3.17.7 → 3.17.9

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 (47) hide show
  1. package/es/grid/src/grid.js +47 -29
  2. package/es/style.css +1 -1
  3. package/es/table/module/export/mixin.js +3 -1
  4. package/es/table/src/methods.js +134 -51
  5. package/es/table/src/props.js +1 -1
  6. package/es/table/src/table.js +4 -2
  7. package/es/table/src/util.js +6 -4
  8. package/es/toolbar/src/toolbar.js +2 -2
  9. package/es/ui/index.js +13 -4
  10. package/es/ui/src/log.js +1 -1
  11. package/lib/grid/src/grid.js +49 -26
  12. package/lib/grid/src/grid.min.js +1 -1
  13. package/lib/index.umd.js +13587 -13452
  14. package/lib/index.umd.min.js +1 -1
  15. package/lib/style.css +1 -1
  16. package/lib/table/module/export/mixin.js +5 -1
  17. package/lib/table/module/export/mixin.min.js +1 -1
  18. package/lib/table/src/methods.js +149 -57
  19. package/lib/table/src/methods.min.js +1 -1
  20. package/lib/table/src/props.js +2 -2
  21. package/lib/table/src/props.min.js +1 -1
  22. package/lib/table/src/table.js +5 -3
  23. package/lib/table/src/table.min.js +1 -1
  24. package/lib/table/src/util.js +6 -4
  25. package/lib/table/src/util.min.js +1 -1
  26. package/lib/toolbar/src/toolbar.js +2 -0
  27. package/lib/toolbar/src/toolbar.min.js +1 -1
  28. package/lib/ui/index.js +12 -3
  29. package/lib/ui/index.min.js +1 -1
  30. package/lib/ui/src/log.js +1 -1
  31. package/lib/ui/src/log.min.js +1 -1
  32. package/package.json +1 -1
  33. package/packages/grid/src/grid.ts +57 -38
  34. package/packages/table/module/export/mixin.ts +5 -3
  35. package/packages/table/src/methods.ts +145 -55
  36. package/packages/table/src/props.ts +1 -1
  37. package/packages/table/src/table.ts +4 -2
  38. package/packages/table/src/util.ts +7 -4
  39. package/packages/toolbar/src/toolbar.ts +2 -2
  40. package/packages/ui/index.ts +12 -2
  41. package/packages/ui/src/dom.ts +1 -1
  42. /package/es/{iconfont.1754614978390.ttf → iconfont.1755066349013.ttf} +0 -0
  43. /package/es/{iconfont.1754614978390.woff → iconfont.1755066349013.woff} +0 -0
  44. /package/es/{iconfont.1754614978390.woff2 → iconfont.1755066349013.woff2} +0 -0
  45. /package/lib/{iconfont.1754614978390.ttf → iconfont.1755066349013.ttf} +0 -0
  46. /package/lib/{iconfont.1754614978390.woff → iconfont.1755066349013.woff} +0 -0
  47. /package/lib/{iconfont.1754614978390.woff2 → iconfont.1755066349013.woff2} +0 -0
@@ -1110,6 +1110,7 @@ export default {
1110
1110
  const reactData = $xeTable;
1111
1111
  const internalData = $xeTable;
1112
1112
  const $xeGrid = $xeTable.$xeGrid;
1113
+ const $xeGantt = $xeTable.$xeGantt;
1113
1114
  const { treeConfig, showHeader, showFooter } = props;
1114
1115
  const { isGroup } = reactData;
1115
1116
  const { tableFullColumn, afterFullData, afterTreeFullData, collectColumn, mergeBodyList, mergeFooterList } = internalData;
@@ -1316,6 +1317,7 @@ export default {
1316
1317
  const params = {
1317
1318
  $table: $xeTable,
1318
1319
  $grid: $xeGrid,
1320
+ $gantt: $xeGantt,
1319
1321
  sort: sortData.length ? sortData[0] : {},
1320
1322
  sorts: sortData,
1321
1323
  filters: gridReactData.filterData,
@@ -1325,7 +1327,7 @@ export default {
1325
1327
  return Promise.resolve((beforeQueryAll || ajaxMethods)(params))
1326
1328
  .then(rest => {
1327
1329
  const listProp = resConfigs.list;
1328
- handleOptions.data = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $grid: $xeGrid }) : XEUtils.get(rest, listProp)) : rest) || [];
1330
+ handleOptions.data = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }) : XEUtils.get(rest, listProp)) : rest) || [];
1329
1331
  if (afterQueryAll) {
1330
1332
  afterQueryAll(params);
1331
1333
  }
@@ -362,6 +362,8 @@ function cacheColumnMap($xeTable) {
362
362
  reactData.rowGroupColumn = rowGroupColumn;
363
363
  reactData.treeNodeColumn = treeNodeColumn;
364
364
  reactData.expandColumn = expandColumn;
365
+ reactData.checkboxColumn = checkboxColumn;
366
+ reactData.radioColumn = radioColumn;
365
367
  reactData.isAllOverflow = isAllOverflow;
366
368
  }
367
369
  function updateScrollXStatus($xeTable, fullColumn) {
@@ -932,50 +934,67 @@ function updateStyle($xeTable) {
932
934
  const internalData = $xeTable;
933
935
  const { showHeaderOverflow: allColumnHeaderOverflow, showFooterOverflow: allColumnFooterOverflow, mouseConfig, spanMethod, footerSpanMethod } = props;
934
936
  const { isGroup, currentRow, tableColumn, scrollXLoad, scrollYLoad, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isAllOverflow, expandColumn, isColLoading } = reactData;
935
- const { visibleColumn, tableHeight, headerHeight, footerHeight, elemStore, customHeight, customMinHeight, customMaxHeight } = internalData;
937
+ const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData;
938
+ const $xeGanttView = internalData.xeGanttView;
936
939
  const el = $xeTable.$refs.refElem;
937
- if (!el) {
940
+ if (!el || !el.clientHeight) {
938
941
  return;
939
942
  }
940
943
  const containerList = ['main', 'left', 'right'];
941
- const osbWidth = overflowY ? scrollbarWidth : 0;
942
- const osbHeight = overflowX ? scrollbarHeight : 0;
944
+ let osbWidth = overflowY ? scrollbarWidth : 0;
945
+ let osbHeight = overflowX ? scrollbarHeight : 0;
943
946
  const emptyPlaceholderElem = $xeTable.$refs.refEmptyPlaceholder;
947
+ const scrollbarOpts = $xeTable.computeScrollbarOpts;
944
948
  const mouseOpts = $xeTable.computeMouseOpts;
945
949
  const expandOpts = $xeTable.computeExpandOpts;
946
950
  const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper']);
947
951
  const bodyTableElem = getRefElem(elemStore['main-body-table']);
948
952
  if (emptyPlaceholderElem) {
949
- emptyPlaceholderElem.style.top = `${headerHeight}px`;
953
+ emptyPlaceholderElem.style.top = `${tHeaderHeight}px`;
950
954
  emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : '';
951
955
  }
952
- let bodyHeight = 0;
956
+ const scrollbarXToTop = $xeTable.computeScrollbarXToTop;
957
+ const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft;
958
+ let xScrollbarVisible = overflowX ? 'visible' : 'hidden';
959
+ if ($xeGanttView) {
960
+ osbHeight = scrollbarHeight;
961
+ xScrollbarVisible = 'visible';
962
+ }
963
+ else if (scrollbarOpts.x && scrollbarOpts.x.visible === false) {
964
+ osbHeight = 0;
965
+ xScrollbarVisible = 'hidden';
966
+ }
967
+ let yScrollbarVisible = overflowY ? 'visible' : 'hidden';
968
+ if ((scrollbarOpts.y && scrollbarOpts.y.visible === false) || ($xeGanttView && !scrollbarYToLeft)) {
969
+ osbWidth = 0;
970
+ yScrollbarVisible = 'hidden';
971
+ }
972
+ let tbHeight = 0;
953
973
  let bodyMaxHeight = 0;
954
- const bodyMinHeight = customMinHeight - headerHeight - footerHeight - osbHeight;
974
+ const bodyMinHeight = customMinHeight - tHeaderHeight - tFooterHeight - osbHeight;
955
975
  if (customMaxHeight) {
956
- bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight - osbHeight);
976
+ bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - tHeaderHeight - tFooterHeight - osbHeight);
957
977
  }
958
978
  if (customHeight) {
959
- bodyHeight = customHeight - headerHeight - footerHeight - osbHeight;
979
+ tbHeight = customHeight - tHeaderHeight - tFooterHeight - osbHeight;
960
980
  }
961
- if (!bodyHeight) {
981
+ if (!tbHeight) {
962
982
  if (bodyTableElem) {
963
- bodyHeight = bodyTableElem.clientHeight;
983
+ tbHeight = bodyTableElem.clientHeight;
964
984
  }
965
985
  }
966
- if (bodyHeight) {
986
+ if (tbHeight) {
967
987
  if (bodyMaxHeight) {
968
- bodyHeight = Math.min(bodyMaxHeight, bodyHeight);
988
+ tbHeight = Math.min(bodyMaxHeight, tbHeight);
969
989
  }
970
- bodyHeight = Math.max(bodyMinHeight, bodyHeight);
990
+ tbHeight = Math.max(bodyMinHeight, tbHeight);
971
991
  }
972
- const scrollbarXToTop = $xeTable.$refs.computeScrollbarXToTop;
973
992
  const xLeftCornerEl = $xeTable.$refs.refScrollXLeftCornerElem;
974
993
  const xRightCornerEl = $xeTable.$refs.refScrollXRightCornerElem;
975
994
  const scrollXVirtualEl = $xeTable.$refs.refScrollXVirtualElem;
976
995
  if (scrollXVirtualEl) {
977
996
  scrollXVirtualEl.style.height = `${osbHeight}px`;
978
- scrollXVirtualEl.style.visibility = overflowX ? 'visible' : 'hidden';
997
+ scrollXVirtualEl.style.visibility = xScrollbarVisible;
979
998
  }
980
999
  const xWrapperEl = $xeTable.$refs.refScrollXWrapperElem;
981
1000
  if (xWrapperEl) {
@@ -993,30 +1012,31 @@ function updateStyle($xeTable) {
993
1012
  const scrollYVirtualEl = $xeTable.$refs.refScrollYVirtualElem;
994
1013
  if (scrollYVirtualEl) {
995
1014
  scrollYVirtualEl.style.width = `${osbWidth}px`;
996
- scrollYVirtualEl.style.height = `${bodyHeight + headerHeight + footerHeight}px`;
997
- scrollYVirtualEl.style.visibility = overflowY ? 'visible' : 'hidden';
1015
+ scrollYVirtualEl.style.height = `${tbHeight + tHeaderHeight + tFooterHeight}px`;
1016
+ scrollYVirtualEl.style.visibility = yScrollbarVisible;
998
1017
  }
999
1018
  const yTopCornerEl = $xeTable.$refs.refScrollYTopCornerElem;
1000
1019
  if (yTopCornerEl) {
1001
- yTopCornerEl.style.height = `${headerHeight}px`;
1002
- yTopCornerEl.style.display = overflowY && headerHeight ? 'block' : '';
1020
+ yTopCornerEl.style.height = `${tHeaderHeight}px`;
1021
+ yTopCornerEl.style.display = overflowY && tHeaderHeight ? 'block' : '';
1003
1022
  }
1004
1023
  const yWrapperEl = $xeTable.$refs.refScrollYWrapperElem;
1005
1024
  if (yWrapperEl) {
1006
- yWrapperEl.style.height = `${bodyHeight}px`;
1007
- yWrapperEl.style.top = `${headerHeight}px`;
1025
+ yWrapperEl.style.height = `${tbHeight}px`;
1026
+ yWrapperEl.style.top = `${tHeaderHeight}px`;
1008
1027
  }
1009
1028
  const yBottomCornerEl = $xeTable.$refs.refScrollYBottomCornerElem;
1010
1029
  if (yBottomCornerEl) {
1011
- yBottomCornerEl.style.height = `${footerHeight}px`;
1012
- yBottomCornerEl.style.top = `${headerHeight + bodyHeight}px`;
1013
- yBottomCornerEl.style.display = overflowY && footerHeight ? 'block' : '';
1030
+ yBottomCornerEl.style.height = `${tFooterHeight}px`;
1031
+ yBottomCornerEl.style.top = `${tHeaderHeight + tbHeight}px`;
1032
+ yBottomCornerEl.style.display = overflowY && tFooterHeight ? 'block' : '';
1014
1033
  }
1015
1034
  const rowExpandEl = $xeTable.$refs.refRowExpandElem;
1016
1035
  if (rowExpandEl) {
1017
- rowExpandEl.style.height = `${bodyHeight}px`;
1018
- rowExpandEl.style.top = `${headerHeight}px`;
1036
+ rowExpandEl.style.height = `${tbHeight}px`;
1037
+ rowExpandEl.style.top = `${tHeaderHeight}px`;
1019
1038
  }
1039
+ internalData.tBodyHeight = tbHeight;
1020
1040
  containerList.forEach((name, index) => {
1021
1041
  const fixedType = index > 0 ? name : '';
1022
1042
  const layoutList = ['header', 'body', 'footer'];
@@ -1080,7 +1100,7 @@ function updateStyle($xeTable) {
1080
1100
  }
1081
1101
  }
1082
1102
  if (currScrollElem) {
1083
- currScrollElem.style.height = `${headerHeight}px`;
1103
+ currScrollElem.style.height = `${tHeaderHeight}px`;
1084
1104
  }
1085
1105
  if (tableElem) {
1086
1106
  tableElem.style.width = tWidth ? `${tWidth}px` : '';
@@ -1089,15 +1109,15 @@ function updateStyle($xeTable) {
1089
1109
  else if (layout === 'body') {
1090
1110
  if (currScrollElem) {
1091
1111
  currScrollElem.style.maxHeight = customMaxHeight ? `${bodyMaxHeight}px` : '';
1092
- currScrollElem.style.height = customHeight ? `${bodyHeight}px` : '';
1112
+ currScrollElem.style.height = customHeight ? `${tbHeight}px` : '';
1093
1113
  currScrollElem.style.minHeight = `${bodyMinHeight}px`;
1094
1114
  }
1095
1115
  // 如果是固定列
1096
1116
  if (fixedWrapperElem) {
1097
1117
  if (wrapperElem) {
1098
- wrapperElem.style.top = `${headerHeight}px`;
1118
+ wrapperElem.style.top = `${tHeaderHeight}px`;
1099
1119
  }
1100
- fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : (tableHeight + headerHeight + footerHeight + osbHeight)}px`;
1120
+ fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : (tableHeight + tHeaderHeight + tFooterHeight + osbHeight)}px`;
1101
1121
  fixedWrapperElem.style.width = `${fixedColumn.reduce((previous, column) => previous + column.renderWidth, 0)}px`;
1102
1122
  }
1103
1123
  let renderColumnList = tableColumn;
@@ -1174,11 +1194,11 @@ function updateStyle($xeTable) {
1174
1194
  }
1175
1195
  }
1176
1196
  if (currScrollElem) {
1177
- currScrollElem.style.height = `${footerHeight}px`;
1197
+ currScrollElem.style.height = `${tFooterHeight}px`;
1178
1198
  // 如果是固定列
1179
1199
  if (fixedWrapperElem) {
1180
1200
  if (wrapperElem) {
1181
- wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight - osbHeight : tableHeight + headerHeight}px`;
1201
+ wrapperElem.style.top = `${customHeight > 0 ? customHeight - tFooterHeight - osbHeight : tableHeight + tHeaderHeight}px`;
1182
1202
  }
1183
1203
  }
1184
1204
  }
@@ -1194,6 +1214,9 @@ function updateStyle($xeTable) {
1194
1214
  if (mouseConfig && mouseOpts.selected && editStore.selected.row && editStore.selected.column) {
1195
1215
  $xeTable.addCellSelectedClass();
1196
1216
  }
1217
+ if ($xeGanttView) {
1218
+ $xeGanttView.handleUpdateStyle();
1219
+ }
1197
1220
  return $xeTable.$nextTick();
1198
1221
  }
1199
1222
  function checkValidate($xeTable, type) {
@@ -2656,12 +2679,13 @@ function calcScrollbar($xeTable) {
2656
2679
  reactData.scrollbarHeight = scrollbarOpts.height || (xHandleEl.offsetHeight - xHandleEl.clientHeight) || 14;
2657
2680
  }
2658
2681
  reactData.overflowX = overflowX;
2659
- const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0;
2660
- const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0;
2682
+ const hHeight = headerTableElem ? headerTableElem.clientHeight : 0;
2683
+ const fHeight = footerTableElem ? footerTableElem.clientHeight : 0;
2661
2684
  internalData.tableHeight = bodyWrapperElem.offsetHeight;
2662
- internalData.headerHeight = headerHeight;
2663
- internalData.footerHeight = footerHeight;
2664
- reactData.parentHeight = Math.max(internalData.headerHeight + footerHeight + 20, $xeTable.getParentHeight());
2685
+ internalData.tHeaderHeight = hHeight;
2686
+ internalData.tFooterHeight = fHeight;
2687
+ reactData.overflowX = overflowX;
2688
+ reactData.parentHeight = Math.max(hHeight + fHeight + 20, $xeTable.getParentHeight());
2665
2689
  }
2666
2690
  if (overflowX) {
2667
2691
  $xeTable.checkScrolling();
@@ -2717,6 +2741,7 @@ function handleLazyRecalculate($xeTable, reFull, reWidth, reHeight) {
2717
2741
  const internalData = $xeTable;
2718
2742
  return new Promise(resolve => {
2719
2743
  const { rceTimeout, rceRunTime } = internalData;
2744
+ const $xeGanttView = internalData.xeGanttView;
2720
2745
  const resizeOpts = $xeTable.computeResizeOpts;
2721
2746
  const refreshDelay = resizeOpts.refreshDelay || 20;
2722
2747
  const el = $xeTable.$refs.refElem;
@@ -2738,12 +2763,18 @@ function handleLazyRecalculate($xeTable, reFull, reWidth, reHeight) {
2738
2763
  else {
2739
2764
  resolve(handleRecalculateStyle($xeTable, reFull, reWidth, reHeight));
2740
2765
  }
2766
+ if ($xeGanttView) {
2767
+ $xeGanttView.handleLazyRecalculate();
2768
+ }
2741
2769
  internalData.rceTimeout = setTimeout(() => {
2742
2770
  internalData.rceTimeout = undefined;
2743
2771
  handleRecalculateStyle($xeTable, reFull, reWidth, reHeight);
2744
2772
  }, refreshDelay);
2745
2773
  });
2746
2774
  }
2775
+ function handleResizeEvent($xeTable) {
2776
+ handleLazyRecalculate($xeTable, true, true, true);
2777
+ }
2747
2778
  function handleUpdateAggValues($xeTable) {
2748
2779
  const reactData = $xeTable;
2749
2780
  const internalData = $xeTable;
@@ -3434,12 +3465,12 @@ function lazyScrollYData($xeTable) {
3434
3465
  function checkLastSyncScroll($xeTable, isRollX, isRollY) {
3435
3466
  const reactData = $xeTable;
3436
3467
  const internalData = $xeTable;
3437
- const { scrollXLoad, scrollYLoad, isAllOverflow } = reactData;
3438
3468
  const { lcsTimeout } = internalData;
3439
3469
  if (lcsTimeout) {
3440
3470
  clearTimeout(lcsTimeout);
3441
3471
  }
3442
3472
  internalData.lcsTimeout = setTimeout(() => {
3473
+ const { scrollXLoad, scrollYLoad, isAllOverflow } = reactData;
3443
3474
  internalData.lcsRunTime = Date.now();
3444
3475
  internalData.lcsTimeout = undefined;
3445
3476
  internalData.intoRunScroll = false;
@@ -3515,6 +3546,18 @@ const wheelScrollTopTo = (diffNum, cb) => {
3515
3546
  };
3516
3547
  requestAnimationFrame(step);
3517
3548
  };
3549
+ const syncGanttScrollTop = ($xeTable, scrollTop) => {
3550
+ const internalData = $xeTable;
3551
+ const $xeGanttView = internalData.xeGanttView;
3552
+ if ($xeGanttView) {
3553
+ const ganttInternalData = $xeGanttView.internalData;
3554
+ const { elemStore: ganttElemStore } = ganttInternalData;
3555
+ const ganttBodyScrollElem = getRefElem(ganttElemStore['main-body-scroll']);
3556
+ if (ganttBodyScrollElem) {
3557
+ ganttBodyScrollElem.scrollTop = scrollTop;
3558
+ }
3559
+ }
3560
+ };
3518
3561
  function updateHeight($xeTable) {
3519
3562
  const reactData = $xeTable;
3520
3563
  const internalData = $xeTable;
@@ -3821,6 +3864,7 @@ const Methods = {
3821
3864
  const internalData = $xeTable;
3822
3865
  const { scrollYLoad } = reactData;
3823
3866
  const { scrollYStore, fullDataRowIdData } = internalData;
3867
+ const $xeGanttView = internalData.xeGanttView;
3824
3868
  let fullList = internalData.afterFullData;
3825
3869
  // 是否进行数据处理
3826
3870
  if (force) {
@@ -3841,6 +3885,9 @@ const Methods = {
3841
3885
  });
3842
3886
  reactData.tableData = tableData;
3843
3887
  internalData.visibleDataRowIdData = visibleDataRowIdMaps;
3888
+ if ($xeGanttView) {
3889
+ $xeGanttView.updateViewData();
3890
+ }
3844
3891
  return $xeTable.$nextTick();
3845
3892
  },
3846
3893
  /**
@@ -5884,6 +5931,10 @@ const Methods = {
5884
5931
  }, 10);
5885
5932
  });
5886
5933
  },
5934
+ handleResizeEvent() {
5935
+ const $xeTable = this;
5936
+ handleResizeEvent($xeTable);
5937
+ },
5887
5938
  /**
5888
5939
  * 重新渲染布局
5889
5940
  * 刷新布局
@@ -6503,7 +6554,7 @@ const Methods = {
6503
6554
  const $xeTable = this;
6504
6555
  $xeTable.closeMenu();
6505
6556
  $xeTable.updateCellAreas();
6506
- handleLazyRecalculate($xeTable, true, true, true);
6557
+ handleResizeEvent($xeTable);
6507
6558
  $xeTable.updateCellAreas();
6508
6559
  },
6509
6560
  /**
@@ -7688,8 +7739,8 @@ const Methods = {
7688
7739
  const $xeTable = this;
7689
7740
  const props = $xeTable;
7690
7741
  const reactData = $xeTable;
7691
- const { highlightCurrentRow, highlightCurrentColumn, editConfig } = props;
7692
- const { editStore, isDragResize } = reactData;
7742
+ const { treeConfig, highlightCurrentRow, highlightCurrentColumn, editConfig, aggregateConfig, rowGroupConfig } = props;
7743
+ const { editStore, isDragResize, expandColumn, checkboxColumn, radioColumn } = reactData;
7693
7744
  if (isDragResize) {
7694
7745
  return;
7695
7746
  }
@@ -7718,15 +7769,15 @@ const Methods = {
7718
7769
  params = Object.assign({ cell, triggerRadio, triggerCheckbox, triggerTreeNode, triggerExpandNode }, params);
7719
7770
  if (!triggerCheckbox && !triggerRadio) {
7720
7771
  // 如果是展开行
7721
- if (!triggerExpandNode && (expandOpts.trigger === 'row' || (isExpandType && expandOpts.trigger === 'cell'))) {
7772
+ if (!triggerExpandNode && ((expandColumn && expandOpts.trigger === 'row') || (isExpandType && expandOpts.trigger === 'cell'))) {
7722
7773
  $xeTable.triggerRowExpandEvent(evnt, params);
7723
7774
  }
7724
7775
  // 如果是树形表格
7725
- if ((treeOpts.trigger === 'row' || (treeNode && treeOpts.trigger === 'cell'))) {
7776
+ if (treeConfig && (treeOpts.trigger === 'row' || (treeNode && treeOpts.trigger === 'cell'))) {
7726
7777
  $xeTable.triggerTreeExpandEvent(evnt, params);
7727
7778
  }
7728
7779
  // 如果是行分组
7729
- if ((aggregateOpts.trigger === 'row' || (rowGroupNode && aggregateOpts.trigger === 'cell'))) {
7780
+ if ((aggregateConfig || rowGroupConfig) && (aggregateOpts.trigger === 'row' || (rowGroupNode && aggregateOpts.trigger === 'cell'))) {
7730
7781
  $xeTable.triggerRowGroupExpandEvent(evnt, params);
7731
7782
  }
7732
7783
  }
@@ -7746,11 +7797,11 @@ const Methods = {
7746
7797
  }
7747
7798
  }
7748
7799
  // 如果是单选框
7749
- if (!triggerRadio && (radioOpts.trigger === 'row' || (isRadioType && radioOpts.trigger === 'cell'))) {
7800
+ if (!triggerRadio && ((radioColumn && radioOpts.trigger === 'row') || (isRadioType && radioOpts.trigger === 'cell'))) {
7750
7801
  $xeTable.triggerRadioRowEvent(evnt, params);
7751
7802
  }
7752
7803
  // 如果是复选框
7753
- if (!triggerCheckbox && (checkboxOpts.trigger === 'row' || (isCheckboxType && checkboxOpts.trigger === 'cell'))) {
7804
+ if (!triggerCheckbox && ((checkboxColumn && checkboxOpts.trigger === 'row') || (isCheckboxType && checkboxOpts.trigger === 'cell'))) {
7754
7805
  $xeTable.handleToggleCheckRowEvent(evnt, params);
7755
7806
  }
7756
7807
  }
@@ -9966,6 +10017,7 @@ const Methods = {
9966
10017
  }
9967
10018
  setScrollTop(yHandleEl, scrollTop);
9968
10019
  setScrollTop(rowExpandEl, scrollTop);
10020
+ syncGanttScrollTop($xeTable, scrollTop);
9969
10021
  if (scrollYLoad) {
9970
10022
  $xeTable.triggerScrollYEvent(evnt);
9971
10023
  }
@@ -10162,6 +10214,7 @@ const Methods = {
10162
10214
  setScrollTop(leftScrollElem, currTopNum);
10163
10215
  setScrollTop(rightScrollElem, currTopNum);
10164
10216
  setScrollTop(rowExpandEl, currTopNum);
10217
+ syncGanttScrollTop($xeTable, currTopNum);
10165
10218
  if (scrollYLoad) {
10166
10219
  $xeTable.triggerScrollYEvent(evnt);
10167
10220
  }
@@ -10179,6 +10232,7 @@ const Methods = {
10179
10232
  setScrollTop(leftScrollElem, currTopNum);
10180
10233
  setScrollTop(rightScrollElem, currTopNum);
10181
10234
  setScrollTop(rowExpandEl, currTopNum);
10235
+ syncGanttScrollTop($xeTable, currTopNum);
10182
10236
  if (scrollYLoad) {
10183
10237
  $xeTable.triggerScrollYEvent(evnt);
10184
10238
  }
@@ -10258,6 +10312,7 @@ const Methods = {
10258
10312
  setScrollTop(leftScrollElem, scrollTop);
10259
10313
  setScrollTop(rightScrollElem, scrollTop);
10260
10314
  setScrollTop(rowExpandEl, scrollTop);
10315
+ syncGanttScrollTop($xeTable, scrollTop);
10261
10316
  if (scrollYLoad) {
10262
10317
  $xeTable.triggerScrollYEvent(evnt);
10263
10318
  }
@@ -10287,6 +10342,7 @@ const Methods = {
10287
10342
  const internalData = $xeTable;
10288
10343
  const { scrollXLoad, overflowX, scrollXWidth } = reactData;
10289
10344
  const { visibleColumn, scrollXStore, elemStore, fullColumnIdData } = internalData;
10345
+ const $xeGanttView = internalData.xeGanttView;
10290
10346
  const mouseOpts = $xeTable.computeMouseOpts;
10291
10347
  const tableBody = $xeTable.$refs.refTableBody;
10292
10348
  const tableBodyElem = tableBody ? tableBody.$el : null;
@@ -10348,10 +10404,13 @@ const Methods = {
10348
10404
  if (scrollXSpaceEl) {
10349
10405
  scrollXSpaceEl.style.width = `${ySpaceWidth}px`;
10350
10406
  }
10407
+ calcScrollbar($xeTable);
10351
10408
  if (isScrollXBig && mouseOpts.area) {
10352
10409
  errLog('vxe.error.notProp', ['mouse-config.area']);
10353
10410
  }
10354
- calcScrollbar($xeTable);
10411
+ if ($xeGanttView) {
10412
+ $xeGanttView.updateScrollXSpace();
10413
+ }
10355
10414
  return $xeTable.$nextTick(() => {
10356
10415
  updateStyle($xeTable);
10357
10416
  });
@@ -10373,6 +10432,7 @@ const Methods = {
10373
10432
  const internalData = $xeTable;
10374
10433
  const { isAllOverflow, scrollYLoad, expandColumn } = reactData;
10375
10434
  const { scrollYStore, elemStore, isResizeCellHeight, afterFullData, fullAllDataRowIdData, rowExpandedMaps } = internalData;
10435
+ const $xeGanttView = internalData.xeGanttView;
10376
10436
  const { startIndex } = scrollYStore;
10377
10437
  const mouseOpts = $xeTable.computeMouseOpts;
10378
10438
  const expandOpts = $xeTable.computeExpandOpts;
@@ -10465,10 +10525,13 @@ const Methods = {
10465
10525
  reactData.scrollYTop = scrollYTop;
10466
10526
  reactData.scrollYHeight = scrollYHeight;
10467
10527
  reactData.isScrollYBig = isScrollYBig;
10528
+ calcScrollbar($xeTable);
10468
10529
  if (isScrollYBig && mouseOpts.area) {
10469
10530
  errLog('vxe.error.notProp', ['mouse-config.area']);
10470
10531
  }
10471
- calcScrollbar($xeTable);
10532
+ if ($xeGanttView) {
10533
+ $xeGanttView.updateScrollYSpace();
10534
+ }
10472
10535
  return $xeTable.$nextTick().then(() => {
10473
10536
  updateStyle($xeTable);
10474
10537
  });
@@ -10824,10 +10887,21 @@ const Methods = {
10824
10887
  this.isActivated = false;
10825
10888
  return this.$nextTick();
10826
10889
  },
10827
- // 连接工具栏
10890
+ /**
10891
+ * 已废弃,被 connectToolbar 替换
10892
+ * @deprecated
10893
+ */
10828
10894
  connect($toolbar) {
10895
+ return this.connectToolbar($toolbar);
10896
+ },
10897
+ /**
10898
+ * 连接工具栏
10899
+ * @param $toolbar
10900
+ */
10901
+ connectToolbar($toolbar) {
10902
+ const $xeTable = this;
10829
10903
  if ($toolbar && $toolbar.syncUpdate) {
10830
- $toolbar.syncUpdate({ collectColumn: this.collectColumn, $table: this });
10904
+ $toolbar.syncUpdate({ collectColumn: this.collectColumn, $table: $xeTable });
10831
10905
  this.$toolbar = $toolbar;
10832
10906
  }
10833
10907
  else {
@@ -10835,6 +10909,15 @@ const Methods = {
10835
10909
  }
10836
10910
  return this.$nextTick();
10837
10911
  },
10912
+ handleConnectGanttView($ganttView) {
10913
+ const $xeTable = this;
10914
+ const internalData = $xeTable;
10915
+ if ($ganttView && $ganttView.connectUpdate) {
10916
+ $ganttView.connectUpdate({ $table: $xeTable });
10917
+ internalData.xeGanttView = $ganttView;
10918
+ }
10919
+ return $xeTable.$nextTick();
10920
+ },
10838
10921
  /*************************
10839
10922
  * Publish methods
10840
10923
  *************************/
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '../../ui';
2
2
  const { getConfig } = VxeUI;
3
- export default {
3
+ export const tableProps = {
4
4
  /** 基本属性 */
5
5
  id: [String, Function],
6
6
  // 数据
@@ -7,7 +7,7 @@ import methods from './methods';
7
7
  import TableBodyComponent from './body';
8
8
  import TableHeaderComponent from './header';
9
9
  import TableFooterComponent from './footer';
10
- import tableProps from './props';
10
+ import { tableProps } from './props';
11
11
  import { getSlotVNs } from '../../ui/src/vn';
12
12
  import { warnLog, errLog } from '../../ui/src/log';
13
13
  import TableCustomPanelComponent from '../module/custom/panel';
@@ -510,6 +510,8 @@ export default {
510
510
  rowGroupColumn: null,
511
511
  // 展开列信息
512
512
  expandColumn: null,
513
+ checkboxColumn: null,
514
+ radioColumn: null,
513
515
  hasFixedColumn: false,
514
516
  // 树节点列信息
515
517
  treeNodeColumn: null,
@@ -1707,7 +1709,7 @@ export default {
1707
1709
  if (this.autoResize) {
1708
1710
  const resizeObserver = globalResize.create(() => {
1709
1711
  if (this.autoResize) {
1710
- this.recalculate(true);
1712
+ this.handleResizeEvent();
1711
1713
  }
1712
1714
  });
1713
1715
  resizeObserver.observe(this.$el);
@@ -33,10 +33,6 @@ export function createInternalData() {
33
33
  tableWidth: 0,
34
34
  // 表格高度
35
35
  tableHeight: 0,
36
- // 表头高度
37
- headerHeight: 0,
38
- // 表尾高度
39
- footerHeight: 0,
40
36
  customHeight: 0,
41
37
  customMinHeight: 0,
42
38
  customMaxHeight: 0,
@@ -113,6 +109,12 @@ export function createInternalData() {
113
109
  // 已删除行
114
110
  removeRowMaps: {},
115
111
  cvCacheMaps: {},
112
+ // 表头高度
113
+ tHeaderHeight: 0,
114
+ // 表体高度
115
+ tBodyHeight: 0,
116
+ // 表尾高度
117
+ tFooterHeight: 0,
116
118
  inited: false,
117
119
  tooltipTimeout: null,
118
120
  initStatus: false,
@@ -332,7 +332,7 @@ export default {
332
332
  }
333
333
  else {
334
334
  const gCommandOpts = commands.get(code);
335
- const params = { code, button: item, $table: $table, $grid: $xeGrid, $event };
335
+ const params = { code, button: item, $table: $table, $grid: $xeGrid, $gantt: null, $event };
336
336
  if (gCommandOpts) {
337
337
  const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
338
338
  if (tCommandMethod) {
@@ -362,7 +362,7 @@ export default {
362
362
  }
363
363
  else {
364
364
  const gCommandOpts = commands.get(code);
365
- const params = { code, button: null, tool: item, $table: $table, $grid: $xeGrid, $event };
365
+ const params = { code, button: null, tool: item, $table: $table, $grid: $xeGrid, $gantt: null, $event };
366
366
  if (gCommandOpts) {
367
367
  const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
368
368
  if (tCommandMethod) {
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "3.17.7";
3
+ export const version = "3.17.9";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
@@ -227,8 +227,16 @@ VxeUI.setConfig({
227
227
  oSize: 0
228
228
  },
229
229
  scrollbarConfig: {
230
- // width: 14,
231
- // height: 14
230
+ // width: 14,
231
+ // height: 14,
232
+ x: {
233
+ // position: 'bottom',
234
+ visible: true
235
+ },
236
+ y: {
237
+ // position: 'right',
238
+ visible: true
239
+ }
232
240
  }
233
241
  },
234
242
  // export: {
@@ -281,7 +289,8 @@ VxeUI.setConfig({
281
289
  // types: ['csv', 'html', 'xml', 'txt']
282
290
  // },
283
291
  // buttons: []
284
- }
292
+ },
293
+ gantt: {}
285
294
  });
286
295
  const iconPrefix = 'vxe-table-icon-';
287
296
  VxeUI.setIcon({
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"3.17.7"}`;
3
+ const version = `table v${"3.17.9"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);