@vxe-ui/plugin-menu 3.3.1 → 3.3.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,35 +1,35 @@
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
- ## Contributors
28
-
29
- Thank you to everyone who contributed to this project.
30
-
31
- [![vxe-ui-plugins](https://contrib.rocks/image?repo=x-extends/vxe-ui-plugins)](https://github.com/x-extends/vxe-ui-plugins/graphs/contributors)
32
-
33
- ## License
34
-
35
- [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
+ ## Contributors
28
+
29
+ Thank you to everyone who contributed to this project.
30
+
31
+ [![vxe-ui-plugins](https://contrib.rocks/image?repo=x-extends/vxe-ui-plugins)](https://github.com/x-extends/vxe-ui-plugins/graphs/contributors)
32
+
33
+ ## License
34
+
35
+ [MIT](LICENSE) © 2019-present, Xu Liangzhan
package/dist/index.umd.js CHANGED
@@ -263,10 +263,14 @@
263
263
  }
264
264
  case 'EDIT_CELL':
265
265
  case 'CLEAR_CELL':
266
+ case 'CLEAR_AREA_CELL':
266
267
  case 'CLEAR_ROW':
267
268
  case 'COPY_CELL':
269
+ case 'COPY_AREA_CELL':
268
270
  case 'CUT_CELL':
271
+ case 'CUT_AREA_CELL':
269
272
  case 'PASTE_CELL':
273
+ case 'PASTE_AREA_CELL':
270
274
  case 'MERGE_OR_CLEAR':
271
275
  case 'MERGE_CELL':
272
276
  case 'REVERT_CELL':
@@ -335,14 +339,18 @@
335
339
  break;
336
340
  }
337
341
  case 'COPY_CELL':
342
+ case 'COPY_AREA_CELL':
338
343
  case 'CUT_CELL':
344
+ case 'CUT_AREA_CELL':
339
345
  case 'PASTE_CELL':
346
+ case 'PASTE_AREA_CELL':
340
347
  {
341
348
  var cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
342
349
  item.disabled = cellAreas.length > 1;
343
350
  if (!item.disabled) {
344
351
  switch (code) {
345
352
  case 'PASTE_CELL':
353
+ case 'PASTE_AREA_CELL':
346
354
  {
347
355
  var clipboard = getClipboardObj();
348
356
  item.disabled = !clipboard || !clipboard.text;
@@ -486,11 +494,11 @@
486
494
  var pVersion = 3;
487
495
  var sVersion = 13;
488
496
  if (!VxeUI.checkVersion(VxeUI.tableVersion, pVersion, sVersion)) {
489
- console.error("[@vxe-ui/plugin-menu 3.3.1] ".concat(VxeUI.getI18n('vxe.error.errorVersion', ["vxe-table@".concat(VxeUI.tableVersion || '?'), "vxe-table v".concat(pVersion, ".").concat(sVersion, "+")])));
497
+ console.error("[@vxe-ui/plugin-menu 3.3.4] ".concat(VxeUI.getI18n('vxe.error.errorVersion', ["vxe-table@".concat(VxeUI.tableVersion || '?'), "vxe-table v".concat(pVersion, ".").concat(sVersion, "+")])));
490
498
  }
491
499
  } else {
492
500
  if (!/^(3)\./.test(VxeUI.uiVersion || VxeUI.tableVersion)) {
493
- console.error('[@vxe-ui/plugin-menu 3.3.1] Requires vxe-table 3.9.0+ version. https://vxeui.com/other3/#/plugin-menu/install');
501
+ console.error('[@vxe-ui/plugin-menu 3.3.4] Requires vxe-table 3.9.0+ version. https://vxeui.com/other3/#/plugin-menu/install');
494
502
  }
495
503
  }
496
504
  pluginConfig(options);
@@ -556,6 +564,37 @@
556
564
  }
557
565
  }
558
566
  },
567
+ /**
568
+ * 清除单元格数据的值;如果启用 mouse-config.area 功能,则清除区域范围内的单元格数据
569
+ */
570
+ CLEAR_AREA_CELL: {
571
+ tableMenuMethod: function tableMenuMethod(params) {
572
+ var $table = params.$table,
573
+ row = params.row,
574
+ column = params.column;
575
+ if (row && column) {
576
+ var tableProps = $table;
577
+ var mouseConfig = tableProps.mouseConfig;
578
+ var mouseOpts = $table.computeMouseOpts;
579
+ if (mouseConfig && mouseOpts.area) {
580
+ var cellAreas = $table.getCellAreas();
581
+ if (cellAreas && cellAreas.length) {
582
+ cellAreas.forEach(function (areaItem) {
583
+ var rows = areaItem.rows,
584
+ cols = areaItem.cols;
585
+ cols.forEach(function (column) {
586
+ rows.forEach(function (row) {
587
+ $table.clearData(row, column.field);
588
+ });
589
+ });
590
+ });
591
+ }
592
+ } else {
593
+ $table.clearData(row, column.field);
594
+ }
595
+ }
596
+ }
597
+ },
559
598
  /**
560
599
  * 清除行数据的值
561
600
  */
@@ -884,6 +923,14 @@
884
923
  handleCopyOrCut(params);
885
924
  }
886
925
  },
926
+ /**
927
+ * 复制单元格数据的值;用于 mouse-config.area 功能,复制区域范围内的单元格数据,支持 Excel 和 WPS
928
+ */
929
+ COPY_AREA_CELL: {
930
+ tableMenuMethod: function tableMenuMethod(params) {
931
+ handleCopyOrCut(params);
932
+ }
933
+ },
887
934
  /**
888
935
  * 剪贴单元格数据的值;如果启用 mouse-config.area 功能,则剪贴区域范围内的单元格数据,支持 Excel 和 WPS
889
936
  */
@@ -892,6 +939,14 @@
892
939
  handleCopyOrCut(params, true);
893
940
  }
894
941
  },
942
+ /**
943
+ * 剪贴单元格数据的值;用于 mouse-config.area 功能,剪贴区域范围内的单元格数据,支持 Excel 和 WPS
944
+ */
945
+ CUT_AREA_CELL: {
946
+ tableMenuMethod: function tableMenuMethod(params) {
947
+ handleCopyOrCut(params, true);
948
+ }
949
+ },
895
950
  /**
896
951
  * 粘贴从表格中被复制的数据;如果启用 mouse-config.area 功能,则粘贴区域范围内的单元格数据,不支持读取剪贴板
897
952
  */
@@ -915,6 +970,21 @@
915
970
  }
916
971
  }
917
972
  },
973
+ /**
974
+ * 粘贴从表格中被复制的数据;用于 mouse-config.area 功能,粘贴区域范围内的单元格数据,不支持读取剪贴板
975
+ */
976
+ PASTE_AREA_CELL: {
977
+ tableMenuMethod: function tableMenuMethod(params) {
978
+ var $event = params.$event,
979
+ $table = params.$table;
980
+ var tableProps = $table;
981
+ var mouseConfig = tableProps.mouseConfig;
982
+ var mouseOpts = $table.computeMouseOpts;
983
+ if (mouseConfig && mouseOpts.area) {
984
+ $table.triggerPasteCellAreaEvent($event);
985
+ }
986
+ }
987
+ },
918
988
  /**
919
989
  * 如果启用 mouse-config.area 功能,如果所选区域内已存在合并单元格,则取消临时合并,否则临时合并
920
990
  */
