vxe-table 4.16.15 → 4.16.17

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 (258) hide show
  1. package/README.md +1 -1
  2. package/README.zh-TW.md +1 -1
  3. package/es/grid/src/grid.js +7 -2
  4. package/es/index.css +1 -1
  5. package/es/index.min.css +1 -1
  6. package/es/locale/lang/en-US.js +2 -2
  7. package/es/style.css +1 -1
  8. package/es/style.min.css +1 -1
  9. package/es/table/module/filter/panel.js +2 -1
  10. package/es/table/module/menu/hook.js +9 -3
  11. package/es/table/module/menu/panel.js +113 -109
  12. package/es/table/src/header.js +4 -1
  13. package/es/table/src/table.js +58 -30
  14. package/es/table/src/util.js +19 -4
  15. package/es/ui/index.js +8 -5
  16. package/es/ui/src/log.js +1 -1
  17. package/lib/grid/src/grid.js +6 -2
  18. package/lib/grid/src/grid.min.js +1 -1
  19. package/lib/index.css +1 -1
  20. package/lib/index.min.css +1 -1
  21. package/lib/index.umd.js +89 -41
  22. package/lib/index.umd.min.js +1 -1
  23. package/lib/locale/lang/ar-EG.min.js +1 -1
  24. package/lib/locale/lang/de-DE.min.js +1 -1
  25. package/lib/locale/lang/en-US.js +2 -2
  26. package/lib/locale/lang/en-US.min.js +1 -1
  27. package/lib/locale/lang/es-ES.min.js +1 -1
  28. package/lib/locale/lang/fr-FR.min.js +1 -1
  29. package/lib/locale/lang/hu-HU.min.js +1 -1
  30. package/lib/locale/lang/hy-AM.min.js +1 -1
  31. package/lib/locale/lang/id-ID.min.js +1 -1
  32. package/lib/locale/lang/it-IT.min.js +1 -1
  33. package/lib/locale/lang/ja-JP.min.js +1 -1
  34. package/lib/locale/lang/ko-KR.min.js +1 -1
  35. package/lib/locale/lang/ms-MY.min.js +1 -1
  36. package/lib/locale/lang/nb-NO.min.js +1 -1
  37. package/lib/locale/lang/pt-BR.min.js +1 -1
  38. package/lib/locale/lang/ru-RU.min.js +1 -1
  39. package/lib/locale/lang/th-TH.min.js +1 -1
  40. package/lib/locale/lang/ug-CN.min.js +1 -1
  41. package/lib/locale/lang/uk-UA.min.js +1 -1
  42. package/lib/locale/lang/uz-UZ.min.js +1 -1
  43. package/lib/locale/lang/vi-VN.min.js +1 -1
  44. package/lib/locale/lang/zh-CHT.min.js +1 -1
  45. package/lib/locale/lang/zh-CN.min.js +1 -1
  46. package/lib/locale/lang/zh-HK.min.js +1 -1
  47. package/lib/locale/lang/zh-MO.min.js +1 -1
  48. package/lib/locale/lang/zh-TW.min.js +1 -1
  49. package/lib/style.css +1 -1
  50. package/lib/style.min.css +1 -1
  51. package/lib/table/src/header.js +3 -1
  52. package/lib/table/src/props.js +0 -318
  53. package/lib/ui/index.js +8 -5
  54. package/lib/ui/index.min.js +1 -1
  55. package/lib/ui/src/log.js +1 -1
  56. package/lib/ui/src/log.min.js +1 -1
  57. package/package.json +1 -1
  58. package/packages/grid/src/grid.ts +8 -2
  59. package/packages/locale/lang/en-US.ts +2 -2
  60. package/packages/table/module/filter/panel.ts +2 -1
  61. package/packages/table/module/menu/hook.ts +11 -3
  62. package/packages/table/module/menu/panel.ts +112 -108
  63. package/packages/table/src/header.ts +3 -1
  64. package/packages/table/src/table.ts +58 -30
  65. package/packages/table/src/util.ts +19 -2
  66. package/packages/ui/index.ts +7 -4
  67. package/styles/components/grid.scss +0 -1
  68. package/es/colgroup/style.css +0 -0
  69. package/es/colgroup/style.min.css +0 -0
  70. package/es/column/style.css +0 -0
  71. package/es/column/style.min.css +0 -0
  72. package/es/grid/style.css +0 -87
  73. package/es/grid/style.min.css +0 -1
  74. package/es/iconfont.1758246364726.ttf +0 -0
  75. package/es/iconfont.1758246364726.woff +0 -0
  76. package/es/iconfont.1758246364726.woff2 +0 -0
  77. package/es/index.esm.js +0 -3
  78. package/es/locale/lang/ar-EG.d.ts +0 -2
  79. package/es/locale/lang/de-DE.d.ts +0 -2
  80. package/es/locale/lang/en-US.d.ts +0 -2
  81. package/es/locale/lang/es-ES.d.ts +0 -2
  82. package/es/locale/lang/fr-FR.d.ts +0 -2
  83. package/es/locale/lang/hu-HU.d.ts +0 -2
  84. package/es/locale/lang/hy-AM.d.ts +0 -2
  85. package/es/locale/lang/id-ID.d.ts +0 -2
  86. package/es/locale/lang/it-IT.d.ts +0 -2
  87. package/es/locale/lang/ja-JP.d.ts +0 -2
  88. package/es/locale/lang/ko-KR.d.ts +0 -2
  89. package/es/locale/lang/ms-MY.d.ts +0 -2
  90. package/es/locale/lang/nb-NO.d.ts +0 -2
  91. package/es/locale/lang/pt-BR.d.ts +0 -2
  92. package/es/locale/lang/ru-RU.d.ts +0 -2
  93. package/es/locale/lang/th-TH.d.ts +0 -2
  94. package/es/locale/lang/ug-CN.d.ts +0 -2
  95. package/es/locale/lang/uk-UA.d.ts +0 -2
  96. package/es/locale/lang/uz-UZ.d.ts +0 -2
  97. package/es/locale/lang/vi-VN.d.ts +0 -2
  98. package/es/locale/lang/zh-CHT.d.ts +0 -2
  99. package/es/locale/lang/zh-CN.d.ts +0 -2
  100. package/es/locale/lang/zh-HK.d.ts +0 -2
  101. package/es/locale/lang/zh-MO.d.ts +0 -2
  102. package/es/locale/lang/zh-TW.d.ts +0 -2
  103. package/es/table/style.css +0 -3657
  104. package/es/table/style.min.css +0 -1
  105. package/es/toolbar/style.css +0 -90
  106. package/es/toolbar/style.min.css +0 -1
  107. package/es/ui/style.css +0 -0
  108. package/es/ui/style.min.css +0 -0
  109. package/es/v-x-e-table/style.css +0 -0
  110. package/es/v-x-e-table/style.min.css +0 -0
  111. package/es/vxe-colgroup/style.css +0 -0
  112. package/es/vxe-colgroup/style.min.css +0 -0
  113. package/es/vxe-column/style.css +0 -0
  114. package/es/vxe-column/style.min.css +0 -0
  115. package/es/vxe-grid/style.css +0 -87
  116. package/es/vxe-grid/style.min.css +0 -1
  117. package/es/vxe-table/style.css +0 -3657
  118. package/es/vxe-table/style.min.css +0 -1
  119. package/es/vxe-toolbar/style.css +0 -90
  120. package/es/vxe-toolbar/style.min.css +0 -1
  121. package/es/vxe-ui/style.css +0 -0
  122. package/es/vxe-ui/style.min.css +0 -0
  123. package/es/vxe-v-x-e-table/style.css +0 -0
  124. package/es/vxe-v-x-e-table/style.min.css +0 -0
  125. package/lib/colgroup/style/index.js +0 -1
  126. package/lib/colgroup/style/style.css +0 -0
  127. package/lib/colgroup/style/style.min.css +0 -0
  128. package/lib/column/style/index.js +0 -1
  129. package/lib/column/style/style.css +0 -0
  130. package/lib/column/style/style.min.css +0 -0
  131. package/lib/grid/style/index.js +0 -1
  132. package/lib/grid/style/style.css +0 -87
  133. package/lib/grid/style/style.min.css +0 -1
  134. package/lib/iconfont.1758246364726.ttf +0 -0
  135. package/lib/iconfont.1758246364726.woff +0 -0
  136. package/lib/iconfont.1758246364726.woff2 +0 -0
  137. package/lib/index.common.js +0 -22
  138. package/lib/locale/lang/ar-EG.d.ts +0 -2
  139. package/lib/locale/lang/ar-EG.umd.js +0 -806
  140. package/lib/locale/lang/de-DE.d.ts +0 -2
  141. package/lib/locale/lang/de-DE.umd.js +0 -806
  142. package/lib/locale/lang/en-US.d.ts +0 -2
  143. package/lib/locale/lang/en-US.umd.js +0 -806
  144. package/lib/locale/lang/es-ES.d.ts +0 -2
  145. package/lib/locale/lang/es-ES.umd.js +0 -806
  146. package/lib/locale/lang/fr-FR.d.ts +0 -2
  147. package/lib/locale/lang/fr-FR.umd.js +0 -806
  148. package/lib/locale/lang/hu-HU.d.ts +0 -2
  149. package/lib/locale/lang/hu-HU.umd.js +0 -806
  150. package/lib/locale/lang/hy-AM.d.ts +0 -2
  151. package/lib/locale/lang/hy-AM.umd.js +0 -806
  152. package/lib/locale/lang/id-ID.d.ts +0 -2
  153. package/lib/locale/lang/id-ID.umd.js +0 -806
  154. package/lib/locale/lang/it-IT.d.ts +0 -2
  155. package/lib/locale/lang/it-IT.umd.js +0 -806
  156. package/lib/locale/lang/ja-JP.d.ts +0 -2
  157. package/lib/locale/lang/ja-JP.umd.js +0 -806
  158. package/lib/locale/lang/ko-KR.d.ts +0 -2
  159. package/lib/locale/lang/ko-KR.umd.js +0 -806
  160. package/lib/locale/lang/ms-MY.d.ts +0 -2
  161. package/lib/locale/lang/ms-MY.umd.js +0 -806
  162. package/lib/locale/lang/nb-NO.d.ts +0 -2
  163. package/lib/locale/lang/nb-NO.umd.js +0 -806
  164. package/lib/locale/lang/pt-BR.d.ts +0 -2
  165. package/lib/locale/lang/pt-BR.umd.js +0 -806
  166. package/lib/locale/lang/ru-RU.d.ts +0 -2
  167. package/lib/locale/lang/ru-RU.umd.js +0 -806
  168. package/lib/locale/lang/th-TH.d.ts +0 -2
  169. package/lib/locale/lang/th-TH.umd.js +0 -806
  170. package/lib/locale/lang/ug-CN.d.ts +0 -2
  171. package/lib/locale/lang/ug-CN.umd.js +0 -806
  172. package/lib/locale/lang/uk-UA.d.ts +0 -2
  173. package/lib/locale/lang/uk-UA.umd.js +0 -806
  174. package/lib/locale/lang/uz-UZ.d.ts +0 -2
  175. package/lib/locale/lang/uz-UZ.umd.js +0 -806
  176. package/lib/locale/lang/vi-VN.d.ts +0 -2
  177. package/lib/locale/lang/vi-VN.umd.js +0 -806
  178. package/lib/locale/lang/zh-CHT.d.ts +0 -2
  179. package/lib/locale/lang/zh-CHT.umd.js +0 -806
  180. package/lib/locale/lang/zh-CN.d.ts +0 -2
  181. package/lib/locale/lang/zh-CN.umd.js +0 -808
  182. package/lib/locale/lang/zh-HK.d.ts +0 -2
  183. package/lib/locale/lang/zh-HK.umd.js +0 -23
  184. package/lib/locale/lang/zh-MO.d.ts +0 -2
  185. package/lib/locale/lang/zh-MO.umd.js +0 -23
  186. package/lib/locale/lang/zh-TW.d.ts +0 -2
  187. package/lib/locale/lang/zh-TW.umd.js +0 -23
  188. package/lib/table/module/custom/hook.js +0 -430
  189. package/lib/table/module/custom/hook.min.js +0 -1
  190. package/lib/table/module/custom/panel.js +0 -1193
  191. package/lib/table/module/custom/panel.min.js +0 -1
  192. package/lib/table/module/edit/hook.js +0 -1308
  193. package/lib/table/module/edit/hook.min.js +0 -1
  194. package/lib/table/module/export/export-panel.js +0 -467
  195. package/lib/table/module/export/export-panel.min.js +0 -1
  196. package/lib/table/module/export/hook.js +0 -1888
  197. package/lib/table/module/export/hook.min.js +0 -1
  198. package/lib/table/module/export/import-panel.js +0 -226
  199. package/lib/table/module/export/import-panel.min.js +0 -1
  200. package/lib/table/module/export/util.js +0 -20
  201. package/lib/table/module/export/util.min.js +0 -1
  202. package/lib/table/module/filter/hook.js +0 -442
  203. package/lib/table/module/filter/hook.min.js +0 -1
  204. package/lib/table/module/filter/panel.js +0 -264
  205. package/lib/table/module/filter/panel.min.js +0 -1
  206. package/lib/table/module/keyboard/hook.js +0 -579
  207. package/lib/table/module/keyboard/hook.min.js +0 -1
  208. package/lib/table/module/menu/hook.js +0 -383
  209. package/lib/table/module/menu/hook.min.js +0 -1
  210. package/lib/table/module/menu/panel.js +0 -135
  211. package/lib/table/module/menu/panel.min.js +0 -1
  212. package/lib/table/module/validator/hook.js +0 -681
  213. package/lib/table/module/validator/hook.min.js +0 -1
  214. package/lib/table/src/header.min.js +0 -1
  215. package/lib/table/src/props.min.js +0 -1
  216. package/lib/table/src/store.js +0 -15
  217. package/lib/table/src/store.min.js +0 -1
  218. package/lib/table/src/table.js +0 -902
  219. package/lib/table/src/table.min.js +0 -1
  220. package/lib/table/src/use/cell-view.js +0 -57
  221. package/lib/table/src/use/cell-view.min.js +0 -1
  222. package/lib/table/src/use/index.js +0 -16
  223. package/lib/table/src/use/index.min.js +0 -1
  224. package/lib/table/src/util.js +0 -896
  225. package/lib/table/src/util.min.js +0 -1
  226. package/lib/table/style/index.js +0 -1
  227. package/lib/table/style/style.css +0 -3657
  228. package/lib/table/style/style.min.css +0 -1
  229. package/lib/toolbar/style/index.js +0 -1
  230. package/lib/toolbar/style/style.css +0 -90
  231. package/lib/toolbar/style/style.min.css +0 -1
  232. package/lib/ui/style/index.js +0 -1
  233. package/lib/ui/style/style.css +0 -0
  234. package/lib/ui/style/style.min.css +0 -0
  235. package/lib/v-x-e-table/style/index.js +0 -1
  236. package/lib/v-x-e-table/style/style.css +0 -0
  237. package/lib/v-x-e-table/style/style.min.css +0 -0
  238. package/lib/vxe-colgroup/style/index.js +0 -1
  239. package/lib/vxe-colgroup/style/style.css +0 -0
  240. package/lib/vxe-colgroup/style/style.min.css +0 -0
  241. package/lib/vxe-column/style/index.js +0 -1
  242. package/lib/vxe-column/style/style.css +0 -0
  243. package/lib/vxe-column/style/style.min.css +0 -0
  244. package/lib/vxe-grid/style/index.js +0 -1
  245. package/lib/vxe-grid/style/style.css +0 -87
  246. package/lib/vxe-grid/style/style.min.css +0 -1
  247. package/lib/vxe-table/style/index.js +0 -1
  248. package/lib/vxe-table/style/style.css +0 -3657
  249. package/lib/vxe-table/style/style.min.css +0 -1
  250. package/lib/vxe-toolbar/style/index.js +0 -1
  251. package/lib/vxe-toolbar/style/style.css +0 -90
  252. package/lib/vxe-toolbar/style/style.min.css +0 -1
  253. package/lib/vxe-ui/style/index.js +0 -1
  254. package/lib/vxe-ui/style/style.css +0 -0
  255. package/lib/vxe-ui/style/style.min.css +0 -0
  256. package/lib/vxe-v-x-e-table/style/index.js +0 -1
  257. package/lib/vxe-v-x-e-table/style/style.css +0 -0
  258. package/lib/vxe-v-x-e-table/style/style.min.css +0 -0
