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.
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/hook.js +69 -6
- package/es/table/module/custom/panel.js +19 -14
- package/es/table/module/keyboard/hook.js +1 -2
- package/es/table/src/body.js +3 -2
- package/es/table/src/header.js +3 -1
- package/es/table/src/table.js +85 -40
- package/es/table/src/util.js +7 -3
- package/es/table/style.css +14 -0
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +14 -0
- package/es/vxe-table/style.min.css +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +141 -59
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/hook.js +76 -6
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/custom/panel.js +21 -13
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +1 -3
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/src/body.js +4 -2
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/header.js +7 -5
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/table.js +23 -25
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +7 -3
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +14 -0
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +14 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/module/custom/hook.ts +70 -7
- package/packages/table/module/custom/panel.ts +20 -15
- package/packages/table/module/keyboard/hook.ts +1 -2
- package/packages/table/src/body.ts +3 -2
- package/packages/table/src/header.ts +3 -1
- package/packages/table/src/table.ts +88 -41
- package/packages/table/src/util.ts +9 -3
- package/styles/components/table-module/custom.scss +14 -0
- /package/es/{iconfont.1774663263220.ttf → iconfont.1776048383631.ttf} +0 -0
- /package/es/{iconfont.1774663263220.woff → iconfont.1776048383631.woff} +0 -0
- /package/es/{iconfont.1774663263220.woff2 → iconfont.1776048383631.woff2} +0 -0
- /package/lib/{iconfont.1774663263220.ttf → iconfont.1776048383631.ttf} +0 -0
- /package/lib/{iconfont.1774663263220.woff → iconfont.1776048383631.woff} +0 -0
- /package/lib/{iconfont.1774663263220.woff2 → iconfont.1776048383631.woff2} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxe-table",
|
|
3
|
-
"version": "4.18.
|
|
3
|
+
"version": "4.18.12",
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
50
|
-
|
|
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
|
|
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
|
|
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 {
|
|
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:
|
|
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 } =
|
|
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
|
|
@@ -492,7 +492,7 @@ export default defineVxeComponent({
|
|
|
492
492
|
|
|
493
493
|
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps
|
|
494
494
|
const { hasFixedColumn, treeExpandedFlag, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, rowExpandHeightFlag, isRowGroupStatus } = tableReactData
|
|
495
|
-
const { fullAllDataRowIdData, fullColumnIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps } = tableInternalData
|
|
495
|
+
const { fullAllDataRowIdData, fullColumnIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps, currentRow } = tableInternalData
|
|
496
496
|
const checkboxOpts = computeCheckboxOpts.value
|
|
497
497
|
const radioOpts = computeRadioOpts.value
|
|
498
498
|
const treeOpts = computeTreeOpts.value
|
|
@@ -582,7 +582,8 @@ export default defineVxeComponent({
|
|
|
582
582
|
'row--radio': radioOpts.highlight && $xeTable.eqRow(selectRadioRow, row),
|
|
583
583
|
'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
584
584
|
'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid],
|
|
585
|
-
'row--group': hasRowGroupAggregate
|
|
585
|
+
'row--group': hasRowGroupAggregate,
|
|
586
|
+
'row--current': currentRow && rowid === getRowid($xeTable, currentRow)
|
|
586
587
|
},
|
|
587
588
|
getPropClass(rowClassName, params)
|
|
588
589
|
]
|
|
@@ -53,7 +53,9 @@ export default defineVxeComponent({
|
|
|
53
53
|
spanColumns = visibleColgroups
|
|
54
54
|
}
|
|
55
55
|
headerColumn.value = spanColumns
|
|
56
|
-
|
|
56
|
+
nextTick(() => {
|
|
57
|
+
$xeTable.dispatchEvent('columns-change', { visibleColgroups, collectColumn, visibleColumn }, null)
|
|
58
|
+
})
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
const renderRows = (isGroup: boolean, isOptimizeMode: boolean, headerGroups: VxeTableDefines.ColumnInfo[][], $rowIndex: number, cols: VxeTableDefines.ColumnInfo[]) => {
|
|
@@ -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,
|
|
@@ -2086,10 +2088,13 @@ export default defineVxeComponent({
|
|
|
2086
2088
|
const { treeConfig } = props
|
|
2087
2089
|
const { tableData, isAllOverflow, scrollYLoad, scrollXLoad } = reactData
|
|
2088
2090
|
const { fullAllDataRowIdData } = internalData
|
|
2091
|
+
const el = refElem.value
|
|
2092
|
+
if (!el || !el.clientWidth) {
|
|
2093
|
+
return
|
|
2094
|
+
}
|
|
2089
2095
|
const treeOpts = computeTreeOpts.value
|
|
2090
2096
|
const defaultRowHeight = computeDefaultRowHeight.value
|
|
2091
|
-
|
|
2092
|
-
if (el && !isAllOverflow && (scrollYLoad || scrollXLoad || (treeConfig && treeOpts.showLine))) {
|
|
2097
|
+
if (!isAllOverflow && (scrollYLoad || scrollXLoad || (treeConfig && treeOpts.showLine))) {
|
|
2093
2098
|
const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
2094
2099
|
el.setAttribute('data-calc-row', 'Y')
|
|
2095
2100
|
tableData.forEach(row => {
|
|
@@ -2480,8 +2485,8 @@ export default defineVxeComponent({
|
|
|
2480
2485
|
|
|
2481
2486
|
const updateStyle = () => {
|
|
2482
2487
|
const { mouseConfig } = props
|
|
2483
|
-
const { isGroup,
|
|
2484
|
-
const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData
|
|
2488
|
+
const { isGroup, tableColumn, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isColLoading } = reactData
|
|
2489
|
+
const { visibleColumn, tableHeight, elemStore, currentRow, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData
|
|
2485
2490
|
const $xeGanttView = internalData.xeGanttView
|
|
2486
2491
|
const el = refElem.value
|
|
2487
2492
|
if (!el || (internalData.tBodyHeight && !el.clientHeight)) {
|
|
@@ -2913,7 +2918,7 @@ export default defineVxeComponent({
|
|
|
2913
2918
|
}
|
|
2914
2919
|
}
|
|
2915
2920
|
|
|
2916
|
-
const handleCheckedRadioRow = (row: any, isForce
|
|
2921
|
+
const handleCheckedRadioRow = (row: any, isForce: boolean) => {
|
|
2917
2922
|
const radioOpts = computeRadioOpts.value
|
|
2918
2923
|
const { checkMethod } = radioOpts
|
|
2919
2924
|
if (row && (isForce || (!checkMethod || checkMethod({ $table: $xeTable, row })))) {
|
|
@@ -3085,8 +3090,8 @@ export default defineVxeComponent({
|
|
|
3085
3090
|
// 还原展开、选中等相关状态
|
|
3086
3091
|
const handleReserveStatus = () => {
|
|
3087
3092
|
const { treeConfig } = props
|
|
3088
|
-
const { expandColumn,
|
|
3089
|
-
const { fullDataRowIdData, fullAllDataRowIdData, radioReserveRow, selectCheckboxMaps, treeExpandedMaps, rowExpandedMaps } = internalData
|
|
3093
|
+
const { expandColumn, selectRadioRow } = reactData
|
|
3094
|
+
const { fullDataRowIdData, fullAllDataRowIdData, radioReserveRow, selectCheckboxMaps, treeExpandedMaps, rowExpandedMaps, currentRow } = internalData
|
|
3090
3095
|
const expandOpts = computeExpandOpts.value
|
|
3091
3096
|
const treeOpts = computeTreeOpts.value
|
|
3092
3097
|
const radioOpts = computeRadioOpts.value
|
|
@@ -3110,7 +3115,7 @@ export default defineVxeComponent({
|
|
|
3110
3115
|
handleCheckedCheckboxRow(handleReserveRow(internalData.checkboxReserveRowMap), true, true)
|
|
3111
3116
|
}
|
|
3112
3117
|
if (currentRow && !fullAllDataRowIdData[getRowid($xeTable, currentRow)]) {
|
|
3113
|
-
|
|
3118
|
+
internalData.currentRow = null // 刷新当前行状态
|
|
3114
3119
|
}
|
|
3115
3120
|
// 行展开
|
|
3116
3121
|
internalData.rowExpandedMaps = expandColumn ? getRecoverRowMaps(rowExpandedMaps) : {} // 刷新行展开状态
|
|
@@ -3348,6 +3353,10 @@ export default defineVxeComponent({
|
|
|
3348
3353
|
const { scrollXWidth, scrollYHeight } = reactData
|
|
3349
3354
|
const { elemStore } = internalData
|
|
3350
3355
|
const scrollbarOpts = computeScrollbarOpts.value
|
|
3356
|
+
const el = refElem.value
|
|
3357
|
+
if (!el || !el.clientWidth) {
|
|
3358
|
+
return
|
|
3359
|
+
}
|
|
3351
3360
|
const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper'])
|
|
3352
3361
|
const headerTableElem = getRefElem(elemStore['main-header-table'])
|
|
3353
3362
|
const footerTableElem = getRefElem(elemStore['main-footer-table'])
|
|
@@ -3435,6 +3444,7 @@ export default defineVxeComponent({
|
|
|
3435
3444
|
const handleLazyRecalculate = (reFull: boolean, reWidth: boolean, reHeight: boolean) => {
|
|
3436
3445
|
return new Promise<void>(resolve => {
|
|
3437
3446
|
const $xeGanttView = internalData.xeGanttView
|
|
3447
|
+
const { customStore } = reactData
|
|
3438
3448
|
const { rceTimeout, rceRunTime } = internalData
|
|
3439
3449
|
const resizeOpts = computeResizeOpts.value
|
|
3440
3450
|
const refreshDelay = resizeOpts.refreshDelay || 20
|
|
@@ -3443,6 +3453,9 @@ export default defineVxeComponent({
|
|
|
3443
3453
|
autoCellWidth()
|
|
3444
3454
|
updateRowExpandStyle()
|
|
3445
3455
|
}
|
|
3456
|
+
if (customStore.visible && $xeTable.handleCustomStyle) {
|
|
3457
|
+
$xeTable.handleCustomStyle()
|
|
3458
|
+
}
|
|
3446
3459
|
if (rceTimeout) {
|
|
3447
3460
|
clearTimeout(rceTimeout)
|
|
3448
3461
|
if (rceRunTime && rceRunTime + (refreshDelay - 5) < Date.now()) {
|
|
@@ -4624,6 +4637,10 @@ export default defineVxeComponent({
|
|
|
4624
4637
|
|
|
4625
4638
|
const updateColumnOffsetLeft = () => {
|
|
4626
4639
|
const { visibleColumn, fullColumnIdData } = internalData
|
|
4640
|
+
const el = refElem.value
|
|
4641
|
+
if (!el || !el.clientWidth) {
|
|
4642
|
+
return
|
|
4643
|
+
}
|
|
4627
4644
|
let offsetLeft = 0
|
|
4628
4645
|
for (let cIndex = 0, rLen = visibleColumn.length; cIndex < rLen; cIndex++) {
|
|
4629
4646
|
const column = visibleColumn[cIndex]
|
|
@@ -4639,6 +4656,10 @@ export default defineVxeComponent({
|
|
|
4639
4656
|
const updateRowOffsetTop = () => {
|
|
4640
4657
|
const { expandColumn } = reactData
|
|
4641
4658
|
const { afterFullData, fullAllDataRowIdData, rowExpandedMaps } = internalData
|
|
4659
|
+
const el = refElem.value
|
|
4660
|
+
if (!el || !el.clientWidth) {
|
|
4661
|
+
return
|
|
4662
|
+
}
|
|
4642
4663
|
const expandOpts = computeExpandOpts.value
|
|
4643
4664
|
const rowOpts = computeRowOpts.value
|
|
4644
4665
|
const cellOpts = computeCellOpts.value
|
|
@@ -4663,6 +4684,10 @@ export default defineVxeComponent({
|
|
|
4663
4684
|
*/
|
|
4664
4685
|
const updateRowExpandStyle = () => {
|
|
4665
4686
|
const { expandColumn, scrollYLoad, scrollYTop, isScrollYBig } = reactData
|
|
4687
|
+
const el = refElem.value
|
|
4688
|
+
if (!el || !el.clientWidth) {
|
|
4689
|
+
return
|
|
4690
|
+
}
|
|
4666
4691
|
const expandOpts = computeExpandOpts.value
|
|
4667
4692
|
const rowOpts = computeRowOpts.value
|
|
4668
4693
|
const cellOpts = computeCellOpts.value
|
|
@@ -4726,6 +4751,10 @@ export default defineVxeComponent({
|
|
|
4726
4751
|
}
|
|
4727
4752
|
const { tableData } = reactData
|
|
4728
4753
|
const { fullAllDataRowIdData, treeExpandedMaps } = internalData
|
|
4754
|
+
const el = refElem.value
|
|
4755
|
+
if (!el || !el.clientWidth) {
|
|
4756
|
+
return
|
|
4757
|
+
}
|
|
4729
4758
|
const cellOpts = computeCellOpts.value
|
|
4730
4759
|
const rowOpts = computeRowOpts.value
|
|
4731
4760
|
const defaultRowHeight = computeDefaultRowHeight.value
|
|
@@ -6393,7 +6422,7 @@ export default defineVxeComponent({
|
|
|
6393
6422
|
const el = refElem.value
|
|
6394
6423
|
$xeTable.clearCurrentRow()
|
|
6395
6424
|
// $xeTable.clearCurrentColumn()
|
|
6396
|
-
|
|
6425
|
+
internalData.currentRow = row
|
|
6397
6426
|
if (rowOpts.isCurrent || props.highlightCurrentRow) {
|
|
6398
6427
|
if (el) {
|
|
6399
6428
|
XEUtils.arrayEach(el.querySelectorAll(`[rowid="${getRowid($xeTable, row)}"]`), elem => addClass(elem, 'row--current'))
|
|
@@ -6443,7 +6472,7 @@ export default defineVxeComponent({
|
|
|
6443
6472
|
clearCurrentRow () {
|
|
6444
6473
|
const $xeGanttView = internalData.xeGanttView
|
|
6445
6474
|
const el = refElem.value
|
|
6446
|
-
|
|
6475
|
+
internalData.currentRow = null
|
|
6447
6476
|
internalData.hoverRow = null
|
|
6448
6477
|
if (el) {
|
|
6449
6478
|
XEUtils.arrayEach(el.querySelectorAll('.row--current'), elem => removeClass(elem, 'row--current'))
|
|
@@ -6464,8 +6493,7 @@ export default defineVxeComponent({
|
|
|
6464
6493
|
* 用于当前行,获取当前行的数据
|
|
6465
6494
|
*/
|
|
6466
6495
|
getCurrentRecord (isFull) {
|
|
6467
|
-
const { currentRow } =
|
|
6468
|
-
const { fullDataRowIdData, afterFullRowMaps } = internalData
|
|
6496
|
+
const { fullDataRowIdData, afterFullRowMaps, currentRow } = internalData
|
|
6469
6497
|
const rowOpts = computeRowOpts.value
|
|
6470
6498
|
if (rowOpts.isCurrent || props.highlightCurrentRow) {
|
|
6471
6499
|
const rowid = getRowid($xeTable, currentRow)
|
|
@@ -8057,6 +8085,25 @@ export default defineVxeComponent({
|
|
|
8057
8085
|
}
|
|
8058
8086
|
}
|
|
8059
8087
|
|
|
8088
|
+
const reUpdateCustomStyleEvent = (evnt: MouseEvent) => {
|
|
8089
|
+
const { customStore } = reactData
|
|
8090
|
+
const customOpts = computeCustomOpts.value
|
|
8091
|
+
const { popupOptions } = customOpts
|
|
8092
|
+
const { transfer } = popupOptions || {}
|
|
8093
|
+
if (transfer && customStore.visible) {
|
|
8094
|
+
const tableCustom = refTableCustom.value
|
|
8095
|
+
if (tableCustom && $xeTable.handleCustomStyle && !checkTargetElement(evnt.target, [tableCustom.getRefMaps().refElem.value as HTMLDivElement], evnt.currentTarget)) {
|
|
8096
|
+
$xeTable.handleCustomStyle().then(() => {
|
|
8097
|
+
$xeTable.handleCustomStyle()
|
|
8098
|
+
})
|
|
8099
|
+
}
|
|
8100
|
+
}
|
|
8101
|
+
}
|
|
8102
|
+
|
|
8103
|
+
const handleGlobalScrollEvent = (evnt: MouseEvent) => {
|
|
8104
|
+
reUpdateCustomStyleEvent(evnt)
|
|
8105
|
+
}
|
|
8106
|
+
|
|
8060
8107
|
/**
|
|
8061
8108
|
* 全局滚动事件
|
|
8062
8109
|
*/
|
|
@@ -8119,8 +8166,8 @@ export default defineVxeComponent({
|
|
|
8119
8166
|
if (internalData.isActivated) {
|
|
8120
8167
|
$xeTable.preventEvent(evnt, 'event.keydown', null, () => {
|
|
8121
8168
|
const { mouseConfig, keyboardConfig, treeConfig, editConfig, highlightCurrentRow, highlightCurrentColumn } = props
|
|
8122
|
-
const { ctxMenuStore, editStore
|
|
8123
|
-
const { afterFullData, visibleColumn } = internalData
|
|
8169
|
+
const { ctxMenuStore, editStore } = reactData
|
|
8170
|
+
const { afterFullData, visibleColumn, currentRow } = internalData
|
|
8124
8171
|
const isContentMenu = computeIsContentMenu.value
|
|
8125
8172
|
const bodyMenu = computeBodyMenu.value
|
|
8126
8173
|
const keyboardOpts = computeKeyboardOpts.value
|
|
@@ -10361,14 +10408,14 @@ export default defineVxeComponent({
|
|
|
10361
10408
|
let newValue = row
|
|
10362
10409
|
let isChange = oldValue !== newValue
|
|
10363
10410
|
if (strict) {
|
|
10364
|
-
handleCheckedRadioRow(newValue)
|
|
10411
|
+
handleCheckedRadioRow(newValue, false)
|
|
10365
10412
|
} else {
|
|
10366
10413
|
if (oldValue === newValue) {
|
|
10367
10414
|
newValue = null
|
|
10368
10415
|
}
|
|
10369
10416
|
isChange = oldValue !== newValue
|
|
10370
10417
|
if (isChange && newValue) {
|
|
10371
|
-
handleCheckedRadioRow(newValue)
|
|
10418
|
+
handleCheckedRadioRow(newValue, false)
|
|
10372
10419
|
} else {
|
|
10373
10420
|
newValue = null
|
|
10374
10421
|
$xeTable.clearRadioRow()
|
|
@@ -10413,7 +10460,7 @@ export default defineVxeComponent({
|
|
|
10413
10460
|
}
|
|
10414
10461
|
},
|
|
10415
10462
|
triggerCurrentRowEvent (evnt, params) {
|
|
10416
|
-
const { currentRow: oldValue } =
|
|
10463
|
+
const { currentRow: oldValue } = internalData
|
|
10417
10464
|
const rowOpts = computeRowOpts.value
|
|
10418
10465
|
const currentRowOpts = computeCurrentRowOpts.value
|
|
10419
10466
|
const beforeRowMethod = currentRowOpts.beforeSelectMethod || rowOpts.currentMethod as any
|
|
@@ -12470,7 +12517,7 @@ export default defineVxeComponent({
|
|
|
12470
12517
|
rowExpandYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : ''
|
|
12471
12518
|
}
|
|
12472
12519
|
reactData.scrollYTop = scrollYTop
|
|
12473
|
-
reactData.scrollYHeight = ySpaceHeight
|
|
12520
|
+
reactData.scrollYHeight = isScrollYBig ? sYHeight : ySpaceHeight
|
|
12474
12521
|
reactData.isScrollYBig = isScrollYBig
|
|
12475
12522
|
|
|
12476
12523
|
calcScrollbar()
|
|
@@ -13016,7 +13063,7 @@ export default defineVxeComponent({
|
|
|
13016
13063
|
const renderVN = () => {
|
|
13017
13064
|
const { loading, stripe, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules } = props
|
|
13018
13065
|
const { isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, tableData, initStore, isRowGroupStatus, columnStore, filterStore, customStore, tooltipStore } = reactData
|
|
13019
|
-
const { teleportToWrapperElem, popupToWrapperElem } = internalData
|
|
13066
|
+
const { teleportToWrapperElem, popupToWrapperElem, customPopupToElem } = internalData
|
|
13020
13067
|
const { leftList, rightList } = columnStore
|
|
13021
13068
|
const loadingSlot = slots.loading
|
|
13022
13069
|
const tipSlots = {
|
|
@@ -13046,8 +13093,6 @@ export default defineVxeComponent({
|
|
|
13046
13093
|
const columnDragOpts = computeColumnDragOpts.value
|
|
13047
13094
|
const scrollbarXToTop = computeScrollbarXToTop.value
|
|
13048
13095
|
const scrollbarYToLeft = computeScrollbarYToLeft.value
|
|
13049
|
-
const customSimpleMode = computeCustomSimpleMode.value
|
|
13050
|
-
const showCustomSimpleOutside = customSimpleMode === 'outside'
|
|
13051
13096
|
const { isCrossTableDrag } = rowDragOpts
|
|
13052
13097
|
const tbOns: {
|
|
13053
13098
|
onContextmenu: (...args: any[]) => void
|
|
@@ -13198,16 +13243,6 @@ export default defineVxeComponent({
|
|
|
13198
13243
|
})
|
|
13199
13244
|
]
|
|
13200
13245
|
: []),
|
|
13201
|
-
/**
|
|
13202
|
-
* 自定义列
|
|
13203
|
-
*/
|
|
13204
|
-
!showCustomSimpleOutside && initStore.custom
|
|
13205
|
-
? h(TableCustomPanelComponent, {
|
|
13206
|
-
key: 'cs',
|
|
13207
|
-
ref: refTableCustom,
|
|
13208
|
-
customStore
|
|
13209
|
-
})
|
|
13210
|
-
: renderEmptyElement($xeTable),
|
|
13211
13246
|
/**
|
|
13212
13247
|
* 加载中
|
|
13213
13248
|
*/
|
|
@@ -13237,6 +13272,26 @@ export default defineVxeComponent({
|
|
|
13237
13272
|
])
|
|
13238
13273
|
])
|
|
13239
13274
|
]),
|
|
13275
|
+
h('div', {
|
|
13276
|
+
key: 'fpw',
|
|
13277
|
+
ref: refCustomContainerElem
|
|
13278
|
+
}, [
|
|
13279
|
+
h(Teleport, {
|
|
13280
|
+
to: customPopupToElem,
|
|
13281
|
+
disabled: !!reactData.ctPopupFlag && !customPopupToElem
|
|
13282
|
+
}, [
|
|
13283
|
+
/**
|
|
13284
|
+
* 自定义列
|
|
13285
|
+
*/
|
|
13286
|
+
initStore.custom
|
|
13287
|
+
? h(TableCustomPanelComponent, {
|
|
13288
|
+
key: 'cs',
|
|
13289
|
+
ref: refTableCustom,
|
|
13290
|
+
customStore
|
|
13291
|
+
})
|
|
13292
|
+
: renderEmptyElement($xeTable)
|
|
13293
|
+
])
|
|
13294
|
+
]),
|
|
13240
13295
|
h('div', {
|
|
13241
13296
|
key: 'tpw'
|
|
13242
13297
|
}, [
|
|
@@ -13247,16 +13302,6 @@ export default defineVxeComponent({
|
|
|
13247
13302
|
h('div', {
|
|
13248
13303
|
ref: refPopupWrapperElem
|
|
13249
13304
|
}, [
|
|
13250
|
-
/**
|
|
13251
|
-
* 自定义列
|
|
13252
|
-
*/
|
|
13253
|
-
showCustomSimpleOutside && initStore.custom
|
|
13254
|
-
? h(TableCustomPanelComponent, {
|
|
13255
|
-
key: 'cs',
|
|
13256
|
-
ref: refTableCustom,
|
|
13257
|
-
customStore
|
|
13258
|
-
})
|
|
13259
|
-
: renderEmptyElement($xeTable),
|
|
13260
13305
|
/**
|
|
13261
13306
|
* 筛选
|
|
13262
13307
|
*/
|
|
@@ -13937,6 +13982,7 @@ export default defineVxeComponent({
|
|
|
13937
13982
|
globalEvents.on($xeTable, 'mousewheel', handleGlobalMousewheelEvent)
|
|
13938
13983
|
globalEvents.on($xeTable, 'keydown', handleGlobalKeydownEvent)
|
|
13939
13984
|
globalEvents.on($xeTable, 'resize', handleGlobalResizeEvent)
|
|
13985
|
+
globalEvents.on($xeTable, 'scroll', handleGlobalScrollEvent)
|
|
13940
13986
|
globalEvents.on($xeTable, 'contextmenu', $xeTable.handleGlobalContextmenuEvent)
|
|
13941
13987
|
$xeTable.preventEvent(null, 'mounted', { $table: $xeTable })
|
|
13942
13988
|
})
|
|
@@ -13974,6 +14020,7 @@ export default defineVxeComponent({
|
|
|
13974
14020
|
globalEvents.off($xeTable, 'mousewheel')
|
|
13975
14021
|
globalEvents.off($xeTable, 'keydown')
|
|
13976
14022
|
globalEvents.off($xeTable, 'resize')
|
|
14023
|
+
globalEvents.off($xeTable, 'scroll')
|
|
13977
14024
|
globalEvents.off($xeTable, 'contextmenu')
|
|
13978
14025
|
|
|
13979
14026
|
$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
|
-
|
|
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,
|