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.
Files changed (109) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.esm.js +2 -1
  3. package/es/index.min.css +1 -1
  4. package/es/style.css +1 -1
  5. package/es/style.min.css +1 -1
  6. package/es/table/module/custom/mixin.js +6 -4
  7. package/es/table/module/custom/panel.js +806 -799
  8. package/es/table/module/edit/mixin.js +43 -31
  9. package/es/table/module/export/export-panel.js +511 -458
  10. package/es/table/module/export/import-panel.js +224 -192
  11. package/es/table/module/keyboard/mixin.js +2 -2
  12. package/es/table/module/menu/panel.js +165 -161
  13. package/es/table/module/validator/mixin.js +255 -236
  14. package/es/table/src/body.js +2 -1
  15. package/es/table/src/cell.js +2 -2
  16. package/es/table/src/methods.js +33 -43
  17. package/es/table/src/table.js +13 -249
  18. package/es/table/src/util.js +242 -0
  19. package/es/table/style.css +23 -50
  20. package/es/table/style.min.css +1 -1
  21. package/es/ui/index.js +2 -2
  22. package/es/ui/src/dom.js +22 -0
  23. package/es/ui/src/log.js +1 -1
  24. package/es/vxe-table/style.css +23 -50
  25. package/es/vxe-table/style.min.css +1 -1
  26. package/lib/index.common.js +2 -1
  27. package/lib/index.css +1 -1
  28. package/lib/index.min.css +1 -1
  29. package/lib/index.umd.js +3640 -4790
  30. package/lib/index.umd.min.js +1 -1
  31. package/lib/style.css +1 -1
  32. package/lib/style.min.css +1 -1
  33. package/lib/table/module/custom/mixin.js +6 -4
  34. package/lib/table/module/custom/mixin.min.js +1 -1
  35. package/lib/table/module/custom/panel.js +693 -685
  36. package/lib/table/module/custom/panel.min.js +1 -1
  37. package/lib/table/module/edit/mixin.js +47 -31
  38. package/lib/table/module/edit/mixin.min.js +1 -1
  39. package/lib/table/module/export/export-panel.js +450 -384
  40. package/lib/table/module/export/export-panel.min.js +1 -1
  41. package/lib/table/module/export/import-panel.js +200 -159
  42. package/lib/table/module/export/import-panel.min.js +1 -1
  43. package/lib/table/module/keyboard/mixin.js +2 -2
  44. package/lib/table/module/keyboard/mixin.min.js +1 -1
  45. package/lib/table/module/menu/panel.js +119 -114
  46. package/lib/table/module/menu/panel.min.js +1 -1
  47. package/lib/table/module/validator/mixin.js +271 -259
  48. package/lib/table/module/validator/mixin.min.js +1 -1
  49. package/lib/table/src/body.js +2 -1
  50. package/lib/table/src/body.min.js +1 -1
  51. package/lib/table/src/cell.js +2 -2
  52. package/lib/table/src/cell.min.js +1 -1
  53. package/lib/table/src/methods.js +33 -45
  54. package/lib/table/src/methods.min.js +1 -1
  55. package/lib/table/src/table.js +12 -248
  56. package/lib/table/src/table.min.js +1 -1
  57. package/lib/table/src/util.js +243 -0
  58. package/lib/table/src/util.min.js +1 -1
  59. package/lib/table/style/style.css +23 -50
  60. package/lib/table/style/style.min.css +1 -1
  61. package/lib/ui/index.js +2 -2
  62. package/lib/ui/index.min.js +1 -1
  63. package/lib/ui/src/dom.js +22 -0
  64. package/lib/ui/src/dom.min.js +1 -1
  65. package/lib/ui/src/log.js +1 -1
  66. package/lib/ui/src/log.min.js +1 -1
  67. package/lib/v-x-e-table/index.js +2 -1
  68. package/lib/v-x-e-table/index.min.js +1 -1
  69. package/lib/vxe-colgroup/index.js +2 -1
  70. package/lib/vxe-colgroup/index.min.js +1 -1
  71. package/lib/vxe-column/index.js +2 -1
  72. package/lib/vxe-column/index.min.js +1 -1
  73. package/lib/vxe-grid/index.js +2 -1
  74. package/lib/vxe-grid/index.min.js +1 -1
  75. package/lib/vxe-table/index.js +2 -1
  76. package/lib/vxe-table/index.min.js +1 -1
  77. package/lib/vxe-table/style/style.css +23 -50
  78. package/lib/vxe-table/style/style.min.css +1 -1
  79. package/lib/vxe-toolbar/index.js +2 -1
  80. package/lib/vxe-toolbar/index.min.js +1 -1
  81. package/lib/vxe-ui/index.js +2 -1
  82. package/lib/vxe-ui/index.min.js +1 -1
  83. package/lib/vxe-v-x-e-table/index.js +2 -1
  84. package/lib/vxe-v-x-e-table/index.min.js +1 -1
  85. package/package.json +1 -1
  86. package/packages/table/module/custom/mixin.ts +7 -4
  87. package/packages/table/module/custom/panel.ts +846 -839
  88. package/packages/table/module/edit/mixin.ts +55 -35
  89. package/packages/table/module/export/export-panel.ts +545 -469
  90. package/packages/table/module/export/import-panel.ts +245 -202
  91. package/packages/table/module/filter/panel.ts +4 -18
  92. package/packages/table/module/keyboard/mixin.ts +2 -2
  93. package/packages/table/module/menu/panel.ts +171 -163
  94. package/packages/table/module/validator/mixin.ts +279 -240
  95. package/packages/table/src/body.ts +2 -1
  96. package/packages/table/src/cell.ts +2 -2
  97. package/packages/table/src/methods.ts +43 -45
  98. package/packages/table/src/table.ts +14 -260
  99. package/packages/table/src/util.ts +254 -0
  100. package/packages/ui/index.ts +1 -1
  101. package/packages/ui/src/dom.ts +22 -0
  102. package/styles/components/table.scss +5 -2
  103. package/styles/theme/base.scss +2 -1
  104. /package/es/{iconfont.1767145426781.ttf → iconfont.1767492234857.ttf} +0 -0
  105. /package/es/{iconfont.1767145426781.woff → iconfont.1767492234857.woff} +0 -0
  106. /package/es/{iconfont.1767145426781.woff2 → iconfont.1767492234857.woff2} +0 -0
  107. /package/lib/{iconfont.1767145426781.ttf → iconfont.1767492234857.ttf} +0 -0
  108. /package/lib/{iconfont.1767145426781.woff → iconfont.1767492234857.woff} +0 -0
  109. /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 as VxeTableConstructor & VxeTablePrivateMethods
