vxe-table 3.20.9 → 3.20.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 (63) 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/mixin.js +76 -5
  6. package/es/table/module/custom/panel.js +18 -12
  7. package/es/table/module/keyboard/mixin.js +1 -3
  8. package/es/table/src/body.js +16 -15
  9. package/es/table/src/methods.js +52 -20
  10. package/es/table/src/table.js +23 -19
  11. package/es/table/src/util.js +6 -3
  12. package/es/table/style.css +14 -0
  13. package/es/table/style.min.css +1 -1
  14. package/es/ui/index.js +3 -2
  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 +160 -70
  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/mixin.js +81 -5
  27. package/lib/table/module/custom/mixin.min.js +1 -1
  28. package/lib/table/module/custom/panel.js +20 -12
  29. package/lib/table/module/custom/panel.min.js +1 -1
  30. package/lib/table/module/keyboard/mixin.js +1 -4
  31. package/lib/table/module/keyboard/mixin.min.js +1 -1
  32. package/lib/table/src/body.js +16 -11
  33. package/lib/table/src/body.min.js +1 -1
  34. package/lib/table/src/methods.js +13 -15
  35. package/lib/table/src/methods.min.js +1 -1
  36. package/lib/table/src/table.js +19 -17
  37. package/lib/table/src/table.min.js +1 -1
  38. package/lib/table/src/util.js +6 -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 +3 -2
  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/mixin.ts +77 -6
  50. package/packages/table/module/custom/panel.ts +19 -13
  51. package/packages/table/module/keyboard/mixin.ts +1 -3
  52. package/packages/table/src/body.ts +18 -15
  53. package/packages/table/src/methods.ts +54 -20
  54. package/packages/table/src/table.ts +23 -19
  55. package/packages/table/src/util.ts +7 -3
  56. package/packages/ui/index.ts +2 -1
  57. package/styles/components/table-module/custom.scss +14 -0
  58. /package/es/{iconfont.1774420912543.ttf → iconfont.1775652058165.ttf} +0 -0
  59. /package/es/{iconfont.1774420912543.woff → iconfont.1775652058165.woff} +0 -0
  60. /package/es/{iconfont.1774420912543.woff2 → iconfont.1775652058165.woff2} +0 -0
  61. /package/lib/{iconfont.1774420912543.ttf → iconfont.1775652058165.ttf} +0 -0
  62. /package/lib/{iconfont.1774420912543.woff → iconfont.1775652058165.woff} +0 -0
  63. /package/lib/{iconfont.1774420912543.woff2 → iconfont.1775652058165.woff2} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-table",
3
- "version": "3.20.9",
3
+ "version": "3.20.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",
@@ -1,7 +1,8 @@
1
1
  import XEUtils from 'xe-utils'
2
2
  import { getColumnList } from '../../src/util'
3
+ import { toCssUnit } from '../../../ui/src/dom'
3
4
 
4
- import type { VxeColumnPropTypes, VxeTableConstructor, VxeTablePrivateMethods, VxeTableDefines, TableReactData, TableInternalData } from '../../../../types'
5
+ import type { VxeColumnPropTypes, VxeTableConstructor, VxeTablePrivateMethods, VxeTableDefines, TableReactData, TableInternalData, VxeComponentStyleType } from '../../../../types'
5
6
 
6
7
  function updatePopupStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
7
8
  const $xeGrid = $xeTable.$xeGrid
@@ -11,20 +12,28 @@ function updatePopupStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethod
11
12
 
12
13
  const { customStore } = reactData
13
14
  const customOpts = $xeTable.computeCustomOpts
15
+ const { mode, placement, popupOptions } = customOpts
16
+ const showSimple = !(mode === 'modal' || mode === 'drawer')
17
+ const { transfer, maxHeight } = popupOptions || {}
14
18
  const customSimpleMode = $xeTable.computeCustomSimpleMode
15
19
  const showCustomSimpleOutside = customSimpleMode === 'outside'
16
- const { popupOptions } = customOpts
17
- const { maxHeight } = popupOptions || {}
20
+ const bodyEl = document.documentElement
18
21
  let wrapperEl = $xeTable.$refs.refElem as HTMLDivElement
19
22
  let popupTop = 0
20
23
  let popupMaxHeight: string | number = 0
24
+ const popupStys: VxeComponentStyleType = {}
21
25
  if ($xeGantt) {
22
26
  const ganttContainerElem = $xeGantt.$refs.refGanttContainerElem as HTMLDivElement
23
27
  if (ganttContainerElem) {
24
28
  wrapperEl = ganttContainerElem
25
29
  }
26
30
  }
