vxe-table 4.18.9 → 4.18.11

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 (59) 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 +14 -13
  9. package/es/table/src/table.js +75 -39
  10. package/es/table/src/util.js +7 -3
  11. package/es/table/style.css +14 -0
  12. package/es/table/style.min.css +1 -1
  13. package/es/ui/index.js +3 -2
  14. package/es/ui/src/log.js +1 -1
  15. package/es/vxe-table/style.css +14 -0
  16. package/es/vxe-table/style.min.css +1 -1
  17. package/helper/vetur/attributes.json +1 -1
  18. package/helper/vetur/tags.json +1 -1
  19. package/lib/index.css +1 -1
  20. package/lib/index.min.css +1 -1
  21. package/lib/index.umd.js +143 -59
  22. package/lib/index.umd.min.js +1 -1
  23. package/lib/style.css +1 -1
  24. package/lib/style.min.css +1 -1
  25. package/lib/table/module/custom/hook.js +76 -6
  26. package/lib/table/module/custom/hook.min.js +1 -1
  27. package/lib/table/module/custom/panel.js +21 -13
  28. package/lib/table/module/custom/panel.min.js +1 -1
  29. package/lib/table/module/keyboard/hook.js +1 -3
  30. package/lib/table/module/keyboard/hook.min.js +1 -1
  31. package/lib/table/src/body.js +14 -9
  32. package/lib/table/src/body.min.js +1 -1
  33. package/lib/table/src/table.js +20 -22
  34. package/lib/table/src/table.min.js +1 -1
  35. package/lib/table/src/util.js +7 -3
  36. package/lib/table/src/util.min.js +1 -1
  37. package/lib/table/style/style.css +14 -0
  38. package/lib/table/style/style.min.css +1 -1
  39. package/lib/ui/index.js +3 -2
  40. package/lib/ui/index.min.js +1 -1
  41. package/lib/ui/src/log.js +1 -1
  42. package/lib/ui/src/log.min.js +1 -1
  43. package/lib/vxe-table/style/style.css +14 -0
  44. package/lib/vxe-table/style/style.min.css +1 -1
  45. package/package.json +1 -1
  46. package/packages/table/module/custom/hook.ts +70 -7
  47. package/packages/table/module/custom/panel.ts +20 -15
  48. package/packages/table/module/keyboard/hook.ts +1 -2
  49. package/packages/table/src/body.ts +16 -13
  50. package/packages/table/src/table.ts +76 -39
  51. package/packages/table/src/util.ts +9 -3
  52. package/packages/ui/index.ts +2 -1
  53. package/styles/components/table-module/custom.scss +14 -0
  54. /package/es/{iconfont.1774420952727.ttf → iconfont.1775652066125.ttf} +0 -0
  55. /package/es/{iconfont.1774420952727.woff → iconfont.1775652066125.woff} +0 -0
  56. /package/es/{iconfont.1774420952727.woff2 → iconfont.1775652066125.woff2} +0 -0
  57. /package/lib/{iconfont.1774420952727.ttf → iconfont.1775652066125.ttf} +0 -0
  58. /package/lib/{iconfont.1774420952727.woff → iconfont.1775652066125.woff} +0 -0
  59. /package/lib/{iconfont.1774420952727.woff2 → iconfont.1775652066125.woff2} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-table",
3
- "version": "4.18.9",
3
+ "version": "4.18.11",
4
4
  "description": "A PC-end table component based on Vxe UI, supporting copy-paste, data pivot table, and high-performance virtual list table solution.",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -2,8 +2,9 @@ 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
 
6
- import type { TableCustomMethods, TableCustomPrivateMethods, VxeColumnPropTypes, VxeTableDefines } from '../../../../types'
7
+ import type { TableCustomMethods, TableCustomPrivateMethods, VxeColumnPropTypes, VxeTableDefines, VxeComponentStyleType } from '../../../../types'
7
8
 
8
9
  const tableCustomMethodKeys: (keyof TableCustomMethods)[] = ['openCustom', 'closeCustom', 'getCustomVisible', 'toggleCustom', 'saveCustom', 'cancelCustom', 'resetCustom', 'toggleCustomAllCheckbox', 'setCustomAllCheckbox']
9
10
 
