@vxe-ui/plugin-menu 3.0.2 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2019 Xu Liangzhan
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Xu Liangzhan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,127 +1,128 @@
1
- # @vxe-ui/plugin-menu
2
-
3
- [Vxe UI](https://vxeui.com/) plug-in supports context menu.
4
-
5
- ## Compatibility
6
-
7
- It corresponds to [vxe-table v3](https://www.npmjs.com/package/vxe-table) or [vxe-pc-ui v3](https://www.npmjs.com/package/vxe-pc-ui)
8
-
9
- ## Installing
10
-
11
- ```shell
12
- npm install @vxe-ui/plugin-menu
13
- ```
14
-
15
- ```javascript
16
- // ...
17
- // Use vxe-pc-ui
18
- import { VxeUI } from 'vxe-pc-ui'
19
- // Use vxe-table
20
- // import { VxeUI } from 'vxe-table'
21
- import VxeUIPluginMenu from '@vxe-ui/plugin-menu'
22
- // ...
23
-
24
- VxeUI.use(VxeUIPluginMenu)
25
- ```
26
-
27
- ## API
28
-
29
- ### Context menu codes
30
-
31
- | code 编码 | describe 描述 | params 参数 |
32
- |------|------|------|
33
- | CLEAR_CELL | 清除单元格数据的值;如果启用 mouse-config.area 功能,则清除区域范围内的单元格数据 | — |
34
- | CLEAR_ROW | 清除行数据的值 | — |
35
- | CLEAR_CHECKBOX_ROW | 清除复选框选中行数据的值 | — |
36
- | CLEAR_AREA_ROW | 如果启用 mouse-config.area 功能,清除区域选择范围内数据的值,否则清除行数据的值 | — |
37
- | CLEAR_ALL | 清除所有数据的值 | — |
38
- | REVERT_CELL | 还原单元格数据的值;如果启用 mouse-config.area 功能,则还原区域范围内的单元格数据 | — |
39
- | REVERT_ROW | 还原行数据的值 | — |
40
- | REVERT_CHECKBOX_ROW | 还原复选框选中行数据的值 | — |
41
- | REVERT_ALL | 还原所有数据的值 | — |
42
- | MERGE_OR_CLEAR | 如果启用 mouse-config.area 功能,如果所选区域内已存在合并单元格,则取消临时合并,否则临时合并 | — |
43
- | MERGE_CELL | 如果启用 mouse-config.area 功能,临时合并区域范围内的单元格,不管是否存在已合并 | — |
44
- | CLEAR_MERGE_CELL | 如果启用 mouse-config.area 功能,清除区域范围内单元格的临时合并状态 | — |
45
- | CLEAR_ALL_MERGE | 清除所有单元格及表尾的临时合并状态 | — |
46
- | COPY_CELL | 复制单元格数据的值;如果启用 mouse-config.area 功能,则复制区域范围内的单元格数据,支持 Excel 和 WPS | — |
47
- | CUT_CELL | 剪贴单元格数据的值;如果启用 mouse-config.area 功能,则剪贴区域范围内的单元格数据,支持 Excel 和 WPS | — |
48
- | PASTE_CELL | (仅支持在单表区域内操作)粘贴从表格中被复制的数据;如果启用 mouse-config.area 功能,则粘贴区域范围内的单元格数据,不支持读取剪贴板 | — |
49
- | EDIT_CELL | 编辑选中单元格 | — |
50
- | EDIT_ROW | 编辑选中行并激活选中单元格 | — |
51
- | INSERT_ROW | 插入数据 | records |
52
- | INSERT_EDIT_ROW | 插入数据并激活编辑状态 | Array\<records, field\> |
53
- | INSERT_AT_ROW | 插入数据到指定位置 | records |
54
- | INSERT_AT_EDIT_ROW | 插入数据到指定位置并激活编辑状态 | Array\<records, field\> |
55
- | DELETE_ROW | 移除行数据 | |
56
- | DELETE_AREA_ROW | 如果启用 mouse-config.area 功能,移除所选区域行数据;否则删除当前行 | — |
57
- | DELETE_CHECKBOX_ROW | 移除复选框选中行数据 | — |
58
- | DELETE_ALL | 移除所有行数据 | — |
59
- | CLEAR_SORT | 清除所选列排序条件 | — |
60
- | CLEAR_ALL_SORT | 清除所有排序条件 | — |
61
- | SORT_ASC | 按所选列的值升序 | — |
62
- | SORT_DESC | 按所选列的值倒序 | — |
63
- | CLEAR_FILTER | 清除选中列的筛选条件 | — |
64
- | CLEAR_ALL_FILTER | 清除所有列筛选条件 | — |
65
- | FILTER_CELL | 根据单元格值筛选 | — |
66
- | EXPORT_ROW | 导出行数据 | options |
67
- | EXPORT_CHECKBOX_ROW | 导出复选框选中行数据 | options |
68
- | EXPORT_ALL | 导出所有行数据 | options |
69
- | PRINT_ALL | 打印所有行数据 | options |
70
- | PRINT_CHECKBOX_ROW | 打印复选框选中行 | options |
71
- | OPEN_FIND | 如果启用 mouse-config.area 功能,打开单元格查找功能 | |
72
- | OPEN_REPLACE | 如果启用 mouse-config.area 功能,打开单元格替换功能 | — |
73
- | FIXED_LEFT_COLUMN | 将列固定到左侧 | — |
74
- | FIXED_RIGHT_COLUMN | 将列固定到右侧 | — |
75
- | CLEAR_FIXED_COLUMN | 清除固定列 | — |
76
- | HIDDEN_COLUMN | 隐藏当前列 | — |
77
- | RESET_COLUMN | 重置列的可视状态 | — |
78
- | RESET_RESIZABLE | 重置列宽状态 | — |
79
- | RESET_ALL | 重置列的所有状态 | — |
80
-
81
- ## Demo
82
-
83
- ```html
84
- <vxe-table
85
- :data="tableData"
86
- :menu-config="menuConfig"
87
- :edit-config="{trigger: 'click', mode: 'cell'}">
88
- <vxe-column type="seq" width="60"></vxe-column>
89
- <vxe-column field="name" title="Name" :edit-render="{name: 'input'}"></vxe-column>
90
- <vxe-column field="sex" title="sex" :edit-render="{name: 'input'}"></vxe-column>
91
- <vxe-column field="age" title="Age" :edit-render="{name: 'input'}"></vxe-column>
92
- </vxe-table>
93
- ```
94
-
95
- ```javascript
96
- export default {
97
- data () {
98
- return {
99
- tableData: [
100
- { id: 100, name: 'test1', age: 28, sex: '1' },
101
- { id: 101, name: 'test2', age: 32, sex: '0' },
102
- { id: 102, name: 'test3', age: 36, sex: '1' }
103
- ],
104
- menuConfig: {
105
- body: {
106
- options: [
107
- [
108
- { code: 'EXPORT_ALL', name: '导出.csv' },
109
- { code: 'INSERT_EDIT_ROW', name: '新增' }
110
- ]
111
- ]
112
- }
113
- }
114
- }
115
- }
116
- }
117
- ```
118
-
119
- ## Contributors
120
-
121
- Thank you to everyone who contributed to this project.
122
-
123
- [![vxe-ui-plugins](https://contrib.rocks/image?repo=x-extends/vxe-ui-plugins)](https://github.com/x-extends/vxe-ui-plugins/graphs/contributors)
124
-
125
- ## License
126
-
127
- [MIT](LICENSE) © 2019-present, Xu Liangzhan
1
+ # @vxe-ui/plugin-menu
2
+
3
+ [Vxe UI](https://vxeui.com/) plug-in supports context menu.
4
+
5
+ ## Compatibility
6
+
7
+ It corresponds to [vxe-table v3](https://www.npmjs.com/package/vxe-table) or [vxe-pc-ui v3](https://www.npmjs.com/package/vxe-pc-ui)
8
+
9
+ ## Installing
10
+
11
+ ```shell
12
+ npm install @vxe-ui/plugin-menu
13
+ ```
14
+
15
+ ```javascript
16
+ // ...
17
+ // Use vxe-pc-ui
18
+ import { VxeUI } from 'vxe-pc-ui'
19
+ // Use vxe-table
20
+ // import { VxeUI } from 'vxe-table'
21
+ import VxeUIPluginMenu from '@vxe-ui/plugin-menu'
22
+ // ...
23
+
24
+ VxeUI.use(VxeUIPluginMenu)
25
+ ```
26
+
27
+ ## API
28
+
29
+ ### Context menu codes
30
+
31
+ | code 编码 | describe 描述 | params 参数 |
32
+ |------|------|------|
33
+ | CLEAR_CELL | 清除单元格数据的值;如果启用 mouse-config.area 功能,则清除区域范围内的单元格数据 | — |
34
+ | CLEAR_ROW | 清除行数据的值 | — |
35
+ | CLEAR_CHECKBOX_ROW | 清除复选框选中行数据的值 | — |
36
+ | CLEAR_AREA_ROW | 如果启用 mouse-config.area 功能,清除区域选择范围内数据的值,否则清除行数据的值 | — |
37
+ | CLEAR_ALL | 清除所有数据的值 | — |
38
+ | REVERT_CELL | 还原单元格数据的值;如果启用 mouse-config.area 功能,则还原区域范围内的单元格数据 | — |
39
+ | REVERT_ROW | 还原行数据的值 | — |
40
+ | REVERT_CHECKBOX_ROW | 还原复选框选中行数据的值 | — |
41
+ | REVERT_ALL | 还原所有数据的值 | — |
42
+ | MERGE_OR_CLEAR | 如果启用 mouse-config.area 功能,如果所选区域内已存在合并单元格,则取消临时合并,否则临时合并 | — |
43
+ | MERGE_CELL | 如果启用 mouse-config.area 功能,临时合并区域范围内的单元格,不管是否存在已合并 | — |
44
+ | CLEAR_MERGE_CELL | 如果启用 mouse-config.area 功能,清除区域范围内单元格的临时合并状态 | — |
45
+ | CLEAR_ALL_MERGE | 清除所有单元格及表尾的临时合并状态 | — |
46
+ | COPY_TITLE | 复制列头标题 | — |
47
+ | COPY_CELL | 复制单元格数据的值;如果启用 mouse-config.area 功能,则复制区域范围内的单元格数据,支持 Excel 和 WPS | — |
48
+ | CUT_CELL | 剪贴单元格数据的值;如果启用 mouse-config.area 功能,则剪贴区域范围内的单元格数据,支持 Excel 和 WPS | — |
49
+ | PASTE_CELL | (仅支持在单表区域内操作)粘贴从表格中被复制的数据;如果启用 mouse-config.area 功能,则粘贴区域范围内的单元格数据,不支持读取剪贴板 | — |
50
+ | EDIT_CELL | 编辑选中单元格 | — |
51
+ | EDIT_ROW | 编辑选中行并激活选中单元格 | |
52
+ | INSERT_ROW | 插入数据 | records |
53
+ | INSERT_EDIT_ROW | 插入数据并激活编辑状态 | Array\<records, field\> |
54
+ | INSERT_AT_ROW | 插入数据到指定位置 | records |
55
+ | INSERT_AT_EDIT_ROW | 插入数据到指定位置并激活编辑状态 | Array\<records, field\> |
56
+ | DELETE_ROW | 移除行数据 | — |
57
+ | DELETE_AREA_ROW | 如果启用 mouse-config.area 功能,移除所选区域行数据;否则删除当前行 | — |
58
+ | DELETE_CHECKBOX_ROW | 移除复选框选中行数据 | — |
59
+ | DELETE_ALL | 移除所有行数据 | — |
60
+ | CLEAR_SORT | 清除所选列排序条件 | — |
61
+ | CLEAR_ALL_SORT | 清除所有排序条件 | — |
62
+ | SORT_ASC | 按所选列的值升序 | — |
63
+ | SORT_DESC | 按所选列的值倒序 | — |
64
+ | CLEAR_FILTER | 清除选中列的筛选条件 | — |
65
+ | CLEAR_ALL_FILTER | 清除所有列筛选条件 | — |
66
+ | FILTER_CELL | 根据单元格值筛选 | |
67
+ | EXPORT_ROW | 导出行数据 | options |
68
+ | EXPORT_CHECKBOX_ROW | 导出复选框选中行数据 | options |
69
+ | EXPORT_ALL | 导出所有行数据 | options |
70
+ | PRINT_ALL | 打印所有行数据 | options |
71
+ | PRINT_CHECKBOX_ROW | 打印复选框选中行 | options |
72
+ | OPEN_FIND | 如果启用 mouse-config.area 功能,打开单元格查找功能 | — |
73
+ | OPEN_REPLACE | 如果启用 mouse-config.area 功能,打开单元格替换功能 | — |
74
+ | FIXED_LEFT_COLUMN | 将列固定到左侧 | — |
75
+ | FIXED_RIGHT_COLUMN | 将列固定到右侧 | — |
76
+ | CLEAR_FIXED_COLUMN | 清除固定列 | — |
77
+ | HIDDEN_COLUMN | 隐藏当前列 | — |
78
+ | RESET_COLUMN | 重置列的可视状态 | — |
79
+ | RESET_RESIZABLE | 重置列宽状态 | — |
80
+ | RESET_ALL | 重置列的所有状态 | — |
81
+
82
+ ## Demo
83
+
84
+ ```html
85
+ <vxe-table
86
+ :data="tableData"
87
+ :menu-config="menuConfig"
88
+ :edit-config="{trigger: 'click', mode: 'cell'}">
89
+ <vxe-column type="seq" width="60"></vxe-column>
90
+ <vxe-column field="name" title="Name" :edit-render="{name: 'input'}"></vxe-column>
91
+ <vxe-column field="sex" title="sex" :edit-render="{name: 'input'}"></vxe-column>
92
+ <vxe-column field="age" title="Age" :edit-render="{name: 'input'}"></vxe-column>
93
+ </vxe-table>
94
+ ```
95
+
96
+ ```javascript
97
+ export default {
98
+ data () {
99
+ return {
100
+ tableData: [
101
+ { id: 100, name: 'test1', age: 28, sex: '1' },
102
+ { id: 101, name: 'test2', age: 32, sex: '0' },
103
+ { id: 102, name: 'test3', age: 36, sex: '1' }
104
+ ],
105
+ menuConfig: {
106
+ body: {
107
+ options: [
108
+ [
109
+ { code: 'EXPORT_ALL', name: '导出.csv' },
110
+ { code: 'INSERT_EDIT_ROW', name: '新增' }
111
+ ]
112
+ ]
113
+ }
114
+ }
115
+ }
116
+ }
117
+ }
118
+ ```
119
+
120
+ ## Contributors
121
+
122
+ Thank you to everyone who contributed to this project.
123
+
124
+ [![vxe-ui-plugins](https://contrib.rocks/image?repo=x-extends/vxe-ui-plugins)](https://github.com/x-extends/vxe-ui-plugins/graphs/contributors)
125
+
126
+ ## License
127
+
128
+ [MIT](LICENSE) © 2019-present, Xu Liangzhan
@@ -176,7 +176,8 @@ function checkPrivilege(item, params) {
176
176
  var code = item.code;
177
177
  var $table = params.$table,
178
178
  row = params.row,
179
- column = params.column;
179
+ column = params.column,
180
+ type = params.type;
180
181
  var tableProps = $table;
181
182
  var editConfig = tableProps.editConfig,
182
183
  mouseConfig = tableProps.mouseConfig;
@@ -206,6 +207,11 @@ function checkPrivilege(item, params) {
206
207
  item.disabled = !beenMerges.length;
207
208
  break;
208
209
  }
210
+ case 'COPY_TITLE':
211
+ {
212
+ item.disabled = !column || type !== 'header';
213
+ break;
214
+ }
209
215
  case 'EDIT_CELL':
210
216
  case 'CLEAR_CELL':
211
217
  case 'CLEAR_ROW':
@@ -346,7 +352,7 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
346
352
  VxeUI = core;
347
353
  // 检查版本
348
354
  if (!/^(3)\./.test(VxeUI.uiVersion)) {
349
- console.error('[plugin-menu 3.x] Version 3.x is required');
355
+ console.error('[@vxe-ui/plugin-menu 3.0.4] Requires vxe-table 3.9.0+ version. https://vxeui.com/other3/#/plugin-export-xlsx/install');
350
356
  }
351
357
  pluginSetup(options);
352
358
  VxeUI.menus.mixin({
@@ -501,6 +507,23 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
501
507
  $table.revertData();
502
508
  }
503
509
  },
510
+ /**
511
+ * 复制列头标题
512
+ */
513
+ COPY_TITLE: {
514
+ menuMethod: function menuMethod(params) {
515
+ var column = params.column;
516
+ var text = column.getTitle();
517
+ if (text) {
518
+ // 开始复制操作
519
+ if (_xeUtils["default"].isFunction(handleCopy)) {
520
+ handleCopy(text);
521
+ } else {
522
+ copyText(text);
523
+ }
524
+ }
525
+ }
526
+ },
504
527
  /**
505
528
  * 复制单元格数据的值;如果启用 mouse-config.area 功能,则复制区域范围内的单元格数据,支持 Excel 和 WPS
506
529
  */
package/dist/index.umd.js CHANGED
@@ -189,7 +189,8 @@
189
189
  var code = item.code;
190
190
  var $table = params.$table,
191
191
  row = params.row,
192
- column = params.column;
192
+ column = params.column,
193
+ type = params.type;
193
194
  var tableProps = $table;
194
195
  var editConfig = tableProps.editConfig,
195
196
  mouseConfig = tableProps.mouseConfig;
@@ -219,6 +220,11 @@
219
220
  item.disabled = !beenMerges.length;
220
221
  break;
221
222
  }
223
+ case 'COPY_TITLE':
224
+ {
225
+ item.disabled = !column || type !== 'header';
226
+ break;
227
+ }
222
228
  case 'EDIT_CELL':
223
229
  case 'CLEAR_CELL':
224
230
  case 'CLEAR_ROW':
@@ -359,7 +365,7 @@
359
365
  VxeUI = core;
360
366
  // 检查版本
361
367
  if (!/^(3)\./.test(VxeUI.uiVersion)) {
362
- console.error('[plugin-menu 3.x] Version 3.x is required');
368
+ console.error('[@vxe-ui/plugin-menu 3.0.4] Requires vxe-table 3.9.0+ version. https://vxeui.com/other3/#/plugin-export-xlsx/install');
363
369
  }
364
370
  pluginSetup(options);
365
371
  VxeUI.menus.mixin({
@@ -514,6 +520,23 @@
514
520
  $table.revertData();
515
521
  }
516
522
  },
523
+ /**
524
+ * 复制列头标题
525
+ */
526
+ COPY_TITLE: {
527
+ menuMethod: function menuMethod(params) {
528
+ var column = params.column;
529
+ var text = column.getTitle();
530
+ if (text) {
531
+ // 开始复制操作
532
+ if (_xeUtils["default"].isFunction(handleCopy)) {
533
+ handleCopy(text);
534
+ } else {
535
+ copyText(text);
536
+ }
537
+ }
538
+ }
539
+ },
517
540
  /**
518
541
  * 复制单元格数据的值;如果启用 mouse-config.area 功能,则复制区域范围内的单元格数据,支持 Excel 和 WPS
519
542
  */
@@ -1 +1 @@
1
- ((e,t)=>{"function"==typeof define&&define.amd?define("@vxe-ui/plugin-menu",["exports","xe-utils"],t):"undefined"!=typeof exports?t(exports,require("xe-utils")):(t(t={},e.XEUtils),e.VxeUIPluginMenu=t)})("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:this,function(e,s){var u,c;Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.VxeUIPluginMenu=void 0,s=(t=s)&&t.__esModule?t:{default:t};var a,L=function(e,t){return s.default.findIndexOf(e,function(e){return e.id===t.id})},g=function(e,t,n){return e.findRowIndexOf(t,n)};function n(n){return{menuMethod:function(e){var t=e.$table;s.default.eachTree([e.column],function(e){e.fixed=n}),t.refreshColumn()}}}function f(){var e=u.globalStore;return e?e.clipboard||"":(e=u.config)&&e.clipboard?e.clipboard:null}function E(e){var t,n;try{t=e,a||((a=document.createElement("textarea")).id="$XECopy",(n=a.style).width="48px",n.height="24px",n.position="fixed",n.zIndex="0",n.left="-500px",n.top="-500px",document.body.appendChild(a)),a.value=null==t?"":""+t,a.select(),a.setSelectionRange(0,a.value.length),document.execCommand("copy"),a.blur()}catch(e){}}function o(e,t){var n,a,o,r=e.$event,l=e.$table,i=e.row,e=e.column;i&&e&&(n=l.mouseConfig,o=l.computeMouseOpts,a="",n&&o.area?(t?l.triggerCutCellAreaEvent(r):l.triggerCopyCellAreaEvent(r),a=(n=f())?n.text:""):(a=s.default.toValueString(s.default.get(i,e.field)),o={text:a,html:""},(t=u.globalStore)?t.clipboard=o:u.config&&(u.config.clipboard=o)),(s.default.isFunction(c)?c:E)(a))}function C(e){var s=e.$table,e=s.mouseConfig,t=s.computeMouseOpts,u=s.getTableData().visibleData,c=s.getTableColumn().visibleColumn,n=e&&t.area?s.getCellAreas():[];return s.getMergeCells().filter(function(e){var o=e.row,r=e.col,l=e.rowspan,i=e.colspan;return n.some(function(e){var t=e.rows,e=e.cols,n=g(s,u,t[0]),t=g(s,u,t[t.length-1]),a=L(c,e[0]),e=L(c,e[e.length-1]);return n<=o&&o+l-1<=t&&a<=r&&r+i-1<=e})})}function l(e){var t=e.$table,e=C(e);return e.length&&t.removeMergeCells(e),e}function r(e,t){var n=e.code,a=t.$table,o=t.row,r=t.column,l=a.editConfig,i=a.mouseConfig;switch(n){case"CLEAR_ALL_SORT":var s=a.getSortColumns();e.disabled=!s.length;break;case"CLEAR_ALL_FILTER":s=a.getCheckedFilters();e.disabled=!s.length;break;case"CLEAR_ALL_MERGE":var s=a.getMergeCells(),u=a.getMergeFooterItems();e.disabled=!s.length&&!u.length;break;case"CLEAR_MERGE_CELL":s=C(t);e.disabled=!s.length;break;case"EDIT_CELL":case"CLEAR_CELL":case"CLEAR_ROW":case"COPY_CELL":case"CUT_CELL":case"PASTE_CELL":case"MERGE_OR_CLEAR":case"MERGE_CELL":case"REVERT_CELL":case"REVERT_ROW":case"INSERT_AT_ROW":case"INSERT_AT_ACTIVED_ROW":case"INSERT_AT_EDIT_ROW":case"DELETE_ROW":case"DELETE_AREA_ROW":case"CLEAR_SORT":case"SORT_ASC":case"SORT_DESC":case"CLEAR_FILTER":case"FILTER_CELL":case"EXPORT_ROW":case"OPEN_FIND":case"OPEN_REPLACE":case"HIDDEN_COLUMN":case"FIXED_LEFT_COLUMN":case"FIXED_RIGHT_COLUMN":case"CLEAR_FIXED_COLUMN":if(e.disabled=!r,r){var c=a.computeMouseOpts,E=!!r.parentId;switch(n){case"CLEAR_SORT":e.disabled=!r.sortable||!r.order;break;case"SORT_ASC":case"SORT_DESC":e.disabled=!r.sortable;break;case"FILTER_CELL":case"CLEAR_FILTER":e.disabled=!r.filters||!r.filters.length,e.disabled||"CLEAR_FILTER"===n&&(e.disabled=!r.filters.some(function(e){return e.checked}));break;case"REVERT_CELL":e.disabled=!o||!r.field||!a.isUpdateByRow(o,r.field);break;case"REVERT_ROW":e.disabled=!o||!r.field||!a.isUpdateByRow(o);break;case"OPEN_FIND":case"OPEN_REPLACE":e.disabled=!(i&&c.area);break;case"EDIT_CELL":e.disabled=!l||!r.editRender;break;case"COPY_CELL":case"CUT_CELL":case"PASTE_CELL":var d=i&&c.area?a.getCellAreas():[];e.disabled=1<d.length,e.disabled||"PASTE_CELL"===n&&(d=f(),e.disabled=!d||!d.text);break;case"MERGE_OR_CLEAR":case"MERGE_CELL":d=i&&c.area?a.getCellAreas():[];e.disabled=!d.length||1===d.length&&1===d[0].rows.length&&1===d[0].cols.length||!((e,t)=>{for(var n=e.$table,a=n.getTableData().visibleData,o=n.getTableColumn().visibleColumn,r={},l=0,i=t.length;l<i;l++)for(var s=t[l],u=s.rows,c=s.cols,E=0,d=u.length;E<d;E++)for(var f=u[E],C=g(n,a,f),m=0,R=c.length;m<R;m++){var _=c[m],_=C+":"+L(o,_);if(r[_])return;r[_]=!0}return 1})(t,d);break;case"FIXED_LEFT_COLUMN":e.disabled=E||"left"===r.fixed;break;case"FIXED_RIGHT_COLUMN":e.disabled=E||"right"===r.fixed;break;case"CLEAR_FIXED_COLUMN":e.disabled=E||!r.fixed}}}}function i(t){return t.options.forEach(function(e){e.forEach(function(e){r(e,t),e.children&&e.children.forEach(function(e){r(e,t)})})}),!0}function d(e){e&&e.copy&&(c=e.copy)}var t=e.VxeUIPluginMenu={setConfig:d,install:function(e,t){u=e,/^(3)\./.test(u.uiVersion)||console.error("[plugin-menu 3.x] Version 3.x is required"),d(t),u.menus.mixin({CLEAR_CELL:{menuMethod:function(e){var t,n,a=e.$table,o=e.row,e=e.column;o&&e&&(n=a.mouseConfig,t=a.computeMouseOpts,n&&t.area?(n=a.getCellAreas())&&n.length&&n.forEach(function(e){var n=e.rows;e.cols.forEach(function(t){n.forEach(function(e){a.clearData(e,t.field)})})}):a.clearData(o,e.field))}},CLEAR_ROW:{menuMethod:function(e){var t=e.$table,e=e.row;e&&t.clearData(e)}},CLEAR_CHECKBOX_ROW:{menuMethod:function(e){e=e.$table;e.clearData(e.getCheckboxRecords())}},CLEAR_AREA_ROW:{menuMethod:function(e){var a=e.$table,t=e.row,e=e.column,n=a.mouseConfig,o=a.computeMouseOpts;n&&o.area?(n&&o.area?a.getCellAreas():[]).forEach(function(e){var t=e.rows,n=e.cols;t.forEach(function(t){n.forEach(function(e){a.clearData(t)})})}):t&&e&&a.clearData(t)}},CLEAR_ALL:{menuMethod:function(e){e.$table.clearData()}},REVERT_CELL:{menuMethod:function(e){var t,n,a=e.$table,o=e.row,e=e.column;o&&e&&(n=a.mouseConfig,t=a.computeMouseOpts,n&&t.area?(n=a.getCellAreas())&&n.length&&n.forEach(function(e){var n=e.rows;e.cols.forEach(function(t){n.forEach(function(e){a.revertData(e,t.field)})})}):a.revertData(o,e.field))}},REVERT_ROW:{menuMethod:function(e){var t=e.$table,e=e.row;e&&t.revertData(e)}},REVERT_CHECKBOX_ROW:{menuMethod:function(e){e=e.$table;e.revertData(e.getCheckboxRecords())}},REVERT_ALL:{menuMethod:function(e){e.$table.revertData()}},COPY_CELL:{menuMethod:function(e){o(e)}},CUT_CELL:{menuMethod:function(e){o(e,!0)}},PASTE_CELL:{menuMethod:function(e){var t=e.$event,n=e.$table,a=e.row,e=e.column,o=n.mouseConfig,r=n.computeMouseOpts;o&&r.area?n.triggerPasteCellAreaEvent(t):(o=f())&&o.text&&s.default.set(a,e.field,o.text)}},MERGE_OR_CLEAR:{menuMethod:function(e){var t=e.$event,n=e.$table,a=n.getCellAreas(),e=C(e),o=!1,e=(e.length?n.removeMergeCells(e):(o=!0,n.setMergeCells(a.map(function(e){var t=e.rows,e=e.cols;return{row:t[0],col:e[0],rowspan:t.length,colspan:e.length}}))),a.map(function(e){return{rows:e.rows,cols:e.cols}}));n.dispatchEvent("cell-area-merge",{status:o,targetAreas:e},t)}},MERGE_CELL:{menuMethod:function(e){var t=e.$event,n=e.$table,a=n.getTableData().visibleData,o=n.getTableColumn().visibleColumn,r=n.getCellAreas();l(e),r.some(function(e){return e.rows.length===a.length||e.cols.length===o.length})?u.modal&&u.modal.message({content:u.getI18n("vxe.pro.area.mergeErr"),status:"error",id:"operErr"}):(n.setMergeCells(r.map(function(e){var t=e.rows,e=e.cols;return{row:t[0],col:e[0],rowspan:t.length,colspan:e.length}})),e=r.map(function(e){return{rows:e.rows,cols:e.cols}}),n.dispatchEvent("cell-area-merge",{status:!0,targetAreas:e},t))}},CLEAR_MERGE_CELL:{menuMethod:function(e){var t=e.$event,n=e.$table,e=l(e);e.length&&n.dispatchEvent("clear-cell-area-merge",{mergeCells:e},t)}},CLEAR_ALL_MERGE:{menuMethod:function(e){var t=e.$event,e=e.$table,n=e.getMergeCells(),a=e.getMergeFooterItems();e.clearMergeCells(),e.clearMergeFooterItems(),e.dispatchEvent("clear-merge",{mergeCells:n,mergeFooterItems:a},t)}},EDIT_CELL:{menuMethod:function(e){var t=e.$table,n=e.row,e=e.column;t.setEditCell?t.setEditCell(n,e):t.setActiveCell(n,e.field)}},EDIT_ROW:{menuMethod:function(e){var t=e.$table,e=e.row;t.setEditRow?t.setEditRow(e):t.setActiveRow(e)}},INSERT_ROW:{menuMethod:function(e){e.$table.insert(e.menu.params)}},INSERT_ACTIVED_ROW:{menuMethod:function(e){var t=e.$table,n=e.column,a=e.menu.params||[];t.insert(a[0]).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,a[1]||n):t.setActiveCell(e,a[1]||n.field)})}},INSERT_EDIT_ROW:{menuMethod:function(e){var t=e.$table,n=e.column,a=e.menu.params||[];t.insert(a[0]).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,a[1]||n):t.setActiveCell(e,a[1]||n.field)})}},INSERT_AT_ROW:{menuMethod:function(e){var t=e.$table,n=e.row;n&&t.insertAt(e.menu.params,n)}},INSERT_AT_ACTIVED_ROW:{menuMethod:function(e){var t,n=e.$table,a=e.row,o=e.column;a&&(t=e.menu.params||[],n.insertAt(t[0],a).then(function(e){e=e.row;n.setEditCell?n.setEditCell(e,t[1]||o):n.setActiveCell(e,t[1]||o.field)}))}},INSERT_AT_EDIT_ROW:{menuMethod:function(e){var t,n=e.$table,a=e.row,o=e.column;a&&(t=e.menu.params||[],n.insertAt(t[0],a).then(function(e){e=e.row;n.setEditCell?n.setEditCell(e,t[1]||o):n.setActiveCell(e,t[1]||o.field)}))}},DELETE_ROW:{menuMethod:function(e){var t=e.$table,e=e.row;e&&t.remove(e)}},DELETE_AREA_ROW:{menuMethod:function(e){var t=e.$table,e=e.row,n=t.mouseConfig,a=t.computeMouseOpts;n&&a.area?(n&&a.area?t.getCellAreas():[]).forEach(function(e){e=e.rows;t.remove(e)}):e&&t.remove(e)}},DELETE_CHECKBOX_ROW:{menuMethod:function(e){e.$table.removeCheckboxRow()}},DELETE_ALL:{menuMethod:function(e){e.$table.remove()}},CLEAR_SORT:{menuMethod:function(e){var t=e.$event,n=e.$table,e=e.column;e&&n.triggerSortEvent(t,e,null)}},CLEAR_ALL_SORT:{menuMethod:function(e){var t=e.$event,e=e.$table,n=e.getSortColumns();n.length&&(e.clearSort(),e.dispatchEvent("clear-sort",{sortList:n},t))}},SORT_ASC:{menuMethod:function(e){var t=e.$event,n=e.$table,e=e.column;e&&n.triggerSortEvent(t,e,"asc")}},SORT_DESC:{menuMethod:function(e){var t=e.$event,n=e.$table,e=e.column;e&&n.triggerSortEvent(t,e,"desc")}},CLEAR_FILTER:{menuMethod:function(e){var t=e.$event,n=e.$table,e=e.column;e&&(n.handleClearFilter(e),n.confirmFilterEvent(t))}},CLEAR_ALL_FILTER:{menuMethod:function(e){var t=e.$event,e=e.$table,n=e.getCheckedFilters();n.length&&(e.clearFilter(),e.dispatchEvent("clear-filter",{filterList:n},t))}},FILTER_CELL:{menuMethod:function(e){var t,n=e.$table,a=e.row,e=e.column;a&&e&&(t=e.field,(e=e.filters).length)&&((e=e[0]).data=s.default.get(a,t),e.checked=!0,n.updateData())}},EXPORT_ROW:{menuMethod:function(e){var t=e.$table,n=e.menu,e=e.row;e&&t.exportData(s.default.assign({},n.params?n.params[0]:{},{data:[e]}))}},EXPORT_CHECKBOX_ROW:{menuMethod:function(e){var t=e.$table,e=e.menu,n={data:t.getCheckboxRecords()};t.exportData(s.default.assign({},e.params?e.params[0]:{},n))}},EXPORT_ALL:{menuMethod:function(e){e.$table.exportData(e.menu.params)}},PRINT_ALL:{menuMethod:function(e){e.$table.print(e.menu.params)}},PRINT_CHECKBOX_ROW:{menuMethod:function(e){var t=e.$table,e=e.menu,n={data:t.getCheckboxRecords()};t.print(s.default.assign(n,e.params))}},OPEN_FIND:{menuMethod:function(e){var t=e.$event;e.$table.triggerFNROpenEvent(t,"find")}},OPEN_REPLACE:{menuMethod:function(e){var t=e.$event;e.$table.triggerFNROpenEvent(t,"replace")}},HIDDEN_COLUMN:{menuMethod:function(e){var t=e.$table,e=e.column;e&&t.hideColumn(e)}},FIXED_LEFT_COLUMN:n("left"),FIXED_RIGHT_COLUMN:n("right"),CLEAR_FIXED_COLUMN:n(null),RESET_COLUMN:{menuMethod:function(e){e.$table.resetColumn({visible:!0,resizable:!1})}},RESET_RESIZABLE:{menuMethod:function(e){e.$table.resetColumn({visible:!1,resizable:!0})}},RESET_ALL:{menuMethod:function(e){e.$table.resetColumn(!0)}}}),u.interceptor.add("event.showMenu",i)}};"undefined"!=typeof window&&window.VxeUI&&window.VxeUI.use&&window.VxeUI.use(t),e.default=t});
1
+ ((e,t)=>{"function"==typeof define&&define.amd?define("@vxe-ui/plugin-menu",["exports","xe-utils"],t):"undefined"!=typeof exports?t(exports,require("xe-utils")):(t(t={},e.XEUtils),e.VxeUIPluginMenu=t)})("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:this,function(e,s){var u,c;Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.VxeUIPluginMenu=void 0,s=(t=s)&&t.__esModule?t:{default:t};var a,L=function(e,t){return s.default.findIndexOf(e,function(e){return e.id===t.id})},h=function(e,t,n){return e.findRowIndexOf(t,n)};function n(n){return{menuMethod:function(e){var t=e.$table;s.default.eachTree([e.column],function(e){e.fixed=n}),t.refreshColumn()}}}function C(){var e=u.globalStore;return e?e.clipboard||"":(e=u.config)&&e.clipboard?e.clipboard:null}function E(e){var t,n;try{t=e,a||((a=document.createElement("textarea")).id="$XECopy",(n=a.style).width="48px",n.height="24px",n.position="fixed",n.zIndex="0",n.left="-500px",n.top="-500px",document.body.appendChild(a)),a.value=null==t?"":""+t,a.select(),a.setSelectionRange(0,a.value.length),document.execCommand("copy"),a.blur()}catch(e){}}function o(e,t){var n,a,o,r=e.$event,l=e.$table,i=e.row,e=e.column;i&&e&&(n=l.mouseConfig,o=l.computeMouseOpts,a="",n&&o.area?(t?l.triggerCutCellAreaEvent(r):l.triggerCopyCellAreaEvent(r),a=(n=C())?n.text:""):(a=s.default.toValueString(s.default.get(i,e.field)),o={text:a,html:""},(t=u.globalStore)?t.clipboard=o:u.config&&(u.config.clipboard=o)),(s.default.isFunction(c)?c:E)(a))}function m(e){var s=e.$table,e=s.mouseConfig,t=s.computeMouseOpts,u=s.getTableData().visibleData,c=s.getTableColumn().visibleColumn,n=e&&t.area?s.getCellAreas():[];return s.getMergeCells().filter(function(e){var o=e.row,r=e.col,l=e.rowspan,i=e.colspan;return n.some(function(e){var t=e.rows,e=e.cols,n=h(s,u,t[0]),t=h(s,u,t[t.length-1]),a=L(c,e[0]),e=L(c,e[e.length-1]);return n<=o&&o+l-1<=t&&a<=r&&r+i-1<=e})})}function l(e){var t=e.$table,e=m(e);return e.length&&t.removeMergeCells(e),e}function r(e,t){var n=e.code,a=t.$table,o=t.row,r=t.column,l=t.type,i=a.editConfig,s=a.mouseConfig;switch(n){case"CLEAR_ALL_SORT":var u=a.getSortColumns();e.disabled=!u.length;break;case"CLEAR_ALL_FILTER":u=a.getCheckedFilters();e.disabled=!u.length;break;case"CLEAR_ALL_MERGE":var u=a.getMergeCells(),c=a.getMergeFooterItems();e.disabled=!u.length&&!c.length;break;case"CLEAR_MERGE_CELL":u=m(t);e.disabled=!u.length;break;case"COPY_TITLE":e.disabled=!r||"header"!==l;break;case"EDIT_CELL":case"CLEAR_CELL":case"CLEAR_ROW":case"COPY_CELL":case"CUT_CELL":case"PASTE_CELL":case"MERGE_OR_CLEAR":case"MERGE_CELL":case"REVERT_CELL":case"REVERT_ROW":case"INSERT_AT_ROW":case"INSERT_AT_ACTIVED_ROW":case"INSERT_AT_EDIT_ROW":case"DELETE_ROW":case"DELETE_AREA_ROW":case"CLEAR_SORT":case"SORT_ASC":case"SORT_DESC":case"CLEAR_FILTER":case"FILTER_CELL":case"EXPORT_ROW":case"OPEN_FIND":case"OPEN_REPLACE":case"HIDDEN_COLUMN":case"FIXED_LEFT_COLUMN":case"FIXED_RIGHT_COLUMN":case"CLEAR_FIXED_COLUMN":if(e.disabled=!r,r){var E=a.computeMouseOpts,d=!!r.parentId;switch(n){case"CLEAR_SORT":e.disabled=!r.sortable||!r.order;break;case"SORT_ASC":case"SORT_DESC":e.disabled=!r.sortable;break;case"FILTER_CELL":case"CLEAR_FILTER":e.disabled=!r.filters||!r.filters.length,e.disabled||"CLEAR_FILTER"===n&&(e.disabled=!r.filters.some(function(e){return e.checked}));break;case"REVERT_CELL":e.disabled=!o||!r.field||!a.isUpdateByRow(o,r.field);break;case"REVERT_ROW":e.disabled=!o||!r.field||!a.isUpdateByRow(o);break;case"OPEN_FIND":case"OPEN_REPLACE":e.disabled=!(s&&E.area);break;case"EDIT_CELL":e.disabled=!i||!r.editRender;break;case"COPY_CELL":case"CUT_CELL":case"PASTE_CELL":var f=s&&E.area?a.getCellAreas():[];e.disabled=1<f.length,e.disabled||"PASTE_CELL"===n&&(f=C(),e.disabled=!f||!f.text);break;case"MERGE_OR_CLEAR":case"MERGE_CELL":f=s&&E.area?a.getCellAreas():[];e.disabled=!f.length||1===f.length&&1===f[0].rows.length&&1===f[0].cols.length||!((e,t)=>{for(var n=e.$table,a=n.getTableData().visibleData,o=n.getTableColumn().visibleColumn,r={},l=0,i=t.length;l<i;l++)for(var s=t[l],u=s.rows,c=s.cols,E=0,d=u.length;E<d;E++)for(var f=u[E],C=h(n,a,f),m=0,R=c.length;m<R;m++){var _=c[m],_=C+":"+L(o,_);if(r[_])return;r[_]=!0}return 1})(t,f);break;case"FIXED_LEFT_COLUMN":e.disabled=d||"left"===r.fixed;break;case"FIXED_RIGHT_COLUMN":e.disabled=d||"right"===r.fixed;break;case"CLEAR_FIXED_COLUMN":e.disabled=d||!r.fixed}}}}function i(t){return t.options.forEach(function(e){e.forEach(function(e){r(e,t),e.children&&e.children.forEach(function(e){r(e,t)})})}),!0}function d(e){e&&e.copy&&(c=e.copy)}var t=e.VxeUIPluginMenu={setConfig:d,install:function(e,t){u=e,/^(3)\./.test(u.uiVersion)||console.error("[@vxe-ui/plugin-menu 3.0.4] Requires vxe-table 3.9.0+ version. https://vxeui.com/other3/#/plugin-export-xlsx/install"),d(t),u.menus.mixin({CLEAR_CELL:{menuMethod:function(e){var t,n,a=e.$table,o=e.row,e=e.column;o&&e&&(n=a.mouseConfig,t=a.computeMouseOpts,n&&t.area?(n=a.getCellAreas())&&n.length&&n.forEach(function(e){var n=e.rows;e.cols.forEach(function(t){n.forEach(function(e){a.clearData(e,t.field)})})}):a.clearData(o,e.field))}},CLEAR_ROW:{menuMethod:function(e){var t=e.$table,e=e.row;e&&t.clearData(e)}},CLEAR_CHECKBOX_ROW:{menuMethod:function(e){e=e.$table;e.clearData(e.getCheckboxRecords())}},CLEAR_AREA_ROW:{menuMethod:function(e){var a=e.$table,t=e.row,e=e.column,n=a.mouseConfig,o=a.computeMouseOpts;n&&o.area?(n&&o.area?a.getCellAreas():[]).forEach(function(e){var t=e.rows,n=e.cols;t.forEach(function(t){n.forEach(function(e){a.clearData(t)})})}):t&&e&&a.clearData(t)}},CLEAR_ALL:{menuMethod:function(e){e.$table.clearData()}},REVERT_CELL:{menuMethod:function(e){var t,n,a=e.$table,o=e.row,e=e.column;o&&e&&(n=a.mouseConfig,t=a.computeMouseOpts,n&&t.area?(n=a.getCellAreas())&&n.length&&n.forEach(function(e){var n=e.rows;e.cols.forEach(function(t){n.forEach(function(e){a.revertData(e,t.field)})})}):a.revertData(o,e.field))}},REVERT_ROW:{menuMethod:function(e){var t=e.$table,e=e.row;e&&t.revertData(e)}},REVERT_CHECKBOX_ROW:{menuMethod:function(e){e=e.$table;e.revertData(e.getCheckboxRecords())}},REVERT_ALL:{menuMethod:function(e){e.$table.revertData()}},COPY_TITLE:{menuMethod:function(e){e=e.column.getTitle();e&&(s.default.isFunction(c)?c:E)(e)}},COPY_CELL:{menuMethod:function(e){o(e)}},CUT_CELL:{menuMethod:function(e){o(e,!0)}},PASTE_CELL:{menuMethod:function(e){var t=e.$event,n=e.$table,a=e.row,e=e.column,o=n.mouseConfig,r=n.computeMouseOpts;o&&r.area?n.triggerPasteCellAreaEvent(t):(o=C())&&o.text&&s.default.set(a,e.field,o.text)}},MERGE_OR_CLEAR:{menuMethod:function(e){var t=e.$event,n=e.$table,a=n.getCellAreas(),e=m(e),o=!1,e=(e.length?n.removeMergeCells(e):(o=!0,n.setMergeCells(a.map(function(e){var t=e.rows,e=e.cols;return{row:t[0],col:e[0],rowspan:t.length,colspan:e.length}}))),a.map(function(e){return{rows:e.rows,cols:e.cols}}));n.dispatchEvent("cell-area-merge",{status:o,targetAreas:e},t)}},MERGE_CELL:{menuMethod:function(e){var t=e.$event,n=e.$table,a=n.getTableData().visibleData,o=n.getTableColumn().visibleColumn,r=n.getCellAreas();l(e),r.some(function(e){return e.rows.length===a.length||e.cols.length===o.length})?u.modal&&u.modal.message({content:u.getI18n("vxe.pro.area.mergeErr"),status:"error",id:"operErr"}):(n.setMergeCells(r.map(function(e){var t=e.rows,e=e.cols;return{row:t[0],col:e[0],rowspan:t.length,colspan:e.length}})),e=r.map(function(e){return{rows:e.rows,cols:e.cols}}),n.dispatchEvent("cell-area-merge",{status:!0,targetAreas:e},t))}},CLEAR_MERGE_CELL:{menuMethod:function(e){var t=e.$event,n=e.$table,e=l(e);e.length&&n.dispatchEvent("clear-cell-area-merge",{mergeCells:e},t)}},CLEAR_ALL_MERGE:{menuMethod:function(e){var t=e.$event,e=e.$table,n=e.getMergeCells(),a=e.getMergeFooterItems();e.clearMergeCells(),e.clearMergeFooterItems(),e.dispatchEvent("clear-merge",{mergeCells:n,mergeFooterItems:a},t)}},EDIT_CELL:{menuMethod:function(e){var t=e.$table,n=e.row,e=e.column;t.setEditCell?t.setEditCell(n,e):t.setActiveCell(n,e.field)}},EDIT_ROW:{menuMethod:function(e){var t=e.$table,e=e.row;t.setEditRow?t.setEditRow(e):t.setActiveRow(e)}},INSERT_ROW:{menuMethod:function(e){e.$table.insert(e.menu.params)}},INSERT_ACTIVED_ROW:{menuMethod:function(e){var t=e.$table,n=e.column,a=e.menu.params||[];t.insert(a[0]).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,a[1]||n):t.setActiveCell(e,a[1]||n.field)})}},INSERT_EDIT_ROW:{menuMethod:function(e){var t=e.$table,n=e.column,a=e.menu.params||[];t.insert(a[0]).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,a[1]||n):t.setActiveCell(e,a[1]||n.field)})}},INSERT_AT_ROW:{menuMethod:function(e){var t=e.$table,n=e.row;n&&t.insertAt(e.menu.params,n)}},INSERT_AT_ACTIVED_ROW:{menuMethod:function(e){var t,n=e.$table,a=e.row,o=e.column;a&&(t=e.menu.params||[],n.insertAt(t[0],a).then(function(e){e=e.row;n.setEditCell?n.setEditCell(e,t[1]||o):n.setActiveCell(e,t[1]||o.field)}))}},INSERT_AT_EDIT_ROW:{menuMethod:function(e){var t,n=e.$table,a=e.row,o=e.column;a&&(t=e.menu.params||[],n.insertAt(t[0],a).then(function(e){e=e.row;n.setEditCell?n.setEditCell(e,t[1]||o):n.setActiveCell(e,t[1]||o.field)}))}},DELETE_ROW:{menuMethod:function(e){var t=e.$table,e=e.row;e&&t.remove(e)}},DELETE_AREA_ROW:{menuMethod:function(e){var t=e.$table,e=e.row,n=t.mouseConfig,a=t.computeMouseOpts;n&&a.area?(n&&a.area?t.getCellAreas():[]).forEach(function(e){e=e.rows;t.remove(e)}):e&&t.remove(e)}},DELETE_CHECKBOX_ROW:{menuMethod:function(e){e.$table.removeCheckboxRow()}},DELETE_ALL:{menuMethod:function(e){e.$table.remove()}},CLEAR_SORT:{menuMethod:function(e){var t=e.$event,n=e.$table,e=e.column;e&&n.triggerSortEvent(t,e,null)}},CLEAR_ALL_SORT:{menuMethod:function(e){var t=e.$event,e=e.$table,n=e.getSortColumns();n.length&&(e.clearSort(),e.dispatchEvent("clear-sort",{sortList:n},t))}},SORT_ASC:{menuMethod:function(e){var t=e.$event,n=e.$table,e=e.column;e&&n.triggerSortEvent(t,e,"asc")}},SORT_DESC:{menuMethod:function(e){var t=e.$event,n=e.$table,e=e.column;e&&n.triggerSortEvent(t,e,"desc")}},CLEAR_FILTER:{menuMethod:function(e){var t=e.$event,n=e.$table,e=e.column;e&&(n.handleClearFilter(e),n.confirmFilterEvent(t))}},CLEAR_ALL_FILTER:{menuMethod:function(e){var t=e.$event,e=e.$table,n=e.getCheckedFilters();n.length&&(e.clearFilter(),e.dispatchEvent("clear-filter",{filterList:n},t))}},FILTER_CELL:{menuMethod:function(e){var t,n=e.$table,a=e.row,e=e.column;a&&e&&(t=e.field,(e=e.filters).length)&&((e=e[0]).data=s.default.get(a,t),e.checked=!0,n.updateData())}},EXPORT_ROW:{menuMethod:function(e){var t=e.$table,n=e.menu,e=e.row;e&&t.exportData(s.default.assign({},n.params?n.params[0]:{},{data:[e]}))}},EXPORT_CHECKBOX_ROW:{menuMethod:function(e){var t=e.$table,e=e.menu,n={data:t.getCheckboxRecords()};t.exportData(s.default.assign({},e.params?e.params[0]:{},n))}},EXPORT_ALL:{menuMethod:function(e){e.$table.exportData(e.menu.params)}},PRINT_ALL:{menuMethod:function(e){e.$table.print(e.menu.params)}},PRINT_CHECKBOX_ROW:{menuMethod:function(e){var t=e.$table,e=e.menu,n={data:t.getCheckboxRecords()};t.print(s.default.assign(n,e.params))}},OPEN_FIND:{menuMethod:function(e){var t=e.$event;e.$table.triggerFNROpenEvent(t,"find")}},OPEN_REPLACE:{menuMethod:function(e){var t=e.$event;e.$table.triggerFNROpenEvent(t,"replace")}},HIDDEN_COLUMN:{menuMethod:function(e){var t=e.$table,e=e.column;e&&t.hideColumn(e)}},FIXED_LEFT_COLUMN:n("left"),FIXED_RIGHT_COLUMN:n("right"),CLEAR_FIXED_COLUMN:n(null),RESET_COLUMN:{menuMethod:function(e){e.$table.resetColumn({visible:!0,resizable:!1})}},RESET_RESIZABLE:{menuMethod:function(e){e.$table.resetColumn({visible:!1,resizable:!0})}},RESET_ALL:{menuMethod:function(e){e.$table.resetColumn(!0)}}}),u.interceptor.add("event.showMenu",i)}};"undefined"!=typeof window&&window.VxeUI&&window.VxeUI.use&&window.VxeUI.use(t),e.default=t});
package/package.json CHANGED
@@ -1,72 +1,72 @@
1
- {
2
- "name": "@vxe-ui/plugin-menu",
3
- "version": "3.0.2",
4
- "description": "Vxe UI plug-in supports context menu.",
5
- "scripts": {
6
- "lib": "gulp build"
7
- },
8
- "files": [
9
- "types",
10
- "dist",
11
- "*.ts",
12
- "*.d.ts"
13
- ],
14
- "main": "dist/index.common.js",
15
- "unpkg": "dist/index.umd.js",
16
- "jsdelivr": "dist/index.umd.js",
17
- "style": "dist/style.css",
18
- "typings": "types/index.d.ts",
19
- "devDependencies": {
20
- "@babel/core": "^7.12.3",
21
- "@babel/plugin-transform-runtime": "^7.12.1",
22
- "@babel/preset-env": "^7.12.1",
23
- "@babel/runtime": "^7.12.5",
24
- "@typescript-eslint/eslint-plugin": "^4.6.1",
25
- "@typescript-eslint/parser": "^4.6.1",
26
- "del": "^6.0.0",
27
- "eslint": "^7.13.0",
28
- "eslint-config-prettier": "^6.15.0",
29
- "eslint-config-standard": "^16.0.1",
30
- "eslint-friendly-formatter": "^4.0.1",
31
- "eslint-plugin-import": "^2.22.1",
32
- "eslint-plugin-node": "^11.1.0",
33
- "eslint-plugin-prettier": "^3.1.4",
34
- "eslint-plugin-promise": "^4.2.1",
35
- "eslint-plugin-standard": "^4.0.2",
36
- "eslint-plugin-typescript": "^0.14.0",
37
- "gulp": "^4.0.2",
38
- "gulp-autoprefixer": "^8.0.0",
39
- "gulp-babel": "^8.0.0",
40
- "gulp-clean-css": "^4.3.0",
41
- "gulp-concat": "^2.6.1",
42
- "gulp-rename": "^2.0.0",
43
- "gulp-replace": "^1.1.3",
44
- "gulp-sass": "^5.1.0",
45
- "gulp-sourcemaps": "^3.0.0",
46
- "gulp-typescript": "^5.0.1",
47
- "gulp-uglify": "^3.0.2",
48
- "markdown-doctest": "^1.1.0",
49
- "prettier": "^2.1.2",
50
- "sass": "^1.55.0",
51
- "typescript": "^4.6.4",
52
- "vue": "^2.6.14",
53
- "vxe-pc-ui": "^3.2.9",
54
- "vxe-table": "^3.10.1"
55
- },
56
- "repository": {
57
- "type": "git",
58
- "url": "git+https://github.com/x-extends/vxe-ui-plugins.git"
59
- },
60
- "keywords": [
61
- "vxe-ui-plugins"
62
- ],
63
- "author": {
64
- "name": "Xu Liangzhan",
65
- "email": "xu_liangzhan@163.com"
66
- },
67
- "license": "MIT",
68
- "bugs": {
69
- "url": "https://github.com/x-extends/vxe-ui-plugins/issues"
70
- },
71
- "homepage": "https://github.com/x-extends/vxe-ui-plugins#readme"
72
- }
1
+ {
2
+ "name": "@vxe-ui/plugin-menu",
3
+ "version": "3.0.4",
4
+ "description": "Vxe UI plug-in supports context menu.",
5
+ "scripts": {
6
+ "lib": "gulp build"
7
+ },
8
+ "files": [
9
+ "types",
10
+ "dist",
11
+ "*.ts",
12
+ "*.d.ts"
13
+ ],
14
+ "main": "dist/index.common.js",
15
+ "unpkg": "dist/index.umd.js",
16
+ "jsdelivr": "dist/index.umd.js",
17
+ "style": "dist/style.css",
18
+ "typings": "types/index.d.ts",
19
+ "devDependencies": {
20
+ "@babel/core": "^7.12.3",
21
+ "@babel/plugin-transform-runtime": "^7.12.1",
22
+ "@babel/preset-env": "^7.12.1",
23
+ "@babel/runtime": "^7.12.5",
24
+ "@typescript-eslint/eslint-plugin": "^4.6.1",
25
+ "@typescript-eslint/parser": "^4.6.1",
26
+ "del": "^6.0.0",
27
+ "eslint": "^7.13.0",
28
+ "eslint-config-prettier": "^6.15.0",
29
+ "eslint-config-standard": "^16.0.1",
30
+ "eslint-friendly-formatter": "^4.0.1",
31
+ "eslint-plugin-import": "^2.22.1",
32
+ "eslint-plugin-node": "^11.1.0",
33
+ "eslint-plugin-prettier": "^3.1.4",
34
+ "eslint-plugin-promise": "^4.2.1",
35
+ "eslint-plugin-standard": "^4.0.2",
36
+ "eslint-plugin-typescript": "^0.14.0",
37
+ "gulp": "^4.0.2",
38
+ "gulp-autoprefixer": "^8.0.0",
39
+ "gulp-babel": "^8.0.0",
40
+ "gulp-clean-css": "^4.3.0",
41
+ "gulp-concat": "^2.6.1",
42
+ "gulp-rename": "^2.0.0",
43
+ "gulp-replace": "^1.1.3",
44
+ "gulp-sass": "^5.1.0",
45
+ "gulp-sourcemaps": "^3.0.0",
46
+ "gulp-typescript": "^5.0.1",
47
+ "gulp-uglify": "^3.0.2",
48
+ "markdown-doctest": "^1.1.0",
49
+ "prettier": "^2.1.2",
50
+ "sass": "^1.55.0",
51
+ "typescript": "^4.6.4",
52
+ "vue": "2.6.14",
53
+ "vxe-pc-ui": "^3.3.58",
54
+ "vxe-table": "^3.12.0"
55
+ },
56
+ "repository": {
57
+ "type": "git",
58
+ "url": "git+https://github.com/x-extends/vxe-ui-plugins.git"
59
+ },
60
+ "keywords": [
61
+ "vxe-ui-plugins"
62
+ ],
63
+ "author": {
64
+ "name": "Xu Liangzhan",
65
+ "email": "xu_liangzhan@163.com"
66
+ },
67
+ "license": "MIT",
68
+ "bugs": {
69
+ "url": "https://github.com/x-extends/vxe-ui-plugins/issues"
70
+ },
71
+ "homepage": "https://github.com/x-extends/vxe-ui-plugins#readme"
72
+ }
package/types/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- import { VxeUIExport } from 'vxe-pc-ui'
2
-
3
- export interface VxeUIPluginMenuOptions {
4
- copy?: (content: string | number) => boolean;
5
- }
6
-
7
- /**
8
- * 基于 Vxe UI 的扩展插件,支持右键菜单
9
- */
10
- export declare const VxeUIPluginMenu: {
11
- install (VxeUI: VxeUIExport, options?: VxeUIPluginMenuOptions): void
12
- }
13
-
14
- export default VxeUIPluginMenu
1
+ import { VxeUIExport } from 'vxe-pc-ui'
2
+
3
+ export interface VxeUIPluginMenuOptions {
4
+ copy?: (content: string | number) => boolean;
5
+ }
6
+
7
+ /**
8
+ * 基于 Vxe UI 的扩展插件,支持右键菜单
9
+ */
10
+ export declare const VxeUIPluginMenu: {
11
+ install (VxeUI: VxeUIExport, options?: VxeUIPluginMenuOptions): void
12
+ }
13
+
14
+ export default VxeUIPluginMenu