27
- if (showCustomSimpleOutside) {
31
+ const tableRect = wrapperEl.getBoundingClientRect()
32
+ // 多种模式,指定元素插入
33
+ if (showSimple && transfer) {
34
+ popupTop = tableRect.top + bodyEl.scrollTop
35
+ popupMaxHeight = XEUtils.eqNull(maxHeight) ? 360 : maxHeight
36
+ } else if (showCustomSimpleOutside) {
28
37
  if ($xeGGWrapper && wrapperEl) {
29
38
  popupTop = wrapperEl.offsetTop
30
39
  }
@@ -36,8 +45,33 @@ function updatePopupStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethod
36
45
  }
37
46
  popupMaxHeight = Math.max(88, popupMaxHeight)
38
47
  }
39
- customStore.popupTop = popupTop
40
- customStore.maxHeight = XEUtils.eqNull(maxHeight) ? popupMaxHeight : maxHeight
48
+ let popupMxHeight: string | number = 0
49
+ if (!(placement === 'left' || placement === 'right')) {
50
+ popupMxHeight = XEUtils.eqNull(maxHeight) ? popupMaxHeight : maxHeight
51
+ }
52
+ if (!placement || !(['left', 'right', 'bottom-left', 'bottom-right'].includes(placement))) {
53
+ if (popupTop) {
54
+ popupStys.top = toCssUnit(popupTop)
55
+ }
56
+ }
57
+
58
+ if (showSimple && transfer) {
59
+ if (placement === 'bottom-left' || placement === 'bottom-right') {
60
+ popupStys.bottom = toCssUnit(bodyEl.scrollHeight - tableRect.top - tableRect.height + 1)
61
+ }
62
+ if (placement === 'top-left' || placement === 'bottom-left') {
63
+ popupStys.left = toCssUnit(tableRect.left)
64
+ } else if (!placement || placement === 'top-right' || placement === 'bottom-right') {
65
+ popupStys.right = toCssUnit(bodyEl.scrollWidth - tableRect.left - tableRect.width + 1)
66
+ }
67
+ }
68
+
69
+ if (popupMxHeight) {
70
+ popupStys.maxHeight = toCssUnit(popupMxHeight)
71
+ }
72
+ customStore.popupStyle = popupStys
73
+ customStore.maxHeight = popupMxHeight
74
+ return $xeTable.$nextTick()
41
75
  }
42
76
 
43
77
  function emitCustomEvent ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, type: VxeTableDefines.CustomType, evnt: Event) {
@@ -60,8 +94,40 @@ export default {
60
94
  _openCustom () {
61
95
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
62
96
  const reactData = $xeTable as unknown as TableReactData
97
+ const internalData = $xeTable as unknown as TableInternalData
98
+ const $xeGrid = $xeTable.$xeGrid
99
+ const $xeGantt = $xeTable.$xeGantt
100
+ const $xeGGWrapper = $xeGrid || $xeGantt
63
101
 
64
102
  const { initStore, customStore } = reactData
103
+ const customOpts = $xeTable.computeCustomOpts
104
+ const { mode, popupOptions } = customOpts
105
+ const showSimple = !(mode === 'modal' || mode === 'drawer')
106
+ const { transfer } = popupOptions || {}
107
+ const customSimpleMode = $xeTable.computeCustomSimpleMode
108
+ const showCustomSimpleOutside = customSimpleMode === 'outside'
109
+ let cpToElem = $xeTable.$refs.refCustomContainerElem as HTMLElement
110
+ // 多种模式,指定元素插入
111
+ if (showSimple && transfer) {
112
+ cpToElem = document.body
113
+ } else {
114
+ if (showCustomSimpleOutside && $xeGGWrapper) {
115
+ const popupContainerElem = $xeGGWrapper.$refs.refPopupContainerElem as HTMLDivElement
116
+ if (popupContainerElem) {
117
+ cpToElem = popupContainerElem
118
+ }
119
+ }
120
+ }
121
+ if (cpToElem) {
122
+ const customPopupToElem = $xeTable.$refs.refCustomPopupToElem as HTMLDivElement
123
+ if (customPopupToElem && customPopupToElem.parentElement !== cpToElem) {
124
+ cpToElem.appendChild(customPopupToElem)
125
+ }
126
+ }
127
+ if (internalData.customPopupToElem !== cpToElem) {
128
+ reactData.ctPopupFlag++
129
+ }
130
+ internalData.customPopupToElem = cpToElem
65
131
  customStore.visible = true
66
132
  initStore.custom = true
67
133
  $xeTable.handleUpdateCustomColumn()
@@ -364,6 +430,11 @@ export default {
364
430
  customStore.oldVisibleMaps = visibleMaps
365
431
  reactData.customColumnList = collectColumn.slice(0)
366
432
  }
433
+ },
434
+ handleCustomStyle () {
435
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
436
+
437
+ return updatePopupStyle($xeTable)
367
438
  }
368
439
  } as any
369
440
  }
