@vxe-ui/plugin-menu 4.0.5 → 4.0.7

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,130 +1,132 @@
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 v4](https://www.npmjs.com/package/vxe-table) or [vxe-pc-ui v4](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
- ## Table Demo
83
-
84
- ```html
85
- <template>
86
- <vxe-table
87
- :data="tableData"
88
- :menu-config="menuConfig"
89
- :edit-config="{trigger: 'click', mode: 'cell'}">
90
- <vxe-column type="seq" width="60"></vxe-column>
91
- <vxe-column field="name" title="Name" :edit-render="{name: 'input'}"></vxe-column>
92
- <vxe-column field="sex" title="sex" :edit-render="{name: 'input'}"></vxe-column>
93
- <vxe-column field="age" title="Age" :edit-render="{name: 'input'}"></vxe-column>
94
- </vxe-table>
95
- </template>
96
-
97
- <script>
98
- export default {
99
- data () {
100
- return {
101
- tableData: [
102
- { id: 100, name: 'test1', age: 28, sex: '1' },
103
- { id: 101, name: 'test2', age: 32, sex: '0' },
104
- { id: 102, name: 'test3', age: 36, sex: '1' }
105
- ],
106
- menuConfig: {
107
- body: {
108
- options: [
109
- [
110
- { code: 'EXPORT_ALL', name: '导出.csv' },
111
- { code: 'INSERT_EDIT_ROW', name: '新增' }
112
- ]
113
- ]
114
- }
115
- }
116
- }
117
- }
118
- }
119
- </script>
120
- ```
121
-
122
- ## Contributors
123
-
124
- Thank you to everyone who contributed to this project.
125
-
126
- [![vxe-ui-plugins](https://contrib.rocks/image?repo=x-extends/vxe-ui-plugins)](https://github.com/x-extends/vxe-ui-plugins/graphs/contributors)
127
-
128
- ## License
129
-
130
- [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 v4](https://www.npmjs.com/package/vxe-table) or [vxe-pc-ui v4](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_NEXT_AT_ROW | 插入数据到指定位置 | records |
56
+ | INSERT_AT_EDIT_ROW | 插入数据到指定位置并激活编辑状态 | Array\<records, field\> |
57
+ | INSERT_NEXT_AT_EDIT_ROW | 插入数据到指定位置并激活编辑状态 | Array\<records, field\> |
58
+ | DELETE_ROW | 移除行数据 | — |
59
+ | DELETE_AREA_ROW | 如果启用 mouse-config.area 功能,移除所选区域行数据;否则删除当前行 | — |
60
+ | DELETE_CHECKBOX_ROW | 移除复选框选中行数据 | — |
61
+ | DELETE_ALL | 移除所有行数据 | — |
62
+ | CLEAR_SORT | 清除所选列排序条件 | — |
63
+ | CLEAR_ALL_SORT | 清除所有排序条件 | — |
64
+ | SORT_ASC | 按所选列的值升序 | — |
65
+ | SORT_DESC | 按所选列的值倒序 | — |
66
+ | CLEAR_FILTER | 清除选中列的筛选条件 | — |
67
+ | CLEAR_ALL_FILTER | 清除所有列筛选条件 | |
68
+ | FILTER_CELL | 根据单元格值筛选 | |
69
+ | EXPORT_ROW | 导出行数据 | options |
70
+ | EXPORT_CHECKBOX_ROW | 导出复选框选中行数据 | options |
71
+ | EXPORT_ALL | 导出所有行数据 | options |
72
+ | PRINT_ALL | 打印所有行数据 | options |
73
+ | PRINT_CHECKBOX_ROW | 打印复选框选中行 | options |
74
+ | OPEN_FIND | 如果启用 mouse-config.area 功能,打开单元格查找功能 | — |
75
+ | OPEN_REPLACE | 如果启用 mouse-config.area 功能,打开单元格替换功能 | — |
76
+ | FIXED_LEFT_COLUMN | 将列固定到左侧 | — |
77
+ | FIXED_RIGHT_COLUMN | 将列固定到右侧 | — |
78
+ | CLEAR_FIXED_COLUMN | 清除固定列 | — |
79
+ | HIDDEN_COLUMN | 隐藏当前列 | — |
80
+ | RESET_COLUMN | 重置列的可视状态 | — |
81
+ | RESET_RESIZABLE | 重置列宽状态 | — |
82
+ | RESET_ALL | 重置列的所有状态 | — |
83
+
84
+ ## Table Demo
85
+
86
+ ```html
87
+ <template>
88
+ <vxe-table
89
+ :data="tableData"
90
+ :menu-config="menuConfig"
91
+ :edit-config="{trigger: 'click', mode: 'cell'}">
92
+ <vxe-column type="seq" width="60"></vxe-column>
93
+ <vxe-column field="name" title="Name" :edit-render="{name: 'input'}"></vxe-column>
94
+ <vxe-column field="sex" title="sex" :edit-render="{name: 'input'}"></vxe-column>
95
+ <vxe-column field="age" title="Age" :edit-render="{name: 'input'}"></vxe-column>
96
+ </vxe-table>
97
+ </template>
98
+
99
+ <script>
100
+ export default {
101
+ data () {
102
+ return {
103
+ tableData: [
104
+ { id: 100, name: 'test1', age: 28, sex: '1' },
105
+ { id: 101, name: 'test2', age: 32, sex: '0' },
106
+ { id: 102, name: 'test3', age: 36, sex: '1' }
107
+ ],
108
+ menuConfig: {
109
+ body: {
110
+ options: [
111
+ [
112
+ { code: 'EXPORT_ALL', name: '导出.csv' },
113
+ { code: 'INSERT_EDIT_ROW', name: '新增' }
114
+ ]
115
+ ]
116
+ }
117
+ }
118
+ }
119
+ }
120
+ }
121
+ </script>
122
+ ```
123
+
124
+ ## Contributors
125
+
126
+ Thank you to everyone who contributed to this project.
127
+
128
+ [![vxe-ui-plugins](https://contrib.rocks/image?repo=x-extends/vxe-ui-plugins)](https://github.com/x-extends/vxe-ui-plugins/graphs/contributors)
129
+
130
+ ## License
131
+
132
+ [MIT](LICENSE) © 2019-present, Xu Liangzhan
@@ -361,7 +361,7 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
361
361
  VxeUI = core;
362
362
  // 检查版本
363
363
  if (!/^(4)\./.test(VxeUI.uiVersion)) {
364
- console.error('[plugin-menu 4.x] Version 4.x is required');
364
+ console.error('[@vxe-ui/plugin-menu 4.0.7] Requires vxe-table 4.7.0+ version. https://vxeui.com/other4/#/plugin-export-xlsx/install');
365
365
  }
366
366
  pluginSetup(options);
367
367
  VxeUI.menus.mixin({
@@ -793,6 +793,19 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
793
793
  }
794
794
  }
795
795
  },
796
+ /**
797
+ * 插入数据到指定位置
798
+ */
799
+ INSERT_NEXT_AT_ROW: {
800
+ menuMethod: function menuMethod(params) {
801
+ var $table = params.$table,
802
+ menu = params.menu,
803
+ row = params.row;
804
+ if (row) {
805
+ $table.insertNextAt(menu.params, row);
806
+ }
807
+ }
808
+ },
796
809
  /**
797
810
  * 插入数据到指定位置并激活编辑状态
798
811
  */
@@ -839,6 +852,29 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
839
852
  }
840
853
  }
841
854
  },
855
+ /**
856
+ * 插入数据到指定位置并激活编辑状态
857
+ */
858
+ INSERT_NEXT_AT_EDIT_ROW: {
859
+ menuMethod: function menuMethod(params) {
860
+ var $table = params.$table,
861
+ menu = params.menu,
862
+ row = params.row,
863
+ column = params.column;
864
+ if (row) {
865
+ var args = menu.params || []; // [{}, 'field']
866
+ $table.insertNextAt(args[0], row).then(function (_ref11) {
867
+ var row = _ref11.row;
868
+ if ($table.setEditCell) {
869
+ $table.setEditCell(row, args[1] || column);
870
+ } else {
871
+ // 兼容老版本
872
+ $table.setActiveCell(row, args[1] || column.field);
873
+ }
874
+ });
875
+ }
876
+ }
877
+ },
842
878
  /**
843
879
  * 移除行数据
844
880
  */
package/dist/index.umd.js CHANGED
@@ -374,7 +374,7 @@
374
374
  VxeUI = core;
375
375
  // 检查版本
376
376
  if (!/^(4)\./.test(VxeUI.uiVersion)) {
377
- console.error('[plugin-menu 4.x] Version 4.x is required');
377
+ console.error('[@vxe-ui/plugin-menu 4.0.7] Requires vxe-table 4.7.0+ version. https://vxeui.com/other4/#/plugin-export-xlsx/install');
378
378
  }
379
379
  pluginSetup(options);
380
380
  VxeUI.menus.mixin({
@@ -806,6 +806,19 @@
806
806
  }
807
807
  }
808
808
  },
809
+ /**
810
+ * 插入数据到指定位置
811
+ */
812
+ INSERT_NEXT_AT_ROW: {
813
+ menuMethod: function menuMethod(params) {
814
+ var $table = params.$table,
815
+ menu = params.menu,
816
+ row = params.row;
817
+ if (row) {
818
+ $table.insertNextAt(menu.params, row);
819
+ }
820
+ }
821
+ },
809
822
  /**
810
823
  * 插入数据到指定位置并激活编辑状态
811
824
  */
@@ -852,6 +865,29 @@
852
865
  }
