vxe-table 3.24.4 → 3.25.0-beta.1

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 (83) hide show
  1. package/es/grid/src/grid.js +15 -2
  2. package/es/locale/lang/fr-FR.js +29 -29
  3. package/es/style.css +1 -1
  4. package/es/table/module/custom/panel.js +3 -2
  5. package/es/table/module/edit/mixin.js +5 -4
  6. package/es/table/module/export/mixin.js +6 -4
  7. package/es/table/module/filter/mixin.js +2 -2
  8. package/es/table/module/keyboard/mixin.js +4 -3
  9. package/es/table/module/menu/mixin.js +3 -3
  10. package/es/table/render/index.js +5 -3
  11. package/es/table/src/body.js +4 -4
  12. package/es/table/src/header.js +4 -3
  13. package/es/table/src/methods.js +93 -59
  14. package/es/table/src/props.js +4 -0
  15. package/es/table/src/table.js +63 -43
  16. package/es/table/src/util.js +6 -3
  17. package/es/ui/index.js +9 -11
  18. package/es/ui/src/log.js +1 -1
  19. package/es/ui/src/utils.js +9 -0
  20. package/lib/grid/src/grid.js +14 -1
  21. package/lib/grid/src/grid.min.js +1 -1
  22. package/lib/index.umd.js +170 -110
  23. package/lib/index.umd.min.js +1 -1
  24. package/lib/locale/lang/fr-FR.js +29 -29
  25. package/lib/locale/lang/fr-FR.min.js +1 -1
  26. package/lib/locale/lang/fr-FR.umd.js +29 -29
  27. package/lib/style.css +1 -1
  28. package/lib/table/module/custom/panel.js +2 -1
  29. package/lib/table/module/custom/panel.min.js +1 -1
  30. package/lib/table/module/edit/mixin.js +4 -3
  31. package/lib/table/module/edit/mixin.min.js +1 -1
  32. package/lib/table/module/export/mixin.js +9 -3
  33. package/lib/table/module/export/mixin.min.js +1 -1
  34. package/lib/table/module/filter/mixin.js +1 -1
  35. package/lib/table/module/filter/mixin.min.js +1 -1
  36. package/lib/table/module/keyboard/mixin.js +4 -3
  37. package/lib/table/module/keyboard/mixin.min.js +1 -1
  38. package/lib/table/module/menu/mixin.js +2 -2
  39. package/lib/table/module/menu/mixin.min.js +1 -1
  40. package/lib/table/render/index.js +4 -2
  41. package/lib/table/render/index.min.js +1 -1
  42. package/lib/table/src/body.js +3 -3
  43. package/lib/table/src/body.min.js +1 -1
  44. package/lib/table/src/header.js +3 -2
  45. package/lib/table/src/header.min.js +1 -1
  46. package/lib/table/src/methods.js +36 -34
  47. package/lib/table/src/methods.min.js +1 -1
  48. package/lib/table/src/props.js +4 -0
  49. package/lib/table/src/props.min.js +1 -1
  50. package/lib/table/src/table.js +58 -45
  51. package/lib/table/src/table.min.js +1 -1
  52. package/lib/table/src/util.js +8 -2
  53. package/lib/table/src/util.min.js +1 -1
  54. package/lib/ui/index.js +9 -11
  55. package/lib/ui/index.min.js +1 -1
  56. package/lib/ui/src/log.js +1 -1
  57. package/lib/ui/src/log.min.js +1 -1
  58. package/lib/ui/src/utils.js +10 -0
  59. package/lib/ui/src/utils.min.js +1 -1
  60. package/package.json +2 -2
  61. package/packages/grid/src/grid.ts +16 -2
  62. package/packages/locale/lang/fr-FR.ts +903 -903
  63. package/packages/table/module/custom/panel.ts +3 -2
  64. package/packages/table/module/edit/mixin.ts +5 -4
  65. package/packages/table/module/export/mixin.ts +6 -4
  66. package/packages/table/module/filter/mixin.ts +2 -2
  67. package/packages/table/module/keyboard/mixin.ts +4 -3
  68. package/packages/table/module/menu/mixin.ts +3 -3
  69. package/packages/table/render/index.ts +5 -3
  70. package/packages/table/src/body.ts +4 -4
  71. package/packages/table/src/header.ts +4 -3
  72. package/packages/table/src/methods.ts +90 -57
  73. package/packages/table/src/props.ts +4 -0
  74. package/packages/table/src/table.ts +69 -43
  75. package/packages/table/src/util.ts +6 -3
  76. package/packages/ui/index.ts +8 -10
  77. package/packages/ui/src/utils.ts +10 -0
  78. /package/es/{iconfont.1791617048832.ttf → iconfont.1791954189007.ttf} +0 -0
  79. /package/es/{iconfont.1791617048832.woff → iconfont.1791954189007.woff} +0 -0
  80. /package/es/{iconfont.1791617048832.woff2 → iconfont.1791954189007.woff2} +0 -0
  81. /package/lib/{iconfont.1791617048832.ttf → iconfont.1791954189007.ttf} +0 -0
  82. /package/lib/{iconfont.1791617048832.woff → iconfont.1791954189007.woff} +0 -0
  83. /package/lib/{iconfont.1791617048832.woff2 → iconfont.1791954189007.woff2} +0 -0
