vxe-table 4.22.4 → 4.23.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 (71) hide show
  1. package/dist/all.esm.js +149 -89
  2. package/dist/style.css +1 -1
  3. package/es/grid/src/grid.js +14 -2
  4. package/es/style.css +1 -1
  5. package/es/table/module/custom/panel.js +4 -3
  6. package/es/table/module/edit/hook.js +5 -4
  7. package/es/table/module/export/hook.js +6 -4
  8. package/es/table/module/filter/hook.js +2 -2
  9. package/es/table/module/keyboard/hook.js +4 -3
  10. package/es/table/module/menu/hook.js +3 -3
  11. package/es/table/render/index.js +7 -4
  12. package/es/table/src/body.js +4 -4
  13. package/es/table/src/header.js +4 -3
  14. package/es/table/src/table.js +90 -63
  15. package/es/table/src/util.js +7 -3
  16. package/es/ui/index.js +1 -1
  17. package/es/ui/src/log.js +1 -1
  18. package/es/ui/src/utils.js +9 -0
  19. package/lib/grid/src/grid.js +13 -1
  20. package/lib/grid/src/grid.min.js +1 -1
  21. package/lib/index.umd.js +114 -64
  22. package/lib/index.umd.min.js +1 -1
  23. package/lib/style.css +1 -1
  24. package/lib/table/module/custom/panel.js +3 -1
  25. package/lib/table/module/custom/panel.min.js +1 -1
  26. package/lib/table/module/edit/hook.js +4 -3
  27. package/lib/table/module/edit/hook.min.js +1 -1
  28. package/lib/table/module/export/hook.js +9 -3
  29. package/lib/table/module/export/hook.min.js +1 -1
  30. package/lib/table/module/filter/hook.js +1 -1
  31. package/lib/table/module/filter/hook.min.js +1 -1
  32. package/lib/table/module/keyboard/hook.js +4 -3
  33. package/lib/table/module/keyboard/hook.min.js +1 -1
  34. package/lib/table/module/menu/hook.js +2 -2
  35. package/lib/table/module/menu/hook.min.js +1 -1
  36. package/lib/table/render/index.js +11 -5
  37. package/lib/table/render/index.min.js +1 -1
  38. package/lib/table/src/body.js +3 -3
  39. package/lib/table/src/body.min.js +1 -1
  40. package/lib/table/src/header.js +3 -2
  41. package/lib/table/src/header.min.js +1 -1
  42. package/lib/table/src/table.js +38 -36
  43. package/lib/table/src/table.min.js +1 -1
  44. package/lib/table/src/util.js +12 -2
  45. package/lib/table/src/util.min.js +1 -1
  46. package/lib/ui/index.js +1 -1
  47. package/lib/ui/index.min.js +1 -1
  48. package/lib/ui/src/log.js +1 -1
  49. package/lib/ui/src/log.min.js +1 -1
  50. package/lib/ui/src/utils.js +10 -0
  51. package/lib/ui/src/utils.min.js +1 -1
  52. package/package.json +2 -2
  53. package/packages/grid/src/grid.ts +14 -2
  54. package/packages/table/module/custom/panel.ts +4 -3
  55. package/packages/table/module/edit/hook.ts +5 -4
  56. package/packages/table/module/export/hook.ts +6 -4
  57. package/packages/table/module/filter/hook.ts +2 -2
  58. package/packages/table/module/keyboard/hook.ts +4 -3
  59. package/packages/table/module/menu/hook.ts +3 -3
  60. package/packages/table/render/index.ts +7 -4
  61. package/packages/table/src/body.ts +4 -4
  62. package/packages/table/src/header.ts +4 -3
  63. package/packages/table/src/table.ts +87 -61
  64. package/packages/table/src/util.ts +7 -3
  65. package/packages/ui/src/utils.ts +10 -0
  66. /package/es/{iconfont.1791617063720.ttf → iconfont.1791880428511.ttf} +0 -0
  67. /package/es/{iconfont.1791617063720.woff → iconfont.1791880428511.woff} +0 -0
  68. /package/es/{iconfont.1791617063720.woff2 → iconfont.1791880428511.woff2} +0 -0
  69. /package/lib/{iconfont.1791617063720.ttf → iconfont.1791880428511.ttf} +0 -0
  70. /package/lib/{iconfont.1791617063720.woff → iconfont.1791880428511.woff} +0 -0
  71. /package/lib/{iconfont.1791617063720.woff2 → iconfont.1791880428511.woff2} +0 -0
@@ -2,7 +2,7 @@ import { h, reactive, ref, provide, inject, nextTick, Teleport, onActivated, onD
2
2
  import { defineVxeComponent } from '../../ui/src/comp';
3
3
  import XEUtils from 'xe-utils';
4
4
  import { initTpImg, getTpImg, isPx, isScale, hasClass, addClass, removeClass, wheelScrollTopTo, wheelScrollLeftTo, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey, checkTargetElement, hasAxternalInputTarget } from '../../ui/src/dom';
5
- import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils';
5
+ import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue, hasEnableConf } from '../../ui/src/utils';
6
6
  import { VxeUI } from '../../ui';