853
866
  }
854
867
  },
868
+ /**
869
+ * 插入数据到指定位置并激活编辑状态
870
+ */
871
+ INSERT_NEXT_AT_EDIT_ROW: {
872
+ menuMethod: function menuMethod(params) {
873
+ var $table = params.$table,
874
+ menu = params.menu,
875
+ row = params.row,
876
+ column = params.column;
877
+ if (row) {
878
+ var args = menu.params || []; // [{}, 'field']
879
+ $table.insertNextAt(args[0], row).then(function (_ref11) {
880
+ var row = _ref11.row;
881
+ if ($table.setEditCell) {
882
+ $table.setEditCell(row, args[1] || column);
883
+ } else {
884
+ // 兼容老版本
885
+ $table.setActiveCell(row, args[1] || column.field);
886
+ }
887
+ });
888
+ }
889
+ }
890
+ },
855
891
  /**
856
892
  * 移除行数据
857
893
  */
@@ -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,u){var i,c;Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.VxeUIPluginMenu=void 0,u=(t=u)&&t.__esModule?t:{default:t};var a,L=function(e,t){return u.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;u.default.eachTree([e.column],function(e){e.fixed=n}),t.refreshColumn()}}}function m(){var e=i.globalStore;return e?e.clipboard||"":(e=i.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,s=e.row,e=e.column;s&&e&&(n=l.props.mouseConfig,o=l.getComputeMaps().computeMouseOpts.value,a="",n&&o.area?(t?l.triggerCutCellAreaEvent(r):l.triggerCopyCellAreaEvent(r),a=(n=m())?n.text:""):(a=u.default.toValueString(u.default.get(s,e.field)),o={text:a,html:""},(t=i.globalStore)?t.clipboard=o:i.config&&(i.config.clipboard=o)),(u.default.isFunction(c)?c:E)(a))}function R(e){var u=e.$table,e=u.props.mouseConfig,t=u.getComputeMaps().computeMouseOpts.value,i=u.getTableData().visibleData,c=u.getTableColumn().visibleColumn,n=e&&t.area?u.getCellAreas():[];return u.getMergeCells().filter(function(e){var o=e.row,r=e.col,l=e.rowspan,s=e.colspan;return n.some(function(e){var t=e.rows,e=e.cols,n=g(u,i,t[0]),t=g(u,i,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+s-1<=e})})}function l(e){var t=e.$table,e=R(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,s=a.props,u=s.editConfig,i=s.mouseConfig;switch(n){case"CLEAR_ALL_SORT":var c=a.getSortColumns();e.disabled=!c.length;break;case"CLEAR_ALL_FILTER":c=a.getCheckedFilters();e.disabled=!c.length;break;case"CLEAR_ALL_MERGE":var c=a.getMergeCells(),E=a.getMergeFooterItems();e.disabled=!c.length&&!E.length;break;case"CLEAR_MERGE_CELL":c=R(t);e.disabled=!c.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 d=a.getComputeMaps().computeMouseOpts.value,f=!!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&&d.area);break;case"EDIT_CELL":e.disabled=!u||!r.editRender;break;case"COPY_CELL":case"CUT_CELL":case"PASTE_CELL":var C=i&&d.area?a.getCellAreas():[];e.disabled=1<C.length,e.disabled||"PASTE_CELL"===n&&(C=m(),e.disabled=!C||!C.text);break;case"MERGE_OR_CLEAR":case"MERGE_CELL":C=i&&d.area?a.getCellAreas():[];e.disabled=!C.length||1===C.length&&1===C[0].rows.length&&1===C[0].cols.length||!((e,t)=>{for(var n=e.$table,a=n.getTableData().visibleData,o=n.getTableColumn().visibleColumn,r={},l=0,s=t.length;l<s;l++)for(var u=t[l],i=u.rows,c=u.cols,E=0,d=i.length;E<d;E++)for(var f=i[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,C);break;case"FIXED_LEFT_COLUMN":e.disabled=f||"left"===r.fixed;break;case"FIXED_RIGHT_COLUMN":e.disabled=f||"right"===r.fixed;break;case"CLEAR_FIXED_COLUMN":e.disabled=f||!r.fixed}}}}function s(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){i=e,/^(4)\./.test(i.uiVersion)||console.error("[plugin-menu 4.x] Version 4.x is required"),d(t),i.menus.mixin({CLEAR_CELL:{menuMethod:function(e){var t,n,a=e.$table,o=e.row,e=e.column;o&&e&&(n=a.props.mouseConfig,t=a.getComputeMaps().computeMouseOpts.value,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 t=e.$table,n=e.row,e=e.column,a=t.props.mouseConfig,o=t.getComputeMaps().computeMouseOpts.value;a&&o.area?(a&&o.area?t.getCellAreas():[]).forEach(function(e){e=e.rows;t.clearData(e)}):n&&e&&t.clearData(n)}},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.props.mouseConfig,t=a.getComputeMaps().computeMouseOpts.value,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&&(u.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.props.mouseConfig,r=n.getComputeMaps().computeMouseOpts.value;o&&r.area?n.triggerPasteCellAreaEvent(t):(o=m())&&o.text&&u.default.set(a,e.field,o.text)}},MERGE_OR_CLEAR:{menuMethod:function(e){var t=e.$event,n=e.$table,a=n.getCellAreas(),e=R(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})?i.modal&&i.modal.message({content:i.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.props.mouseConfig,a=t.getComputeMaps().computeMouseOpts.value;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=u.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(u.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(u.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(u.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)}}}),i.interceptor.add("event.showMenu",s)}};"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,u){var i,c;Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.VxeUIPluginMenu=void 0,u=(t=u)&&t.__esModule?t:{default:t};var a,g=function(e,t){return u.default.findIndexOf(e,function(e){return e.id===t.id})},L=function(e,t,n){return e.findRowIndexOf(t,n)};function n(n){return{menuMethod:function(e){var t=e.$table;u.default.eachTree([e.column],function(e){e.fixed=n}),t.refreshColumn()}}}function m(){var e=i.globalStore;return e?e.clipboard||"":(e=i.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,l=e.$event,r=e.$table,s=e.row,e=e.column;s&&e&&(n=r.props.mouseConfig,o=r.getComputeMaps().computeMouseOpts.value,a="",n&&o.area?(t?r.triggerCutCellAreaEvent(l):r.triggerCopyCellAreaEvent(l),a=(n=m())?n.text:""):(a=u.default.toValueString(u.default.get(s,e.field)),o={text:a,html:""},(t=i.globalStore)?t.clipboard=o:i.config&&(i.config.clipboard=o)),(u.default.isFunction(c)?c:E)(a))}function _(e){var u=e.$table,e=u.props.mouseConfig,t=u.getComputeMaps().computeMouseOpts.value,i=u.getTableData().visibleData,c=u.getTableColumn().visibleColumn,n=e&&t.area?u.getCellAreas():[];return u.getMergeCells().filter(function(e){var o=e.row,l=e.col,r=e.rowspan,s=e.colspan;return n.some(function(e){var t=e.rows,e=e.cols,n=L(u,i,t[0]),t=L(u,i,t[t.length-1]),a=g(c,e[0]),e=g(c,e[e.length-1]);return n<=o&&o+r-1<=t&&a<=l&&l+s-1<=e})})}function r(e){var t=e.$table,e=_(e);return e.length&&t.removeMergeCells(e),e}function l(e,t){var n=e.code,a=t.$table,o=t.row,l=t.column,r=t.type,s=a.props,u=s.editConfig,i=s.mouseConfig;switch(n){case"CLEAR_ALL_SORT":var c=a.getSortColumns();e.disabled=!c.length;break;case"CLEAR_ALL_FILTER":c=a.getCheckedFilters();e.disabled=!c.length;break;case"CLEAR_ALL_MERGE":var c=a.getMergeCells(),E=a.getMergeFooterItems();e.disabled=!c.length&&!E.length;break;case"CLEAR_MERGE_CELL":c=_(t);e.disabled=!c.length;break;case"COPY_TITLE":e.disabled=!l||"header"!==r;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=!l,l){var d=a.getComputeMaps().computeMouseOpts.value,f=!!l.parentId;switch(n){case"CLEAR_SORT":e.disabled=!l.sortable||!l.order;break;case"SORT_ASC":case"SORT_DESC":e.disabled=!l.sortable;break;case"FILTER_CELL":case"CLEAR_FILTER":e.disabled=!l.filters||!l.filters.length,e.disabled||"CLEAR_FILTER"===n&&(e.disabled=!l.filters.some(function(e){return e.checked}));break;case"REVERT_CELL":e.disabled=!o||!l.field||!a.isUpdateByRow(o,l.field);break;case"REVERT_ROW":e.disabled=!o||!l.field||!a.isUpdateByRow(o);break;case"OPEN_FIND":case"OPEN_REPLACE":e.disabled=!(i&&d.area);break;case"EDIT_CELL":e.disabled=!u||!l.editRender;break;case"COPY_CELL":case"CUT_CELL":case"PASTE_CELL":var C=i&&d.area?a.getCellAreas():[];e.disabled=1<C.length,e.disabled||"PASTE_CELL"===n&&(C=m(),e.disabled=!C||!C.text);break;case"MERGE_OR_CLEAR":case"MERGE_CELL":C=i&&d.area?a.getCellAreas():[];e.disabled=!C.length||1===C.length&&1===C[0].rows.length&&1===C[0].cols.length||!((e,t)=>{for(var n=e.$table,a=n.getTableData().visibleData,o=n.getTableColumn().visibleColumn,l={},r=0,s=t.length;r<s;r++)for(var u=t[r],i=u.rows,c=u.cols,E=0,d=i.length;E<d;E++)for(var f=i[E],C=L(n,a,f),m=0,_=c.length;m<_;m++){var R=c[m],R=C+":"+g(o,R);if(l[R])return;l[R]=!0}return 1})(t,C);break;case"FIXED_LEFT_COLUMN":e.disabled=f||"left"===l.fixed;break;case"FIXED_RIGHT_COLUMN":e.disabled=f||"right"===l.fixed;break;case"CLEAR_FIXED_COLUMN":e.disabled=f||!l.fixed}}}}function s(t){return t.options.forEach(function(e){e.forEach(function(e){l(e,t),e.children&&e.children.forEach(function(e){l(e,t)})})}),!0}function d(e){e&&e.copy&&(c=e.copy)}var t=e.VxeUIPluginMenu={setConfig:d,install:function(e,t){i=e,/^(4)\./.test(i.uiVersion)||console.error("[@vxe-ui/plugin-menu 4.0.7] Requires vxe-table 4.7.0+ version. https://vxeui.com/other4/#/plugin-export-xlsx/install"),d(t),i.menus.mixin({CLEAR_CELL:{menuMethod:function(e){var t,n,a=e.$table,o=e.row,e=e.column;o&&e&&(n=a.props.mouseConfig,t=a.getComputeMaps().computeMouseOpts.value,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 t=e.$table,n=e.row,e=e.column,a=t.props.mouseConfig,o=t.getComputeMaps().computeMouseOpts.value;a&&o.area?(a&&o.area?t.getCellAreas():[]).forEach(function(e){e=e.rows;t.clearData(e)}):n&&e&&t.clearData(n)}},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.props.mouseConfig,t=a.getComputeMaps().computeMouseOpts.value,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&&(u.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.props.mouseConfig,l=n.getComputeMaps().computeMouseOpts.value;o&&l.area?n.triggerPasteCellAreaEvent(t):(o=m())&&o.text&&u.default.set(a,e.field,o.text)}},MERGE_OR_CLEAR:{menuMethod:function(e){var t=e.$event,n=e.$table,a=n.getCellAreas(),e=_(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,l=n.getCellAreas();r(e),l.some(function(e){return e.rows.length===a.length||e.cols.length===o.length})?i.modal&&i.modal.message({content:i.getI18n("vxe.pro.area.mergeErr"),status:"error",id:"operErr"}):(n.setMergeCells(l.map(function(e){var t=e.rows,e=e.cols;return{row:t[0],col:e[0],rowspan:t.length,colspan:e.length}})),e=l.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=r(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_NEXT_AT_ROW:{menuMethod:function(e){var t=e.$table,n=e.row;n&&t.insertNextAt(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)}))}},INSERT_NEXT_AT_EDIT_ROW:{menuMethod:function(e){var t,n=e.$table,a=e.row,o=e.column;a&&(t=e.menu.params||[],n.insertNextAt(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.props.mouseConfig,a=t.getComputeMaps().computeMouseOpts.value;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=u.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(u.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(u.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(u.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)}}}),i.interceptor.add("event.showMenu",s)}};"undefined"!=typeof window&&window.VxeUI&&window.VxeUI.use&&window.VxeUI.use(t),e.default=t});
package/package.json CHANGED
@@ -1,72 +1,73 @@
1
- {
2
- "name": "@vxe-ui/plugin-menu",
3
- "version": "4.0.5",
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": "^3.4.27",
53
- "vxe-pc-ui": "^4.3.6",
54
- "vxe-table": "^4.9.8"
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": "4.0.7",
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
+ "@types/node": "20.10.0",
21
+ "@babel/core": "^7.12.3",
22
+ "@babel/plugin-transform-runtime": "^7.12.1",
23
+ "@babel/preset-env": "^7.12.1",
24
+ "@babel/runtime": "^7.12.5",
25
+ "@typescript-eslint/eslint-plugin": "^4.6.1",
26
+ "@typescript-eslint/parser": "^4.6.1",
27
+ "del": "^6.0.0",
28
+ "eslint": "^7.13.0",
29
+ "eslint-config-prettier": "^6.15.0",
30
+ "eslint-config-standard": "^16.0.1",
31
+ "eslint-friendly-formatter": "^4.0.1",
32
+ "eslint-plugin-import": "^2.22.1",
33
+ "eslint-plugin-node": "^11.1.0",
34
+ "eslint-plugin-prettier": "^3.1.4",
35
+ "eslint-plugin-promise": "^4.2.1",
36
+ "eslint-plugin-standard": "^4.0.2",
37
+ "eslint-plugin-typescript": "^0.14.0",
38
+ "gulp": "^4.0.2",
39
+ "gulp-autoprefixer": "^8.0.0",
40
+ "gulp-babel": "^8.0.0",
41
+ "gulp-clean-css": "^4.3.0",
42
+ "gulp-concat": "^2.6.1",
43
+ "gulp-rename": "^2.0.0",
44
+ "gulp-replace": "^1.1.3",
45
+ "gulp-sass": "^5.1.0",
46
+ "gulp-sourcemaps": "^3.0.0",
47
+ "gulp-typescript": "^5.0.1",
48
+ "gulp-uglify": "^3.0.2",
49
+ "markdown-doctest": "^1.1.0",
50
+ "prettier": "^2.1.2",
51
+ "sass": "^1.55.0",
52
+ "typescript": "~4.7.4",
53
+ "vue": "3.4.27",
54
+ "vxe-pc-ui": "^4.3.54",
55
+ "vxe-table": "^4.10.0"
56
+ },
57
+ "repository": {
58
+ "type": "git",
59
+ "url": "git+https://github.com/x-extends/vxe-ui-plugins.git"
60
+ },
61
+ "keywords": [
62
+ "vxe-ui-plugins"
63
+ ],
64
+ "author": {
65
+ "name": "Xu Liangzhan",
66
+ "email": "xu_liangzhan@163.com"
67
+ },
68
+ "license": "MIT",
69
+ "bugs": {
70
+ "url": "https://github.com/x-extends/vxe-ui-plugins/issues"
71
+ },
72
+ "homepage": "https://github.com/x-extends/vxe-ui-plugins#readme"
73
+ }
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