26
+ const $xeTable = $xeMenuPanel.$xeTable
25
27
  const menuOpts = $xeTable.computeMenuOpts
26
28
  const { transfer } = menuOpts
27
- const el = this.$refs.refElem as HTMLDivElement
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 el = this.$refs.refElem as HTMLDivElement
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
- render (this: any, h: CreateElement) {
41
- const $xeMenuPanel = this
42
- const $xeTable = $xeMenuPanel.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
43
- const tableReactData = $xeTable as unknown as TableReactData
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
- const { ctxMenuStore } = tableReactData
46
- const menuOpts = $xeTable.computeMenuOpts
47
- const { destroyOnClose } = menuOpts
48
- const { visible, list, className } = ctxMenuStore
49
- return h('div', {
50
- ref: 'refElem',
51
- class: ['vxe-table--context-menu-wrapper', className, {
52
- 'is--visible': visible
53
- }],
54
- style: ctxMenuStore.style
55
- }, (destroyOnClose ? visible : true)
56
- ? list.map((options, gIndex) => {
57
- return options.every((item) => item.visible === false)
58
- ? renderEmptyElement($xeTable)
59
- : h('ul', {
60
- class: 'vxe-context-menu--option-wrapper',
61
- key: gIndex
62
- }, options.map((item, index) => {
63
- const { children, loading } = item
64
- const hasChildMenus = children && children.some((child) => child.visible !== false)
65
- const prefixOpts = Object.assign({}, item.prefixConfig)
66
- const prefixIcon = prefixOpts.icon || item.prefixIcon
67
- const suffixOpts = Object.assign({}, item.suffixConfig)
68
- const suffixIcon = suffixOpts.icon || item.suffixIcon
69
- const menuContent = getFuncText(item.name)
70
- return item.visible === false
71
- ? renderEmptyElement($xeTable)
72
- : h('li', {
73
- class: [item.className, {
74
- 'link--loading': loading,
75
- 'link--disabled': item.disabled,
76
- 'link--active': item === ctxMenuStore.selected
77
- }],
78
- key: `${gIndex}_${index}`
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('div', {
95
- class: ['vxe-context-menu--link-prefix', prefixOpts.className || '']
96
- }, [
97
- loading
98
- ? h('span', {
99
- class: getIcon('TABLE_MENU_OPTION_LOADING')
100
- })
101
- : (prefixIcon && XEUtils.isFunction(prefixIcon)
102
- ? h('span', {}, getSlotVNs(prefixIcon.call($xeTable, {})))
103
- : h('span', {}, [
104
- h('i', {
105
- class: prefixIcon
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
- suffixIcon && XEUtils.isFunction(suffixIcon)
120
- ? h('span', {}, getSlotVNs(suffixIcon.call($xeTable, {})))
121
- : h('i', {
122
- class: suffixIcon || (hasChildMenus ? getIcon().TABLE_MENU_OPTIONS : '')
123
- }),
124
- suffixOpts.content ? h('span', `${suffixOpts.content}`) : renderEmptyElement($xeTable)
125
- ])
126
- ]),
127
- hasChildMenus && item.children
128
- ? h('ul', {
129
- class: ['vxe-table--context-menu-clild-wrapper', {
130
- 'is--show': item === ctxMenuStore.selected && ctxMenuStore.showChild
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
- : (childPrefixIcon && XEUtils.isFunction(childPrefixIcon)
171
- ? h('span', {}, getSlotVNs(childPrefixIcon({})))
172
- : h('span', {}, [
173
- h('i', {
174
- class: childPrefixIcon
175
- })
176
- ])),
177
- childPrefixOpts.content ? h('span', `${childPrefixOpts.content}`) : renderEmptyElement($xeTable)
178
- ]),
179
- h('span', {
180
- class: 'vxe-context-menu--link-content',
181
- attrs: {
182
- title: childMenuContent
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
- childSuffixIcon && XEUtils.isFunction(childSuffixIcon)
189
- ? h('span', {}, getSlotVNs(childSuffixIcon.call($xeTable, {})))
190
- : h('i', {
191
- class: childSuffixIcon
192
- }),
193
- childSuffixOpts.content ? h('span', `${childSuffixOpts.content}`) : renderEmptyElement($xeTable)
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
- : null
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
- } as any
212
+ }) /* define-vxe-component end */