@@ -2,12 +2,12 @@ import { CreateElement, VNode, PropType } from 'vue'
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
9
  import type { VxeTableDefines, VxeTableConstructor, VxeTablePrivateMethods, TableReactData, TableInternalData, VxeColumnPropTypes, VxeTableCustomPanelConstructor, TableCustomPanelReactData, TableCustomPanelInternalData } from '../../../../types'
10
- import type { VxeButtonDefines, VxeRadioGroupDefines, VxeComponentStyleType } from 'vxe-pc-ui'
10
+ import type { VxeButtonDefines, VxeRadioGroupDefines } from 'vxe-pc-ui'
11
11
 
12
12
  const { getI18n, getIcon, renderEmptyElement } = VxeUI
13
13
 
@@ -389,11 +389,18 @@ export default /* define-vxe-component start */ defineVxeComponent({
389
389
  },
390
390
  sortDragstartEvent (evnt: any) {
391
391
  const $xeTableCustomPanel = this
392
+ const $xeTable = $xeTableCustomPanel.$xeTable
393
+ const tableReactData = $xeTable as unknown as TableReactData
392
394
  const customPanelInternalData = $xeTableCustomPanel.internalData
393
395
 
396
+ const { customDragTime } = customPanelInternalData
394
397
  if (evnt.dataTransfer) {
395
398
  evnt.dataTransfer.setDragImage(getTpImg(), 0, 0)
396
399
  }
400
+ if (customDragTime) {
401
+ clearTimeout(customDragTime)
402
+ }
403
+ tableReactData.isCustomDragStatus = true
397
404
  customPanelInternalData.prevDragGroupField = null
398
405
  customPanelInternalData.prevDragAggFnColid = null
399
406
  },
@@ -582,6 +589,10 @@ export default /* define-vxe-component start */ defineVxeComponent({
582
589
  tableReactData.customColumnList = collectColumn.slice(0)
583
590
  $xeTable.handleColDragSwapColumn()
584
591
  }
592
+ customPanelInternalData.customDragTime = setTimeout(() => {
593
+ tableReactData.isCustomDragStatus = false
594
+ customPanelInternalData.customDragTime = undefined
595
+ }, 350)
585
596
  }).catch(() => {
586
597
  })
587
598
  }
@@ -697,13 +708,14 @@ export default /* define-vxe-component start */ defineVxeComponent({
697
708
 
698
709
  const { customStore } = props
699
710
  const { treeConfig, rowGroupConfig, aggregateConfig } = tableProps
700
- const { isCustomStatus, customColumnList } = tableReactData
711
+ const { isCustomStatus, customColumnList, isCustomDragStatus } = tableReactData
701
712
  const customOpts = $xeTable.computeCustomOpts
702
713
  const { immediate } = customOpts
703
714
  const columnDragOpts = $xeTable.computeColumnDragOpts
704
- const { maxHeight, popupTop } = customStore
715
+ const { popupStyle } = customStore
705
716
  const { checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, trigger, placement } = customOpts
706
717
  const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn
718
+ const vSize = $xeTable.computeSize
707
719
  const { isCrossDrag } = columnDragOpts
708
720
  const slots = customOpts.slots || {}
709
721
  const headerSlot = slots.header
@@ -858,20 +870,14 @@ export default /* define-vxe-component start */ defineVxeComponent({
858
870
  )
859
871
  }
860
872
  })
