@vxe-ui/plugin-menu 3.3.2 → 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/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.2] ".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.2] 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
  */
@@ -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 n,u,i,c,a,_,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 b(){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=b())?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 M(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=_(c,e[0]),e=_(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=M(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=M(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_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=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"CUT_CELL":case"PASTE_CELL":var C=i&&E.area?a.getCellAreas():[];e.disabled=1<C.length,e.disabled||"PASTE_CELL"===n&&(C=b(),e.disabled=!C||!C.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 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 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 g(){location.reload()}function h(){history.forward()}function L(){history.back()}function T(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},_=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:T,install:function(e,t){(u=e).checkVersion?u.checkVersion(u.tableVersion,3,13)||console.error("[@vxe-ui/plugin-menu 3.3.2] ".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.2] Requires vxe-table 3.9.0+ version. https://vxeui.com/other3/#/plugin-menu/install"),T(t),u.menus.mixin({SYSTEM_PAGE_REFRESH:{tableMenuMethod:g,treeMenuMethod:g,calendarMenuMethod:g,menuMenuMethod:g,formDesignMenuMethod:g},SYSTEM_PAGE_FORWARD:{tableMenuMethod:h,treeMenuMethod:h,calendarMenuMethod:h,menuMenuMethod:h,formDesignMenuMethod:h},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_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)}},CUT_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=b())&&l.text&&c.default.set(a,e.field,l.text)}},MERGE_OR_CLEAR:{tableMenuMethod:function(e){var t=e.$event,n=e.$table,a=n.getCellAreas(),e=M(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;m().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;m().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||[];m().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||[];m().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)});
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.2] ${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.2] 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
  */
package/es/index.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.2] ${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.2] 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
  */
@@ -246,10 +246,14 @@ function checkPrivilege(item, params) {
246
246
  }
247
247
  case 'EDIT_CELL':
248
248
  case 'CLEAR_CELL':
249
+ case 'CLEAR_AREA_CELL':
249
250
  case 'CLEAR_ROW':
250
251
  case 'COPY_CELL':
252
+ case 'COPY_AREA_CELL':
251
253
  case 'CUT_CELL':
254
+ case 'CUT_AREA_CELL':
252
255
  case 'PASTE_CELL':
256
+ case 'PASTE_AREA_CELL':
253
257
  case 'MERGE_OR_CLEAR':
254
258
  case 'MERGE_CELL':
255
259
  case 'REVERT_CELL':
@@ -318,14 +322,18 @@ function checkPrivilege(item, params) {
318
322
  break;
319
323
  }
320
324
  case 'COPY_CELL':
325
+ case 'COPY_AREA_CELL':
321
326
  case 'CUT_CELL':
327
+ case 'CUT_AREA_CELL':
322
328
  case 'PASTE_CELL':
329
+ case 'PASTE_AREA_CELL':
323
330
  {
324
331
  var cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
325
332
  item.disabled = cellAreas.length > 1;
326
333
  if (!item.disabled) {
327
334
  switch (code) {
328
335
  case 'PASTE_CELL':
336
+ case 'PASTE_AREA_CELL':
329
337
  {
330
338
  var clipboard = getClipboardObj();
331
339
  item.disabled = !clipboard || !clipboard.text;
@@ -469,11 +477,11 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
469
477
  var pVersion = 3;
470
478
  var sVersion = 13;
471
479
  if (!VxeUI.checkVersion(VxeUI.tableVersion, pVersion, sVersion)) {
472
- console.error("[@vxe-ui/plugin-menu 3.3.2] ".concat(VxeUI.getI18n('vxe.error.errorVersion', ["vxe-table@".concat(VxeUI.tableVersion || '?'), "vxe-table v".concat(pVersion, ".").concat(sVersion, "+")])));
480
+ 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, "+")])));
473
481
  }
474
482
  } else {
475
483
  if (!/^(3)\./.test(VxeUI.uiVersion || VxeUI.tableVersion)) {
476
- console.error('[@vxe-ui/plugin-menu 3.3.2] Requires vxe-table 3.9.0+ version. https://vxeui.com/other3/#/plugin-menu/install');
484
+ console.error('[@vxe-ui/plugin-menu 3.3.4] Requires vxe-table 3.9.0+ version. https://vxeui.com/other3/#/plugin-menu/install');
477
485
  }
478
486
  }
479
487
  pluginConfig(options);
@@ -539,6 +547,37 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
539
547
  }
540
548
  }
