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,3 +1,4 @@
1
+ import { defineVxeComponent } from '../../../ui/src/comp';
1
2
  import { VxeUI } from '../../../ui';
2
3
  import XEUtils from 'xe-utils';
3
4
  import { getFuncText } from '../../../ui/src/utils';
@@ -5,192 +6,195 @@ import { getSlotVNs } from '../../../ui/src/vn';
5
6
  const { getIcon, getI18n, renderEmptyElement } = VxeUI;
6
7
  export default {
7
8
  name: 'VxeTableMenuPanel',
8
- props: {
9
- ctxMenuStore: Object,
10
- ctxMenuOpts: Object
11
- },
12
9
  inject: {
13
10
  $xeTable: {
14
11
  default: null
15
12
  }
16
13
  },
14
+ computed: Object.assign({}, {}),
17
15
  mounted() {
18
16
  const $xeMenuPanel = this;
19
17
  const $xeTable = $xeMenuPanel.$xeTable;
20
18
  const menuOpts = $xeTable.computeMenuOpts;
21
19
  const { transfer } = menuOpts;
22
- const el = this.$refs.refElem;
20
+ const el = $xeMenuPanel.$refs.refElem;
23
21
  if (transfer && el) {
24
22
  document.body.appendChild(el);
25
23
  }
26
24
  },
27
25
  beforeDestroy() {
28
- const el = this.$refs.refElem;
26
+ const $xeMenuPanel = this;
27
+ const el = $xeMenuPanel.$refs.refElem;
29
28
  if (el && el.parentNode) {
30
29
  el.parentNode.removeChild(el);
31
30
  }
32
31
  },
33
- render(h) {
34
- const $xeMenuPanel = this;
35
- const $xeTable = $xeMenuPanel.$xeTable;
36
- const tableReactData = $xeTable;
37
- const { ctxMenuStore } = tableReactData;
38
- const menuOpts = $xeTable.computeMenuOpts;
39
- const { destroyOnClose } = menuOpts;
40
- const { visible, list, className } = ctxMenuStore;
41
- return h('div', {
42
- ref: 'refElem',
43
- class: ['vxe-table--context-menu-wrapper', className, {
44
- 'is--visible': visible
45
- }],
46
- style: ctxMenuStore.style
47
- }, (destroyOnClose ? visible : true)
48
- ? list.map((options, gIndex) => {
49
- return options.every((item) => item.visible === false)
50
- ? renderEmptyElement($xeTable)
51
- : h('ul', {
52
- class: 'vxe-context-menu--option-wrapper',
53
- key: gIndex
54
- }, options.map((item, index) => {
55
- const { children, loading } = item;
56
- const hasChildMenus = children && children.some((child) => child.visible !== false);
57
- const prefixOpts = Object.assign({}, item.prefixConfig);
58
- const prefixIcon = prefixOpts.icon || item.prefixIcon;
59
- const suffixOpts = Object.assign({}, item.suffixConfig);
60
- const suffixIcon = suffixOpts.icon || item.suffixIcon;
61
- const menuContent = getFuncText(item.name);
62
- return item.visible === false
63
- ? renderEmptyElement($xeTable)
64
- : h('li', {
65
- class: [item.className, {
66
- 'link--loading': loading,
67
- 'link--disabled': item.disabled,
68
- 'link--active': item === ctxMenuStore.selected
69
- }],
70
- key: `${gIndex}_${index}`
71
- }, [
72
- h('a', {
73
- class: 'vxe-context-menu--link',
74
- on: {
75
- click(evnt) {
76
- $xeTable.ctxMenuLinkEvent(evnt, item);
77
- },
78
- mouseover(evnt) {
79
- $xeTable.ctxMenuMouseoverEvent(evnt, item);
80
- },
81
- mouseout(evnt) {
82
- $xeTable.ctxMenuMouseoutEvent(evnt, item);
83
- }
84
- }
32
+ methods: {
33
+ renderVN(h) {
34
+ const $xeMenuPanel = this;
35
+ const $xeTable = $xeMenuPanel.$xeTable;
36
+ const tableReactData = $xeTable;
37
+ const { ctxMenuStore } = tableReactData;
38
+ const menuOpts = $xeTable.computeMenuOpts;
39
+ const { destroyOnClose } = menuOpts;
40
+ const { visible, list, className } = ctxMenuStore;
41
+ return h('div', {
42
+ ref: 'refElem',
43
+ class: ['vxe-table--context-menu-wrapper', className, {
44
+ 'is--visible': visible
45
+ }],
46
+ style: ctxMenuStore.style
47
+ }, (destroyOnClose ? visible : true)
48
+ ? list.map((options, gIndex) => {
49
+ return options.every((item) => item.visible === false)
50
+ ? renderEmptyElement($xeTable)
51
+ : h('ul', {
52
+ class: 'vxe-context-menu--option-wrapper',
53
+ key: gIndex
54
+ }, options.map((item, index) => {
55
+ const { children, loading } = item;
56
+ const hasChildMenus = children && children.some((child) => child.visible !== false);
57
+ const prefixOpts = Object.assign({}, item.prefixConfig);
58
+ const prefixIcon = prefixOpts.icon || item.prefixIcon;
59
+ const suffixOpts = Object.assign({}, item.suffixConfig);
60
+ const suffixIcon = suffixOpts.icon || item.suffixIcon;
61
+ const menuContent = getFuncText(item.name);
62
+ return item.visible === false
63
+ ? renderEmptyElement($xeTable)
64
+ : h('li', {
65
+ class: [item.className, {
66
+ 'link--loading': loading,
67
+ 'link--disabled': item.disabled,
68
+ 'link--active': item === ctxMenuStore.selected
69
+ }],
70
+ key: `${gIndex}_${index}`
85
71
  }, [
86
- h('div', {
87
- class: ['vxe-context-menu--link-prefix', prefixOpts.className || '']
88
- }, [
89
- loading
90
- ? h('span', {
91
- class: getIcon('TABLE_MENU_OPTION_LOADING')
92
- })
93
- : (prefixIcon && XEUtils.isFunction(prefixIcon)
94
- ? h('span', {}, getSlotVNs(prefixIcon.call($xeTable, {})))
95
- : h('span', {}, [
96
- h('i', {
97
- class: prefixIcon
98
- })
99
- ])),
100
- prefixOpts.content ? h('span', {}, `${prefixOpts.content}`) : renderEmptyElement($xeTable)
101
- ]),
102
- h('span', {
103
- class: 'vxe-context-menu--link-content',
104
- attrs: {
105
- title: menuContent
72
+ h('a', {
73
+ class: 'vxe-context-menu--link',
74
+ on: {
75
+ click(evnt) {
76
+ $xeTable.ctxMenuLinkEvent(evnt, item);
77
+ },
78
+ mouseover(evnt) {
79
+ $xeTable.ctxMenuMouseoverEvent(evnt, item);
80
+ },
81
+ mouseout(evnt) {
82
+ $xeTable.ctxMenuMouseoutEvent(evnt, item);
83
+ }
106
84
  }
107
- }, loading ? getI18n('vxe.table.menuLoading') : menuContent),
108
- h('div', {
109
- class: ['vxe-context-menu--link-suffix', suffixOpts.className || '']
110
85
  }, [
111
- suffixIcon && XEUtils.isFunction(suffixIcon)
112
- ? h('span', {}, getSlotVNs(suffixIcon.call($xeTable, {})))
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
- on: {
144
- click(evnt) {
145
- $xeTable.ctxMenuLinkEvent(evnt, child);
146
- },
147
- mouseover(evnt) {
148
- $xeTable.ctxMenuMouseoverEvent(evnt, item, child);
149
- },
150
- mouseout(evnt) {
151
- $xeTable.ctxMenuMouseoutEvent(evnt, item);
152
- }
153
- }
86
+ h('div', {
87
+ class: ['vxe-context-menu--link-prefix', prefixOpts.className || '']
88
+ }, [
89
+ loading
90
+ ? h('span', {
91
+ class: getIcon('TABLE_MENU_OPTION_LOADING')
92
+ })
93
+ : (prefixIcon && XEUtils.isFunction(prefixIcon)
94
+ ? h('span', {}, getSlotVNs(prefixIcon.call($xeTable, {})))
95
+ : h('span', {}, [
96
+ h('i', {
97
+ class: prefixIcon
98
+ })
99
+ ])),
100
+ prefixOpts.content ? h('span', {}, `${prefixOpts.content}`) : renderEmptyElement($xeTable)
101
+ ]),
102
+ h('span', {
103
+ class: 'vxe-context-menu--link-content',
104
+ attrs: {
105
+ title: menuContent
106
+ }
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.call($xeTable, {})))
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}`
154
140
  }, [
155
- h('div', {
156
- class: ['vxe-context-menu--link-prefix', childPrefixOpts.className || '']
157
- }, [
158
- child.loading
159
- ? h('span', {
160
- class: getIcon('TABLE_MENU_OPTION_LOADING')
161
- })
162
- : (childPrefixIcon && XEUtils.isFunction(childPrefixIcon)
163
- ? h('span', {}, getSlotVNs(childPrefixIcon({})))
164
- : h('span', {}, [
165
- h('i', {
166
- class: childPrefixIcon
167
- })
168
- ])),
169
- childPrefixOpts.content ? h('span', `${childPrefixOpts.content}`) : renderEmptyElement($xeTable)
170
- ]),
171
- h('span', {
172
- class: 'vxe-context-menu--link-content',
173
- attrs: {
174
- title: childMenuContent
141
+ h('a', {
142
+ class: 'vxe-context-menu--link',
143
+ on: {
144
+ click(evnt) {
145
+ $xeTable.ctxMenuLinkEvent(evnt, child);
146
+ },
147
+ mouseover(evnt) {
148
+ $xeTable.ctxMenuMouseoverEvent(evnt, item, child);
149
+ },
150
+ mouseout(evnt) {
151
+ $xeTable.ctxMenuMouseoutEvent(evnt, item);
152
+ }
175
153
  }
176
- }, childLoading ? getI18n('vxe.table.menuLoading') : childMenuContent),
177
- h('div', {
178
- class: ['vxe-context-menu--link-suffix', childSuffixOpts.className || '']
179
154
  }, [
180
- childSuffixIcon && XEUtils.isFunction(childSuffixIcon)
181
- ? h('span', {}, getSlotVNs(childSuffixIcon.call($xeTable, {})))
182
- : h('i', {
183
- class: childSuffixIcon
184
- }),
185
- childSuffixOpts.content ? h('span', `${childSuffixOpts.content}`) : renderEmptyElement($xeTable)
155
+ h('div', {
156
+ class: ['vxe-context-menu--link-prefix', childPrefixOpts.className || '']
157
+ }, [
158
+ child.loading
159
+ ? h('span', {
160
+ class: getIcon('TABLE_MENU_OPTION_LOADING')
161
+ })
162
+ : (childPrefixIcon && XEUtils.isFunction(childPrefixIcon)
163
+ ? h('span', {}, getSlotVNs(childPrefixIcon({})))
164
+ : h('span', {}, [
165
+ h('i', {
166
+ class: childPrefixIcon
167
+ })
168
+ ])),
169
+ childPrefixOpts.content ? h('span', `${childPrefixOpts.content}`) : renderEmptyElement($xeTable)
170
+ ]),
171
+ h('span', {
172
+ class: 'vxe-context-menu--link-content',
173
+ attrs: {
174
+ title: childMenuContent
175
+ }
176
+ }, childLoading ? getI18n('vxe.table.menuLoading') : childMenuContent),
177
+ h('div', {
178
+ class: ['vxe-context-menu--link-suffix', childSuffixOpts.className || '']
179
+ }, [
180
+ childSuffixIcon && XEUtils.isFunction(childSuffixIcon)
181
+ ? h('span', {}, getSlotVNs(childSuffixIcon.call($xeTable, {})))
182
+ : h('i', {
183
+ class: childSuffixIcon
184
+ }),
185
+ childSuffixOpts.content ? h('span', `${childSuffixOpts.content}`) : renderEmptyElement($xeTable)
186
+ ])
186
187
  ])
187
- ])
188
- ]);
189
- }))
190
- : null
191
- ]);
192
- }));
193
- })
194
- : []);
188
+ ]);
189
+ }))
190
+ : null
191
+ ]);
192
+ }));
193
+ })
194
+ : []);
195
+ }
196
+ },
197
+ render(h) {
198
+ return this.renderVN(h);
195
199
  }
196
200
  };