@@ -1603,7 +1673,11 @@
1603
1673
  tableMenuMethod: function tableMenuMethod(params) {
1604
1674
  var $event = params.$event,
1605
1675
  $table = params.$table;
1606
- $table.triggerFNROpenEvent($event, 'find');
1676
+ if ($table.triggerFnrOpenEvent) {
1677
+ $table.triggerFnrOpenEvent($event, 'find');
1678
+ } else {
1679
+ $table.triggerFNROpenEvent($event, 'find');
1680
+ }
1607
1681
  }
1608
1682
  },
1609
1683
  /**
@@ -1613,7 +1687,11 @@
1613
1687
  tableMenuMethod: function tableMenuMethod(params) {
1614
1688
  var $event = params.$event,
1615
1689
  $table = params.$table;
1616
- $table.triggerFNROpenEvent($event, 'replace');
1690
+ if ($table.triggerFnrOpenEvent) {
1691
+ $table.triggerFnrOpenEvent($event, 'replace');
1692
+ } else {
1693
+ $table.triggerFNROpenEvent($event, 'replace');
1694
+ }
1617
1695
  }
1618
1696
  },
1619
1697
  /**
@@ -1 +1 @@
1
- ((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("xe-utils")):"function"==typeof define&&define.amd?define(["xe-utils"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VxeUIPluginMenu=t(e.XEUtils)})(this,function(e){function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a,u,i,c,n,_,R,l={};function o(a){return{tableMenuMethod:function(e){var t=e.$table;c.default.eachTree([e.column],function(e){e.fixed=a}),t.refreshColumn()}}}function b(){var e=u.globalStore;return e?e.clipboard||"":(e=u.config)&&e.clipboard?e.clipboard:null}function d(e){var t,a;try{t=e,n||((n=document.createElement("textarea")).id="$XECopy",(a=n.style).width="48px",a.height="24px",a.position="fixed",a.zIndex="0",a.left="-500px",a.top="-500px",document.body.appendChild(n)),n.value=null==t?"":""+t,n.select(),n.setSelectionRange(0,n.value.length),document.execCommand("copy"),n.blur()}catch(e){}}function r(e,t){var a,n,l,o=e.$event,r=e.$table,s=e.row,e=e.column;s&&e&&(a=r.mouseConfig,l=r.computeMouseOpts,n="",a&&l.area?(t?r.triggerCutCellAreaEvent(o):r.triggerCopyCellAreaEvent(o),n=(a=b())?a.text:""):(n=c.default.toValueString(c.default.get(s,e.field)),l={text:n,html:""},(t=u.globalStore)?t.clipboard=l:u.config&&(u.config.clipboard=l)),(c.default.isFunction(i)?i:d)(n))}function s(t){return function(e){e=e.$grid;e&&e.commitProxy(t)}}function M(e){var u=e.$table,e=u.mouseConfig,t=u.computeMouseOpts,i=u.getTableData().visibleData,c=u.getTableColumn().visibleColumn,a=e&&t.area?u.getCellAreas():[];return u.getMergeCells().filter(function(e){var l=e.row,o=e.col,r=e.rowspan,s=e.colspan;return a.some(function(e){var t=e.rows,e=e.cols,a=R(u,i,t[0]),t=R(u,i,t[t.length-1]),n=_(c,e[0]),e=_(c,e[e.length-1]);return a<=l&&l+r-1<=t&&n<=o&&o+s-1<=e})})}function E(e){var t=e.$table,e=M(e);return e.length&&t.removeMergeCells(e),e}function f(e,t){var a=e.code,n=t.$table,l=t.$grid,o=t.row,r=t.column,s=t.type,u=n.editConfig,i=n.mouseConfig;switch(a){case"CLEAR_ALL_SORT":var c=n.getSortColumns();e.disabled=!c.length;break;case"CLEAR_ALL_FILTER":c=n.getCheckedFilters();e.disabled=!c.length;break;case"CLEAR_ALL_MERGE":var c=n.getMergeCells(),d=n.getMergeFooterItems();e.disabled=!c.length&&!d.length;break;case"CLEAR_MERGE_CELL":c=M(t);e.disabled=!c.length;break;case"COPY_TITLE":e.disabled=!r||"header"!==s;break;case"SELECT_ALL_AREA":d=n.getTableData().visibleData,c=n.getTableColumn().visibleColumn;e.disabled=!d.length||!c.length;break;case"SELECT_AREA_TO_LEFT":case"SELECT_AREA_TO_RIGHT":case"SELECT_AREA_TO_TOP":case"SELECT_AREA_TO_BOTTON":e.disabled=!r||!o;break;case"DELETE_CHECKBOX_ROW":d=n.getCheckboxRecords();e.disabled=!d.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"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=n.computeMouseOpts,f=!!r.parentId;switch(a){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"===a&&(e.disabled=!r.filters.some(function(e){return e.checked}));break;case"REVERT_CELL":e.disabled=!o||!r.field||!n.isUpdateByRow(o,r.field);break;case"REVERT_ROW":e.disabled=!o||!r.field||!n.isUpdateByRow(o);break;case"OPEN_FIND":case"OPEN_REPLACE":e.disabled=!(i&&E.area);break;case"EDIT_CELL":e.disabled=!u||!r.editRender;break;case"COPY_CELL":case"CUT_CELL":case"PASTE_CELL":var C=i&&E.area?n.getCellAreas():[];e.disabled=1<C.length,e.disabled||"PASTE_CELL"===a&&(C=b(),e.disabled=!C||!C.text);break;case"MERGE_OR_CLEAR":case"MERGE_CELL":C=i&&E.area?n.getCellAreas():[];e.disabled=!C.length||1===C.length&&1===C[0].rows.length&&1===C[0].cols.length||!((e,t)=>{for(var a=e.$table,n=a.getTableData().visibleData,l=a.getTableColumn().visibleColumn,o={},r=0,s=t.length;r<s;r++)for(var u=t[r],i=u.rows,c=u.cols,d=0,E=i.length;d<E;d++)for(var f=i[d],C=R(a,n,f),b=0,M=c.length;b<M;b++){var m=c[b],m=C+":"+_(l,m);if(o[m])return;o[m]=!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}}break;case"COMMIT_PROXY_INITIAL":case"COMMIT_PROXY_QUERY":case"COMMIT_PROXY_RELOAD":case"COMMIT_PROXY_DELETE":case"COMMIT_PROXY_SAVE":e.disabled=!l}}function C(t){return t.options.forEach(function(e){e.forEach(function(e){f(e,t),e.children&&e.children.forEach(function(e){f(e,t)})})}),!0}function m(){return new Promise(function(t){var a,n;u.modal?(a=u.getComponent("VxeNumberInput"))?(n=1,u.modal.alert({title:"请输入行数",width:220,maskClosable:!1,slots:{default:function(e,t){return t(a,{props:{value:n,min:1,max:100,type:"integer",align:"center",controlConfig:{layout:"default"}},style:{width:"100%"},on:{modelValue:function(e){n=e}}})}}}).then(function(e){t("confirm"===e?{size:n||1}:{size:0})})):(console.error(u.getI18n("vxe.error.reqComp",["vxe-number-input"])),t({size:0})):t({size:0})})}function h(){location.reload()}function g(){history.forward()}function L(){history.back()}function T(e){e&&e.copy&&(i=e.copy)}return a||(a=1,a=l,Object.defineProperty(a,"__esModule",{value:!0}),a.default=a.VxeUIPluginMenu=void 0,c=(e=e)&&e.__esModule?e:{default:e},_=function(e,t){return c.default.findIndexOf(e,function(e){return e.id===t.id})},R=function(e,t,a){return e.findRowIndexOf(t,a)},e=a.VxeUIPluginMenu={setConfig:T,install:function(e,t){(u=e).checkVersion?u.checkVersion(u.tableVersion,3,13)||console.error("[@vxe-ui/plugin-menu 3.3.1] ".concat(u.getI18n("vxe.error.errorVersion",["vxe-table@".concat(u.tableVersion||"?"),"vxe-table v".concat(3,".").concat(13,"+")]))):/^(3)\./.test(u.uiVersion||u.tableVersion)||console.error("[@vxe-ui/plugin-menu 3.3.1] Requires vxe-table 3.9.0+ version. https://vxeui.com/other3/#/plugin-menu/install"),T(t),u.menus.mixin({SYSTEM_PAGE_REFRESH:{tableMenuMethod:h,treeMenuMethod:h,calendarMenuMethod:h,menuMenuMethod:h,formDesignMenuMethod:h},SYSTEM_PAGE_FORWARD:{tableMenuMethod:g,treeMenuMethod:g,calendarMenuMethod:g,menuMenuMethod:g,formDesignMenuMethod:g},SYSTEM_PAGE_BACK:{tableMenuMethod:L,treeMenuMethod:L,calendarMenuMethod:L,menuMenuMethod:L,formDesignMenuMethod:L},CLEAR_CELL:{tableMenuMethod:function(e){var t,a,n=e.$table,l=e.row,e=e.column;l&&e&&(a=n.mouseConfig,t=n.computeMouseOpts,a&&t.area?(a=n.getCellAreas())&&a.length&&a.forEach(function(e){var a=e.rows;e.cols.forEach(function(t){a.forEach(function(e){n.clearData(e,t.field)})})}):n.clearData(l,e.field))}},CLEAR_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.row;e&&t.clearData(e)}},CLEAR_CHECKBOX_ROW:{tableMenuMethod:function(e){e=e.$table;e.clearData(e.getCheckboxRecords())}},CLEAR_AREA_ROW:{tableMenuMethod:function(e){var n=e.$table,t=e.row,e=e.column,a=n.mouseConfig,l=n.computeMouseOpts;a&&l.area?(a&&l.area?n.getCellAreas():[]).forEach(function(e){var t=e.rows,a=e.cols;t.forEach(function(t){a.forEach(function(e){n.clearData(t)})})}):t&&e&&n.clearData(t)}},CLEAR_ALL:{tableMenuMethod:function(e){e.$table.clearData()}},SELECT_ALL_AREA:{tableMenuMethod:function(e){var e=e.$table,t=e.mouseConfig,a=e.computeMouseOpts;t&&a.area&&(t=e.getTableData().visibleData,a=e.getTableColumn().visibleColumn,e.setCellAreas([{startRow:c.default.first(t),endRow:c.default.last(t),startColumn:c.default.first(a),endColumn:c.default.last(a)}]))}},SELECT_AREA_TO_LEFT:{tableMenuMethod:function(e){var t=e.$table,a=e.row,e=e.column,n=t.mouseConfig,l=t.computeMouseOpts;n&&l.area&&(n=t.getTableColumn().visibleColumn,1===(l=t.getCellAreas()).length?(l=l[0],t.setCellAreas([{startRow:c.default.first(l.rows),endRow:c.default.last(l.rows),startColumn:c.default.first(n),endColumn:c.default.last(l.cols)}],{column:e,row:a})):t.setCellAreas([{startRow:a,endRow:a,startColumn:c.default.first(n),endColumn:e}],{column:e,row:a}))}},SELECT_AREA_TO_RIGHT:{tableMenuMethod:function(e){var t=e.$table,a=e.row,e=e.column,n=t.mouseConfig,l=t.computeMouseOpts;n&&l.area&&(n=t.getTableColumn().visibleColumn,1===(l=t.getCellAreas()).length?(l=l[0],t.setCellAreas([{startRow:c.default.first(l.rows),endRow:c.default.last(l.rows),startColumn:c.default.first(l.cols),endColumn:c.default.last(n)}],{column:e,row:a})):t.setCellAreas([{startRow:a,endRow:a,startColumn:e,endColumn:c.default.last(n)}],{column:e,row:a}))}},SELECT_AREA_TO_TOP:{tableMenuMethod:function(e){var t=e.$table,a=e.row,e=e.column,n=t.mouseConfig,l=t.computeMouseOpts;n&&l.area&&(n=t.getTableData().visibleData,1===(l=t.getCellAreas()).length?(l=l[0],t.setCellAreas([{startRow:c.default.first(n),endRow:c.default.last(l.rows),startColumn:c.default.first(l.cols),endColumn:c.default.last(l.cols)}],{column:e,row:a})):t.setCellAreas([{startRow:c.default.first(n),endRow:a,startColumn:e,endColumn:e}],{column:e,row:a}))}},SELECT_AREA_TO_BOTTON:{tableMenuMethod:function(e){var t=e.$table,a=e.row,e=e.column,n=t.mouseConfig,l=t.computeMouseOpts;n&&l.area&&(n=t.getTableData().visibleData,1===(l=t.getCellAreas()).length?(l=l[0],t.setCellAreas([{startRow:c.default.first(l.rows),endRow:c.default.last(n),startColumn:c.default.first(l.cols),endColumn:c.default.last(l.cols)}],{column:e,row:a})):t.setCellAreas([{startRow:a,endRow:c.default.last(n),startColumn:e,endColumn:e}],{column:e,row:a}))}},REVERT_CELL:{tableMenuMethod:function(e){var t,a,n=e.$table,l=e.row,e=e.column;l&&e&&(a=n.mouseConfig,t=n.computeMouseOpts,a&&t.area?(a=n.getCellAreas())&&a.length&&a.forEach(function(e){var a=e.rows;e.cols.forEach(function(t){a.forEach(function(e){n.revertData(e,t.field)})})}):n.revertData(l,e.field))}},REVERT_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.row;e&&t.revertData(e)}},REVERT_CHECKBOX_ROW:{tableMenuMethod:function(e){e=e.$table;e.revertData(e.getCheckboxRecords())}},REVERT_ALL:{tableMenuMethod:function(e){e.$table.revertData()}},COPY_TITLE:{tableMenuMethod:function(e){e=e.column.getTitle();e&&(c.default.isFunction(i)?i:d)(e)}},COPY_CELL:{tableMenuMethod:function(e){r(e)}},CUT_CELL:{tableMenuMethod:function(e){r(e,!0)}},PASTE_CELL:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,n=e.row,e=e.column,l=a.mouseConfig,o=a.computeMouseOpts;l&&o.area?a.triggerPasteCellAreaEvent(t):(l=b())&&l.text&&c.default.set(n,e.field,l.text)}},MERGE_OR_CLEAR:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,n=a.getCellAreas(),e=M(e),l=!1,e=(e.length?a.removeMergeCells(e):(l=!0,a.setMergeCells(n.map(function(e){var t=e.rows,e=e.cols;return{row:t[0],col:e[0],rowspan:t.length,colspan:e.length}}))),n.map(function(e){return{rows:e.rows,cols:e.cols}}));a.dispatchEvent("cell-area-merge",{status:l,targetAreas:e},t)}},MERGE_CELL:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,n=a.getTableData().visibleData,l=a.getTableColumn().visibleColumn,o=a.getCellAreas();E(e),o.some(function(e){return e.rows.length===n.length||e.cols.length===l.length})?u.modal&&u.modal.message({content:u.getI18n("vxe.pro.area.mergeErr"),status:"error",id:"operErr"}):(a.setMergeCells(o.map(function(e){var t=e.rows,e=e.cols;return{row:t[0],col:e[0],rowspan:t.length,colspan:e.length}})),e=o.map(function(e){return{rows:e.rows,cols:e.cols}}),a.dispatchEvent("cell-area-merge",{status:!0,targetAreas:e},t))}},CLEAR_MERGE_CELL:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,e=E(e);e.length&&a.dispatchEvent("clear-cell-area-merge",{mergeCells:e},t)}},CLEAR_ALL_MERGE:{tableMenuMethod:function(e){var t=e.$event,e=e.$table,a=e.getMergeCells(),n=e.getMergeFooterItems();e.clearMergeCells(),e.clearMergeFooterItems(),e.dispatchEvent("clear-merge",{mergeCells:a,mergeFooterItems:n},t)}},EDIT_CELL:{tableMenuMethod:function(e){var t=e.$table,a=e.row,e=e.column;t.setEditCell?t.setEditCell(a,e):t.setActiveCell(a,e.field)}},EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.row;t.setEditRow?t.setEditRow(e):t.setActiveRow(e)}},INSERT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.column,n=t.mouseConfig,l=t.computeMouseOpts;t.insert(e.menu.params||{}).then(function(e){e=e.rows;a&&n&&l.area&&t.setCellAreas([{startRow:c.default.first(e),endRow:c.default.last(e),startColumn:a,endColumn:a}])})}},INSERT_AT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.menu,n=e.row,l=e.column,o=t.mouseConfig,r=t.computeMouseOpts;(n?t.insertAt(a.params||{},n):t.insert(a.params||{})).then(function(e){e=e.rows;l&&o&&r.area&&t.setCellAreas([{startRow:c.default.first(e),endRow:c.default.last(e),startColumn:l,endColumn:l}])})}},BATCH_INSERT_AT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.menu,n=e.row,l=e.column,o=t.mouseConfig,r=t.computeMouseOpts;m().then(function(e){var e=e.size;e&&(e=c.default.range(0,e).map(function(){return Object.assign({},a.params)}),(n?t.insertAt(e,n):t.insert(e)).then(function(e){e=e.rows;l&&o&&r.area&&t.setCellAreas([{startRow:c.default.first(e),endRow:c.default.last(e),startColumn:l,endColumn:l}])}))})}},INSERT_NEXT_AT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.menu,n=e.row,l=e.column,o=t.mouseConfig,r=t.computeMouseOpts;(n?t.insertNextAt(a.params||{},n):t.insert(a.params||{})).then(function(e){e=e.rows;l&&o&&r.area&&t.setCellAreas([{startRow:c.default.first(e),endRow:c.default.last(e),startColumn:l,endColumn:l}])})}},BATCH_INSERT_NEXT_AT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.menu,n=e.row,l=e.column,o=t.mouseConfig,r=t.computeMouseOpts;m().then(function(e){var e=e.size;e&&(e=c.default.range(0,e).map(function(){return Object.assign({},a.params)}),(n?t.insertNextAt(e,n):t.insert(e)).then(function(e){e=e.rows;l&&o&&r.area&&t.setCellAreas([{startRow:c.default.first(e),endRow:c.default.last(e),startColumn:l,endColumn:l}])}))})}},INSERT_ACTIVED_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.column,n=e.menu.params||[],e=Object.assign({},n[0]||{});t.insert(e).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,n[1]||a):t.setActiveCell(e,n[1]||a.field)})}},INSERT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.column,n=e.menu.params||[],e=Object.assign({},n[0]||{});t.insert(e).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,n[1]||a):t.setActiveCell(e,n[1]||a.field)})}},INSERT_AT_ACTIVED_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.row,n=e.column,l=e.menu.params||[],e=Object.assign({},l[0]||{});(a?t.insertAt(e,a):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,l[1]||n):t.setActiveCell(e,l[1]||n.field)})}},INSERT_AT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.row,n=e.column,l=e.menu.params||[],e=Object.assign({},l[0]||{});(a?t.insertAt(e,a):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,l[1]||n):t.setActiveCell(e,l[1]||n.field)})}},BATCH_INSERT_AT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.row,n=e.column,l=e.menu.params||[];m().then(function(e){var e=e.size;e&&(e=c.default.range(0,e).map(function(){return Object.assign({},l[0])}),(a?t.insertAt(e,a):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,l[1]||n):t.setActiveCell(e,l[1]||n.field)}))})}},INSERT_NEXT_AT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.row,n=e.column,l=e.menu.params||[],e=Object.assign({},l[0]||{});(a?t.insertNextAt(e,a):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,l[1]||n):t.setActiveCell(e,l[1]||n.field)})}},BATCH_INSERT_NEXT_AT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.row,n=e.column,l=e.menu.params||[];m().then(function(e){var e=e.size;e&&(e=c.default.range(0,e).map(function(){return Object.assign({},l[0])}),(a?t.insertNextAt(e,a):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,l[1]||n):t.setActiveCell(e,l[1]||n.field)}))})}},DELETE_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.row;e&&t.remove(e)}},DELETE_AREA_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.row,a=t.mouseConfig,n=t.computeMouseOpts;a&&n.area?(a&&n.area?t.getCellAreas():[]).forEach(function(e){e=e.rows;t.remove(e)}):e&&t.remove(e)}},DELETE_CHECKBOX_ROW:{tableMenuMethod:function(e){e.$table.removeCheckboxRow()}},DELETE_ALL:{tableMenuMethod:function(e){e.$table.remove()}},CLEAR_SORT:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,e=e.column;e&&a.triggerSortEvent(t,e,null)}},CLEAR_ALL_SORT:{tableMenuMethod:function(e){var t=e.$event,e=e.$table,a=e.getSortColumns();a.length&&(e.clearSort(),e.dispatchEvent("clear-sort",{sortList:a},t))}},SORT_ASC:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,e=e.column;e&&a.triggerSortEvent(t,e,"asc")}},SORT_DESC:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,e=e.column;e&&a.triggerSortEvent(t,e,"desc")}},CLEAR_FILTER:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,e=e.column;e&&(a.handleClearFilter(e),a.confirmFilterEvent(t))}},CLEAR_ALL_FILTER:{tableMenuMethod:function(e){var t=e.$event,e=e.$table,a=e.getCheckedFilters();a.length&&(e.clearFilter(),e.dispatchEvent("clear-filter",{filterList:a},t))}},FILTER_CELL:{tableMenuMethod:function(e){var t,a=e.$table,n=e.row,e=e.column;n&&e&&(t=e.field,(e=e.filters).length)&&((e=e[0]).data=c.default.get(n,t),e.checked=!0,a.updateData())}},EXPORT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.menu,e=e.row;e&&t.exportData(c.default.assign({},a.params?a.params[0]:{},{data:[e]}))}},EXPORT_CHECKBOX_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.menu,a={data:t.getCheckboxRecords()};t.exportData(c.default.assign({},e.params?e.params[0]:{},a))}},EXPORT_ALL:{tableMenuMethod:function(e){e.$table.exportData(e.menu.params)}},PRINT_ALL:{tableMenuMethod:function(e){e.$table.print(e.menu.params)}},PRINT_CHECKBOX_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.menu,a={data:t.getCheckboxRecords()};t.print(c.default.assign(a,e.params))}},OPEN_FIND:{tableMenuMethod:function(e){var t=e.$event;e.$table.triggerFNROpenEvent(t,"find")}},OPEN_REPLACE:{tableMenuMethod:function(e){var t=e.$event;e.$table.triggerFNROpenEvent(t,"replace")}},HIDDEN_COLUMN:{tableMenuMethod:function(e){var t=e.$table,e=e.column;e&&t.hideColumn(e)}},FIXED_LEFT_COLUMN:o("left"),FIXED_RIGHT_COLUMN:o("right"),CLEAR_FIXED_COLUMN:o(null),RESET_COLUMN:{tableMenuMethod:function(e){e.$table.resetColumn({visible:!0,resizable:!1})}},RESET_RESIZABLE:{tableMenuMethod:function(e){e.$table.resetColumn({visible:!1,resizable:!0})}},RESET_ALL:{tableMenuMethod:function(e){e.$table.resetColumn(!0)}},COMMIT_PROXY_INITIAL:{tableMenuMethod:s("initial")},COMMIT_PROXY_QUERY:{tableMenuMethod:s("query")},COMMIT_PROXY_RELOAD:{tableMenuMethod:s("reload")},COMMIT_PROXY_DELETE:{tableMenuMethod:s("delete")},COMMIT_PROXY_SAVE:{tableMenuMethod:s("save")}}),u.interceptor.add("event.showMenu",C)}},"undefined"!=typeof window&&window.VxeUI&&window.VxeUI.use&&window.VxeUI.use(e),a.default=e),t(l)});
1
+ ((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("xe-utils")):"function"==typeof define&&define.amd?define(["xe-utils"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VxeUIPluginMenu=t(e.XEUtils)})(this,function(e){function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,u,i,c,a,m,R,l={};function o(n){return{tableMenuMethod:function(e){var t=e.$table;c.default.eachTree([e.column],function(e){e.fixed=n}),t.refreshColumn()}}}function M(){var e=u.globalStore;return e?e.clipboard||"":(e=u.config)&&e.clipboard?e.clipboard:null}function d(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 r(e,t){var n,a,l,o=e.$event,r=e.$table,s=e.row,e=e.column;s&&e&&(n=r.mouseConfig,l=r.computeMouseOpts,a="",n&&l.area?(t?r.triggerCutCellAreaEvent(o):r.triggerCopyCellAreaEvent(o),a=(n=M())?n.text:""):(a=c.default.toValueString(c.default.get(s,e.field)),l={text:a,html:""},(t=u.globalStore)?t.clipboard=l:u.config&&(u.config.clipboard=l)),(c.default.isFunction(i)?i:d)(a))}function s(t){return function(e){e=e.$grid;e&&e.commitProxy(t)}}function _(e){var u=e.$table,e=u.mouseConfig,t=u.computeMouseOpts,i=u.getTableData().visibleData,c=u.getTableColumn().visibleColumn,n=e&&t.area?u.getCellAreas():[];return u.getMergeCells().filter(function(e){var l=e.row,o=e.col,r=e.rowspan,s=e.colspan;return n.some(function(e){var t=e.rows,e=e.cols,n=R(u,i,t[0]),t=R(u,i,t[t.length-1]),a=m(c,e[0]),e=m(c,e[e.length-1]);return n<=l&&l+r-1<=t&&a<=o&&o+s-1<=e})})}function E(e){var t=e.$table,e=_(e);return e.length&&t.removeMergeCells(e),e}function f(e,t){var n=e.code,a=t.$table,l=t.$grid,o=t.row,r=t.column,s=t.type,u=a.editConfig,i=a.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(),d=a.getMergeFooterItems();e.disabled=!c.length&&!d.length;break;case"CLEAR_MERGE_CELL":c=_(t);e.disabled=!c.length;break;case"COPY_TITLE":e.disabled=!r||"header"!==s;break;case"SELECT_ALL_AREA":d=a.getTableData().visibleData,c=a.getTableColumn().visibleColumn;e.disabled=!d.length||!c.length;break;case"SELECT_AREA_TO_LEFT":case"SELECT_AREA_TO_RIGHT":case"SELECT_AREA_TO_TOP":case"SELECT_AREA_TO_BOTTON":e.disabled=!r||!o;break;case"DELETE_CHECKBOX_ROW":d=a.getCheckboxRecords();e.disabled=!d.length;break;case"EDIT_CELL":case"CLEAR_CELL":case"CLEAR_AREA_CELL":case"CLEAR_ROW":case"COPY_CELL":case"COPY_AREA_CELL":case"CUT_CELL":case"CUT_AREA_CELL":case"PASTE_CELL":case"PASTE_AREA_CELL":case"MERGE_OR_CLEAR":case"MERGE_CELL":case"REVERT_CELL":case"REVERT_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,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&&E.area);break;case"EDIT_CELL":e.disabled=!u||!r.editRender;break;case"COPY_CELL":case"COPY_AREA_CELL":case"CUT_CELL":case"CUT_AREA_CELL":case"PASTE_CELL":case"PASTE_AREA_CELL":var C=i&&E.area?a.getCellAreas():[];if(e.disabled=1<C.length,!e.disabled)switch(n){case"PASTE_CELL":case"PASTE_AREA_CELL":var b=M();e.disabled=!b||!b.text}break;case"MERGE_OR_CLEAR":case"MERGE_CELL":C=i&&E.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,l=n.getTableColumn().visibleColumn,o={},r=0,s=t.length;r<s;r++)for(var u=t[r],i=u.rows,c=u.cols,d=0,E=i.length;d<E;d++)for(var f=i[d],C=R(n,a,f),b=0,M=c.length;b<M;b++){var _=c[b],_=C+":"+m(l,_);if(o[_])return;o[_]=!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}}break;case"COMMIT_PROXY_INITIAL":case"COMMIT_PROXY_QUERY":case"COMMIT_PROXY_RELOAD":case"COMMIT_PROXY_DELETE":case"COMMIT_PROXY_SAVE":e.disabled=!l}}function C(t){return t.options.forEach(function(e){e.forEach(function(e){f(e,t),e.children&&e.children.forEach(function(e){f(e,t)})})}),!0}function b(){return new Promise(function(t){var n,a;u.modal?(n=u.getComponent("VxeNumberInput"))?(a=1,u.modal.alert({title:"请输入行数",width:220,maskClosable:!1,slots:{default:function(e,t){return t(n,{props:{value:a,min:1,max:100,type:"integer",align:"center",controlConfig:{layout:"default"}},style:{width:"100%"},on:{modelValue:function(e){a=e}}})}}}).then(function(e){t("confirm"===e?{size:a||1}:{size:0})})):(console.error(u.getI18n("vxe.error.reqComp",["vxe-number-input"])),t({size:0})):t({size:0})})}function h(){location.reload()}function g(){history.forward()}function L(){history.back()}function A(e){e&&e.copy&&(i=e.copy)}return n||(n=1,n=l,Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.VxeUIPluginMenu=void 0,c=(e=e)&&e.__esModule?e:{default:e},m=function(e,t){return c.default.findIndexOf(e,function(e){return e.id===t.id})},R=function(e,t,n){return e.findRowIndexOf(t,n)},e=n.VxeUIPluginMenu={setConfig:A,install:function(e,t){(u=e).checkVersion?u.checkVersion(u.tableVersion,3,13)||console.error("[@vxe-ui/plugin-menu 3.3.4] ".concat(u.getI18n("vxe.error.errorVersion",["vxe-table@".concat(u.tableVersion||"?"),"vxe-table v".concat(3,".").concat(13,"+")]))):/^(3)\./.test(u.uiVersion||u.tableVersion)||console.error("[@vxe-ui/plugin-menu 3.3.4] Requires vxe-table 3.9.0+ version. https://vxeui.com/other3/#/plugin-menu/install"),A(t),u.menus.mixin({SYSTEM_PAGE_REFRESH:{tableMenuMethod:h,treeMenuMethod:h,calendarMenuMethod:h,menuMenuMethod:h,formDesignMenuMethod:h},SYSTEM_PAGE_FORWARD:{tableMenuMethod:g,treeMenuMethod:g,calendarMenuMethod:g,menuMenuMethod:g,formDesignMenuMethod:g},SYSTEM_PAGE_BACK:{tableMenuMethod:L,treeMenuMethod:L,calendarMenuMethod:L,menuMenuMethod:L,formDesignMenuMethod:L},CLEAR_CELL:{tableMenuMethod:function(e){var t,n,a=e.$table,l=e.row,e=e.column;l&&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(l,e.field))}},CLEAR_AREA_CELL:{tableMenuMethod:function(e){var t,n,a=e.$table,l=e.row,e=e.column;l&&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(l,e.field))}},CLEAR_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.row;e&&t.clearData(e)}},CLEAR_CHECKBOX_ROW:{tableMenuMethod:function(e){e=e.$table;e.clearData(e.getCheckboxRecords())}},CLEAR_AREA_ROW:{tableMenuMethod:function(e){var a=e.$table,t=e.row,e=e.column,n=a.mouseConfig,l=a.computeMouseOpts;n&&l.area?(n&&l.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:{tableMenuMethod:function(e){e.$table.clearData()}},SELECT_ALL_AREA:{tableMenuMethod:function(e){var e=e.$table,t=e.mouseConfig,n=e.computeMouseOpts;t&&n.area&&(t=e.getTableData().visibleData,n=e.getTableColumn().visibleColumn,e.setCellAreas([{startRow:c.default.first(t),endRow:c.default.last(t),startColumn:c.default.first(n),endColumn:c.default.last(n)}]))}},SELECT_AREA_TO_LEFT:{tableMenuMethod:function(e){var t=e.$table,n=e.row,e=e.column,a=t.mouseConfig,l=t.computeMouseOpts;a&&l.area&&(a=t.getTableColumn().visibleColumn,1===(l=t.getCellAreas()).length?(l=l[0],t.setCellAreas([{startRow:c.default.first(l.rows),endRow:c.default.last(l.rows),startColumn:c.default.first(a),endColumn:c.default.last(l.cols)}],{column:e,row:n})):t.setCellAreas([{startRow:n,endRow:n,startColumn:c.default.first(a),endColumn:e}],{column:e,row:n}))}},SELECT_AREA_TO_RIGHT:{tableMenuMethod:function(e){var t=e.$table,n=e.row,e=e.column,a=t.mouseConfig,l=t.computeMouseOpts;a&&l.area&&(a=t.getTableColumn().visibleColumn,1===(l=t.getCellAreas()).length?(l=l[0],t.setCellAreas([{startRow:c.default.first(l.rows),endRow:c.default.last(l.rows),startColumn:c.default.first(l.cols),endColumn:c.default.last(a)}],{column:e,row:n})):t.setCellAreas([{startRow:n,endRow:n,startColumn:e,endColumn:c.default.last(a)}],{column:e,row:n}))}},SELECT_AREA_TO_TOP:{tableMenuMethod:function(e){var t=e.$table,n=e.row,e=e.column,a=t.mouseConfig,l=t.computeMouseOpts;a&&l.area&&(a=t.getTableData().visibleData,1===(l=t.getCellAreas()).length?(l=l[0],t.setCellAreas([{startRow:c.default.first(a),endRow:c.default.last(l.rows),startColumn:c.default.first(l.cols),endColumn:c.default.last(l.cols)}],{column:e,row:n})):t.setCellAreas([{startRow:c.default.first(a),endRow:n,startColumn:e,endColumn:e}],{column:e,row:n}))}},SELECT_AREA_TO_BOTTON:{tableMenuMethod:function(e){var t=e.$table,n=e.row,e=e.column,a=t.mouseConfig,l=t.computeMouseOpts;a&&l.area&&(a=t.getTableData().visibleData,1===(l=t.getCellAreas()).length?(l=l[0],t.setCellAreas([{startRow:c.default.first(l.rows),endRow:c.default.last(a),startColumn:c.default.first(l.cols),endColumn:c.default.last(l.cols)}],{column:e,row:n})):t.setCellAreas([{startRow:n,endRow:c.default.last(a),startColumn:e,endColumn:e}],{column:e,row:n}))}},REVERT_CELL:{tableMenuMethod:function(e){var t,n,a=e.$table,l=e.row,e=e.column;l&&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(l,e.field))}},REVERT_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.row;e&&t.revertData(e)}},REVERT_CHECKBOX_ROW:{tableMenuMethod:function(e){e=e.$table;e.revertData(e.getCheckboxRecords())}},REVERT_ALL:{tableMenuMethod:function(e){e.$table.revertData()}},COPY_TITLE:{tableMenuMethod:function(e){e=e.column.getTitle();e&&(c.default.isFunction(i)?i:d)(e)}},COPY_CELL:{tableMenuMethod:function(e){r(e)}},COPY_AREA_CELL:{tableMenuMethod:function(e){r(e)}},CUT_CELL:{tableMenuMethod:function(e){r(e,!0)}},CUT_AREA_CELL:{tableMenuMethod:function(e){r(e,!0)}},PASTE_CELL:{tableMenuMethod:function(e){var t=e.$event,n=e.$table,a=e.row,e=e.column,l=n.mouseConfig,o=n.computeMouseOpts;l&&o.area?n.triggerPasteCellAreaEvent(t):(l=M())&&l.text&&c.default.set(a,e.field,l.text)}},PASTE_AREA_CELL:{tableMenuMethod:function(e){var t=e.$event,e=e.$table,n=e.mouseConfig,a=e.computeMouseOpts;n&&a.area&&e.triggerPasteCellAreaEvent(t)}},MERGE_OR_CLEAR:{tableMenuMethod:function(e){var t=e.$event,n=e.$table,a=n.getCellAreas(),e=_(e),l=!1,e=(e.length?n.removeMergeCells(e):(l=!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:l,targetAreas:e},t)}},MERGE_CELL:{tableMenuMethod:function(e){var t=e.$event,n=e.$table,a=n.getTableData().visibleData,l=n.getTableColumn().visibleColumn,o=n.getCellAreas();E(e),o.some(function(e){return e.rows.length===a.length||e.cols.length===l.length})?u.modal&&u.modal.message({content:u.getI18n("vxe.pro.area.mergeErr"),status:"error",id:"operErr"}):(n.setMergeCells(o.map(function(e){var t=e.rows,e=e.cols;return{row:t[0],col:e[0],rowspan:t.length,colspan:e.length}})),e=o.map(function(e){return{rows:e.rows,cols:e.cols}}),n.dispatchEvent("cell-area-merge",{status:!0,targetAreas:e},t))}},CLEAR_MERGE_CELL:{tableMenuMethod:function(e){var t=e.$event,n=e.$table,e=E(e);e.length&&n.dispatchEvent("clear-cell-area-merge",{mergeCells:e},t)}},CLEAR_ALL_MERGE:{tableMenuMethod: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:{tableMenuMethod: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:{tableMenuMethod:function(e){var t=e.$table,e=e.row;t.setEditRow?t.setEditRow(e):t.setActiveRow(e)}},INSERT_ROW:{tableMenuMethod:function(e){var t=e.$table,n=e.column,a=t.mouseConfig,l=t.computeMouseOpts;t.insert(e.menu.params||{}).then(function(e){e=e.rows;n&&a&&l.area&&t.setCellAreas([{startRow:c.default.first(e),endRow:c.default.last(e),startColumn:n,endColumn:n}])})}},INSERT_AT_ROW:{tableMenuMethod:function(e){var t=e.$table,n=e.menu,a=e.row,l=e.column,o=t.mouseConfig,r=t.computeMouseOpts;(a?t.insertAt(n.params||{},a):t.insert(n.params||{})).then(function(e){e=e.rows;l&&o&&r.area&&t.setCellAreas([{startRow:c.default.first(e),endRow:c.default.last(e),startColumn:l,endColumn:l}])})}},BATCH_INSERT_AT_ROW:{tableMenuMethod:function(e){var t=e.$table,n=e.menu,a=e.row,l=e.column,o=t.mouseConfig,r=t.computeMouseOpts;b().then(function(e){var e=e.size;e&&(e=c.default.range(0,e).map(function(){return Object.assign({},n.params)}),(a?t.insertAt(e,a):t.insert(e)).then(function(e){e=e.rows;l&&o&&r.area&&t.setCellAreas([{startRow:c.default.first(e),endRow:c.default.last(e),startColumn:l,endColumn:l}])}))})}},INSERT_NEXT_AT_ROW:{tableMenuMethod:function(e){var t=e.$table,n=e.menu,a=e.row,l=e.column,o=t.mouseConfig,r=t.computeMouseOpts;(a?t.insertNextAt(n.params||{},a):t.insert(n.params||{})).then(function(e){e=e.rows;l&&o&&r.area&&t.setCellAreas([{startRow:c.default.first(e),endRow:c.default.last(e),startColumn:l,endColumn:l}])})}},BATCH_INSERT_NEXT_AT_ROW:{tableMenuMethod:function(e){var t=e.$table,n=e.menu,a=e.row,l=e.column,o=t.mouseConfig,r=t.computeMouseOpts;b().then(function(e){var e=e.size;e&&(e=c.default.range(0,e).map(function(){return Object.assign({},n.params)}),(a?t.insertNextAt(e,a):t.insert(e)).then(function(e){e=e.rows;l&&o&&r.area&&t.setCellAreas([{startRow:c.default.first(e),endRow:c.default.last(e),startColumn:l,endColumn:l}])}))})}},INSERT_ACTIVED_ROW:{tableMenuMethod:function(e){var t=e.$table,n=e.column,a=e.menu.params||[],e=Object.assign({},a[0]||{});t.insert(e).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,a[1]||n):t.setActiveCell(e,a[1]||n.field)})}},INSERT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,n=e.column,a=e.menu.params||[],e=Object.assign({},a[0]||{});t.insert(e).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,a[1]||n):t.setActiveCell(e,a[1]||n.field)})}},INSERT_AT_ACTIVED_ROW:{tableMenuMethod:function(e){var t=e.$table,n=e.row,a=e.column,l=e.menu.params||[],e=Object.assign({},l[0]||{});(n?t.insertAt(e,n):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,l[1]||a):t.setActiveCell(e,l[1]||a.field)})}},INSERT_AT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,n=e.row,a=e.column,l=e.menu.params||[],e=Object.assign({},l[0]||{});(n?t.insertAt(e,n):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,l[1]||a):t.setActiveCell(e,l[1]||a.field)})}},BATCH_INSERT_AT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,n=e.row,a=e.column,l=e.menu.params||[];b().then(function(e){var e=e.size;e&&(e=c.default.range(0,e).map(function(){return Object.assign({},l[0])}),(n?t.insertAt(e,n):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,l[1]||a):t.setActiveCell(e,l[1]||a.field)}))})}},INSERT_NEXT_AT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,n=e.row,a=e.column,l=e.menu.params||[],e=Object.assign({},l[0]||{});(n?t.insertNextAt(e,n):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,l[1]||a):t.setActiveCell(e,l[1]||a.field)})}},BATCH_INSERT_NEXT_AT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,n=e.row,a=e.column,l=e.menu.params||[];b().then(function(e){var e=e.size;e&&(e=c.default.range(0,e).map(function(){return Object.assign({},l[0])}),(n?t.insertNextAt(e,n):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,l[1]||a):t.setActiveCell(e,l[1]||a.field)}))})}},DELETE_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.row;e&&t.remove(e)}},DELETE_AREA_ROW:{tableMenuMethod: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:{tableMenuMethod:function(e){e.$table.removeCheckboxRow()}},DELETE_ALL:{tableMenuMethod:function(e){e.$table.remove()}},CLEAR_SORT:{tableMenuMethod:function(e){var t=e.$event,n=e.$table,e=e.column;e&&n.triggerSortEvent(t,e,null)}},CLEAR_ALL_SORT:{tableMenuMethod: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:{tableMenuMethod:function(e){var t=e.$event,n=e.$table,e=e.column;e&&n.triggerSortEvent(t,e,"asc")}},SORT_DESC:{tableMenuMethod:function(e){var t=e.$event,n=e.$table,e=e.column;e&&n.triggerSortEvent(t,e,"desc")}},CLEAR_FILTER:{tableMenuMethod:function(e){var t=e.$event,n=e.$table,e=e.column;e&&(n.handleClearFilter(e),n.confirmFilterEvent(t))}},CLEAR_ALL_FILTER:{tableMenuMethod: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:{tableMenuMethod: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=c.default.get(a,t),e.checked=!0,n.updateData())}},EXPORT_ROW:{tableMenuMethod:function(e){var t=e.$table,n=e.menu,e=e.row;e&&t.exportData(c.default.assign({},n.params?n.params[0]:{},{data:[e]}))}},EXPORT_CHECKBOX_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.menu,n={data:t.getCheckboxRecords()};t.exportData(c.default.assign({},e.params?e.params[0]:{},n))}},EXPORT_ALL:{tableMenuMethod:function(e){e.$table.exportData(e.menu.params)}},PRINT_ALL:{tableMenuMethod:function(e){e.$table.print(e.menu.params)}},PRINT_CHECKBOX_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.menu,n={data:t.getCheckboxRecords()};t.print(c.default.assign(n,e.params))}},OPEN_FIND:{tableMenuMethod:function(e){var t=e.$event,e=e.$table;e.triggerFnrOpenEvent?e.triggerFnrOpenEvent(t,"find"):e.triggerFNROpenEvent(t,"find")}},OPEN_REPLACE:{tableMenuMethod:function(e){var t=e.$event,e=e.$table;e.triggerFnrOpenEvent?e.triggerFnrOpenEvent(t,"replace"):e.triggerFNROpenEvent(t,"replace")}},HIDDEN_COLUMN:{tableMenuMethod:function(e){var t=e.$table,e=e.column;e&&t.hideColumn(e)}},FIXED_LEFT_COLUMN:o("left"),FIXED_RIGHT_COLUMN:o("right"),CLEAR_FIXED_COLUMN:o(null),RESET_COLUMN:{tableMenuMethod:function(e){e.$table.resetColumn({visible:!0,resizable:!1})}},RESET_RESIZABLE:{tableMenuMethod:function(e){e.$table.resetColumn({visible:!1,resizable:!0})}},RESET_ALL:{tableMenuMethod:function(e){e.$table.resetColumn(!0)}},COMMIT_PROXY_INITIAL:{tableMenuMethod:s("initial")},COMMIT_PROXY_QUERY:{tableMenuMethod:s("query")},COMMIT_PROXY_RELOAD:{tableMenuMethod:s("reload")},COMMIT_PROXY_DELETE:{tableMenuMethod:s("delete")},COMMIT_PROXY_SAVE:{tableMenuMethod:s("save")}}),u.interceptor.add("event.showMenu",C)}},"undefined"!=typeof window&&window.VxeUI&&window.VxeUI.use&&window.VxeUI.use(e),n.default=e),t(l)});
package/es/index.esm.js CHANGED
@@ -210,10 +210,14 @@ function checkPrivilege(item, params) {
210
210
  }
211
211
  case 'EDIT_CELL':
212
212
  case 'CLEAR_CELL':
213
+ case 'CLEAR_AREA_CELL':
213
214
  case 'CLEAR_ROW':
214
215
  case 'COPY_CELL':
216
+ case 'COPY_AREA_CELL':
215
217
  case 'CUT_CELL':
218
+ case 'CUT_AREA_CELL':
216
219
  case 'PASTE_CELL':
220
+ case 'PASTE_AREA_CELL':
217
221
  case 'MERGE_OR_CLEAR':
218
222
  case 'MERGE_CELL':
219
223
  case 'REVERT_CELL':
@@ -274,13 +278,17 @@ function checkPrivilege(item, params) {
274
278
  break;
275
279
  }
276
280
  case 'COPY_CELL':
281
+ case 'COPY_AREA_CELL':
277
282
  case 'CUT_CELL':
278
- case 'PASTE_CELL': {
283
+ case 'CUT_AREA_CELL':
284
+ case 'PASTE_CELL':
285
+ case 'PASTE_AREA_CELL': {
279
286
  const cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
280
287
  item.disabled = cellAreas.length > 1;
281
288
  if (!item.disabled) {
282
289
  switch (code) {
283
- case 'PASTE_CELL': {
290
+ case 'PASTE_CELL':
291
+ case 'PASTE_AREA_CELL': {
284
292
  const clipboard = getClipboardObj();
285
293
  item.disabled = !clipboard || !clipboard.text;
286
294
  break;
@@ -424,12 +432,12 @@ export const VxeUIPluginMenu = {
424
432
  const pVersion = 3;
425
433
  const sVersion = 13;
426
434
  if (!VxeUI.checkVersion(VxeUI.tableVersion, pVersion, sVersion)) {
427
- console.error(`[@vxe-ui/plugin-menu 3.3.1] ${VxeUI.getI18n('vxe.error.errorVersion', [`vxe-table@${VxeUI.tableVersion || '?'}`, `vxe-table v${pVersion}.${sVersion}+`])}`);
435
+ console.error(`[@vxe-ui/plugin-menu 3.3.4] ${VxeUI.getI18n('vxe.error.errorVersion', [`vxe-table@${VxeUI.tableVersion || '?'}`, `vxe-table v${pVersion}.${sVersion}+`])}`);
428
436
  }
429
437
  }
430
438
  else {
431
439
  if (!/^(3)\./.test(VxeUI.uiVersion || VxeUI.tableVersion)) {
432
- console.error('[@vxe-ui/plugin-menu 3.3.1] Requires vxe-table 3.9.0+ version. https://vxeui.com/other3/#/plugin-menu/install');
440
+ console.error('[@vxe-ui/plugin-menu 3.3.4] Requires vxe-table 3.9.0+ version. https://vxeui.com/other3/#/plugin-menu/install');
433
441
  }
434
442
  }
435
443
  pluginConfig(options);
@@ -493,6 +501,35 @@ export const VxeUIPluginMenu = {
493
501
  }
494
502
  }
495
503
  },
504
+ /**
505
+ * 清除单元格数据的值;如果启用 mouse-config.area 功能,则清除区域范围内的单元格数据
506
+ */
507
+ CLEAR_AREA_CELL: {
508
+ tableMenuMethod(params) {
509
+ const { $table, row, column } = params;
510
+ if (row && column) {
511
+ const tableProps = $table;
512
+ const { mouseConfig } = tableProps;
513
+ const mouseOpts = $table.computeMouseOpts;
514
+ if (mouseConfig && mouseOpts.area) {
515
+ const cellAreas = $table.getCellAreas();
516
+ if (cellAreas && cellAreas.length) {
517
+ cellAreas.forEach(areaItem => {
518
+ const { rows, cols } = areaItem;
519
+ cols.forEach(column => {
520
+ rows.forEach(row => {
521
+ $table.clearData(row, column.field);
522
+ });
523
+ });
524
+ });
525
+ }
526
+ }
527
+ else {
528
+ $table.clearData(row, column.field);
529
+ }
530
+ }
531
+ }
532
+ },
496
533
  /**
497
534
  * 清除行数据的值
498
535
  */