861
- const popupStys: VxeComponentStyleType = {}
862
- if (maxHeight && !['left', 'right'].includes(placement || '')) {
863
- if (popupTop) {
864
- popupStys.top = toCssUnit(popupTop)
865
- }
866
- popupStys.maxHeight = toCssUnit(maxHeight)
867
- }
868
873
  return h('div', {
869
874
  ref: 'refElem',
870
875
  key: 'simple',
871
876
  class: ['vxe-table-custom-wrapper', `placement--${placement}`, {
877
+ [`size--${vSize}`]: vSize,
872
878
  'is--active': customStore.visible
873
879
  }],
874
- style: popupStys
880
+ style: popupStyle
875
881
  }, customStore.visible
876
882
  ? [
877
883
  h('div', {
@@ -941,7 +947,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
941
947
  : h('transition-group', {
942
948
  class: 'vxe-table-custom--panel-list',
943
949
  props: {
944
- name: 'vxe-table-custom--list',
950
+ name: isCustomDragStatus ? 'vxe-table-custom--list' : '',
945
951
  tag: 'ul'
946
952
  },
947
953
  on: customWrapperOns
@@ -362,12 +362,10 @@ export default {
362
362
  moveCurrentRow (isUpArrow: boolean, isDwArrow: boolean, evnt: any) {
363
363
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
364
364
  const props = $xeTable
365
- const reactData = $xeTable as unknown as TableReactData
366
365
  const internalData = $xeTable as unknown as TableInternalData
367
366
 
368
367
  const { treeConfig } = props
369
- const { currentRow } = reactData
370
- const { afterFullData } = internalData
368
+ const { afterFullData, currentRow } = internalData
371
369
  const treeOpts = $xeTable.computeTreeOpts
372
370
  const childrenField = treeOpts.children || treeOpts.childrenField
373
371
  let targetRow
@@ -350,6 +350,18 @@ function renderTdColumn (
350
350
  if (treeConfig) {
351
351
  tdVNs.push(...renderLine(h, $xeTable, rowid, cellParams, cellHeight))
352
352
  }
353
+ const clVNs: VxeComponentSlotType[] = []
354
+ if (!isVNPreEmptyStatus) {
355
+ clVNs.push(
356
+ h('div', {
357
+ attrs: {
358
+ colid,
359
+ rowid
360
+ },
361
+ class: 'vxe-cell--wrapper vxe-body-cell--wrapper'
362
+ }, column.renderCell(h, cellParams))
363
+ )
364
+ }
353
365
  tdVNs.push(
354
366
  h('div', {
355
367
  key: 'tc',
@@ -362,17 +374,7 @@ function renderTdColumn (
362
374
  attrs: {
363
375
  title: showTitle ? $xeTable.getCellLabel(row, column) : null
364
376
  }
365
- }, isVNPreEmptyStatus
366
- ? []
367
- : [
368
- h('div', {
369
- attrs: {
370
- colid,
371
- rowid
372
- },
373
- class: 'vxe-cell--wrapper vxe-body-cell--wrapper'
374
- }, column.renderCell(h, cellParams))
375
- ])
377
+ }, clVNs)
376
378
  )
377
379
  if (showValidTip && errorValidItem) {
378
380
  const errRule = errorValidItem.rule
@@ -485,8 +487,8 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
485
487
  const $xeGantt = $xeTable.$xeGantt
486
488
 
487
489
  const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps
488
- const { hasFixedColumn, treeExpandedFlag, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, rowExpandHeightFlag, isRowGroupStatus } = tableReactData
489
- const { fullAllDataRowIdData, fullColumnIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps } = tableInternalData
490
+ const { hasFixedColumn, treeExpandedFlag, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, rowExpandHeightFlag, isRowGroupStatus } = tableReactData
491
+ const { fullAllDataRowIdData, fullColumnIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps, currentRow } = tableInternalData
490
492
  const checkboxOpts = $xeTable.computeCheckboxOpts
491
493
  const radioOpts = $xeTable.computeRadioOpts
492
494
  const treeOpts = $xeTable.computeTreeOpts
@@ -577,7 +579,8 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
577
579
  'row--radio': radioOpts.highlight && selectRadioRow === row,
578
580
  'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
579
581
  'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid],
580
- 'row--group': hasRowGroupAggregate
582
+ 'row--group': hasRowGroupAggregate,
583
+ 'row--current': currentRow && rowid === getRowid($xeTable, currentRow)
581
584
  },
582
585
  rowClassName ? (XEUtils.isFunction(rowClassName) ? rowClassName(params) : rowClassName) : ''
583
586
  ]
@@ -591,7 +594,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
591
594
  rowid
592
595
  },
593
596
  style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) as VxeComponentStyleType : undefined,
594
- key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || isRowGroupStatus || treeConfig ? rowid : $rowIndex,
597
+ key: rowKey || rowOpts.useKey || rowOpts.drag || columnOpts.drag || isRowGroupStatus || treeConfig ? rowid : $rowIndex,
595
598
  on: trOn
596
599
  }, tdVNs)
597
600
  )
@@ -1006,8 +1006,8 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
1006
1006
  const internalData = $xeTable as unknown as TableInternalData
1007
1007
 
1008
1008
  const { mouseConfig } = props
1009
- const { isGroup, currentRow, tableColumn, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isColLoading } = reactData
1010
- const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData
1009
+ const { isGroup, tableColumn, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isColLoading } = reactData
1010
+ const { visibleColumn, tableHeight, elemStore, currentRow, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData
1011
1011
  const $xeGanttView = internalData.xeGanttView
1012
1012
  const el = $xeTable.$refs.refElem as HTMLDivElement
1013
1013
  if (!el || (internalData.tBodyHeight && !el.clientHeight)) {
@@ -1636,8 +1636,8 @@ function handleReserveStatus ($xeTable: VxeTableConstructor & VxeTablePrivateMet
1636
1636
  const internalData = $xeTable as unknown as TableInternalData
1637
1637
 
1638
1638
  const { treeConfig } = props
1639
- const { expandColumn, currentRow, selectRadioRow } = reactData
1640
- const { fullDataRowIdData, fullAllDataRowIdData, radioReserveRow, selectCheckboxMaps, treeExpandedMaps, rowExpandedMaps } = internalData
1639
+ const { expandColumn, selectRadioRow } = reactData
1640
+ const { fullDataRowIdData, fullAllDataRowIdData, radioReserveRow, selectCheckboxMaps, treeExpandedMaps, rowExpandedMaps, currentRow } = internalData
1641
1641
  const expandOpts = $xeTable.computeExpandOpts
1642
1642
  const treeOpts = $xeTable.computeTreeOpts
1643
1643
  const radioOpts = $xeTable.computeRadioOpts
@@ -1661,7 +1661,7 @@ function handleReserveStatus ($xeTable: VxeTableConstructor & VxeTablePrivateMet
1661
1661
  handleCheckedCheckboxRow($xeTable, handleReserveRow($xeTable, internalData.checkboxReserveRowMap), true, true)
1662
1662
  }
1663
1663
  if (currentRow && !fullAllDataRowIdData[getRowid($xeTable, currentRow)]) {
1664
- reactData.currentRow = null // 刷新当前行状态
1664
+ internalData.currentRow = null // 刷新当前行状态
1665
1665
  }
1666
1666
  // 行展开
1667
1667
  internalData.rowExpandedMaps = expandColumn ? getRecoverRowMaps($xeTable, rowExpandedMaps) : {} // 刷新行展开状态
@@ -3135,9 +3135,11 @@ function handleRecalculateStyle ($xeTable: VxeTableConstructor & VxeTablePrivate
3135
3135
  }
3136
3136
 
3137
3137
  function handleLazyRecalculate ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, reFull: boolean, reWidth: boolean, reHeight: boolean) {
3138
+ const reactData = $xeTable as unknown as TableReactData
3138
3139
  const internalData = $xeTable as unknown as TableInternalData
3139
3140
 
3140
3141
  return new Promise<void>(resolve => {
3142
+ const { customStore } = reactData
3141
3143
  const { rceTimeout, rceRunTime } = internalData
3142
3144
  const $xeGanttView = internalData.xeGanttView
3143
3145
  const resizeOpts = $xeTable.computeResizeOpts
@@ -3147,6 +3149,9 @@ function handleLazyRecalculate ($xeTable: VxeTableConstructor & VxeTablePrivateM
3147
3149
  autoCellWidth($xeTable)
3148
3150
  updateRowExpandStyle($xeTable)
3149
3151
  }
3152
+ if (customStore.visible && $xeTable.handleCustomStyle) {
3153
+ $xeTable.handleCustomStyle()
3154
+ }
3150
3155
  if (rceTimeout) {
3151
3156
  clearTimeout(rceTimeout)
3152
3157
  if (rceRunTime && rceRunTime + (refreshDelay - 5) < Date.now()) {
@@ -4432,6 +4437,23 @@ function handleColumnVisible (visible: boolean) {
4432
4437
  }
4433
4438
  }
4434
4439
 
4440
+ function reUpdateCustomStyleEvent ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, evnt: MouseEvent) {
4441
+ const reactData = $xeTable as unknown as TableReactData
4442
+
4443
+ const { customStore } = reactData
4444
+ const customOpts = $xeTable.computeCustomOpts
4445
+ const { popupOptions } = customOpts
4446
+ const { transfer } = popupOptions || {}
4447
+ if (transfer && customStore.visible) {
4448
+ const tableCustom = $xeTable.$refs.refTableCustom as Vue
4449
+ if (tableCustom && $xeTable.handleCustomStyle && !checkTargetElement(evnt.target, [tableCustom.$el as HTMLDivElement], evnt.currentTarget)) {
4450
+ $xeTable.handleCustomStyle().then(() => {
4451
+ $xeTable.handleCustomStyle()
4452
+ })
4453
+ }
4454
+ }
4455
+ }
4456
+
4435
4457
  const tableMethods: any = {
4436
4458
  callSlot (slotFunc: any, params: any, h: any, vNodes: any) {
4437
4459
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
@@ -7151,6 +7173,11 @@ const tableMethods: any = {
7151
7173
  $xeTable.closeFilter()
7152
7174
  $xeTable.closeMenu()
7153
7175
  },
7176
+ handleGlobalScrollEvent (evnt: MouseEvent) {
7177
+ const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
7178
+
7179
+ reUpdateCustomStyleEvent($xeTable, evnt)
7180
+ },
7154
7181
  /**
7155
7182
  * 全局滚动事件
7156
7183
  */
@@ -7158,7 +7185,9 @@ const tableMethods: any = {
7158
7185
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
7159
7186
 
7160
7187
  $xeTable.closeTooltip()
7161
- $xeTable.closeMenu()
7188
+ if ($xeTable.closeMenu) {
7189
+ $xeTable.closeMenu()
7190
+ }
7162
7191
  },
7163
7192
  /**
7164
7193
  * 表格键盘事件
@@ -7217,8 +7246,8 @@ const tableMethods: any = {
7217
7246
  if (internalData.isActivated) {
7218
7247
  $xeTable.preventEvent(evnt, 'event.keydown', null, () => {
7219
7248
  const { mouseConfig, keyboardConfig, treeConfig, editConfig, highlightCurrentRow, highlightCurrentColumn } = props
7220
- const { ctxMenuStore, editStore, currentRow } = reactData
7221
- const { afterFullData, visibleColumn } = internalData
7249
+ const { ctxMenuStore, editStore } = reactData
7250
+ const { afterFullData, visibleColumn, currentRow } = internalData
7222
7251
  const isContentMenu = $xeTable.computeIsContentMenu
7223
7252
  const bodyMenu = $xeTable.computeBodyMenu
7224
7253
  const keyboardOpts = $xeTable.computeKeyboardOpts
@@ -8672,9 +8701,9 @@ const tableMethods: any = {
8672
8701
  },
8673
8702
  triggerCurrentRowEvent (evnt: Event, params: any) {
8674
8703
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
8675
- const reactData = $xeTable as unknown as TableReactData
8704
+ const internalData = $xeTable as unknown as TableInternalData
8676
8705
 
8677
- const { currentRow: oldValue } = reactData
8706
+ const { currentRow: oldValue } = internalData
8678
8707
  const rowOpts = $xeTable.computeRowOpts
8679
8708
  const currentRowOpts = $xeTable.computeCurrentRowOpts
8680
8709
  const beforeRowMethod = currentRowOpts.beforeSelectMethod || rowOpts.currentMethod as any
@@ -8781,12 +8810,11 @@ const tableMethods: any = {
8781
8810
  */
8782
8811
  clearCurrentRow () {
8783
8812
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
8784
- const reactData = $xeTable as unknown as TableReactData
8785
8813
  const internalData = $xeTable as unknown as TableInternalData
8786
8814
 
8787
8815
  const $xeGanttView = internalData.xeGanttView
8788
8816
  const el = $xeTable.$refs.refElem as HTMLDivElement
8789
- reactData.currentRow = null
8817
+ internalData.currentRow = null
8790
8818
  internalData.hoverRow = null
8791
8819
  if (el) {
8792
8820
  XEUtils.arrayEach(el.querySelectorAll('.row--current'), elem => removeClass(elem, 'row--current'))
@@ -8809,11 +8837,9 @@ const tableMethods: any = {
8809
8837
  getCurrentRecord (isFull?: boolean) {
8810
8838
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
8811
8839
  const props = $xeTable
8812
- const reactData = $xeTable as unknown as TableReactData
8813
8840
  const internalData = $xeTable as unknown as TableInternalData
8814
8841
 
8815
- const { currentRow } = reactData
8816
- const { fullDataRowIdData, afterFullRowMaps } = internalData
8842
+ const { fullDataRowIdData, afterFullRowMaps, currentRow } = internalData
8817
8843
  const rowOpts = $xeTable.computeRowOpts
8818
8844
  if (rowOpts.isCurrent || props.highlightCurrentRow) {
8819
8845
  const rowid = getRowid($xeTable, currentRow)
@@ -12310,7 +12336,7 @@ const tableMethods: any = {
12310
12336
  rowExpandYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : ''
12311
12337
  }
12312
12338
  reactData.scrollYTop = scrollYTop
12313
- reactData.scrollYHeight = ySpaceHeight
12339
+ reactData.scrollYHeight = isScrollYBig ? sYHeight : ySpaceHeight
12314
12340
  reactData.isScrollYBig = isScrollYBig
12315
12341
 
12316
12342
  calcScrollbar($xeTable)
@@ -12383,18 +12409,26 @@ const tableMethods: any = {
12383
12409
  },
12384
12410
  /**
12385
12411
  * 如果有滚动条,则滚动到对应的行
12386
- * @param {Row} row 行对象
12387
- * @param {ColumnInfo} column 列配置
12388
12412
  */
12389
- scrollToRow (row: any, fieldOrColumn?: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo, options?: VxeTableDefines.ScrollToRowConfig) {
12413
+ scrollToRow (rowOrRowid: any, fieldOrColumn?: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo, options?: VxeTableDefines.ScrollToRowConfig) {
12390
12414
  const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
12391
12415
  const props = $xeTable
12392
12416
  const reactData = $xeTable as unknown as TableReactData
12393
12417
  const internalData = $xeTable as unknown as TableInternalData
12394
12418
 
12395
12419
  const { isAllOverflow, scrollYLoad, scrollXLoad } = reactData
12396
- const { _sToTime } = internalData
12420
+ const { fullAllDataRowIdData, _sToTime } = internalData
12397
12421
  const rest = []
12422
+ let row: any
12423
+ if (XEUtils.isString(rowOrRowid) || XEUtils.isNumber(rowOrRowid)) {
12424
+ const rowid = rowOrRowid
12425
+ const rowRest = rowid ? fullAllDataRowIdData[rowid] : null
12426
+ if (rowRest) {
12427
+ row = rowRest.row
12428
+ }
12429
+ } else {
12430
+ row = rowOrRowid
12431
+ }
12398
12432
  if (row) {
12399
12433
  if (props.treeConfig) {
12400
12434
  rest.push($xeTable.scrollToTreeRow(row))
@@ -1953,6 +1953,7 @@ export default {
1953
1953
  globalEvents.on($xeTable, 'mousewheel', this.handleGlobalMousewheelEvent)
1954
1954
  globalEvents.on($xeTable, 'keydown', this.handleGlobalKeydownEvent)
1955
1955
  globalEvents.on($xeTable, 'resize', this.handleGlobalResizeEvent)
1956
+ globalEvents.on($xeTable, 'scroll', this.handleGlobalScrollEvent)
1956
1957
  globalEvents.on($xeTable, 'contextmenu', this.handleGlobalContextmenuEvent)
1957
1958
  $xeTable.preventEvent(null, 'created')
1958
1959
  },
@@ -2096,6 +2097,10 @@ export default {
2096
2097
  if (popupWrapperEl && popupWrapperEl.parentElement) {
2097
2098
  popupWrapperEl.parentElement.removeChild(popupWrapperEl)
2098
2099
  }
2100
+ const customPopupToElem = $xeTable.$refs.refCustomPopupToElem as HTMLDivElement
2101
+ if (customPopupToElem && customPopupToElem.parentElement) {
2102
+ customPopupToElem.parentElement.removeChild(customPopupToElem)
2103
+ }
2099
2104
 
2100
2105
  const tableViewportEl = $xeTable.$refs.refTableViewportElem as HTMLDivElement
2101
2106
  if (tableViewportEl) {
@@ -2118,6 +2123,7 @@ export default {
2118
2123
  globalEvents.off($xeTable, 'mousewheel')
2119
2124
  globalEvents.off($xeTable, 'keydown')
2120
2125
  globalEvents.off($xeTable, 'resize')
2126
+ globalEvents.off($xeTable, 'scroll')
2121
2127
  globalEvents.off($xeTable, 'contextmenu')
2122
2128
 
2123
2129
  $xeTable.preventEvent(null, 'beforeDestroy')
@@ -2175,8 +2181,6 @@ export default {
2175
2181
  const columnDragOpts = $xeTable.computeColumnDragOpts
2176
2182
  const scrollbarXToTop = $xeTable.computeScrollbarXToTop
2177
2183
  const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft
2178
- const customSimpleMode = $xeTable.computeCustomSimpleMode
2179
- const showCustomSimpleOutside = customSimpleMode === 'outside'
2180
2184
  const { isCrossTableDrag } = rowDragOpts
2181
2185
  const tbOns: {
2182
2186
  contextmenu: (...args: any[]) => void
@@ -2329,18 +2333,6 @@ export default {
2329
2333
  })
2330
2334
  ]
2331
2335
  : []),
2332
- /**
2333
- * 自定义列
2334
- */
2335
- !showCustomSimpleOutside && initStore.custom
2336
- ? h(TableCustomPanelComponent, {
2337
- key: 'cs',
2338
- ref: 'refTableCustom',
2339
- props: {
2340
- customStore
2341
- }
2342
- })
2343
- : renderEmptyElement($xeTable),
2344
2336
  /**
2345
2337
  * 加载中
2346
2338
  */
@@ -2373,15 +2365,16 @@ export default {
2373
2365
  ])
2374
2366
  ]),
2375
2367
  h('div', {
2376
- key: 'tpw'
2368
+ key: 'fpw',
2369
+ ref: 'refCustomContainerElem'
2377
2370
  }, [
2378
2371
  h('div', {
2379
- ref: 'refPopupWrapperElem'
2372
+ ref: 'refCustomPopupToElem'
2380
2373
  }, [
2381
2374
  /**
2382
2375
  * 自定义列
2383
2376
  */
2384
- showCustomSimpleOutside && initStore.custom
2377
+ initStore.custom
2385
2378
  ? h(TableCustomPanelComponent, {
2386
2379
  key: 'cs',
2387
2380
  ref: 'refTableCustom',
@@ -2389,7 +2382,15 @@ export default {
2389
2382
  customStore
2390
2383
  }
2391
2384
  })
2392
- : renderEmptyElement($xeTable),
2385
+ : renderEmptyElement($xeTable)
2386
+ ])
2387
+ ]),
2388
+ h('div', {
2389
+ key: 'tpw'
2390
+ }, [
2391
+ h('div', {
2392
+ ref: 'refPopupWrapperElem'
2393
+ }, [
2393
2394
  /**
2394
2395
  * 筛选
2395
2396
  */
@@ -2469,7 +2470,10 @@ export default {
2469
2470
  minWidth: tableTipConfig.minWidth,
2470
2471
  minHeight: tableTipConfig.minHeight,
2471
2472
  maxWidth: tableTipConfig.maxWidth,
2472
- maxHeight: tableTipConfig.maxHeight
2473
+ maxHeight: tableTipConfig.maxHeight,
2474
+ placement: tableTipConfig.placement,
2475
+ defaultPlacement: tableTipConfig.defaultPlacement,
2476
+ popupClassName: tableTipConfig.popupClassName
2473
2477
  },
2474
2478
  scopedSlots: currTooltipSlot
2475
2479
  ? {
@@ -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,6 +145,7 @@ 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
 
@@ -188,8 +192,6 @@ export function createReactData (): TableReactData {
188
192
  isAllSelected: false,
189
193
  // 复选框属性,有选中且非全选状态
190
194
  isIndeterminate: false,
191
- // 当前行
192
- currentRow: null,
193
195
  // 单选框属性,选中列
194
196
  currentColumn: null,
195
197
  // 单选框属性,选中行
@@ -225,7 +227,7 @@ export function createReactData (): TableReactData {
225
227
  activeWrapper: false,
226
228
  visible: false,
227
229
  maxHeight: null,
228
- popupTop: 0,
230
+ popupStyle: {},
229
231
  oldSortMaps: {},
230
232
  oldFixedMaps: {},
231
233
  oldVisibleMaps: {}
@@ -395,6 +397,8 @@ export function createReactData (): TableReactData {
395
397
  resizeWidthFlag: 1,
396
398
 
397
399
  isCustomStatus: false,
400
+ isCustomDragStatus: true,
401
+ ctPopupFlag: 1,
398
402
 
399
403
  isCrossDragRow: false,
400
404
  dragRow: null,
@@ -73,7 +73,8 @@ VxeUI.setConfig({
73
73
  strict: true
74
74
  },
75
75
  tooltipConfig: {
76
- enterable: true
76
+ enterable: true,
77
+ defaultPlacement: 'top'
77
78
  },
78
79
  headerTooltipConfig: {
79
80
  enterable: true