vxe-table 3.18.14 → 3.18.16
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/README.md +1 -1
- package/es/grid/src/grid.js +4 -1
- package/es/grid/style.css +0 -1
- package/es/grid/style.min.css +1 -1
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/en-US.js +2 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/filter/panel.js +2 -1
- package/es/table/module/menu/mixin.js +9 -3
- package/es/table/module/menu/panel.js +136 -118
- package/es/table/src/header.js +4 -1
- package/es/table/src/methods.js +15 -12
- package/es/table/src/table.js +52 -28
- package/es/table/src/util.js +15 -0
- package/es/ui/index.js +8 -5
- package/es/ui/src/log.js +1 -1
- package/es/vxe-grid/style.css +0 -1
- package/es/vxe-grid/style.min.css +1 -1
- package/lib/grid/src/grid.js +3 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/grid/style/style.css +0 -1
- package/lib/grid/style/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +132 -51
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +2 -2
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -2
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/filter/panel.js +3 -2
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/module/menu/mixin.js +12 -3
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/module/menu/panel.js +34 -12
- package/lib/table/module/menu/panel.min.js +1 -1
- package/lib/table/src/header.js +3 -1
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +14 -11
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +35 -15
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +21 -0
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +8 -5
- 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-grid/style/style.css +0 -1
- package/lib/vxe-grid/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/grid/src/grid.ts +4 -1
- package/packages/locale/lang/en-US.ts +2 -2
- package/packages/table/module/filter/panel.ts +2 -1
- package/packages/table/module/menu/mixin.ts +11 -3
- package/packages/table/module/menu/panel.ts +137 -117
- package/packages/table/src/header.ts +3 -1
- package/packages/table/src/methods.ts +15 -12
- package/packages/table/src/table.ts +53 -29
- package/packages/table/src/util.ts +17 -0
- package/packages/ui/index.ts +7 -4
- package/styles/components/grid.scss +0 -1
- /package/es/{iconfont.1758158482285.ttf → iconfont.1758344480506.ttf} +0 -0
- /package/es/{iconfont.1758158482285.woff → iconfont.1758344480506.woff} +0 -0
- /package/es/{iconfont.1758158482285.woff2 → iconfont.1758344480506.woff2} +0 -0
- /package/lib/{iconfont.1758158482285.ttf → iconfont.1758344480506.ttf} +0 -0
- /package/lib/{iconfont.1758158482285.woff → iconfont.1758344480506.woff} +0 -0
- /package/lib/{iconfont.1758158482285.woff2 → iconfont.1758344480506.woff2} +0 -0
|
@@ -170,7 +170,7 @@ export default {
|
|
|
170
170
|
const isContentMenu = $xeTable.computeIsContentMenu
|
|
171
171
|
const menuOpts = $xeTable.computeMenuOpts
|
|
172
172
|
const config = menuOpts[type]
|
|
173
|
-
const visibleMethod = menuOpts
|
|
173
|
+
const { transfer, visibleMethod } = menuOpts
|
|
174
174
|
if (config) {
|
|
175
175
|
const { options, disabled } = config
|
|
176
176
|
if (disabled) {
|
|
@@ -181,9 +181,17 @@ export default {
|
|
|
181
181
|
if (!visibleMethod || visibleMethod(params)) {
|
|
182
182
|
evnt.preventDefault()
|
|
183
183
|
$xeTable.updateZindex()
|
|
184
|
+
const el = $xeTable.$refs.refElem as HTMLDivElement
|
|
185
|
+
const tableRect = el.getBoundingClientRect()
|
|
184
186
|
const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode()
|
|
185
|
-
|
|
186
|
-
let
|
|
187
|
+
|
|
188
|
+
let top = evnt.clientY - tableRect.y
|
|
189
|
+
let left = evnt.clientX - tableRect.x
|
|
190
|
+
if (transfer) {
|
|
191
|
+
top = evnt.clientY + scrollTop
|
|
192
|
+
left = evnt.clientX + scrollLeft
|
|
193
|
+
}
|
|
194
|
+
|
|
187
195
|
const handleVisible = () => {
|
|
188
196
|
internalData._currMenuParams = params
|
|
189
197
|
Object.assign(ctxMenuStore, {
|
|
@@ -12,143 +12,163 @@ export default {
|
|
|
12
12
|
ctxMenuStore: Object,
|
|
13
13
|
ctxMenuOpts: Object
|
|
14
14
|
},
|
|
15
|
+
inject: {
|
|
16
|
+
$xeTable: {
|
|
17
|
+
default: null
|
|
18
|
+
}
|
|
19
|
+
},
|
|
15
20
|
mounted () {
|
|
16
|
-
|
|
21
|
+
const $xeMenuPanel = this
|
|
22
|
+
const $xeTable = $xeMenuPanel.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
|
|
23
|
+
const menuOpts = $xeTable.computeMenuOpts
|
|
24
|
+
const { transfer } = menuOpts
|
|
25
|
+
const el = this.$refs.refElem as HTMLDivElement
|
|
26
|
+
|
|
27
|
+
if (transfer && el) {
|
|
28
|
+
document.body.appendChild(el)
|
|
29
|
+
}
|
|
17
30
|
},
|
|
18
31
|
beforeDestroy () {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
32
|
+
const el = this.$refs.refElem as HTMLDivElement
|
|
33
|
+
|
|
34
|
+
if (el && el.parentNode) {
|
|
35
|
+
el.parentNode.removeChild(el)
|
|
22
36
|
}
|
|
23
37
|
},
|
|
24
38
|
render (this: any, h: CreateElement) {
|
|
25
|
-
const $
|
|
39
|
+
const $xeMenuPanel = this
|
|
40
|
+
const $xeTable = $xeMenuPanel.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
|
|
26
41
|
const tableReactData = $xeTable as unknown as TableReactData
|
|
27
42
|
|
|
28
43
|
const { ctxMenuStore } = tableReactData
|
|
29
44
|
const menuOpts = $xeTable.computeMenuOpts
|
|
45
|
+
const { destroyOnClose } = menuOpts
|
|
46
|
+
const { visible, list, className } = ctxMenuStore
|
|
30
47
|
return h('div', {
|
|
31
|
-
|
|
32
|
-
|
|
48
|
+
ref: 'refElem',
|
|
49
|
+
class: ['vxe-table--context-menu-wrapper', className, {
|
|
50
|
+
'is--visible': visible
|
|
33
51
|
}],
|
|
34
52
|
style: ctxMenuStore.style
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
h('a', {
|
|
56
|
-
class: 'vxe-context-menu--link',
|
|
57
|
-
on: {
|
|
58
|
-
click (evnt: any) {
|
|
59
|
-
$xeTable.ctxMenuLinkEvent(evnt, item)
|
|
60
|
-
},
|
|
61
|
-
mouseover (evnt: any) {
|
|
62
|
-
$xeTable.ctxMenuMouseoverEvent(evnt, item)
|
|
63
|
-
},
|
|
64
|
-
mouseout (evnt: any) {
|
|
65
|
-
$xeTable.ctxMenuMouseoutEvent(evnt, item)
|
|
66
|
-
}
|
|
67
|
-
}
|
|
53
|
+
}, (destroyOnClose ? visible : true)
|
|
54
|
+
? list.map((options, gIndex) => {
|
|
55
|
+
return options.every((item) => item.visible === false)
|
|
56
|
+
? renderEmptyElement($xeTable)
|
|
57
|
+
: h('ul', {
|
|
58
|
+
class: 'vxe-context-menu--option-wrapper',
|
|
59
|
+
key: gIndex
|
|
60
|
+
}, options.map((item, index) => {
|
|
61
|
+
const hasChildMenus = item.children && item.children.some((child: any) => child.visible !== false)
|
|
62
|
+
const prefixOpts = Object.assign({}, item.prefixConfig)
|
|
63
|
+
const suffixOpts = Object.assign({}, item.suffixConfig)
|
|
64
|
+
const menuContent = getFuncText(item.name)
|
|
65
|
+
return item.visible === false
|
|
66
|
+
? renderEmptyElement($xeTable)
|
|
67
|
+
: h('li', {
|
|
68
|
+
class: [item.className, {
|
|
69
|
+
'link--disabled': item.disabled,
|
|
70
|
+
'link--active': item === ctxMenuStore.selected
|
|
71
|
+
}],
|
|
72
|
+
key: `${gIndex}_${index}`
|
|
68
73
|
}, [
|
|
69
|
-
h('
|
|
70
|
-
class:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
h('a', {
|
|
75
|
+
class: 'vxe-context-menu--link',
|
|
76
|
+
on: {
|
|
77
|
+
click (evnt: any) {
|
|
78
|
+
$xeTable.ctxMenuLinkEvent(evnt, item)
|
|
79
|
+
},
|
|
80
|
+
mouseover (evnt: any) {
|
|
81
|
+
$xeTable.ctxMenuMouseoverEvent(evnt, item)
|
|
82
|
+
},
|
|
83
|
+
mouseout (evnt: any) {
|
|
84
|
+
$xeTable.ctxMenuMouseoutEvent(evnt, item)
|
|
85
|
+
}
|
|
81
86
|
}
|
|
82
|
-
}, menuContent),
|
|
83
|
-
h('div', {
|
|
84
|
-
class: ['vxe-context-menu--link-suffix', suffixOpts.className || '']
|
|
85
87
|
}, [
|
|
86
|
-
h('
|
|
87
|
-
class:
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
'
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
class:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
88
|
+
h('div', {
|
|
89
|
+
class: ['vxe-context-menu--link-prefix', prefixOpts.className || '']
|
|
90
|
+
}, [
|
|
91
|
+
h('i', {
|
|
92
|
+
class: prefixOpts.icon || item.prefixIcon
|
|
93
|
+
}),
|
|
94
|
+
prefixOpts.content ? h('span', {}, `${prefixOpts.content}`) : renderEmptyElement($xeTable)
|
|
95
|
+
]),
|
|
96
|
+
h('span', {
|
|
97
|
+
class: 'vxe-context-menu--link-content',
|
|
98
|
+
attrs: {
|
|
99
|
+
title: menuContent
|
|
100
|
+
}
|
|
101
|
+
}, menuContent),
|
|
102
|
+
h('div', {
|
|
103
|
+
class: ['vxe-context-menu--link-suffix', suffixOpts.className || '']
|
|
104
|
+
}, [
|
|
105
|
+
h('i', {
|
|
106
|
+
class: (suffixOpts.icon || item.suffixIcon) || (hasChildMenus ? getIcon().TABLE_MENU_OPTIONS : '')
|
|
107
|
+
}),
|
|
108
|
+
suffixOpts.content ? h('span', `${suffixOpts.content}`) : renderEmptyElement($xeTable)
|
|
109
|
+
])
|
|
110
|
+
]),
|
|
111
|
+
hasChildMenus
|
|
112
|
+
? h('ul', {
|
|
113
|
+
class: ['vxe-table--context-menu-clild-wrapper', {
|
|
114
|
+
'is--show': item === ctxMenuStore.selected && ctxMenuStore.showChild
|
|
115
|
+
}]
|
|
116
|
+
}, item.children.map((child: any, cIndex: any) => {
|
|
117
|
+
const childPrefixOpts = Object.assign({}, child.prefixConfig)
|
|
118
|
+
const childSuffixOpts = Object.assign({}, child.suffixConfig)
|
|
119
|
+
const childMenuContent = getFuncText(child.name)
|
|
120
|
+
return child.visible === false
|
|
121
|
+
? null
|
|
122
|
+
: h('li', {
|
|
123
|
+
class: [child.className, {
|
|
124
|
+
'link--disabled': child.disabled,
|
|
125
|
+
'link--active': child === ctxMenuStore.selectChild
|
|
126
|
+
}],
|
|
127
|
+
key: `${gIndex}_${index}_${cIndex}`
|
|
123
128
|
}, [
|
|
124
|
-
h('
|
|
125
|
-
class:
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
129
|
+
h('a', {
|
|
130
|
+
class: 'vxe-context-menu--link',
|
|
131
|
+
on: {
|
|
132
|
+
click (evnt: any) {
|
|
133
|
+
$xeTable.ctxMenuLinkEvent(evnt, child)
|
|
134
|
+
},
|
|
135
|
+
mouseover (evnt: any) {
|
|
136
|
+
$xeTable.ctxMenuMouseoverEvent(evnt, item, child)
|
|
137
|
+
},
|
|
138
|
+
mouseout (evnt: any) {
|
|
139
|
+
$xeTable.ctxMenuMouseoutEvent(evnt, item)
|
|
140
|
+
}
|
|
136
141
|
}
|
|
137
|
-
}, childMenuContent),
|
|
138
|
-
h('div', {
|
|
139
|
-
class: ['vxe-context-menu--link-suffix', childSuffixOpts.className || '']
|
|
140
142
|
}, [
|
|
141
|
-
h('
|
|
142
|
-
class:
|
|
143
|
-
}
|
|
144
|
-
|
|
143
|
+
h('div', {
|
|
144
|
+
class: ['vxe-context-menu--link-prefix', childPrefixOpts.className || '']
|
|
145
|
+
}, [
|
|
146
|
+
h('i', {
|
|
147
|
+
class: childPrefixOpts.icon || child.prefixIcon
|
|
148
|
+
}),
|
|
149
|
+
childPrefixOpts.content ? h('span', `${childPrefixOpts.content}`) : renderEmptyElement($xeTable)
|
|
150
|
+
]),
|
|
151
|
+
h('span', {
|
|
152
|
+
class: 'vxe-context-menu--link-content',
|
|
153
|
+
attrs: {
|
|
154
|
+
title: childMenuContent
|
|
155
|
+
}
|
|
156
|
+
}, childMenuContent),
|
|
157
|
+
h('div', {
|
|
158
|
+
class: ['vxe-context-menu--link-suffix', childSuffixOpts.className || '']
|
|
159
|
+
}, [
|
|
160
|
+
h('i', {
|
|
161
|
+
class: childSuffixOpts.icon
|
|
162
|
+
}),
|
|
163
|
+
childSuffixOpts.content ? h('span', `${childSuffixOpts.content}`) : renderEmptyElement($xeTable)
|
|
164
|
+
])
|
|
145
165
|
])
|
|
146
166
|
])
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
167
|
+
}))
|
|
168
|
+
: null
|
|
169
|
+
])
|
|
170
|
+
}))
|
|
171
|
+
})
|
|
172
|
+
: [])
|
|
153
173
|
}
|
|
154
174
|
} as any
|
|
@@ -158,7 +158,9 @@ function renderRows (h: CreateElement, _vm: any, isGroup: boolean, isOptimizeMod
|
|
|
158
158
|
tcStyle.minHeight = `${currCellHeight}px`
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
if (
|
|
161
|
+
if (showCustomHeader) {
|
|
162
|
+
// custom
|
|
163
|
+
} else if (isColGroup && !isLastRow) {
|
|
162
164
|
const firstCol = getColumnFirstChild(column)
|
|
163
165
|
const lastCol = getColumnLastChild(column)
|
|
164
166
|
if (firstCol && lastCol && firstCol.id !== lastCol.id) {
|
|
@@ -3,7 +3,7 @@ import { getTpImg, isPx, isScale, hasClass, addClass, removeClass, getEventTarge
|
|
|
3
3
|
import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils'
|
|
4
4
|
import { VxeUI } from '../../ui'
|
|
5
5
|
import Cell from './cell'
|
|
6
|
-
import { getRowUniqueId, clearTableAllStatus, getColumnList, toFilters, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getRefElem, getCellRestHeight } from './util'
|
|
6
|
+
import { getRowUniqueId, clearTableAllStatus, getColumnList, toFilters, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getRefElem, getCellRestHeight, getLastChildColumn } from './util'
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
8
|
import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from './anime'
|
|
9
9
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
@@ -3654,6 +3654,7 @@ function initColumnHierarchy ($xeTable: VxeTableConstructor & VxeTablePrivateMet
|
|
|
3654
3654
|
}
|
|
3655
3655
|
|
|
3656
3656
|
function handleInitColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, collectColumn: VxeTableDefines.ColumnInfo[]) {
|
|
3657
|
+
const props = $xeTable
|
|
3657
3658
|
const $xeToolbar = $xeTable.$refs.$xeToolbar as VxeToolbarConstructor
|
|
3658
3659
|
const reactData = $xeTable as unknown as TableReactData
|
|
3659
3660
|
const internalData = $xeTable as unknown as TableInternalData
|
|
@@ -3693,6 +3694,10 @@ function handleInitColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMethod
|
|
|
3693
3694
|
if ($xeTable.handleUpdateCustomColumn) {
|
|
3694
3695
|
$xeTable.handleUpdateCustomColumn()
|
|
3695
3696
|
}
|
|
3697
|
+
const columnOpts = $xeTable.computeColumnOpts
|
|
3698
|
+
if (props.showCustomHeader && reactData.isGroup && (columnOpts.resizable || props.resizable)) {
|
|
3699
|
+
warnLog('vxe.error.notConflictProp', ['show-custom-header & colgroup', 'column-config.resizable=false'])
|
|
3700
|
+
}
|
|
3696
3701
|
reactData.isColLoading = false
|
|
3697
3702
|
return handleLazyRecalculate($xeTable, false, true, true)
|
|
3698
3703
|
})
|
|
@@ -5903,18 +5908,16 @@ const Methods = {
|
|
|
5903
5908
|
const scrollbarXToTop = $xeTable.computeScrollbarXToTop
|
|
5904
5909
|
const { clientX: dragClientX } = evnt
|
|
5905
5910
|
const dragBtnElem = evnt.target as HTMLDivElement
|
|
5911
|
+
let cell = dragBtnElem.parentElement as HTMLTableCellElement | null
|
|
5906
5912
|
let resizeColumn = column
|
|
5907
5913
|
const isDragGroupCol = column.children && column.children.length
|
|
5908
5914
|
if (isDragGroupCol) {
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
const trEl = cell ? cell.parentElement as HTMLTableRowElement : null
|
|
5916
|
-
const theadEl = trEl ? trEl.parentElement as HTMLTableElement : null
|
|
5917
|
-
cell = theadEl ? theadEl.querySelector<HTMLTableCellElement>(`.vxe-header--column[colid="${resizeColumn.id}"]`) : null
|
|
5915
|
+
resizeColumn = getLastChildColumn(column)
|
|
5916
|
+
if (isDragGroupCol) {
|
|
5917
|
+
const trEl = cell ? cell.parentElement as HTMLTableRowElement : null
|
|
5918
|
+
const theadEl = trEl ? trEl.parentElement as HTMLTableElement : null
|
|
5919
|
+
cell = theadEl ? theadEl.querySelector<HTMLTableCellElement>(`.vxe-header--column[colid="${resizeColumn.id}"]`) : null
|
|
5920
|
+
}
|
|
5918
5921
|
}
|
|
5919
5922
|
if (!cell) {
|
|
5920
5923
|
return
|
|
@@ -10825,7 +10828,7 @@ const Methods = {
|
|
|
10825
10828
|
const xThreshold = $xeTable.computeScrollXThreshold
|
|
10826
10829
|
isLeft = scrollLeft <= 0
|
|
10827
10830
|
if (!isLeft) {
|
|
10828
|
-
isRight = scrollLeft + bodyWidth >= scrollWidth
|
|
10831
|
+
isRight = scrollLeft + bodyWidth >= scrollWidth - 1
|
|
10829
10832
|
}
|
|
10830
10833
|
if (scrollLeft > lastScrollLeft) {
|
|
10831
10834
|
direction = 'right'
|
|
@@ -10845,7 +10848,7 @@ const Methods = {
|
|
|
10845
10848
|
const yThreshold = $xeTable.computeScrollYThreshold
|
|
10846
10849
|
isTop = scrollTop <= 0
|
|
10847
10850
|
if (!isTop) {
|
|
10848
|
-
isBottom = scrollTop + bodyHeight >= scrollHeight
|
|
10851
|
+
isBottom = scrollTop + bodyHeight >= scrollHeight - 1
|
|
10849
10852
|
}
|
|
10850
10853
|
if (scrollTop > lastScrollTop) {
|
|
10851
10854
|
direction = 'bottom'
|
|
@@ -1876,7 +1876,9 @@ export default {
|
|
|
1876
1876
|
const $xeTable = this
|
|
1877
1877
|
const props = $xeTable
|
|
1878
1878
|
const internalData = $xeTable as unknown as TableInternalData
|
|
1879
|
+
const $xeGrid = $xeTable.$xeGrid
|
|
1879
1880
|
const $xeGantt = $xeTable.$xeGantt
|
|
1881
|
+
const $xeGGWrapper = $xeGrid || $xeGantt
|
|
1880
1882
|
|
|
1881
1883
|
const columnOpts = $xeTable.computeColumnOpts
|
|
1882
1884
|
const rowOpts = $xeTable.computeRowOpts
|
|
@@ -1893,6 +1895,16 @@ export default {
|
|
|
1893
1895
|
internalData.teleportToWrapperElem = classifyWrapperEl
|
|
1894
1896
|
}
|
|
1895
1897
|
}
|
|
1898
|
+
if ($xeGGWrapper) {
|
|
1899
|
+
const popupContainerElem = $xeGantt.$refs.refPopupContainerElem as HTMLDivElement
|
|
1900
|
+
const popupWrapperEl = $xeTable.$refs.refPopupWrapperElem as HTMLDivElement
|
|
1901
|
+
if (popupContainerElem) {
|
|
1902
|
+
if (popupWrapperEl) {
|
|
1903
|
+
popupContainerElem.appendChild(popupWrapperEl)
|
|
1904
|
+
}
|
|
1905
|
+
internalData.popupToWrapperElem = popupContainerElem
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1896
1908
|
|
|
1897
1909
|
if (columnOpts.drag || rowOpts.drag || customOpts.allowSort) {
|
|
1898
1910
|
initTpImg()
|
|
@@ -1906,11 +1918,11 @@ export default {
|
|
|
1906
1918
|
warnLog('vxe.error.reqProp', ['tooltip-config'])
|
|
1907
1919
|
}
|
|
1908
1920
|
|
|
1909
|
-
// 使用已安装的组件,如果未安装则不渲染
|
|
1910
|
-
const VxeUILoadingComponent = VxeUI.getComponent('VxeLoading')
|
|
1911
|
-
const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip')
|
|
1912
|
-
|
|
1913
1921
|
$xeTable.$nextTick(() => {
|
|
1922
|
+
// 使用已安装的组件,如果未安装则不渲染
|
|
1923
|
+
const VxeUILoadingComponent = VxeUI.getComponent('VxeLoading')
|
|
1924
|
+
const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip')
|
|
1925
|
+
|
|
1914
1926
|
if (props.loading) {
|
|
1915
1927
|
if (!VxeUILoadingComponent && !this.$scopedSlots.loading) {
|
|
1916
1928
|
errLog('vxe.error.errProp', ['loading=true', 'loading=false | <template #loading>...</template>'])
|
|
@@ -1989,6 +2001,10 @@ export default {
|
|
|
1989
2001
|
if (teleportWrapperEl && teleportWrapperEl.parentElement) {
|
|
1990
2002
|
teleportWrapperEl.parentElement.removeChild(teleportWrapperEl)
|
|
1991
2003
|
}
|
|
2004
|
+
const popupWrapperEl = $xeTable.$refs.refPopupWrapperElem as HTMLDivElement
|
|
2005
|
+
if (popupWrapperEl && popupWrapperEl.parentElement) {
|
|
2006
|
+
popupWrapperEl.parentElement.removeChild(popupWrapperEl)
|
|
2007
|
+
}
|
|
1992
2008
|
const tableViewportEl = $xeTable.$refs.refTableViewportElem as HTMLDivElement
|
|
1993
2009
|
if (tableViewportEl) {
|
|
1994
2010
|
tableViewportEl.removeEventListener('wheel', $xeTable.triggerBodyWheelEvent)
|
|
@@ -2244,18 +2260,39 @@ export default {
|
|
|
2244
2260
|
renderDragTip(h, this)
|
|
2245
2261
|
])
|
|
2246
2262
|
]),
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2263
|
+
h('div', {
|
|
2264
|
+
key: 'tpw'
|
|
2265
|
+
}, [
|
|
2266
|
+
h('div', {
|
|
2267
|
+
ref: 'refPopupWrapperElem'
|
|
2268
|
+
}, [
|
|
2269
|
+
/**
|
|
2270
|
+
* 筛选
|
|
2271
|
+
*/
|
|
2272
|
+
initStore.filter
|
|
2273
|
+
? h(TableFilterPanelComponent, {
|
|
2274
|
+
key: 'tf',
|
|
2275
|
+
ref: 'refTableFilter',
|
|
2276
|
+
props: {
|
|
2277
|
+
filterStore
|
|
2278
|
+
}
|
|
2279
|
+
})
|
|
2280
|
+
: renderEmptyElement($xeTable),
|
|
2281
|
+
/**
|
|
2282
|
+
* 快捷菜单
|
|
2283
|
+
*/
|
|
2284
|
+
isContentMenu
|
|
2285
|
+
? h(TableMenuPanelComponent, {
|
|
2286
|
+
key: 'tm',
|
|
2287
|
+
ref: 'refTableMenu',
|
|
2288
|
+
props: {
|
|
2289
|
+
ctxMenuStore: this.ctxMenuStore,
|
|
2290
|
+
ctxMenuOpts: this.ctxMenuOpts
|
|
2291
|
+
}
|
|
2292
|
+
})
|
|
2293
|
+
: renderEmptyElement($xeTable)
|
|
2294
|
+
])
|
|
2295
|
+
]),
|
|
2259
2296
|
/**
|
|
2260
2297
|
* 导入
|
|
2261
2298
|
*/
|
|
@@ -2280,19 +2317,6 @@ export default {
|
|
|
2280
2317
|
}
|
|
2281
2318
|
})
|
|
2282
2319
|
: renderEmptyElement($xeTable),
|
|
2283
|
-
/**
|
|
2284
|
-
* 快捷菜单
|
|
2285
|
-
*/
|
|
2286
|
-
isContentMenu
|
|
2287
|
-
? h(TableMenuPanelComponent, {
|
|
2288
|
-
key: 'tm',
|
|
2289
|
-
ref: 'refTableMenu',
|
|
2290
|
-
props: {
|
|
2291
|
-
ctxMenuStore: this.ctxMenuStore,
|
|
2292
|
-
ctxMenuOpts: this.ctxMenuOpts
|
|
2293
|
-
}
|
|
2294
|
-
})
|
|
2295
|
-
: renderEmptyElement($xeTable),
|
|
2296
2320
|
h('div', {}, [
|
|
2297
2321
|
/**
|
|
2298
2322
|
* 提示相关
|
|
@@ -130,6 +130,7 @@ export function createInternalData (): TableInternalData {
|
|
|
130
130
|
tFooterHeight: 0,
|
|
131
131
|
|
|
132
132
|
teleportToWrapperElem: null,
|
|
133
|
+
popupToWrapperElem: null,
|
|
133
134
|
|
|
134
135
|
inited: false,
|
|
135
136
|
tooltipTimeout: null,
|
|
@@ -529,6 +530,22 @@ export function getColReMinWidth (params: any) {
|
|
|
529
530
|
return mWidth
|
|
530
531
|
}
|
|
531
532
|
|
|
533
|
+
export function getFirstChildColumn (column: VxeTableDefines.ColumnInfo): VxeTableDefines.ColumnInfo {
|
|
534
|
+
const { children } = column
|
|
535
|
+
if (children && children.length) {
|
|
536
|
+
return getFirstChildColumn(XEUtils.first(children))
|
|
537
|
+
}
|
|
538
|
+
return column
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
export function getLastChildColumn (column: VxeTableDefines.ColumnInfo): VxeTableDefines.ColumnInfo {
|
|
542
|
+
const { children } = column
|
|
543
|
+
if (children && children.length) {
|
|
544
|
+
return getFirstChildColumn(XEUtils.last(children))
|
|
545
|
+
}
|
|
546
|
+
return column
|
|
547
|
+
}
|
|
548
|
+
|
|
532
549
|
const lineOffsetSizes: Record<string, any> = {
|
|
533
550
|
mini: 3,
|
|
534
551
|
small: 2,
|
package/packages/ui/index.ts
CHANGED
|
@@ -100,9 +100,11 @@ VxeUI.setConfig({
|
|
|
100
100
|
footerCellConfig: {
|
|
101
101
|
height: 'unset'
|
|
102
102
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
menuConfig: {
|
|
104
|
+
// visibleMethod () {},
|
|
105
|
+
// transfer: false,
|
|
106
|
+
destroyOnClose: true
|
|
107
|
+
},
|
|
106
108
|
customConfig: {
|
|
107
109
|
// enabled: false,
|
|
108
110
|
allowVisible: true,
|
|
@@ -149,8 +151,9 @@ VxeUI.setConfig({
|
|
|
149
151
|
filterConfig: {
|
|
150
152
|
// remote: false,
|
|
151
153
|
// filterMethod: null,
|
|
152
|
-
// destroyOnClose: false,
|
|
153
154
|
// isEvery: false,
|
|
155
|
+
// transfer: false,
|
|
156
|
+
destroyOnClose: true,
|
|
154
157
|
multiple: true,
|
|
155
158
|
showIcon: true
|
|
156
159
|
},
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|