541
549
  },
550
+ /**
551
+ * 清除单元格数据的值;如果启用 mouse-config.area 功能,则清除区域范围内的单元格数据
552
+ */
553
+ CLEAR_AREA_CELL: {
554
+ tableMenuMethod: function tableMenuMethod(params) {
555
+ var $table = params.$table,
556
+ row = params.row,
557
+ column = params.column;
558
+ if (row && column) {
559
+ var tableProps = $table;
560
+ var mouseConfig = tableProps.mouseConfig;
561
+ var mouseOpts = $table.computeMouseOpts;
562
+ if (mouseConfig && mouseOpts.area) {
563
+ var cellAreas = $table.getCellAreas();
564
+ if (cellAreas && cellAreas.length) {
565
+ cellAreas.forEach(function (areaItem) {
566
+ var rows = areaItem.rows,
567
+ cols = areaItem.cols;
568
+ cols.forEach(function (column) {
569
+ rows.forEach(function (row) {
570
+ $table.clearData(row, column.field);
571
+ });
572
+ });
573
+ });
574
+ }
575
+ } else {
576
+ $table.clearData(row, column.field);
577
+ }
578
+ }
579
+ }
580
+ },
542
581
  /**
543
582
  * 清除行数据的值
544
583
  */
@@ -867,6 +906,14 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
867
906
  handleCopyOrCut(params);
868
907
  }
869
908
  },
909
+ /**
910
+ * 复制单元格数据的值;用于 mouse-config.area 功能,复制区域范围内的单元格数据,支持 Excel 和 WPS
911
+ */
912
+ COPY_AREA_CELL: {
913
+ tableMenuMethod: function tableMenuMethod(params) {
914
+ handleCopyOrCut(params);
915
+ }
916
+ },
870
917
  /**
871
918
  * 剪贴单元格数据的值;如果启用 mouse-config.area 功能,则剪贴区域范围内的单元格数据,支持 Excel 和 WPS
872
919
  */
@@ -875,6 +922,14 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
875
922
  handleCopyOrCut(params, true);
876
923
  }
877
924
  },
925
+ /**
926
+ * 剪贴单元格数据的值;用于 mouse-config.area 功能,剪贴区域范围内的单元格数据,支持 Excel 和 WPS
927
+ */
928
+ CUT_AREA_CELL: {
929
+ tableMenuMethod: function tableMenuMethod(params) {
930
+ handleCopyOrCut(params, true);
931
+ }
932
+ },
878
933
  /**
879
934
  * 粘贴从表格中被复制的数据;如果启用 mouse-config.area 功能,则粘贴区域范围内的单元格数据,不支持读取剪贴板
880
935
  */
@@ -898,6 +953,21 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
898
953
  }
899
954
  }
900
955
  },
956
+ /**
957
+ * 粘贴从表格中被复制的数据;用于 mouse-config.area 功能,粘贴区域范围内的单元格数据,不支持读取剪贴板
958
+ */
959
+ PASTE_AREA_CELL: {
960
+ tableMenuMethod: function tableMenuMethod(params) {
961
+ var $event = params.$event,
962
+ $table = params.$table;
963
+ var tableProps = $table;
964
+ var mouseConfig = tableProps.mouseConfig;
965
+ var mouseOpts = $table.computeMouseOpts;
966
+ if (mouseConfig && mouseOpts.area) {
967
+ $table.triggerPasteCellAreaEvent($event);
968
+ }
969
+ }
970
+ },
901
971
  /**
902
972
  * 如果启用 mouse-config.area 功能,如果所选区域内已存在合并单元格,则取消临时合并,否则临时合并
903
973
  */
