vxe-table 4.21.4 → 4.21.6

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 (73) hide show
  1. package/README.md +23 -16
  2. package/dist/all.esm.js +274 -88
  3. package/dist/style.css +1 -1
  4. package/dist/style.min.css +1 -1
  5. package/es/index.css +1 -1
  6. package/es/index.min.css +1 -1
  7. package/es/style.css +1 -1
  8. package/es/style.min.css +1 -1
  9. package/es/table/module/filter/hook.js +67 -56
  10. package/es/table/module/keyboard/hook.js +3 -4
  11. package/es/table/src/body.js +3 -3
  12. package/es/table/src/footer.js +3 -3
  13. package/es/table/src/header.js +6 -6
  14. package/es/table/src/table.js +24 -11
  15. package/es/table/src/util.js +6 -5
  16. package/es/table/style.css +1 -1
  17. package/es/table/style.min.css +1 -1
  18. package/es/ui/index.js +1 -1
  19. package/es/ui/src/dom.js +162 -0
  20. package/es/ui/src/log.js +1 -1
  21. package/es/vxe-table/style.css +1 -1
  22. package/es/vxe-table/style.min.css +1 -1
  23. package/lib/index.css +1 -1
  24. package/lib/index.min.css +1 -1
  25. package/lib/index.umd.js +272 -96
  26. package/lib/index.umd.min.js +1 -1
  27. package/lib/style.css +1 -1
  28. package/lib/style.min.css +1 -1
  29. package/lib/table/module/filter/hook.js +65 -58
  30. package/lib/table/module/filter/hook.min.js +1 -1
  31. package/lib/table/module/keyboard/hook.js +3 -5
  32. package/lib/table/module/keyboard/hook.min.js +1 -1
  33. package/lib/table/src/body.js +5 -4
  34. package/lib/table/src/body.min.js +1 -1
  35. package/lib/table/src/footer.js +5 -4
  36. package/lib/table/src/footer.min.js +1 -1
  37. package/lib/table/src/header.js +10 -8
  38. package/lib/table/src/header.min.js +1 -1
  39. package/lib/table/src/table.js +11 -9
  40. package/lib/table/src/table.min.js +1 -1
  41. package/lib/table/src/util.js +6 -5
  42. package/lib/table/src/util.min.js +1 -1
  43. package/lib/table/style/style.css +1 -1
  44. package/lib/table/style/style.min.css +1 -1
  45. package/lib/ui/index.js +1 -1
  46. package/lib/ui/index.min.js +1 -1
  47. package/lib/ui/src/dom.js +167 -0
  48. package/lib/ui/src/dom.min.js +1 -1
  49. package/lib/ui/src/log.js +1 -1
  50. package/lib/ui/src/log.min.js +1 -1
  51. package/lib/vxe-table/style/style.css +1 -1
  52. package/lib/vxe-table/style/style.min.css +1 -1
  53. package/package.json +2 -2
  54. package/packages/table/module/custom/hook.ts +1 -1
  55. package/packages/table/module/filter/hook.ts +67 -53
  56. package/packages/table/module/keyboard/hook.ts +3 -4
  57. package/packages/table/src/body.ts +3 -3
  58. package/packages/table/src/footer.ts +3 -3
  59. package/packages/table/src/header.ts +6 -6
  60. package/packages/table/src/table.ts +24 -11
  61. package/packages/table/src/util.ts +9 -6
  62. package/packages/ui/src/dom.ts +176 -0
  63. package/styles/components/table-module/filter.scss +1 -1
  64. package/styles/theme/base.scss +2 -0
  65. package/styles/theme/dark.scss +4 -4
  66. package/styles/theme/light.scss +4 -4
  67. package/styles/variable.scss +4 -4
  68. /package/es/{iconfont.1788399047071.ttf → iconfont.1788695187811.ttf} +0 -0
  69. /package/es/{iconfont.1788399047071.woff → iconfont.1788695187811.woff} +0 -0
  70. /package/es/{iconfont.1788399047071.woff2 → iconfont.1788695187811.woff2} +0 -0
  71. /package/lib/{iconfont.1788399047071.ttf → iconfont.1788695187811.ttf} +0 -0
  72. /package/lib/{iconfont.1788399047071.woff → iconfont.1788695187811.woff} +0 -0
  73. /package/lib/{iconfont.1788399047071.woff2 → iconfont.1788695187811.woff2} +0 -0
package/README.md CHANGED
@@ -20,34 +20,45 @@
20
20
  * 双向数据流的设计,在渲染器或自定义扩展中支持直接操作数据值,达到最高效的简洁 API 设计
21
21
  * 按需加载、自定义主题样式
22
22
 
23
+ * 分支说明
24
+ * v3 分支和 v4 分支功能与 API 保持同步更新
25
+ * v3 分支对应 vue 2.6~2.7 版本,v3.9+ 为长期维护版本
26
+ * v4 分支对应 vue 3.x 版本,v4.7+ 为长期维护版本
27
+
23
28
  * 版本说明
24
29
  * **V4**
25
- * [ ] v4.22 功能需求收集中,大福提升渲染性能,优化百万级渲染量
26
- * [x] v4.21 重构全键盘操作,解决按键输入为拼音输入法时第一个字符无法唤起输入法问题
30
+ * [ ] v4.? 重构虚拟渲染v8,数据渲染量提升至千万级
31
+ * [ ] v4.? 重构虚拟渲染v7,优化百万级渲染量
32
+ * [ ] v4.? 重构虚拟渲染v6,同时支持原生滚动条和虚拟滚动条
33
+ * [ ] v4.? 功能需求收集中...
34
+ * [x] v4.21 重构全键盘操作,修复按键编辑为拼音输入法时首字母丢失问题;筛选支持自适应屏幕上下位置显示;优化虚拟渲染,解决滚动错位场景
27
35
  * [x] v4.20 内部重构优化,内部结构调整