@@ -1,6 +1,6 @@
1
1
  import XEUtils from 'xe-utils'
2
2
  import { getTpImg, isPx, isScale, hasClass, addClass, removeClass, wheelScrollLeftTo, wheelScrollTopTo, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey, checkTargetElement, hasAxternalInputTarget } from '../../ui/src/dom'
3
- import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils'
3
+ import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue, hasEnableConf, getDefaultConfig } from '../../ui/src/utils'
4
4
  import { VxeUI } from '../../ui'
5
5
  import Cell from './cell'
6
6
  import { getRowUniqueId, createRowId, clearTableAllStatus, getColumnList, toFilters, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getColReMinWidth, getColReMaxWidth, createHandleUpdateRowId, createHandleGetRowId, getRefElem, getCellRestHeight, getLastChildColumn, getRowMaxHeight, handleCustomStoreConfig, encodeRowid } from './util'
@@ -1047,7 +1047,6 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
1047
1047
  const isHeaderRenderOptimize = $xeTable.computeIsHeaderRenderOptimize
1048
1048
  const isBodyRenderOptimize = $xeTable.computeIsBodyRenderOptimize
1049
1049
  const isFooterRenderOptimize = $xeTable.computeIsFooterRenderOptimize
1050
- const scrollbarOpts = $xeTable.computeScrollbarOpts
1051
1050
  const mouseOpts = $xeTable.computeMouseOpts
1052
1051
  const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper'])
1053
1052
  const bodyTableElem = getRefElem(elemStore['main-body-table'])
@@ -1056,24 +1055,26 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
1056
1055
  emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : ''
1057
1056
  }
1058
1057
 
1059
- const scrollbarXConf = scrollbarOpts.x || {}
1060
- const scrollbarYConf = scrollbarOpts.y || {}
1058
+ const scrollbarXOpts = $xeTable.computeScrollbarXOpts
1059
+ const scrollbarYOpts = $xeTable.computeScrollbarYOpts
1061
1060
  const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft
1062
1061
 
1063
1062
  let xScrollbarVisible = overflowX ? 'visible' : 'hidden'