package/lib/index.js CHANGED
@@ -246,10 +246,14 @@ function checkPrivilege(item, params) {
246
246
  }
247
247
  case 'EDIT_CELL':
248
248
  case 'CLEAR_CELL':
249
+ case 'CLEAR_AREA_CELL':
249
250
  case 'CLEAR_ROW':
250
251
  case 'COPY_CELL':
252
+ case 'COPY_AREA_CELL':
251
253
  case 'CUT_CELL':
254
+ case 'CUT_AREA_CELL':
252
255
  case 'PASTE_CELL':
256
+ case 'PASTE_AREA_CELL':
253
257
  case 'MERGE_OR_CLEAR':
254
258
  case 'MERGE_CELL':
255
259
  case 'REVERT_CELL':
@@ -318,14 +322,18 @@ function checkPrivilege(item, params) {
318
322
  break;
319
323
  }
320
324
  case 'COPY_CELL':
325
+ case 'COPY_AREA_CELL':
321
326
  case 'CUT_CELL':
327
+ case 'CUT_AREA_CELL':
322
328
  case 'PASTE_CELL':
329
+ case 'PASTE_AREA_CELL':
323
330
  {
324
331
  var cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
325
332
  item.disabled = cellAreas.length > 1;
326
333
  if (!item.disabled) {
327
334
  switch (code) {
328
335
  case 'PASTE_CELL':
336
+ case 'PASTE_AREA_CELL':
329
337
  {
330
338
  var clipboard = getClipboardObj();
331
339
  item.disabled = !clipboard || !clipboard.text;
@@ -469,11 +477,11 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
469
477
  var pVersion = 3;
470
478
  var sVersion = 13;
471
479
  if (!VxeUI.checkVersion(VxeUI.tableVersion, pVersion, sVersion)) {
472
- console.error("[@vxe-ui/plugin-menu 3.3.2] ".concat(VxeUI.getI18n('vxe.error.errorVersion', ["vxe-table@".concat(VxeUI.tableVersion || '?'), "vxe-table v".concat(pVersion, ".").concat(sVersion, "+")])));
480
+ 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, "+")])));
473
481
  }
474
482
  } else {
475
483
  if (!/^(3)\./.test(VxeUI.uiVersion || VxeUI.tableVersion)) {
476
- console.error('[@vxe-ui/plugin-menu 3.3.2] Requires vxe-table 3.9.0+ version. https://vxeui.com/other3/#/plugin-menu/install');
484
+ console.error('[@vxe-ui/plugin-menu 3.3.4] Requires vxe-table 3.9.0+ version. https://vxeui.com/other3/#/plugin-menu/install');
477
485
  }
478
486
  }
479
487
  pluginConfig(options);
@@ -539,6 +547,37 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
539
547
  }
540
548
  }
541
549
  },
550
+ /**
551
+ * 清除单元格数据的值;如果启用 mouse-config.area 功能,则清除区域范围内的单元格数据
552
+ */
553
+ CLEAR_AREA_CELL: {
554
+ tableMenuMethod: function tableMenuMethod(params) {
555
+ var $table = params.$table,
556
+ row = params.row,
557
+ column = params.column;
558
+ if (row && column) {
559
+ var tableProps = $table;
560
+ var mouseConfig = tableProps.mouseConfig;
561
+ var mouseOpts = $table.computeMouseOpts;
562
+ if (mouseConfig && mouseOpts.area) {
563
+ var cellAreas = $table.getCellAreas();
564
+ if (cellAreas && cellAreas.length) {
565
+ cellAreas.forEach(function (areaItem) {
566
+ var rows = areaItem.rows,
567
+ cols = areaItem.cols;
568
+ cols.forEach(function (column) {
569
+ rows.forEach(function (row) {
570
+ $table.clearData(row, column.field);
571
+ });
572
+ });
573
+ });
574
+ }
575
+ } else {
576
+ $table.clearData(row, column.field);
577
+ }
578
+ }
579
+ }
580
+ },
542
581
  /**
543
582
  * 清除行数据的值
544
583
  */
