vxe-table 3.15.1 → 3.15.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/mixin.js +29 -10
- package/es/table/module/filter/panel.js +173 -142
- package/es/table/src/body.js +5 -3
- package/es/table/src/footer.js +4 -2
- package/es/table/src/header.js +2 -1
- package/es/table/src/methods.js +125 -101
- package/es/table/src/table.js +3 -0
- 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 +355 -262
- 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/mixin.js +33 -9
- package/lib/table/module/filter/mixin.min.js +1 -1
- package/lib/table/module/filter/panel.js +153 -122
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/src/body.js +5 -2
- 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 +2 -1
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +151 -122
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +3 -0
- 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/mixin.ts +27 -10
- package/packages/table/module/filter/panel.ts +178 -143
- package/packages/table/src/body.ts +5 -3
- package/packages/table/src/footer.ts +4 -2
- package/packages/table/src/header.ts +2 -1
- package/packages/table/src/methods.ts +132 -106
- package/packages/table/src/table.ts +3 -0
- package/styles/components/table-module/filter.scss +16 -0
- package/styles/components/table.scss +6 -1
- /package/es/{iconfont.1744336394111.ttf → iconfont.1744609828798.ttf} +0 -0
- /package/es/{iconfont.1744336394111.woff → iconfont.1744609828798.woff} +0 -0
- /package/es/{iconfont.1744336394111.woff2 → iconfont.1744609828798.woff2} +0 -0
- /package/lib/{iconfont.1744336394111.ttf → iconfont.1744609828798.ttf} +0 -0
- /package/lib/{iconfont.1744336394111.woff → iconfont.1744609828798.woff} +0 -0
- /package/lib/{iconfont.1744336394111.woff2 → iconfont.1744609828798.woff2} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
2
|
import { VxeUI } from '../../../ui'
|
|
3
3
|
import { toFilters, handleFieldOrColumn, getRefElem } from '../../src/util'
|
|
4
|
-
import { toCssUnit, triggerEvent } from '../../../ui/src/dom'
|
|
4
|
+
import { toCssUnit, triggerEvent, getDomNode } from '../../../ui/src/dom'
|
|
5
5
|
import { isEnableConf } from '../../../ui/src/utils'
|
|
6
6
|
|
|
7
7
|
import type { VxeTableConstructor, VxeTableDefines, TableReactData, TableInternalData } from '../../../../types'
|
|
@@ -75,6 +75,9 @@ export default {
|
|
|
75
75
|
filterStore.visible = false
|
|
76
76
|
} else {
|
|
77
77
|
const el = $xeTable.$refs.refElem as HTMLDivElement
|
|
78
|
+
const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode()
|
|
79
|
+
const filterOpts = $xeTable.computeFilterOpts
|
|
80
|
+
const { transfer } = filterOpts
|
|
78
81
|
const tableRect = el.getBoundingClientRect()
|
|
79
82
|
const btnElem = evnt.currentTarget as HTMLDivElement
|
|
80
83
|
const { filters, filterMultiple, filterRender } = column
|
|
@@ -111,23 +114,37 @@ export default {
|
|
|
111
114
|
return
|
|
112
115
|
}
|
|
113
116
|
const btnRect = btnElem.getBoundingClientRect()
|
|
114
|
-
const filterWidth = filterWrapperElem.offsetWidth
|
|
115
117
|
const filterHeadElem = filterWrapperElem.querySelector<HTMLDivElement>('.vxe-table--filter-header')
|
|
116
118
|
const filterFootElem = filterWrapperElem.querySelector<HTMLDivElement>('.vxe-table--filter-footer')
|
|
119
|
+
const filterWidth = filterWrapperElem.offsetWidth
|
|
117
120
|
const centerWidth = filterWidth / 2
|
|
118
|
-
let left =
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
left
|
|
121
|
+
let left = 0
|
|
122
|
+
let top = 0
|
|
123
|
+
let maxHeight = 0
|
|
124
|
+
if (transfer) {
|
|
125
|
+
left = btnRect.left - centerWidth + scrollLeft
|
|
126
|
+
top = btnRect.top + btnElem.clientHeight + scrollTop
|
|
127
|
+
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))
|
|
128
|
+
if (left < 16) {
|
|
129
|
+
left = 16
|
|
130
|
+
} else if (left > (visibleWidth - filterWidth - 16)) {
|
|
131
|
+
left = visibleWidth - filterWidth - 16
|
|
132
|
+
}
|
|
133
|
+
} else {
|
|
134
|
+
left = btnRect.left - tableRect.left - centerWidth
|
|
135
|
+
top = btnRect.top - tableRect.top + btnElem.clientHeight
|
|
136
|
+
maxHeight = Math.max(40, el.clientHeight - top - (filterHeadElem ? filterHeadElem.clientHeight : 0) - (filterFootElem ? filterFootElem.clientHeight : 0) - 14)
|
|
137
|
+
if (left < 1) {
|
|
138
|
+
left = 1
|
|
139
|
+
} else if (left > (el.clientWidth - filterWidth - 1)) {
|
|
140
|
+
left = el.clientWidth - filterWidth - 1
|
|
141
|
+
}
|
|
126
142
|
}
|
|
127
143
|
filterStore.style = {
|
|
128
144
|
top: toCssUnit(top),
|
|
129
145
|
left: toCssUnit(left)
|
|
130
146
|
}
|
|
147
|
+
// 判断面板不能大于表格高度
|
|
131
148
|
filterStore.maxHeight = maxHeight
|
|
132
149
|
})
|
|
133
150
|
}
|
|
@@ -5,183 +5,218 @@ import { CreateElement } from 'vue'
|
|
|
5
5
|
|
|
6
6
|
import type { VxeTableConstructor, VxeTablePrivateMethods, TableInternalData } from '../../../../types'
|
|
7
7
|
|
|
8
|
-
const { getI18n, getIcon, renderer } = VxeUI
|
|
8
|
+
const { getI18n, getIcon, renderer, globalMixins } = VxeUI
|
|
9
|
+
|
|
10
|
+
function renderOptions ($xeFilterPanel: any, h: CreateElement, filterRender: any, compConf: any) {
|
|
11
|
+
const props = $xeFilterPanel
|
|
12
|
+
const $xeTable = $xeFilterPanel.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
|
|
13
|
+
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
14
|
+
|
|
15
|
+
const { filterStore } = props
|
|
16
|
+
const { column, multiple, maxHeight } = filterStore
|
|
17
|
+
const slots = column ? column.slots : null
|
|
18
|
+
const filterSlot = slots ? slots.filter : null
|
|
19
|
+
const params = Object.assign({}, tableInternalData._currFilterParams, { $panel: $xeFilterPanel, $table: $xeTable })
|
|
20
|
+
const rtFilter = compConf ? (compConf.renderTableFilter || compConf.renderFilter) : null
|
|
21
|
+
if (filterSlot) {
|
|
22
|
+
return [
|
|
23
|
+
h('div', {
|
|
24
|
+
class: 'vxe-table--filter-template',
|
|
25
|
+
style: maxHeight
|
|
26
|
+
? {
|
|
27
|
+
maxHeight: `${maxHeight}px`
|
|
28
|
+
}
|
|
29
|
+
: {}
|
|
30
|
+
}, $xeTable.callSlot(filterSlot, params, h))
|
|
31
|
+
]
|
|
32
|
+
} else if (rtFilter) {
|
|
33
|
+
return [
|
|
34
|
+
h('div', {
|
|
35
|
+
class: 'vxe-table--filter-template',
|
|
36
|
+
style: maxHeight
|
|
37
|
+
? {
|
|
38
|
+
maxHeight: `${maxHeight}px`
|
|
39
|
+
}
|
|
40
|
+
: {}
|
|
41
|
+
}, getSlotVNs(rtFilter.call($xeTable, h, filterRender, params)))
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
const isAllChecked = multiple ? filterStore.isAllSelected : !filterStore.options.some((item: any) => item._checked)
|
|
45
|
+
const isAllIndeterminate = multiple && filterStore.isIndeterminate
|
|
46
|
+
return [
|
|
47
|
+
h('ul', {
|
|
48
|
+
class: 'vxe-table--filter-header'
|
|
49
|
+
}, [
|
|
50
|
+
h('li', {
|
|
51
|
+
class: ['vxe-table--filter-option', {
|
|
52
|
+
'is--checked': isAllChecked,
|
|
53
|
+
'is--indeterminate': isAllIndeterminate
|
|
54
|
+
}],
|
|
55
|
+
attrs: {
|
|
56
|
+
title: getI18n(multiple ? 'vxe.table.allTitle' : 'vxe.table.allFilter')
|
|
57
|
+
},
|
|
58
|
+
on: {
|
|
59
|
+
click: (evnt: MouseEvent) => {
|
|
60
|
+
$xeFilterPanel.changeAllOption(evnt, !filterStore.isAllSelected)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}, (multiple
|
|
64
|
+
? [
|
|
65
|
+
h('span', {
|
|
66
|
+
class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
: []).concat([
|
|
70
|
+
h('span', {
|
|
71
|
+
class: 'vxe-checkbox--label'
|
|
72
|
+
}, getI18n('vxe.table.allFilter'))
|
|
73
|
+
]))
|
|
74
|
+
]),
|
|
75
|
+
h('ul', {
|
|
76
|
+
class: 'vxe-table--filter-body',
|
|
77
|
+
style: maxHeight
|
|
78
|
+
? {
|
|
79
|
+
maxHeight: `${maxHeight}px`
|
|
80
|
+
}
|
|
81
|
+
: {}
|
|
82
|
+
}, filterStore.options.map((item: any) => {
|
|
83
|
+
const isChecked = item._checked
|
|
84
|
+
const isIndeterminate = false
|
|
85
|
+
return h('li', {
|
|
86
|
+
class: ['vxe-table--filter-option', {
|
|
87
|
+
'is--checked': isChecked
|
|
88
|
+
}],
|
|
89
|
+
attrs: {
|
|
90
|
+
title: item.label
|
|
91
|
+
},
|
|
92
|
+
on: {
|
|
93
|
+
click: (evnt: MouseEvent) => {
|
|
94
|
+
$xeFilterPanel.changeOption(evnt, !item._checked, item)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}, (multiple
|
|
98
|
+
? [
|
|
99
|
+
h('span', {
|
|
100
|
+
class: ['vxe-checkbox--icon', isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
101
|
+
})
|
|
102
|
+
]
|
|
103
|
+
: []).concat([
|
|
104
|
+
h('span', {
|
|
105
|
+
class: 'vxe-checkbox--label'
|
|
106
|
+
}, formatText(item.label, 1))
|
|
107
|
+
]))
|
|
108
|
+
}))
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function renderFooter ($xeFilterPanel: any, h: CreateElement) {
|
|
113
|
+
const props = $xeFilterPanel
|
|
114
|
+
const $xeTable = $xeFilterPanel.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
|
|
115
|
+
|
|
116
|
+
const { filterStore } = props
|
|
117
|
+
const { column, multiple } = filterStore
|
|
118
|
+
const filterOpts = $xeTable.computeFilterOpts
|
|
119
|
+
const hasCheckOption = $xeFilterPanel.computeHasCheckOption
|
|
120
|
+
const filterRender = column.filterRender
|
|
121
|
+
const compConf = isEnableConf(filterRender) ? renderer.get(filterRender.name) : null
|
|
122
|
+
const isDisabled = !hasCheckOption && !filterStore.isAllSelected && !filterStore.isIndeterminate
|
|
123
|
+
return multiple && (compConf ? !(compConf.showTableFilterFooter === false || compConf.showFilterFooter === false || compConf.isFooter === false) : true)
|
|
124
|
+
? [
|
|
125
|
+
h('div', {
|
|
126
|
+
class: 'vxe-table--filter-footer'
|
|
127
|
+
}, [
|
|
128
|
+
h('button', {
|
|
129
|
+
class: {
|
|
130
|
+
'is--disabled': isDisabled
|
|
131
|
+
},
|
|
132
|
+
attrs: {
|
|
133
|
+
disabled: isDisabled
|
|
134
|
+
},
|
|
135
|
+
on: {
|
|
136
|
+
click: $xeFilterPanel.confirmFilter
|
|
137
|
+
}
|
|
138
|
+
}, filterOpts.confirmButtonText || getI18n('vxe.table.confirmFilter')),
|
|
139
|
+
h('button', {
|
|
140
|
+
on: {
|
|
141
|
+
click: $xeFilterPanel.resetFilter
|
|
142
|
+
}
|
|
143
|
+
}, filterOpts.resetButtonText || getI18n('vxe.table.resetFilter'))
|
|
144
|
+
])
|
|
145
|
+
]
|
|
146
|
+
: []
|
|
147
|
+
}
|
|
9
148
|
|
|
10
149
|
export default {
|
|
11
150
|
name: 'VxeTableFilterPanel',
|
|
151
|
+
mixins: [
|
|
152
|
+
globalMixins.sizeMixin
|
|
153
|
+
],
|
|
12
154
|
props: {
|
|
13
155
|
filterStore: Object
|
|
14
156
|
},
|
|
157
|
+
inject: {
|
|
158
|
+
$xeTable: {
|
|
159
|
+
default: null
|
|
160
|
+
}
|
|
161
|
+
},
|
|
15
162
|
computed: {
|
|
16
|
-
|
|
163
|
+
computeHasCheckOption () {
|
|
17
164
|
const { filterStore } = this
|
|
18
165
|
return filterStore && filterStore.options.some((option: any) => option.checked)
|
|
19
166
|
}
|
|
20
167
|
} as any,
|
|
168
|
+
mounted (this: any) {
|
|
169
|
+
const $xeFilterPanel = this
|
|
170
|
+
const $xeTable = $xeFilterPanel.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
|
|
171
|
+
const filterOpts = $xeTable.computeFilterOpts
|
|
172
|
+
const { transfer } = filterOpts
|
|
173
|
+
const el = this.$refs.refElem as HTMLDivElement
|
|
174
|
+
|
|
175
|
+
if (transfer && el) {
|
|
176
|
+
document.body.appendChild(el)
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
beforeDestroy (this: any) {
|
|
180
|
+
const el = this.$refs.refElem as HTMLDivElement
|
|
181
|
+
|
|
182
|
+
if (el && el.parentNode) {
|
|
183
|
+
el.parentNode.removeChild(el)
|
|
184
|
+
}
|
|
185
|
+
},
|
|
21
186
|
render (this: any, h: CreateElement) {
|
|
22
|
-
const $
|
|
23
|
-
const
|
|
187
|
+
const $xeFilterPanel = this
|
|
188
|
+
const props = $xeFilterPanel
|
|
189
|
+
const $xeTable = $xeFilterPanel.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
|
|
24
190
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
25
191
|
|
|
26
|
-
const { filterStore } =
|
|
192
|
+
const { filterStore } = props
|
|
27
193
|
const { visible, multiple, column } = filterStore
|
|
28
194
|
const filterRender = column ? column.filterRender : null
|
|
29
195
|
const compConf = isEnableConf(filterRender) ? renderer.get(filterRender.name) : null
|
|
30
196
|
const filterClassName = compConf ? (compConf.tableFilterClassName || compConf.filterClassName) : ''
|
|
31
|
-
const params = Object.assign({}, tableInternalData._currFilterParams, { $panel, $table: $xeTable })
|
|
197
|
+
const params = Object.assign({}, tableInternalData._currFilterParams, { $panel: $xeFilterPanel, $table: $xeTable })
|
|
198
|
+
const tableProps = $xeTable
|
|
199
|
+
const vSize = $xeFilterPanel.computeSize
|
|
32
200
|
const filterOpts = $xeTable.computeFilterOpts
|
|
33
201
|
const { destroyOnClose } = filterOpts
|
|
34
202
|
return h('div', {
|
|
203
|
+
ref: 'refElem',
|
|
35
204
|
class: [
|
|
36
205
|
'vxe-table--filter-wrapper',
|
|
37
206
|
'filter--prevent-default',
|
|
38
207
|
compConf && compConf.className ? compConf.className : '',
|
|
39
208
|
getClass(filterClassName, params),
|
|
40
209
|
{
|
|
41
|
-
|
|
210
|
+
[`size--${vSize}`]: vSize,
|
|
211
|
+
'is--animat': tableProps.animat,
|
|
42
212
|
'is--multiple': multiple,
|
|
43
213
|
'is--active': visible
|
|
44
214
|
}
|
|
45
215
|
],
|
|
46
216
|
style: filterStore.style
|
|
47
|
-
}, filterStore.visible && (destroyOnClose ? visible : true) && column ?
|
|
217
|
+
}, filterStore.visible && (destroyOnClose ? visible : true) && column ? renderOptions($xeFilterPanel, h, filterRender, compConf).concat(renderFooter($xeFilterPanel, h)) : [])
|
|
48
218
|
},
|
|
49
219
|
methods: {
|
|
50
|
-
renderOptions (h: CreateElement, filterRender: any, compConf: any) {
|
|
51
|
-
const $panel = this
|
|
52
|
-
const $xeTable = this.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
53
|
-
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
54
|
-
|
|
55
|
-
const { filterStore } = this
|
|
56
|
-
const { column, multiple, maxHeight } = filterStore
|
|
57
|
-
const slots = column ? column.slots : null
|
|
58
|
-
const filterSlot = slots ? slots.filter : null
|
|
59
|
-
const params = Object.assign({}, tableInternalData._currFilterParams, { $panel, $table: $xeTable })
|
|
60
|
-
const rtFilter = compConf ? (compConf.renderTableFilter || compConf.renderFilter) : null
|
|
61
|
-
if (filterSlot) {
|
|
62
|
-
return [
|
|
63
|
-
h('div', {
|
|
64
|
-
class: 'vxe-table--filter-template',
|
|
65
|
-
style: maxHeight
|
|
66
|
-
? {
|
|
67
|
-
maxHeight: `${maxHeight}px`
|
|
68
|
-
}
|
|
69
|
-
: {}
|
|
70
|
-
}, $xeTable.callSlot(filterSlot, params, h))
|
|
71
|
-
]
|
|
72
|
-
} else if (rtFilter) {
|
|
73
|
-
return [
|
|
74
|
-
h('div', {
|
|
75
|
-
class: 'vxe-table--filter-template',
|
|
76
|
-
style: maxHeight
|
|
77
|
-
? {
|
|
78
|
-
maxHeight: `${maxHeight}px`
|
|
79
|
-
}
|
|
80
|
-
: {}
|
|
81
|
-
}, getSlotVNs(rtFilter.call($xeTable, h, filterRender, params)))
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
const isAllChecked = multiple ? filterStore.isAllSelected : !filterStore.options.some((item: any) => item._checked)
|
|
85
|
-
const isAllIndeterminate = multiple && filterStore.isIndeterminate
|
|
86
|
-
return [
|
|
87
|
-
h('ul', {
|
|
88
|
-
class: 'vxe-table--filter-header'
|
|
89
|
-
}, [
|
|
90
|
-
h('li', {
|
|
91
|
-
class: ['vxe-table--filter-option', {
|
|
92
|
-
'is--checked': isAllChecked,
|
|
93
|
-
'is--indeterminate': isAllIndeterminate
|
|
94
|
-
}],
|
|
95
|
-
attrs: {
|
|
96
|
-
title: getI18n(multiple ? 'vxe.table.allTitle' : 'vxe.table.allFilter')
|
|
97
|
-
},
|
|
98
|
-
on: {
|
|
99
|
-
click: (evnt: MouseEvent) => {
|
|
100
|
-
this.changeAllOption(evnt, !filterStore.isAllSelected)
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}, (multiple
|
|
104
|
-
? [
|
|
105
|
-
h('span', {
|
|
106
|
-
class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
107
|
-
})
|
|
108
|
-
]
|
|
109
|
-
: []).concat([
|
|
110
|
-
h('span', {
|
|
111
|
-
class: 'vxe-checkbox--label'
|
|
112
|
-
}, getI18n('vxe.table.allFilter'))
|
|
113
|
-
]))
|
|
114
|
-
]),
|
|
115
|
-
h('ul', {
|
|
116
|
-
class: 'vxe-table--filter-body',
|
|
117
|
-
style: maxHeight
|
|
118
|
-
? {
|
|
119
|
-
maxHeight: `${maxHeight}px`
|
|
120
|
-
}
|
|
121
|
-
: {}
|
|
122
|
-
}, filterStore.options.map((item: any) => {
|
|
123
|
-
const isChecked = item._checked
|
|
124
|
-
const isIndeterminate = false
|
|
125
|
-
return h('li', {
|
|
126
|
-
class: ['vxe-table--filter-option', {
|
|
127
|
-
'is--checked': isChecked
|
|
128
|
-
}],
|
|
129
|
-
attrs: {
|
|
130
|
-
title: item.label
|
|
131
|
-
},
|
|
132
|
-
on: {
|
|
133
|
-
click: (evnt: MouseEvent) => {
|
|
134
|
-
this.changeOption(evnt, !item._checked, item)
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}, (multiple
|
|
138
|
-
? [
|
|
139
|
-
h('span', {
|
|
140
|
-
class: ['vxe-checkbox--icon', isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
141
|
-
})
|
|
142
|
-
]
|
|
143
|
-
: []).concat([
|
|
144
|
-
h('span', {
|
|
145
|
-
class: 'vxe-checkbox--label'
|
|
146
|
-
}, formatText(item.label, 1))
|
|
147
|
-
]))
|
|
148
|
-
}))
|
|
149
|
-
]
|
|
150
|
-
},
|
|
151
|
-
renderFooter (h: CreateElement) {
|
|
152
|
-
const $xeTable = this.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
153
|
-
|
|
154
|
-
const { hasCheckOption, filterStore } = this
|
|
155
|
-
const { column, multiple } = filterStore
|
|
156
|
-
const filterOpts = $xeTable.computeFilterOpts
|
|
157
|
-
const filterRender = column.filterRender
|
|
158
|
-
const compConf = isEnableConf(filterRender) ? renderer.get(filterRender.name) : null
|
|
159
|
-
const isDisabled = !hasCheckOption && !filterStore.isAllSelected && !filterStore.isIndeterminate
|
|
160
|
-
return multiple && (compConf ? !(compConf.showTableFilterFooter === false || compConf.showFilterFooter === false || compConf.isFooter === false) : true)
|
|
161
|
-
? [
|
|
162
|
-
h('div', {
|
|
163
|
-
class: 'vxe-table--filter-footer'
|
|
164
|
-
}, [
|
|
165
|
-
h('button', {
|
|
166
|
-
class: {
|
|
167
|
-
'is--disabled': isDisabled
|
|
168
|
-
},
|
|
169
|
-
attrs: {
|
|
170
|
-
disabled: isDisabled
|
|
171
|
-
},
|
|
172
|
-
on: {
|
|
173
|
-
click: this.confirmFilter
|
|
174
|
-
}
|
|
175
|
-
}, filterOpts.confirmButtonText || getI18n('vxe.table.confirmFilter')),
|
|
176
|
-
h('button', {
|
|
177
|
-
on: {
|
|
178
|
-
click: this.resetFilter
|
|
179
|
-
}
|
|
180
|
-
}, filterOpts.resetButtonText || getI18n('vxe.table.resetFilter'))
|
|
181
|
-
])
|
|
182
|
-
]
|
|
183
|
-
: []
|
|
184
|
-
},
|
|
185
220
|
// 全部筛选事件
|
|
186
221
|
filterCheckAllEvent (evnt: any, value: any) {
|
|
187
222
|
const filterStore = this.filterStore
|
|
@@ -89,7 +89,7 @@ function renderTdColumn (
|
|
|
89
89
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
90
90
|
const $xeGrid = $xeTable.$xeGrid
|
|
91
91
|
|
|
92
|
-
const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps
|
|
92
|
+
const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, treeConfig, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps
|
|
93
93
|
const { tableData, dragRow, overflowX, currentColumn, scrollXLoad, scrollYLoad, mergeBodyFlag, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag, editStore, isAllOverflow, validErrorMaps } = tableReactData
|
|
94
94
|
const { fullAllDataRowIdData, fullColumnIdData, mergeBodyCellMaps, visibleColumn, afterFullData, mergeBodyList, scrollXStore, scrollYStore } = tableInternalData
|
|
95
95
|
const cellOpts = $xeTable.computeCellOpts
|
|
@@ -97,6 +97,8 @@ function renderTdColumn (
|
|
|
97
97
|
const checkboxOpts = $xeTable.computeCheckboxOpts
|
|
98
98
|
const editOpts = $xeTable.computeEditOpts
|
|
99
99
|
const tooltipOpts = $xeTable.computeTooltipOpts
|
|
100
|
+
const virtualXOpts = $xeTable.computeVirtualXOpts
|
|
101
|
+
const virtualYOpts = $xeTable.computeVirtualYOpts
|
|
100
102
|
const { isAllColumnDrag, isAllRowDrag } = $xeTable.resizableOpts
|
|
101
103
|
const rowOpts = $xeTable.computeRowOpts
|
|
102
104
|
const rowDragOpts = $xeTable.computeRowDragOpts
|
|
@@ -268,9 +270,9 @@ function renderTdColumn (
|
|
|
268
270
|
let isVNPreEmptyStatus = false
|
|
269
271
|
if (!isMergeCell) {
|
|
270
272
|
if (!dragRow || getRowid($xeTable, dragRow) !== rowid) {
|
|
271
|
-
if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
273
|
+
if (scrollYLoad && !treeConfig && !virtualYOpts.immediate && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
272
274
|
isVNPreEmptyStatus = true
|
|
273
|
-
} else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
275
|
+
} else if (scrollXLoad && !virtualXOpts.immediate && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
274
276
|
isVNPreEmptyStatus = true
|
|
275
277
|
}
|
|
276
278
|
}
|
|
@@ -23,8 +23,10 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
|
|
|
23
23
|
const { resizable: allResizable, border, footerCellClassName, footerCellStyle, footerAlign: allFooterAlign, footerSpanMethod, align: allAlign, columnKey, showFooterOverflow: allColumnFooterOverflow } = tableProps
|
|
24
24
|
const { scrollXLoad, scrollYLoad, overflowX, currentColumn } = tableReactData
|
|
25
25
|
const { fullColumnIdData, mergeFooterList, mergeFooterCellMaps, scrollXStore } = tableInternalData
|
|
26
|
+
const virtualXOpts = $xeTable.computeVirtualXOpts
|
|
26
27
|
const tooltipOpts = $xeTable.computeTooltipOpts
|
|
27
|
-
const
|
|
28
|
+
const resizableOpts = $xeTable.resizableOpts
|
|
29
|
+
const { isAllColumnDrag } = resizableOpts
|
|
28
30
|
const columnOpts = $xeTable.computeColumnOpts
|
|
29
31
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight
|
|
30
32
|
const cellOpts = $xeTable.computeCellOpts
|
|
@@ -134,7 +136,7 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
|
|
|
134
136
|
|
|
135
137
|
let isVNPreEmptyStatus = false
|
|
136
138
|
if (!isMergeCell) {
|
|
137
|
-
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
139
|
+
if (scrollXLoad && !column.fixed && !virtualXOpts.immediate && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
138
140
|
isVNPreEmptyStatus = true
|
|
139
141
|
}
|
|
140
142
|
}
|
|
@@ -22,6 +22,7 @@ const renderRows = (h: CreateElement, _vm: any, isGroup: boolean, isOptimizeMode
|
|
|
22
22
|
const { resizable: allResizable, columnKey, headerCellClassName, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, mouseConfig } = tableProps
|
|
23
23
|
const { currentColumn, dragCol, scrollXLoad, scrollYLoad, overflowX } = tableReactData
|
|
24
24
|
const { fullColumnIdData, scrollXStore } = tableInternalData
|
|
25
|
+
const virtualXOpts = $xeTable.computeVirtualXOpts
|
|
25
26
|
const columnOpts = $xeTable.computeColumnOpts
|
|
26
27
|
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
27
28
|
const cellOpts = $xeTable.computeCellOpts
|
|
@@ -92,7 +93,7 @@ const renderRows = (h: CreateElement, _vm: any, isGroup: boolean, isOptimizeMode
|
|
|
92
93
|
let isVNPreEmptyStatus = false
|
|
93
94
|
if (!isGroup) {
|
|
94
95
|
if (!dragCol || dragCol.id !== colid) {
|
|
95
|
-
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
96
|
+
if (scrollXLoad && !column.fixed && !virtualXOpts.immediate && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
96
97
|
isVNPreEmptyStatus = true
|
|
97
98
|
}
|
|
98
99
|
}
|