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
@@ -1,383 +0,0 @@
1
- "use strict";
2
-
3
- var _vue = require("vue");
4
- var _xeUtils = _interopRequireDefault(require("xe-utils"));
5
- var _ui = require("../../../ui");
6
- var _dom = require("../../../ui/src/dom");
7
- var _utils = require("../../../ui/src/utils");
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- const {
10
- menus,
11
- hooks,
12
- globalEvents,
13
- GLOBAL_EVENT_KEYS
14
- } = _ui.VxeUI;
15
- const tableMenuMethodKeys = ['closeMenu'];
16
- hooks.add('tableMenuModule', {
17
- setupTable($xeTable) {
18
- const {
19
- xID,
20
- props,
21
- reactData,
22
- internalData
23
- } = $xeTable;
24
- const {
25
- refElem,
26
- refTableFilter,
27
- refTableMenu
28
- } = $xeTable.getRefMaps();
29
- const {
30
- computeMouseOpts,
31
- computeIsContentMenu,
32
- computeMenuOpts
33
- } = $xeTable.getComputeMaps();
34
- let menuMethods = {};
35
- let menuPrivateMethods = {};
36
- /**
37
- * 显示快捷菜单
38
- */
39
- const handleOpenMenuEvent = (evnt, type, params) => {
40
- const {
41
- ctxMenuStore
42
- } = reactData;
43
- const isContentMenu = computeIsContentMenu.value;
44
- const menuOpts = computeMenuOpts.value;
45
- const config = menuOpts[type];
46
- const visibleMethod = menuOpts.visibleMethod;
47
- if (config) {
48
- const {
49
- options,
50
- disabled
51
- } = config;
52
- if (disabled) {
53
- evnt.preventDefault();
54
- } else if (isContentMenu && options && options.length) {
55
- params.options = options;
56
- $xeTable.preventEvent(evnt, 'event.showMenu', params, () => {
57
- if (!visibleMethod || visibleMethod(params)) {
58
- evnt.preventDefault();
59
- $xeTable.updateZindex();
60
- const {
61
- scrollTop,
62
- scrollLeft,
63
- visibleHeight,
64
- visibleWidth
65
- } = (0, _dom.getDomNode)();
66
- let top = evnt.clientY + scrollTop;
67
- let left = evnt.clientX + scrollLeft;
68
- const handleVisible = () => {
69
- internalData._currMenuParams = params;
70
- Object.assign(ctxMenuStore, {
71
- visible: true,
72
- list: options,
73
- selected: null,
74
- selectChild: null,
75
- showChild: false,
76
- style: {
77
- zIndex: internalData.tZindex,
78
- top: `${top}px`,
79
- left: `${left}px`
80
- }
81
- });
82
- (0, _vue.nextTick)(() => {
83
- const tableMenu = refTableMenu.value;
84
- const ctxElem = tableMenu.getRefMaps().refElem.value;
85
- const clientHeight = ctxElem.clientHeight;
86
- const clientWidth = ctxElem.clientWidth;
87
- const {
88
- boundingTop,
89
- boundingLeft
90
- } = (0, _dom.getAbsolutePos)(ctxElem);
91
- const offsetTop = boundingTop + clientHeight - visibleHeight;
92
- const offsetLeft = boundingLeft + clientWidth - visibleWidth;
93
- if (offsetTop > -10) {
94
- ctxMenuStore.style.top = `${Math.max(scrollTop + 2, top - clientHeight - 2)}px`;
95
- }
96
- if (offsetLeft > -10) {
97
- ctxMenuStore.style.left = `${Math.max(scrollLeft + 2, left - clientWidth - 2)}px`;
98
- }
99
- });
100
- };
101
- const {
102
- keyboard,
103
- row,
104
- column
105
- } = params;
106
- if (keyboard && row && column) {
107
- $xeTable.scrollToRow(row, column).then(() => {
108
- const cell = $xeTable.getCellElement(row, column);
109
- if (cell) {
110
- const {
111
- boundingTop,
112
- boundingLeft
113
- } = (0, _dom.getAbsolutePos)(cell);
114
- top = boundingTop + scrollTop + Math.floor(cell.offsetHeight / 2);
115
- left = boundingLeft + scrollLeft + Math.floor(cell.offsetWidth / 2);
116
- }
117
- handleVisible();
118
- });
119
- } else {
120
- handleVisible();
121
- }
122
- } else {
123
- menuMethods.closeMenu();
124
- }
125
- });
126
- }
127
- }
128
- $xeTable.closeFilter();
129
- };
130
- menuMethods = {
131
- /**
132
- * 关闭快捷菜单
133
- */
134
- closeMenu() {
135
- Object.assign(reactData.ctxMenuStore, {
136
- visible: false,
137
- selected: null,
138
- selectChild: null,
139
- showChild: false
140
- });
141
- return (0, _vue.nextTick)();
142
- }
143
- };
144
- menuPrivateMethods = {
145
- /**
146
- * 处理菜单的移动
147
- */
148
- moveCtxMenu(evnt, ctxMenuStore, property, hasOper, operRest, menuList) {
149
- let selectItem;
150
- const selectIndex = _xeUtils.default.findIndexOf(menuList, item => ctxMenuStore[property] === item);
151
- if (hasOper) {
152
- if (operRest && (0, _utils.hasChildrenList)(ctxMenuStore.selected)) {
153
- ctxMenuStore.showChild = true;
154
- } else {
155
- ctxMenuStore.showChild = false;
156
- ctxMenuStore.selectChild = null;
157
- }
158
- } else if (globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_UP)) {
159
- for (let len = selectIndex - 1; len >= 0; len--) {
160
- if (menuList[len].visible !== false) {
161
- selectItem = menuList[len];
162
- break;
163
- }
164
- }
165
- ctxMenuStore[property] = selectItem || menuList[menuList.length - 1];
166
- } else if (globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_DOWN)) {
167
- for (let index = selectIndex + 1; index < menuList.length; index++) {
168
- if (menuList[index].visible !== false) {
169
- selectItem = menuList[index];
170
- break;
171
- }
172
- }
173
- ctxMenuStore[property] = selectItem || menuList[0];
174
- } else if (ctxMenuStore[property] && (globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ENTER) || globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.SPACEBAR))) {
175
- $xeTable.ctxMenuLinkEvent(evnt, ctxMenuStore[property]);
176
- }
177
- },
178
- handleOpenMenuEvent,
179
- /**
180
- * 快捷菜单事件处理
181
- */
182
- handleGlobalContextmenuEvent(evnt) {
183
- const $xeGrid = $xeTable.xeGrid;
184
- const $xeGantt = $xeTable.xeGantt;
185
- const {
186
- mouseConfig,
187
- menuConfig
188
- } = props;
189
- const {
190
- editStore,
191
- ctxMenuStore
192
- } = reactData;
193
- const {
194
- visibleColumn
195
- } = internalData;
196
- const tableFilter = refTableFilter.value;
197
- const tableMenu = refTableMenu.value;
198
- const mouseOpts = computeMouseOpts.value;
199
- const menuOpts = computeMenuOpts.value;
200
- const el = refElem.value;
201
- const {
202
- selected
203
- } = editStore;
204
- const layoutList = ['header', 'body', 'footer'];
205
- if ((0, _utils.isEnableConf)(menuConfig)) {
206
- if (ctxMenuStore.visible && tableMenu && (0, _dom.getEventTargetNode)(evnt, tableMenu.getRefMaps().refElem.value).flag) {
207
- evnt.preventDefault();
208
- return;
209
- }
210
- if (internalData._keyCtx) {
211
- const type = 'body';
212
- const params = {
213
- type,
214
- $table: $xeTable,
215
- $grid: $xeGrid,
216
- $gantt: $xeGantt,
217
- keyboard: true,
218
- columns: visibleColumn.slice(0),
219
- $event: evnt
220
- };
221
- // 如果开启单元格区域
222
- if (mouseConfig && mouseOpts.area) {
223
- const activeArea = $xeTable.getActiveCellArea();
224
- if (activeArea && activeArea.row && activeArea.column) {
225
- params.row = activeArea.row;
226
- params.column = activeArea.column;
227
- handleOpenMenuEvent(evnt, type, params);
228
- return;
229
- }
230
- } else if (mouseConfig && mouseOpts.selected) {
231
- // 如果启用键盘导航且已选中单元格
232
- if (selected.row && selected.column) {
233
- params.row = selected.row;
234
- params.column = selected.column;
235
- handleOpenMenuEvent(evnt, type, params);
236
- return;
237
- }
238
- }
239
- }
240
- // 分别匹配表尾、内容、表尾的快捷菜单
241
- for (let index = 0; index < layoutList.length; index++) {
242
- const layout = layoutList[index];
243
- const columnTargetNode = (0, _dom.getEventTargetNode)(evnt, el, `vxe-${layout}--column`, target => {
244
- // target=td|th,直接向上找 table 去匹配即可
245
- return target.parentNode.parentNode.parentNode.getAttribute('xid') === xID;
246
- });
247
- const params = {
248
- type: layout,
249
- $table: $xeTable,
250
- $grid: $xeGrid,
251
- $gantt: $xeGantt,
252
- columns: visibleColumn.slice(0),
253
- $event: evnt
254
- };
255
- if (columnTargetNode.flag) {
256
- const cell = columnTargetNode.targetElem;
257
- const columnNodeRest = $xeTable.getColumnNode(cell);
258
- const column = columnNodeRest ? columnNodeRest.item : null;
259
- let typePrefix = `${layout}-`;
260
- if (column) {
261
- Object.assign(params, {
262
- column,
263
- columnIndex: $xeTable.getColumnIndex(column),
264
- cell
265
- });
266
- }
267
- if (layout === 'body') {
268
- const rowNodeRest = $xeTable.getRowNode(cell.parentNode);
269
- const row = rowNodeRest ? rowNodeRest.item : null;
270
- typePrefix = '';
271
- if (row) {
272
- params.row = row;
273
- params.rowIndex = $xeTable.getRowIndex(row);
274
- }
275
- }
276
- const eventType = `${typePrefix}cell-menu`;
277
- handleOpenMenuEvent(evnt, layout, params);
278
- $xeTable.dispatchEvent(eventType, params, evnt);
279
- return;
280
- } else if ((0, _dom.getEventTargetNode)(evnt, el, `vxe-table--${layout}-wrapper`, target => target.getAttribute('xid') === xID).flag) {
281
- if (menuOpts.trigger === 'cell') {
282
- evnt.preventDefault();
283
- } else {
284
- handleOpenMenuEvent(evnt, layout, params);
285
- }
286
- return;
287
- }
288
- }
289
- }
290
- if (tableFilter && !(0, _dom.getEventTargetNode)(evnt, tableFilter.getRefMaps().refElem.value).flag) {
291
- $xeTable.closeFilter();
292
- }
293
- menuMethods.closeMenu();
294
- },
295
- ctxMenuMouseoverEvent(evnt, item, child) {
296
- const menuElem = evnt.currentTarget;
297
- const {
298
- ctxMenuStore
299
- } = reactData;
300
- evnt.preventDefault();
301
- evnt.stopPropagation();
302
- ctxMenuStore.selected = item;
303
- ctxMenuStore.selectChild = child;
304
- if (!child) {
305
- ctxMenuStore.showChild = (0, _utils.hasChildrenList)(item);
306
- if (ctxMenuStore.showChild) {
307
- (0, _vue.nextTick)(() => {
308
- const childWrapperElem = menuElem.nextElementSibling;
309
- if (childWrapperElem) {
310
- const {
311
- boundingTop,
312
- boundingLeft,
313
- visibleHeight,
314
- visibleWidth
315
- } = (0, _dom.getAbsolutePos)(menuElem);
316
- const posTop = boundingTop + menuElem.offsetHeight;
317
- const posLeft = boundingLeft + menuElem.offsetWidth;
318
- let left = '';
319
- let right = '';
320
- // 是否超出右侧
321
- if (posLeft + childWrapperElem.offsetWidth > visibleWidth - 10) {
322
- left = 'auto';
323
- right = `${menuElem.offsetWidth}px`;
324
- }
325
- // 是否超出底部
326
- let top = '';
327
- let bottom = '';
328
- if (posTop + childWrapperElem.offsetHeight > visibleHeight - 10) {
329
- top = 'auto';
330
- bottom = '0';
331
- }
332
- childWrapperElem.style.left = left;
333
- childWrapperElem.style.right = right;
334
- childWrapperElem.style.top = top;
335
- childWrapperElem.style.bottom = bottom;
336
- }
337
- });
338
- }
339
- }
340
- },
341
- ctxMenuMouseoutEvent(evnt, item) {
342
- const {
343
- ctxMenuStore
344
- } = reactData;
345
- if (!item.children) {
346
- ctxMenuStore.selected = null;
347
- }
348
- ctxMenuStore.selectChild = null;
349
- },
350
- /**
351
- * 快捷菜单点击事件
352
- */
353
- ctxMenuLinkEvent(evnt, menu) {
354
- const $xeGrid = $xeTable.xeGrid;
355
- const $xeGantt = $xeTable.xeGantt;
356
- // 如果一级菜单有配置 code 则允许点击,否则不能点击
357
- if (!menu.disabled && (menu.code || !menu.children || !menu.children.length)) {
358
- const gMenuOpts = menus.get(menu.code);
359
- const params = Object.assign({}, internalData._currMenuParams, {
360
- menu,
361
- $table: $xeTable,
362
- $grid: $xeGrid,
363
- $gantt: $xeGantt,
364
- $event: evnt
365
- });
366
- const tmMethod = gMenuOpts ? gMenuOpts.tableMenuMethod || gMenuOpts.menuMethod : null;
367
- if (tmMethod) {
368
- tmMethod(params, evnt);
369
- }
370
- $xeTable.dispatchEvent('menu-click', params, evnt);
371
- menuMethods.closeMenu();
372
- }
373
- }
374
- };
375
- return Object.assign(Object.assign({}, menuMethods), menuPrivateMethods);
376
- },
377
- setupGrid($xeGrid) {
378
- return $xeGrid.extendTableMethods(tableMenuMethodKeys);
379
- },
380
- setupGantt($xeGantt) {
381
- return $xeGantt.extendTableMethods(tableMenuMethodKeys);
382
- }
383
- });
@@ -1 +0,0 @@
1
- var _vue=require("vue"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../../ui"),_dom=require("../../../ui/src/dom"),_utils=require("../../../ui/src/utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let{menus,hooks,globalEvents,GLOBAL_EVENT_KEYS}=_ui.VxeUI,tableMenuMethodKeys=["closeMenu"];hooks.add("tableMenuModule",{setupTable(p){let{xID:M,props:x,reactData:E,internalData:_}=p,{refElem:C,refTableFilter:T,refTableMenu:y}=p.getRefMaps(),{computeMouseOpts:w,computeIsContentMenu:t,computeMenuOpts:L}=p.getComputeMaps(),N;var e;let O=(l,n,v)=>{let g=E.ctxMenuStore;var o=t.value,e=L.value,n=e[n];let i=e.visibleMethod;if(n){let{options:t,disabled:e}=n;e?l.preventDefault():o&&t&&t.length&&(v.options=t,p.preventEvent(l,"event.showMenu",v,()=>{if(!i||i(v)){l.preventDefault(),p.updateZindex();let{scrollTop:o,scrollLeft:i,visibleHeight:u,visibleWidth:s}=(0,_dom.getDomNode)(),r=l.clientY+o,a=l.clientX+i,n=()=>{_._currMenuParams=v,Object.assign(g,{visible:!0,list:t,selected:null,selectChild:null,showChild:!1,style:{zIndex:_.tZindex,top:r+"px",left:a+"px"}}),(0,_vue.nextTick)(()=>{var e=y.value.getRefMaps().refElem.value,t=e.clientHeight,l=e.clientWidth,{boundingTop:e,boundingLeft:n}=(0,_dom.getAbsolutePos)(e),e=e+t-u,n=n+l-s;-10<e&&(g.style.top=Math.max(o+2,r-t-2)+"px"),-10<n&&(g.style.left=Math.max(i+2,a-l-2)+"px")})},{keyboard:e,row:d,column:c}=v;e&&d&&c?p.scrollToRow(d,c).then(()=>{var e,t,l=p.getCellElement(d,c);l&&({boundingTop:e,boundingLeft:t}=(0,_dom.getAbsolutePos)(l),r=e+o+Math.floor(l.offsetHeight/2),a=t+i+Math.floor(l.offsetWidth/2)),n()}):n()}else N.closeMenu()}))}p.closeFilter()};return N={closeMenu(){return Object.assign(E.ctxMenuStore,{visible:!1,selected:null,selectChild:null,showChild:!1}),(0,_vue.nextTick)()}},e={moveCtxMenu(e,t,l,n,o,i){let u;var s=_xeUtils.default.findIndexOf(i,e=>t[l]===e);if(n)o&&(0,_utils.hasChildrenList)(t.selected)?t.showChild=!0:(t.showChild=!1,t.selectChild=null);else if(globalEvents.hasKey(e,GLOBAL_EVENT_KEYS.ARROW_UP)){for(let e=s-1;0<=e;e--)if(!1!==i[e].visible){u=i[e];break}t[l]=u||i[i.length-1]}else if(globalEvents.hasKey(e,GLOBAL_EVENT_KEYS.ARROW_DOWN)){for(let e=s+1;e<i.length;e++)if(!1!==i[e].visible){u=i[e];break}t[l]=u||i[0]}else t[l]&&(globalEvents.hasKey(e,GLOBAL_EVENT_KEYS.ENTER)||globalEvents.hasKey(e,GLOBAL_EVENT_KEYS.SPACEBAR))&&p.ctxMenuLinkEvent(e,t[l])},handleOpenMenuEvent:O,handleGlobalContextmenuEvent(t){var l=p.xeGrid,n=p.xeGantt,{mouseConfig:e,menuConfig:o}=x,{editStore:i,ctxMenuStore:u}=E,s=_.visibleColumn,r=T.value,a=y.value,d=w.value,c=L.value,v=C.value,i=i.selected,g=["header","body","footer"];if((0,_utils.isEnableConf)(o)){if(u.visible&&a&&(0,_dom.getEventTargetNode)(t,a.getRefMaps().refElem.value).flag)return void t.preventDefault();if(_._keyCtx){o="body",u={type:o,$table:p,$grid:l,$gantt:n,keyboard:!0,columns:s.slice(0),$event:t};if(e&&d.area){a=p.getActiveCellArea();if(a&&a.row&&a.column)return u.row=a.row,u.column=a.column,void O(t,o,u)}else if(e&&d.selected&&i.row&&i.column)return u.row=i.row,u.column=i.column,void O(t,o,u)}for(let e=0;e<g.length;e++){var f=g[e],h=(0,_dom.getEventTargetNode)(t,v,`vxe-${f}--column`,e=>e.parentNode.parentNode.parentNode.getAttribute("xid")===M),b={type:f,$table:p,$grid:l,$gantt:n,columns:s.slice(0),$event:t};if(h.flag){var h=h.targetElem,m=p.getColumnNode(h),m=m?m.item:null;let e=f+"-";m&&Object.assign(b,{column:m,columnIndex:p.getColumnIndex(m),cell:h}),"body"===f&&(h=(m=p.getRowNode(h.parentNode))?m.item:null,e="",h)&&(b.row=h,b.rowIndex=p.getRowIndex(h));m=e+"cell-menu";return O(t,f,b),void p.dispatchEvent(m,b,t)}if((0,_dom.getEventTargetNode)(t,v,`vxe-table--${f}-wrapper`,e=>e.getAttribute("xid")===M).flag)return void("cell"===c.trigger?t.preventDefault():O(t,f,b))}}r&&!(0,_dom.getEventTargetNode)(t,r.getRefMaps().refElem.value).flag&&p.closeFilter(),N.closeMenu()},ctxMenuMouseoverEvent(e,t,l){let a=e.currentTarget;var n=E.ctxMenuStore;e.preventDefault(),e.stopPropagation(),n.selected=t,(n.selectChild=l)||(n.showChild=(0,_utils.hasChildrenList)(t),n.showChild&&(0,_vue.nextTick)(()=>{var o=a.nextElementSibling;if(o){var{boundingTop:i,boundingLeft:u,visibleHeight:s,visibleWidth:r}=(0,_dom.getAbsolutePos)(a),i=i+a.offsetHeight;let e="",t="",l=(u+a.offsetWidth+o.offsetWidth>r-10&&(e="auto",t=a.offsetWidth+"px"),""),n="";i+o.offsetHeight>s-10&&(l="auto",n="0"),o.style.left=e,o.style.right=t,o.style.top=l,o.style.bottom=n}}))},ctxMenuMouseoutEvent(e,t){var l=E.ctxMenuStore;t.children||(l.selected=null),l.selectChild=null},ctxMenuLinkEvent(e,t){var l,n=p.xeGrid,o=p.xeGantt;t.disabled||!t.code&&t.children&&t.children.length||(l=menus.get(t.code),t=Object.assign({},_._currMenuParams,{menu:t,$table:p,$grid:n,$gantt:o,$event:e}),(n=l?l.tableMenuMethod||l.menuMethod:null)&&n(t,e),p.dispatchEvent("menu-click",t,e),N.closeMenu())}},Object.assign(Object.assign({},N),e)},setupGrid(e){return e.extendTableMethods(tableMenuMethodKeys)},setupGantt(e){return e.extendTableMethods(tableMenuMethodKeys)}});
@@ -1,135 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _vue = require("vue");
8
- var _comp = require("../../../ui/src/comp");
9
- var _ui = require("../../../ui");
10
- var _utils = require("../../../ui/src/utils");
11
- var _xeUtils = _interopRequireDefault(require("xe-utils"));
12
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
- const {
14
- getIcon
15
- } = _ui.VxeUI;
16
- var _default = exports.default = (0, _comp.defineVxeComponent)({
17
- name: 'VxeTableMenuPanel',
18
- setup(props, context) {
19
- const xID = _xeUtils.default.uniqueId();
20
- const $xeTable = (0, _vue.inject)('$xeTable', {});
21
- const {
22
- reactData: tableReactData
23
- } = $xeTable;
24
- const refElem = (0, _vue.ref)();
25
- const refMaps = {
26
- refElem
27
- };
28
- const $xeMenuPanel = {
29
- xID,
30
- props,
31
- context,
32
- getRefMaps: () => refMaps
33
- };
34
- const renderVN = () => {
35
- const {
36
- ctxMenuStore
37
- } = tableReactData;
38
- const {
39
- computeMenuOpts
40
- } = $xeTable.getComputeMaps();
41
- const menuOpts = computeMenuOpts.value;
42
- return (0, _vue.h)(_vue.Teleport, {
43
- to: 'body',
44
- disabled: false
45
- }, [(0, _vue.h)('div', {
46
- ref: refElem,
47
- class: ['vxe-table--context-menu-wrapper', menuOpts.className, {
48
- 'is--visible': ctxMenuStore.visible
49
- }],
50
- style: ctxMenuStore.style
51
- }, ctxMenuStore.list.map((options, gIndex) => {
52
- return options.every(item => item.visible === false) ? (0, _vue.createCommentVNode)() : (0, _vue.h)('ul', {
53
- class: 'vxe-context-menu--option-wrapper',
54
- key: gIndex
55
- }, options.map((item, index) => {
56
- const hasChildMenus = item.children && item.children.some(child => child.visible !== false);
57
- const prefixOpts = Object.assign({}, item.prefixConfig);
58
- const suffixOpts = Object.assign({}, item.suffixConfig);
59
- const menuContent = (0, _utils.getFuncText)(item.name);
60
- return item.visible === false ? null : (0, _vue.h)('li', {
61
- class: [item.className, {
62
- 'link--disabled': item.disabled,
63
- 'link--active': item === ctxMenuStore.selected
64
- }],
65
- key: `${gIndex}_${index}`
66
- }, [(0, _vue.h)('a', {
67
- class: 'vxe-context-menu--link',
68
- onClick(evnt) {
69
- $xeTable.ctxMenuLinkEvent(evnt, item);
70
- },
71
- onMouseover(evnt) {
72
- $xeTable.ctxMenuMouseoverEvent(evnt, item);
73
- },
74
- onMouseout(evnt) {
75
- $xeTable.ctxMenuMouseoutEvent(evnt, item);
76
- }
77
- }, [(0, _vue.h)('div', {
78
- class: ['vxe-context-menu--link-prefix', prefixOpts.className || '']
79
- }, [(0, _vue.h)('i', {
80
- class: prefixOpts.icon || item.prefixIcon
81
- }), prefixOpts.content ? (0, _vue.h)('span', {}, `${prefixOpts.content}`) : (0, _vue.createCommentVNode)()]), (0, _vue.h)('div', {
82
- class: 'vxe-context-menu--link-content',
83
- title: menuContent
84
- }, menuContent), (0, _vue.h)('div', {
85
- class: ['vxe-context-menu--link-suffix', suffixOpts.className || '']
86
- }, [(0, _vue.h)('i', {
87
- class: suffixOpts.icon || item.suffixIcon || (hasChildMenus ? getIcon().TABLE_MENU_OPTIONS : '')
88
- }), suffixOpts.content ? (0, _vue.h)('span', `${suffixOpts.content}`) : (0, _vue.createCommentVNode)()])]), hasChildMenus ? (0, _vue.h)('ul', {
89
- class: ['vxe-table--context-menu-clild-wrapper', {
90
- 'is--show': item === ctxMenuStore.selected && ctxMenuStore.showChild
91
- }]
92
- }, item.children.map((child, cIndex) => {
93
- const childPrefixOpts = Object.assign({}, child.prefixConfig);
94
- const childSuffixOpts = Object.assign({}, child.suffixConfig);
95
- const childMenuContent = (0, _utils.getFuncText)(child.name);
96
- return child.visible === false ? null : (0, _vue.h)('li', {
97
- class: [child.className, {
98
- 'link--disabled': child.disabled,
99
- 'link--active': child === ctxMenuStore.selectChild
100
- }],
101
- key: `${gIndex}_${index}_${cIndex}`
102
- }, [(0, _vue.h)('a', {
103
- class: 'vxe-context-menu--link',
104
- onClick(evnt) {
105
- $xeTable.ctxMenuLinkEvent(evnt, child);
106
- },
107
- onMouseover(evnt) {
108
- $xeTable.ctxMenuMouseoverEvent(evnt, item, child);
109
- },
110
- onMouseout(evnt) {
111
- $xeTable.ctxMenuMouseoutEvent(evnt, item);
112
- }
113
- }, [(0, _vue.h)('div', {
114
- class: ['vxe-context-menu--link-prefix', childPrefixOpts.className || '']
115
- }, [(0, _vue.h)('i', {
116
- class: childPrefixOpts.icon || child.prefixIcon
117
- }), childPrefixOpts.content ? (0, _vue.h)('span', `${childPrefixOpts.content}`) : (0, _vue.createCommentVNode)()]), (0, _vue.h)('div', {
118
- class: 'vxe-context-menu--link-content',
119
- title: childMenuContent
120
- }, childMenuContent), (0, _vue.h)('div', {
121
- class: ['vxe-context-menu--link-suffix', childSuffixOpts.className || '']
122
- }, [(0, _vue.h)('i', {
123
- class: childSuffixOpts.icon
124
- }), childSuffixOpts.content ? (0, _vue.h)('span', `${childSuffixOpts.content}`) : (0, _vue.createCommentVNode)()])])]);
125
- })) : null]);
126
- }));
127
- }))]);
128
- };
129
- $xeMenuPanel.renderVN = renderVN;
130
- return $xeMenuPanel;
131
- },
132
- render() {
133
- return this.renderVN();
134
- }
135
- });
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_comp=require("../../../ui/src/comp"),_ui=require("../../../ui"),_utils=require("../../../ui/src/utils"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let getIcon=_ui.VxeUI.getIcon;var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeTableMenuPanel",setup(e,t){var n=_xeUtils.default.uniqueId();let a=(0,_vue.inject)("$xeTable",{}),u=a.reactData,s=(0,_vue.ref)(),i={refElem:s};n={xID:n,props:e,context:t,getRefMaps:()=>i};return n.renderVN=()=>{let o=u.ctxMenuStore;var e=a.getComputeMaps().computeMenuOpts,e=e.value;return(0,_vue.h)(_vue.Teleport,{to:"body",disabled:!1},[(0,_vue.h)("div",{ref:s,class:["vxe-table--context-menu-wrapper",e.className,{"is--visible":o.visible}],style:o.style},o.list.map((e,c)=>e.every(e=>!1===e.visible)?(0,_vue.createCommentVNode)():(0,_vue.h)("ul",{class:"vxe-context-menu--option-wrapper",key:c},e.map((i,l)=>{var e=i.children&&i.children.some(e=>!1!==e.visible),t=Object.assign({},i.prefixConfig),n=Object.assign({},i.suffixConfig),u=(0,_utils.getFuncText)(i.name);return!1===i.visible?null:(0,_vue.h)("li",{class:[i.className,{"link--disabled":i.disabled,"link--active":i===o.selected}],key:c+"_"+l},[(0,_vue.h)("a",{class:"vxe-context-menu--link",onClick(e){a.ctxMenuLinkEvent(e,i)},onMouseover(e){a.ctxMenuMouseoverEvent(e,i)},onMouseout(e){a.ctxMenuMouseoutEvent(e,i)}},[(0,_vue.h)("div",{class:["vxe-context-menu--link-prefix",t.className||""]},[(0,_vue.h)("i",{class:t.icon||i.prefixIcon}),t.content?(0,_vue.h)("span",{},""+t.content):(0,_vue.createCommentVNode)()]),(0,_vue.h)("div",{class:"vxe-context-menu--link-content",title:u},u),(0,_vue.h)("div",{class:["vxe-context-menu--link-suffix",n.className||""]},[(0,_vue.h)("i",{class:n.icon||i.suffixIcon||(e?getIcon().TABLE_MENU_OPTIONS:"")}),n.content?(0,_vue.h)("span",""+n.content):(0,_vue.createCommentVNode)()])]),e?(0,_vue.h)("ul",{class:["vxe-table--context-menu-clild-wrapper",{"is--show":i===o.selected&&o.showChild}]},i.children.map((t,e)=>{var n=Object.assign({},t.prefixConfig),u=Object.assign({},t.suffixConfig),s=(0,_utils.getFuncText)(t.name);return!1===t.visible?null:(0,_vue.h)("li",{class:[t.className,{"link--disabled":t.disabled,"link--active":t===o.selectChild}],key:c+`_${l}_`+e},[(0,_vue.h)("a",{class:"vxe-context-menu--link",onClick(e){a.ctxMenuLinkEvent(e,t)},onMouseover(e){a.ctxMenuMouseoverEvent(e,i,t)},onMouseout(e){a.ctxMenuMouseoutEvent(e,i)}},[(0,_vue.h)("div",{class:["vxe-context-menu--link-prefix",n.className||""]},[(0,_vue.h)("i",{class:n.icon||t.prefixIcon}),n.content?(0,_vue.h)("span",""+n.content):(0,_vue.createCommentVNode)()]),(0,_vue.h)("div",{class:"vxe-context-menu--link-content",title:s},s),(0,_vue.h)("div",{class:["vxe-context-menu--link-suffix",u.className||""]},[(0,_vue.h)("i",{class:u.icon}),u.content?(0,_vue.h)("span",""+u.content):(0,_vue.createCommentVNode)()])])])})):null])}))))])},n},render(){return this.renderVN()}});