vxe-table 4.18.10 → 4.18.12

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 (62) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/table/module/custom/hook.js +69 -6
  6. package/es/table/module/custom/panel.js +19 -14
  7. package/es/table/module/keyboard/hook.js +1 -2
  8. package/es/table/src/body.js +3 -2
  9. package/es/table/src/header.js +3 -1
  10. package/es/table/src/table.js +85 -40
  11. package/es/table/src/util.js +7 -3
  12. package/es/table/style.css +14 -0
  13. package/es/table/style.min.css +1 -1
  14. package/es/ui/index.js +1 -1
  15. package/es/ui/src/log.js +1 -1
  16. package/es/vxe-table/style.css +14 -0
  17. package/es/vxe-table/style.min.css +1 -1
  18. package/helper/vetur/attributes.json +1 -1
  19. package/helper/vetur/tags.json +1 -1
  20. package/lib/index.css +1 -1
  21. package/lib/index.min.css +1 -1
  22. package/lib/index.umd.js +141 -59
  23. package/lib/index.umd.min.js +1 -1
  24. package/lib/style.css +1 -1
  25. package/lib/style.min.css +1 -1
  26. package/lib/table/module/custom/hook.js +76 -6
  27. package/lib/table/module/custom/hook.min.js +1 -1
  28. package/lib/table/module/custom/panel.js +21 -13
  29. package/lib/table/module/custom/panel.min.js +1 -1
  30. package/lib/table/module/keyboard/hook.js +1 -3
  31. package/lib/table/module/keyboard/hook.min.js +1 -1
  32. package/lib/table/src/body.js +4 -2
  33. package/lib/table/src/body.min.js +1 -1
  34. package/lib/table/src/header.js +7 -5
  35. package/lib/table/src/header.min.js +1 -1
  36. package/lib/table/src/table.js +23 -25
  37. package/lib/table/src/table.min.js +1 -1
  38. package/lib/table/src/util.js +7 -3
  39. package/lib/table/src/util.min.js +1 -1
  40. package/lib/table/style/style.css +14 -0
  41. package/lib/table/style/style.min.css +1 -1
  42. package/lib/ui/index.js +1 -1
  43. package/lib/ui/index.min.js +1 -1
  44. package/lib/ui/src/log.js +1 -1
  45. package/lib/ui/src/log.min.js +1 -1
  46. package/lib/vxe-table/style/style.css +14 -0
  47. package/lib/vxe-table/style/style.min.css +1 -1
  48. package/package.json +1 -1
  49. package/packages/table/module/custom/hook.ts +70 -7
  50. package/packages/table/module/custom/panel.ts +20 -15
  51. package/packages/table/module/keyboard/hook.ts +1 -2
  52. package/packages/table/src/body.ts +3 -2
  53. package/packages/table/src/header.ts +3 -1
  54. package/packages/table/src/table.ts +88 -41
  55. package/packages/table/src/util.ts +9 -3
  56. package/styles/components/table-module/custom.scss +14 -0
  57. /package/es/{iconfont.1774663263220.ttf → iconfont.1776048383631.ttf} +0 -0
  58. /package/es/{iconfont.1774663263220.woff → iconfont.1776048383631.woff} +0 -0
  59. /package/es/{iconfont.1774663263220.woff2 → iconfont.1776048383631.woff2} +0 -0
  60. /package/lib/{iconfont.1774663263220.ttf → iconfont.1776048383631.ttf} +0 -0
  61. /package/lib/{iconfont.1774663263220.woff → iconfont.1776048383631.woff} +0 -0
  62. /package/lib/{iconfont.1774663263220.woff2 → iconfont.1776048383631.woff2} +0 -0
@@ -2,6 +2,7 @@ import { nextTick } from 'vue';
2
2
  import { VxeUI } from '../../../ui';
3
3
  import XEUtils from 'xe-utils';
4
4
  import { getColumnList } from '../../src/util';
5
+ import { toCssUnit } from '../../../ui/src/dom';
5
6
  const tableCustomMethodKeys = ['openCustom', 'closeCustom', 'getCustomVisible', 'toggleCustom', 'saveCustom', 'cancelCustom', 'resetCustom', 'toggleCustomAllCheckbox', 'setCustomAllCheckbox'];
