vxe-table 3.19.39 → 3.20.0-beta.1
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.esm.js +2 -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/mixin.js +6 -4
- package/es/table/module/custom/panel.js +806 -799
- package/es/table/module/edit/mixin.js +43 -31
- package/es/table/module/export/export-panel.js +511 -458
- package/es/table/module/export/import-panel.js +224 -192
- package/es/table/module/keyboard/mixin.js +2 -2
- package/es/table/module/menu/panel.js +165 -161
- package/es/table/module/validator/mixin.js +255 -236
- package/es/table/src/body.js +2 -1
- package/es/table/src/cell.js +2 -2
- package/es/table/src/methods.js +33 -43
- package/es/table/src/table.js +13 -249
- package/es/table/src/util.js +242 -0
- package/es/table/style.css +23 -50
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +2 -2
- package/es/ui/src/dom.js +22 -0
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +23 -50
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.common.js +2 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +3640 -4790
- 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/mixin.js +6 -4
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +693 -685
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +47 -31
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/export-panel.js +450 -384
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +200 -159
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +2 -2
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/panel.js +119 -114
- package/lib/table/module/menu/panel.min.js +1 -1
- package/lib/table/module/validator/mixin.js +271 -259
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/src/body.js +2 -1
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +2 -2
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/methods.js +33 -45
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +12 -248
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +243 -0
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +23 -50
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +2 -2
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +22 -0
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +2 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/vxe-colgroup/index.js +2 -1
- package/lib/vxe-colgroup/index.min.js +1 -1
- package/lib/vxe-column/index.js +2 -1
- package/lib/vxe-column/index.min.js +1 -1
- package/lib/vxe-grid/index.js +2 -1
- package/lib/vxe-grid/index.min.js +1 -1
- package/lib/vxe-table/index.js +2 -1
- package/lib/vxe-table/index.min.js +1 -1
- package/lib/vxe-table/style/style.css +23 -50
- package/lib/vxe-table/style/style.min.css +1 -1
- package/lib/vxe-toolbar/index.js +2 -1
- package/lib/vxe-toolbar/index.min.js +1 -1
- package/lib/vxe-ui/index.js +2 -1
- package/lib/vxe-ui/index.min.js +1 -1
- package/lib/vxe-v-x-e-table/index.js +2 -1
- package/lib/vxe-v-x-e-table/index.min.js +1 -1
- package/package.json +1 -1
- package/packages/table/module/custom/mixin.ts +7 -4
- package/packages/table/module/custom/panel.ts +846 -839
- package/packages/table/module/edit/mixin.ts +55 -35
- package/packages/table/module/export/export-panel.ts +545 -469
- package/packages/table/module/export/import-panel.ts +245 -202
- package/packages/table/module/filter/panel.ts +4 -18
- package/packages/table/module/keyboard/mixin.ts +2 -2
- package/packages/table/module/menu/panel.ts +171 -163
- package/packages/table/module/validator/mixin.ts +279 -240
- package/packages/table/src/body.ts +2 -1
- package/packages/table/src/cell.ts +2 -2
- package/packages/table/src/methods.ts +43 -45
- package/packages/table/src/table.ts +14 -260
- package/packages/table/src/util.ts +254 -0
- package/packages/ui/index.ts +1 -1
- package/packages/ui/src/dom.ts +22 -0
- package/styles/components/table.scss +5 -2
- package/styles/theme/base.scss +2 -1
- /package/es/{iconfont.1767145426781.ttf → iconfont.1767492234857.ttf} +0 -0
- /package/es/{iconfont.1767145426781.woff → iconfont.1767492234857.woff} +0 -0
- /package/es/{iconfont.1767145426781.woff2 → iconfont.1767492234857.woff2} +0 -0
- /package/lib/{iconfont.1767145426781.ttf → iconfont.1767492234857.ttf} +0 -0
- /package/lib/{iconfont.1767145426781.woff → iconfont.1767492234857.woff} +0 -0
- /package/lib/{iconfont.1767145426781.woff2 → iconfont.1767492234857.woff2} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CreateElement } from 'vue'
|
|
2
|
+
import { defineVxeComponent } from '../../../ui/src/comp'
|
|
2
3
|
import { VxeUI } from '../../../ui'
|
|
3
4
|
import XEUtils from 'xe-utils'
|
|
4
5
|
import { getFuncText } from '../../../ui/src/utils'
|
|
@@ -8,197 +9,204 @@ import type { VxeTableConstructor, VxeTablePrivateMethods, TableReactData } from
|
|
|
8
9
|
|
|
9
10
|
const { getIcon, getI18n, renderEmptyElement } = VxeUI
|
|
10
11
|
|
|
11
|
-
export default {
|
|
12
|
+
export default /* define-vxe-component start */ defineVxeComponent({
|
|
12
13
|
name: 'VxeTableMenuPanel',
|
|
13
|
-
props: {
|
|
14
|
-
ctxMenuStore: Object,
|
|
15
|
-
ctxMenuOpts: Object
|
|
16
|
-
},
|
|
17
14
|
inject: {
|
|
18
15
|
$xeTable: {
|
|
19
16
|
default: null
|
|
20
17
|
}
|
|
21
18
|
},
|
|
19
|
+
computed: {
|
|
20
|
+
...({} as {
|
|
21
|
+
$xeTable(): VxeTableConstructor & VxeTablePrivateMethods
|
|
22
|
+
})
|
|
23
|
+
},
|
|
22
24
|
mounted () {
|
|
23
25
|
const $xeMenuPanel = this
|
|
24
|
-
const $xeTable = $xeMenuPanel.$xeTable
|
|
26
|
+
const $xeTable = $xeMenuPanel.$xeTable
|
|
25
27
|
const menuOpts = $xeTable.computeMenuOpts
|
|
26
28
|
const { transfer } = menuOpts
|
|
27
|
-
const el =
|
|
29
|
+
const el = $xeMenuPanel.$refs.refElem as HTMLDivElement
|
|
28
30
|
|
|
29
31
|
if (transfer && el) {
|
|
30
32
|
document.body.appendChild(el)
|
|
31
33
|
}
|
|
32
34
|
},
|
|
33
35
|
beforeDestroy () {
|
|
34
|
-
const
|
|
36
|
+
const $xeMenuPanel = this
|
|
37
|
+
const el = $xeMenuPanel.$refs.refElem as HTMLDivElement
|
|
35
38
|
|
|
36
39
|
if (el && el.parentNode) {
|
|
37
40
|
el.parentNode.removeChild(el)
|
|
38
41
|
}
|
|
39
42
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
methods: {
|
|
44
|
+
renderVN (h: CreateElement) {
|
|
45
|
+
const $xeMenuPanel = this
|
|
46
|
+
const $xeTable = $xeMenuPanel.$xeTable
|
|
47
|
+
const tableReactData = $xeTable as unknown as TableReactData
|
|
44
48
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}, [
|
|
80
|
-
h('a', {
|
|
81
|
-
class: 'vxe-context-menu--link',
|
|
82
|
-
on: {
|
|
83
|
-
click (evnt: Event) {
|
|
84
|
-
$xeTable.ctxMenuLinkEvent(evnt, item)
|
|
85
|
-
},
|
|
86
|
-
mouseover (evnt: Event) {
|
|
87
|
-
$xeTable.ctxMenuMouseoverEvent(evnt, item)
|
|
88
|
-
},
|
|
89
|
-
mouseout (evnt: Event) {
|
|
90
|
-
$xeTable.ctxMenuMouseoutEvent(evnt, item)
|
|
91
|
-
}
|
|
92
|
-
}
|
|
49
|
+
const { ctxMenuStore } = tableReactData
|
|
50
|
+
const menuOpts = $xeTable.computeMenuOpts
|
|
51
|
+
const { destroyOnClose } = menuOpts
|
|
52
|
+
const { visible, list, className } = ctxMenuStore
|
|
53
|
+
return h('div', {
|
|
54
|
+
ref: 'refElem',
|
|
55
|
+
class: ['vxe-table--context-menu-wrapper', className, {
|
|
56
|
+
'is--visible': visible
|
|
57
|
+
}],
|
|
58
|
+
style: ctxMenuStore.style
|
|
59
|
+
}, (destroyOnClose ? visible : true)
|
|
60
|
+
? list.map((options, gIndex) => {
|
|
61
|
+
return options.every((item) => item.visible === false)
|
|
62
|
+
? renderEmptyElement($xeTable)
|
|
63
|
+
: h('ul', {
|
|
64
|
+
class: 'vxe-context-menu--option-wrapper',
|
|
65
|
+
key: gIndex
|
|
66
|
+
}, options.map((item, index) => {
|
|
67
|
+
const { children, loading } = item
|
|
68
|
+
const hasChildMenus = children && children.some((child) => child.visible !== false)
|
|
69
|
+
const prefixOpts = Object.assign({}, item.prefixConfig)
|
|
70
|
+
const prefixIcon = prefixOpts.icon || item.prefixIcon
|
|
71
|
+
const suffixOpts = Object.assign({}, item.suffixConfig)
|
|
72
|
+
const suffixIcon = suffixOpts.icon || item.suffixIcon
|
|
73
|
+
const menuContent = getFuncText(item.name)
|
|
74
|
+
return item.visible === false
|
|
75
|
+
? renderEmptyElement($xeTable)
|
|
76
|
+
: h('li', {
|
|
77
|
+
class: [item.className, {
|
|
78
|
+
'link--loading': loading,
|
|
79
|
+
'link--disabled': item.disabled,
|
|
80
|
+
'link--active': item === ctxMenuStore.selected
|
|
81
|
+
}],
|
|
82
|
+
key: `${gIndex}_${index}`
|
|
93
83
|
}, [
|
|
94
|
-
h('
|
|
95
|
-
class:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
})
|
|
107
|
-
])),
|
|
108
|
-
prefixOpts.content ? h('span', {}, `${prefixOpts.content}`) : renderEmptyElement($xeTable)
|
|
109
|
-
]),
|
|
110
|
-
h('span', {
|
|
111
|
-
class: 'vxe-context-menu--link-content',
|
|
112
|
-
attrs: {
|
|
113
|
-
title: menuContent
|
|
84
|
+
h('a', {
|
|
85
|
+
class: 'vxe-context-menu--link',
|
|
86
|
+
on: {
|
|
87
|
+
click (evnt: Event) {
|
|
88
|
+
$xeTable.ctxMenuLinkEvent(evnt, item)
|
|
89
|
+
},
|
|
90
|
+
mouseover (evnt: Event) {
|
|
91
|
+
$xeTable.ctxMenuMouseoverEvent(evnt, item)
|
|
92
|
+
},
|
|
93
|
+
mouseout (evnt: Event) {
|
|
94
|
+
$xeTable.ctxMenuMouseoutEvent(evnt, item)
|
|
95
|
+
}
|
|
114
96
|
}
|
|
115
|
-
}, loading ? getI18n('vxe.table.menuLoading') : menuContent),
|
|
116
|
-
h('div', {
|
|
117
|
-
class: ['vxe-context-menu--link-suffix', suffixOpts.className || '']
|
|
118
97
|
}, [
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}]
|
|
132
|
-
}, item.children.map((child, cIndex) => {
|
|
133
|
-
const { loading: childLoading } = child
|
|
134
|
-
const childPrefixOpts = Object.assign({}, child.prefixConfig)
|
|
135
|
-
const childPrefixIcon = childPrefixOpts.icon || child.prefixIcon
|
|
136
|
-
const childSuffixOpts = Object.assign({}, child.suffixConfig)
|
|
137
|
-
const childSuffixIcon = childSuffixOpts.icon || child.suffixIcon
|
|
138
|
-
const childMenuContent = getFuncText(child.name)
|
|
139
|
-
return child.visible === false
|
|
140
|
-
? null
|
|
141
|
-
: h('li', {
|
|
142
|
-
class: [child.className, {
|
|
143
|
-
'link--loading': childLoading,
|
|
144
|
-
'link--disabled': child.disabled,
|
|
145
|
-
'link--active': child === ctxMenuStore.selectChild
|
|
146
|
-
}],
|
|
147
|
-
key: `${gIndex}_${index}_${cIndex}`
|
|
148
|
-
}, [
|
|
149
|
-
h('a', {
|
|
150
|
-
class: 'vxe-context-menu--link',
|
|
151
|
-
on: {
|
|
152
|
-
click (evnt: Event) {
|
|
153
|
-
$xeTable.ctxMenuLinkEvent(evnt, child)
|
|
154
|
-
},
|
|
155
|
-
mouseover (evnt: Event) {
|
|
156
|
-
$xeTable.ctxMenuMouseoverEvent(evnt, item, child)
|
|
157
|
-
},
|
|
158
|
-
mouseout (evnt: Event) {
|
|
159
|
-
$xeTable.ctxMenuMouseoutEvent(evnt, item)
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}, [
|
|
163
|
-
h('div', {
|
|
164
|
-
class: ['vxe-context-menu--link-prefix', childPrefixOpts.className || '']
|
|
165
|
-
}, [
|
|
166
|
-
child.loading
|
|
167
|
-
? h('span', {
|
|
168
|
-
class: getIcon('TABLE_MENU_OPTION_LOADING')
|
|
98
|
+
h('div', {
|
|
99
|
+
class: ['vxe-context-menu--link-prefix', prefixOpts.className || '']
|
|
100
|
+
}, [
|
|
101
|
+
loading
|
|
102
|
+
? h('span', {
|
|
103
|
+
class: getIcon('TABLE_MENU_OPTION_LOADING')
|
|
104
|
+
})
|
|
105
|
+
: (prefixIcon && XEUtils.isFunction(prefixIcon)
|
|
106
|
+
? h('span', {}, getSlotVNs(prefixIcon.call($xeTable, {})))
|
|
107
|
+
: h('span', {}, [
|
|
108
|
+
h('i', {
|
|
109
|
+
class: prefixIcon
|
|
169
110
|
})
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
111
|
+
])),
|
|
112
|
+
prefixOpts.content ? h('span', {}, `${prefixOpts.content}`) : renderEmptyElement($xeTable)
|
|
113
|
+
]),
|
|
114
|
+
h('span', {
|
|
115
|
+
class: 'vxe-context-menu--link-content',
|
|
116
|
+
attrs: {
|
|
117
|
+
title: menuContent
|
|
118
|
+
}
|
|
119
|
+
}, loading ? getI18n('vxe.table.menuLoading') : menuContent),
|
|
120
|
+
h('div', {
|
|
121
|
+
class: ['vxe-context-menu--link-suffix', suffixOpts.className || '']
|
|
122
|
+
}, [
|
|
123
|
+
suffixIcon && XEUtils.isFunction(suffixIcon)
|
|
124
|
+
? h('span', {}, getSlotVNs(suffixIcon.call($xeTable, {})))
|
|
125
|
+
: h('i', {
|
|
126
|
+
class: suffixIcon || (hasChildMenus ? getIcon().TABLE_MENU_OPTIONS : '')
|
|
127
|
+
}),
|
|
128
|
+
suffixOpts.content ? h('span', `${suffixOpts.content}`) : renderEmptyElement($xeTable)
|
|
129
|
+
])
|
|
130
|
+
]),
|
|
131
|
+
hasChildMenus && item.children
|
|
132
|
+
? h('ul', {
|
|
133
|
+
class: ['vxe-table--context-menu-clild-wrapper', {
|
|
134
|
+
'is--show': item === ctxMenuStore.selected && ctxMenuStore.showChild
|
|
135
|
+
}]
|
|
136
|
+
}, item.children.map((child, cIndex) => {
|
|
137
|
+
const { loading: childLoading } = child
|
|
138
|
+
const childPrefixOpts = Object.assign({}, child.prefixConfig)
|
|
139
|
+
const childPrefixIcon = childPrefixOpts.icon || child.prefixIcon
|
|
140
|
+
const childSuffixOpts = Object.assign({}, child.suffixConfig)
|
|
141
|
+
const childSuffixIcon = childSuffixOpts.icon || child.suffixIcon
|
|
142
|
+
const childMenuContent = getFuncText(child.name)
|
|
143
|
+
return child.visible === false
|
|
144
|
+
? null
|
|
145
|
+
: h('li', {
|
|
146
|
+
class: [child.className, {
|
|
147
|
+
'link--loading': childLoading,
|
|
148
|
+
'link--disabled': child.disabled,
|
|
149
|
+
'link--active': child === ctxMenuStore.selectChild
|
|
150
|
+
}],
|
|
151
|
+
key: `${gIndex}_${index}_${cIndex}`
|
|
152
|
+
}, [
|
|
153
|
+
h('a', {
|
|
154
|
+
class: 'vxe-context-menu--link',
|
|
155
|
+
on: {
|
|
156
|
+
click (evnt: Event) {
|
|
157
|
+
$xeTable.ctxMenuLinkEvent(evnt, child)
|
|
158
|
+
},
|
|
159
|
+
mouseover (evnt: Event) {
|
|
160
|
+
$xeTable.ctxMenuMouseoverEvent(evnt, item, child)
|
|
161
|
+
},
|
|
162
|
+
mouseout (evnt: Event) {
|
|
163
|
+
$xeTable.ctxMenuMouseoutEvent(evnt, item)
|
|
164
|
+
}
|
|
183
165
|
}
|
|
184
|
-
}, childLoading ? getI18n('vxe.table.menuLoading') : childMenuContent),
|
|
185
|
-
h('div', {
|
|
186
|
-
class: ['vxe-context-menu--link-suffix', childSuffixOpts.className || '']
|
|
187
166
|
}, [
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
167
|
+
h('div', {
|
|
168
|
+
class: ['vxe-context-menu--link-prefix', childPrefixOpts.className || '']
|
|
169
|
+
}, [
|
|
170
|
+
child.loading
|
|
171
|
+
? h('span', {
|
|
172
|
+
class: getIcon('TABLE_MENU_OPTION_LOADING')
|
|
173
|
+
})
|
|
174
|
+
: (childPrefixIcon && XEUtils.isFunction(childPrefixIcon)
|
|
175
|
+
? h('span', {}, getSlotVNs(childPrefixIcon({})))
|
|
176
|
+
: h('span', {}, [
|
|
177
|
+
h('i', {
|
|
178
|
+
class: childPrefixIcon
|
|
179
|
+
})
|
|
180
|
+
])),
|
|
181
|
+
childPrefixOpts.content ? h('span', `${childPrefixOpts.content}`) : renderEmptyElement($xeTable)
|
|
182
|
+
]),
|
|
183
|
+
h('span', {
|
|
184
|
+
class: 'vxe-context-menu--link-content',
|
|
185
|
+
attrs: {
|
|
186
|
+
title: childMenuContent
|
|
187
|
+
}
|
|
188
|
+
}, childLoading ? getI18n('vxe.table.menuLoading') : childMenuContent),
|
|
189
|
+
h('div', {
|
|
190
|
+
class: ['vxe-context-menu--link-suffix', childSuffixOpts.className || '']
|
|
191
|
+
}, [
|
|
192
|
+
childSuffixIcon && XEUtils.isFunction(childSuffixIcon)
|
|
193
|
+
? h('span', {}, getSlotVNs(childSuffixIcon.call($xeTable, {})))
|
|
194
|
+
: h('i', {
|
|
195
|
+
class: childSuffixIcon
|
|
196
|
+
}),
|
|
197
|
+
childSuffixOpts.content ? h('span', `${childSuffixOpts.content}`) : renderEmptyElement($xeTable)
|
|
198
|
+
])
|
|
194
199
|
])
|
|
195
200
|
])
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
}))
|
|
202
|
+
: null
|
|
203
|
+
])
|
|
204
|
+
}))
|
|
205
|
+
})
|
|
206
|
+
: [])
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
render (h: CreateElement) {
|
|
210
|
+
return (this as any).renderVN(h)
|
|
203
211
|
}
|
|
204
|
-
}
|
|
212
|
+
}) /* define-vxe-component end */
|