vxe-table 4.13.1 → 4.13.3
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/filter/hook.js +30 -11
- package/es/table/module/filter/panel.js +47 -20
- package/es/table/module/menu/hook.js +1 -1
- package/es/table/src/body.js +6 -4
- package/es/table/src/footer.js +3 -2
- package/es/table/src/header.js +3 -2
- package/es/table/src/table.js +42 -17
- package/es/table/style.css +18 -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 +18 -0
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +101 -40
- 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/filter/hook.js +34 -10
- package/lib/table/module/filter/hook.min.js +1 -1
- package/lib/table/module/filter/panel.js +37 -8
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/module/menu/hook.js +1 -1
- package/lib/table/module/menu/hook.min.js +1 -1
- package/lib/table/src/body.js +8 -3
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +4 -2
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +4 -2
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/table.js +863 -12307
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +18 -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 +18 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/filter/hook.ts +28 -11
- package/packages/table/module/filter/panel.ts +52 -20
- package/packages/table/module/menu/hook.ts +1 -1
- package/packages/table/src/body.ts +6 -4
- package/packages/table/src/footer.ts +3 -2
- package/packages/table/src/header.ts +3 -2
- package/packages/table/src/table.ts +43 -18
- package/styles/components/table-module/filter.scss +16 -0
- package/styles/components/table.scss +6 -1
- /package/es/{iconfont.1744337102291.ttf → iconfont.1744609856022.ttf} +0 -0
- /package/es/{iconfont.1744337102291.woff → iconfont.1744609856022.woff} +0 -0
- /package/es/{iconfont.1744337102291.woff2 → iconfont.1744609856022.woff2} +0 -0
- /package/lib/{iconfont.1744337102291.ttf → iconfont.1744609856022.ttf} +0 -0
- /package/lib/{iconfont.1744337102291.woff → iconfont.1744609856022.woff} +0 -0
- /package/lib/{iconfont.1744337102291.woff2 → iconfont.1744609856022.woff2} +0 -0
|
@@ -2,7 +2,7 @@ import { nextTick } from 'vue'
|
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
import { VxeUI } from '../../../ui'
|
|
4
4
|
import { toFilters, handleFieldOrColumn, getRefElem } from '../../src/util'
|
|
5
|
-
import { toCssUnit, triggerEvent } from '../../../ui/src/dom'
|
|
5
|
+
import { toCssUnit, triggerEvent, getDomNode } from '../../../ui/src/dom'
|
|
6
6
|
import { isEnableConf } from '../../../ui/src/utils'
|
|
7
7
|
|
|
8
8
|
import type { TableFilterMethods, TableFilterPrivateMethods } from '../../../../types'
|
|
@@ -76,6 +76,9 @@ hooks.add('tableFilterModule', {
|
|
|
76
76
|
filterStore.visible = false
|
|
77
77
|
} else {
|
|
78
78
|
const el = refElem.value
|
|
79
|
+
const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode()
|
|
80
|
+
const filterOpts = computeFilterOpts.value
|
|
81
|
+
const { transfer } = filterOpts
|
|
79
82
|
const tableRect = el.getBoundingClientRect()
|
|
80
83
|
const btnElem = evnt.currentTarget as HTMLDivElement
|
|
81
84
|
const { filters, filterMultiple, filterRender } = column
|
|
@@ -107,28 +110,42 @@ hooks.add('tableFilterModule', {
|
|
|
107
110
|
return
|
|
108
111
|
}
|
|
109
112
|
const tableFilter = refTableFilter.value
|
|
110
|
-
const filterWrapperElem = tableFilter ? tableFilter
|
|
113
|
+
const filterWrapperElem = tableFilter ? tableFilter.getRefMaps().refElem.value as HTMLDivElement : null
|
|
111
114
|
if (!filterWrapperElem) {
|
|
112
115
|
return
|
|
113
116
|
}
|
|
114
117
|
const btnRect = btnElem.getBoundingClientRect()
|
|
115
|
-
const filterWidth = filterWrapperElem.offsetWidth
|
|
116
118
|
const filterHeadElem = filterWrapperElem.querySelector<HTMLDivElement>('.vxe-table--filter-header')
|
|
117
119
|
const filterFootElem = filterWrapperElem.querySelector<HTMLDivElement>('.vxe-table--filter-footer')
|
|
120
|
+
const filterWidth = filterWrapperElem.offsetWidth
|
|
118
121
|
const centerWidth = filterWidth / 2
|
|
119
|
-
let left =
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
left
|
|
122
|
+
let left = 0
|
|
123
|
+
let top = 0
|
|
124
|
+
let maxHeight = 0
|
|
125
|
+
if (transfer) {
|
|
126
|
+
left = btnRect.left - centerWidth + scrollLeft
|
|
127
|
+
top = btnRect.top + btnElem.clientHeight + scrollTop
|
|
128
|
+
maxHeight = Math.min(Math.max(tableRect.height, Math.floor(visibleHeight / 2)), Math.max(80, visibleHeight - top - (filterHeadElem ? filterHeadElem.clientHeight : 0) - (filterFootElem ? filterFootElem.clientHeight : 0) - 28))
|
|
129
|
+
if (left < 16) {
|
|
130
|
+
left = 16
|
|
131
|
+
} else if (left > (visibleWidth - filterWidth - 16)) {
|
|
132
|
+
left = visibleWidth - filterWidth - 16
|
|
133
|
+
}
|
|
134
|
+
} else {
|
|
135
|
+
left = btnRect.left - tableRect.left - centerWidth
|
|
136
|
+
top = btnRect.top - tableRect.top + btnElem.clientHeight
|
|
137
|
+
maxHeight = Math.max(40, el.clientHeight - top - (filterHeadElem ? filterHeadElem.clientHeight : 0) - (filterFootElem ? filterFootElem.clientHeight : 0) - 14)
|
|
138
|
+
if (left < 1) {
|
|
139
|
+
left = 1
|
|
140
|
+
} else if (left > (el.clientWidth - filterWidth - 1)) {
|
|
141
|
+
left = el.clientWidth - filterWidth - 1
|
|
142
|
+
}
|
|
127
143
|
}
|
|
128
144
|
filterStore.style = {
|
|
129
145
|
top: toCssUnit(top),
|
|
130
146
|
left: toCssUnit(left)
|
|
131
147
|
}
|
|
148
|
+
// 判断面板不能大于表格高度
|
|
132
149
|
filterStore.maxHeight = maxHeight
|
|
133
150
|
})
|
|
134
151
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent, h, computed, inject } from 'vue'
|
|
1
|
+
import { defineComponent, h, ref, computed, inject, Teleport } from 'vue'
|
|
2
2
|
import { VxeUI } from '../../../ui'
|
|
3
3
|
import { formatText, isEnableConf } from '../../../ui/src/utils'
|
|
4
4
|
import { getPropClass } from '../../../ui/src/dom'
|
|
5
5
|
import { getSlotVNs } from '../../../ui/src/vn'
|
|
6
|
+
import XEUtils from 'xe-utils'
|
|
6
7
|
|
|
7
8
|
import type { VxeTableConstructor, VxeTableMethods, VxeTablePrivateMethods } from '../../../../types'
|
|
8
9
|
|
|
@@ -13,11 +14,26 @@ export default defineComponent({
|
|
|
13
14
|
props: {
|
|
14
15
|
filterStore: Object as any
|
|
15
16
|
},
|
|
16
|
-
setup (props) {
|
|
17
|
+
setup (props, context) {
|
|
18
|
+
const xID = XEUtils.uniqueId()
|
|
19
|
+
|
|
17
20
|
const $xeTable = inject('$xeTable', {} as VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods)
|
|
18
21
|
const { reactData: tableReactData, internalData: tableInternalData, getComputeMaps } = $xeTable
|
|
19
22
|
const { computeFilterOpts } = getComputeMaps()
|
|
20
23
|
|
|
24
|
+
const refElem = ref<HTMLDivElement>()
|
|
25
|
+
|
|
26
|
+
const refMaps = {
|
|
27
|
+
refElem
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const $xeFilterPanel: any = {
|
|
31
|
+
xID,
|
|
32
|
+
props,
|
|
33
|
+
context,
|
|
34
|
+
getRefMaps: () => refMaps
|
|
35
|
+
}
|
|
36
|
+
|
|
21
37
|
const computeHasCheckOption = computed(() => {
|
|
22
38
|
const { filterStore } = props
|
|
23
39
|
return filterStore && filterStore.options.some((option: any) => option.checked)
|
|
@@ -78,7 +94,7 @@ export default defineComponent({
|
|
|
78
94
|
* Publish methods
|
|
79
95
|
*************************/
|
|
80
96
|
|
|
81
|
-
const
|
|
97
|
+
const filterPanelMethods = {
|
|
82
98
|
changeRadioOption,
|
|
83
99
|
changeMultipleOption,
|
|
84
100
|
changeAllOption,
|
|
@@ -86,13 +102,14 @@ export default defineComponent({
|
|
|
86
102
|
confirmFilter,
|
|
87
103
|
resetFilter
|
|
88
104
|
}
|
|
105
|
+
Object.assign($xeFilterPanel, filterPanelMethods)
|
|
89
106
|
|
|
90
107
|
const renderOptions = (filterRender: any, compConf: any) => {
|
|
91
108
|
const { filterStore } = props
|
|
92
109
|
const { column, multiple, maxHeight } = filterStore
|
|
93
110
|
const slots = column ? column.slots : null
|
|
94
111
|
const filterSlot = slots ? slots.filter : null
|
|
95
|
-
const params = Object.assign({}, tableInternalData._currFilterParams, { $panel, $table: $xeTable })
|
|
112
|
+
const params = Object.assign({}, tableInternalData._currFilterParams, { $panel: $xeFilterPanel, $table: $xeTable })
|
|
96
113
|
const rtFilter = compConf ? (compConf.renderTableFilter || compConf.renderFilter) : null
|
|
97
114
|
if (filterSlot) {
|
|
98
115
|
return [
|
|
@@ -212,24 +229,39 @@ export default defineComponent({
|
|
|
212
229
|
const filterRender = column ? column.filterRender : null
|
|
213
230
|
const compConf = isEnableConf(filterRender) ? renderer.get(filterRender.name) : null
|
|
214
231
|
const filterClassName = compConf ? (compConf.tableFilterClassName || compConf.filterClassName) : ''
|
|
215
|
-
const params = Object.assign({}, tableInternalData._currFilterParams, { $panel, $table: $xeTable })
|
|
232
|
+
const params = Object.assign({}, tableInternalData._currFilterParams, { $panel: $xeFilterPanel, $table: $xeTable })
|
|
233
|
+
const tableProps = $xeTable.props
|
|
234
|
+
const { computeSize } = $xeTable.getComputeMaps()
|
|
235
|
+
const vSize = computeSize.value
|
|
216
236
|
const filterOpts = computeFilterOpts.value
|
|
217
|
-
const { destroyOnClose } = filterOpts
|
|
218
|
-
return h(
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
'
|
|
226
|
-
'
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
237
|
+
const { transfer, destroyOnClose } = filterOpts
|
|
238
|
+
return h(Teleport, {
|
|
239
|
+
to: 'body',
|
|
240
|
+
disabled: !transfer
|
|
241
|
+
}, [
|
|
242
|
+
h('div', {
|
|
243
|
+
ref: refElem,
|
|
244
|
+
class: [
|
|
245
|
+
'vxe-table--filter-wrapper',
|
|
246
|
+
'filter--prevent-default',
|
|
247
|
+
getPropClass(filterClassName, params),
|
|
248
|
+
{
|
|
249
|
+
[`size--${vSize}`]: vSize,
|
|
250
|
+
'is--animat': tableProps.animat,
|
|
251
|
+
'is--multiple': multiple,
|
|
252
|
+
'is--active': visible
|
|
253
|
+
}
|
|
254
|
+
],
|
|
255
|
+
style: filterStore.style
|
|
256
|
+
}, initStore.filter && (destroyOnClose ? visible : true) && column ? renderOptions(filterRender, compConf).concat(renderFooters()) : [])
|
|
257
|
+
])
|
|
231
258
|
}
|
|
232
259
|
|
|
233
|
-
|
|
260
|
+
$xeFilterPanel.renderVN = renderVN
|
|
261
|
+
|
|
262
|
+
return $xeFilterPanel
|
|
263
|
+
},
|
|
264
|
+
render () {
|
|
265
|
+
return this.renderVN()
|
|
234
266
|
}
|
|
235
267
|
})
|
|
@@ -224,7 +224,7 @@ hooks.add('tableMenuModule', {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
if (tableFilter && !getEventTargetNode(evnt, tableFilter
|
|
227
|
+
if (tableFilter && !getEventTargetNode(evnt, tableFilter.getRefMaps().refElem.value).flag) {
|
|
228
228
|
$xeTable.closeFilter()
|
|
229
229
|
}
|
|
230
230
|
menuMethods.closeMenu()
|
|
@@ -27,7 +27,7 @@ export default defineComponent({
|
|
|
27
27
|
const $xeTable = inject('$xeTable', {} as VxeTableConstructor & VxeTablePrivateMethods)
|
|
28
28
|
|
|
29
29
|
const { xID, props: tableProps, context: tableContext, reactData: tableReactData, internalData: tableInternalData } = $xeTable
|
|
30
|
-
const { computeEditOpts, computeMouseOpts, computeCellOffsetWidth, computeAreaOpts, computeDefaultRowHeight, computeEmptyOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeCellOpts, computeValidOpts, computeRowOpts, computeColumnOpts, computeRowDragOpts, computeColumnDragOpts, computeResizableOpts } = $xeTable.getComputeMaps()
|
|
30
|
+
const { computeEditOpts, computeMouseOpts, computeCellOffsetWidth, computeAreaOpts, computeDefaultRowHeight, computeEmptyOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeCellOpts, computeValidOpts, computeRowOpts, computeColumnOpts, computeRowDragOpts, computeColumnDragOpts, computeResizableOpts, computeVirtualXOpts, computeVirtualYOpts } = $xeTable.getComputeMaps()
|
|
31
31
|
|
|
32
32
|
const refElem = ref() as Ref<HTMLDivElement>
|
|
33
33
|
const refBodyScroll = ref() as Ref<HTMLDivElement>
|
|
@@ -102,7 +102,7 @@ export default defineComponent({
|
|
|
102
102
|
) => {
|
|
103
103
|
const $xeGrid = $xeTable.xeGrid
|
|
104
104
|
|
|
105
|
-
const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps
|
|
105
|
+
const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, treeConfig, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps
|
|
106
106
|
const { tableData, dragRow, overflowX, currentColumn, scrollXLoad, scrollYLoad, mergeBodyFlag, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag, editStore, isAllOverflow, validErrorMaps } = tableReactData
|
|
107
107
|
const { fullAllDataRowIdData, fullColumnIdData, mergeBodyCellMaps, visibleColumn, afterFullData, mergeBodyList, scrollXStore, scrollYStore } = tableInternalData
|
|
108
108
|
const cellOpts = computeCellOpts.value
|
|
@@ -111,6 +111,8 @@ export default defineComponent({
|
|
|
111
111
|
const editOpts = computeEditOpts.value
|
|
112
112
|
const tooltipOpts = computeTooltipOpts.value
|
|
113
113
|
const resizableOpts = computeResizableOpts.value
|
|
114
|
+
const virtualXOpts = computeVirtualXOpts.value
|
|
115
|
+
const virtualYOpts = computeVirtualYOpts.value
|
|
114
116
|
const { isAllColumnDrag, isAllRowDrag } = resizableOpts
|
|
115
117
|
const rowOpts = computeRowOpts.value
|
|
116
118
|
const rowDragOpts = computeRowDragOpts.value
|
|
@@ -282,9 +284,9 @@ export default defineComponent({
|
|
|
282
284
|
let isVNPreEmptyStatus = false
|
|
283
285
|
if (!isMergeCell) {
|
|
284
286
|
if (!dragRow || getRowid($xeTable, dragRow) !== rowid) {
|
|
285
|
-
if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
287
|
+
if (scrollYLoad && !treeConfig && !virtualYOpts.immediate && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
286
288
|
isVNPreEmptyStatus = true
|
|
287
|
-
} else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
289
|
+
} else if (scrollXLoad && !virtualXOpts.immediate && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
288
290
|
isVNPreEmptyStatus = true
|
|
289
291
|
}
|
|
290
292
|
}
|
|
@@ -34,7 +34,7 @@ export default defineComponent({
|
|
|
34
34
|
const $xeTable = inject('$xeTable', {} as VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods)
|
|
35
35
|
|
|
36
36
|
const { xID, props: tableProps, reactData: tableReactData, internalData: tableInternalData } = $xeTable
|
|
37
|
-
const { computeTooltipOpts, computeColumnOpts, computeColumnDragOpts, computeCellOpts, computeFooterCellOpts, computeDefaultRowHeight, computeResizableOpts } = $xeTable.getComputeMaps()
|
|
37
|
+
const { computeTooltipOpts, computeColumnOpts, computeColumnDragOpts, computeCellOpts, computeFooterCellOpts, computeDefaultRowHeight, computeResizableOpts, computeVirtualXOpts } = $xeTable.getComputeMaps()
|
|
38
38
|
|
|
39
39
|
const refElem = ref() as Ref<HTMLDivElement>
|
|
40
40
|
const refFooterScroll = ref() as Ref<HTMLDivElement>
|
|
@@ -50,6 +50,7 @@ export default defineComponent({
|
|
|
50
50
|
const { resizable: allResizable, border, footerCellClassName, footerCellStyle, footerAlign: allFooterAlign, footerSpanMethod, align: allAlign, columnKey, showFooterOverflow: allColumnFooterOverflow } = tableProps
|
|
51
51
|
const { scrollXLoad, scrollYLoad, overflowX, currentColumn } = tableReactData
|
|
52
52
|
const { fullColumnIdData, mergeFooterList, mergeFooterCellMaps, scrollXStore } = tableInternalData
|
|
53
|
+
const virtualXOpts = computeVirtualXOpts.value
|
|
53
54
|
const tooltipOpts = computeTooltipOpts.value
|
|
54
55
|
const resizableOpts = computeResizableOpts.value
|
|
55
56
|
const { isAllColumnDrag } = resizableOpts
|
|
@@ -162,7 +163,7 @@ export default defineComponent({
|
|
|
162
163
|
|
|
163
164
|
let isVNPreEmptyStatus = false
|
|
164
165
|
if (!isMergeCell) {
|
|
165
|
-
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
166
|
+
if (scrollXLoad && !column.fixed && !virtualXOpts.immediate && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
166
167
|
isVNPreEmptyStatus = true
|
|
167
168
|
}
|
|
168
169
|
}
|
|
@@ -25,7 +25,7 @@ export default defineComponent({
|
|
|
25
25
|
const $xeTable = inject('$xeTable', {} as VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods)
|
|
26
26
|
|
|
27
27
|
const { xID, props: tableProps, reactData: tableReactData, internalData: tableInternalData } = $xeTable
|
|
28
|
-
const { computeColumnOpts, computeColumnDragOpts, computeCellOpts, computeMouseOpts, computeHeaderCellOpts, computeDefaultRowHeight } = $xeTable.getComputeMaps()
|
|
28
|
+
const { computeColumnOpts, computeColumnDragOpts, computeCellOpts, computeMouseOpts, computeHeaderCellOpts, computeDefaultRowHeight, computeVirtualXOpts } = $xeTable.getComputeMaps()
|
|
29
29
|
|
|
30
30
|
const headerColumn = ref([] as VxeTableDefines.ColumnInfo[][])
|
|
31
31
|
|
|
@@ -49,6 +49,7 @@ export default defineComponent({
|
|
|
49
49
|
const { resizable: allResizable, columnKey, headerCellClassName, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, mouseConfig } = tableProps
|
|
50
50
|
const { currentColumn, dragCol, scrollXLoad, scrollYLoad, overflowX } = tableReactData
|
|
51
51
|
const { fullColumnIdData, scrollXStore } = tableInternalData
|
|
52
|
+
const virtualXOpts = computeVirtualXOpts.value
|
|
52
53
|
const columnOpts = computeColumnOpts.value
|
|
53
54
|
const columnDragOpts = computeColumnDragOpts.value
|
|
54
55
|
const cellOpts = computeCellOpts.value
|
|
@@ -120,7 +121,7 @@ export default defineComponent({
|
|
|
120
121
|
let isVNPreEmptyStatus = false
|
|
121
122
|
if (!isGroup) {
|
|
122
123
|
if (!dragCol || dragCol.id !== colid) {
|
|
123
|
-
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
124
|
+
if (scrollXLoad && !column.fixed && !virtualXOpts.immediate && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
124
125
|
isVNPreEmptyStatus = true
|
|
125
126
|
}
|
|
126
127
|
}
|
|
@@ -402,7 +402,7 @@ export default defineComponent({
|
|
|
402
402
|
const refCommTooltip = ref() as Ref<VxeTooltipInstance>
|
|
403
403
|
const refValidTooltip = ref() as Ref<VxeTooltipInstance>
|
|
404
404
|
const refTableMenu = ref() as Ref<any>
|
|
405
|
-
const refTableFilter = ref() as Ref<
|
|
405
|
+
const refTableFilter = ref() as Ref<any>
|
|
406
406
|
const refTableCustom = ref() as Ref<ComponentPublicInstance>
|
|
407
407
|
|
|
408
408
|
const refTableViewportElem = ref<HTMLDivElement>()
|
|
@@ -2975,7 +2975,12 @@ export default defineComponent({
|
|
|
2975
2975
|
$xeTable.checkSelectionStatus()
|
|
2976
2976
|
return new Promise<void>(resolve => {
|
|
2977
2977
|
nextTick()
|
|
2978
|
-
.then(() =>
|
|
2978
|
+
.then(() => handleRecalculateLayout(false))
|
|
2979
|
+
.then(() => {
|
|
2980
|
+
calcCellHeight()
|
|
2981
|
+
updateRowOffsetTop()
|
|
2982
|
+
return handleRecalculateLayout(false)
|
|
2983
|
+
})
|
|
2979
2984
|
.then(() => {
|
|
2980
2985
|
let targetScrollLeft = lastScrollLeft
|
|
2981
2986
|
let targetScrollTop = lastScrollTop
|
|
@@ -2989,8 +2994,7 @@ export default defineComponent({
|
|
|
2989
2994
|
targetScrollTop = 0
|
|
2990
2995
|
}
|
|
2991
2996
|
reactData.isRowLoading = false
|
|
2992
|
-
|
|
2993
|
-
updateRowOffsetTop()
|
|
2997
|
+
handleRecalculateLayout(false)
|
|
2994
2998
|
// 是否变更虚拟滚动
|
|
2995
2999
|
if (oldScrollYLoad === sYLoad) {
|
|
2996
3000
|
restoreScrollLocation($xeTable, targetScrollLeft, targetScrollTop)
|
|
@@ -3289,8 +3293,8 @@ export default defineComponent({
|
|
|
3289
3293
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
3290
3294
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField
|
|
3291
3295
|
const result: any[] = []
|
|
3292
|
-
const columnIndex =
|
|
3293
|
-
const $columnIndex =
|
|
3296
|
+
const columnIndex = $xeTable.getColumnIndex(treeNodeColumn)
|
|
3297
|
+
const $columnIndex = $xeTable.getVMColumnIndex(treeNodeColumn)
|
|
3294
3298
|
const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
3295
3299
|
let validRows = toggleMethod ? rows.filter((row: any) => toggleMethod({ $table: $xeTable, expanded, column: treeNodeColumn, columnIndex, $columnIndex, row })) : rows
|
|
3296
3300
|
if (accordion) {
|
|
@@ -3337,7 +3341,7 @@ export default defineComponent({
|
|
|
3337
3341
|
}
|
|
3338
3342
|
reactData.treeExpandedFlag++
|
|
3339
3343
|
return Promise.all(result).then(() => {
|
|
3340
|
-
return
|
|
3344
|
+
return $xeTable.recalculate()
|
|
3341
3345
|
})
|
|
3342
3346
|
}
|
|
3343
3347
|
|
|
@@ -3350,14 +3354,14 @@ export default defineComponent({
|
|
|
3350
3354
|
const handleVirtualTreeExpand = (rows: any[], expanded: boolean) => {
|
|
3351
3355
|
return handleBaseTreeExpand(rows, expanded).then(() => {
|
|
3352
3356
|
handleVirtualTreeToList()
|
|
3353
|
-
|
|
3357
|
+
$xeTable.handleTableData()
|
|
3354
3358
|
updateAfterDataIndex()
|
|
3355
3359
|
return nextTick()
|
|
3356
3360
|
}).then(() => {
|
|
3357
|
-
return
|
|
3361
|
+
return $xeTable.recalculate(true)
|
|
3358
3362
|
}).then(() => {
|
|
3359
3363
|
setTimeout(() => {
|
|
3360
|
-
|
|
3364
|
+
$xeTable.updateCellAreas()
|
|
3361
3365
|
}, 30)
|
|
3362
3366
|
})
|
|
3363
3367
|
}
|
|
@@ -5543,7 +5547,7 @@ export default defineComponent({
|
|
|
5543
5547
|
internalData.rowExpandedMaps = rowExpandedMaps
|
|
5544
5548
|
rows = rows.slice(rows.length - 1, rows.length)
|
|
5545
5549
|
}
|
|
5546
|
-
const validRows: any[] = toggleMethod ? rows.filter((row: any) => toggleMethod({ $table: $xeTable, expanded, column: expandColumn, columnIndex, $columnIndex, row, rowIndex:
|
|
5550
|
+
const validRows: any[] = toggleMethod ? rows.filter((row: any) => toggleMethod({ $table: $xeTable, expanded, column: expandColumn, columnIndex, $columnIndex, row, rowIndex: $xeTable.getRowIndex(row), $rowIndex: $xeTable.getVMRowIndex(row) })) : rows
|
|
5547
5551
|
if (expanded) {
|
|
5548
5552
|
validRows.forEach((row: any) => {
|
|
5549
5553
|
const rowid = handleGetRowId(row)
|
|
@@ -6176,7 +6180,7 @@ export default defineComponent({
|
|
|
6176
6180
|
if (tableFilter) {
|
|
6177
6181
|
if (getEventTargetNode(evnt, el, 'vxe-cell--filter').flag) {
|
|
6178
6182
|
// 如果点击了筛选按钮
|
|
6179
|
-
} else if (getEventTargetNode(evnt, tableFilter
|
|
6183
|
+
} else if (getEventTargetNode(evnt, tableFilter.getRefMaps().refElem.value as HTMLDivElement).flag) {
|
|
6180
6184
|
// 如果点击筛选容器
|
|
6181
6185
|
} else {
|
|
6182
6186
|
if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-clear').flag) {
|
|
@@ -8241,6 +8245,10 @@ export default defineComponent({
|
|
|
8241
8245
|
const currentColumnOpts = computeCurrentColumnOpts.value
|
|
8242
8246
|
const beforeRowMethod = currentColumnOpts.beforeSelectMethod || columnOpts.currentMethod as any
|
|
8243
8247
|
const { column: newValue } = params
|
|
8248
|
+
const { trigger } = currentColumnOpts
|
|
8249
|
+
if (trigger === 'manual') {
|
|
8250
|
+
return
|
|
8251
|
+
}
|
|
8244
8252
|
const isChange = oldValue !== newValue
|
|
8245
8253
|
if (!beforeRowMethod || beforeRowMethod({ column: newValue, $table: $xeTable })) {
|
|
8246
8254
|
$xeTable.setCurrentColumn(newValue)
|
|
@@ -8257,6 +8265,10 @@ export default defineComponent({
|
|
|
8257
8265
|
const currentRowOpts = computeCurrentRowOpts.value
|
|
8258
8266
|
const beforeRowMethod = currentRowOpts.beforeSelectMethod || rowOpts.currentMethod as any
|
|
8259
8267
|
const { row: newValue } = params
|
|
8268
|
+
const { trigger } = currentRowOpts
|
|
8269
|
+
if (trigger === 'manual') {
|
|
8270
|
+
return
|
|
8271
|
+
}
|
|
8260
8272
|
const isChange = oldValue !== newValue
|
|
8261
8273
|
if (!beforeRowMethod || beforeRowMethod({ row: newValue, $table: $xeTable })) {
|
|
8262
8274
|
$xeTable.setCurrentRow(newValue)
|
|
@@ -8303,10 +8315,10 @@ export default defineComponent({
|
|
|
8303
8315
|
* 展开树节点事件
|
|
8304
8316
|
*/
|
|
8305
8317
|
triggerTreeExpandEvent (evnt, params) {
|
|
8306
|
-
const { treeExpandLazyLoadedMaps } = internalData
|
|
8318
|
+
const { treeExpandLazyLoadedMaps, treeEATime } = internalData
|
|
8307
8319
|
const treeOpts = computeTreeOpts.value
|
|
8308
8320
|
const { row, column } = params
|
|
8309
|
-
const { lazy, trigger } = treeOpts
|
|
8321
|
+
const { lazy, trigger, accordion } = treeOpts
|
|
8310
8322
|
if (trigger === 'manual') {
|
|
8311
8323
|
return
|
|
8312
8324
|
}
|
|
@@ -8316,7 +8328,17 @@ export default defineComponent({
|
|
|
8316
8328
|
const expanded = !$xeTable.isTreeExpandByRow(row)
|
|
8317
8329
|
const columnIndex = $xeTable.getColumnIndex(column)
|
|
8318
8330
|
const $columnIndex = $xeTable.getVMColumnIndex(column)
|
|
8319
|
-
|
|
8331
|
+
if (treeEATime) {
|
|
8332
|
+
clearTimeout(treeEATime)
|
|
8333
|
+
}
|
|
8334
|
+
$xeTable.setTreeExpand(row, expanded).then(() => {
|
|
8335
|
+
if (accordion) {
|
|
8336
|
+
internalData.treeEATime = setTimeout(() => {
|
|
8337
|
+
internalData.treeEATime = undefined
|
|
8338
|
+
$xeTable.scrollToRow(row)
|
|
8339
|
+
}, 30)
|
|
8340
|
+
}
|
|
8341
|
+
})
|
|
8320
8342
|
dispatchEvent('toggle-tree-expand', { expanded, column, columnIndex, $columnIndex, row }, evnt)
|
|
8321
8343
|
}
|
|
8322
8344
|
},
|
|
@@ -9483,7 +9505,6 @@ export default defineComponent({
|
|
|
9483
9505
|
}
|
|
9484
9506
|
const isRollX = scrollLeft !== lastScrollLeft
|
|
9485
9507
|
const isRollY = true
|
|
9486
|
-
|
|
9487
9508
|
internalData.inVirtualScroll = true
|
|
9488
9509
|
setScrollTop(bodyScrollElem, scrollTop)
|
|
9489
9510
|
setScrollTop(leftScrollElem, scrollTop)
|
|
@@ -9594,7 +9615,8 @@ export default defineComponent({
|
|
|
9594
9615
|
if (isScrollXBig && mouseOpts.area) {
|
|
9595
9616
|
errLog('vxe.error.notProp', ['mouse-config.area'])
|
|
9596
9617
|
}
|
|
9597
|
-
|
|
9618
|
+
calcScrollbar()
|
|
9619
|
+
return nextTick().then(() => {
|
|
9598
9620
|
updateStyle()
|
|
9599
9621
|
})
|
|
9600
9622
|
}
|
|
@@ -9690,6 +9712,7 @@ export default defineComponent({
|
|
|
9690
9712
|
if (isScrollYBig && mouseOpts.area) {
|
|
9691
9713
|
errLog('vxe.error.notProp', ['mouse-config.area'])
|
|
9692
9714
|
}
|
|
9715
|
+
calcScrollbar()
|
|
9693
9716
|
return nextTick().then(() => {
|
|
9694
9717
|
updateStyle()
|
|
9695
9718
|
})
|
|
@@ -10602,7 +10625,6 @@ export default defineComponent({
|
|
|
10602
10625
|
initTpImg()
|
|
10603
10626
|
}
|
|
10604
10627
|
|
|
10605
|
-
;(window as any).aa = $xeTable
|
|
10606
10628
|
nextTick(() => {
|
|
10607
10629
|
const { data, exportConfig, importConfig, treeConfig, showOverflow, highlightCurrentRow, highlightCurrentColumn } = props
|
|
10608
10630
|
const { scrollXStore, scrollYStore } = internalData
|
|
@@ -10661,6 +10683,9 @@ export default defineComponent({
|
|
|
10661
10683
|
if (props.highlightHoverColumn) {
|
|
10662
10684
|
warnLog('vxe.error.delProp', ['highlight-hover-column', 'column-config.isHover'])
|
|
10663
10685
|
}
|
|
10686
|
+
if (props.resizable) {
|
|
10687
|
+
warnLog('vxe.error.delProp', ['resizable', 'column-config.resizable'])
|
|
10688
|
+
}
|
|
10664
10689
|
// if (props.scrollY) {
|
|
10665
10690
|
// warnLog('vxe.error.delProp', ['scroll-y', 'virtual-y-config'])
|
|
10666
10691
|
// }
|
|
@@ -33,9 +33,11 @@
|
|
|
33
33
|
position: absolute;
|
|
34
34
|
top: 0;
|
|
35
35
|
min-width: 100px;
|
|
36
|
+
font-size: var(--vxe-ui-font-size-default);
|
|
36
37
|
border-radius: var(--vxe-ui-border-radius);
|
|
37
38
|
background-color: var(--vxe-ui-layout-background-color);
|
|
38
39
|
border: 1px solid var(--vxe-ui-base-popup-border-color);
|
|
40
|
+
color: var(--vxe-ui-font-color);
|
|
39
41
|
box-shadow: var(--vxe-ui-base-popup-box-shadow);
|
|
40
42
|
z-index: 10;
|
|
41
43
|
&:not(.is--multiple) {
|
|
@@ -110,3 +112,17 @@
|
|
|
110
112
|
.vxe-table--filter-option {
|
|
111
113
|
@include baseMixin.createCheckboxIcon();
|
|
112
114
|
}
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
.vxe-table--filter-wrapper {
|
|
119
|
+
&.size--medium {
|
|
120
|
+
font-size: var(--vxe-ui-font-size-medium);
|
|
121
|
+
}
|
|
122
|
+
&.size--small {
|
|
123
|
+
font-size: var(--vxe-ui-font-size-small);
|
|
124
|
+
}
|
|
125
|
+
&.size--mini {
|
|
126
|
+
font-size: var(--vxe-ui-font-size-mini);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -1617,10 +1617,12 @@
|
|
|
1617
1617
|
height: 1em;
|
|
1618
1618
|
text-align: center;
|
|
1619
1619
|
transform: translateY(-50%);
|
|
1620
|
-
// background-color: var(--vxe-ui-layout-background-color);
|
|
1621
1620
|
z-index: 1;
|
|
1622
1621
|
user-select: none;
|
|
1623
1622
|
cursor: pointer;
|
|
1623
|
+
& > i {
|
|
1624
|
+
background-color: var(--vxe-ui-layout-background-color);
|
|
1625
|
+
}
|
|
1624
1626
|
}
|
|
1625
1627
|
.vxe-tree--node-btn {
|
|
1626
1628
|
display: block;
|
|
@@ -1650,6 +1652,9 @@
|
|
|
1650
1652
|
&.col--rs-height,
|
|
1651
1653
|
&.col--auto-height {
|
|
1652
1654
|
overflow: hidden;
|
|
1655
|
+
&.col--tree-node {
|
|
1656
|
+
overflow: unset;
|
|
1657
|
+
}
|
|
1653
1658
|
& > .vxe-cell {
|
|
1654
1659
|
overflow: hidden;
|
|
1655
1660
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|