@@ -867,6 +906,14 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
867
906
  handleCopyOrCut(params);
868
907
  }
869
908
  },
909
+ /**
910
+ * 复制单元格数据的值;用于 mouse-config.area 功能,复制区域范围内的单元格数据,支持 Excel 和 WPS
911
+ */
912
+ COPY_AREA_CELL: {
913
+ tableMenuMethod: function tableMenuMethod(params) {
914
+ handleCopyOrCut(params);
915
+ }
916
+ },
870
917
  /**
871
918
  * 剪贴单元格数据的值;如果启用 mouse-config.area 功能,则剪贴区域范围内的单元格数据,支持 Excel 和 WPS
872
919
  */
@@ -875,6 +922,14 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
875
922
  handleCopyOrCut(params, true);
876
923
  }
877
924
  },
925
+ /**
926
+ * 剪贴单元格数据的值;用于 mouse-config.area 功能,剪贴区域范围内的单元格数据,支持 Excel 和 WPS
927
+ */
928
+ CUT_AREA_CELL: {
929
+ tableMenuMethod: function tableMenuMethod(params) {
930
+ handleCopyOrCut(params, true);
931
+ }
932
+ },
878
933
  /**
879
934
  * 粘贴从表格中被复制的数据;如果启用 mouse-config.area 功能,则粘贴区域范围内的单元格数据,不支持读取剪贴板
880
935
  */
@@ -898,6 +953,21 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
898
953
  }
899
954
  }
900
955
  },
956
+ /**
957
+ * 粘贴从表格中被复制的数据;用于 mouse-config.area 功能,粘贴区域范围内的单元格数据,不支持读取剪贴板
958
+ */
959
+ PASTE_AREA_CELL: {
960
+ tableMenuMethod: function tableMenuMethod(params) {
961
+ var $event = params.$event,
962
+ $table = params.$table;
963
+ var tableProps = $table;
964
+ var mouseConfig = tableProps.mouseConfig;
965
+ var mouseOpts = $table.computeMouseOpts;
966
+ if (mouseConfig && mouseOpts.area) {
967
+ $table.triggerPasteCellAreaEvent($event);
968
+ }
969
+ }
970
+ },
901
971
  /**
902
972
  * 如果启用 mouse-config.area 功能,如果所选区域内已存在合并单元格,则取消临时合并,否则临时合并
903
973
  */
package/lib/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.2] ".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.2] 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
  */