@@ -782,6 +819,14 @@ export const VxeUIPluginMenu = {
782
819
  handleCopyOrCut(params);
783
820
  }
784
821
  },
822
+ /**
823
+ * 复制单元格数据的值;用于 mouse-config.area 功能,复制区域范围内的单元格数据,支持 Excel 和 WPS
824
+ */
825
+ COPY_AREA_CELL: {
826
+ tableMenuMethod(params) {
827
+ handleCopyOrCut(params);
828
+ }
829
+ },
785
830
  /**
786
831
  * 剪贴单元格数据的值;如果启用 mouse-config.area 功能,则剪贴区域范围内的单元格数据,支持 Excel 和 WPS
787
832
  */
@@ -790,6 +835,14 @@ export const VxeUIPluginMenu = {
790
835
  handleCopyOrCut(params, true);
791
836
  }
792
837
  },
838
+ /**
839
+ * 剪贴单元格数据的值;用于 mouse-config.area 功能,剪贴区域范围内的单元格数据,支持 Excel 和 WPS
840
+ */
841
+ CUT_AREA_CELL: {
842
+ tableMenuMethod(params) {
843
+ handleCopyOrCut(params, true);
844
+ }
845
+ },
793
846
  /**
794
847
  * 粘贴从表格中被复制的数据;如果启用 mouse-config.area 功能,则粘贴区域范围内的单元格数据,不支持读取剪贴板
795
848
  */
