vxe-table 4.18.5 → 4.18.7
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/LICENSE +20 -20
- package/README.en.md +118 -118
- package/README.ja-JP.md +117 -117
- package/README.md +268 -268
- package/README.zh-TW.md +117 -117
- package/es/style.css +1 -1
- package/es/table/src/table.js +54 -0
- package/es/table/src/util.js +3 -4
- package/es/table/style.css +48 -18
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +48 -18
- package/lib/index.common.js +1 -2
- package/lib/index.umd.js +2832 -2732
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/table.js +5 -4
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +4 -6
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +48 -18
- 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/v-x-e-table/index.js +1 -2
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/vxe-colgroup/index.js +1 -2
- package/lib/vxe-colgroup/index.min.js +1 -1
- package/lib/vxe-column/index.js +1 -2
- package/lib/vxe-column/index.min.js +1 -1
- package/lib/vxe-grid/index.js +1 -2
- package/lib/vxe-grid/index.min.js +1 -1
- package/lib/vxe-table/index.js +1 -2
- package/lib/vxe-table/index.min.js +1 -1
- package/lib/vxe-table/style/style.css +48 -18
- package/lib/vxe-toolbar/index.js +1 -2
- package/lib/vxe-toolbar/index.min.js +1 -1
- package/lib/vxe-ui/index.js +1 -2
- package/lib/vxe-ui/index.min.js +1 -1
- package/lib/vxe-v-x-e-table/index.js +1 -2
- package/lib/vxe-v-x-e-table/index.min.js +1 -1
- package/package.json +91 -91
- package/packages/colgroup/index.ts +22 -22
- package/packages/column/index.ts +22 -22
- package/packages/components.ts +43 -43
- package/packages/grid/index.ts +18 -18
- package/packages/grid/src/emits.ts +19 -19
- package/packages/grid/src/grid.ts +1768 -1768
- package/packages/grid/src/props.ts +23 -23
- package/packages/index.ts +4 -4
- package/packages/locale/lang/ar-EG.ts +832 -832
- package/packages/locale/lang/de-DE.ts +832 -832
- package/packages/locale/lang/en-US.ts +832 -832
- package/packages/locale/lang/es-ES.ts +832 -832
- package/packages/locale/lang/fr-FR.ts +832 -832
- package/packages/locale/lang/hu-HU.ts +832 -832
- package/packages/locale/lang/hy-AM.ts +832 -832
- package/packages/locale/lang/id-ID.ts +832 -832
- package/packages/locale/lang/it-IT.ts +832 -832
- package/packages/locale/lang/ja-JP.ts +832 -832
- package/packages/locale/lang/ko-KR.ts +832 -832
- package/packages/locale/lang/ms-MY.ts +832 -832
- package/packages/locale/lang/nb-NO.ts +832 -832
- package/packages/locale/lang/pt-BR.ts +832 -832
- package/packages/locale/lang/ru-RU.ts +832 -832
- package/packages/locale/lang/th-TH.ts +832 -832
- package/packages/locale/lang/ug-CN.ts +832 -832
- package/packages/locale/lang/uk-UA.ts +832 -832
- package/packages/locale/lang/uz-UZ.ts +832 -832
- package/packages/locale/lang/vi-VN.ts +832 -832
- package/packages/locale/lang/zh-CHT.ts +832 -832
- package/packages/locale/lang/zh-CN.ts +832 -832
- package/packages/locale/lang/zh-HK.ts +3 -3
- package/packages/locale/lang/zh-MO.ts +3 -3
- package/packages/locale/lang/zh-TC.ts +3 -3
- package/packages/locale/lang/zh-TW.ts +3 -3
- package/packages/table/index.ts +26 -26
- package/packages/table/module/custom/hook.ts +359 -359
- package/packages/table/module/custom/panel.ts +1331 -1331
- package/packages/table/module/edit/hook.ts +1032 -1032
- package/packages/table/module/export/export-panel.ts +567 -567
- package/packages/table/module/export/hook.ts +1654 -1654
- package/packages/table/module/export/import-panel.ts +266 -266
- package/packages/table/module/export/util.ts +24 -24
- package/packages/table/module/filter/hook.ts +468 -468
- package/packages/table/module/filter/panel.ts +301 -301
- package/packages/table/module/keyboard/hook.ts +495 -495
- package/packages/table/module/menu/hook.ts +325 -325
- package/packages/table/module/menu/panel.ts +201 -201
- package/packages/table/module/validator/hook.ts +631 -631
- package/packages/table/render/index.ts +1440 -1440
- package/packages/table/src/body.ts +932 -932
- package/packages/table/src/cell.ts +1290 -1290
- package/packages/table/src/column.ts +190 -190
- package/packages/table/src/columnInfo.ts +225 -225
- package/packages/table/src/emits.ts +123 -123
- package/packages/table/src/footer.ts +368 -368
- package/packages/table/src/group.ts +59 -59
- package/packages/table/src/header.ts +559 -559
- package/packages/table/src/props.ts +324 -324
- package/packages/table/src/store.ts +14 -14
- package/packages/table/src/table.ts +14004 -13947
- package/packages/table/src/use/cell-view.ts +44 -44
- package/packages/table/src/use/index.ts +1 -1
- package/packages/table/src/util.ts +1064 -1064
- package/packages/toolbar/index.ts +18 -18
- package/packages/toolbar/src/toolbar.ts +701 -701
- package/packages/ui/index.ts +530 -530
- package/packages/ui/src/anime.ts +52 -52
- package/packages/ui/src/comp.ts +3 -3
- package/packages/ui/src/dom.ts +236 -236
- package/packages/ui/src/log.ts +8 -8
- package/packages/ui/src/utils.ts +56 -56
- package/packages/ui/src/vn.ts +55 -55
- package/packages/v-x-e-table/index.d.ts +4 -4
- package/packages/v-x-e-table/index.ts +4 -4
- package/styles/all.scss +7 -7
- package/styles/base.scss +16 -16
- package/styles/components/grid.scss +89 -89
- package/styles/components/icon.scss +225 -225
- package/styles/components/old-icon.scss +715 -715
- package/styles/components/table-module/all.scss +6 -6
- package/styles/components/table-module/custom.scss +527 -527
- package/styles/components/table-module/export.scss +130 -130
- package/styles/components/table-module/filter.scss +130 -130
- package/styles/components/table-module/menu.scss +81 -81
- package/styles/components/table.scss +2679 -2679
- package/styles/components/toolbar.scss +119 -119
- package/styles/default.scss +2 -2
- package/styles/helpers/baseMixin.scss +95 -95
- package/styles/index.scss +4 -4
- package/styles/modules.scss +5 -5
- package/styles/theme/base.scss +93 -93
- package/styles/theme/dark.scss +49 -49
- package/styles/theme/light.scss +44 -44
- package/styles/variable.scss +43 -43
- package/types/all.d.ts +37 -37
- package/types/index.d.ts +4 -4
- /package/es/{iconfont.1773710736571.ttf → iconfont.1773991907408.ttf} +0 -0
- /package/es/{iconfont.1773710736571.woff → iconfont.1773991907408.woff} +0 -0
- /package/es/{iconfont.1773710736571.woff2 → iconfont.1773991907408.woff2} +0 -0
- /package/lib/{iconfont.1773710736571.ttf → iconfont.1773991907408.ttf} +0 -0
- /package/lib/{iconfont.1773710736571.woff → iconfont.1773991907408.woff} +0 -0
- /package/lib/{iconfont.1773710736571.woff2 → iconfont.1773991907408.woff2} +0 -0
|
@@ -1,201 +1,201 @@
|
|
|
1
|
-
import { h, Teleport, inject, ref, Ref } from 'vue'
|
|
2
|
-
import { defineVxeComponent } from '../../../ui/src/comp'
|
|
3
|
-
import XEUtils from 'xe-utils'
|
|
4
|
-
import { VxeUI } from '../../../ui'
|
|
5
|
-
import { getFuncText } from '../../../ui/src/utils'
|
|
6
|
-
import { getSlotVNs } from '../../../ui/src/vn'
|
|
7
|
-
|
|
8
|
-
import type { VxeTablePrivateMethods, VxeTableConstructor, VxeTableMethods } from '../../../../types'
|
|
9
|
-
|
|
10
|
-
const { getIcon, getI18n, renderEmptyElement } = VxeUI
|
|
11
|
-
|
|
12
|
-
export default defineVxeComponent({
|
|
13
|
-
name: 'VxeTableMenuPanel',
|
|
14
|
-
setup (props, context) {
|
|
15
|
-
const xID = XEUtils.uniqueId()
|
|
16
|
-
|
|
17
|
-
const $xeTable = inject('$xeTable', {} as VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods)
|
|
18
|
-
|
|
19
|
-
const { reactData: tableReactData } = $xeTable
|
|
20
|
-
|
|
21
|
-
const refElem = ref() as Ref<HTMLDivElement>
|
|
22
|
-
|
|
23
|
-
const refMaps = {
|
|
24
|
-
refElem
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const $xeMenuPanel: any = {
|
|
28
|
-
xID,
|
|
29
|
-
props,
|
|
30
|
-
context,
|
|
31
|
-
getRefMaps: () => refMaps
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const renderVN = () => {
|
|
35
|
-
const { ctxMenuStore } = tableReactData
|
|
36
|
-
const { computeMenuOpts } = $xeTable.getComputeMaps()
|
|
37
|
-
const menuOpts = computeMenuOpts.value
|
|
38
|
-
const { transfer, destroyOnClose } = menuOpts
|
|
39
|
-
const { visible, list, className } = ctxMenuStore
|
|
40
|
-
|
|
41
|
-
return h(Teleport, {
|
|
42
|
-
to: 'body',
|
|
43
|
-
disabled: !transfer
|
|
44
|
-
}, [
|
|
45
|
-
h('div', {
|
|
46
|
-
ref: refElem,
|
|
47
|
-
class: ['vxe-table--context-menu-wrapper', className, {
|
|
48
|
-
'is--visible': visible
|
|
49
|
-
}],
|
|
50
|
-
style: ctxMenuStore.style
|
|
51
|
-
}, (destroyOnClose ? visible : true)
|
|
52
|
-
? list.map((options, gIndex) => {
|
|
53
|
-
return options.every(item => item.visible === false)
|
|
54
|
-
? renderEmptyElement($xeTable)
|
|
55
|
-
: h('ul', {
|
|
56
|
-
class: 'vxe-context-menu--option-wrapper',
|
|
57
|
-
key: gIndex
|
|
58
|
-
}, options.map((item, index) => {
|
|
59
|
-
const { children, loading } = item
|
|
60
|
-
const hasChildMenus = children && children.some((child) => child.visible !== false)
|
|
61
|
-
const prefixOpts = Object.assign({}, item.prefixConfig)
|
|
62
|
-
const prefixIcon = prefixOpts.icon || item.prefixIcon
|
|
63
|
-
const suffixOpts = Object.assign({}, item.suffixConfig)
|
|
64
|
-
const suffixIcon = suffixOpts.icon || item.suffixIcon
|
|
65
|
-
const menuContent = getFuncText(item.name)
|
|
66
|
-
return item.visible === false
|
|
67
|
-
? renderEmptyElement($xeTable)
|
|
68
|
-
: h('li', {
|
|
69
|
-
class: [item.className, {
|
|
70
|
-
'link--loading': loading,
|
|
71
|
-
'link--disabled': item.disabled,
|
|
72
|
-
'link--active': item === ctxMenuStore.selected
|
|
73
|
-
}],
|
|
74
|
-
key: `${gIndex}_${index}`
|
|
75
|
-
}, [
|
|
76
|
-
h('a', {
|
|
77
|
-
class: 'vxe-context-menu--link',
|
|
78
|
-
onClick (evnt: Event) {
|
|
79
|
-
$xeTable.ctxMenuLinkEvent(evnt, item)
|
|
80
|
-
},
|
|
81
|
-
onMouseover (evnt: Event) {
|
|
82
|
-
$xeTable.ctxMenuMouseoverEvent(evnt, item)
|
|
83
|
-
},
|
|
84
|
-
onMouseout (evnt: Event) {
|
|
85
|
-
$xeTable.ctxMenuMouseoutEvent(evnt, item)
|
|
86
|
-
}
|
|
87
|
-
}, [
|
|
88
|
-
h('div', {
|
|
89
|
-
class: ['vxe-context-menu--link-prefix', prefixOpts.className || '']
|
|
90
|
-
}, [
|
|
91
|
-
loading
|
|
92
|
-
? h('span', {
|
|
93
|
-
class: getIcon('TABLE_MENU_OPTION_LOADING')
|
|
94
|
-
})
|
|
95
|
-
: (prefixIcon && XEUtils.isFunction(prefixIcon)
|
|
96
|
-
? h('span', {}, getSlotVNs(prefixIcon({})))
|
|
97
|
-
: h('span', {}, [
|
|
98
|
-
h('i', {
|
|
99
|
-
class: prefixIcon
|
|
100
|
-
})
|
|
101
|
-
])),
|
|
102
|
-
prefixOpts.content ? h('span', {}, `${prefixOpts.content}`) : renderEmptyElement($xeTable)
|
|
103
|
-
]),
|
|
104
|
-
h('div', {
|
|
105
|
-
class: 'vxe-context-menu--link-content',
|
|
106
|
-
title: menuContent
|
|
107
|
-
}, loading ? getI18n('vxe.table.menuLoading') : menuContent),
|
|
108
|
-
h('div', {
|
|
109
|
-
class: ['vxe-context-menu--link-suffix', suffixOpts.className || '']
|
|
110
|
-
}, [
|
|
111
|
-
suffixIcon && XEUtils.isFunction(suffixIcon)
|
|
112
|
-
? h('span', {}, getSlotVNs(suffixIcon({})))
|
|
113
|
-
: h('i', {
|
|
114
|
-
class: suffixIcon || (hasChildMenus ? getIcon().TABLE_MENU_OPTIONS : '')
|
|
115
|
-
}),
|
|
116
|
-
suffixOpts.content ? h('span', `${suffixOpts.content}`) : renderEmptyElement($xeTable)
|
|
117
|
-
])
|
|
118
|
-
]),
|
|
119
|
-
hasChildMenus && item.children
|
|
120
|
-
? h('ul', {
|
|
121
|
-
class: ['vxe-table--context-menu-clild-wrapper', {
|
|
122
|
-
'is--show': item === ctxMenuStore.selected && ctxMenuStore.showChild
|
|
123
|
-
}]
|
|
124
|
-
}, item.children.map((child, cIndex) => {
|
|
125
|
-
const { loading: childLoading } = child
|
|
126
|
-
const childPrefixOpts = Object.assign({}, child.prefixConfig)
|
|
127
|
-
const childPrefixIcon = childPrefixOpts.icon || child.prefixIcon
|
|
128
|
-
const childSuffixOpts = Object.assign({}, child.suffixConfig)
|
|
129
|
-
const childSuffixIcon = childSuffixOpts.icon || child.suffixIcon
|
|
130
|
-
const childMenuContent = getFuncText(child.name)
|
|
131
|
-
return child.visible === false
|
|
132
|
-
? null
|
|
133
|
-
: h('li', {
|
|
134
|
-
class: [child.className, {
|
|
135
|
-
'link--loading': childLoading,
|
|
136
|
-
'link--disabled': child.disabled,
|
|
137
|
-
'link--active': child === ctxMenuStore.selectChild
|
|
138
|
-
}],
|
|
139
|
-
key: `${gIndex}_${index}_${cIndex}`
|
|
140
|
-
}, [
|
|
141
|
-
h('a', {
|
|
142
|
-
class: 'vxe-context-menu--link',
|
|
143
|
-
onClick (evnt: Event) {
|
|
144
|
-
$xeTable.ctxMenuLinkEvent(evnt, child)
|
|
145
|
-
},
|
|
146
|
-
onMouseover (evnt: Event) {
|
|
147
|
-
$xeTable.ctxMenuMouseoverEvent(evnt, item, child)
|
|
148
|
-
},
|
|
149
|
-
onMouseout (evnt: Event) {
|
|
150
|
-
$xeTable.ctxMenuMouseoutEvent(evnt, item)
|
|
151
|
-
}
|
|
152
|
-
}, [
|
|
153
|
-
h('div', {
|
|
154
|
-
class: ['vxe-context-menu--link-prefix', childPrefixOpts.className || '']
|
|
155
|
-
}, [
|
|
156
|
-
child.loading
|
|
157
|
-
? h('span', {
|
|
158
|
-
class: getIcon('TABLE_MENU_OPTION_LOADING')
|
|
159
|
-
})
|
|
160
|
-
: (childPrefixIcon && XEUtils.isFunction(childPrefixIcon)
|
|
161
|
-
? h('span', {}, getSlotVNs(childPrefixIcon({})))
|
|
162
|
-
: h('span', {}, [
|
|
163
|
-
h('i', {
|
|
164
|
-
class: childPrefixIcon
|
|
165
|
-
})
|
|
166
|
-
])),
|
|
167
|
-
childPrefixOpts.content ? h('span', `${childPrefixOpts.content}`) : renderEmptyElement($xeTable)
|
|
168
|
-
]),
|
|
169
|
-
h('div', {
|
|
170
|
-
class: 'vxe-context-menu--link-content',
|
|
171
|
-
title: childMenuContent
|
|
172
|
-
}, childLoading ? getI18n('vxe.table.menuLoading') : childMenuContent),
|
|
173
|
-
h('div', {
|
|
174
|
-
class: ['vxe-context-menu--link-suffix', childSuffixOpts.className || '']
|
|
175
|
-
}, [
|
|
176
|
-
childSuffixIcon && XEUtils.isFunction(childSuffixIcon)
|
|
177
|
-
? h('span', {}, getSlotVNs(childSuffixIcon({})))
|
|
178
|
-
: h('i', {
|
|
179
|
-
class: childSuffixIcon
|
|
180
|
-
}),
|
|
181
|
-
childSuffixOpts.content ? h('span', `${childSuffixOpts.content}`) : renderEmptyElement($xeTable)
|
|
182
|
-
])
|
|
183
|
-
])
|
|
184
|
-
])
|
|
185
|
-
}))
|
|
186
|
-
: null
|
|
187
|
-
])
|
|
188
|
-
}))
|
|
189
|
-
})
|
|
190
|
-
: [])
|
|
191
|
-
])
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
$xeMenuPanel.renderVN = renderVN
|
|
195
|
-
|
|
196
|
-
return $xeMenuPanel
|
|
197
|
-
},
|
|
198
|
-
render () {
|
|
199
|
-
return this.renderVN()
|
|
200
|
-
}
|
|
201
|
-
})
|
|
1
|
+
import { h, Teleport, inject, ref, Ref } from 'vue'
|
|
2
|
+
import { defineVxeComponent } from '../../../ui/src/comp'
|
|
3
|
+
import XEUtils from 'xe-utils'
|
|
4
|
+
import { VxeUI } from '../../../ui'
|
|
5
|
+
import { getFuncText } from '../../../ui/src/utils'
|
|
6
|
+
import { getSlotVNs } from '../../../ui/src/vn'
|
|
7
|
+
|
|
8
|
+
import type { VxeTablePrivateMethods, VxeTableConstructor, VxeTableMethods } from '../../../../types'
|
|
9
|
+
|
|
10
|
+
const { getIcon, getI18n, renderEmptyElement } = VxeUI
|
|
11
|
+
|
|
12
|
+
export default defineVxeComponent({
|
|
13
|
+
name: 'VxeTableMenuPanel',
|
|
14
|
+
setup (props, context) {
|
|
15
|
+
const xID = XEUtils.uniqueId()
|
|
16
|
+
|
|
17
|
+
const $xeTable = inject('$xeTable', {} as VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods)
|
|
18
|
+
|
|
19
|
+
const { reactData: tableReactData } = $xeTable
|
|
20
|
+
|
|
21
|
+
const refElem = ref() as Ref<HTMLDivElement>
|
|
22
|
+
|
|
23
|
+
const refMaps = {
|
|
24
|
+
refElem
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const $xeMenuPanel: any = {
|
|
28
|
+
xID,
|
|
29
|
+
props,
|
|
30
|
+
context,
|
|
31
|
+
getRefMaps: () => refMaps
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const renderVN = () => {
|
|
35
|
+
const { ctxMenuStore } = tableReactData
|
|
36
|
+
const { computeMenuOpts } = $xeTable.getComputeMaps()
|
|
37
|
+
const menuOpts = computeMenuOpts.value
|
|
38
|
+
const { transfer, destroyOnClose } = menuOpts
|
|
39
|
+
const { visible, list, className } = ctxMenuStore
|
|
40
|
+
|
|
41
|
+
return h(Teleport, {
|
|
42
|
+
to: 'body',
|
|
43
|
+
disabled: !transfer
|
|
44
|
+
}, [
|
|
45
|
+
h('div', {
|
|
46
|
+
ref: refElem,
|
|
47
|
+
class: ['vxe-table--context-menu-wrapper', className, {
|
|
48
|
+
'is--visible': visible
|
|
49
|
+
}],
|
|
50
|
+
style: ctxMenuStore.style
|
|
51
|
+
}, (destroyOnClose ? visible : true)
|
|
52
|
+
? list.map((options, gIndex) => {
|
|
53
|
+
return options.every(item => item.visible === false)
|
|
54
|
+
? renderEmptyElement($xeTable)
|
|
55
|
+
: h('ul', {
|
|
56
|
+
class: 'vxe-context-menu--option-wrapper',
|
|
57
|
+
key: gIndex
|
|
58
|
+
}, options.map((item, index) => {
|
|
59
|
+
const { children, loading } = item
|
|
60
|
+
const hasChildMenus = children && children.some((child) => child.visible !== false)
|
|
61
|
+
const prefixOpts = Object.assign({}, item.prefixConfig)
|
|
62
|
+
const prefixIcon = prefixOpts.icon || item.prefixIcon
|
|
63
|
+
const suffixOpts = Object.assign({}, item.suffixConfig)
|
|
64
|
+
const suffixIcon = suffixOpts.icon || item.suffixIcon
|
|
65
|
+
const menuContent = getFuncText(item.name)
|
|
66
|
+
return item.visible === false
|
|
67
|
+
? renderEmptyElement($xeTable)
|
|
68
|
+
: h('li', {
|
|
69
|
+
class: [item.className, {
|
|
70
|
+
'link--loading': loading,
|
|
71
|
+
'link--disabled': item.disabled,
|
|
72
|
+
'link--active': item === ctxMenuStore.selected
|
|
73
|
+
}],
|
|
74
|
+
key: `${gIndex}_${index}`
|
|
75
|
+
}, [
|
|
76
|
+
h('a', {
|
|
77
|
+
class: 'vxe-context-menu--link',
|
|
78
|
+
onClick (evnt: Event) {
|
|
79
|
+
$xeTable.ctxMenuLinkEvent(evnt, item)
|
|
80
|
+
},
|
|
81
|
+
onMouseover (evnt: Event) {
|
|
82
|
+
$xeTable.ctxMenuMouseoverEvent(evnt, item)
|
|
83
|
+
},
|
|
84
|
+
onMouseout (evnt: Event) {
|
|
85
|
+
$xeTable.ctxMenuMouseoutEvent(evnt, item)
|
|
86
|
+
}
|
|
87
|
+
}, [
|
|
88
|
+
h('div', {
|
|
89
|
+
class: ['vxe-context-menu--link-prefix', prefixOpts.className || '']
|
|
90
|
+
}, [
|
|
91
|
+
loading
|
|
92
|
+
? h('span', {
|
|
93
|
+
class: getIcon('TABLE_MENU_OPTION_LOADING')
|
|
94
|
+
})
|
|
95
|
+
: (prefixIcon && XEUtils.isFunction(prefixIcon)
|
|
96
|
+
? h('span', {}, getSlotVNs(prefixIcon({})))
|
|
97
|
+
: h('span', {}, [
|
|
98
|
+
h('i', {
|
|
99
|
+
class: prefixIcon
|
|
100
|
+
})
|
|
101
|
+
])),
|
|
102
|
+
prefixOpts.content ? h('span', {}, `${prefixOpts.content}`) : renderEmptyElement($xeTable)
|
|
103
|
+
]),
|
|
104
|
+
h('div', {
|
|
105
|
+
class: 'vxe-context-menu--link-content',
|
|
106
|
+
title: menuContent
|
|
107
|
+
}, loading ? getI18n('vxe.table.menuLoading') : menuContent),
|
|
108
|
+
h('div', {
|
|
109
|
+
class: ['vxe-context-menu--link-suffix', suffixOpts.className || '']
|
|
110
|
+
}, [
|
|
111
|
+
suffixIcon && XEUtils.isFunction(suffixIcon)
|
|
112
|
+
? h('span', {}, getSlotVNs(suffixIcon({})))
|
|
113
|
+
: h('i', {
|
|
114
|
+
class: suffixIcon || (hasChildMenus ? getIcon().TABLE_MENU_OPTIONS : '')
|
|
115
|
+
}),
|
|
116
|
+
suffixOpts.content ? h('span', `${suffixOpts.content}`) : renderEmptyElement($xeTable)
|
|
117
|
+
])
|
|
118
|
+
]),
|
|
119
|
+
hasChildMenus && item.children
|
|
120
|
+
? h('ul', {
|
|
121
|
+
class: ['vxe-table--context-menu-clild-wrapper', {
|
|
122
|
+
'is--show': item === ctxMenuStore.selected && ctxMenuStore.showChild
|
|
123
|
+
}]
|
|
124
|
+
}, item.children.map((child, cIndex) => {
|
|
125
|
+
const { loading: childLoading } = child
|
|
126
|
+
const childPrefixOpts = Object.assign({}, child.prefixConfig)
|
|
127
|
+
const childPrefixIcon = childPrefixOpts.icon || child.prefixIcon
|
|
128
|
+
const childSuffixOpts = Object.assign({}, child.suffixConfig)
|
|
129
|
+
const childSuffixIcon = childSuffixOpts.icon || child.suffixIcon
|
|
130
|
+
const childMenuContent = getFuncText(child.name)
|
|
131
|
+
return child.visible === false
|
|
132
|
+
? null
|
|
133
|
+
: h('li', {
|
|
134
|
+
class: [child.className, {
|
|
135
|
+
'link--loading': childLoading,
|
|
136
|
+
'link--disabled': child.disabled,
|
|
137
|
+
'link--active': child === ctxMenuStore.selectChild
|
|
138
|
+
}],
|
|
139
|
+
key: `${gIndex}_${index}_${cIndex}`
|
|
140
|
+
}, [
|
|
141
|
+
h('a', {
|
|
142
|
+
class: 'vxe-context-menu--link',
|
|
143
|
+
onClick (evnt: Event) {
|
|
144
|
+
$xeTable.ctxMenuLinkEvent(evnt, child)
|
|
145
|
+
},
|
|
146
|
+
onMouseover (evnt: Event) {
|
|
147
|
+
$xeTable.ctxMenuMouseoverEvent(evnt, item, child)
|
|
148
|
+
},
|
|
149
|
+
onMouseout (evnt: Event) {
|
|
150
|
+
$xeTable.ctxMenuMouseoutEvent(evnt, item)
|
|
151
|
+
}
|
|
152
|
+
}, [
|
|
153
|
+
h('div', {
|
|
154
|
+
class: ['vxe-context-menu--link-prefix', childPrefixOpts.className || '']
|
|
155
|
+
}, [
|
|
156
|
+
child.loading
|
|
157
|
+
? h('span', {
|
|
158
|
+
class: getIcon('TABLE_MENU_OPTION_LOADING')
|
|
159
|
+
})
|
|
160
|
+
: (childPrefixIcon && XEUtils.isFunction(childPrefixIcon)
|
|
161
|
+
? h('span', {}, getSlotVNs(childPrefixIcon({})))
|
|
162
|
+
: h('span', {}, [
|
|
163
|
+
h('i', {
|
|
164
|
+
class: childPrefixIcon
|
|
165
|
+
})
|
|
166
|
+
])),
|
|
167
|
+
childPrefixOpts.content ? h('span', `${childPrefixOpts.content}`) : renderEmptyElement($xeTable)
|
|
168
|
+
]),
|
|
169
|
+
h('div', {
|
|
170
|
+
class: 'vxe-context-menu--link-content',
|
|
171
|
+
title: childMenuContent
|
|
172
|
+
}, childLoading ? getI18n('vxe.table.menuLoading') : childMenuContent),
|
|
173
|
+
h('div', {
|
|
174
|
+
class: ['vxe-context-menu--link-suffix', childSuffixOpts.className || '']
|
|
175
|
+
}, [
|
|
176
|
+
childSuffixIcon && XEUtils.isFunction(childSuffixIcon)
|
|
177
|
+
? h('span', {}, getSlotVNs(childSuffixIcon({})))
|
|
178
|
+
: h('i', {
|
|
179
|
+
class: childSuffixIcon
|
|
180
|
+
}),
|
|
181
|
+
childSuffixOpts.content ? h('span', `${childSuffixOpts.content}`) : renderEmptyElement($xeTable)
|
|
182
|
+
])
|
|
183
|
+
])
|
|
184
|
+
])
|
|
185
|
+
}))
|
|
186
|
+
: null
|
|
187
|
+
])
|
|
188
|
+
}))
|
|
189
|
+
})
|
|
190
|
+
: [])
|
|
191
|
+
])
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
$xeMenuPanel.renderVN = renderVN
|
|
195
|
+
|
|
196
|
+
return $xeMenuPanel
|
|
197
|
+
},
|
|
198
|
+
render () {
|
|
199
|
+
return this.renderVN()
|
|
200
|
+
}
|
|
201
|
+
})
|