@@ -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 n,u,i,c,a,_,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 b(){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=b())?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 M(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=_(c,e[0]),e=_(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=M(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=M(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_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=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"CUT_CELL":case"PASTE_CELL":var C=i&&E.area?a.getCellAreas():[];e.disabled=1<C.length,e.disabled||"PASTE_CELL"===n&&(C=b(),e.disabled=!C||!C.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 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 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 g(){location.reload()}function h(){history.forward()}function L(){history.back()}function T(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},_=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:T,install:function(e,t){(u=e).checkVersion?u.checkVersion(u.tableVersion,3,13)||console.error("[@vxe-ui/plugin-menu 3.3.2] ".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.2] Requires vxe-table 3.9.0+ version. https://vxeui.com/other3/#/plugin-menu/install"),T(t),u.menus.mixin({SYSTEM_PAGE_REFRESH:{tableMenuMethod:g,treeMenuMethod:g,calendarMenuMethod:g,menuMenuMethod:g,formDesignMenuMethod:g},SYSTEM_PAGE_FORWARD:{tableMenuMethod:h,treeMenuMethod:h,calendarMenuMethod:h,menuMenuMethod:h,formDesignMenuMethod:h},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_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)}},CUT_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=b())&&l.text&&c.default.set(a,e.field,l.text)}},MERGE_OR_CLEAR:{tableMenuMethod:function(e){var t=e.$event,n=e.$table,a=n.getCellAreas(),e=M(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;m().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;m().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||[];m().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||[];m().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)});
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vxe-ui/plugin-menu",
3
- "version": "3.3.2",
3
+ "version": "3.3.4",
4
4
  "description": "Vxe UI plug-in supports context menu.",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -20,7 +20,7 @@
20
20
  "style": "lib/style.css",
21
21
  "typings": "types/index.d.ts",
22
22
  "devDependencies": {
23
- "@types/node": "20.14.8",
23
+ "@types/node": "~24.12.3",
24
24
  "@babel/core": "~7.28.6",
25
25
  "@babel/preset-env": "~7.28.6",
26
26
  "@babel/runtime": "~7.28.6",
@@ -28,10 +28,9 @@
28
28
  "@typescript-eslint/eslint-plugin": "~4.6.1",
29
29
  "@typescript-eslint/parser": "~4.6.1",
30
30
  "del": "~6.0.0",
31
- "eslint": "~7.13.0",
31
+ "eslint": "~7.32.0",
32
32
  "eslint-config-prettier": "~6.15.0",
33
33
  "eslint-config-standard": "~16.0.1",
34
- "eslint-friendly-formatter": "~4.0.1",
35
34
  "eslint-plugin-import": "~2.22.1",
36
35
  "eslint-plugin-node": "~11.1.0",
37
36
  "eslint-plugin-prettier": "~3.1.4",
@@ -53,10 +52,10 @@
53
52
  "prettier": "~2.1.2",
54
53
  "rollup": "^4.53.3",
55
54
  "sass": "~1.55.0",
56
- "typescript": "~4.7.4",
55
+ "typescript": "~5.9.3",
57
56
  "vue": "2.6.14",
58
- "vxe-pc-ui": "~3.14.15",
59
- "vxe-table": "~3.20.13"
57
+ "vxe-pc-ui": "~3.17.14",
58
+ "vxe-table": "~3.23.0"
60
59
  },
61
60
  "repository": {
62
61
  "type": "git",
package/src/index.ts CHANGED
@@ -227,10 +227,14 @@ function checkPrivilege (item: VxeTableDefines.MenuFirstOption | VxeTableDefines
227
227
  }
228
228
  case 'EDIT_CELL':
229
229
  case 'CLEAR_CELL':
230
+ case 'CLEAR_AREA_CELL':
230
231
  case 'CLEAR_ROW':
231
232
  case 'COPY_CELL':
233
+ case 'COPY_AREA_CELL':
232
234
  case 'CUT_CELL':
235
+ case 'CUT_AREA_CELL':
233
236
  case 'PASTE_CELL':
237
+ case 'PASTE_AREA_CELL':
234
238
  case 'MERGE_OR_CLEAR':
235
239
  case 'MERGE_CELL':
236
240
  case 'REVERT_CELL':
@@ -291,13 +295,17 @@ function checkPrivilege (item: VxeTableDefines.MenuFirstOption | VxeTableDefines
291
295
  break
292
296
  }
293
297
  case 'COPY_CELL':
298
+ case 'COPY_AREA_CELL':
294
299
  case 'CUT_CELL':
295
- case 'PASTE_CELL': {
300
+ case 'CUT_AREA_CELL':
301
+ case 'PASTE_CELL':
302
+ case 'PASTE_AREA_CELL': {
296
303
  const cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : []
297
304
  item.disabled = cellAreas.length > 1
298
305
  if (!item.disabled) {
299
306
  switch (code) {
300
- case 'PASTE_CELL': {
307
+ case 'PASTE_CELL':
308
+ case 'PASTE_AREA_CELL': {
301
309
  const clipboard = getClipboardObj()
302
310
  item.disabled = !clipboard || !clipboard.text
303
311
  break
@@ -517,6 +525,34 @@ export const VxeUIPluginMenu = {
517
525
  }
518
526
  }
519
527
  },
528
+ /**
529
+ * 清除单元格数据的值;如果启用 mouse-config.area 功能,则清除区域范围内的单元格数据
530
+ */
531
+ CLEAR_AREA_CELL: {
532
+ tableMenuMethod (params) {
533
+ const { $table, row, column } = params
534
+ if (row && column) {
535
+ const tableProps = $table
536
+ const { mouseConfig } = tableProps
537
+ const mouseOpts = $table.computeMouseOpts
538
+ if (mouseConfig && mouseOpts.area) {
539
+ const cellAreas = $table.getCellAreas()
540
+ if (cellAreas && cellAreas.length) {
541
+ cellAreas.forEach(areaItem => {
542
+ const { rows, cols } = areaItem
543
+ cols.forEach(column => {
544
+ rows.forEach(row => {
545
+ $table.clearData(row, column.field)
546
+ })
547
+ })
548
+ })
549
+ }
550
+ } else {
551
+ $table.clearData(row, column.field)
552
+ }
553
+ }
554
+ }
555
+ },
520
556
  /**
521
557
  * 清除行数据的值
522
558
  */
@@ -799,6 +835,14 @@ export const VxeUIPluginMenu = {
799
835
  handleCopyOrCut(params as VxeGlobalMenusHandles.TableMenuMethodParams & { $table: VxeTableConstructor & VxeTablePrivateMethods })
800
836
  }
801
837
  },
838
+ /**
839
+ * 复制单元格数据的值;用于 mouse-config.area 功能,复制区域范围内的单元格数据,支持 Excel 和 WPS
840
+ */
841
+ COPY_AREA_CELL: {
842
+ tableMenuMethod (params) {
843
+ handleCopyOrCut(params as VxeGlobalMenusHandles.TableMenuMethodParams & { $table: VxeTableConstructor & VxeTablePrivateMethods })
844
+ }
845
+ },
802
846
  /**
803
847
  * 剪贴单元格数据的值;如果启用 mouse-config.area 功能,则剪贴区域范围内的单元格数据,支持 Excel 和 WPS
804
848
  */
@@ -807,6 +851,14 @@ export const VxeUIPluginMenu = {
807
851
  handleCopyOrCut(params as VxeGlobalMenusHandles.TableMenuMethodParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }, true)
808
852
  }
809
853
  },
854
+ /**
855
+ * 剪贴单元格数据的值;用于 mouse-config.area 功能,剪贴区域范围内的单元格数据,支持 Excel 和 WPS
856
+ */
857
+ CUT_AREA_CELL: {
858
+ tableMenuMethod (params) {
859
+ handleCopyOrCut(params as VxeGlobalMenusHandles.TableMenuMethodParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }, true)
860
+ }
861
+ },
810
862
  /**
811
863
  * 粘贴从表格中被复制的数据;如果启用 mouse-config.area 功能,则粘贴区域范围内的单元格数据,不支持读取剪贴板
812
864
  */
@@ -827,6 +879,20 @@ export const VxeUIPluginMenu = {
827
879
  }
828
880
  }
829
881
  },
882
+ /**
883
+ * 粘贴从表格中被复制的数据;用于 mouse-config.area 功能,粘贴区域范围内的单元格数据,不支持读取剪贴板
884
+ */
885
+ PASTE_AREA_CELL: {
886
+ tableMenuMethod (params) {
887
+ const { $event, $table } = params as VxeGlobalMenusHandles.TableMenuMethodParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }
888
+ const tableProps = $table
889
+ const { mouseConfig } = tableProps
890
+ const mouseOpts = $table.computeMouseOpts
891
+ if (mouseConfig && mouseOpts.area) {
892
+ $table.triggerPasteCellAreaEvent($event)
893
+ }
894
+ }
895
+ },
830
896
  /**
831
897
  * 如果启用 mouse-config.area 功能,如果所选区域内已存在合并单元格,则取消临时合并,否则临时合并
832
898
  */