7
7
  import { createReactData, createInternalData, getRowUniqueId, createRowId, clearTableAllStatus, getColumnList, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, getColReMaxWidth, createHandleUpdateRowId, createHandleGetRowId, getCalcHeight, getCellRestHeight, getLastChildColumn, getRowMaxHeight, handleCustomStoreConfig, encodeRowid } from './util';
8
8
  import { getSlotVNs } from '../../ui/src/vn';
@@ -2720,7 +2720,7 @@ export default defineVxeComponent({
2720
2720
  if (currentRow) {
2721
2721
  $xeTable.setCurrentRow(currentRow);
2722
2722
  }
2723
- if (mouseConfig && mouseOpts.selected && editStore.selected.row && editStore.selected.column) {
2723
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.selected && editStore.selected.row && editStore.selected.column) {
2724
2724
  $xeTable.addCellSelectedClass();
2725
2725
  }
2726
2726
  if ($xeGanttView && $xeGanttView.handleUpdateStyle) {
@@ -3724,12 +3724,13 @@ export default defineVxeComponent({
3724
3724
  * @param {Array} datas 数据
3725
3725
  */
3726
3726
  const loadTableData = (datas, isReload, isReset) => {
3727
- const { keepSource, treeConfig, rowGroupConfig, aggregateConfig } = props;
3727
+ const { keepSource, treeConfig, rowGroupConfig, aggregateConfig, mouseConfig } = props;
3728
3728
  const { rowGroupList, scrollYLoad: oldScrollYLoad } = reactData;
3729
3729
  const { initStatus, scrollYStore, scrollXStore, lastScrollLeft, lastScrollTop } = internalData;
3730
3730
  const rowOpts = computeRowOpts.value;
3731
3731
  const treeOpts = computeTreeOpts.value;
3732
3732
  const expandOpts = computeExpandOpts.value;
3733
+ const mouseOpts = computeMouseOpts.value;
3733
3734
  const { transform } = treeOpts;
3734
3735
  const childrenField = treeOpts.children || treeOpts.childrenField;
3735
3736
  let treeData = [];
@@ -3819,7 +3820,7 @@ export default defineVxeComponent({
3819
3820
  if (keepSource) {
3820
3821
  $xeTable.cacheSourceMap(fullData);
3821
3822
  }
3822
- if ($xeTable.clearCellAreas && props.mouseConfig) {
3823
+ if ($xeTable.clearCellAreas && hasEnableConf(mouseConfig, mouseOpts)) {
3823
3824
  $xeTable.clearCellAreas();
3824
3825
  $xeTable.clearCopyCellArea();
3825
3826
  }
@@ -6776,7 +6777,7 @@ export default defineVxeComponent({
6776
6777
  setCurrentColumn(fieldOrColumn) {
6777
6778
  const { mouseConfig } = props;
6778
6779
  const mouseOpts = computeMouseOpts.value;
6779
- const isMouseSelected = mouseConfig && mouseOpts.selected;
6780
+ const isMouseSelected = hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.selected;
6780
6781
  const column = handleFieldOrColumn($xeTable, fieldOrColumn);
6781
6782
  if (column) {
6782
6783
  $xeTable.clearCurrentColumn();
@@ -8023,7 +8024,7 @@ export default defineVxeComponent({
8023
8024
  updateCellAreas() {
8024
8025
  const { mouseConfig } = props;
8025
8026
  const mouseOpts = computeMouseOpts.value;
8026
- if (mouseConfig && mouseOpts.area && $xeTable.handleRecalculateCellAreaEvent) {
8027
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area && $xeTable.handleRecalculateCellAreaEvent) {
8027
8028
  return $xeTable.handleRecalculateCellAreaEvent();
8028
8029
  }
8029
8030
  return nextTick();
@@ -8282,6 +8283,7 @@ export default defineVxeComponent({
8282
8283
  const editOpts = computeEditOpts.value;
8283
8284
  const validOpts = computeValidOpts.value;
8284
8285
  const areaOpts = computeAreaOpts.value;
8286
+ const mouseOpts = computeMouseOpts.value;
8285
8287
  const { actived } = editStore;
8286
8288
  const $validTooltip = refValidTooltip.value;
8287
8289
  const tableFilter = refTableFilter.value;
@@ -8378,7 +8380,7 @@ export default defineVxeComponent({
8378
8380
  }
8379
8381
  }
8380
8382
  }
8381
- else if (mouseConfig) {
8383
+ else if (hasEnableConf(mouseConfig, mouseOpts)) {
8382
8384
  if (!getEventTargetNode(evnt, el).flag && !($xeGGWrapper && getEventTargetNode(evnt, $xeGGWrapper.getRefMaps().refElem.value).flag) && !(tableMenu && getEventTargetNode(evnt, tableMenu.getRefMaps().refElem.value).flag) && !($xeToolbar && getEventTargetNode(evnt, $xeToolbar.getRefMaps().refElem.value).flag)) {
8383
8385
  if ($xeTable.clearSelected) {
8384
8386
  $xeTable.clearSelected();
@@ -8465,7 +8467,7 @@ export default defineVxeComponent({
8465
8467
  if (isEsc) {
8466
8468
  $xeTable.preventEvent(evnt, 'event.keydown', null, () => {
8467
8469
  dispatchEvent('keydown-start', {}, evnt);
8468
- if (keyboardConfig && mouseConfig && mouseOpts.area && $xeTable.handleKdClAreaEvent) {
8470
+ if (hasEnableConf(keyboardConfig, keyboardOpts) && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area && $xeTable.handleKdClAreaEvent) {
8469
8471
  $xeTable.handleKdClAreaEvent(evnt);
8470
8472
  }
8471
8473
  else if (actived.row || filterStore.visible || ctxMenuStore.visible) {
@@ -8475,7 +8477,7 @@ export default defineVxeComponent({
8475
8477
  $xeTable.closeMenu();
8476
8478
  }
8477
8479
  $xeTable.closeFilter();
8478
- if (keyboardConfig && keyboardOpts.isEsc) {
8480
+ if (hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isEsc) {
8479
8481
  // 如果是激活编辑状态,则取消编辑
8480
8482
  if (actived.row) {
8481
8483
  const params = actived.args;
@@ -8552,7 +8554,7 @@ export default defineVxeComponent({
8552
8554
  $xeTable.moveCtxMenu(evnt, ctxMenuStore, 'selected', isRightArrow, true, menuList);
8553
8555
  }
8554
8556
  }
8555
- else if (keyboardConfig && mouseConfig && mouseOpts.area && $xeTable.handleKdClAreaEvent) {
8557
+ else if (hasEnableConf(keyboardConfig, keyboardOpts) && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area && $xeTable.handleKdClAreaEvent) {
8556
8558
  $xeTable.handleKdClAreaEvent(evnt);
8557
8559
  }
8558
8560
  else if (isEsc) {
@@ -8561,7 +8563,7 @@ export default defineVxeComponent({
8561
8563
  $xeTable.closeMenu();
8562
8564
  }
8563
8565
  $xeTable.closeFilter();
8564
- if (keyboardConfig && keyboardOpts.isEsc) {
8566
+ if (hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isEsc) {
8565
8567
  // 如果是激活编辑状态,则取消编辑
8566
8568
  if (actived.row) {
8567
8569
  const params = actived.args;
@@ -8573,7 +8575,7 @@ export default defineVxeComponent({
8573
8575
  }
8574
8576
  }
8575
8577
  }
8576
- else if (isSpacebar && keyboardConfig && keyboardOpts.isChecked && selectRow && selectColumn && (selectColumn.type === 'checkbox' || selectColumn.type === 'radio')) {
8578
+ else if (isSpacebar && hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isChecked && selectRow && selectColumn && (selectColumn.type === 'checkbox' || selectColumn.type === 'radio')) {
8577
8579
  // 空格键支持选中复选框
8578
8580
  evnt.preventDefault();
8579
8581
  if (selectColumn.type === 'checkbox') {
@@ -8600,7 +8602,7 @@ export default defineVxeComponent({
8600
8602
  internalData._keyCtx = false;
8601
8603
  }, 1000);
8602
8604
  }
8603
- else if (isEnter && !isAltKey && keyboardConfig && keyboardOpts.isEnter && (selectRow || actived.row || (treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow))) {
8605
+ else if (isEnter && !isAltKey && hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isEnter && (selectRow || actived.row || (treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow))) {
8604
8606
  // 退出选中
8605
8607
  if (isControlKey) {
8606
8608
  // 如果是激活编辑状态,则取消编辑
@@ -8728,7 +8730,7 @@ export default defineVxeComponent({
8728
8730
  }
8729
8731
  }
8730
8732
  }
8731
- else if (operArrow && keyboardConfig && keyboardOpts.isArrow) {
8733
+ else if (operArrow && hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isArrow) {
8732
8734
  if (!isEditStatus) {
8733
8735
  // 如果按下了方向键
8734
8736
  if (mouseOpts.selected && selectRow && selectColumn) {
@@ -8746,7 +8748,7 @@ export default defineVxeComponent({
8746
8748
  }
8747
8749
  }
8748
8750
  }
8749
- else if (isTab && keyboardConfig && keyboardOpts.isTab) {
8751
+ else if (isTab && hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isTab) {
8750
8752
  // 如果按下了 Tab 键切换
8751
8753
  if (selectRow || actived.row) {
8752
8754
  const activeRow = selectRow || actived.row;
@@ -8796,7 +8798,7 @@ export default defineVxeComponent({
8796
8798
  }
8797
8799
  }
8798
8800
  }
8799
- else if (keyboardConfig && keyboardOpts.isDel && hasDeleteKey && isEnableConf(editConfig) && (selectRow || selectColumn)) {
8801
+ else if (hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isDel && hasDeleteKey && isEnableConf(editConfig) && (selectRow || selectColumn)) {
8800
8802
  // 如果是删除键
8801
8803
  if (!isEditStatus) {
8802
8804
  const { delMethod } = keyboardOpts;
@@ -8827,7 +8829,7 @@ export default defineVxeComponent({
8827
8829
  }
8828
8830
  }
8829
8831
  }
8830
- else if (hasBackspaceKey && keyboardConfig && keyboardOpts.isBack && isEnableConf(editConfig) && (selectRow || selectColumn)) {
8832
+ else if (hasBackspaceKey && hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isBack && isEnableConf(editConfig) && (selectRow || selectColumn)) {
8831
8833
  if (!isEditStatus) {
8832
8834
  const { backMethod } = keyboardOpts;
8833
8835
  // 如果是删除键
@@ -8860,7 +8862,7 @@ export default defineVxeComponent({
8860
8862
  }
8861
8863
  }
8862
8864
  }
8863
- else if (hasBackspaceKey && keyboardConfig && treeConfig && keyboardOpts.isBack && (rowOpts.isCurrent || highlightCurrentRow) && currentRow) {
8865
+ else if (hasBackspaceKey && hasEnableConf(keyboardConfig, keyboardOpts) && treeConfig && keyboardOpts.isBack && (rowOpts.isCurrent || highlightCurrentRow) && currentRow) {
8864
8866
  // 如果树形表格回退键关闭当前行返回父节点
8865
8867
  const { parent: parentRow } = XEUtils.findTree(internalData.afterTreeFullData, item => item === currentRow, { children: childrenField });
8866
8868
  if (parentRow) {
@@ -8878,7 +8880,7 @@ export default defineVxeComponent({
8878
8880
  .then(() => $xeTable.triggerCurrentRowEvent(evnt, params));
8879
8881
  }
8880
8882
  }
8881
- else if (keyboardConfig && keyboardOpts.isUndoRedo && isControlKey && (isZ || isY) && !hasAxternalInputTarget(evnt.target)) {
8883
+ else if (hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isUndoRedo && isControlKey && (isZ || isY) && !hasAxternalInputTarget(evnt.target)) {
8882
8884
  if (evnt.target) {
8883
8885
  if (isY || (hasShiftKey && isZ)) {
8884
8886
  // 恢复被撤销的操作:Ctrl + Y 或 Ctrl + Shift + Z
@@ -8892,7 +8894,7 @@ export default defineVxeComponent({
8892
8894
  }
8893
8895
  }
8894
8896
  }
8895
- else if (keyboardConfig && isEnableConf(editConfig) && keyboardOpts.isEdit && !isControlKey && (isSpacebar || isProcess || evnt.key === 'Process' || (keyCode >= 48 && keyCode <= 57) || (keyCode >= 65 && keyCode <= 90) || (keyCode >= 96 && keyCode <= 111) || (keyCode >= 186 && keyCode <= 192) || (keyCode >= 219 && keyCode <= 222))) {
8897
+ else if (hasEnableConf(keyboardConfig, keyboardOpts) && isEnableConf(editConfig) && keyboardOpts.isEdit && !isControlKey && (isSpacebar || isProcess || evnt.key === 'Process' || (keyCode >= 48 && keyCode <= 57) || (keyCode >= 65 && keyCode <= 90) || (keyCode >= 96 && keyCode <= 111) || (keyCode >= 186 && keyCode <= 192) || (keyCode >= 219 && keyCode <= 222))) {
8896
8898
  const { editMode, editMethod } = keyboardOpts;
8897
8899
  // 启用编辑后,空格键功能将失效
8898
8900
  // if (isSpacebar) {
@@ -8944,7 +8946,7 @@ export default defineVxeComponent({
8944
8946
  const { actived } = editStore;
8945
8947
  if (isActivated && !filterStore.visible) {
8946
8948
  if (!(actived.row || actived.column)) {
8947
- if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && $xeTable.handlePeClAreaEvent) {
8949
+ if (hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isClip && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area && $xeTable.handlePeClAreaEvent) {
8948
8950
  $xeTable.handlePeClAreaEvent(evnt);
8949
8951
  }
8950
8952
  }
@@ -8960,7 +8962,7 @@ export default defineVxeComponent({
8960
8962
  const { actived } = editStore;
8961
8963
  if (isActivated && !filterStore.visible) {
8962
8964
  if (!(actived.row || actived.column)) {
8963
- if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && $xeTable.handleCyClAreaEvent) {
8965
+ if (hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isClip && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area && $xeTable.handleCyClAreaEvent) {
8964
8966
  $xeTable.handleCyClAreaEvent(evnt);
8965
8967
  }
8966
8968
  }
@@ -8976,7 +8978,7 @@ export default defineVxeComponent({
8976
8978
  const { actived } = editStore;
8977
8979
  if (isActivated && !filterStore.visible) {
8978
8980
  if (!(actived.row || actived.column)) {
8979
- if (keyboardConfig && keyboardOpts.isClip && mouseConfig && mouseOpts.area && $xeTable.handleCutCellAreaEvent) {
8981
+ if (hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isClip && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area && $xeTable.handleCutCellAreaEvent) {
8980
8982
  $xeTable.handleCutCellAreaEvent(evnt);
8981
8983
  }
8982
8984
  }
@@ -9483,11 +9485,24 @@ export default defineVxeComponent({
9483
9485
  */
9484
9486
  getParentElem() {
9485
9487
  const el = refElem.value;
9486
- if ($xeGGWrapper) {
9487
- const gridEl = $xeGGWrapper.getRefMaps().refElem.value;
9488
- return gridEl ? gridEl.parentNode : null;
9488
+ if (!el) {
9489
+ return null;
9490
+ }
9491
+ const parentEl = el.parentElement;
9492
+ if (!parentEl) {
9493
+ return null;
9494
+ }
9495
+ if ($xeGantt && hasClass(parentEl, 'vxe-gantt--table-wrapper')) {
9496
+ return $xeGantt.getParentElem();
9489
9497
  }
9490
- return el ? el.parentNode : null;
9498
+ else if ($xeGrid && hasClass(parentEl, 'vxe-grid--table-wrapper')) {
9499
+ return $xeGrid.getParentElem();
9500
+ }
9501
+ // 如果是虚拟滚动条
9502
+ if (parentEl && hasClass(parentEl, 'vxe-scrollbar--view-inner')) {
9503
+ return parentEl.parentElement;
9504
+ }
9505
+ return parentEl;
9491
9506
  },
9492
9507
  /**
9493
9508
  * 获取父容器的高度
@@ -9495,25 +9510,32 @@ export default defineVxeComponent({
9495
9510
  getParentHeight() {
9496
9511
  const { height } = props;
9497
9512
  const el = refElem.value;
9498
- if (el) {
9499
- const parentElem = el.parentNode;
9500
- let parentPaddingSize = 0;
9501
- let parentWrapperHeight = 0;
9502
- if (parentElem) {
9503
- if ($xeGantt && hasClass(parentElem, 'vxe-gantt--table-wrapper')) {
9504
- parentWrapperHeight = $xeGantt.getParentHeight();
9505
- }
9506
- else if ($xeGrid && hasClass(parentElem, 'vxe-grid--table-wrapper')) {
9507
- parentWrapperHeight = $xeGrid.getParentHeight();
9508
- }
9509
- else {
9510
- parentWrapperHeight = parentElem.clientHeight;
9511
- parentPaddingSize = height === '100%' || height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0;
9512
- }
9513
+ if (!el) {
9514
+ return 0;
9515
+ }
9516
+ let parentEl = el.parentElement;
9517
+ let parentPaddingSize = 0;
9518
+ let parentWrapperHeight = 0;
9519
+ if (!parentEl) {
9520
+ return 0;
9521
+ }
9522
+ if ($xeGantt && hasClass(parentEl, 'vxe-gantt--table-wrapper')) {
9523
+ parentWrapperHeight = $xeGantt.getParentHeight();
9524
+ }
9525
+ else if ($xeGrid && hasClass(parentEl, 'vxe-grid--table-wrapper')) {
9526
+ parentWrapperHeight = $xeGrid.getParentHeight();
9527
+ }
9528
+ else {
9529
+ // 如果是虚拟滚动条
9530
+ if (parentEl && hasClass(parentEl, 'vxe-scrollbar--view-inner')) {
9531
+ parentEl = parentEl.parentElement;
9532
+ }
9533
+ if (parentEl) {
9534
+ parentWrapperHeight = parentEl.clientHeight;
9535
+ parentPaddingSize = height === '100%' || height === 'auto' ? getPaddingTopBottomSize(parentEl) : 0;
9513
9536
  }
9514
- return Math.floor(parentWrapperHeight - parentPaddingSize);
9515
9537
  }
9516
- return 0;
9538
+ return Math.floor(parentWrapperHeight - parentPaddingSize);
9517
9539
  },
9518
9540
  /**
9519
9541
  * 获取需要排除的高度
@@ -10180,7 +10202,8 @@ export default defineVxeComponent({
10180
10202
  */
10181
10203
  handleCustom() {
10182
10204
  const { mouseConfig } = props;
10183
- if (mouseConfig) {
10205
+ const mouseOpts = computeMouseOpts.value;
10206
+ if (hasEnableConf(mouseConfig, mouseOpts)) {
10184
10207
  if ($xeTable.clearSelected) {
10185
10208
  $xeTable.clearSelected();
10186
10209
  }
@@ -11338,7 +11361,7 @@ export default defineVxeComponent({
11338
11361
  const { field, sortable, order } = column;
11339
11362
  if (sortable) {
11340
11363
  const params = { $table: $xeTable, $event: evnt, column, field, property: field, order, sortList: $xeTable.getSortColumns(), sortTime: column.sortTime };
11341
- if (mouseConfig && mouseOpts.area && $xeTable.handleSortEvent) {
11364
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area && $xeTable.handleSortEvent) {
11342
11365
  $xeTable.handleSortEvent(evnt, params);
11343
11366
  }
11344
11367
  if (!order) {
@@ -11415,7 +11438,7 @@ export default defineVxeComponent({
11415
11438
  $xeTable.handleHeaderCellDragMousedownEvent(evnt, params);
11416
11439
  }
11417
11440
  }
11418
- if (!triggerDrag && mouseConfig && mouseOpts.area && $xeTable.handleHeaderCellAreaMouseDnEvent) {
11441
+ if (!triggerDrag && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area && $xeTable.handleHeaderCellAreaMouseDnEvent) {
11419
11442
  $xeTable.handleHeaderCellAreaMouseDnEvent(evnt, Object.assign({ cell, triggerSort, triggerFilter }, params));
11420
11443
  }
11421
11444
  $xeTable.focus();
@@ -12156,6 +12179,7 @@ export default defineVxeComponent({
12156
12179
  handleColDragSwapEvent(evnt, isSyncColumn, dragCol, prevDragCol, prevDragPos, prevDragToChild) {
12157
12180
  const { mouseConfig } = props;
12158
12181
  const columnDragOpts = computeColumnDragOpts.value;
12182
+ const mouseOpts = computeMouseOpts.value;
12159
12183
  const { animation, isPeerDrag, isCrossDrag, isSelfToChildDrag, isToChildDrag, dragEndMethod, dragToChildMethod } = columnDragOpts;
12160
12184
  const { collectColumn, fullColumnIdData } = internalData;
12161
12185
  const el = refElem.value;
@@ -12318,7 +12342,7 @@ export default defineVxeComponent({
12318
12342
  }
12319
12343
  });
12320
12344
  $xeTable.handleClearStack();
12321
- if (mouseConfig) {
12345
+ if (hasEnableConf(mouseConfig, mouseOpts)) {
12322
12346
  if ($xeTable.clearSelected) {
12323
12347
  $xeTable.clearSelected();
12324
12348
  }
@@ -13828,7 +13852,7 @@ export default defineVxeComponent({
13828
13852
  ]);
13829
13853
  };
13830
13854
  const renderVN = () => {
13831
- const { loading, stripe, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules } = props;
13855
+ const { loading, stripe, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules, importConfig, exportConfig, printConfig } = props;
13832
13856
  const { isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, tableData, initStore, isRowGroupStatus, columnStore, filterStore, customStore, tooltipStore } = reactData;
13833
13857
  const { teleportToWrapperElem, popupToWrapperElem, customPopupToElem } = internalData;
13834
13858
  const { leftList, rightList } = columnStore;
@@ -13856,10 +13880,13 @@ export default defineVxeComponent({
13856
13880
  const isContentMenu = computeIsContentMenu.value;
13857
13881
  const currLoading = reactData.isColLoading || reactData.isRowLoading || loading;
13858
13882
  const resizableOpts = computeResizableOpts.value;
13859
- const isArea = mouseConfig && mouseOpts.area;
13883
+ const isArea = hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area;
13860
13884
  const columnDragOpts = computeColumnDragOpts.value;
13861
13885
  const scrollbarXToTop = computeScrollbarXToTop.value;
13862
13886
  const scrollbarYToLeft = computeScrollbarYToLeft.value;
13887
+ const exportOpts = computeExportOpts.value;
13888
+ const importOpts = computeImportOpts.value;
13889
+ const printOpts = computePrintOpts.value;
13863
13890
  const { isCrossTableDrag } = rowDragOpts;
13864
13891
  const tbOns = {
13865
13892
  onKeydown: keydownEvent,
@@ -13874,7 +13901,7 @@ export default defineVxeComponent({
13874
13901
  'vxe-editable': !!editConfig,
13875
13902
  'old-cell-valid': editRules && getConfig().cellVaildMode === 'obsolete',
13876
13903
  'cell--highlight': highlightCell,
13877
- 'cell--selected': mouseConfig && mouseOpts.selected,
13904
+ 'cell--selected': hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.selected,
13878
13905
  'cell--area': isArea,
13879
13906
  'header-cell--area': isArea && areaOpts.selectCellByHeader,
13880
13907
  'body-cell--area': isArea && areaOpts.selectCellByBody,
@@ -14084,7 +14111,7 @@ export default defineVxeComponent({
14084
14111
  /**
14085
14112
  * 导入
14086
14113
  */
14087
- initStore.import && props.importConfig
14114
+ initStore.import && hasEnableConf(importConfig, importOpts)
14088
14115
  ? h(TableImportPanelComponent, {
14089
14116
  key: 'it',
14090
14117
  defaultOptions: reactData.importParams,
@@ -14094,7 +14121,7 @@ export default defineVxeComponent({
14094
14121
  /**
14095
14122
  * 导出
14096
14123
  */
14097
- initStore.export && (props.exportConfig || props.printConfig)
14124
+ initStore.export && (hasEnableConf(exportConfig, exportOpts) || hasEnableConf(printConfig, printOpts))
14098
14125
  ? h(TableExportPanelComponent, {
14099
14126
  key: 'et',
14100
14127
  defaultOptions: reactData.exportParams,
@@ -14436,7 +14463,7 @@ export default defineVxeComponent({
14436
14463
  $xeTable.preventEvent(null, 'deactivated', { $table: $xeTable });
14437
14464
  });
14438
14465
  onMounted(() => {
14439
- const { editConfig, exportConfig, importConfig, treeConfig, minHeight, keepSource } = props;
14466
+ const { editConfig, exportConfig, importConfig, treeConfig, minHeight, keepSource, areaConfig } = props;
14440
14467
  const { scrollXStore, scrollYStore } = internalData;
14441
14468
  const columnOpts = computeColumnOpts.value;
14442
14469
  const columnDragOpts = computeColumnDragOpts.value;
@@ -14550,13 +14577,13 @@ export default defineVxeComponent({
14550
14577
  // warnLog('vxe.error.delProp', ['scroll-x', 'virtual-x-config'])
14551
14578
  // }
14552
14579
  // 检查导入导出类型,如果自定义导入导出方法,则不校验类型
14553
- if (importConfig && importOpts.types && !importOpts.importMethod && !XEUtils.includeArrays(XEUtils.keys(importOpts._typeMaps), importOpts.types)) {
14580
+ if (hasEnableConf(importConfig, importOpts) && importOpts.types && !importOpts.importMethod && !XEUtils.includeArrays(XEUtils.keys(importOpts._typeMaps), importOpts.types)) {
14554
14581
  warnLog('vxe.error.errProp', [`export-config.types=${importOpts.types.join(',')}`, importOpts.types.filter((type) => XEUtils.includes(XEUtils.keys(importOpts._typeMaps), type)).join(',') || XEUtils.keys(importOpts._typeMaps).join(',')]);
14555
14582
  }
14556
- if (exportConfig && exportOpts.types && !exportOpts.exportMethod && !XEUtils.includeArrays(XEUtils.keys(exportOpts._typeMaps), exportOpts.types)) {
14583
+ if (hasEnableConf(exportConfig, exportOpts) && exportOpts.types && !exportOpts.exportMethod && !XEUtils.includeArrays(XEUtils.keys(exportOpts._typeMaps), exportOpts.types)) {
14557
14584
  warnLog('vxe.error.errProp', [`export-config.types=${exportOpts.types.join(',')}`, exportOpts.types.filter((type) => XEUtils.includes(XEUtils.keys(exportOpts._typeMaps), type)).join(',') || XEUtils.keys(exportOpts._typeMaps).join(',')]);
14558
14585
  }
14559
- if (exportConfig && XEUtils.isBoolean(exportOpts.isAllExpand)) {
14586
+ if (hasEnableConf(exportConfig, exportOpts) && XEUtils.isBoolean(exportOpts.isAllExpand)) {
14560
14587
  warnLog('vxe.error.delProp', ['isAllExpand', 'isTreeAllExpanded']);
14561
14588
  }
14562
14589
  if (!props.id) {
@@ -14570,8 +14597,8 @@ export default defineVxeComponent({
14570
14597
  if (rowOpts.height && !props.showOverflow) {
14571
14598
  warnLog('vxe.error.notProp', ['table.show-overflow']);
14572
14599
  }
14573
- if (!$xeTable.triggerClAreaMnEvent) {
14574
- if (props.areaConfig) {
14600
+ if (!$xeTable.triggerClAaMnEvent) {
14601
+ if (hasEnableConf(areaConfig, areaOpts)) {
14575
14602
  warnLog('vxe.error.notProp', ['area-config']);
14576
14603
  }
14577
14604
  if (props.clipConfig) {
@@ -14657,10 +14684,10 @@ export default defineVxeComponent({
14657
14684
  if (columnOpts.currentMethod) {
14658
14685
  warnLog('vxe.error.delProp', ['row-config.currentMethod', 'current-column-config.beforeSelectMethod']);
14659
14686
  }
14660
- // if ((rowOpts.isCurrent || highlightCurrentRow) && props.keyboardConfig && keyboardOpts.isArrow && !XEUtils.isBoolean(currentRowOpts.isFollowSelected)) {
14687
+ // if ((rowOpts.isCurrent || highlightCurrentRow) && hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isArrow && !XEUtils.isBoolean(currentRowOpts.isFollowSelected)) {
14661
14688
  // warnLog('vxe.error.notConflictProp', ['row-config.isCurrent & keyboard-config.isArrow', 'current-row-config.isFollowSelected'])
14662
14689
  // }
14663
- // if ((columnOpts.isCurrent || highlightCurrentColumn) && props.keyboardConfig && keyboardOpts.isArrow && !XEUtils.isBoolean(currentColumnOpts.isFollowSelected)) {
14690
+ // if ((columnOpts.isCurrent || highlightCurrentColumn) && hasEnableConf(keyboardConfig, keyboardOpts) && keyboardOpts.isArrow && !XEUtils.isBoolean(currentColumnOpts.isFollowSelected)) {
14664
14691
  // warnLog('vxe.error.notConflictProp', ['column-config.isCurrent & keyboard-config.isArrow', 'current-column-config.isFollowSelected'])
14665
14692
  // }
14666
14693
  // 如果不支持虚拟滚动
@@ -14684,10 +14711,10 @@ export default defineVxeComponent({
14684
14711
  // if (props.editRules && !$xeTable.validate) {
14685
14712
  // errLog('vxe.error.reqModule', ['Validator'])
14686
14713
  // }
14687
- // if ((checkboxOpts.range || props.keyboardConfig || props.mouseConfig) && !$xeTable.handleCellMousedownEvent) {
14714
+ // if ((checkboxOpts.range || hasEnableConf(keyboardConfig, keyboardOpts) || hasEnableConf(mouseConfig, mouseOpts)) && !$xeTable.handleCellMousedownEvent) {
14688
14715
  // errLog('vxe.error.reqModule', ['Keyboard'])
14689
14716
  // }
14690
- // if ((props.printConfig || props.importConfig || props.exportConfig) && !$xeTable.exportData) {
14717
+ // if (hasEnableConf(printConfig, printOpts) || hasEnableConf(importConfig, importOpts) || hasEnableConf(exportConfig, exportOpts)) && !$xeTable.exportData) {
14691
14718
  // errLog('vxe.error.reqModule', ['Export'])
14692
14719
  // }
14693
14720
  Object.assign(scrollYStore, {
@@ -2,7 +2,7 @@ import { watch, reactive } from 'vue';
2
2
  import XEUtils from 'xe-utils';
3
3
  import { ColumnInfo } from './columnInfo';
4
4
  import { isPx, isScale, queryElement } from '../../ui/src/dom';
5
- import { eqEmptyValue } from '../../ui/src/utils';
5
+ import { eqEmptyValue, hasEnableConf } from '../../ui/src/utils';
6
6
  export function createInternalData() {
7
7
  return {
8
8
  tZindex: 0,
@@ -892,6 +892,10 @@ export function getLastChildColumn(column) {
892
892
  }
893
893
  export function clearTableDefaultStatus($xeTable) {
894
894
  const { props, internalData } = $xeTable;
895
+ const { keyboardConfig, mouseConfig } = props;
896
+ const { computeMouseOpts, computeKeyboardOpts } = $xeTable.getComputeMaps();
897
+ const mouseOpts = computeMouseOpts.value;
898
+ const keyboardOpts = computeKeyboardOpts.value;
895
899
  internalData.initStatus = false;
896
900
  const actionList = [
897
901
  $xeTable.clearSort(),
@@ -909,10 +913,10 @@ export function clearTableDefaultStatus($xeTable) {
909
913
  if ($xeTable.clearFilter) {
910
914
  actionList.push($xeTable.clearFilter());
911
915
  }
912
- if ($xeTable.clearSelected && (props.keyboardConfig || props.mouseConfig)) {
916
+ if ($xeTable.clearSelected && (hasEnableConf(keyboardConfig, keyboardOpts) || hasEnableConf(mouseConfig, mouseOpts))) {
913
917
  actionList.push($xeTable.clearSelected());
914
918
  }
915
- if ($xeTable.clearCellAreas && props.mouseConfig) {
919
+ if ($xeTable.clearCellAreas && hasEnableConf(mouseConfig, mouseOpts)) {
916
920
  actionList.push($xeTable.clearCellAreas(), $xeTable.clearCopyCellArea());
917
921
  }
918
922
  return Promise.all(actionList).then(() => {
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 = "4.22.4";
3
+ export const version = "4.23.0-beta.0";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const tableVersion = `table v${"4.22.4"}`;
3
+ const tableVersion = `table v${"4.23.0-beta.0"}`;
4
4
  export function createComponentLog(name) {
5
5
  const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
6
6
  const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
@@ -5,6 +5,15 @@ const { getConfig } = VxeUI;
5
5
  export function isEnableConf(conf) {
6
6
  return conf && conf.enabled !== false;
7
7
  }
8
+ /**
9
+ * 用于开关类型的配置项
10
+ * 局部启用规则:conf={}
11
+ * 局部禁用规则:conf={enabled:false}
12
+ * 全局默认启用规则:conf.enabled=true
13
+ */
14
+ export function hasEnableConf(conf, opts) {
15
+ return opts && (conf ? opts.enabled !== false : opts.enabled);
16
+ }
8
17
  export function isEmptyValue(cellValue) {
9
18
  return cellValue === null || cellValue === undefined || cellValue === '';
10
19
  }
@@ -1935,10 +1935,22 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
1935
1935
  }
1936
1936
  return 0;
1937
1937
  },
1938
+ getParentElem() {
1939
+ const el = refElem.value;
1940
+ if (!el) {
1941
+ return null;
1942
+ }
1943
+ let parentEl = el.parentElement;
1944
+ // 如果是虚拟滚动条
1945
+ if (parentEl && (0, _dom.hasClass)(parentEl, 'vxe-scrollbar--view-inner')) {
1946
+ parentEl = parentEl.parentElement;
1947
+ }
1948
+ return parentEl;
1949
+ },
1938
1950
  getParentHeight() {
1939
1951
  const el = refElem.value;
1940
1952
  if (el) {
1941
- const parentEl = el.parentElement;
1953
+ const parentEl = $xeGrid.getParentElem();
1942
1954
  return (reactData.isZMax ? (0, _dom.getDomNode)().visibleHeight : parentEl ? _xeUtils.default.toNumber(getComputedStyle(parentEl).height) : 0) - gridPrivateMethods.getExcludeHeight();
1943
1955
  }
1944
1956
  return 0;