@@ -20,7 +20,7 @@ hooks.add('tableMenuModule', {
20
20
  const isContentMenu = computeIsContentMenu.value;
21
21
  const menuOpts = computeMenuOpts.value;
22
22
  const config = menuOpts[type];
23
- const visibleMethod = menuOpts.visibleMethod;
23
+ const { transfer, visibleMethod } = menuOpts;
24
24
  if (config) {
25
25
  const { options, disabled } = config;
26
26
  if (disabled) {
@@ -32,9 +32,15 @@ hooks.add('tableMenuModule', {
32
32
  if (!visibleMethod || visibleMethod(params)) {
33
33
  evnt.preventDefault();
34
34
  $xeTable.updateZindex();
35
+ const el = refElem.value;
36
+ const tableRect = el.getBoundingClientRect();
35
37
  const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode();
36
- let top = evnt.clientY + scrollTop;
37
- let left = evnt.clientX + scrollLeft;
38
+ let top = evnt.clientY - tableRect.y;
39
+ let left = evnt.clientX - tableRect.x;
40
+ if (transfer) {
41
+ top = evnt.clientY + scrollTop;
42
+ left = evnt.clientX + scrollLeft;
43
+ }
38
44
  const handleVisible = () => {
39
45
  internalData._currMenuParams = params;
40
46
  Object.assign(ctxMenuStore, {
@@ -1,9 +1,9 @@
1
- import { h, Teleport, inject, ref, createCommentVNode } from 'vue';
1
+ import { h, Teleport, inject, ref } from 'vue';
2
2
  import { defineVxeComponent } from '../../../ui/src/comp';
3
3
  import { VxeUI } from '../../../ui';
4
4
  import { getFuncText } from '../../../ui/src/utils';
5
5
  import XEUtils from 'xe-utils';
6
- const { getIcon } = VxeUI;
6
+ const { getIcon, renderEmptyElement } = VxeUI;
7
7
  export default defineVxeComponent({
8
8
  name: 'VxeTableMenuPanel',
9
9
  setup(props, context) {
@@ -24,126 +24,130 @@ export default defineVxeComponent({
24
24
  const { ctxMenuStore } = tableReactData;
25
25
  const { computeMenuOpts } = $xeTable.getComputeMaps();
26
26
  const menuOpts = computeMenuOpts.value;
27
+ const { transfer, destroyOnClose } = menuOpts;
28
+ const { visible, list, className } = ctxMenuStore;
27
29
  return h(Teleport, {
28
30
  to: 'body',
29
- disabled: false
31
+ disabled: !transfer
30
32
  }, [
31
33
  h('div', {
32
34
  ref: refElem,
33
- class: ['vxe-table--context-menu-wrapper', menuOpts.className, {
34
- 'is--visible': ctxMenuStore.visible
35
+ class: ['vxe-table--context-menu-wrapper', className, {
36
+ 'is--visible': visible
35
37
  }],
36
38
  style: ctxMenuStore.style
37
- }, ctxMenuStore.list.map((options, gIndex) => {
38
- return options.every(item => item.visible === false)
39
- ? createCommentVNode()
40
- : h('ul', {
41
- class: 'vxe-context-menu--option-wrapper',
42
- key: gIndex
43
- }, options.map((item, index) => {
44
- const hasChildMenus = item.children && item.children.some((child) => child.visible !== false);
45
- const prefixOpts = Object.assign({}, item.prefixConfig);
46
- const suffixOpts = Object.assign({}, item.suffixConfig);
47
- const menuContent = getFuncText(item.name);
48
- return item.visible === false
49
- ? null
50
- : h('li', {
51
- class: [item.className, {
52
- 'link--disabled': item.disabled,
53
- 'link--active': item === ctxMenuStore.selected
54
- }],
55
- key: `${gIndex}_${index}`
56
- }, [
57
- h('a', {
58
- class: 'vxe-context-menu--link',
59
- onClick(evnt) {
60
- $xeTable.ctxMenuLinkEvent(evnt, item);
61
- },
62
- onMouseover(evnt) {
63
- $xeTable.ctxMenuMouseoverEvent(evnt, item);
64
- },
65
- onMouseout(evnt) {
66
- $xeTable.ctxMenuMouseoutEvent(evnt, item);
67
- }
39
+ }, (destroyOnClose ? visible : true)
40
+ ? list.map((options, gIndex) => {
41
+ return options.every(item => item.visible === false)
42
+ ? renderEmptyElement($xeTable)
43
+ : h('ul', {
44
+ class: 'vxe-context-menu--option-wrapper',
45
+ key: gIndex
46
+ }, options.map((item, index) => {
47
+ const hasChildMenus = item.children && item.children.some((child) => child.visible !== false);
48
+ const prefixOpts = Object.assign({}, item.prefixConfig);
49
+ const suffixOpts = Object.assign({}, item.suffixConfig);
50
+ const menuContent = getFuncText(item.name);
51
+ return item.visible === false
52
+ ? renderEmptyElement($xeTable)
53
+ : h('li', {
54
+ class: [item.className, {
55
+ 'link--disabled': item.disabled,
56
+ 'link--active': item === ctxMenuStore.selected
57
+ }],
58
+ key: `${gIndex}_${index}`
68
59
  }, [
69
- h('div', {
70
- class: ['vxe-context-menu--link-prefix', prefixOpts.className || '']
60
+ h('a', {
61
+ class: 'vxe-context-menu--link',
62
+ onClick(evnt) {
63
+ $xeTable.ctxMenuLinkEvent(evnt, item);
64
+ },
65
+ onMouseover(evnt) {
66
+ $xeTable.ctxMenuMouseoverEvent(evnt, item);
67
+ },
68
+ onMouseout(evnt) {
69
+ $xeTable.ctxMenuMouseoutEvent(evnt, item);
70
+ }
71
71
  }, [
72
- h('i', {
73
- class: prefixOpts.icon || item.prefixIcon
74
- }),
75
- prefixOpts.content ? h('span', {}, `${prefixOpts.content}`) : createCommentVNode()
72
+ h('div', {
73
+ class: ['vxe-context-menu--link-prefix', prefixOpts.className || '']
74
+ }, [
75
+ h('i', {
76
+ class: prefixOpts.icon || item.prefixIcon
77
+ }),
78
+ prefixOpts.content ? h('span', {}, `${prefixOpts.content}`) : renderEmptyElement($xeTable)
79
+ ]),
80
+ h('div', {
81
+ class: 'vxe-context-menu--link-content',
82
+ title: menuContent
83
+ }, menuContent),
84
+ h('div', {
85
+ class: ['vxe-context-menu--link-suffix', suffixOpts.className || '']
86
+ }, [
87
+ h('i', {
88
+ class: (suffixOpts.icon || item.suffixIcon) || (hasChildMenus ? getIcon().TABLE_MENU_OPTIONS : '')
89
+ }),
90
+ suffixOpts.content ? h('span', `${suffixOpts.content}`) : renderEmptyElement($xeTable)
91
+ ])
76
92
  ]),
77
- h('div', {
78
- class: 'vxe-context-menu--link-content',
79
- title: menuContent
80
- }, menuContent),
81
- h('div', {
82
- class: ['vxe-context-menu--link-suffix', suffixOpts.className || '']
83
- }, [
84
- h('i', {
85
- class: (suffixOpts.icon || item.suffixIcon) || (hasChildMenus ? getIcon().TABLE_MENU_OPTIONS : '')
86
- }),
87
- suffixOpts.content ? h('span', `${suffixOpts.content}`) : createCommentVNode()
88
- ])
89
- ]),
90
- hasChildMenus
91
- ? h('ul', {
92
- class: ['vxe-table--context-menu-clild-wrapper', {
93
- 'is--show': item === ctxMenuStore.selected && ctxMenuStore.showChild
94
- }]
95
- }, item.children.map((child, cIndex) => {
96
- const childPrefixOpts = Object.assign({}, child.prefixConfig);
97
- const childSuffixOpts = Object.assign({}, child.suffixConfig);
98
- const childMenuContent = getFuncText(child.name);
99
- return child.visible === false
100
- ? null
101
- : h('li', {
102
- class: [child.className, {
103
- 'link--disabled': child.disabled,
104
- 'link--active': child === ctxMenuStore.selectChild
105
- }],
106
- key: `${gIndex}_${index}_${cIndex}`
107
- }, [
108
- h('a', {
109
- class: 'vxe-context-menu--link',
110
- onClick(evnt) {
111
- $xeTable.ctxMenuLinkEvent(evnt, child);
112
- },
113
- onMouseover(evnt) {
114
- $xeTable.ctxMenuMouseoverEvent(evnt, item, child);
115
- },
116
- onMouseout(evnt) {
117
- $xeTable.ctxMenuMouseoutEvent(evnt, item);
118
- }
93
+ hasChildMenus
94
+ ? h('ul', {
95
+ class: ['vxe-table--context-menu-clild-wrapper', {
96
+ 'is--show': item === ctxMenuStore.selected && ctxMenuStore.showChild
97
+ }]
98
+ }, item.children.map((child, cIndex) => {
99
+ const childPrefixOpts = Object.assign({}, child.prefixConfig);
100
+ const childSuffixOpts = Object.assign({}, child.suffixConfig);
101
+ const childMenuContent = getFuncText(child.name);
102
+ return child.visible === false
103
+ ? null
104
+ : h('li', {
105
+ class: [child.className, {
106
+ 'link--disabled': child.disabled,
107
+ 'link--active': child === ctxMenuStore.selectChild
108
+ }],
109
+ key: `${gIndex}_${index}_${cIndex}`
119
110
  }, [
120
- h('div', {
121
- class: ['vxe-context-menu--link-prefix', childPrefixOpts.className || '']
122
- }, [
123
- h('i', {
124
- class: childPrefixOpts.icon || child.prefixIcon
125
- }),
126
- childPrefixOpts.content ? h('span', `${childPrefixOpts.content}`) : createCommentVNode()
127
- ]),
128
- h('div', {
129
- class: 'vxe-context-menu--link-content',
130
- title: childMenuContent
131
- }, childMenuContent),
132
- h('div', {
133
- class: ['vxe-context-menu--link-suffix', childSuffixOpts.className || '']
111
+ h('a', {
112
+ class: 'vxe-context-menu--link',
113
+ onClick(evnt) {
114
+ $xeTable.ctxMenuLinkEvent(evnt, child);
115
+ },
116
+ onMouseover(evnt) {
117
+ $xeTable.ctxMenuMouseoverEvent(evnt, item, child);
118
+ },
119
+ onMouseout(evnt) {
120
+ $xeTable.ctxMenuMouseoutEvent(evnt, item);
121
+ }
134
122
  }, [
135
- h('i', {
136
- class: childSuffixOpts.icon
137
- }),
138
- childSuffixOpts.content ? h('span', `${childSuffixOpts.content}`) : createCommentVNode()
123
+ h('div', {
124
+ class: ['vxe-context-menu--link-prefix', childPrefixOpts.className || '']
125
+ }, [
126
+ h('i', {
127
+ class: childPrefixOpts.icon || child.prefixIcon
128
+ }),
129
+ childPrefixOpts.content ? h('span', `${childPrefixOpts.content}`) : renderEmptyElement($xeTable)
130
+ ]),
131
+ h('div', {
132
+ class: 'vxe-context-menu--link-content',
133
+ title: childMenuContent
134
+ }, childMenuContent),
135
+ h('div', {
136
+ class: ['vxe-context-menu--link-suffix', childSuffixOpts.className || '']
137
+ }, [
138
+ h('i', {
139
+ class: childSuffixOpts.icon
140
+ }),
141
+ childSuffixOpts.content ? h('span', `${childSuffixOpts.content}`) : renderEmptyElement($xeTable)
142
+ ])
139
143
  ])
140
- ])
141
- ]);
142
- }))
143
- : null
144
- ]);
145
- }));
146
- }))
144
+ ]);
145
+ }))
146
+ : null
147
+ ]);
148
+ }));
149
+ })
150
+ : [])
147
151
  ]);
148
152
  };
149
153
  $xeMenuPanel.renderVN = renderVN;
@@ -177,7 +177,10 @@ export default defineVxeComponent({
177
177
  else {
178
178
  tcStyle.minHeight = `${currCellHeight}px`;
179
179
  }
180
- if (isColGroup && !isLastRow) {
180
+ if (showCustomHeader) {
181
+ // custom
182
+ }
183
+ else if (isColGroup && !isLastRow) {
181
184
  const firstCol = getColumnFirstChild(column);
182
185
  const lastCol = getColumnLastChild(column);
183
186
  if (firstCol && lastCol && firstCol.id !== lastCol.id) {
@@ -4,7 +4,7 @@ import XEUtils from 'xe-utils';
4
4
  import { initTpImg, getTpImg, isPx, isScale, hasClass, addClass, removeClass, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey } from '../../ui/src/dom';
5
5
  import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils';
6
6
  import { VxeUI } from '../../ui';
7
- import { createInternalData, getRowUniqueId, clearTableAllStatus, getColumnList, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getCalcHeight, getCellRestHeight } from './util';
7
+ import { createInternalData, getRowUniqueId, clearTableAllStatus, getColumnList, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getCalcHeight, getCellRestHeight, getLastChildColumn } from './util';
8
8
  import { getSlotVNs } from '../../ui/src/vn';
9
9
  import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from './anime';
10
10
  import { warnLog, errLog } from '../../ui/src/log';
@@ -315,6 +315,7 @@ export default defineVxeComponent({
315
315
  const refTableRightBody = ref();
316
316
  const refTableRightFooter = ref();
317
317
  const refTeleportWrapper = ref();
318
+ const refPopupWrapperElem = ref();
318
319
  const refLeftContainer = ref();
319
320
  const refRightContainer = ref();
320
321
  const refColResizeBar = ref();
@@ -1195,6 +1196,7 @@ export default defineVxeComponent({
1195
1196
  $xeTable.setMergeHeaderCells(merges);
1196
1197
  };
1197
1198
  const handleHeaderMerge = (merges) => {
1199
+ const { showCustomHeader } = props;
1198
1200
  const { footerTableData } = reactData;
1199
1201
  const { mergeHeaderList, mergeHeaderMaps, fullColumnIdData } = internalData;
1200
1202
  if (merges) {
@@ -1219,6 +1221,10 @@ export default defineVxeComponent({
1219
1221
  if (mergeRowIndex > -1 && mergeColumnIndex > -1 && (rowspan || colspan)) {
1220
1222
  rowspan = XEUtils.toNumber(rowspan) || 1;
1221
1223
  colspan = XEUtils.toNumber(colspan) || 1;
1224
+ if (!showCustomHeader && rowspan > 1) {
1225
+ errLog('vxe.error.notSupportProp', ['[table] show-custom-header=false', `rowspan=${rowspan}`, 'rowspan=1']);
1226
+ return;
1227
+ }
1222
1228
  if (rowspan > 1 || colspan > 1) {
1223
1229
  const row = footerTableData[mergeRowIndex];
1224
1230
  const column = visibleColumn[mergeColumnIndex];
@@ -3849,6 +3855,10 @@ export default defineVxeComponent({
3849
3855
  if ($xeTable.handleUpdateCustomColumn) {
3850
3856
  $xeTable.handleUpdateCustomColumn();
3851
3857
  }
3858
+ const columnOpts = computeColumnOpts.value;
3859
+ if (props.showCustomHeader && reactData.isGroup && (columnOpts.resizable || props.resizable)) {
3860
+ warnLog('vxe.error.notConflictProp', ['show-custom-header & colgroup', 'column-config.resizable=false']);
3861
+ }
3852
3862
  reactData.isColLoading = false;
3853
3863
  return handleLazyRecalculate(false, true, true);
3854
3864
  });
@@ -8416,18 +8426,16 @@ export default defineVxeComponent({
8416
8426
  const scrollbarXToTop = computeScrollbarXToTop.value;
8417
8427
  const { clientX: dragClientX } = evnt;
8418
8428
  const dragBtnElem = evnt.target;
8429
+ let cell = dragBtnElem.parentElement;
8419
8430
  let resizeColumn = column;
8420
8431
  const isDragGroupCol = column.children && column.children.length;
8421
8432
  if (isDragGroupCol) {
8422
- XEUtils.eachTree(column.children, childColumn => {
8423
- resizeColumn = childColumn;
8424
- });
8425
- }
8426
- let cell = dragBtnElem.parentElement;
8427
- if (isDragGroupCol) {
8428
- const trEl = cell ? cell.parentElement : null;
8429
- const theadEl = trEl ? trEl.parentElement : null;
8430
- cell = theadEl ? theadEl.querySelector(`.vxe-header--column[colid="${resizeColumn.id}"]`) : null;
8433
+ resizeColumn = getLastChildColumn(column);
8434
+ if (isDragGroupCol) {
8435
+ const trEl = cell ? cell.parentElement : null;
8436
+ const theadEl = trEl ? trEl.parentElement : null;
8437
+ cell = theadEl ? theadEl.querySelector(`.vxe-header--column[colid="${resizeColumn.id}"]`) : null;
8438
+ }
8431
8439
  }
8432
8440
  if (!cell) {
8433
8441
  return;
@@ -12082,7 +12090,7 @@ export default defineVxeComponent({
12082
12090
  const renderVN = () => {
12083
12091
  const { loading, stripe, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules } = props;
12084
12092
  const { isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, tableData, initStore, isRowGroupStatus, columnStore, filterStore, customStore, tooltipStore } = reactData;
12085
- const { teleportToWrapperElem } = internalData;
12093
+ const { teleportToWrapperElem, popupToWrapperElem } = internalData;
12086
12094
  const { leftList, rightList } = columnStore;
12087
12095
  const loadingSlot = slots.loading;
12088
12096
  const tipSlots = {
@@ -12280,16 +12288,38 @@ export default defineVxeComponent({
12280
12288
  ])
12281
12289
  ])
12282
12290
  ]),
12283
- /**
12284
- * 筛选
12285
- */
12286
- initStore.filter
12287
- ? h(TableFilterPanelComponent, {
12288
- key: 'tf',
12289
- ref: refTableFilter,
12290
- filterStore
12291
- })
12292
- : renderEmptyElement($xeTable),
12291
+ h('div', {
12292
+ key: 'tpw'
12293
+ }, [
12294
+ h(Teleport, {
12295
+ to: popupToWrapperElem,
12296
+ disabled: !($xeGGWrapper && popupToWrapperElem)
12297
+ }, [
12298
+ h('div', {
12299
+ ref: refPopupWrapperElem
12300
+ }, [
12301
+ /**
12302
+ * 筛选
12303
+ */
12304
+ initStore.filter
12305
+ ? h(TableFilterPanelComponent, {
12306
+ key: 'tf',
12307
+ ref: refTableFilter,
12308
+ filterStore
12309
+ })
12310
+ : renderEmptyElement($xeTable),
12311
+ /**
12312
+ * 快捷菜单
12313
+ */
12314
+ isContentMenu
12315
+ ? h(TableMenuPanelComponent, {
12316
+ key: 'tm',
12317
+ ref: refTableMenu
12318
+ })
12319
+ : renderEmptyElement($xeTable)
12320
+ ])
12321
+ ])
12322
+ ]),
12293
12323
  /**
12294
12324
  * 导入
12295
12325
  */
@@ -12310,15 +12340,6 @@ export default defineVxeComponent({
12310
12340
  storeData: reactData.exportStore
12311
12341
  })
12312
12342
  : renderEmptyElement($xeTable),
12313
- /**
12314
- * 快捷菜单
12315
- */
12316
- isContentMenu
12317
- ? h(TableMenuPanelComponent, {
12318
- key: 'tm',
12319
- ref: refTableMenu
12320
- })
12321
- : renderEmptyElement($xeTable),
12322
12343
  /**
12323
12344
  * 提示相关
12324
12345
  */
@@ -12605,6 +12626,13 @@ export default defineVxeComponent({
12605
12626
  internalData.teleportToWrapperElem = classifyWrapperEl;
12606
12627
  }
12607
12628
  }
12629
+ if ($xeGGWrapper) {
12630
+ const { refPopupContainerElem } = $xeGGWrapper.getRefMaps();
12631
+ const popupContainerEl = refPopupContainerElem.value;
12632
+ if (popupContainerEl) {
12633
+ internalData.popupToWrapperElem = popupContainerEl;
12634
+ }
12635
+ }
12608
12636
  if (columnOpts.drag || rowOpts.drag || customOpts.allowSort) {
12609
12637
  initTpImg();
12610
12638
  }
@@ -121,6 +121,7 @@ export function createInternalData() {
121
121
  // 表尾高度
122
122
  tFooterHeight: 0,
123
123
  teleportToWrapperElem: null,
124
+ popupToWrapperElem: null,
124
125
  inited: false,
125
126
  tooltipTimeout: null,
126
127
  initStatus: false,
@@ -542,13 +543,27 @@ export function getRootColumn($xeTable, column) {
542
543
  }
543
544
  return column;
544
545
  }
546
+ export function getFirstChildColumn(column) {
547
+ const { children } = column;
548
+ if (children && children.length) {
549
+ return getFirstChildColumn(XEUtils.first(children));
550
+ }
551
+ return column;
552
+ }
553
+ export function getLastChildColumn(column) {
554
+ const { children } = column;
555
+ if (children && children.length) {
556
+ return getFirstChildColumn(XEUtils.last(children));
557
+ }
558
+ return column;
559
+ }
545
560
  const lineOffsetSizes = {
546
561
  mini: 3,
547
562
  small: 2,
548
563
  medium: 1,
549
564
  large: 0
550
565
  };
551
- const countTreeExpand = (prevRow, params) => {
566
+ function countTreeExpand(prevRow, params) {
552
567
  let count = 1;
553
568
  if (!prevRow) {
554
569
  return count;
@@ -569,15 +584,15 @@ const countTreeExpand = (prevRow, params) => {
569
584
  }
570
585
  }
571
586
  return count;
572
- };
573
- export const getOffsetSize = ($xeTable) => {
587
+ }
588
+ export function getOffsetSize($xeTable) {
574
589
  const { computeSize } = $xeTable.getComputeMaps();
575
590
  const vSize = computeSize.value;
576
591
  if (vSize) {
577
592
  return lineOffsetSizes[vSize] || 0;
578
593
  }
579
594
  return 0;
580
- };
595
+ }
581
596
  export function calcTreeLine(params, prevRow) {
582
597
  const { $table, row } = params;
583
598
  const tableProps = $table.props;
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "4.16.15";
3
+ export const version = "4.16.17";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
@@ -93,9 +93,11 @@ VxeUI.setConfig({
93
93
  footerCellConfig: {
94
94
  height: 'unset'
95
95
  },
96
- // menuConfig: {
97
- // visibleMethod () {}
98
- // },
96
+ menuConfig: {
97
+ // visibleMethod () {},
98
+ // transfer: false,
99
+ destroyOnClose: true
100
+ },
99
101
  customConfig: {
100
102
  // enabled: false,
101
103
  allowVisible: true,
@@ -142,8 +144,9 @@ VxeUI.setConfig({
142
144
  filterConfig: {
143
145
  // remote: false,
144
146
  // filterMethod: null,
145
- // destroyOnClose: false,
146
147
  // isEvery: false,
148
+ // transfer: false,
149
+ destroyOnClose: true,
147
150
  multiple: true,
148
151
  showIcon: true
149
152
  },
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"4.16.15"}`;
3
+ const version = `table v${"4.16.17"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
@@ -74,6 +74,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
74
74
  const refForm = (0, _vue.ref)();
75
75
  const refToolbar = (0, _vue.ref)();
76
76
  const refPager = (0, _vue.ref)();
77
+ const refPopupContainerElem = (0, _vue.ref)();
77
78
  const refFormWrapper = (0, _vue.ref)();
78
79
  const refToolbarWrapper = (0, _vue.ref)();
79
80
  const refTopWrapper = (0, _vue.ref)();
@@ -253,7 +254,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
253
254
  refTable,
254
255
  refForm,
255
256
  refToolbar,
256
- refPager
257
+ refPager,
258
+ refPopupContainerElem
257
259
  };
258
260
  const computeMaps = {
259
261
  computeProxyOpts,
@@ -894,7 +896,9 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
894
896
  class: 'vxe-grid--layout-aside-right-wrapper'
895
897
  }, asideRightSlot({})) : renderEmptyElement($xeGrid)]), (0, _vue.h)('div', {
896
898
  class: 'vxe-grid--layout-footer-wrapper'
897
- }, renderChildLayout(footKeys))];
899
+ }, renderChildLayout(footKeys)), (0, _vue.h)('div', {
900
+ ref: refPopupContainerElem
901
+ })];
898
902
  };
899
903
  const tableCompEvents = {};
900
904
  _emits2.tableEmits.forEach(name => {