1064
- if (scrollbarXConf.visible === 'visible' || $xeGanttView) {
1063
+ const hideXScroll = scrollbarXOpts.visible === false || scrollbarXOpts.visible === 'hidden'
1064
+ if (!hideXScroll || $xeGanttView) {
1065
1065
  osbHeight = scrollbarHeight
1066
1066
  xScrollbarVisible = 'visible'
1067
- } else if (scrollbarXConf.visible === 'hidden' || scrollbarXConf.visible === false) {
1067
+ } else if (hideXScroll) {
1068
1068
  osbHeight = 0
1069
1069
  xScrollbarVisible = 'hidden'
1070
1070
  }
1071
1071
 
1072
1072
  let yScrollbarVisible = overflowY ? 'visible' : 'hidden'
1073
- if ((scrollbarYConf.visible === 'hidden' || scrollbarYConf.visible === false) || (($xeGantt && $xeGanttView && $xeGantt.reactData.showRightView) && !scrollbarYToLeft)) {
1073
+ const showYScroll = !(scrollbarYOpts.visible === false || scrollbarYOpts.visible === 'hidden')
1074
+ if (!showYScroll || (($xeGantt && $xeGanttView && $xeGantt.reactData.showRightView) && !scrollbarYToLeft)) {
1074
1075
  osbWidth = 0
1075
1076
  yScrollbarVisible = 'hidden'
1076
- } else if (scrollbarYConf.visible === 'visible') {
1077
+ } else if (showYScroll) {
1077
1078
  osbWidth = scrollbarWidth
1078
1079
  yScrollbarVisible = 'visible'
1079
1080
  }
@@ -1320,7 +1321,7 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
1320
1321
  if (currentRow) {
1321
1322
  $xeTable.setCurrentRow(currentRow)
1322
1323
  }
1323
- if (mouseConfig && mouseOpts.selected && editStore.selected.row && editStore.selected.column) {
1324
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.selected && editStore.selected.row && editStore.selected.column) {
1324
1325
  $xeTable.addCellSelectedClass()
1325
1326
  }
1326
1327
  if ($xeGanttView && $xeGanttView.handleUpdateStyle) {
@@ -3147,6 +3148,7 @@ function computeScrollLoad ($xeTable: VxeTableConstructor & VxeTablePrivateMetho
3147
3148
  }
3148
3149
 
3149
3150
  function calcScrollbar ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
3151
+ const scrollDefaultConf = ($xeTable as any).scrollDefaultConf
3150
3152
  const reactData = $xeTable as unknown as TableReactData
3151
3153
  const internalData = $xeTable as unknown as TableInternalData
3152
3154
 
@@ -3165,15 +3167,19 @@ function calcScrollbar ($xeTable: VxeTableConstructor & VxeTablePrivateMethods)
3165
3167
  let overflowY = false
3166
3168
  let overflowX = false
3167
3169
  if (bodyWrapperElem) {
3170
+ const scrollbarXOpts = $xeTable.computeScrollbarXOpts
3171
+ const scrollbarYOpts = $xeTable.computeScrollbarYOpts
3172
+ const barWidth = XEUtils.toNumber(getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), scrollDefaultConf.width))
3173
+ const barHeight = XEUtils.toNumber(getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), scrollDefaultConf.height))
3168
3174
  overflowY = scrollYHeight > bodyWrapperElem.clientHeight
3169
3175
  if (yHandleEl) {
3170
- reactData.scrollbarWidth = scrollbarOpts.width || (yHandleEl.offsetWidth - yHandleEl.clientWidth) || 14
3176
+ reactData.scrollbarWidth = (barWidth || barHeight) || (yHandleEl.offsetWidth - yHandleEl.clientWidth) || 14
3171
3177
  }
3172
3178
  reactData.overflowY = overflowY
3173
3179
 
3174
3180
  overflowX = scrollXWidth > bodyWrapperElem.clientWidth
3175
3181
  if (xHandleEl) {
3176
- reactData.scrollbarHeight = scrollbarOpts.height || (xHandleEl.offsetHeight - xHandleEl.clientHeight) || 14
3182
+ reactData.scrollbarHeight = (barHeight || barWidth) || (xHandleEl.offsetHeight - xHandleEl.clientHeight) || 14
3177
3183
  }
3178
3184
  reactData.overflowX = overflowX
3179
3185
 
@@ -3601,12 +3607,13 @@ function loadTableData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods,
3601
3607
  const reactData = $xeTable as unknown as TableReactData
3602
3608
  const internalData = $xeTable as unknown as TableInternalData
3603
3609
 
3604
- const { keepSource, treeConfig, aggregateConfig, rowGroupConfig } = props
3610
+ const { keepSource, treeConfig, rowGroupConfig, aggregateConfig, mouseConfig } = props
3605
3611
  const { rowGroupList, scrollYLoad: oldScrollYLoad } = reactData
3606
3612
  const { initStatus, scrollYStore, scrollXStore, lastScrollLeft, lastScrollTop } = internalData
3607
3613
  const rowOpts = $xeTable.computeRowOpts
3608
3614
  const treeOpts = $xeTable.computeTreeOpts
3609
3615
  const expandOpts = $xeTable.computeExpandOpts
3616
+ const mouseOpts = $xeTable.computeMouseOpts
3610
3617
  const { transform } = treeOpts
3611
3618
  const childrenField = treeOpts.children || treeOpts.childrenField
3612
3619
  let treeData = []
@@ -3694,7 +3701,7 @@ function loadTableData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods,
3694
3701
  if (keepSource) {
3695
3702
  $xeTable.cacheSourceMap(fullData)
3696
3703
  }
