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
@@ -8,7 +8,7 @@ import { getSlotVNs } from '../../ui/src/vn'
8
8
  import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from './anime'
9
9
  import { warnLog, errLog } from '../../ui/src/log'
10
10
 
11
- import type { VxeTableDefines, VxeColumnPropTypes, VxeTableEmits, ValueOf, TableReactData, VxeTableConstructor, VxeToolbarConstructor, TableInternalData, VxeGridConstructor, GridPrivateMethods, VxeTablePrivateMethods, VxeTooltipInstance, VxeTablePropTypes } from '../../../types'
11
+ import type { VxeTableDefines, VxeColumnPropTypes, VxeTableEmits, ValueOf, TableReactData, VxeTableConstructor, VxeToolbarConstructor, VxeToolbarInstance, TableInternalData, VxeGridConstructor, GridPrivateMethods, VxeTablePrivateMethods, VxeTooltipInstance, VxeTablePropTypes } from '../../../types'
12
12
 
13
13
  const { getConfig, getI18n, renderer, formats, interceptor, createEvent } = VxeUI
14
14
 
@@ -388,6 +388,8 @@ function cacheColumnMap ($xeTable: VxeTableConstructor & VxeTablePrivateMethods)
388
388
  reactData.rowGroupColumn = rowGroupColumn
389
389
  reactData.treeNodeColumn = treeNodeColumn
390
390
  reactData.expandColumn = expandColumn
391
+ reactData.checkboxColumn = checkboxColumn
392
+ reactData.radioColumn = radioColumn
391
393
  reactData.isAllOverflow = isAllOverflow
392
394
  }
393
395
 
@@ -972,53 +974,71 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
972
974
 
973
975
  const { showHeaderOverflow: allColumnHeaderOverflow, showFooterOverflow: allColumnFooterOverflow, mouseConfig, spanMethod, footerSpanMethod } = props
974
976
  const { isGroup, currentRow, tableColumn, scrollXLoad, scrollYLoad, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isAllOverflow, expandColumn, isColLoading } = reactData
975
- const { visibleColumn, tableHeight, headerHeight, footerHeight, elemStore, customHeight, customMinHeight, customMaxHeight } = internalData
977
+ const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData
978
+ const $xeGanttView = internalData.xeGanttView
976
979
  const el = $xeTable.$refs.refElem as HTMLDivElement
977
- if (!el) {
980
+ if (!el || !el.clientHeight) {
978
981
  return
979
982
  }
980
983
  const containerList = ['main', 'left', 'right']
981
- const osbWidth = overflowY ? scrollbarWidth : 0
982
- const osbHeight = overflowX ? scrollbarHeight : 0
984
+ let osbWidth = overflowY ? scrollbarWidth : 0
985
+ let osbHeight = overflowX ? scrollbarHeight : 0
983
986
  const emptyPlaceholderElem = $xeTable.$refs.refEmptyPlaceholder as HTMLDivElement
987
+ const scrollbarOpts = $xeTable.computeScrollbarOpts
984
988
  const mouseOpts = $xeTable.computeMouseOpts
985
989
  const expandOpts = $xeTable.computeExpandOpts
986
990
  const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper'])
987
991
  const bodyTableElem = getRefElem(elemStore['main-body-table'])
988
992
  if (emptyPlaceholderElem) {
989
- emptyPlaceholderElem.style.top = `${headerHeight}px`
993
+ emptyPlaceholderElem.style.top = `${tHeaderHeight}px`
990
994
  emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : ''
991
995
  }
992
996
 
993
- let bodyHeight = 0
997
+ const scrollbarXToTop = $xeTable.computeScrollbarXToTop
998
+ const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft
999
+
1000
+ let xScrollbarVisible = overflowX ? 'visible' : 'hidden'
1001
+ if ($xeGanttView) {
1002
+ osbHeight = scrollbarHeight
1003
+ xScrollbarVisible = 'visible'
1004
+ } else if (scrollbarOpts.x && scrollbarOpts.x.visible === false) {
1005
+ osbHeight = 0
1006
+ xScrollbarVisible = 'hidden'
1007
+ }
1008
+
1009
+ let yScrollbarVisible = overflowY ? 'visible' : 'hidden'
1010
+ if ((scrollbarOpts.y && scrollbarOpts.y.visible === false) || ($xeGanttView && !scrollbarYToLeft)) {
1011
+ osbWidth = 0
1012
+ yScrollbarVisible = 'hidden'
1013
+ }
1014
+
1015
+ let tbHeight = 0
994
1016
  let bodyMaxHeight = 0
995
- const bodyMinHeight = customMinHeight - headerHeight - footerHeight - osbHeight
1017
+ const bodyMinHeight = customMinHeight - tHeaderHeight - tFooterHeight - osbHeight
996
1018
  if (customMaxHeight) {
997
- bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight - osbHeight)
1019
+ bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - tHeaderHeight - tFooterHeight - osbHeight)
998
1020
  }