28
36
  * [x] v4.19 增加对增删改操作撤销回退的支持;优化虚拟渲染,优化提升 Window/Mac 触摸板滚动流畅度
29
37
  * [x] v4.18 基于 xe-utils@4.0+,内部优化,优化键盘操作
30
38
  * [x] v4.17 优化触摸板操作;重构筛选渲染,筛选配置更简单功能更强大
31
39
  * [x] v4.16 适配 Gantt 甘特图
32
- * [x] v4.15 优化虚拟渲染,降低内存的占用率
33
- * [x] v4.14 重构虚拟渲染,提高渲染与拖拽效果流畅度
34
- * [x] v4.13 优化虚拟渲染,提升 Chrome、Safari、Firefox 流畅度极兼容性
35
- * [x] v4.12 重构虚拟渲染,支持百万级数据渲染、渲染性能及流畅度大幅提升
40
+ * [x] v4.15 重构虚拟渲染v5,降低内存的占用率
41
+ * [x] v4.14 重构虚拟渲染v4,提高渲染与拖拽效果流畅度
42
+ * [x] v4.13 重构虚拟渲染v3,提升 Chrome、Safari、Firefox 流畅度极兼容性
43
+ * [x] v4.12 重构虚拟渲染v2,支持百万级数据渲染、渲染性能及流畅度大幅提升
36
44
  * [x] v4.11 重构展开行功能,同时支持展开行与虚拟渲染和冻结列
37
45
  * [x] v4.7 基于 vue3.2+,内部重构,拆分 Table 库和 UI 库,只支持现代浏览器,不支持 IE
38
46
  * [x] ~~v4.0 基于 vue3.2+,只支持现代浏览器,不支持 IE(2020-03-01 ~ 2024-12-01 已停止维护)~~
39
47
  * **V3**
40
- * [ ] v3.24 功能需求收集中,大福提升渲染性能,优化百万级渲染量
41
- * [x] v3.23 重构全键盘操作,解决按键输入为拼音输入法时第一个字符无法唤起输入法问题
48
+ * [ ] v3.? 重构虚拟渲染v8,数据渲染量提升至千万级
49
+ * [ ] v3.? 重构虚拟渲染v7,优化百万级渲染量
50
+ * [ ] v3.? 重构虚拟渲染v6,同时支持原生滚动条和虚拟滚动条
51
+ * [ ] v3.? 功能需求收集中...
52
+ * [x] v3.23 重构全键盘操作,修复按键编辑为拼音输入法时首字母丢失问题;筛选支持自适应屏幕上下位置显示;优化虚拟渲染,解决滚动错位场景
42
53
  * [x] v3.22 内部重构优化,内部结构调整
43
54
  * [x] v3.21 增加对增删改操作撤销回退的支持;优化虚拟渲染,优化提升 Window/Mac 触摸板滚动流畅度
44
55
  * [x] v3.20 基于 xe-utils@4.0+,优化渲染性能,优化键盘操作
45
56
  * [x] v3.19 优化触摸板操作;重构筛选渲染,筛选配置更简单功能更强大
46
57
  * [x] v3.18 适配 Gantt 甘特图
47
- * [x] v3.17 优化虚拟渲染,降低内存的占用率
48
- * [x] v3.16 重构虚拟渲染,提高渲染与拖拽效果流畅度
49
- * [x] v3.15 优化虚拟渲染,提升 Chrome、Safari、Firefox 流畅度极兼容性
50
- * [x] v3.14 重构虚拟渲染,支持百万级数据渲染、渲染性能及流畅度大幅提升
58
+ * [x] v3.17 重构虚拟渲染v5,降低内存的占用率
59
+ * [x] v3.16 重构虚拟渲染v4,提高渲染与拖拽效果流畅度
60
+ * [x] v3.15 重构虚拟渲染v3,提升 Chrome、Safari、Firefox 流畅度极兼容性
61
+ * [x] v3.14 重构虚拟渲染v2,支持百万级数据渲染、渲染性能及流畅度大幅提升
51
62
  * [x] v3.13 重构展开行功能,同时支持展开行与虚拟渲染和冻结列
52
63
  * [x] v3.9 基于 vue2.6~2.7,内部重构,拆分 Table 库和 UI 库,只支持现代浏览器,不支持 IE
53
64
  * [x] ~~v3.0 基于 vue2.6~2.7,支持现代浏览器并保留兼容 IE11(2020-03-01 ~ 2024-12-01 已停止维护)~~
@@ -55,10 +66,6 @@
55
66
  * [x] ~~v2.0 基于 vue2.6~2.7,支持所有主流的浏览器,同时兼具功能与性能(2019-03-01 ~ 2021-12-01 已停止维护)~~
56
67
  * **V1**
57
68
  * [x] ~~v1.0 基于 vue2.6~2.7,支持所有主流的浏览器,实现表格的一切实用的功能(2018-02-01 ~ 2020-04-01 已停止维护)~~
58
- * 版本计划
59
- * [x] 优化展开行与冻结列
60
- * [ ] 优化虚拟渲染,支持千万级数据渲染
61
- * [ ] 数据图表可视化
62
69
 