3697
- if ($xeTable.clearCellAreas && props.mouseConfig) {
3704
+ if ($xeTable.clearCellAreas && hasEnableConf(mouseConfig, mouseOpts)) {
3698
3705
  $xeTable.clearCellAreas()
3699
3706
  $xeTable.clearCopyCellArea()
3700
3707
  }
@@ -4885,10 +4892,25 @@ const tableMethods: any = {
4885
4892
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
4886
4893
  const $xeGrid = $xeTable.$xeGrid
4887
4894
  const $xeGantt = $xeTable.$xeGantt
4888
- const $xeGGWrapper = $xeGrid || $xeGantt
4889
4895
 
4890
- const { $el } = this
4891
- return $xeGGWrapper ? $xeGGWrapper.$el.parentNode : $el.parentNode
4896
+ const el = $xeTable.$refs.refElem as HTMLDivElement
4897
+ if (!el) {
4898
+ return null
4899
+ }
4900
+ const parentEl = el.parentElement
4901
+ if (!parentEl) {
4902
+ return null
4903
+ }
4904
+ if ($xeGantt && hasClass(parentEl, 'vxe-gantt--table-wrapper')) {
4905
+ return $xeGantt.getParentElem()
4906
+ } else if ($xeGrid && hasClass(parentEl, 'vxe-grid--table-wrapper')) {
4907
+ return $xeGrid.getParentElem()
4908
+ }
4909
+ // 如果是虚拟滚动条
4910
+ if (parentEl && hasClass(parentEl, 'vxe-scrollbar--view-inner')) {
4911
+ return parentEl.parentElement
4912
+ }
4913
+ return parentEl
4892
4914
  },
4893
4915
  /**
4894
4916
  * 获取父容器的高度
@@ -4901,22 +4923,30 @@ const tableMethods: any = {
4901
4923
 
4902
4924
  const { height } = props
4903
4925
  const el = $xeTable.$refs.refElem as HTMLDivElement
4904
- if (el) {
4905
- const parentElem = el.parentNode as HTMLElement
4906
- const parentPaddingSize = height === '100%' || height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0
4907
- let parentWrapperHeight = 0
4908
- if (parentElem) {
4909
- if ($xeGantt && hasClass(parentElem, 'vxe-gantt--table-wrapper')) {
4910
- parentWrapperHeight = $xeGantt.getParentHeight()
4911
- } else if ($xeGrid && hasClass(parentElem, 'vxe-grid--table-wrapper')) {
4912
- parentWrapperHeight = $xeGrid.getParentHeight()
4913
- } else {
4914
- parentWrapperHeight = parentElem.clientHeight
4915
- }
4926
+ if (!el) {
4927
+ return 0
4928
+ }
4929
+ let parentEl = el.parentElement
4930
+ let parentPaddingSize = 0
4931
+ let parentWrapperHeight = 0
4932
+ if (!parentEl) {
4933
+ return 0
4934
+ }
4935
+ if ($xeGantt && hasClass(parentEl, 'vxe-gantt--table-wrapper')) {
4936
+ parentWrapperHeight = $xeGantt.getParentHeight()
4937
+ } else if ($xeGrid && hasClass(parentEl, 'vxe-grid--table-wrapper')) {
4938
+ parentWrapperHeight = $xeGrid.getParentHeight()
4939
+ } else {
4940
+ // 如果是虚拟滚动条
4941
+ if (parentEl && hasClass(parentEl, 'vxe-scrollbar--view-inner')) {
4942
+ parentEl = parentEl.parentElement
4943
+ }
4944
+ if (parentEl) {
4945
+ parentWrapperHeight = parentEl.clientHeight
4946
+ parentPaddingSize = height === '100%' || height === 'auto' ? getPaddingTopBottomSize(parentEl) : 0
4916
4947
  }
4917
- return Math.floor(parentWrapperHeight - parentPaddingSize)
4918
4948
  }
4919
- return 0
4949
+ return Math.floor(parentWrapperHeight - parentPaddingSize)
4920
4950
  },
4921
4951
  /**
4922
4952
  * 获取需要排除的高度
@@ -6716,7 +6746,8 @@ const tableMethods: any = {
6716
6746
  const props = $xeTable
6717
6747
 
6718
6748
  const { mouseConfig } = props
6719
- if (mouseConfig) {
6749
+ const mouseOpts = $xeTable.computeMouseOpts
6750
+ if (hasEnableConf(mouseConfig, mouseOpts)) {
6720
6751
  if ($xeTable.clearSelected) {
6721
6752
  $xeTable.clearSelected()
6722
6753
  }
@@ -7812,6 +7843,7 @@ const tableMethods: any = {
7812
7843
  const editOpts = $xeTable.computeEditOpts
7813
7844
  const validOpts = $xeTable.computeValidOpts
7814
7845
  const areaOpts = $xeTable.computeAreaOpts
7846
+ const mouseOpts = $xeTable.computeMouseOpts
7815
7847
  const { actived } = editStore
7816
7848
  const tableFilter = $xeTable.$refs.refTableFilter as Vue
7817
7849
  const tableMenu = $xeTable.$refs.refTableMenu as Vue
@@ -7903,7 +7935,7 @@ const tableMethods: any = {
7903
7935
  }
7904
7936
  }
7905
7937
  }
7906
- } else if (mouseConfig) {
7938
+ } else if (hasEnableConf(mouseConfig, mouseOpts)) {
7907
7939
  if (!getEventTargetNode(evnt, el).flag && !($xeGGWrapper && getEventTargetNode(evnt, $xeGGWrapper.$el).flag) && !(tableMenu && getEventTargetNode(evnt, tableMenu.$el).flag) && !(this.$toolbar && getEventTargetNode(evnt, this.$toolbar.$el).flag)) {
7908
7940
  if ($xeTable.clearSelected) {
7909
7941
  $xeTable.clearSelected()
@@ -7984,20 +8016,20 @@ const tableMethods: any = {
7984
8016
  if (isEsc) {
7985
8017
  $xeTable.preventEvent(evnt, 'event.keydown', null, () => {
7986
8018
  $xeTable.dispatchEvent('keydown-start', {}, evnt)
7987
- if (keyboardConfig && mouseConfig && mouseOpts.area && $xeTable.handleKdClAreaEvent) {
8019
+ if (hasEnableConf(keyboardConfig, keyboardOpts) && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area && $xeTable.handleKdClAreaEvent) {
7988
8020
  $xeTable.handleKdClAreaEvent(evnt)
7989
8021
  } else if (actived.row || filterStore.visible || ctxMenuStore.visible) {
7990
8022
  evnt.stopPropagation()
7991
8023
  // 如果按下了 Esc 键,关闭快捷菜单、筛选
7992
8024
  $xeTable.closeFilter()
7993
8025
  $xeTable.closeMenu()
7994
- if (keyboardConfig && keyboardOpts.isEsc) {
8026
+ if (hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isEsc) {
7995
8027
  // 如果是激活编辑状态,则取消编辑
7996
8028
  if (actived.row) {
7997
8029
  const params = actived.args
7998
8030
  $xeTable.handleClearEdit(evnt)
7999
8031
  // 如果配置了选中功能,则为选中状态
8000
- if (mouseConfig && mouseOpts.selected) {
8032
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.selected) {
8001
8033
  $xeTable.$nextTick(() => $xeTable.handleSelected(params, evnt))
8002
8034
  }
8003
8035
  }
@@ -8075,7 +8107,7 @@ const tableMethods: any = {
8075
8107
  } else {
8076
8108
  $xeTable.moveCtxMenu(evnt, ctxMenuStore, 'selected', isRightArrow, true, menuList)
8077
8109
  }
8078
- } else if (keyboardConfig && mouseConfig && mouseOpts.area && $xeTable.handleKdClAreaEvent) {
8110
+ } else if (hasEnableConf(keyboardConfig, keyboardOpts) && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area && $xeTable.handleKdClAreaEvent) {
8079
8111
  $xeTable.handleKdClAreaEvent(evnt)
8080
8112
  } else if (isEsc) {
8081
8113
  // 如果按下了 Esc 键,关闭快捷菜单、筛选
@@ -8083,7 +8115,7 @@ const tableMethods: any = {
8083
8115
  $xeTable.closeMenu()
8084
8116
  }
8085
8117
  $xeTable.closeFilter()
8086
- if (keyboardConfig && keyboardOpts.isEsc) {
8118
+ if (hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isEsc) {
8087
8119
  // 如果是激活编辑状态,则取消编辑
8088
8120
  if (actived.row) {
8089
8121
  const params = actived.args
@@ -8094,7 +8126,7 @@ const tableMethods: any = {
8094
8126
  }
8095
8127
  }
8096
8128
  }
8097
- } else if (keyboardConfig && isSpacebar && keyboardOpts.isChecked && selectRow && selectColumn && (selectColumn.type === 'checkbox' || selectColumn.type === 'radio')) {
8129
+ } else if (hasEnableConf(keyboardConfig, keyboardOpts) && isSpacebar && keyboardOpts.isChecked && selectRow && selectColumn && (selectColumn.type === 'checkbox' || selectColumn.type === 'radio')) {
8098
8130
  // 空格键支持选中复选框
8099
8131
  evnt.preventDefault()
8100
8132
  if (selectColumn.type === 'checkbox') {
@@ -8117,7 +8149,7 @@ const tableMethods: any = {
8117
8149
  internalData.keyCtxTimeout = setTimeout(() => {
8118
8150
  internalData._keyCtx = false
8119
8151
  }, 1000)
8120
- } else if (isEnter && !hasAltKey && keyboardConfig && keyboardOpts.isEnter && (selectRow || actived.row || (treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow))) {
8152
+ } else if (isEnter && !hasAltKey && hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isEnter && (selectRow || actived.row || (treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow))) {
8121
8153
  // 退出选中
8122
8154
  if (isControlKey) {
8123
8155
  // 如果是激活编辑状态,则取消编辑
@@ -8125,7 +8157,7 @@ const tableMethods: any = {
8125
8157
  const params = actived.args
8126
8158
  $xeTable.handleClearEdit(evnt)
8127
8159
  // 如果配置了选中功能,则为选中状态
8128
- if (mouseConfig && mouseOpts.selected) {
8160
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.selected) {
8129
8161
  $xeTable.$nextTick(() => $xeTable.handleSelected(params, evnt))
8130
8162
  }
8131
8163
  }
@@ -8235,7 +8267,7 @@ const tableMethods: any = {
8235
8267
  }
8236
8268
  }
8237
8269
  }
8238
- } else if (operArrow && keyboardConfig && keyboardOpts.isArrow) {
8270
+ } else if (operArrow && hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isArrow) {
8239
8271
  if (!isEditStatus) {
8240
8272
  // 如果按下了方向键
8241
8273
  if (mouseOpts.selected && selectRow && selectColumn) {
@@ -8251,7 +8283,7 @@ const tableMethods: any = {
8251
8283
  }
8252
8284
  }
8253
8285
  }
8254
- } else if (isTab && keyboardConfig && keyboardOpts.isTab) {
8286
+ } else if (isTab && hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isTab) {
8255
8287
  // 如果按下了 Tab 键切换
8256
8288
  if (selectRow || actived.row) {
8257
8289
  const activeRow = selectRow || actived.row
@@ -8299,7 +8331,7 @@ const tableMethods: any = {
8299
8331
  }
8300
8332
  }
8301
8333
  }
8302
- } else if (keyboardConfig && keyboardOpts.isDel && hasDeleteKey && isEnableConf(editConfig) && (selectRow || selectColumn)) {
8334
+ } else if (hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isDel && hasDeleteKey && isEnableConf(editConfig) && (selectRow || selectColumn)) {
8303
8335
  // 如果是删除键
8304
8336
  if (!isEditStatus) {
8305
8337
  const { delMethod } = keyboardOpts
@@ -8328,7 +8360,7 @@ const tableMethods: any = {
8328
8360
  $xeTable.dispatchEvent('cell-delete-value', params, evnt)
8329
8361
  }
8330
8362
  }
8331
- } else if (hasBackspaceKey && keyboardConfig && keyboardOpts.isBack && isEnableConf(editConfig) && (selectRow || selectColumn)) {
8363
+ } else if (hasBackspaceKey && hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isBack && isEnableConf(editConfig) && (selectRow || selectColumn)) {
8332
8364
  if (!isEditStatus) {
8333
8365
  const { backMethod } = keyboardOpts
8334
8366
  // 如果是删除键
@@ -8359,7 +8391,7 @@ const tableMethods: any = {
8359
8391
  }
8360
8392
  }
8361
8393
  }
8362
- } else if (hasBackspaceKey && keyboardConfig && treeConfig && keyboardOpts.isBack && (rowOpts.isCurrent || highlightCurrentRow) && currentRow) {
8394
+ } else if (hasBackspaceKey && hasEnableConf(keyboardConfig, keyboardOpts) && treeConfig && keyboardOpts.isBack && (rowOpts.isCurrent || highlightCurrentRow) && currentRow) {
8363
8395
  // 如果树形表格回退键关闭当前行返回父节点
8364
8396
  const { parent: parentRow } = XEUtils.findTree(internalData.afterTreeFullData, item => item === currentRow, { children: childrenField })
8365
8397
  if (parentRow) {
@@ -8376,7 +8408,7 @@ const tableMethods: any = {
8376
8408
  .then(() => $xeTable.scrollToRow(parentRow))
8377
8409
  .then(() => $xeTable.triggerCurrentRowEvent(evnt, params))
8378
8410
  }
8379
- } else if (keyboardConfig && keyboardOpts.isUndoRedo && isControlKey && (isZ || isY) && !hasAxternalInputTarget(evnt.target)) {
8411
+ } else if (hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isUndoRedo && isControlKey && (isZ || isY) && !hasAxternalInputTarget(evnt.target)) {
8380
8412
  if (isY || (hasShiftKey && isZ)) {
8381
8413
  // 恢复被撤销的操作:Ctrl + Y 或 Ctrl + Shift + Z
8382
8414
  evnt.preventDefault()
@@ -8386,7 +8418,7 @@ const tableMethods: any = {
8386
8418
  evnt.preventDefault()
8387
8419
  $xeTable.handleUndoStackEvent(evnt)
8388
8420
  }
8389
- } else if (keyboardConfig && keyboardOpts.isEdit && !isControlKey && (isSpacebar || isProcess || (keyCode >= 48 && keyCode <= 57) || (keyCode >= 65 && keyCode <= 90) || (keyCode >= 96 && keyCode <= 111) || (keyCode >= 186 && keyCode <= 192) || (keyCode >= 219 && keyCode <= 222))) {
8421
+ } else if (hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isEdit && !isControlKey && (isSpacebar || isProcess || (keyCode >= 48 && keyCode <= 57) || (keyCode >= 65 && keyCode <= 90) || (keyCode >= 96 && keyCode <= 111) || (keyCode >= 186 && keyCode <= 192) || (keyCode >= 219 && keyCode <= 222))) {
8390
8422
  const { editMode, editMethod } = keyboardOpts
8391
8423
  // 启用编辑后,空格键功能将失效
8392
8424
  // if (isSpacebar) {
@@ -8442,7 +8474,7 @@ const tableMethods: any = {
8442
8474
  const { actived } = editStore
8443
8475
  if (isActivated && !filterStore.visible) {
8444
8476
  if (!(actived.row || actived.column)) {
8445
- if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && $xeTable.handlePeClAreaEvent) {
8477
+ if (hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isClip && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area && $xeTable.handlePeClAreaEvent) {
8446
8478
  $xeTable.handlePeClAreaEvent(evnt)
8447
8479
  }
8448
8480
  }
@@ -8463,7 +8495,7 @@ const tableMethods: any = {
8463
8495
  const { actived } = editStore
8464
8496
  if (isActivated && !filterStore.visible) {
8465
8497
  if (!(actived.row || actived.column)) {
8466
- if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && $xeTable.handleCyClAreaEvent) {
8498
+ if (hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isClip && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area && $xeTable.handleCyClAreaEvent) {
8467
8499
  $xeTable.handleCyClAreaEvent(evnt)
8468
8500
  }
8469
8501
  }
@@ -8484,7 +8516,7 @@ const tableMethods: any = {
8484
8516
  const { actived } = editStore
8485
8517
  if (isActivated && !filterStore.visible) {
8486
8518
  if (!(actived.row || actived.column)) {
8487
- if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && $xeTable.handleCutCellAreaEvent) {
8519
+ if (hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isClip && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area && $xeTable.handleCutCellAreaEvent) {
8488
8520
  $xeTable.handleCutCellAreaEvent(evnt)
8489
8521
  }
8490
8522
  }
@@ -9963,7 +9995,7 @@ const tableMethods: any = {
9963
9995
 
9964
9996
  const { mouseConfig } = props
9965
9997
  const mouseOpts = $xeTable.computeMouseOpts
9966
- const isMouseSelected = mouseConfig && mouseOpts.selected
9998
+ const isMouseSelected = hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.selected
9967
9999
  const column = handleFieldOrColumn($xeTable, fieldOrColumn)
9968
10000
  if (column) {
9969
10001
  $xeTable.clearCurrentColumn()
@@ -10178,7 +10210,7 @@ const tableMethods: any = {
10178
10210
  const { field, sortable, order } = column
10179
10211
  if (sortable) {
10180
10212
  const params = { $table: $xeTable, $event: evnt, column, field, property: field, order, sortList: $xeTable.getSortColumns(), sortTime: column.sortTime }
10181
- if (mouseConfig && mouseOpts.area && $xeTable.handleSortEvent) {
10213
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area && $xeTable.handleSortEvent) {
10182
10214
  $xeTable.handleSortEvent(evnt, params)
10183
10215
  }
10184
10216
  if (!order) {
@@ -10265,7 +10297,7 @@ const tableMethods: any = {
10265
10297
  $xeTable.handleHeaderCellDragMousedownEvent(evnt, params)
10266
10298
  }
10267
10299
  }
10268
- if (!triggerDrag && mouseConfig && mouseOpts.area && $xeTable.handleHeaderCellAreaMouseDnEvent) {
10300
+ if (!triggerDrag && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area && $xeTable.handleHeaderCellAreaMouseDnEvent) {
10269
10301
  $xeTable.handleHeaderCellAreaMouseDnEvent(evnt, Object.assign({ cell, triggerSort, triggerFilter }, params))
10270
10302
  }
10271
10303
  $xeTable.focus()
@@ -11073,6 +11105,7 @@ const tableMethods: any = {
11073
11105
 
11074
11106
  const { mouseConfig } = props
11075
11107
  const columnDragOpts = $xeTable.computeColumnDragOpts
11108
+ const mouseOpts = $xeTable.computeMouseOpts
11076
11109
  const { animation, isPeerDrag, isCrossDrag, isSelfToChildDrag, isToChildDrag, dragEndMethod, dragToChildMethod } = columnDragOpts
11077
11110
  const { collectColumn, fullColumnIdData } = internalData
11078
11111
  const el = $xeTable.$refs.refElem as HTMLDivElement
@@ -11246,7 +11279,7 @@ const tableMethods: any = {
11246
11279
  })
11247
11280
 
11248
11281
  $xeTable.handleClearStack()
11249
- if (mouseConfig) {
11282
+ if (hasEnableConf(mouseConfig, mouseOpts)) {
11250
11283
  if ($xeTable.clearSelected) {
11251
11284
  $xeTable.clearSelected()
11252
11285
  }
@@ -12995,14 +13028,14 @@ const tableMethods: any = {
12995
13028
 
12996
13029
  if (isRollX) {
12997
13030
  // 如果禁用滚动
12998
- if (scrollbarXOpts.visible === 'hidden') {
13031
+ if (scrollbarXOpts.visible === false || scrollbarXOpts.visible === 'hidden') {
12999
13032
  evnt.preventDefault()
13000
13033
  return
13001
13034
  }
13002
13035
  }
13003
13036
  if (isRollY) {
13004
13037
  // 如果禁用滚动
13005
- if (scrollbarYOpts.visible === 'hidden') {
13038
+ if (scrollbarYOpts.visible === false || scrollbarYOpts.visible === 'hidden') {
13006
13039
  evnt.preventDefault()
13007
13040
  return
13008
13041
  }
@@ -13987,7 +14020,7 @@ const tableMethods: any = {
13987
14020
 
13988
14021
  const { mouseConfig } = props
13989
14022
  const mouseOpts = $xeTable.computeMouseOpts
13990
- if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreaEvent) {
14023
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area && $xeTable.handleRecalculateCellAreaEvent) {
13991
14024
  return $xeTable.handleRecalculateCellAreaEvent()
13992
14025
  }
13993
14026
  return $xeTable.$nextTick()
@@ -298,6 +298,10 @@ export const tableProps = {
298
298
  virtualXConfig: Object as PropType<VxeTablePropTypes.VirtualXConfig>,
299
299
  // 纵向虚拟滚动配置项
300
300
  virtualYConfig: Object as PropType<VxeTablePropTypes.VirtualYConfig>,
301
+ useScrollbar: {
302
+ type: Boolean as PropType<VxeTablePropTypes.UseScrollbar>,
303
+ default: () => getConfig().table.useScrollbar
304
+ },
301
305
  // 滚动条配置项
302
306
  scrollbarConfig: Object as PropType<VxeTablePropTypes.ScrollbarConfig>,
303
307
  // 撤销/恢复历史配置项