999
1021
  if (customHeight) {
1000
- bodyHeight = customHeight - headerHeight - footerHeight - osbHeight
1022
+ tbHeight = customHeight - tHeaderHeight - tFooterHeight - osbHeight
1001
1023
  }
1002
- if (!bodyHeight) {
1024
+ if (!tbHeight) {
1003
1025
  if (bodyTableElem) {
1004
- bodyHeight = bodyTableElem.clientHeight
1026
+ tbHeight = bodyTableElem.clientHeight
1005
1027
  }
1006
1028
  }
1007
- if (bodyHeight) {
1029
+ if (tbHeight) {
1008
1030
  if (bodyMaxHeight) {
1009
- bodyHeight = Math.min(bodyMaxHeight, bodyHeight)
1031
+ tbHeight = Math.min(bodyMaxHeight, tbHeight)
1010
1032
  }
1011
- bodyHeight = Math.max(bodyMinHeight, bodyHeight)
1033
+ tbHeight = Math.max(bodyMinHeight, tbHeight)
1012
1034
  }
1013
1035
 
1014
- const scrollbarXToTop = $xeTable.$refs.computeScrollbarXToTop
1015
-
1016
1036
  const xLeftCornerEl = $xeTable.$refs.refScrollXLeftCornerElem as HTMLDivElement
1017
1037
  const xRightCornerEl = $xeTable.$refs.refScrollXRightCornerElem as HTMLDivElement
1018
1038
  const scrollXVirtualEl = $xeTable.$refs.refScrollXVirtualElem as HTMLDivElement
1019
1039
  if (scrollXVirtualEl) {
1020
1040
  scrollXVirtualEl.style.height = `${osbHeight}px`
1021
- scrollXVirtualEl.style.visibility = overflowX ? 'visible' : 'hidden'
1041
+ scrollXVirtualEl.style.visibility = xScrollbarVisible
1022
1042
  }
1023
1043
  const xWrapperEl = $xeTable.$refs.refScrollXWrapperElem as HTMLDivElement
1024
1044
  if (xWrapperEl) {
@@ -1037,32 +1057,34 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
1037
1057
  const scrollYVirtualEl = $xeTable.$refs.refScrollYVirtualElem as HTMLDivElement
1038
1058
  if (scrollYVirtualEl) {
1039
1059
  scrollYVirtualEl.style.width = `${osbWidth}px`
1040
- scrollYVirtualEl.style.height = `${bodyHeight + headerHeight + footerHeight}px`
1041
- scrollYVirtualEl.style.visibility = overflowY ? 'visible' : 'hidden'
1060
+ scrollYVirtualEl.style.height = `${tbHeight + tHeaderHeight + tFooterHeight}px`
1061
+ scrollYVirtualEl.style.visibility = yScrollbarVisible
1042
1062
  }
1043
1063
  const yTopCornerEl = $xeTable.$refs.refScrollYTopCornerElem as HTMLDivElement
1044
1064
  if (yTopCornerEl) {
1045
- yTopCornerEl.style.height = `${headerHeight}px`
1046
- yTopCornerEl.style.display = overflowY && headerHeight ? 'block' : ''
1065
+ yTopCornerEl.style.height = `${tHeaderHeight}px`
1066
+ yTopCornerEl.style.display = overflowY && tHeaderHeight ? 'block' : ''
1047
1067
  }
1048
1068
  const yWrapperEl = $xeTable.$refs.refScrollYWrapperElem as HTMLDivElement
1049
1069
  if (yWrapperEl) {
1050
- yWrapperEl.style.height = `${bodyHeight}px`
1051
- yWrapperEl.style.top = `${headerHeight}px`
1070
+ yWrapperEl.style.height = `${tbHeight}px`
1071
+ yWrapperEl.style.top = `${tHeaderHeight}px`
1052
1072
  }
1053
1073
  const yBottomCornerEl = $xeTable.$refs.refScrollYBottomCornerElem as HTMLDivElement
1054
1074
  if (yBottomCornerEl) {
1055
- yBottomCornerEl.style.height = `${footerHeight}px`
1056
- yBottomCornerEl.style.top = `${headerHeight + bodyHeight}px`
1057
- yBottomCornerEl.style.display = overflowY && footerHeight ? 'block' : ''
1075
+ yBottomCornerEl.style.height = `${tFooterHeight}px`
1076
+ yBottomCornerEl.style.top = `${tHeaderHeight + tbHeight}px`
1077
+ yBottomCornerEl.style.display = overflowY && tFooterHeight ? 'block' : ''
1058
1078
  }
1059
1079
 
1060
1080
  const rowExpandEl = $xeTable.$refs.refRowExpandElem as HTMLDivElement
1061
1081
  if (rowExpandEl) {
1062
- rowExpandEl.style.height = `${bodyHeight}px`
1063
- rowExpandEl.style.top = `${headerHeight}px`
1082
+ rowExpandEl.style.height = `${tbHeight}px`
1083
+ rowExpandEl.style.top = `${tHeaderHeight}px`
1064
1084
  }
1065
1085
 
1086
+ internalData.tBodyHeight = tbHeight
1087
+
1066
1088
  containerList.forEach((name, index) => {
1067
1089
  const fixedType = index > 0 ? name : ''
1068
1090
  const layoutList = ['header', 'body', 'footer']
@@ -1128,7 +1150,7 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
1128
1150
  }
1129
1151
 
1130
1152
  if (currScrollElem) {
1131
- currScrollElem.style.height = `${headerHeight}px`
1153
+ currScrollElem.style.height = `${tHeaderHeight}px`
1132
1154
  }
1133
1155
 
1134
1156
  if (tableElem) {
@@ -1137,16 +1159,16 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
1137
1159
  } else if (layout === 'body') {
1138
1160
  if (currScrollElem) {
1139
1161
  currScrollElem.style.maxHeight = customMaxHeight ? `${bodyMaxHeight}px` : ''
1140
- currScrollElem.style.height = customHeight ? `${bodyHeight}px` : ''
1162
+ currScrollElem.style.height = customHeight ? `${tbHeight}px` : ''
1141
1163
  currScrollElem.style.minHeight = `${bodyMinHeight}px`
1142
1164
  }
1143
1165
 
1144
1166
  // 如果是固定列
1145
1167
  if (fixedWrapperElem) {
1146
1168
  if (wrapperElem) {
1147
- wrapperElem.style.top = `${headerHeight}px`
1169
+ wrapperElem.style.top = `${tHeaderHeight}px`
1148
1170
  }
1149
- fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : (tableHeight + headerHeight + footerHeight + osbHeight)}px`
1171
+ fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : (tableHeight + tHeaderHeight + tFooterHeight + osbHeight)}px`
1150
1172
  fixedWrapperElem.style.width = `${fixedColumn.reduce((previous, column) => previous + column.renderWidth, 0)}px`
1151
1173
  }
1152
1174
 
@@ -1229,11 +1251,11 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
1229
1251
  }
1230
1252
 
1231
1253
  if (currScrollElem) {
1232
- currScrollElem.style.height = `${footerHeight}px`
1254
+ currScrollElem.style.height = `${tFooterHeight}px`
1233
1255
  // 如果是固定列
1234
1256
  if (fixedWrapperElem) {
1235
1257
  if (wrapperElem) {
1236
- wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight - osbHeight : tableHeight + headerHeight}px`
1258
+ wrapperElem.style.top = `${customHeight > 0 ? customHeight - tFooterHeight - osbHeight : tableHeight + tHeaderHeight}px`
1237
1259
  }
1238
1260
  }
1239
1261
  }
@@ -1249,6 +1271,9 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
1249
1271
  if (mouseConfig && mouseOpts.selected && editStore.selected.row && editStore.selected.column) {
1250
1272
  $xeTable.addCellSelectedClass()
1251
1273
  }
1274
+ if ($xeGanttView) {
1275
+ $xeGanttView.handleUpdateStyle()
1276
+ }
1252
1277
  return $xeTable.$nextTick()
1253
1278
  }
1254
1279
 
@@ -2762,13 +2787,13 @@ function calcScrollbar ($xeTable: VxeTableConstructor & VxeTablePrivateMethods)
2762
2787
  }
2763
2788
  reactData.overflowX = overflowX
2764
2789
 
2765
- const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0
2766
- const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0
2790
+ const hHeight = headerTableElem ? headerTableElem.clientHeight : 0
2791
+ const fHeight = footerTableElem ? footerTableElem.clientHeight : 0
2767
2792
  internalData.tableHeight = bodyWrapperElem.offsetHeight
2768
- internalData.headerHeight = headerHeight
2769
- internalData.footerHeight = footerHeight
2770
-
2771
- reactData.parentHeight = Math.max(internalData.headerHeight + footerHeight + 20, $xeTable.getParentHeight())
2793
+ internalData.tHeaderHeight = hHeight
2794
+ internalData.tFooterHeight = fHeight
2795
+ reactData.overflowX = overflowX
2796
+ reactData.parentHeight = Math.max(hHeight + fHeight + 20, $xeTable.getParentHeight())
2772
2797
  }
2773
2798
  if (overflowX) {
2774
2799
  $xeTable.checkScrolling()
@@ -2828,6 +2853,7 @@ function handleLazyRecalculate ($xeTable: VxeTableConstructor & VxeTablePrivateM
2828
2853
 
2829
2854
  return new Promise<void>(resolve => {
2830
2855
  const { rceTimeout, rceRunTime } = internalData
2856
+ const $xeGanttView = internalData.xeGanttView
2831
2857
  const resizeOpts = $xeTable.computeResizeOpts
2832
2858
  const refreshDelay = resizeOpts.refreshDelay || 20
2833
2859
  const el = $xeTable.$refs.refElem as HTMLElement
@@ -2851,6 +2877,9 @@ function handleLazyRecalculate ($xeTable: VxeTableConstructor & VxeTablePrivateM
2851
2877
  handleRecalculateStyle($xeTable, reFull, reWidth, reHeight)
2852
2878
  )
2853
2879
  }
2880
+ if ($xeGanttView) {
2881
+ $xeGanttView.handleLazyRecalculate()
2882
+ }
2854
2883
  internalData.rceTimeout = setTimeout(() => {
2855
2884
  internalData.rceTimeout = undefined
2856
2885
  handleRecalculateStyle($xeTable, reFull, reWidth, reHeight)
@@ -2858,6 +2887,10 @@ function handleLazyRecalculate ($xeTable: VxeTableConstructor & VxeTablePrivateM
2858
2887
  })
2859
2888
  }
2860
2889
 
2890
+ function handleResizeEvent ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
2891
+ handleLazyRecalculate($xeTable, true, true, true)
2892
+ }
2893
+
2861
2894
  function handleUpdateAggValues ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
2862
2895
  const reactData = $xeTable as unknown as TableReactData
2863
2896
  const internalData = $xeTable as unknown as TableInternalData
@@ -3578,12 +3611,12 @@ function checkLastSyncScroll ($xeTable: VxeTableConstructor & VxeTablePrivateMet
3578
3611
  const reactData = $xeTable as unknown as TableReactData
3579
3612
  const internalData = $xeTable as unknown as TableInternalData
3580
3613
 
3581
- const { scrollXLoad, scrollYLoad, isAllOverflow } = reactData
3582
3614
  const { lcsTimeout } = internalData
3583
3615
  if (lcsTimeout) {
3584
3616
  clearTimeout(lcsTimeout)
3585
3617
  }
3586
3618
  internalData.lcsTimeout = setTimeout(() => {
3619
+ const { scrollXLoad, scrollYLoad, isAllOverflow } = reactData
3587
3620
  internalData.lcsRunTime = Date.now()
3588
3621
  internalData.lcsTimeout = undefined
3589
3622
  internalData.intoRunScroll = false
@@ -3658,6 +3691,20 @@ const wheelScrollTopTo = (diffNum: number, cb: (progress: number) => void) => {
3658
3691
  requestAnimationFrame(step)
3659
3692
  }
3660
3693
 
3694
+ const syncGanttScrollTop = ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, scrollTop: number) => {
3695
+ const internalData = $xeTable as unknown as TableInternalData
3696
+
3697
+ const $xeGanttView = internalData.xeGanttView
3698
+ if ($xeGanttView) {
3699
+ const ganttInternalData = $xeGanttView.internalData
3700
+ const { elemStore: ganttElemStore } = ganttInternalData
3701
+ const ganttBodyScrollElem = getRefElem(ganttElemStore['main-body-scroll'])
3702
+ if (ganttBodyScrollElem) {
3703
+ ganttBodyScrollElem.scrollTop = scrollTop
3704
+ }
3705
+ }
3706
+ }
3707
+
3661
3708
  function updateHeight ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
3662
3709
  const reactData = $xeTable as unknown as TableReactData
3663
3710
  const internalData = $xeTable as unknown as TableInternalData
@@ -3988,6 +4035,7 @@ const Methods = {
3988
4035
 
3989
4036
  const { scrollYLoad } = reactData
3990
4037
  const { scrollYStore, fullDataRowIdData } = internalData
4038
+ const $xeGanttView = internalData.xeGanttView
3991
4039
  let fullList: any[] = internalData.afterFullData
3992
4040
  // 是否进行数据处理
3993
4041
  if (force) {
@@ -4008,6 +4056,9 @@ const Methods = {
4008
4056
  })
4009
4057
  reactData.tableData = tableData
4010
4058
  internalData.visibleDataRowIdData = visibleDataRowIdMaps
4059
+ if ($xeGanttView) {
4060
+ $xeGanttView.updateViewData()
4061
+ }
4011
4062
  return $xeTable.$nextTick()
4012
4063
  },
4013
4064
  /**
@@ -6115,6 +6166,11 @@ const Methods = {
6115
6166
  }, 10)
6116
6167
  })
6117
6168
  },
6169
+ handleResizeEvent () {
6170
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
6171
+
6172
+ handleResizeEvent($xeTable)
6173
+ },
6118
6174
  /**
6119
6175
  * 重新渲染布局
6120
6176
  * 刷新布局
@@ -6711,7 +6767,7 @@ const Methods = {
6711
6767
 
6712
6768
  $xeTable.closeMenu()
6713
6769
  $xeTable.updateCellAreas()
6714
- handleLazyRecalculate($xeTable, true, true, true)
6770
+ handleResizeEvent($xeTable)
6715
6771
  $xeTable.updateCellAreas()
6716
6772
  },
6717
6773
  /**
@@ -7920,8 +7976,8 @@ const Methods = {
7920
7976
  const props = $xeTable
7921
7977
  const reactData = $xeTable as unknown as TableReactData
7922
7978
 
7923
- const { highlightCurrentRow, highlightCurrentColumn, editConfig } = props
7924
- const { editStore, isDragResize } = reactData
7979
+ const { treeConfig, highlightCurrentRow, highlightCurrentColumn, editConfig, aggregateConfig, rowGroupConfig } = props
7980
+ const { editStore, isDragResize, expandColumn, checkboxColumn, radioColumn } = reactData
7925
7981
  if (isDragResize) {
7926
7982
  return
7927
7983
  }
@@ -7950,15 +8006,15 @@ const Methods = {
7950
8006
  params = Object.assign({ cell, triggerRadio, triggerCheckbox, triggerTreeNode, triggerExpandNode }, params)
7951
8007
  if (!triggerCheckbox && !triggerRadio) {
7952
8008
  // 如果是展开行
7953
- if (!triggerExpandNode && (expandOpts.trigger === 'row' || (isExpandType && expandOpts.trigger === 'cell'))) {
8009
+ if (!triggerExpandNode && ((expandColumn && expandOpts.trigger === 'row') || (isExpandType && expandOpts.trigger === 'cell'))) {
7954
8010
  $xeTable.triggerRowExpandEvent(evnt, params)
7955
8011
  }
7956
8012
  // 如果是树形表格
7957
- if ((treeOpts.trigger === 'row' || (treeNode && treeOpts.trigger === 'cell'))) {
8013
+ if (treeConfig && (treeOpts.trigger === 'row' || (treeNode && treeOpts.trigger === 'cell'))) {
7958
8014
  $xeTable.triggerTreeExpandEvent(evnt, params)
7959
8015
  }
7960
8016
  // 如果是行分组
7961
- if ((aggregateOpts.trigger === 'row' || (rowGroupNode && aggregateOpts.trigger === 'cell'))) {
8017
+ if ((aggregateConfig || rowGroupConfig) && (aggregateOpts.trigger === 'row' || (rowGroupNode && aggregateOpts.trigger === 'cell'))) {
7962
8018
  $xeTable.triggerRowGroupExpandEvent(evnt, params)
7963
8019
  }
7964
8020
  }
@@ -7978,11 +8034,11 @@ const Methods = {
7978
8034
  }
7979
8035
  }
7980
8036
  // 如果是单选框
7981
- if (!triggerRadio && (radioOpts.trigger === 'row' || (isRadioType && radioOpts.trigger === 'cell'))) {
8037
+ if (!triggerRadio && ((radioColumn && radioOpts.trigger === 'row') || (isRadioType && radioOpts.trigger === 'cell'))) {
7982
8038
  $xeTable.triggerRadioRowEvent(evnt, params)
7983
8039
  }
7984
8040
  // 如果是复选框
7985
- if (!triggerCheckbox && (checkboxOpts.trigger === 'row' || (isCheckboxType && checkboxOpts.trigger === 'cell'))) {
8041
+ if (!triggerCheckbox && ((checkboxColumn && checkboxOpts.trigger === 'row') || (isCheckboxType && checkboxOpts.trigger === 'cell'))) {
7986
8042
  $xeTable.handleToggleCheckRowEvent(evnt, params)
7987
8043
  }
7988
8044
  }
@@ -10289,6 +10345,7 @@ const Methods = {
10289
10345
  }
10290
10346
  setScrollTop(yHandleEl, scrollTop)
10291
10347
  setScrollTop(rowExpandEl, scrollTop)
10348
+ syncGanttScrollTop($xeTable, scrollTop)
10292
10349
  if (scrollYLoad) {
10293
10350
  $xeTable.triggerScrollYEvent(evnt)
10294
10351
  }
@@ -10493,6 +10550,7 @@ const Methods = {
10493
10550
  setScrollTop(leftScrollElem, currTopNum)
10494
10551
  setScrollTop(rightScrollElem, currTopNum)
10495
10552
  setScrollTop(rowExpandEl, currTopNum)
10553
+ syncGanttScrollTop($xeTable, currTopNum)
10496
10554
  if (scrollYLoad) {
10497
10555
  $xeTable.triggerScrollYEvent(evnt)
10498
10556
  }
@@ -10509,6 +10567,7 @@ const Methods = {
10509
10567
  setScrollTop(leftScrollElem, currTopNum)
10510
10568
  setScrollTop(rightScrollElem, currTopNum)
10511
10569
  setScrollTop(rowExpandEl, currTopNum)
10570
+ syncGanttScrollTop($xeTable, currTopNum)
10512
10571
  if (scrollYLoad) {
10513
10572
  $xeTable.triggerScrollYEvent(evnt)
10514
10573
  }
@@ -10592,6 +10651,7 @@ const Methods = {
10592
10651
  setScrollTop(leftScrollElem, scrollTop)
10593
10652
  setScrollTop(rightScrollElem, scrollTop)
10594
10653
  setScrollTop(rowExpandEl, scrollTop)
10654
+ syncGanttScrollTop($xeTable, scrollTop)
10595
10655
  if (scrollYLoad) {
10596
10656
  $xeTable.triggerScrollYEvent(evnt)
10597
10657
  }
@@ -10623,6 +10683,7 @@ const Methods = {
10623
10683
 
10624
10684
  const { scrollXLoad, overflowX, scrollXWidth } = reactData
10625
10685
  const { visibleColumn, scrollXStore, elemStore, fullColumnIdData } = internalData
10686
+ const $xeGanttView = internalData.xeGanttView
10626
10687
  const mouseOpts = $xeTable.computeMouseOpts
10627
10688
  const tableBody = $xeTable.$refs.refTableBody
10628
10689
  const tableBodyElem = tableBody ? (tableBody as any).$el as HTMLDivElement : null
@@ -10690,10 +10751,13 @@ const Methods = {
10690
10751
  scrollXSpaceEl.style.width = `${ySpaceWidth}px`
10691
10752
  }
10692
10753
 
10754
+ calcScrollbar($xeTable)
10693
10755
  if (isScrollXBig && mouseOpts.area) {
10694
10756
  errLog('vxe.error.notProp', ['mouse-config.area'])
10695
10757
  }
10696
- calcScrollbar($xeTable)
10758
+ if ($xeGanttView) {
10759
+ $xeGanttView.updateScrollXSpace()
10760
+ }
10697
10761
  return $xeTable.$nextTick(() => {
10698
10762
  updateStyle($xeTable)
10699
10763
  })
@@ -10717,6 +10781,7 @@ const Methods = {
10717
10781
 
10718
10782
  const { isAllOverflow, scrollYLoad, expandColumn } = reactData
10719
10783
  const { scrollYStore, elemStore, isResizeCellHeight, afterFullData, fullAllDataRowIdData, rowExpandedMaps } = internalData
10784
+ const $xeGanttView = internalData.xeGanttView
10720
10785
  const { startIndex } = scrollYStore
10721
10786
  const mouseOpts = $xeTable.computeMouseOpts
10722
10787
  const expandOpts = $xeTable.computeExpandOpts
@@ -10811,10 +10876,13 @@ const Methods = {
10811
10876
  reactData.scrollYHeight = scrollYHeight
10812
10877
  reactData.isScrollYBig = isScrollYBig
10813
10878
 
10879
+ calcScrollbar($xeTable)
10814
10880
  if (isScrollYBig && mouseOpts.area) {
10815
10881
  errLog('vxe.error.notProp', ['mouse-config.area'])
10816
10882
  }
10817
- calcScrollbar($xeTable)
10883
+ if ($xeGanttView) {
10884
+ $xeGanttView.updateScrollYSpace()
10885
+ }
10818
10886
  return $xeTable.$nextTick().then(() => {
10819
10887
  updateStyle($xeTable)
10820
10888
  })
@@ -11193,16 +11261,38 @@ const Methods = {
11193
11261
  this.isActivated = false
11194
11262
  return this.$nextTick()
11195
11263
  },
11196
- // 连接工具栏
11197
- connect ($toolbar: any) {
11264
+ /**
11265
+ * 已废弃,被 connectToolbar 替换
11266
+ * @deprecated
11267
+ */
11268
+ connect ($toolbar: VxeToolbarConstructor | VxeToolbarInstance) {
11269
+ return this.connectToolbar($toolbar)
11270
+ },
11271
+ /**
11272
+ * 连接工具栏
11273
+ * @param $toolbar
11274
+ */
11275
+ connectToolbar ($toolbar: VxeToolbarConstructor | VxeToolbarInstance) {
11276
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
11277
+
11198
11278
  if ($toolbar && $toolbar.syncUpdate) {
11199
- $toolbar.syncUpdate({ collectColumn: this.collectColumn, $table: this })
11279
+ $toolbar.syncUpdate({ collectColumn: this.collectColumn, $table: $xeTable })
11200
11280
  this.$toolbar = $toolbar
11201
11281
  } else {
11202
11282
  errLog('vxe.error.barUnableLink')
11203
11283
  }
11204
11284
  return this.$nextTick()
11205
11285
  },
11286
+ handleConnectGanttView ($ganttView: any) {
11287
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
11288
+ const internalData = $xeTable as unknown as TableInternalData
11289
+
11290
+ if ($ganttView && $ganttView.connectUpdate) {
11291
+ $ganttView.connectUpdate({ $table: $xeTable })
11292
+ internalData.xeGanttView = $ganttView
11293
+ }
11294
+ return $xeTable.$nextTick()
11295
+ },
11206
11296
 
11207
11297
  /*************************
11208
11298
  * Publish methods
@@ -5,7 +5,7 @@ import type { VxeTablePropTypes } from '../../../types'
5
5
 
6
6
  const { getConfig } = VxeUI
7
7
 
8
- export default {
8
+ export const tableProps = {
9
9
  /** 基本属性 */
10
10
  id: [String, Function] as PropType<VxeTablePropTypes.ID>,
11
11
  // 数据
@@ -8,7 +8,7 @@ import methods from './methods'
8
8
  import TableBodyComponent from './body'
9
9
  import TableHeaderComponent from './header'
10
10
  import TableFooterComponent from './footer'
11
- import tableProps from './props'
11
+ import { tableProps } from './props'
12
12
  import { getSlotVNs } from '../../ui/src/vn'
13
13
  import { warnLog, errLog } from '../../ui/src/log'
14
14
  import TableCustomPanelComponent from '../module/custom/panel'
@@ -543,6 +543,8 @@ export default {
543
543
  rowGroupColumn: null,
544
544
  // 展开列信息
545
545
  expandColumn: null,
546
+ checkboxColumn: null,
547
+ radioColumn: null,
546
548
  hasFixedColumn: false,
547
549
  // 树节点列信息
548
550
  treeNodeColumn: null,
@@ -1833,7 +1835,7 @@ export default {
1833
1835
  if (this.autoResize) {
1834
1836
  const resizeObserver = globalResize.create(() => {
1835
1837
  if (this.autoResize) {
1836
- this.recalculate(true)
1838
+ this.handleResizeEvent()
1837
1839
  }
1838
1840
  })
1839
1841
  resizeObserver.observe(this.$el)
@@ -36,10 +36,6 @@ export function createInternalData (): TableInternalData {
36
36
  tableWidth: 0,
37
37
  // 表格高度
38
38
  tableHeight: 0,
39
- // 表头高度
40
- headerHeight: 0,
41
- // 表尾高度
42
- footerHeight: 0,
43
39
  customHeight: 0,
44
40
  customMinHeight: 0,
45
41
  customMaxHeight: 0,
@@ -119,6 +115,13 @@ export function createInternalData (): TableInternalData {
119
115
 
120
116
  cvCacheMaps: {},
121
117
 
118
+ // 表头高度
119
+ tHeaderHeight: 0,
120
+ // 表体高度
121
+ tBodyHeight: 0,
122
+ // 表尾高度
123
+ tFooterHeight: 0,
124
+
122
125
  inited: false,
123
126
  tooltipTimeout: null,
124
127
  initStatus: false,
@@ -367,7 +367,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
367
367
  $xeGrid.triggerToolbarBtnEvent(item, $event)
368
368
  } else {
369
369
  const gCommandOpts = commands.get(code)
370
- const params = { code, button: item, $table: $table!, $grid: $xeGrid, $event }
370
+ const params = { code, button: item, $table: $table as VxeTableConstructor, $grid: $xeGrid, $gantt: null, $event }
371
371
  if (gCommandOpts) {
372
372
  const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod
373
373
  if (tCommandMethod) {
@@ -396,7 +396,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
396
396
  $xeGrid.triggerToolbarTolEvent(item, $event)
397
397
  } else {
398
398
  const gCommandOpts = commands.get(code)
399
- const params = { code, button: null, tool: item, $table: $table!, $grid: $xeGrid, $event }
399
+ const params = { code, button: null, tool: item, $table: $table as VxeTableConstructor, $grid: $xeGrid, $gantt: null, $event }
400
400
  if (gCommandOpts) {
401
401
  const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod
402
402
  if (tCommandMethod) {
@@ -235,7 +235,15 @@ VxeUI.setConfig({
235
235
  },
236
236
  scrollbarConfig: {
237
237
  // width: 14,
238
- // height: 14
238
+ // height: 14,
239
+ x: {
240
+ // position: 'bottom',
241
+ visible: true
242
+ },
243
+ y: {
244
+ // position: 'right',
245
+ visible: true
246
+ }
239
247
  }
240
248
  },
241
249
  // export: {
@@ -288,7 +296,9 @@ VxeUI.setConfig({
288
296
  // types: ['csv', 'html', 'xml', 'txt']
289
297
  // },
290
298
  // buttons: []
291
- }
299
+ },
300
+
301
+ gantt: {}
292
302
  })
293
303
 
294
304
  const iconPrefix = 'vxe-table-icon-'
@@ -100,7 +100,7 @@ export function getDomNode () {
100
100
  }
101
101
  }
102
102
 
103
- export function getOffsetHeight (elem: HTMLElement) {
103
+ export function getOffsetHeight (elem?: HTMLElement) {
104
104
  return elem ? elem.offsetHeight : 0
105
105
  }
106
106