@@ -811,6 +864,20 @@ export const VxeUIPluginMenu = {
811
864
  }
812
865
  }
813
866
  },
867
+ /**
868
+ * 粘贴从表格中被复制的数据;用于 mouse-config.area 功能,粘贴区域范围内的单元格数据,不支持读取剪贴板
869
+ */
870
+ PASTE_AREA_CELL: {
871
+ tableMenuMethod(params) {
872
+ const { $event, $table } = params;
873
+ const tableProps = $table;
874
+ const { mouseConfig } = tableProps;
875
+ const mouseOpts = $table.computeMouseOpts;
876
+ if (mouseConfig && mouseOpts.area) {
877
+ $table.triggerPasteCellAreaEvent($event);
878
+ }
879
+ }
880
+ },
814
881
  /**
815
882
  * 如果启用 mouse-config.area 功能,如果所选区域内已存在合并单元格,则取消临时合并,否则临时合并
816
883
  */
@@ -1360,7 +1427,12 @@ export const VxeUIPluginMenu = {
1360
1427
  OPEN_FIND: {
1361
1428
  tableMenuMethod(params) {
1362
1429
  const { $event, $table } = params;
1363
- $table.triggerFNROpenEvent($event, 'find');
1430
+ if ($table.triggerFnrOpenEvent) {
1431
+ $table.triggerFnrOpenEvent($event, 'find');
1432
+ }
1433
+ else {
1434
+ $table.triggerFNROpenEvent($event, 'find');
1435
+ }
1364
1436
  }
1365
1437
  },
1366
1438
  /**
@@ -1369,7 +1441,12 @@ export const VxeUIPluginMenu = {
1369
1441
  OPEN_REPLACE: {
1370
1442
  tableMenuMethod(params) {
1371
1443
  const { $event, $table } = params;
1372
- $table.triggerFNROpenEvent($event, 'replace');
1444
+ if ($table.triggerFnrOpenEvent) {
1445
+ $table.triggerFnrOpenEvent($event, 'replace');
1446
+ }
1447
+ else {
1448
+ $table.triggerFNROpenEvent($event, 'replace');
1449
+ }
1373
1450
  }
1374
1451
  },
1375
1452
  /**