6
7
  VxeUI.hooks.add('tableCustomModule', {
7
8
  setupTable($xeTable) {
@@ -14,13 +15,16 @@ VxeUI.hooks.add('tableCustomModule', {
14
15
  const updatePopupStyle = () => {
15
16
  const { customStore } = reactData;
16
17
  const customOpts = computeCustomOpts.value;
18
+ const { mode, placement, popupOptions } = customOpts;
19
+ const showSimple = !(mode === 'modal' || mode === 'drawer');
20
+ const { transfer, maxHeight } = popupOptions || {};
17
21
  const customSimpleMode = computeCustomSimpleMode.value;
18
22
  const showCustomSimpleOutside = customSimpleMode === 'outside';
19
- const { popupOptions } = customOpts;
20
- const { maxHeight } = popupOptions || {};
23
+ const bodyEl = document.documentElement;
21
24
  let wrapperEl = refElem.value;
22
25
  let popupTop = 0;
23
26
  let popupMaxHeight = 0;
27
+ const popupStys = {};
24
28
  if ($xeGantt) {
25
29
  const { refGanttContainerElem } = $xeGantt.getRefMaps();
26
30
  const ganttContainerElem = refGanttContainerElem.value;
@@ -28,7 +32,13 @@ VxeUI.hooks.add('tableCustomModule', {
28
32
  wrapperEl = ganttContainerElem;
29
33
  }
30
34
  }
31
- if (showCustomSimpleOutside) {
35
+ const tableRect = wrapperEl.getBoundingClientRect();
36
+ // 多种模式,指定元素插入
37
+ if (showSimple && transfer) {
38
+ popupTop = tableRect.top + bodyEl.scrollTop;
39
+ popupMaxHeight = XEUtils.eqNull(maxHeight) ? 360 : maxHeight;
40
+ }
41
+ else if (showCustomSimpleOutside) {
32
42
  if ($xeGGWrapper && wrapperEl) {
33
43
  popupTop = wrapperEl.offsetTop;
34
44
  }
@@ -41,11 +51,59 @@ VxeUI.hooks.add('tableCustomModule', {
41
51
  }
42
52
  popupMaxHeight = Math.max(88, popupMaxHeight);
43
53
  }
44
- customStore.popupTop = popupTop;
45
- customStore.maxHeight = XEUtils.eqNull(maxHeight) ? popupMaxHeight : maxHeight;
54
+ let popupMxHeight = 0;
55
+ if (!(placement === 'left' || placement === 'right')) {
56
+ popupMxHeight = XEUtils.eqNull(maxHeight) ? popupMaxHeight : maxHeight;
57
+ }
58
+ if (!placement || !(['left', 'right', 'bottom-left', 'bottom-right'].includes(placement))) {
59
+ if (popupTop) {
60
+ popupStys.top = toCssUnit(popupTop);
61
+ }
62
+ }
63
+ if (showSimple && transfer) {
64
+ if (placement === 'bottom-left' || placement === 'bottom-right') {
65
+ popupStys.bottom = toCssUnit(bodyEl.scrollHeight - tableRect.top - tableRect.height + 1);
66
+ }
67
+ if (placement === 'top-left' || placement === 'bottom-left') {
68
+ popupStys.left = toCssUnit(tableRect.left);
69
+ }
70
+ else if (!placement || placement === 'top-right' || placement === 'bottom-right') {
71
+ popupStys.right = toCssUnit(bodyEl.scrollWidth - tableRect.left - tableRect.width + 1);
72
+ }
73
+ }
74
+ if (popupMxHeight) {
75
+ popupStys.maxHeight = toCssUnit(popupMxHeight);
76
+ }
77
+ customStore.popupStyle = popupStys;
78
+ customStore.maxHeight = popupMxHeight;
79
+ return nextTick();
46
80
  };
47
81
  const openCustom = () => {
48
82
  const { initStore, customStore } = reactData;
83
+ const customOpts = computeCustomOpts.value;
84
+ const { mode, popupOptions } = customOpts;
85
+ const showSimple = !(mode === 'modal' || mode === 'drawer');
86
+ const { transfer } = popupOptions || {};
87
+ const customSimpleMode = computeCustomSimpleMode.value;
88
+ const showCustomSimpleOutside = customSimpleMode === 'outside';
89
+ let cpToElem = null;
90
+ // 多种模式,指定元素插入
91
+ if (showSimple && transfer) {
92
+ cpToElem = document.body;
93
+ }
94
+ else {
95
+ if (showCustomSimpleOutside && $xeGGWrapper) {
96
+ const { refPopupContainerElem } = $xeGGWrapper.getRefMaps();
97
+ const popupContainerElem = refPopupContainerElem.value;
98
+ if (popupContainerElem) {
99
+ cpToElem = popupContainerElem;
100
+ }
101
+ }
102
+ }
103
+ if (internalData.customPopupToElem !== cpToElem) {
104
+ reactData.ctPopupFlag++;
105
+ }
106
+ internalData.customPopupToElem = cpToElem;
49
107
  customStore.visible = true;
50
108
  initStore.custom = true;
51
109
  handleUpdateCustomColumn();
@@ -333,7 +391,12 @@ VxeUI.hooks.add('tableCustomModule', {
333
391
  $xeTable.emitCustomEvent('close', evnt);
334
392
  }
335
393
  },
336
- handleUpdateCustomColumn
394
+ handleUpdateCustomColumn,
395
+ handleCustomStyle() {
396
+ const reactData = $xeTable.reactData;
397
+ reactData.isCustomDragStatus = false;
398
+ return updatePopupStyle();
399
+ }
337
400
  };
338
401
  return Object.assign(Object.assign({}, customMethods), customPrivateMethods);
339
402
  },
@@ -2,7 +2,7 @@ import { h, inject, ref, provide, nextTick, TransitionGroup, reactive, onUnmount
2
2
  import { defineVxeComponent } from '../../../ui/src/comp';
3
3
  import { VxeUI } from '../../../ui';
4
4
  import { formatText } from '../../../ui/src/utils';
5
- import { getTpImg, addClass, removeClass, hasControlKey, toCssUnit } from '../../../ui/src/dom';
5
+ import { getTpImg, addClass, removeClass, hasControlKey } from '../../../ui/src/dom';
6
6
  import { errLog } from '../../../ui/src/log';
7
7
  import XEUtils from 'xe-utils';
8
8
  const { getI18n, getIcon, renderEmptyElement } = VxeUI;
@@ -13,7 +13,8 @@ export function createInternalData() {
13
13
  // prevDragGroupField: undefined,
14
14
  // prevDragAggFnColid: undefined,
15
15
  // prevDragToChild: false,
16
- // prevDragPos: null
16
+ // prevDragPos: null,
17
+ // customDragTime: null
17
18
  };
18
19
  }
19
20
  export default defineVxeComponent({
@@ -33,7 +34,7 @@ export default defineVxeComponent({
33
34
  const VxeUIRadioGroupComponent = VxeUI.getComponent('VxeRadioGroup');
34
35
  const $xeTable = inject('$xeTable', {});
35
36
  const { props: tableProps, reactData: tableReactData, internalData: tableInternalData } = $xeTable;
36
- const { computeCustomOpts, computeColumnDragOpts, computeColumnOpts, computeIsMaxFixedColumn, computeResizableOpts } = $xeTable.getComputeMaps();
37
+ const { computeSize, computeCustomOpts, computeColumnDragOpts, computeColumnOpts, computeIsMaxFixedColumn, computeResizableOpts } = $xeTable.getComputeMaps();
37
38
  const refElem = ref();
38
39
  const refBodyWrapperElem = ref();
39
40
  const refCustomBodyElem = ref();
@@ -302,9 +303,14 @@ export default defineVxeComponent({
302
303
  removeClass(trEl, 'active--drag-origin');
303
304
  };
304
305
  const sortDragstartEvent = (evnt) => {
306
+ const { customDragTime } = customPanelInternalData;
305
307
  if (evnt.dataTransfer) {
306
308
  evnt.dataTransfer.setDragImage(getTpImg(), 0, 0);
307
309
  }
310
+ if (customDragTime) {
311
+ clearTimeout(customDragTime);
312
+ }
313
+ tableReactData.isCustomDragStatus = true;
308
314
  customPanelInternalData.prevDragGroupField = null;
309
315
  customPanelInternalData.prevDragAggFnColid = null;
310
316
  };
@@ -474,6 +480,10 @@ export default defineVxeComponent({
474
480
  tableReactData.customColumnList = collectColumn.slice(0);
475
481
  $xeTable.handleColDragSwapColumn();
476
482
  }
483
+ customPanelInternalData.customDragTime = setTimeout(() => {
484
+ tableReactData.isCustomDragStatus = false;
485
+ customPanelInternalData.customDragTime = undefined;
486
+ }, 350);
477
487
  }).catch(() => {
478
488
  });
479
489
  }
@@ -568,13 +578,14 @@ export default defineVxeComponent({
568
578
  const tableProps = $xeTable.props;
569
579
  const { customStore } = props;
570
580
  const { treeConfig, rowGroupConfig, aggregateConfig } = tableProps;
571
- const { isCustomStatus, customColumnList } = tableReactData;
581
+ const { isCustomStatus, customColumnList, isCustomDragStatus } = tableReactData;
572
582
  const customOpts = computeCustomOpts.value;
573
583
  const { immediate } = customOpts;
574
584
  const columnDragOpts = computeColumnDragOpts.value;
575
- const { maxHeight, popupTop } = customStore;
585
+ const { popupStyle } = customStore;
576
586
  const { checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, trigger, placement } = customOpts;
577
587
  const isMaxFixedColumn = computeIsMaxFixedColumn.value;
588
+ const vSize = computeSize.value;
578
589
  const { isCrossDrag } = columnDragOpts;
579
590
  const slots = customOpts.slots || {};
580
591
  const headerSlot = slots.header;
@@ -704,20 +715,14 @@ export default defineVxeComponent({
704
715
  ]));
705
716
  }
706
717
  });
707
- const popupStys = {};
708
- if (maxHeight && !['left', 'right'].includes(placement || '')) {
709
- if (popupTop) {
710
- popupStys.top = toCssUnit(popupTop);
711
- }
712
- popupStys.maxHeight = toCssUnit(maxHeight);
713
- }
714
718
  return h('div', {
715
719
  ref: refElem,
716
720
  key: 'simple',
717
721
  class: ['vxe-table-custom-wrapper', `placement--${placement}`, {
722
+ [`size--${vSize}`]: vSize,
718
723
  'is--active': customStore.visible
719
724
  }],
720
- style: popupStys
725
+ style: popupStyle
721
726
  }, customStore.visible
722
727
  ? [
723
728
  h('div', {
@@ -778,7 +783,7 @@ export default defineVxeComponent({
778
783
  ? h('div', {
779
784
  class: 'vxe-table-custom--panel-body'
780
785
  }, $xeTable.callSlot(defaultSlot, params))
781
- : h(TransitionGroup, Object.assign({ class: 'vxe-table-custom--panel-list', name: 'vxe-table-custom--list', tag: 'ul' }, customWrapperOns), {
786
+ : h(TransitionGroup, Object.assign({ class: 'vxe-table-custom--panel-list', name: isCustomDragStatus ? 'vxe-table-custom--list' : '', tag: 'ul' }, customWrapperOns), {
782
787
  default: () => colVNs
783
788
  }),
784
789
  bottomSlot
@@ -392,8 +392,7 @@ hooks.add('tableKeyboardModule', {
392
392
  // 处理当前行方向键移动
393
393
  moveCurrentRow(isUpArrow, isDwArrow, evnt) {
394
394
  const { treeConfig } = props;
395
- const { currentRow } = reactData;
396
- const { afterFullData } = internalData;
395
+ const { afterFullData, currentRow } = internalData;
397
396
  const treeOpts = computeTreeOpts.value;
398
397
  const childrenField = treeOpts.children || treeOpts.childrenField;
399
398
  let targetRow;
@@ -441,7 +441,7 @@ export default defineVxeComponent({
441
441
  const $xeGantt = $xeTable.xeGantt;
442
442
  const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps;
443
443
  const { hasFixedColumn, treeExpandedFlag, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, rowExpandHeightFlag, isRowGroupStatus } = tableReactData;
444
- const { fullAllDataRowIdData, fullColumnIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps } = tableInternalData;
444
+ const { fullAllDataRowIdData, fullColumnIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps, currentRow } = tableInternalData;
445
445
  const checkboxOpts = computeCheckboxOpts.value;
446
446
  const radioOpts = computeRadioOpts.value;
447
447
  const treeOpts = computeTreeOpts.value;
@@ -532,7 +532,8 @@ export default defineVxeComponent({
532
532
  'row--radio': radioOpts.highlight && $xeTable.eqRow(selectRadioRow, row),
533
533
  'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
534
534
  'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid],
535
- 'row--group': hasRowGroupAggregate
535
+ 'row--group': hasRowGroupAggregate,
536
+ 'row--current': currentRow && rowid === getRowid($xeTable, currentRow)
536
537
  },
537
538
  getPropClass(rowClassName, params)
538
539
  ];
@@ -44,7 +44,9 @@ export default defineVxeComponent({
44
44
  spanColumns = visibleColgroups;
45
45
  }
46
46
  headerColumn.value = spanColumns;
47
- $xeTable.dispatchEvent('columns-change', { visibleColgroups, collectColumn, visibleColumn }, null);
47
+ nextTick(() => {
48
+ $xeTable.dispatchEvent('columns-change', { visibleColgroups, collectColumn, visibleColumn }, null);
49
+ });
48
50
  };
49
51
  const renderRows = (isGroup, isOptimizeMode, headerGroups, $rowIndex, cols) => {
50
52
  const $xeGrid = $xeTable.xeGrid;
@@ -77,6 +77,7 @@ export default defineVxeComponent({
77
77
  const refTableRightFooter = ref();
78
78
  const refTeleportWrapper = ref();
79
79
  const refPopupWrapperElem = ref();
80
+ const refCustomContainerElem = ref();
80
81
  const refLeftContainer = ref();
81
82
  const refRightContainer = ref();
82
83
  const refColResizeBar = ref();
@@ -682,6 +683,7 @@ export default defineVxeComponent({
682
683
  refRightContainer,
683
684
  refColResizeBar,
684
685
  refRowResizeBar,
686
+ refCustomContainerElem,
685
687
  refScrollXVirtualElem,
686
688
  refScrollYVirtualElem,
687
689
  refScrollXHandleElem,
@@ -1954,10 +1956,13 @@ export default defineVxeComponent({
1954
1956
  const { treeConfig } = props;
1955
1957
  const { tableData, isAllOverflow, scrollYLoad, scrollXLoad } = reactData;
1956
1958
  const { fullAllDataRowIdData } = internalData;
1959
+ const el = refElem.value;
1960
+ if (!el || !el.clientWidth) {
1961
+ return;
1962
+ }
1957
1963
  const treeOpts = computeTreeOpts.value;
1958
1964
  const defaultRowHeight = computeDefaultRowHeight.value;
1959
- const el = refElem.value;
1960
- if (el && !isAllOverflow && (scrollYLoad || scrollXLoad || (treeConfig && treeOpts.showLine))) {
1965
+ if (!isAllOverflow && (scrollYLoad || scrollXLoad || (treeConfig && treeOpts.showLine))) {
1961
1966
  const { handleGetRowId } = createHandleGetRowId($xeTable);
1962
1967
  el.setAttribute('data-calc-row', 'Y');
1963
1968
  tableData.forEach(row => {
@@ -2354,8 +2359,8 @@ export default defineVxeComponent({
2354
2359
  };
2355
2360
  const updateStyle = () => {
2356
2361
  const { mouseConfig } = props;
2357
- const { isGroup, currentRow, tableColumn, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isColLoading } = reactData;
2358
- const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData;
2362
+ const { isGroup, tableColumn, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isColLoading } = reactData;
2363
+ const { visibleColumn, tableHeight, elemStore, currentRow, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData;
2359
2364
  const $xeGanttView = internalData.xeGanttView;
2360
2365
  const el = refElem.value;
2361
2366
  if (!el || (internalData.tBodyHeight && !el.clientHeight)) {
@@ -2943,8 +2948,8 @@ export default defineVxeComponent({
2943
2948
  // 还原展开、选中等相关状态
2944
2949
  const handleReserveStatus = () => {
2945
2950
  const { treeConfig } = props;
2946
- const { expandColumn, currentRow, selectRadioRow } = reactData;
2947
- const { fullDataRowIdData, fullAllDataRowIdData, radioReserveRow, selectCheckboxMaps, treeExpandedMaps, rowExpandedMaps } = internalData;
2951
+ const { expandColumn, selectRadioRow } = reactData;
2952
+ const { fullDataRowIdData, fullAllDataRowIdData, radioReserveRow, selectCheckboxMaps, treeExpandedMaps, rowExpandedMaps, currentRow } = internalData;
2948
2953
  const expandOpts = computeExpandOpts.value;
2949
2954
  const treeOpts = computeTreeOpts.value;
2950
2955
  const radioOpts = computeRadioOpts.value;
@@ -2968,7 +2973,7 @@ export default defineVxeComponent({
2968
2973
  handleCheckedCheckboxRow(handleReserveRow(internalData.checkboxReserveRowMap), true, true);
2969
2974
  }
2970
2975
  if (currentRow && !fullAllDataRowIdData[getRowid($xeTable, currentRow)]) {
2971
- reactData.currentRow = null; // 刷新当前行状态
2976
+ internalData.currentRow = null; // 刷新当前行状态
2972
2977
  }
2973
2978
  // 行展开
2974
2979
  internalData.rowExpandedMaps = expandColumn ? getRecoverRowMaps(rowExpandedMaps) : {}; // 刷新行展开状态
@@ -3199,6 +3204,10 @@ export default defineVxeComponent({
3199
3204
  const { scrollXWidth, scrollYHeight } = reactData;
3200
3205
  const { elemStore } = internalData;
3201
3206
  const scrollbarOpts = computeScrollbarOpts.value;
3207
+ const el = refElem.value;
3208
+ if (!el || !el.clientWidth) {
3209
+ return;
3210
+ }
3202
3211
  const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper']);
3203
3212
  const headerTableElem = getRefElem(elemStore['main-header-table']);
3204
3213
  const footerTableElem = getRefElem(elemStore['main-footer-table']);
@@ -3282,6 +3291,7 @@ export default defineVxeComponent({
3282
3291
  const handleLazyRecalculate = (reFull, reWidth, reHeight) => {
3283
3292
  return new Promise(resolve => {
3284
3293
  const $xeGanttView = internalData.xeGanttView;
3294
+ const { customStore } = reactData;
3285
3295
  const { rceTimeout, rceRunTime } = internalData;
3286
3296
  const resizeOpts = computeResizeOpts.value;
3287
3297
  const refreshDelay = resizeOpts.refreshDelay || 20;
@@ -3290,6 +3300,9 @@ export default defineVxeComponent({
3290
3300
  autoCellWidth();
3291
3301
  updateRowExpandStyle();
3292
3302
  }
3303
+ if (customStore.visible && $xeTable.handleCustomStyle) {
3304
+ $xeTable.handleCustomStyle();
3305
+ }
3293
3306
  if (rceTimeout) {
3294
3307
  clearTimeout(rceTimeout);
3295
3308
  if (rceRunTime && rceRunTime + (refreshDelay - 5) < Date.now()) {
@@ -4440,6 +4453,10 @@ export default defineVxeComponent({
4440
4453
  };
4441
4454
  const updateColumnOffsetLeft = () => {
4442
4455
  const { visibleColumn, fullColumnIdData } = internalData;
4456
+ const el = refElem.value;
4457
+ if (!el || !el.clientWidth) {
4458
+ return;
4459
+ }
4443
4460
  let offsetLeft = 0;
4444
4461
  for (let cIndex = 0, rLen = visibleColumn.length; cIndex < rLen; cIndex++) {
4445
4462
  const column = visibleColumn[cIndex];
@@ -4454,6 +4471,10 @@ export default defineVxeComponent({
4454
4471
  const updateRowOffsetTop = () => {
4455
4472
  const { expandColumn } = reactData;
4456
4473
  const { afterFullData, fullAllDataRowIdData, rowExpandedMaps } = internalData;
4474
+ const el = refElem.value;
4475
+ if (!el || !el.clientWidth) {
4476
+ return;
4477
+ }
4457
4478
  const expandOpts = computeExpandOpts.value;
4458
4479
  const rowOpts = computeRowOpts.value;
4459
4480
  const cellOpts = computeCellOpts.value;
@@ -4477,6 +4498,10 @@ export default defineVxeComponent({
4477
4498
  */
4478
4499
  const updateRowExpandStyle = () => {
4479
4500
  const { expandColumn, scrollYLoad, scrollYTop, isScrollYBig } = reactData;
4501
+ const el = refElem.value;
4502
+ if (!el || !el.clientWidth) {
4503
+ return;
4504
+ }
4480
4505
  const expandOpts = computeExpandOpts.value;
4481
4506
  const rowOpts = computeRowOpts.value;
4482
4507
  const cellOpts = computeCellOpts.value;
@@ -4540,6 +4565,10 @@ export default defineVxeComponent({
4540
4565
  }
4541
4566
  const { tableData } = reactData;
4542
4567
  const { fullAllDataRowIdData, treeExpandedMaps } = internalData;
4568
+ const el = refElem.value;
4569
+ if (!el || !el.clientWidth) {
4570
+ return;
4571
+ }
4543
4572
  const cellOpts = computeCellOpts.value;
4544
4573
  const rowOpts = computeRowOpts.value;
4545
4574
  const defaultRowHeight = computeDefaultRowHeight.value;
@@ -6226,7 +6255,7 @@ export default defineVxeComponent({
6226
6255
  const el = refElem.value;
6227
6256
  $xeTable.clearCurrentRow();
6228
6257
  // $xeTable.clearCurrentColumn()
6229
- reactData.currentRow = row;
6258
+ internalData.currentRow = row;
6230
6259
  if (rowOpts.isCurrent || props.highlightCurrentRow) {
6231
6260
  if (el) {
6232
6261
  XEUtils.arrayEach(el.querySelectorAll(`[rowid="${getRowid($xeTable, row)}"]`), elem => addClass(elem, 'row--current'));
@@ -6276,7 +6305,7 @@ export default defineVxeComponent({
6276
6305
  clearCurrentRow() {
6277
6306
  const $xeGanttView = internalData.xeGanttView;
6278
6307
  const el = refElem.value;
6279
- reactData.currentRow = null;
6308
+ internalData.currentRow = null;
6280
6309
  internalData.hoverRow = null;
6281
6310
  if (el) {
6282
6311
  XEUtils.arrayEach(el.querySelectorAll('.row--current'), elem => removeClass(elem, 'row--current'));
@@ -6297,8 +6326,7 @@ export default defineVxeComponent({
6297
6326
  * 用于当前行,获取当前行的数据
6298
6327
  */
6299
6328
  getCurrentRecord(isFull) {
6300
- const { currentRow } = reactData;
6301
- const { fullDataRowIdData, afterFullRowMaps } = internalData;
6329
+ const { fullDataRowIdData, afterFullRowMaps, currentRow } = internalData;
6302
6330
  const rowOpts = computeRowOpts.value;
6303
6331
  if (rowOpts.isCurrent || props.highlightCurrentRow) {
6304
6332
  const rowid = getRowid($xeTable, currentRow);
@@ -7894,6 +7922,23 @@ export default defineVxeComponent({
7894
7922
  $xeTable.closeMenu();
7895
7923
  }
7896
7924
  };
7925
+ const reUpdateCustomStyleEvent = (evnt) => {
7926
+ const { customStore } = reactData;
7927
+ const customOpts = computeCustomOpts.value;
7928
+ const { popupOptions } = customOpts;
7929
+ const { transfer } = popupOptions || {};
7930
+ if (transfer && customStore.visible) {
7931
+ const tableCustom = refTableCustom.value;
7932
+ if (tableCustom && $xeTable.handleCustomStyle && !checkTargetElement(evnt.target, [tableCustom.getRefMaps().refElem.value], evnt.currentTarget)) {
7933
+ $xeTable.handleCustomStyle().then(() => {
7934
+ $xeTable.handleCustomStyle();
7935
+ });
7936
+ }
7937
+ }
7938
+ };
7939
+ const handleGlobalScrollEvent = (evnt) => {
7940
+ reUpdateCustomStyleEvent(evnt);
7941
+ };
7897
7942
  /**
7898
7943
  * 全局滚动事件
7899
7944
  */
@@ -7954,8 +7999,8 @@ export default defineVxeComponent({
7954
7999
  if (internalData.isActivated) {
7955
8000
  $xeTable.preventEvent(evnt, 'event.keydown', null, () => {
7956
8001
  const { mouseConfig, keyboardConfig, treeConfig, editConfig, highlightCurrentRow, highlightCurrentColumn } = props;
7957
- const { ctxMenuStore, editStore, currentRow } = reactData;
7958
- const { afterFullData, visibleColumn } = internalData;
8002
+ const { ctxMenuStore, editStore } = reactData;
8003
+ const { afterFullData, visibleColumn, currentRow } = internalData;
7959
8004
  const isContentMenu = computeIsContentMenu.value;
7960
8005
  const bodyMenu = computeBodyMenu.value;
7961
8006
  const keyboardOpts = computeKeyboardOpts.value;
@@ -10224,7 +10269,7 @@ export default defineVxeComponent({
10224
10269
  let newValue = row;
10225
10270
  let isChange = oldValue !== newValue;
10226
10271
  if (strict) {
10227
- handleCheckedRadioRow(newValue);
10272
+ handleCheckedRadioRow(newValue, false);
10228
10273
  }
10229
10274
  else {
10230
10275
  if (oldValue === newValue) {
@@ -10232,7 +10277,7 @@ export default defineVxeComponent({
10232
10277
  }
10233
10278
  isChange = oldValue !== newValue;
10234
10279
  if (isChange && newValue) {
10235
- handleCheckedRadioRow(newValue);
10280
+ handleCheckedRadioRow(newValue, false);
10236
10281
  }
10237
10282
  else {
10238
10283
  newValue = null;
@@ -10281,7 +10326,7 @@ export default defineVxeComponent({
10281
10326
  }
10282
10327
  },
10283
10328
  triggerCurrentRowEvent(evnt, params) {
10284
- const { currentRow: oldValue } = reactData;
10329
+ const { currentRow: oldValue } = internalData;
10285
10330
  const rowOpts = computeRowOpts.value;
10286
10331
  const currentRowOpts = computeCurrentRowOpts.value;
10287
10332
  const beforeRowMethod = currentRowOpts.beforeSelectMethod || rowOpts.currentMethod;
@@ -12303,7 +12348,7 @@ export default defineVxeComponent({
12303
12348
  rowExpandYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
12304
12349
  }
12305
12350
  reactData.scrollYTop = scrollYTop;
12306
- reactData.scrollYHeight = ySpaceHeight;
12351
+ reactData.scrollYHeight = isScrollYBig ? sYHeight : ySpaceHeight;
12307
12352
  reactData.isScrollYBig = isScrollYBig;
12308
12353
  calcScrollbar();
12309
12354
  if (isScrollYBig && mouseOpts.area) {
@@ -12835,7 +12880,7 @@ export default defineVxeComponent({
12835
12880
  const renderVN = () => {
12836
12881
  const { loading, stripe, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules } = props;
12837
12882
  const { isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, tableData, initStore, isRowGroupStatus, columnStore, filterStore, customStore, tooltipStore } = reactData;
12838
- const { teleportToWrapperElem, popupToWrapperElem } = internalData;
12883
+ const { teleportToWrapperElem, popupToWrapperElem, customPopupToElem } = internalData;
12839
12884
  const { leftList, rightList } = columnStore;
12840
12885
  const loadingSlot = slots.loading;
12841
12886
  const tipSlots = {
@@ -12865,8 +12910,6 @@ export default defineVxeComponent({
12865
12910
  const columnDragOpts = computeColumnDragOpts.value;
12866
12911
  const scrollbarXToTop = computeScrollbarXToTop.value;
12867
12912
  const scrollbarYToLeft = computeScrollbarYToLeft.value;
12868
- const customSimpleMode = computeCustomSimpleMode.value;
12869
- const showCustomSimpleOutside = customSimpleMode === 'outside';
12870
12913
  const { isCrossTableDrag } = rowDragOpts;
12871
12914
  const tbOns = {
12872
12915
  onKeydown: keydownEvent,
@@ -13007,16 +13050,6 @@ export default defineVxeComponent({
13007
13050
  })
13008
13051
  ]
13009
13052
  : []),
13010
- /**
13011
- * 自定义列
13012
- */
13013
- !showCustomSimpleOutside && initStore.custom
13014
- ? h(TableCustomPanelComponent, {
13015
- key: 'cs',
13016
- ref: refTableCustom,
13017
- customStore
13018
- })
13019
- : renderEmptyElement($xeTable),
13020
13053
  /**
13021
13054
  * 加载中
13022
13055
  */
@@ -13046,6 +13079,26 @@ export default defineVxeComponent({
13046
13079
  ])
13047
13080
  ])
13048
13081
  ]),
13082
+ h('div', {
13083
+ key: 'fpw',
13084
+ ref: refCustomContainerElem
13085
+ }, [
13086
+ h(Teleport, {
13087
+ to: customPopupToElem,
13088
+ disabled: !!reactData.ctPopupFlag && !customPopupToElem
13089
+ }, [
13090
+ /**
13091
+ * 自定义列
13092
+ */
13093
+ initStore.custom
13094
+ ? h(TableCustomPanelComponent, {
13095
+ key: 'cs',
13096
+ ref: refTableCustom,
13097
+ customStore
13098
+ })
13099
+ : renderEmptyElement($xeTable)
13100
+ ])
13101
+ ]),
13049
13102
  h('div', {
13050
13103
  key: 'tpw'
13051
13104
  }, [
@@ -13056,16 +13109,6 @@ export default defineVxeComponent({
13056
13109
  h('div', {
13057
13110
  ref: refPopupWrapperElem
13058
13111
  }, [
13059
- /**
13060
- * 自定义列
13061
- */
13062
- showCustomSimpleOutside && initStore.custom
13063
- ? h(TableCustomPanelComponent, {
13064
- key: 'cs',
13065
- ref: refTableCustom,
13066
- customStore
13067
- })
13068
- : renderEmptyElement($xeTable),
13069
13112
  /**
13070
13113
  * 筛选
13071
13114
  */
@@ -13709,6 +13752,7 @@ export default defineVxeComponent({
13709
13752
  globalEvents.on($xeTable, 'mousewheel', handleGlobalMousewheelEvent);
13710
13753
  globalEvents.on($xeTable, 'keydown', handleGlobalKeydownEvent);
13711
13754
  globalEvents.on($xeTable, 'resize', handleGlobalResizeEvent);
13755
+ globalEvents.on($xeTable, 'scroll', handleGlobalScrollEvent);
13712
13756
  globalEvents.on($xeTable, 'contextmenu', $xeTable.handleGlobalContextmenuEvent);
13713
13757
  $xeTable.preventEvent(null, 'mounted', { $table: $xeTable });
13714
13758
  });
@@ -13740,6 +13784,7 @@ export default defineVxeComponent({
13740
13784
  globalEvents.off($xeTable, 'mousewheel');
13741
13785
  globalEvents.off($xeTable, 'keydown');
13742
13786
  globalEvents.off($xeTable, 'resize');
13787
+ globalEvents.off($xeTable, 'scroll');
13743
13788
  globalEvents.off($xeTable, 'contextmenu');
13744
13789
  $xeTable.preventEvent(null, 'beforeUnmount', { $table: $xeTable });
13745
13790
  XEUtils.assign(reactData, createReactData());
@@ -82,6 +82,8 @@ export function createInternalData() {
82
82
  sourceDataRowIdData: {},
83
83
  fullColumnIdData: {},
84
84
  fullColumnFieldData: {},
85
+ // 当前行
86
+ currentRow: null,
85
87
  // 合并表头单元格的数据
86
88
  mergeHeaderList: [],
87
89
  mergeHeaderMaps: {},
@@ -130,7 +132,9 @@ export function createInternalData() {
130
132
  tFooterHeight: 0,
131
133
  teleportToWrapperElem: null,
132
134
  popupToWrapperElem: null,
135
+ customPopupToElem: null,
133
136
  lastSTime: 0,
137
+ // isCustomDragStatus: false,
134
138
  inited: false,
135
139
  tooltipTimeout: null,
136
140
  initStatus: false,
@@ -172,8 +176,6 @@ export function createReactData() {
172
176
  isAllSelected: false,
173
177
  // 复选框属性,有选中且非全选状态
174
178
  isIndeterminate: false,
175
- // 当前行
176
- currentRow: null,
177
179
  // 单选框属性,选中列
178
180
  currentColumn: null,
179
181
  // 单选框属性,选中行
@@ -209,7 +211,7 @@ export function createReactData() {
209
211
  activeWrapper: false,
210
212
  visible: false,
211
213
  maxHeight: null,
212
- popupTop: 0,
214
+ popupStyle: {},
213
215
  oldSortMaps: {},
214
216
  oldFixedMaps: {},
215
217
  oldVisibleMaps: {}
@@ -370,6 +372,8 @@ export function createReactData() {
370
372
  resizeHeightFlag: 1,
371
373
  resizeWidthFlag: 1,
372
374
  isCustomStatus: false,
375
+ isCustomDragStatus: true,
376
+ ctPopupFlag: 1,
373
377
  isCrossDragRow: false,
374
378
  dragRow: null,
375
379
  isCrossDragCol: false,
@@ -791,6 +791,7 @@
791
791
  text-align: left;
792
792
  background-color: var(--vxe-ui-layout-background-color);
793
793
  z-index: 19;
794
+ color: var(--vxe-ui-font-color);
794
795
  border: 1px solid var(--vxe-ui-table-border-color);
795
796
  border-radius: var(--vxe-ui-border-radius);
796
797
  box-shadow: var(--vxe-ui-base-popup-box-shadow);
@@ -1299,6 +1300,19 @@
1299
1300
  width: 200px;
1300
1301
  }
1301
1302
 
1303
+ .vxe-table-custom-wrapper {
1304
+ font-size: var(--vxe-ui-font-size-default);
1305
+ }
1306
+ .vxe-table-custom-wrapper.size--medium {
1307
+ font-size: var(--vxe-ui-font-size-medium);
1308
+ }
1309
+ .vxe-table-custom-wrapper.size--small {
1310
+ font-size: var(--vxe-ui-font-size-small);
1311
+ }
1312
+ .vxe-table-custom-wrapper.size--mini {
1313
+ font-size: var(--vxe-ui-font-size-mini);
1314
+ }
1315
+
1302
1316
  .vxe-table-export--panel-column > ul {
1303
1317
  list-style-type: none;
1304
1318
  overflow: auto;