@@ -20,13 +21,16 @@ VxeUI.hooks.add('tableCustomModule', {
20
21
  const updatePopupStyle = () => {
21
22
  const { customStore } = reactData
22
23
  const customOpts = computeCustomOpts.value
24
+ const { mode, placement, popupOptions } = customOpts
25
+ const showSimple = !(mode === 'modal' || mode === 'drawer')
26
+ const { transfer, maxHeight } = popupOptions || {}
23
27
  const customSimpleMode = computeCustomSimpleMode.value
24
28
  const showCustomSimpleOutside = customSimpleMode === 'outside'
25
- const { popupOptions } = customOpts
26
- const { maxHeight } = popupOptions || {}
29
+ const bodyEl = document.documentElement
27
30
  let wrapperEl = refElem.value
28
31
  let popupTop = 0
29
32
  let popupMaxHeight: string | number = 0
33
+ const popupStys: VxeComponentStyleType = {}
30
34
  if ($xeGantt) {
31
35
  const { refGanttContainerElem } = $xeGantt.getRefMaps()
32
36
  const ganttContainerElem = refGanttContainerElem.value
@@ -34,7 +38,12 @@ VxeUI.hooks.add('tableCustomModule', {
34
38
  wrapperEl = ganttContainerElem
35
39
  }
36
40
  }
37
- if (showCustomSimpleOutside) {
41
+ const tableRect = wrapperEl.getBoundingClientRect()
42
+ // 多种模式,指定元素插入
43
+ if (showSimple && transfer) {
44
+ popupTop = tableRect.top + bodyEl.scrollTop
45
+ popupMaxHeight = XEUtils.eqNull(maxHeight) ? 360 : maxHeight
46
+ } else if (showCustomSimpleOutside) {
38
47
  if ($xeGGWrapper && wrapperEl) {
39
48
  popupTop = wrapperEl.offsetTop
40
49
  }
@@ -46,12 +55,60 @@ VxeUI.hooks.add('tableCustomModule', {
46
55
  }
47
56
  popupMaxHeight = Math.max(88, popupMaxHeight)
48
57
  }
49
- customStore.popupTop = popupTop
50
- customStore.maxHeight = XEUtils.eqNull(maxHeight) ? popupMaxHeight : maxHeight
58
+ let popupMxHeight: string | number = 0
59
+ if (!(placement === 'left' || placement === 'right')) {
60
+ popupMxHeight = XEUtils.eqNull(maxHeight) ? popupMaxHeight : maxHeight
61
+ }
62
+ if (!placement || !(['left', 'right', 'bottom-left', 'bottom-right'].includes(placement))) {
63
+ if (popupTop) {
64
+ popupStys.top = toCssUnit(popupTop)
65
+ }
66
+ }
67
+
68
+ if (showSimple && transfer) {
69
+ if (placement === 'bottom-left' || placement === 'bottom-right') {
70
+ popupStys.bottom = toCssUnit(bodyEl.scrollHeight - tableRect.top - tableRect.height + 1)
71
+ }
72
+ if (placement === 'top-left' || placement === 'bottom-left') {
73
+ popupStys.left = toCssUnit(tableRect.left)
74
+ } else if (!placement || placement === 'top-right' || placement === 'bottom-right') {
75
+ popupStys.right = toCssUnit(bodyEl.scrollWidth - tableRect.left - tableRect.width + 1)
76
+ }
77
+ }
78
+
79
+ if (popupMxHeight) {
80
+ popupStys.maxHeight = toCssUnit(popupMxHeight)
81
+ }
82
+ customStore.popupStyle = popupStys
83
+ customStore.maxHeight = popupMxHeight
84
+ return nextTick()
51
85
  }
52
86
 
53
87
  const openCustom = () => {
54
88
  const { initStore, customStore } = reactData
89
+ const customOpts = computeCustomOpts.value
90
+ const { mode, popupOptions } = customOpts
91
+ const showSimple = !(mode === 'modal' || mode === 'drawer')
92
+ const { transfer } = popupOptions || {}
93
+ const customSimpleMode = computeCustomSimpleMode.value
94
+ const showCustomSimpleOutside = customSimpleMode === 'outside'
95
+ let cpToElem = null
96
+ // 多种模式,指定元素插入
97
+ if (showSimple && transfer) {
98
+ cpToElem = document.body
99
+ } else {
100
+ if (showCustomSimpleOutside && $xeGGWrapper) {
101
+ const { refPopupContainerElem } = $xeGGWrapper.getRefMaps()
102
+ const popupContainerElem = refPopupContainerElem.value
103
+ if (popupContainerElem) {
104
+ cpToElem = popupContainerElem
105
+ }
106
+ }
107
+ }
108
+ if (internalData.customPopupToElem !== cpToElem) {
109
+ reactData.ctPopupFlag++
110
+ }
111
+ internalData.customPopupToElem = cpToElem
55
112
  customStore.visible = true
56
113
  initStore.custom = true
57
114
  handleUpdateCustomColumn()
@@ -345,7 +402,13 @@ VxeUI.hooks.add('tableCustomModule', {
345
402
  $xeTable.emitCustomEvent('close', evnt)
346
403
  }
347
404
  },
348
- handleUpdateCustomColumn
405
+ handleUpdateCustomColumn,
406
+ handleCustomStyle () {
407
+ const reactData = $xeTable.reactData
408
+
409
+ reactData.isCustomDragStatus = false
410
+ return updatePopupStyle()
411
+ }
349
412
  }
350
413
 
351
414
  return { ...customMethods, ...customPrivateMethods }
@@ -2,11 +2,11 @@ import { h, inject, ref, Ref, provide, VNode, PropType, nextTick, TransitionGrou
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
 
9
- import type { VxeButtonEvents, VxeComponentStyleType } from 'vxe-pc-ui'
9
+ import type { VxeButtonEvents } from 'vxe-pc-ui'
10
10
  import type { VxeTableDefines, VxeTablePrivateMethods, VxeTableConstructor, VxeTableMethods, VxeColumnPropTypes, VxeTableCustomPanelConstructor, TableCustomPanelReactData, TableCustomPanelInternalData, TableCustomPanelPrivateRef, TableCustomPanelPrivateComputed } from '../../../../types'
11
11
 
12
12
  const { getI18n, getIcon, renderEmptyElement } = VxeUI
@@ -18,7 +18,8 @@ export function createInternalData (): TableCustomPanelInternalData {
18
18
  // prevDragGroupField: undefined,
19
19
  // prevDragAggFnColid: undefined,
20
20
  // prevDragToChild: false,
21
- // prevDragPos: null
21
+ // prevDragPos: null,
22
+ // customDragTime: null
22
23
  }
23
24
  }
24
25
 
@@ -42,7 +43,7 @@ export default defineVxeComponent({
42
43
  const $xeTable = inject('$xeTable', {} as VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods)
43
44
 
44
45
  const { props: tableProps, reactData: tableReactData, internalData: tableInternalData } = $xeTable
45
- const { computeCustomOpts, computeColumnDragOpts, computeColumnOpts, computeIsMaxFixedColumn, computeResizableOpts } = $xeTable.getComputeMaps()
46
+ const { computeSize, computeCustomOpts, computeColumnDragOpts, computeColumnOpts, computeIsMaxFixedColumn, computeResizableOpts } = $xeTable.getComputeMaps()
46
47
 
47
48
  const refElem = ref() as Ref<HTMLDivElement>
48
49
  const refBodyWrapperElem = ref() as Ref<HTMLDivElement>
@@ -327,9 +328,14 @@ export default defineVxeComponent({
327
328
  }
328
329
 
329
330
  const sortDragstartEvent = (evnt: DragEvent) => {
331
+ const { customDragTime } = customPanelInternalData
330
332
  if (evnt.dataTransfer) {
331
333
  evnt.dataTransfer.setDragImage(getTpImg(), 0, 0)
332
334
  }
335
+ if (customDragTime) {
336
+ clearTimeout(customDragTime)
337
+ }
338
+ tableReactData.isCustomDragStatus = true
333
339
  customPanelInternalData.prevDragGroupField = null
334
340
  customPanelInternalData.prevDragAggFnColid = null
335
341
  }
@@ -511,6 +517,10 @@ export default defineVxeComponent({
511
517
  tableReactData.customColumnList = collectColumn.slice(0)
512
518
  $xeTable.handleColDragSwapColumn()
513
519
  }
520
+ customPanelInternalData.customDragTime = setTimeout(() => {
521
+ tableReactData.isCustomDragStatus = false
522
+ customPanelInternalData.customDragTime = undefined
523
+ }, 350)
514
524
  }).catch(() => {
515
525
  })
516
526
  }
@@ -612,13 +622,14 @@ export default defineVxeComponent({
612
622
 
613
623
  const { customStore } = props
614
624
  const { treeConfig, rowGroupConfig, aggregateConfig } = tableProps
615
- const { isCustomStatus, customColumnList } = tableReactData
625
+ const { isCustomStatus, customColumnList, isCustomDragStatus } = tableReactData
616
626
  const customOpts = computeCustomOpts.value
617
627
  const { immediate } = customOpts
618
628
  const columnDragOpts = computeColumnDragOpts.value
619
- const { maxHeight, popupTop } = customStore
629
+ const { popupStyle } = customStore
620
630
  const { checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, trigger, placement } = customOpts
621
631
  const isMaxFixedColumn = computeIsMaxFixedColumn.value
632
+ const vSize = computeSize.value
622
633
  const { isCrossDrag } = columnDragOpts
623
634
  const slots = customOpts.slots || {}
624
635
  const headerSlot = slots.header
@@ -754,20 +765,14 @@ export default defineVxeComponent({
754
765
  )
755
766
  }
756
767
  })
757
- const popupStys: VxeComponentStyleType = {}
758
- if (maxHeight && !['left', 'right'].includes(placement || '')) {
759
- if (popupTop) {
760
- popupStys.top = toCssUnit(popupTop)
761
- }
762
- popupStys.maxHeight = toCssUnit(maxHeight)
763
- }
764
768
  return h('div', {
765
769
  ref: refElem,
766
770
  key: 'simple',
767
771
  class: ['vxe-table-custom-wrapper', `placement--${placement}`, {
772
+ [`size--${vSize}`]: vSize,
768
773
  'is--active': customStore.visible
769
774
  }],
770
- style: popupStys
775
+ style: popupStyle
771
776
  }, customStore.visible
772
777
  ? [
773
778
  h('div', {
@@ -830,7 +835,7 @@ export default defineVxeComponent({
830
835
  }, $xeTable.callSlot(defaultSlot, params))
831
836
  : h(TransitionGroup, {
832
837
  class: 'vxe-table-custom--panel-list',
833
- name: 'vxe-table-custom--list',
838
+ name: isCustomDragStatus ? 'vxe-table-custom--list' : '',
834
839
  tag: 'ul',
835
840
  ...customWrapperOns
836
841
  }, {
@@ -377,8 +377,7 @@ hooks.add('tableKeyboardModule', {
377
377
  // 处理当前行方向键移动
378
378
  moveCurrentRow (isUpArrow, isDwArrow, evnt) {
379
379
  const { treeConfig } = props
380
- const { currentRow } = reactData
381
- const { afterFullData } = internalData
380
+ const { afterFullData, currentRow } = internalData
382
381
  const treeOpts = computeTreeOpts.value
383
382
  const childrenField = treeOpts.children || treeOpts.childrenField
384
383
  let targetRow
@@ -366,6 +366,16 @@ export default defineVxeComponent({
366
366
  if (treeConfig) {
367
367
  tdVNs.push(...renderLine(rowid, cellParams, cellHeight))
368
368
  }
369
+ const clVNs: VxeComponentSlotType[] = []
370
+ if (!isVNPreEmptyStatus) {
371
+ clVNs.push(
372
+ h('div', {
373
+ colid,
374
+ rowid,
375
+ class: 'vxe-cell--wrapper vxe-body-cell--wrapper'
376
+ }, column.renderCell(cellParams))
377
+ )
378
+ }
369
379
  tdVNs.push(
370
380
  h('div', {
371
381
  key: 'tc',
@@ -376,15 +386,7 @@ export default defineVxeComponent({
376
386
  }],
377
387
  style: tcStyle,
378
388
  title: showTitle ? $xeTable.getCellLabel(row, column) : null
379
- }, isVNPreEmptyStatus
380
- ? []
381
- : [
382
- h('div', {
383
- colid,
384
- rowid,
385
- class: 'vxe-cell--wrapper vxe-body-cell--wrapper'
386
- }, column.renderCell(cellParams))
387
- ])
389
+ }, clVNs)
388
390
  )
389
391
  if (showValidTip && errorValidItem) {
390
392
  const errRule = errorValidItem.rule
@@ -489,8 +491,8 @@ export default defineVxeComponent({
489
491
  const $xeGantt = $xeTable.xeGantt
490
492
 
491
493
  const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps
492
- const { hasFixedColumn, treeExpandedFlag, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, rowExpandHeightFlag, isRowGroupStatus } = tableReactData
493
- const { fullAllDataRowIdData, fullColumnIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps } = tableInternalData
494
+ const { hasFixedColumn, treeExpandedFlag, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, rowExpandHeightFlag, isRowGroupStatus } = tableReactData
495
+ const { fullAllDataRowIdData, fullColumnIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps, currentRow } = tableInternalData
494
496
  const checkboxOpts = computeCheckboxOpts.value
495
497
  const radioOpts = computeRadioOpts.value
496
498
  const treeOpts = computeTreeOpts.value
@@ -580,7 +582,8 @@ export default defineVxeComponent({
580
582
  'row--radio': radioOpts.highlight && $xeTable.eqRow(selectRadioRow, row),
581
583
  'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
582
584
  'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid],
583
- 'row--group': hasRowGroupAggregate
585
+ 'row--group': hasRowGroupAggregate,
586
+ 'row--current': currentRow && rowid === getRowid($xeTable, currentRow)
584
587
  },
585
588
  getPropClass(rowClassName, params)
586
589
  ]
@@ -592,7 +595,7 @@ export default defineVxeComponent({
592
595
  class: trClass,
593
596
  rowid: rowid,
594
597
  style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null,
595
- key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || isRowGroupStatus || treeConfig ? rowid : $rowIndex,
598
+ key: rowKey || rowOpts.useKey || rowOpts.drag || columnOpts.drag || isRowGroupStatus || treeConfig ? rowid : $rowIndex,
596
599
  ...trOn
597
600
  }, tdVNs)
598
601
  )
@@ -101,6 +101,7 @@ export default defineVxeComponent({
101
101
 
102
102
  const refTeleportWrapper = ref<HTMLDivElement>()
103
103
  const refPopupWrapperElem = ref<HTMLDivElement>()
104
+ const refCustomContainerElem = ref<HTMLDivElement>()
104
105
 
105
106
  const refLeftContainer = ref() as Ref<HTMLDivElement>
106
107
  const refRightContainer = ref() as Ref<HTMLDivElement>
@@ -790,6 +791,7 @@ export default defineVxeComponent({
790
791
  refRightContainer,
791
792
  refColResizeBar,
792
793
  refRowResizeBar,
794
+ refCustomContainerElem,
793
795
  refScrollXVirtualElem,
794
796
  refScrollYVirtualElem,
795
797
  refScrollXHandleElem,
@@ -2480,8 +2482,8 @@ export default defineVxeComponent({
2480
2482
 
2481
2483
  const updateStyle = () => {
2482
2484
  const { mouseConfig } = props
2483
- const { isGroup, currentRow, tableColumn, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isColLoading } = reactData
2484
- const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData
2485
+ const { isGroup, tableColumn, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isColLoading } = reactData
2486
+ const { visibleColumn, tableHeight, elemStore, currentRow, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData
2485
2487
  const $xeGanttView = internalData.xeGanttView
2486
2488
  const el = refElem.value
2487
2489
  if (!el || (internalData.tBodyHeight && !el.clientHeight)) {
@@ -3085,8 +3087,8 @@ export default defineVxeComponent({
3085
3087
  // 还原展开、选中等相关状态
3086
3088
  const handleReserveStatus = () => {
3087
3089
  const { treeConfig } = props
3088
- const { expandColumn, currentRow, selectRadioRow } = reactData
3089
- const { fullDataRowIdData, fullAllDataRowIdData, radioReserveRow, selectCheckboxMaps, treeExpandedMaps, rowExpandedMaps } = internalData
3090
+ const { expandColumn, selectRadioRow } = reactData
3091
+ const { fullDataRowIdData, fullAllDataRowIdData, radioReserveRow, selectCheckboxMaps, treeExpandedMaps, rowExpandedMaps, currentRow } = internalData
3090
3092
  const expandOpts = computeExpandOpts.value
3091
3093
  const treeOpts = computeTreeOpts.value
3092
3094
  const radioOpts = computeRadioOpts.value
@@ -3110,7 +3112,7 @@ export default defineVxeComponent({
3110
3112
  handleCheckedCheckboxRow(handleReserveRow(internalData.checkboxReserveRowMap), true, true)
3111
3113
  }
3112
3114
  if (currentRow && !fullAllDataRowIdData[getRowid($xeTable, currentRow)]) {
3113
- reactData.currentRow = null // 刷新当前行状态
3115
+ internalData.currentRow = null // 刷新当前行状态
3114
3116
  }
3115
3117
  // 行展开
3116
3118
  internalData.rowExpandedMaps = expandColumn ? getRecoverRowMaps(rowExpandedMaps) : {} // 刷新行展开状态
@@ -3435,6 +3437,7 @@ export default defineVxeComponent({
3435
3437
  const handleLazyRecalculate = (reFull: boolean, reWidth: boolean, reHeight: boolean) => {
3436
3438
  return new Promise<void>(resolve => {
3437
3439
  const $xeGanttView = internalData.xeGanttView
3440
+ const { customStore } = reactData
3438
3441
  const { rceTimeout, rceRunTime } = internalData
3439
3442
  const resizeOpts = computeResizeOpts.value
3440
3443
  const refreshDelay = resizeOpts.refreshDelay || 20
@@ -3443,6 +3446,9 @@ export default defineVxeComponent({
3443
3446
  autoCellWidth()
3444
3447
  updateRowExpandStyle()
3445
3448
  }
3449
+ if (customStore.visible && $xeTable.handleCustomStyle) {
3450
+ $xeTable.handleCustomStyle()
3451
+ }
3446
3452
  if (rceTimeout) {
3447
3453
  clearTimeout(rceTimeout)
3448
3454
  if (rceRunTime && rceRunTime + (refreshDelay - 5) < Date.now()) {
@@ -6393,7 +6399,7 @@ export default defineVxeComponent({
6393
6399
  const el = refElem.value
6394
6400
  $xeTable.clearCurrentRow()
6395
6401
  // $xeTable.clearCurrentColumn()
6396
- reactData.currentRow = row
6402
+ internalData.currentRow = row
6397
6403
  if (rowOpts.isCurrent || props.highlightCurrentRow) {
6398
6404
  if (el) {
6399
6405
  XEUtils.arrayEach(el.querySelectorAll(`[rowid="${getRowid($xeTable, row)}"]`), elem => addClass(elem, 'row--current'))
@@ -6443,7 +6449,7 @@ export default defineVxeComponent({
6443
6449
  clearCurrentRow () {
6444
6450
  const $xeGanttView = internalData.xeGanttView
6445
6451
  const el = refElem.value
6446
- reactData.currentRow = null
6452
+ internalData.currentRow = null
6447
6453
  internalData.hoverRow = null
6448
6454
  if (el) {
6449
6455
  XEUtils.arrayEach(el.querySelectorAll('.row--current'), elem => removeClass(elem, 'row--current'))
@@ -6464,8 +6470,7 @@ export default defineVxeComponent({
6464
6470
  * 用于当前行,获取当前行的数据
6465
6471
  */
6466
6472
  getCurrentRecord (isFull) {
6467
- const { currentRow } = reactData
6468
- const { fullDataRowIdData, afterFullRowMaps } = internalData
6473
+ const { fullDataRowIdData, afterFullRowMaps, currentRow } = internalData
6469
6474
  const rowOpts = computeRowOpts.value
6470
6475
  if (rowOpts.isCurrent || props.highlightCurrentRow) {
6471
6476
  const rowid = getRowid($xeTable, currentRow)
@@ -7446,10 +7451,20 @@ export default defineVxeComponent({
7446
7451
  /**
7447
7452
  * 如果有滚动条,则滚动到对应的行
7448
7453
  */
7449
- scrollToRow (row, fieldOrColumn, options) {
7454
+ scrollToRow (rowOrRowid, fieldOrColumn, options) {
7450
7455
  const { isAllOverflow, scrollYLoad, scrollXLoad } = reactData
7451
- const { _sToTime } = internalData
7456
+ const { fullAllDataRowIdData, _sToTime } = internalData
7452
7457
  const rest = []
7458
+ let row: any
7459
+ if (XEUtils.isString(rowOrRowid) || XEUtils.isNumber(rowOrRowid)) {
7460
+ const rowid = rowOrRowid
7461
+ const rowRest = rowid ? fullAllDataRowIdData[rowid] : null
7462
+ if (rowRest) {
7463
+ row = rowRest.row
7464
+ }
7465
+ } else {
7466
+ row = rowOrRowid
7467
+ }
7453
7468
  if (row) {
7454
7469
  if (props.treeConfig) {
7455
7470
  rest.push($xeTable.scrollToTreeRow(row))
@@ -8047,6 +8062,25 @@ export default defineVxeComponent({
8047
8062
  }
8048
8063
  }
8049
8064
 
8065
+ const reUpdateCustomStyleEvent = (evnt: MouseEvent) => {
8066
+ const { customStore } = reactData
8067
+ const customOpts = computeCustomOpts.value
8068
+ const { popupOptions } = customOpts
8069
+ const { transfer } = popupOptions || {}
8070
+ if (transfer && customStore.visible) {
8071
+ const tableCustom = refTableCustom.value
8072
+ if (tableCustom && $xeTable.handleCustomStyle && !checkTargetElement(evnt.target, [tableCustom.getRefMaps().refElem.value as HTMLDivElement], evnt.currentTarget)) {
8073
+ $xeTable.handleCustomStyle().then(() => {
8074
+ $xeTable.handleCustomStyle()
8075
+ })
8076
+ }
8077
+ }
8078
+ }
8079
+
8080
+ const handleGlobalScrollEvent = (evnt: MouseEvent) => {
8081
+ reUpdateCustomStyleEvent(evnt)
8082
+ }
8083
+
8050
8084
  /**
8051
8085
  * 全局滚动事件
8052
8086
  */
@@ -8109,8 +8143,8 @@ export default defineVxeComponent({
8109
8143
  if (internalData.isActivated) {
8110
8144
  $xeTable.preventEvent(evnt, 'event.keydown', null, () => {
8111
8145
  const { mouseConfig, keyboardConfig, treeConfig, editConfig, highlightCurrentRow, highlightCurrentColumn } = props
8112
- const { ctxMenuStore, editStore, currentRow } = reactData
8113
- const { afterFullData, visibleColumn } = internalData
8146
+ const { ctxMenuStore, editStore } = reactData
8147
+ const { afterFullData, visibleColumn, currentRow } = internalData
8114
8148
  const isContentMenu = computeIsContentMenu.value
8115
8149
  const bodyMenu = computeBodyMenu.value
8116
8150
  const keyboardOpts = computeKeyboardOpts.value
@@ -10403,7 +10437,7 @@ export default defineVxeComponent({
10403
10437
  }
10404
10438
  },
10405
10439
  triggerCurrentRowEvent (evnt, params) {
10406
- const { currentRow: oldValue } = reactData
10440
+ const { currentRow: oldValue } = internalData
10407
10441
  const rowOpts = computeRowOpts.value
10408
10442
  const currentRowOpts = computeCurrentRowOpts.value
10409
10443
  const beforeRowMethod = currentRowOpts.beforeSelectMethod || rowOpts.currentMethod as any
@@ -12460,7 +12494,7 @@ export default defineVxeComponent({
12460
12494
  rowExpandYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : ''
12461
12495
  }
12462
12496
  reactData.scrollYTop = scrollYTop
12463
- reactData.scrollYHeight = ySpaceHeight
12497
+ reactData.scrollYHeight = isScrollYBig ? sYHeight : ySpaceHeight
12464
12498
  reactData.isScrollYBig = isScrollYBig
12465
12499
 
12466
12500
  calcScrollbar()
@@ -13006,7 +13040,7 @@ export default defineVxeComponent({
13006
13040
  const renderVN = () => {
13007
13041
  const { loading, stripe, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules } = props
13008
13042
  const { isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, tableData, initStore, isRowGroupStatus, columnStore, filterStore, customStore, tooltipStore } = reactData
13009
- const { teleportToWrapperElem, popupToWrapperElem } = internalData
13043
+ const { teleportToWrapperElem, popupToWrapperElem, customPopupToElem } = internalData
13010
13044
  const { leftList, rightList } = columnStore
13011
13045
  const loadingSlot = slots.loading
13012
13046
  const tipSlots = {
@@ -13036,8 +13070,6 @@ export default defineVxeComponent({
13036
13070
  const columnDragOpts = computeColumnDragOpts.value
13037
13071
  const scrollbarXToTop = computeScrollbarXToTop.value
13038
13072
  const scrollbarYToLeft = computeScrollbarYToLeft.value
13039
- const customSimpleMode = computeCustomSimpleMode.value
13040
- const showCustomSimpleOutside = customSimpleMode === 'outside'
13041
13073
  const { isCrossTableDrag } = rowDragOpts
13042
13074
  const tbOns: {
13043
13075
  onContextmenu: (...args: any[]) => void
@@ -13188,16 +13220,6 @@ export default defineVxeComponent({
13188
13220
  })
13189
13221
  ]
13190
13222
  : []),
13191
- /**
13192
- * 自定义列
13193
- */
13194
- !showCustomSimpleOutside && initStore.custom
13195
- ? h(TableCustomPanelComponent, {
13196
- key: 'cs',
13197
- ref: refTableCustom,
13198
- customStore
13199
- })
13200
- : renderEmptyElement($xeTable),
13201
13223
  /**
13202
13224
  * 加载中
13203
13225
  */
@@ -13227,6 +13249,26 @@ export default defineVxeComponent({
13227
13249
  ])
13228
13250
  ])
13229
13251
  ]),
13252
+ h('div', {
13253
+ key: 'fpw',
13254
+ ref: refCustomContainerElem
13255
+ }, [
13256
+ h(Teleport, {
13257
+ to: customPopupToElem,
13258
+ disabled: !!reactData.ctPopupFlag && !customPopupToElem
13259
+ }, [
13260
+ /**
13261
+ * 自定义列
13262
+ */
13263
+ initStore.custom
13264
+ ? h(TableCustomPanelComponent, {
13265
+ key: 'cs',
13266
+ ref: refTableCustom,
13267
+ customStore
13268
+ })
13269
+ : renderEmptyElement($xeTable)
13270
+ ])
13271
+ ]),
13230
13272
  h('div', {
13231
13273
  key: 'tpw'
13232
13274
  }, [
@@ -13237,16 +13279,6 @@ export default defineVxeComponent({
13237
13279
  h('div', {
13238
13280
  ref: refPopupWrapperElem
13239
13281
  }, [
13240
- /**
13241
- * 自定义列
13242
- */
13243
- showCustomSimpleOutside && initStore.custom
13244
- ? h(TableCustomPanelComponent, {
13245
- key: 'cs',
13246
- ref: refTableCustom,
13247
- customStore
13248
- })
13249
- : renderEmptyElement($xeTable),
13250
13282
  /**
13251
13283
  * 筛选
13252
13284
  */
@@ -13319,7 +13351,10 @@ export default defineVxeComponent({
13319
13351
  minWidth: tableTipConfig.minWidth,
13320
13352
  minHeight: tableTipConfig.minHeight,
13321
13353
  maxWidth: tableTipConfig.maxWidth,
13322
- maxHeight: tableTipConfig.maxHeight
13354
+ maxHeight: tableTipConfig.maxHeight,
13355
+ placement: tableTipConfig.placement,
13356
+ defaultPlacement: tableTipConfig.defaultPlacement,
13357
+ popupClassName: tableTipConfig.popupClassName
13323
13358
  }, currTooltipSlot
13324
13359
  ? {
13325
13360
  content: () => {
@@ -13924,6 +13959,7 @@ export default defineVxeComponent({
13924
13959
  globalEvents.on($xeTable, 'mousewheel', handleGlobalMousewheelEvent)
13925
13960
  globalEvents.on($xeTable, 'keydown', handleGlobalKeydownEvent)
13926
13961
  globalEvents.on($xeTable, 'resize', handleGlobalResizeEvent)
13962
+ globalEvents.on($xeTable, 'scroll', handleGlobalScrollEvent)
13927
13963
  globalEvents.on($xeTable, 'contextmenu', $xeTable.handleGlobalContextmenuEvent)
13928
13964
  $xeTable.preventEvent(null, 'mounted', { $table: $xeTable })
13929
13965
  })
@@ -13961,6 +13997,7 @@ export default defineVxeComponent({
13961
13997
  globalEvents.off($xeTable, 'mousewheel')
13962
13998
  globalEvents.off($xeTable, 'keydown')
13963
13999
  globalEvents.off($xeTable, 'resize')
14000
+ globalEvents.off($xeTable, 'scroll')
13964
14001
  globalEvents.off($xeTable, 'contextmenu')
13965
14002
 
13966
14003
  $xeTable.preventEvent(null, 'beforeUnmount', { $table: $xeTable })
@@ -90,6 +90,9 @@ export function createInternalData (): TableInternalData {
90
90
  fullColumnIdData: {},
91
91
  fullColumnFieldData: {},
92
92
 
93
+ // 当前行
94
+ currentRow: null,
95
+
93
96
  // 合并表头单元格的数据
94
97
  mergeHeaderList: [],
95
98
  mergeHeaderMaps: {},
@@ -142,9 +145,12 @@ export function createInternalData (): TableInternalData {
142
145
 
143
146
  teleportToWrapperElem: null,
144
147
  popupToWrapperElem: null,
148
+ customPopupToElem: null,
145
149
 
146
150
  lastSTime: 0,
147
151
 
152
+ // isCustomDragStatus: false,
153
+
148
154
  inited: false,
149
155
  tooltipTimeout: null,
150
156
  initStatus: false,
@@ -188,8 +194,6 @@ export function createReactData (): TableReactData {
188
194
  isAllSelected: false,
189
195
  // 复选框属性,有选中且非全选状态
190
196
  isIndeterminate: false,
191
- // 当前行
192
- currentRow: null,
193
197
  // 单选框属性,选中列
194
198
  currentColumn: null,
195
199
  // 单选框属性,选中行
@@ -225,7 +229,7 @@ export function createReactData (): TableReactData {
225
229
  activeWrapper: false,
226
230
  visible: false,
227
231
  maxHeight: null,
228
- popupTop: 0,
232
+ popupStyle: {},
229
233
  oldSortMaps: {},
230
234
  oldFixedMaps: {},
231
235
  oldVisibleMaps: {}
@@ -395,6 +399,8 @@ export function createReactData (): TableReactData {
395
399
  resizeWidthFlag: 1,
396
400
 
397
401
  isCustomStatus: false,
402
+ isCustomDragStatus: true,
403
+ ctPopupFlag: 1,
398
404
 
399
405
  isCrossDragRow: false,
400
406
  dragRow: null,
@@ -72,7 +72,8 @@ VxeUI.setConfig({
72
72
  strict: true
73
73
  },
74
74
  tooltipConfig: {
75
- enterable: true
75
+ enterable: true,
76
+ defaultPlacement: 'top'
76
77
  },
77
78
  headerTooltipConfig: {
78
79
  enterable: true
@@ -64,6 +64,7 @@
64
64
  text-align: left;
65
65
  background-color: var(--vxe-ui-layout-background-color);
66
66
  z-index: 19;
67
+ color: var(--vxe-ui-font-color);
67
68
  border: 1px solid var(--vxe-ui-table-border-color);
68
69
  border-radius: var(--vxe-ui-border-radius);
69
70
  box-shadow: var(--vxe-ui-base-popup-box-shadow);
@@ -525,4 +526,17 @@
525
526
  }
526
527
  .vxe-table-custom-popup--table-col-fixed {
527
528
  width: 200px;
529
+ }
530
+
531
+ .vxe-table-custom-wrapper {
532
+ font-size: var(--vxe-ui-font-size-default);
533
+ &.size--medium {
534
+ font-size: var(--vxe-ui-font-size-medium);
535
+ }
536
+ &.size--small {
537
+ font-size: var(--vxe-ui-font-size-small);
538
+ }
539
+ &.size--mini {
540
+ font-size: var(--vxe-ui-font-size-mini);
541
+ }
528
542
  }