63
70
  ## 浏览器支持
64
71
 
package/dist/all.esm.js CHANGED
@@ -47,7 +47,7 @@ function getDefaultConfig(val1, def1) {
47
47
  return XEUtils.eqNull(val1) ? def1 : val1;
48
48
  }
49
49
 
50
- const version = "4.21.4";
50
+ const version = "4.21.6";
51
51
  VxeUI.version = version;
52
52
  VxeUI.tableVersion = version;
53
53
  VxeUI.setConfig({
@@ -729,6 +729,18 @@ function hasEventInputTarget(target) {
729
729
  const tagName = target ? target.tagName : '';
730
730
  return tagName && ['input', 'textarea'].includes((tagName.toLowerCase()));
731
731
  }
732
+ /**
733
+ * 判断是否由内部可复用控件触发,输入框带有 vxe-reusekeep-control
734
+ */
735
+ function hasReusekeepControl(elem) {
736
+ if (elem) {
737
+ return hasClass(elem, 'vxe-reusekeep-control');
738
+ }
739
+ return false;
740
+ }
741
+ function hasAxternalInputTarget(target) {
742
+ return hasEventInputTarget(target) ? !hasReusekeepControl(target) : false;
743
+ }
732
744
  const scrollIntoViewIfNeeded = 'scrollIntoViewIfNeeded';
733
745
  const scrollIntoView = 'scrollIntoView';
734
746
  function scrollToView(elem) {
@@ -767,9 +779,159 @@ function wheelScrollTopTo(diffNum, cb) {
767
779
  wtaFrame = null;
768
780
  });
769
781
  }
782
+ /**
783
+ * 通用定位计算
784
+ */
785
+ function updatePanelPlacement(targetElem, panelElem, options) {
786
+ const { defaultTop, defaultLeft, placement, defaultPlacement, teleportTo, marginSize, isMinWidth } = Object.assign({
787
+ teleportTo: false,
788
+ marginSize: 18,
789
+ isMinWidth: true
790
+ }, options);
791
+ let panelPlacement = 'bottom';
792
+ let top = '';
793
+ let bottom = '';
794
+ let left = 0;
795
+ let minWidth = '';
796
+ let arrowLeft = '';
797
+ const stys = {};
798
+ if (panelElem && targetElem) {
799
+ const bodyEl = document.body;
800
+ const parentWrapperEl = getPopupWrapperElement(panelElem);
801
+ if (parentWrapperEl) {
802
+ const targetWidth = targetElem.offsetWidth;
803
+ const targetHeight = targetElem.offsetHeight;
804
+ const panelWidth = panelElem.offsetWidth;
805
+ const panelHeight = panelElem.offsetHeight;
806
+ const parentWrapperRect = parentWrapperEl.getBoundingClientRect();
807
+ const panelRect = panelElem.getBoundingClientRect();
808
+ const targetRect = targetElem.getBoundingClientRect();
809
+ const visibleHeight = bodyEl.clientHeight;
810
+ const visibleWidth = bodyEl.clientWidth;
811
+ const offsetLeft = parentWrapperRect.left;
812
+ const offsetTop = parentWrapperRect.top;
813
+ const targetLeft = targetRect.left;
814
+ const targetTop = targetRect.top;
815
+ minWidth = targetElem.offsetWidth;
816
+ if (teleportTo) {
817
+ left = defaultLeft || (targetLeft - (panelWidth - targetWidth) / 2);
818
+ top = defaultTop || (targetTop + targetHeight);
819
+ if (placement === 'top') {
820
+ panelPlacement = 'top';
821
+ top = targetTop - panelHeight;
822
+ }
823
+ else if (!placement) {
824
+ if (defaultPlacement === 'top') {
825
+ panelPlacement = 'top';
826
+ if (!defaultTop) {
827
+ top = targetTop - panelHeight;
828
+ }
829
+ // 如果上面不够放,则向下
830
+ if (top < marginSize) {
831
+ panelPlacement = 'bottom';
832
+ top = targetTop + targetHeight;
833
+ }
834
+ // 如果下面不够放,则向上(优先)
835
+ if (top + panelHeight + marginSize > visibleHeight) {
836
+ panelPlacement = 'top';
837
+ top = targetTop - panelHeight;
838
+ }
839
+ }
840
+ else {
841
+ // 如果下面不够放,则向上
842
+ if (top + panelHeight + marginSize > visibleHeight) {
843
+ panelPlacement = 'top';
844
+ top = targetTop - panelHeight;
845
+ }
846
+ // 如果上面不够放,则向下(优先)
847
+ if (top < marginSize) {
848
+ panelPlacement = 'bottom';
849
+ top = targetTop + targetHeight;
850
+ }
851
+ }
852
+ }
853
+ // 如果溢出右边
854
+ if (left + panelWidth + marginSize > visibleWidth) {
855
+ left -= left + panelWidth + marginSize - visibleWidth;
856
+ }
857
+ // 如果溢出左边
858
+ if (left < marginSize) {
859
+ left = marginSize;
860
+ }
861
+ // 偏移
862
+ top -= offsetTop;
863
+ left -= offsetLeft;
864
+ }
865
+ else {
866
+ if (placement === 'top') {
867
+ panelPlacement = 'top';
868
+ bottom = targetHeight;
869
+ }
870
+ else if (!placement) {
871
+ // 如果下面不够放,则向上
872
+ top = targetHeight;
873
+ if (targetTop + targetHeight + panelHeight + marginSize > visibleHeight) {
874
+ // 如果上面不够放,则向下(优先)
875
+ if (targetTop - targetHeight - panelHeight > marginSize) {
876
+ panelPlacement = 'top';
877
+ top = '';
878
+ bottom = targetHeight;
879
+ }
880
+ }
881
+ }
882
+ // 是否超出右侧
883
+ if (panelRect.left + panelRect.width + marginSize > visibleWidth) {
884
+ left = -(panelRect.left + panelRect.width + marginSize - visibleWidth);
885
+ }
886
+ }
887
+ if (XEUtils.isNumber(top)) {
888
+ stys.top = toCssUnit(top);
889
+ }
890
+ if (XEUtils.isNumber(bottom)) {
891
+ stys.bottom = toCssUnit(bottom);
892
+ }
893
+ if (XEUtils.isNumber(left)) {
894
+ stys.left = toCssUnit(left);
895
+ }
896
+ if (isMinWidth && XEUtils.isNumber(minWidth)) {
897
+ stys.minWidth = toCssUnit(minWidth);
898
+ }
899
+ // 箭头
900
+ if (left === targetLeft) {
901
+ if (targetWidth <= panelWidth) {
902
+ arrowLeft = targetWidth / 2;
903
+ }
904
+ }
905
+ else if (left < targetLeft) {
906
+ if (left + panelWidth > targetLeft + targetWidth) {
907
+ arrowLeft = (targetLeft - left) + targetWidth / 2;
908
+ }
909
+ else {
910
+ arrowLeft = (targetLeft - left) + (panelWidth - (targetLeft - left)) / 2;
911
+ }
912
+ }
913
+ }
914
+ }
915
+ return {
916
+ top: top || 0,
917
+ bottom: bottom || 0,
918
+ left: left || 0,
919
+ arrowLeft: arrowLeft || 0,
920
+ style: stys,
921
+ placement: panelPlacement
922
+ };
923
+ }
924
+ function getPopupWrapperElement(panelElem) {
925
+ if (!panelElem) {
926
+ return null;
927
+ }
928
+ const bodyEl = document.body;
929
+ const parentEl = panelElem.parentElement;
930
+ return (parentEl === bodyEl ? document.documentElement : parentEl) || null;
931
+ }
770
932
 
771
933
  const { log } = VxeUI;
772
- const tableVersion = `table v${"4.21.4"}`;
934
+ const tableVersion = `table v${"4.21.6"}`;
773
935
  function createComponentLog(name) {
774
936
  const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
775
937
  const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
@@ -1016,6 +1178,10 @@ function createInternalData$3() {
1016
1178
  customMaxHeight: 0,
1017
1179
  // 当前 hover 行
1018
1180
  hoverRow: null,
1181
+ hoverCol: null,
1182
+ // 当前行
1183
+ currentRow: null,
1184
+ currentCol: null,
1019
1185
  // 最后滚动位置
1020
1186
  lastScrollLeft: 0,
1021
1187
  lastScrollTop: 0,
@@ -1063,8 +1229,6 @@ function createInternalData$3() {
1063
1229
  fullColumnFieldData: {},
1064
1230
  fullCellHeightMaps: {},
1065
1231
  fullCellStoreMaps: {},
1066
- // 当前行
1067
- currentRow: null,
1068
1232
  // 合并表头单元格的数据
1069
1233
  mergeHeaderList: [],
1070
1234
  mergeHeaderMaps: {},
@@ -1164,8 +1328,6 @@ function createReactData$2() {
1164
1328
  isAllSelected: false,
1165
1329
  // 复选框属性,有选中且非全选状态
1166
1330
  isIndeterminate: false,
1167
- // 单选框属性,选中列
1168
- currentColumn: null,
1169
1331
  // 单选框属性,选中行
1170
1332
  selectRadioRow: null,
1171
1333
  // 表尾合计数据
@@ -1374,7 +1536,8 @@ function createReactData$2() {
1374
1536
  dragTipText: '',
1375
1537
  isDragResize: false,
1376
1538
  isRowLoading: false,
1377
- isColLoading: false
1539
+ isColLoading: false,
1540
+ currColFlag: 1
1378
1541
  };
1379
1542
  }
1380
1543
  const maxKey = '__max';
@@ -4150,8 +4313,8 @@ var TableBodyComponent = defineVxeComponent({
4150
4313
  const $xeGrid = $xeTable.xeGrid;
4151
4314
  const $xeGantt = $xeTable.xeGantt;
4152
4315
  const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, treeConfig, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps;
4153
- const { tableData, tableColumn, dragRow, overflowX, overflowY, currentColumn, scrollXLoad, scrollYLoad, mergeBodyFlag, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag, editStore, isAllOverflow, validErrorMaps } = tableReactData;
4154
- const { fullAllDataRowIdData, fullColumnIdData, mergeBodyCellMaps, visibleColumn, afterFullData, mergeBodyList, scrollXStore, scrollYStore, keepUpdateFieldMaps } = tableInternalData;
4316
+ const { tableData, tableColumn, dragRow, overflowX, overflowY, scrollXLoad, scrollYLoad, mergeBodyFlag, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag, editStore, isAllOverflow, validErrorMaps, currColFlag } = tableReactData;
4317
+ const { fullAllDataRowIdData, fullColumnIdData, mergeBodyCellMaps, visibleColumn, afterFullData, mergeBodyList, scrollXStore, scrollYStore, keepUpdateFieldMaps, currentCol } = tableInternalData;
4155
4318
  const cellOpts = computeCellOpts.value;
4156
4319
  const validOpts = computeValidOpts.value;
4157
4320
  const checkboxOpts = computeCheckboxOpts.value;
@@ -4496,7 +4659,7 @@ var TableBodyComponent = defineVxeComponent({
4496
4659
  'col--active': editConfig && isEdit && (actived.row === row && (actived.column === column || editOpts.mode === 'row')),
4497
4660
  'col--valid-error': !!errorValidItem,
4498
4661
  'show--valid-bg': errorValidItem && validOpts.showErrorBackground,
4499
- 'col--current': currentColumn === column
4662
+ 'col--current': currColFlag && currentCol === column
4500
4663
  },
4501
4664
  getPropClass(compCellClassName, cellParams),
4502
4665
  getPropClass(className, cellParams),
@@ -4980,8 +5143,8 @@ var TableHeaderComponent = defineVxeComponent({
4980
5143
  const $xeGantt = $xeTable.xeGantt;
4981
5144
  const { fixedType } = props;
4982
5145
  const { resizable: allResizable, columnKey, showCustomHeader, headerCellClassName, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, mouseConfig } = tableProps;
4983
- const { currentColumn, dragCol, scrollXLoad, scrollYLoad, overflowX, mergeHeadFlag, tableColumn } = tableReactData;
4984
- const { fullColumnIdData, scrollXStore, mergeHeaderList, mergeHeaderCellMaps } = tableInternalData;
5146
+ const { dragCol, scrollXLoad, scrollYLoad, overflowX, mergeHeadFlag, tableColumn, currColFlag } = tableReactData;
5147
+ const { fullColumnIdData, scrollXStore, mergeHeaderList, mergeHeaderCellMaps, currentCol } = tableInternalData;
4985
5148
  const virtualXOpts = computeVirtualXOpts.value;
4986
5149
  const columnOpts = computeColumnOpts.value;
4987
5150
  const columnDragOpts = computeColumnDragOpts.value;
@@ -5131,7 +5294,7 @@ var TableHeaderComponent = defineVxeComponent({
5131
5294
  'is--filter-active': hasFilter,
5132
5295
  'is--drag-active': columnOpts.drag && !column.fixed && !isDisabledDrag && (isCrossDrag || isPeerDrag || !column.parentId),
5133
5296
  'is--drag-disabled': columnOpts.drag && isDisabledDrag,
5134
- 'col--current': currentColumn === column
5297
+ 'col--current': currColFlag && currentCol === column
5135
5298
  },
5136
5299
  headerClassName ? (XEUtils.isFunction(headerClassName) ? headerClassName(cellParams) : headerClassName) : '',
5137
5300
  headerCellClassName ? (XEUtils.isFunction(headerCellClassName) ? headerCellClassName(cellParams) : headerCellClassName) : ''
@@ -5169,8 +5332,8 @@ var TableHeaderComponent = defineVxeComponent({
5169
5332
  const $xeGantt = $xeTable.xeGantt;
5170
5333
  const { fixedType } = props;
5171
5334
  const { showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign } = tableProps;
5172
- const { currentColumn, overflowX } = tableReactData;
5173
- const { fullColumnIdData } = tableInternalData;
5335
+ const { overflowX, currColFlag } = tableReactData;
5336
+ const { fullColumnIdData, currentCol } = tableInternalData;
5174
5337
  const headerTooltipOpts = computeHeaderTooltipOpts.value;
5175
5338
  const cellOpts = computeCellOpts.value;
5176
5339
  const defaultRowHeight = computeDefaultRowHeight.value;
@@ -5239,7 +5402,7 @@ var TableHeaderComponent = defineVxeComponent({
5239
5402
  'fixed--width': !isAutoCellWidth,
5240
5403
  'is--padding': isPadding,
5241
5404
  'is--sortable': column.sortable,
5242
- 'col--current': currentColumn === column
5405
+ 'col--current': currColFlag && currentCol === column
5243
5406
  }
5244
5407
  ], key: colid }, thAttrs), [
5245
5408
  h('div', {
@@ -5490,8 +5653,8 @@ var TableFooterComponent = defineVxeComponent({
5490
5653
  const $xeGantt = $xeTable.xeGantt;
5491
5654
  const { fixedType } = props;
5492
5655
  const { resizable: allResizable, border, footerCellClassName, footerCellStyle, footerAlign: allFooterAlign, footerSpanMethod, align: allAlign, columnKey, showFooterOverflow: allColumnFooterOverflow } = tableProps;
5493
- const { scrollXLoad, scrollYLoad, overflowX, currentColumn, mergeFootFlag } = tableReactData;
5494
- const { fullColumnIdData, mergeFooterList, mergeFooterCellMaps, scrollXStore } = tableInternalData;
5656
+ const { scrollXLoad, scrollYLoad, overflowX, mergeFootFlag, currColFlag } = tableReactData;
5657
+ const { fullColumnIdData, mergeFooterList, mergeFooterCellMaps, scrollXStore, currentCol } = tableInternalData;
5495
5658
  const virtualXOpts = computeVirtualXOpts.value;
5496
5659
  const footerTooltipOpts = computeFooterTooltipOpts.value;
5497
5660
  const resizableOpts = computeResizableOpts.value;
@@ -5627,7 +5790,7 @@ var TableFooterComponent = defineVxeComponent({
5627
5790
  'is--pg-left': isCellPaddingLeft,
5628
5791
  'is--pg-right': isCellPaddingRight,
5629
5792
  'col--ellipsis': hasEllipsis,
5630
- 'col--current': currentColumn === column
5793
+ 'col--current': currColFlag && currentCol === column
5631
5794
  }, getPropClass(footerClassName, cellParams), getPropClass(footerCellClassName, cellParams)] }, attrs), { style: footerCellStyle ? (XEUtils.isFunction(footerCellStyle) ? footerCellStyle(cellParams) : footerCellStyle) : null }), tfOns), { key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag ? column.id : $columnIndex }), [
5632
5795
  h('div', {
5633
5796
  class: ['vxe-cell', {
@@ -8686,15 +8849,12 @@ hooks$7.add('tableFilterModule', {
8686
8849
  const { filterStore } = reactData;
8687
8850
  const { elemStore } = internalData;
8688
8851
  const { column, targetEl } = filterStore;
8689
- if (!column || !targetEl) {
8852
+ if (!column) {
8690
8853
  return nextTick();
8691
8854
  }
8692
8855
  const tableEl = refElem.value;
8693
- const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode();
8694
8856
  const filterOpts = computeFilterOpts.value;
8695
8857
  const { maxHeight: customMaxHeight, transfer, zIndex } = filterOpts;
8696
- const currEl = targetEl;
8697
- const tableRect = tableEl.getBoundingClientRect();
8698
8858
  const filterRender = column ? column.filterRender : null;
8699
8859
  const compConf = filterRender && isEnableConf(filterRender) ? renderer$5.get(filterRender.name) : null;
8700
8860
  const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
@@ -8706,67 +8866,82 @@ hooks$7.add('tableFilterModule', {
8706
8866
  if (!filterWrapperElem) {
8707
8867
  return nextTick();
8708
8868
  }
8709
- const btnRect = currEl.getBoundingClientRect();
8710
8869
  const filterHeadElem = filterWrapperElem.querySelector('.vxe-table--filter-header');
8711
8870
  const filterFootElem = filterWrapperElem.querySelector('.vxe-table--filter-footer');
8712
- const filterWidth = filterWrapperElem.offsetWidth;
8713
- const centerWidth = currEl ? filterWidth / 2 : ((filterWidth - column.renderWidth) / 2);
8714
- let left = 0;
8715
- let top = 0;
8716
- let maxHeight = 0;
8717
8871
  /**
8718
8872
  * 是否显示筛选按钮图标
8719
8873
  * 如果不存在图标,则相对单元格居中显示
8720
8874
  */
8721
- if (transfer) {
8722
- left = btnRect.left - centerWidth + scrollLeft;
8723
- top = btnRect.top + currEl.clientHeight + scrollTop;
8724
- maxHeight = Math.min(Math.max(tableRect.height, Math.floor(visibleHeight / 2)), Math.max(80, visibleHeight - top - (filterHeadElem ? filterHeadElem.clientHeight : 0) - (filterFootElem ? filterFootElem.clientHeight : 0) - 28));
8725
- if (left < 16) {
8726
- left = 16;
8875
+ const handleStyle = () => {
8876
+ let currEl = targetEl;
8877
+ if (!targetEl) {
8878
+ const headerWrapperElem = getRefElem(elemStore[`${column.fixed || 'main'}-header-wrapper`] || elemStore['main-header-wrapper']);
8879
+ const colEl = headerWrapperElem ? headerWrapperElem.querySelector(`.vxe-header--column.${column.id}`) : null;
8880
+ if (colEl) {
8881
+ currEl = colEl;
8882
+ }
8727
8883
  }
8728
- else if (left > (visibleWidth - filterWidth - 16)) {
8729
- left = visibleWidth - filterWidth - 16;
8884
+ if (!currEl) {
8885
+ return nextTick();
8730
8886
  }
8731
- }
8732
- else {
8733
- left = btnRect.left - tableRect.left - centerWidth;
8734
- top = btnRect.top - tableRect.top + currEl.clientHeight;
8735
- maxHeight = Math.max(40, tableEl.clientHeight - top - (filterHeadElem ? filterHeadElem.clientHeight : 0) - (filterFootElem ? filterFootElem.clientHeight : 0) - 14);
8736
- if (left < 1) {
8737
- left = 1;
8887
+ const btnRect = currEl.getBoundingClientRect();
8888
+ const tableRect = tableEl.getBoundingClientRect();
8889
+ let left = 0;
8890
+ let top = 0;
8891
+ let maxHeight = 0;
8892
+ let panelStyle = {};
8893
+ if (transfer) {
8894
+ const ppObj = updatePanelPlacement(currEl, filterWrapperElem, {
8895
+ defaultPlacement: 'bottom',
8896
+ isMinWidth: false,
8897
+ teleportTo: transfer
8898
+ });
8899
+ panelStyle = ppObj.style;
8738
8900
  }
8739
- else if (left > (tableEl.clientWidth - filterWidth - 1)) {
8740
- left = tableEl.clientWidth - filterWidth - 1;
8901
+ else {
8902
+ const filterWidth = filterWrapperElem.offsetWidth;
8903
+ const centerWidth = targetEl ? filterWidth / 2 : ((filterWidth - column.renderWidth) / 2);
8904
+ left = btnRect.left - tableRect.left - centerWidth;
8905
+ top = btnRect.top - tableRect.top + currEl.clientHeight;
8906
+ maxHeight = Math.max(40, tableEl.clientHeight - top - (filterHeadElem ? filterHeadElem.clientHeight : 0) - (filterFootElem ? filterFootElem.clientHeight : 0) - 14);
8907
+ if (left < 1) {
8908
+ left = 1;
8909
+ }
8910
+ else if (left > (tableEl.clientWidth - filterWidth - 1)) {
8911
+ left = tableEl.clientWidth - filterWidth - 1;
8912
+ }
8913
+ if ($xeGGWrapper) {
8914
+ const wrapperEl = $xeGGWrapper.getRefMaps().refElem.value;
8915
+ if (wrapperEl) {
8916
+ const wrapperRect = wrapperEl.getBoundingClientRect();
8917
+ top += tableRect.top - wrapperRect.top;
8918
+ }
8919
+ }
8920
+ panelStyle = {
8921
+ top: toCssUnit(top),
8922
+ left: toCssUnit(left)
8923
+ };
8741
8924
  }
8742
- if ($xeGGWrapper) {
8743
- const wrapperEl = $xeGGWrapper.getRefMaps().refElem.value;
8744
- if (wrapperEl) {
8745
- const wrapperRect = wrapperEl.getBoundingClientRect();
8746
- top += tableRect.top - wrapperRect.top;
8925
+ if (zIndex) {
8926
+ panelStyle.zIndex = zIndex;
8927
+ }
8928
+ filterStore.style = panelStyle;
8929
+ // 筛选面板是自适应表格高度
8930
+ if (compConf ? !compConf.tableFilterAutoHeight : false) {
8931
+ maxHeight = 0;
8932
+ }
8933
+ else {
8934
+ if (customMaxHeight) {
8935
+ maxHeight = customMaxHeight > maxHeight ? maxHeight : customMaxHeight;
8747
8936
  }
8748
8937
  }
8749
- }
8750
- const fStys = {
8751
- top: toCssUnit(top),
8752
- left: toCssUnit(left)
8938
+ // 判断面板不能大于表格高度
8939
+ filterStore.maxHeight = maxHeight;
8753
8940
  };
8754
- if (zIndex) {
8755
- fStys.zIndex = zIndex;
8756
- }
8757
- filterStore.style = fStys;
8758
- // 筛选面板是自适应表格高度
8759
- if (compConf ? !compConf.tableFilterAutoHeight : false) {
8760
- maxHeight = 0;
8761
- }
8762
- else {
8763
- if (customMaxHeight) {
8764
- maxHeight = customMaxHeight > maxHeight ? maxHeight : customMaxHeight;
8765
- }
8766
- }
8767
- // 判断面板不能大于表格高度
8768
- filterStore.maxHeight = maxHeight;
8769
- return nextTick();
8941
+ handleStyle();
8942
+ return nextTick().then(() => {
8943
+ handleStyle();
8944
+ });
8770
8945
  };
8771
8946
  const filterPrivateMethods = {
8772
8947
  checkFilterOptions() {
@@ -8784,15 +8959,14 @@ hooks$7.add('tableFilterModule', {
8784
8959
  filterStore.visible = false;
8785
8960
  }
8786
8961
  else {
8787
- const currEl = btnEl || colEl;
8788
8962
  $xeTable.handleFilterOptions(column);
8789
8963
  internalData._currFilterParams = params;
8790
- filterStore.targetEl = currEl;
8964
+ filterStore.targetEl = btnEl;
8791
8965
  filterStore.style = null;
8792
8966
  filterStore.visible = true;
8793
8967
  initStore.filter = true;
8794
8968
  }
8795
- nextTick(() => {
8969
+ nextTick().then(() => {
8796
8970
  updatePopupStyle();
8797
8971
  });
8798
8972
  $xeTable.dispatchEvent('filter-visible', { column, field: column.field, property: column.field, filterList: $xeTable.getCheckedFilters(), visible: filterStore.visible }, evnt);
@@ -13002,11 +13176,10 @@ hooks$3.add('tableKeyboardModule', {
13002
13176
  },
13003
13177
  // 处理当前列方向键移动
13004
13178
  moveCurrentColumn(isLeftArrow, isRightArrow, evnt) {
13005
- const { currentColumn } = reactData;
13006
- const { visibleColumn } = internalData;
13179
+ const { currentCol, visibleColumn } = internalData;
13007
13180
  let targetCol = null;
13008
- if (currentColumn) {
13009
- const _columnIndex = $xeTable.getVTColumnIndex(currentColumn);
13181
+ if (currentCol) {
13182
+ const _columnIndex = $xeTable.getVTColumnIndex(currentCol);
13010
13183
  if (isLeftArrow && _columnIndex > 0) {
13011
13184
  targetCol = visibleColumn[_columnIndex - 1];
13012
13185
  }
@@ -15972,10 +16145,18 @@ var VxeTableComponent = defineVxeComponent({
15972
16145
  return Object.assign({}, getConfig$2().tooltip, getConfig$2().table.tooltipConfig, props.tooltipConfig);
15973
16146
  });
15974
16147
  const computeHeaderTooltipOpts = computed(() => {
15975
- return Object.assign({}, getConfig$2().tooltip, getConfig$2().table.headerTooltipConfig, props.headerTooltipConfig);
16148
+ const tooltipOpts = computeTooltipOpts.value;
16149
+ return Object.assign({}, getConfig$2().tooltip, {
16150
+ enterable: tooltipOpts.enterable,
16151
+ defaultPlacement: tooltipOpts.defaultPlacement
16152
+ }, getConfig$2().table.headerTooltipConfig, props.headerTooltipConfig);
15976
16153
  });
15977
16154
  const computeFooterTooltipOpts = computed(() => {
15978
- return Object.assign({}, getConfig$2().tooltip, getConfig$2().table.footerTooltipConfig, props.footerTooltipConfig);
16155
+ const tooltipOpts = computeTooltipOpts.value;
16156
+ return Object.assign({}, getConfig$2().tooltip, {
16157
+ enterable: tooltipOpts.enterable,
16158
+ defaultPlacement: tooltipOpts.defaultPlacement
16159
+ }, getConfig$2().table.footerTooltipConfig, props.footerTooltipConfig);
15979
16160
  });
15980
16161
  const computeTableTipConfig = computed(() => {
15981
16162
  const { tooltipStore } = reactData;
@@ -22402,7 +22583,7 @@ var VxeTableComponent = defineVxeComponent({
22402
22583
  },
22403
22584
  getCurrentColumn() {
22404
22585
  const columnOpts = computeColumnOpts.value;
22405
- return columnOpts.isCurrent || props.highlightCurrentColumn ? reactData.currentColumn : null;
22586
+ return columnOpts.isCurrent || props.highlightCurrentColumn ? internalData.currentCol : null;
22406
22587
  },
22407
22588
  /**
22408
22589
  * 用于当前列,设置某列行为高亮状态
@@ -22414,7 +22595,8 @@ var VxeTableComponent = defineVxeComponent({
22414
22595
  const column = handleFieldOrColumn($xeTable, fieldOrColumn);
22415
22596
  if (column) {
22416
22597
  $xeTable.clearCurrentColumn();
22417
- reactData.currentColumn = column;
22598
+ internalData.currentCol = column;
22599
+ reactData.currColFlag++; // 刷新当前列状态
22418
22600
  }
22419
22601
  return nextTick().then(() => {
22420
22602
  // 更新状选中态
@@ -22427,7 +22609,8 @@ var VxeTableComponent = defineVxeComponent({
22427
22609
  * 用于当前列,手动清空当前高亮的状态
22428
22610
  */
22429
22611
  clearCurrentColumn() {
22430
- reactData.currentColumn = null;
22612
+ internalData.currentCol = null;
22613
+ reactData.currColFlag++; // 刷新当前列状态
22431
22614
  return nextTick();
22432
22615
  },
22433
22616
  setPendingRow(rows, status) {
@@ -24060,8 +24243,7 @@ var VxeTableComponent = defineVxeComponent({
24060
24243
  };
24061
24244
  const handleGlobalScrollEvent = (evnt) => {
24062
24245
  const { filterStore } = reactData;
24063
- const filterOpts = computeFilterOpts.value;
24064
- if (filterStore.visible && filterOpts.transfer) {
24246
+ if (filterStore.visible) {
24065
24247
  $xeTable.handleFilterStyle();
24066
24248
  }
24067
24249
  reUpdateCustomStyleEvent(evnt);
@@ -24501,7 +24683,7 @@ var VxeTableComponent = defineVxeComponent({
24501
24683
  .then(() => $xeTable.triggerCurrentRowEvent(evnt, params));
24502
24684
  }
24503
24685
  }
24504
- else if (keyboardConfig && keyboardOpts.isUndoRedo && isControlKey && (isZ || isY) && !hasEventInputTarget(evnt.target)) {
24686
+ else if (keyboardConfig && keyboardOpts.isUndoRedo && isControlKey && (isZ || isY) && !hasAxternalInputTarget(evnt.target)) {
24505
24687
  if (evnt.target) {
24506
24688
  if (isY || (hasShiftKey && isZ)) {
24507
24689
  // 恢复被撤销的操作:Ctrl + Y 或 Ctrl + Shift + Z
@@ -24607,6 +24789,10 @@ var VxeTableComponent = defineVxeComponent({
24607
24789
  }
24608
24790
  };
24609
24791
  const handleGlobalResizeEvent = () => {
24792
+ const { filterStore } = reactData;
24793
+ if (filterStore.visible) {
24794
+ $xeTable.handleFilterStyle();
24795
+ }
24610
24796
  if ($xeTable.closeMenu) {
24611
24797
  $xeTable.closeMenu();
24612
24798
  }
@@ -26797,7 +26983,7 @@ var VxeTableComponent = defineVxeComponent({
26797
26983
  }
26798
26984
  },
26799
26985
  triggerCurrentColumnEvent(evnt, params) {
26800
- const { currentColumn: oldValue } = reactData;
26986
+ const { currentCol: oldValue } = internalData;
26801
26987
  const columnOpts = computeColumnOpts.value;
26802
26988
  const currentColumnOpts = computeCurrentColumnOpts.value;
26803
26989
  const beforeRowMethod = currentColumnOpts.beforeSelectMethod || columnOpts.currentMethod;
@@ -28993,9 +29179,9 @@ var VxeTableComponent = defineVxeComponent({
28993
29179
  },
28994
29180
  setHoverRow(row) {
28995
29181
  const $xeGanttView = internalData.xeGanttView;
29182
+ $xeTable.clearHoverRow();
28996
29183
  const rowid = getRowid($xeTable, row);
28997
29184
  const el = refElem.value;
28998
- $xeTable.clearHoverRow();
28999
29185
  if (el) {
29000
29186
  XEUtils.arrayEach(el.querySelectorAll(`.vxe-body--row[rowid="${rowid}"]`), elem => addClass(elem, 'row--hover'));
29001
29187
  }