@vxe-ui/plugin-menu 4.3.4 → 4.4.0

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
@@ -21,11 +21,21 @@
21
21
  value: true
22
22
  });
23
23
  exports["default"] = exports.VxeUIPluginMenu = void 0;
24
+ exports.hasEnableConf = hasEnableConf;
24
25
  var _xeUtils = _interopRequireDefault(require$$0);
25
26
  var _vue = require$$1;
26
27
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
27
28
  var VxeUI;
28
29
  var handleCopy;
30
+ /**
31
+ * 用于开关类型的配置项
32
+ * 局部启用规则:conf={}
33
+ * 局部禁用规则:conf={enabled:false}
34
+ * 全局默认启用规则:conf.enabled=true
35
+ */
36
+ function hasEnableConf(conf, opts) {
37
+ return opts && (conf ? opts.enabled !== false : opts.enabled);
38
+ }
29
39
  var columnIndexOf = function columnIndexOf(cols, column) {
30
40
  return _xeUtils["default"].findIndexOf(cols, function (item) {
31
41
  return item.id === column.id;
@@ -106,7 +116,7 @@
106
116
  computeMouseOpts = _$table$getComputeMap.computeMouseOpts;
107
117
  var mouseOpts = computeMouseOpts.value;
108
118
  var text;
109
- if (mouseConfig && mouseOpts.area) {
119
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
110
120
  if (isCut) {
111
121
  $table.triggerCutCellAreaEvent($event);
112
122
  } else {
@@ -176,7 +186,7 @@
176
186
  visibleData = _$table$getTableData2.visibleData;
177
187
  var _$table$getTableColum2 = $table.getTableColumn(),
178
188
  visibleColumn = _$table$getTableColum2.visibleColumn;
179
- var cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
189
+ var cellAreas = hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area ? $table.getCellAreas() : [];
180
190
  var mergeList = $table.getMergeCells();
181
191
  return mergeList.filter(function (_ref) {
182
192
  var mergeRowIndex = _ref.row,
@@ -337,7 +347,7 @@
337
347
  case 'OPEN_FIND':
338
348
  case 'OPEN_REPLACE':
339
349
  {
340
- item.disabled = !(mouseConfig && mouseOpts.area);
350
+ item.disabled = !(hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area);
341
351
  break;
342
352
  }
343
353
  case 'EDIT_CELL':
@@ -352,7 +362,7 @@
352
362
  case 'PASTE_CELL':
353
363
  case 'PASTE_AREA_CELL':
354
364
  {
355
- var cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
365
+ var cellAreas = hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area ? $table.getCellAreas() : [];
356
366
  item.disabled = cellAreas.length > 1;
357
367
  if (!item.disabled) {
358
368
  switch (code) {
@@ -370,7 +380,7 @@
370
380
  case 'MERGE_OR_CLEAR':
371
381
  case 'MERGE_CELL':
372
382
  {
373
- var _cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
383
+ var _cellAreas = hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area ? $table.getCellAreas() : [];
374
384
  item.disabled = !_cellAreas.length || _cellAreas.length === 1 && _cellAreas[0].rows.length === 1 && _cellAreas[0].cols.length === 1 || !checkCellOverlay(params, _cellAreas);
375
385
  break;
376
386
  }
@@ -500,11 +510,11 @@
500
510
  var pVersion = 4;
501
511
  var sVersion = 11;
502
512
  if (!VxeUI.checkVersion(VxeUI.tableVersion, pVersion, sVersion)) {
503
- console.error("[@vxe-ui/plugin-menu 4.3.4] ".concat(VxeUI.getI18n('vxe.error.errorVersion', ["vxe-table@".concat(VxeUI.tableVersion || '?'), "vxe-table v".concat(pVersion, ".").concat(sVersion, "+")]), " https://vxeui.com/other4/#/plugin-menu/install"));
513
+ console.error("[@vxe-ui/plugin-menu 4.4.0] ".concat(VxeUI.getI18n('vxe.error.errorVersion', ["vxe-table@".concat(VxeUI.tableVersion || '?'), "vxe-table v".concat(pVersion, ".").concat(sVersion, "+")]), " https://vxeui.com/other4/#/plugin-menu/install"));
504
514
  }
505
515
  } else {
506
516
  if (!/^(4)\./.test(VxeUI.uiVersion || VxeUI.tableVersion)) {
507
- console.error('[@vxe-ui/plugin-menu 4.3.4] Requires vxe-table 4.7.0+ version. https://vxeui.com/other4/#/plugin-menu/install');
517
+ console.error('[@vxe-ui/plugin-menu 4.4.0] Requires vxe-table 4.7.0+ version. https://vxeui.com/other4/#/plugin-menu/install');
508
518
  }
509
519
  }
510
520
  pluginSetup(options);
@@ -553,7 +563,7 @@
553
563
  var _$table$getComputeMap4 = $table.getComputeMaps(),
554
564
  computeMouseOpts = _$table$getComputeMap4.computeMouseOpts;
555
565
  var mouseOpts = computeMouseOpts.value;
556
- if (mouseConfig && mouseOpts.area) {
566
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
557
567
  var cellAreas = $table.getCellAreas();
558
568
  if (cellAreas && cellAreas.length) {
559
569
  cellAreas.forEach(function (areaItem) {
@@ -586,7 +596,7 @@
586
596
  var _$table$getComputeMap5 = $table.getComputeMaps(),
587
597
  computeMouseOpts = _$table$getComputeMap5.computeMouseOpts;
588
598
  var mouseOpts = computeMouseOpts.value;
589
- if (mouseConfig && mouseOpts.area) {
599
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
590
600
  var cellAreas = $table.getCellAreas();
591
601
  if (cellAreas && cellAreas.length) {
592
602
  cellAreas.forEach(function (areaItem) {
@@ -637,8 +647,8 @@
637
647
  var _$table$getComputeMap6 = $table.getComputeMaps(),
638
648
  computeMouseOpts = _$table$getComputeMap6.computeMouseOpts;
639
649
  var mouseOpts = computeMouseOpts.value;
640
- if (mouseConfig && mouseOpts.area) {
641
- var cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
650
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
651
+ var cellAreas = mouseOpts.area ? $table.getCellAreas() : [];
642
652
  cellAreas.forEach(function (areaItem) {
643
653
  var rows = areaItem.rows;
644
654
  $table.clearData(rows);
@@ -670,7 +680,7 @@
670
680
  var _$table$getComputeMap7 = $table.getComputeMaps(),
671
681
  computeMouseOpts = _$table$getComputeMap7.computeMouseOpts;
672
682
  var mouseOpts = computeMouseOpts.value;
673
- if (mouseConfig && mouseOpts.area) {
683
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
674
684
  var _$table$getTableData4 = $table.getTableData(),
675
685
  visibleData = _$table$getTableData4.visibleData;
676
686
  var _$table$getTableColum4 = $table.getTableColumn(),
@@ -697,7 +707,7 @@
697
707
  var _$table$getComputeMap8 = $table.getComputeMaps(),
698
708
  computeMouseOpts = _$table$getComputeMap8.computeMouseOpts;
699
709
  var mouseOpts = computeMouseOpts.value;
700
- if (row && column && mouseConfig && mouseOpts.area) {
710
+ if (row && column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
701
711
  var _$table$getTableColum5 = $table.getTableColumn(),
702
712
  visibleColumn = _$table$getTableColum5.visibleColumn;
703
713
  var cellAreas = $table.getCellAreas();
@@ -739,7 +749,7 @@
739
749
  var _$table$getComputeMap9 = $table.getComputeMaps(),
740
750
  computeMouseOpts = _$table$getComputeMap9.computeMouseOpts;
741
751
  var mouseOpts = computeMouseOpts.value;
742
- if (row && column && mouseConfig && mouseOpts.area) {
752
+ if (row && column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
743
753
  var _$table$getTableColum6 = $table.getTableColumn(),
744
754
  visibleColumn = _$table$getTableColum6.visibleColumn;
745
755
  var cellAreas = $table.getCellAreas();
@@ -781,7 +791,7 @@
781
791
  var _$table$getComputeMap0 = $table.getComputeMaps(),
782
792
  computeMouseOpts = _$table$getComputeMap0.computeMouseOpts;
783
793
  var mouseOpts = computeMouseOpts.value;
784
- if (row && column && mouseConfig && mouseOpts.area) {
794
+ if (row && column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
785
795
  var _$table$getTableData5 = $table.getTableData(),
786
796
  visibleData = _$table$getTableData5.visibleData;
787
797
  var cellAreas = $table.getCellAreas();
@@ -823,7 +833,7 @@
823
833
  var _$table$getComputeMap1 = $table.getComputeMaps(),
824
834
  computeMouseOpts = _$table$getComputeMap1.computeMouseOpts;
825
835
  var mouseOpts = computeMouseOpts.value;
826
- if (row && column && mouseConfig && mouseOpts.area) {
836
+ if (row && column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
827
837
  var _$table$getTableData6 = $table.getTableData(),
828
838
  visibleData = _$table$getTableData6.visibleData;
829
839
  var cellAreas = $table.getCellAreas();
@@ -866,7 +876,7 @@
866
876
  var _$table$getComputeMap10 = $table.getComputeMaps(),
867
877
  computeMouseOpts = _$table$getComputeMap10.computeMouseOpts;
868
878
  var mouseOpts = computeMouseOpts.value;
869
- if (mouseConfig && mouseOpts.area) {
879
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
870
880
  var cellAreas = $table.getCellAreas();
871
881
  if (cellAreas && cellAreas.length) {
872
882
  cellAreas.forEach(function (areaItem) {
@@ -978,7 +988,7 @@
978
988
  var _$table$getComputeMap11 = $table.getComputeMaps(),
979
989
  computeMouseOpts = _$table$getComputeMap11.computeMouseOpts;
980
990
  var mouseOpts = computeMouseOpts.value;
981
- if (mouseConfig && mouseOpts.area) {
991
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
982
992
  $table.triggerPasteCellAreaEvent($event);
983
993
  } else {
984
994
  var clipboard = getClipboardObj();
@@ -1001,7 +1011,7 @@
1001
1011
  var _$table$getComputeMap12 = $table.getComputeMaps(),
1002
1012
  computeMouseOpts = _$table$getComputeMap12.computeMouseOpts;
1003
1013
  var mouseOpts = computeMouseOpts.value;
1004
- if (mouseConfig && mouseOpts.area) {
1014
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1005
1015
  $table.triggerPasteCellAreaEvent($event);
1006
1016
  }
1007
1017
  }
@@ -1174,7 +1184,7 @@
1174
1184
  var mouseOpts = computeMouseOpts.value;
1175
1185
  $table.insert(menu.params || {}).then(function (_ref7) {
1176
1186
  var rows = _ref7.rows;
1177
- if (column && mouseConfig && mouseOpts.area) {
1187
+ if (column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1178
1188
  $table.setCellAreas([{
1179
1189
  startRow: _xeUtils["default"].first(rows),
1180
1190
  endRow: _xeUtils["default"].last(rows),
@@ -1201,7 +1211,7 @@
1201
1211
  var mouseOpts = computeMouseOpts.value;
1202
1212
  (row ? $table.insertAt(menu.params || {}, row) : $table.insert(menu.params || {})).then(function (_ref8) {
1203
1213
  var rows = _ref8.rows;
1204
- if (column && mouseConfig && mouseOpts.area) {
1214
+ if (column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1205
1215
  $table.setCellAreas([{
1206
1216
  startRow: _xeUtils["default"].first(rows),
1207
1217
  endRow: _xeUtils["default"].last(rows),
@@ -1234,7 +1244,7 @@
1234
1244
  });
1235
1245
  (row ? $table.insertAt(records, row) : $table.insert(records)).then(function (_ref0) {
1236
1246
  var rows = _ref0.rows;
1237
- if (column && mouseConfig && mouseOpts.area) {
1247
+ if (column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1238
1248
  $table.setCellAreas([{
1239
1249
  startRow: _xeUtils["default"].first(rows),
1240
1250
  endRow: _xeUtils["default"].last(rows),
@@ -1263,7 +1273,7 @@
1263
1273
  var mouseOpts = computeMouseOpts.value;
1264
1274
  (row ? $table.insertNextAt(menu.params || {}, row) : $table.insert(menu.params || {})).then(function (_ref1) {
1265
1275
  var rows = _ref1.rows;
1266
- if (column && mouseConfig && mouseOpts.area) {
1276
+ if (column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1267
1277
  $table.setCellAreas([{
1268
1278
  startRow: _xeUtils["default"].first(rows),
1269
1279
  endRow: _xeUtils["default"].last(rows),
@@ -1296,7 +1306,7 @@
1296
1306
  });
1297
1307
  (row ? $table.insertNextAt(records, row) : $table.insert(records)).then(function (_ref11) {
1298
1308
  var rows = _ref11.rows;
1299
- if (column && mouseConfig && mouseOpts.area) {
1309
+ if (column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1300
1310
  $table.setCellAreas([{
1301
1311
  startRow: _xeUtils["default"].first(rows),
1302
1312
  endRow: _xeUtils["default"].last(rows),
@@ -1501,7 +1511,7 @@
1501
1511
  var _$table$getComputeMap18 = $table.getComputeMaps(),
1502
1512
  computeMouseOpts = _$table$getComputeMap18.computeMouseOpts;
1503
1513
  var mouseOpts = computeMouseOpts.value;
1504
- if (mouseConfig && mouseOpts.area) {
1514
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1505
1515
  var cellAreas = $table.getCellAreas();
1506
1516
  cellAreas.forEach(function (areaItem) {
1507
1517
  var rows = areaItem.rows;
@@ -1 +1 @@
1
- ((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("xe-utils"),require("vue")):"function"==typeof define&&define.amd?define(["xe-utils","vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VxeUIPluginMenu=t(e.XEUtils,e.Vue)})(this,function(e,t){function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,u,i,c,o,l,_,R,r={};function s(a){return{tableMenuMethod:function(e){var t=e.$table;c.default.eachTree([e.column],function(e){e.fixed=a}),t.refreshColumn()}}}function b(){var e=u.globalStore;return e?e.clipboard||"":(e=u.config)&&e.clipboard?e.clipboard:null}function d(e){var t,a;try{t=e,l||((l=document.createElement("textarea")).id="$XECopy",(a=l.style).width="48px",a.height="24px",a.position="fixed",a.zIndex="0",a.left="-500px",a.top="-500px",document.body.appendChild(l)),l.value=null==t?"":""+t,l.select(),l.setSelectionRange(0,l.value.length),document.execCommand("copy"),l.blur()}catch(e){}}function E(e,t){var a,n,o,l=e.$event,r=e.$table,s=e.row,e=e.column;s&&e&&(a=r.props.mouseConfig,o=r.getComputeMaps().computeMouseOpts.value,a&&o.area?(t?r.triggerCutCellAreaEvent(l):r.triggerCopyCellAreaEvent(l),n=(a=b())?a.text:""):(n=c.default.toValueString(c.default.get(s,e.field)),o={text:n,html:""},(t=u.globalStore)?t.clipboard=o:u.config&&(u.config.clipboard=o)),(c.default.isFunction(i)?i:d)(n))}function C(t){return function(e){e=e.$grid;e&&e.commitProxy(t)}}function p(e){var u=e.$table,e=u.props.mouseConfig,t=u.getComputeMaps().computeMouseOpts.value,i=u.getTableData().visibleData,c=u.getTableColumn().visibleColumn,a=e&&t.area?u.getCellAreas():[];return u.getMergeCells().filter(function(e){var o=e.row,l=e.col,r=e.rowspan,s=e.colspan;return a.some(function(e){var t=e.rows,e=e.cols,a=R(u,i,t[0]),t=R(u,i,t[t.length-1]),n=_(c,e[0]),e=_(c,e[e.length-1]);return a<=o&&o+r-1<=t&&n<=l&&l+s-1<=e})})}function f(e){var t=e.$table,e=p(e);return e.length&&t.removeMergeCells(e),e}function M(e,t){var a=e.code,n=t.$table,o=t.$grid,l=t.row,r=t.column,s=t.type,u=n.props,i=u.editConfig,c=u.mouseConfig;switch(a){case"CLEAR_ALL_SORT":var d=n.getSortColumns();e.disabled=!d.length;break;case"CLEAR_ALL_FILTER":d=n.getCheckedFilters();e.disabled=!d.length;break;case"CLEAR_ALL_MERGE":var d=n.getMergeCells(),E=n.getMergeFooterItems();e.disabled=!d.length&&!E.length;break;case"CLEAR_MERGE_CELL":d=p(t);e.disabled=!d.length;break;case"COPY_TITLE":e.disabled=!r||"header"!==s;break;case"SELECT_ALL_AREA":E=n.getTableData().visibleData,d=n.getTableColumn().visibleColumn;e.disabled=!E.length||!d.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||!l;break;case"DELETE_CHECKBOX_ROW":E=n.getCheckboxRecords();e.disabled=!E.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 C=n.getComputeMaps().computeMouseOpts.value,f=!!r.parentId;switch(a){case"CLEAR_SORT":e.disabled=!r.sortable||!r.order;break;case"SORT_ASC":case"SORT_DESC":e.disabled=!r.sortable;break;case"FILTER_CELL":case"CLEAR_FILTER":e.disabled=!r.filters||!r.filters.length,e.disabled||"CLEAR_FILTER"===a&&(e.disabled=!r.filters.some(function(e){return e.checked}));break;case"REVERT_CELL":e.disabled=!l||!r.field||!n.isUpdateByRow(l,r.field);break;case"REVERT_ROW":e.disabled=!l||!r.field||!n.isUpdateByRow(l);break;case"OPEN_FIND":case"OPEN_REPLACE":e.disabled=!(c&&C.area);break;case"EDIT_CELL":e.disabled=!i||!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 M=c&&C.area?n.getCellAreas():[];if(e.disabled=1<M.length,!e.disabled)switch(a){case"PASTE_CELL":case"PASTE_AREA_CELL":var m=b();e.disabled=!m||!m.text}break;case"MERGE_OR_CLEAR":case"MERGE_CELL":M=c&&C.area?n.getCellAreas():[];e.disabled=!M.length||1===M.length&&1===M[0].rows.length&&1===M[0].cols.length||!((e,t)=>{for(var a=e.$table,n=a.getTableData().visibleData,o=a.getTableColumn().visibleColumn,l={},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 C=i[d],f=R(a,n,C),M=0,m=c.length;M<m;M++){var b=c[M],b=f+":"+_(o,b);if(l[b])return;l[b]=!0}return 1})(t,M);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=!o}}function m(t){return t.options.forEach(function(e){e.forEach(function(e){M(e,t),e.children&&e.children.forEach(function(e){M(e,t)})})}),!0}function g(){return new Promise(function(t){var e,a;u.modal?(e=u.getComponent("VxeNumberInput"))?(a=(0,o.ref)(1),u.modal.alert({title:"请输入行数",width:220,maskClosable:!1,slots:{default:function(){return(0,o.h)(e,{modelValue:a.value,min:1,max:100,type:"integer",align:"center",controlConfig:{layout:"default"},style:{width:"100%"},"onUpdate:modelValue":function(e){a.value=e}})}}}).then(function(e){t("confirm"===e?{size:a.value||1}:{size:0})})):(console.error(u.getI18n("vxe.error.reqComp",["vxe-number-input"])),t({size:0})):t({size:0})})}function h(){location.reload()}function v(){history.forward()}function L(){history.back()}function A(e){e&&e.copy&&(i=e.copy)}return n||(n=1,n=r,Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.VxeUIPluginMenu=void 0,c=(e=e)&&e.__esModule?e:{default:e},o=t,_=function(e,t){return c.default.findIndexOf(e,function(e){return e.id===t.id})},R=function(e,t,a){return e.findRowIndexOf(t,a)},e=n.VxeUIPluginMenu={setConfig:A,install:function(e,t){(u=e).checkVersion?u.checkVersion(u.tableVersion,4,11)||console.error("[@vxe-ui/plugin-menu 4.3.4] ".concat(u.getI18n("vxe.error.errorVersion",["vxe-table@".concat(u.tableVersion||"?"),"vxe-table v".concat(4,".").concat(11,"+")])," https://vxeui.com/other4/#/plugin-menu/install")):/^(4)\./.test(u.uiVersion||u.tableVersion)||console.error("[@vxe-ui/plugin-menu 4.3.4] Requires vxe-table 4.7.0+ version. https://vxeui.com/other4/#/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:v,treeMenuMethod:v,calendarMenuMethod:v,menuMenuMethod:v,formDesignMenuMethod:v},SYSTEM_PAGE_BACK:{tableMenuMethod:L,treeMenuMethod:L,calendarMenuMethod:L,menuMenuMethod:L,formDesignMenuMethod:L},CLEAR_CELL:{tableMenuMethod:function(e){var t,a,n=e.$table,o=e.row,e=e.column;o&&e&&(a=n.props.mouseConfig,t=n.getComputeMaps().computeMouseOpts.value,a&&t.area?(a=n.getCellAreas())&&a.length&&a.forEach(function(e){var a=e.rows;e.cols.forEach(function(t){a.forEach(function(e){n.clearData(e,t.field)})})}):n.clearData(o,e.field))}},CLEAR_AREA_CELL:{tableMenuMethod:function(e){var t,n=e.$table;e.row&&e.column&&(e=n.props.mouseConfig,t=n.getComputeMaps().computeMouseOpts.value,e)&&t.area&&(e=n.getCellAreas())&&e.length&&e.forEach(function(e){var a=e.rows;e.cols.forEach(function(t){a.forEach(function(e){n.clearData(e,t.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 t=e.$table,a=e.row,e=e.column,n=t.props.mouseConfig,o=t.getComputeMaps().computeMouseOpts.value;n&&o.area?(n&&o.area?t.getCellAreas():[]).forEach(function(e){e=e.rows;t.clearData(e)}):a&&e&&t.clearData(a)}},CLEAR_ALL:{tableMenuMethod:function(e){e.$table.clearData()}},SELECT_ALL_AREA:{tableMenuMethod:function(e){var e=e.$table,t=e.props.mouseConfig,a=e.getComputeMaps().computeMouseOpts.value;t&&a.area&&(t=e.getTableData().visibleData,a=e.getTableColumn().visibleColumn,e.setCellAreas([{startRow:c.default.first(t),endRow:c.default.last(t),startColumn:c.default.first(a),endColumn:c.default.last(a)}]))}},SELECT_AREA_TO_LEFT:{tableMenuMethod:function(e){var t=e.$table,a=e.row,e=e.column,n=t.props.mouseConfig,o=t.getComputeMaps().computeMouseOpts.value;a&&e&&n&&o.area&&(n=t.getTableColumn().visibleColumn,1===(o=t.getCellAreas()).length?(o=o[0],t.setCellAreas([{startRow:c.default.first(o.rows),endRow:c.default.last(o.rows),startColumn:c.default.first(n),endColumn:c.default.last(o.cols)}],{column:e,row:a})):t.setCellAreas([{startRow:a,endRow:a,startColumn:c.default.first(n),endColumn:e}],{column:e,row:a}))}},SELECT_AREA_TO_RIGHT:{tableMenuMethod:function(e){var t=e.$table,a=e.row,e=e.column,n=t.props.mouseConfig,o=t.getComputeMaps().computeMouseOpts.value;a&&e&&n&&o.area&&(n=t.getTableColumn().visibleColumn,1===(o=t.getCellAreas()).length?(o=o[0],t.setCellAreas([{startRow:c.default.first(o.rows),endRow:c.default.last(o.rows),startColumn:c.default.first(o.cols),endColumn:c.default.last(n)}],{column:e,row:a})):t.setCellAreas([{startRow:a,endRow:a,startColumn:e,endColumn:c.default.last(n)}],{column:e,row:a}))}},SELECT_AREA_TO_TOP:{tableMenuMethod:function(e){var t=e.$table,a=e.row,e=e.column,n=t.props.mouseConfig,o=t.getComputeMaps().computeMouseOpts.value;a&&e&&n&&o.area&&(n=t.getTableData().visibleData,1===(o=t.getCellAreas()).length?(o=o[0],t.setCellAreas([{startRow:c.default.first(n),endRow:c.default.last(o.rows),startColumn:c.default.first(o.cols),endColumn:c.default.last(o.cols)}],{column:e,row:a})):t.setCellAreas([{startRow:c.default.first(n),endRow:a,startColumn:e,endColumn:e}],{column:e,row:a}))}},SELECT_AREA_TO_BOTTON:{tableMenuMethod:function(e){var t=e.$table,a=e.row,e=e.column,n=t.props.mouseConfig,o=t.getComputeMaps().computeMouseOpts.value;a&&e&&n&&o.area&&(n=t.getTableData().visibleData,1===(o=t.getCellAreas()).length?(o=o[0],t.setCellAreas([{startRow:c.default.first(o.rows),endRow:c.default.last(n),startColumn:c.default.first(o.cols),endColumn:c.default.last(o.cols)}],{column:e,row:a})):t.setCellAreas([{startRow:a,endRow:c.default.last(n),startColumn:e,endColumn:e}],{column:e,row:a}))}},REVERT_CELL:{tableMenuMethod:function(e){var t,a,n=e.$table,o=e.row,e=e.column;o&&e&&(a=n.props.mouseConfig,t=n.getComputeMaps().computeMouseOpts.value,a&&t.area?(a=n.getCellAreas())&&a.length&&a.forEach(function(e){var a=e.rows;e.cols.forEach(function(t){a.forEach(function(e){n.revertData(e,t.field)})})}):n.revertData(o,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){E(e)}},COPY_AREA_CELL:{tableMenuMethod:function(e){E(e)}},CUT_CELL:{tableMenuMethod:function(e){E(e,!0)}},CUT_AREA_CELL:{tableMenuMethod:function(e){E(e,!0)}},PASTE_CELL:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,n=e.row,e=e.column,o=a.props.mouseConfig,l=a.getComputeMaps().computeMouseOpts.value;o&&l.area?a.triggerPasteCellAreaEvent(t):(o=b())&&o.text&&c.default.set(n,e.field,o.text)}},PASTE_AREA_CELL:{tableMenuMethod:function(e){var t=e.$event,e=e.$table,a=e.props.mouseConfig,n=e.getComputeMaps().computeMouseOpts.value;a&&n.area&&e.triggerPasteCellAreaEvent(t)}},MERGE_OR_CLEAR:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,n=a.getCellAreas(),e=p(e),o=!1,e=(e.length?a.removeMergeCells(e):(o=!0,a.setMergeCells(n.map(function(e){var t=e.rows,e=e.cols;return{row:t[0],col:e[0],rowspan:t.length,colspan:e.length}}))),n.map(function(e){return{rows:e.rows,cols:e.cols}}));a.dispatchEvent("cell-area-merge",{status:o,targetAreas:e},t)}},MERGE_CELL:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,n=a.getTableData().visibleData,o=a.getTableColumn().visibleColumn,l=a.getCellAreas();f(e),l.some(function(e){return e.rows.length===n.length||e.cols.length===o.length})?u.modal&&u.modal.message({content:u.getI18n("vxe.pro.area.mergeErr"),status:"error",id:"operErr"}):(a.setMergeCells(l.map(function(e){var t=e.rows,e=e.cols;return{row:t[0],col:e[0],rowspan:t.length,colspan:e.length}})),e=l.map(function(e){return{rows:e.rows,cols:e.cols}}),a.dispatchEvent("cell-area-merge",{status:!0,targetAreas:e},t))}},CLEAR_MERGE_CELL:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,e=f(e);e.length&&a.dispatchEvent("clear-cell-area-merge",{mergeCells:e},t)}},CLEAR_ALL_MERGE:{tableMenuMethod:function(e){var t=e.$event,e=e.$table,a=e.getMergeCells(),n=e.getMergeFooterItems();e.clearMergeCells(),e.clearMergeFooterItems(),e.dispatchEvent("clear-merge",{mergeCells:a,mergeFooterItems:n},t)}},EDIT_CELL:{tableMenuMethod:function(e){var t=e.$table,a=e.row,e=e.column;t.setEditCell?t.setEditCell(a,e):t.setActiveCell(a,e.field)}},EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.row;t.setEditRow?t.setEditRow(e):t.setActiveRow(e)}},INSERT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.menu,n=e.column,o=t.props.mouseConfig,l=t.getComputeMaps().computeMouseOpts.value;t.insert(a.params||{}).then(function(e){e=e.rows;n&&o&&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,a=e.menu,n=e.row,o=e.column,l=t.props.mouseConfig,r=t.getComputeMaps().computeMouseOpts.value;(n?t.insertAt(a.params||{},n):t.insert(a.params||{})).then(function(e){e=e.rows;o&&l&&r.area&&t.setCellAreas([{startRow:c.default.first(e),endRow:c.default.last(e),startColumn:o,endColumn:o}])})}},BATCH_INSERT_AT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.menu,n=e.row,o=e.column,l=t.props.mouseConfig,r=t.getComputeMaps().computeMouseOpts.value;g().then(function(e){var e=e.size;e&&(e=c.default.range(0,e).map(function(){return Object.assign({},a.params)}),(n?t.insertAt(e,n):t.insert(e)).then(function(e){e=e.rows;o&&l&&r.area&&t.setCellAreas([{startRow:c.default.first(e),endRow:c.default.last(e),startColumn:o,endColumn:o}])}))})}},INSERT_NEXT_AT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.menu,n=e.row,o=e.column,l=t.props.mouseConfig,r=t.getComputeMaps().computeMouseOpts.value;(n?t.insertNextAt(a.params||{},n):t.insert(a.params||{})).then(function(e){e=e.rows;o&&l&&r.area&&t.setCellAreas([{startRow:c.default.first(e),endRow:c.default.last(e),startColumn:o,endColumn:o}])})}},BATCH_INSERT_NEXT_AT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.menu,n=e.row,o=e.column,l=t.props.mouseConfig,r=t.getComputeMaps().computeMouseOpts.value;g().then(function(e){var e=e.size;e&&(e=c.default.range(0,e).map(function(){return Object.assign({},a.params)}),(n?t.insertNextAt(e,n):t.insert(e)).then(function(e){e=e.rows;o&&l&&r.area&&t.setCellAreas([{startRow:c.default.first(e),endRow:c.default.last(e),startColumn:o,endColumn:o}])}))})}},INSERT_ACTIVED_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.column,n=e.menu.params||[],e=Object.assign({},n[0]||{});t.insert(e).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,n[1]||a):t.setActiveCell(e,n[1]||a.field)})}},INSERT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.column,n=e.menu.params||[],e=Object.assign({},n[0]||{});t.insert(e).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,n[1]||a):t.setActiveCell(e,n[1]||a.field)})}},INSERT_AT_ACTIVED_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.row,n=e.column,o=e.menu.params||[],e=Object.assign({},o[0]||{});(a?t.insertAt(e,a):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,o[1]||n):t.setActiveCell(e,o[1]||n.field)})}},INSERT_AT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.row,n=e.column,o=e.menu.params||[],e=Object.assign({},o[0]||{});(a?t.insertAt(e,a):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,o[1]||n):t.setActiveCell(e,o[1]||n.field)})}},BATCH_INSERT_AT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.row,n=e.column,o=e.menu.params||[];g().then(function(e){var e=e.size;e&&(e=c.default.range(0,e).map(function(){return Object.assign({},o[0])}),(a?t.insertAt(e,a):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,o[1]||n):t.setActiveCell(e,o[1]||n.field)}))})}},INSERT_NEXT_AT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.row,n=e.column,o=e.menu.params||[],e=Object.assign({},o[0]||{});(a?t.insertNextAt(e,a):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,o[1]||n):t.setActiveCell(e,o[1]||n.field)})}},BATCH_INSERT_NEXT_AT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.row,n=e.column,o=e.menu.params||[];g().then(function(e){var e=e.size;e&&(e=c.default.range(0,e).map(function(){return Object.assign({},o[0])}),(a?t.insertNextAt(e,a):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,o[1]||n):t.setActiveCell(e,o[1]||n.field)}))})}},DELETE_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.row;e&&t.remove(e)}},DELETE_AREA_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.row,a=t.props.mouseConfig,n=t.getComputeMaps().computeMouseOpts.value;a&&n.area?t.getCellAreas().forEach(function(e){e=e.rows;t.remove(e)}):e&&t.remove(e)}},DELETE_CHECKBOX_ROW:{tableMenuMethod:function(e){e.$table.removeCheckboxRow()}},DELETE_ALL:{tableMenuMethod:function(e){e.$table.remove()}},CLEAR_SORT:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,e=e.column;e&&a.triggerSortEvent(t,e,null)}},CLEAR_ALL_SORT:{tableMenuMethod:function(e){var t=e.$event,e=e.$table,a=e.getSortColumns();a.length&&(e.clearSort(),e.dispatchEvent("clear-sort",{sortList:a},t))}},SORT_ASC:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,e=e.column;e&&a.triggerSortEvent(t,e,"asc")}},SORT_DESC:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,e=e.column;e&&a.triggerSortEvent(t,e,"desc")}},CLEAR_FILTER:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,e=e.column;e&&(a.handleClearFilter(e),a.confirmFilterEvent(t))}},CLEAR_ALL_FILTER:{tableMenuMethod:function(e){var t=e.$event,e=e.$table,a=e.getCheckedFilters();a.length&&(e.clearFilter(),e.dispatchEvent("clear-filter",{filterList:a},t))}},FILTER_CELL:{tableMenuMethod:function(e){var t,a=e.$table,n=e.row,e=e.column;n&&e&&(t=e.field,(e=e.filters).length)&&((e=e[0]).data=c.default.get(n,t),e.checked=!0,a.updateData())}},EXPORT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.menu,e=e.row;e&&t.exportData(c.default.assign({},a.params?a.params[0]:{},{data:[e]}))}},EXPORT_CHECKBOX_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.menu,a={data:t.getCheckboxRecords()};t.exportData(c.default.assign({},e.params?e.params[0]:{},a))}},EXPORT_ALL:{tableMenuMethod:function(e){e.$table.exportData(e.menu.params)}},PRINT_ALL:{tableMenuMethod:function(e){e.$table.print(e.menu.params)}},PRINT_CHECKBOX_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.menu,a={data:t.getCheckboxRecords()};t.print(c.default.assign(a,e.params))}},OPEN_FIND:{tableMenuMethod:function(e){var t=e.$event,e=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:s("left"),FIXED_RIGHT_COLUMN:s("right"),CLEAR_FIXED_COLUMN:s(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:C("initial")},COMMIT_PROXY_QUERY:{tableMenuMethod:C("query")},COMMIT_PROXY_RELOAD:{tableMenuMethod:C("reload")},COMMIT_PROXY_DELETE:{tableMenuMethod:C("delete")},COMMIT_PROXY_SAVE:{tableMenuMethod:C("save")}}),u.interceptor.add("event.showMenu",m)}},"undefined"!=typeof window&&window.VxeUI&&window.VxeUI.use&&window.VxeUI.use(e),n.default=e),a(r)});
1
+ ((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("xe-utils"),require("vue")):"function"==typeof define&&define.amd?define(["xe-utils","vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VxeUIPluginMenu=t(e.XEUtils,e.Vue)})(this,function(e,t){function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,s,u,i,o,l,_,R,r={};function b(e,t){return t&&(e?!1!==t.enabled:t.enabled)}function c(a){return{tableMenuMethod:function(e){var t=e.$table;i.default.eachTree([e.column],function(e){e.fixed=a}),t.refreshColumn()}}}function p(){var e=s.globalStore;return e?e.clipboard||"":(e=s.config)&&e.clipboard?e.clipboard:null}function d(e){var t,a;try{t=e,l||((l=document.createElement("textarea")).id="$XECopy",(a=l.style).width="48px",a.height="24px",a.position="fixed",a.zIndex="0",a.left="-500px",a.top="-500px",document.body.appendChild(l)),l.value=null==t?"":""+t,l.select(),l.setSelectionRange(0,l.value.length),document.execCommand("copy"),l.blur()}catch(e){}}function E(e,t){var a,n,o=e.$event,l=e.$table,r=e.row,e=e.column;r&&e&&(b(l.props.mouseConfig,a=l.getComputeMaps().computeMouseOpts.value)&&a.area?(t?l.triggerCutCellAreaEvent(o):l.triggerCopyCellAreaEvent(o),n=(a=p())?a.text:""):(n=i.default.toValueString(i.default.get(r,e.field)),t={text:n,html:""},(l=s.globalStore)?l.clipboard=t:s.config&&(s.config.clipboard=t)),(i.default.isFunction(u)?u:d)(n))}function C(t){return function(e){e=e.$grid;e&&e.commitProxy(t)}}function g(e){var u=e.$table,e=u.props.mouseConfig,t=u.getComputeMaps().computeMouseOpts.value,i=u.getTableData().visibleData,c=u.getTableColumn().visibleColumn,a=b(e,t)&&t.area?u.getCellAreas():[];return u.getMergeCells().filter(function(e){var o=e.row,l=e.col,r=e.rowspan,s=e.colspan;return a.some(function(e){var t=e.rows,e=e.cols,a=R(u,i,t[0]),t=R(u,i,t[t.length-1]),n=_(c,e[0]),e=_(c,e[e.length-1]);return a<=o&&o+r-1<=t&&n<=l&&l+s-1<=e})})}function f(e){var t=e.$table,e=g(e);return e.length&&t.removeMergeCells(e),e}function M(e,t){var a=e.code,n=t.$table,o=t.$grid,l=t.row,r=t.column,s=t.type,u=n.props,i=u.editConfig,c=u.mouseConfig;switch(a){case"CLEAR_ALL_SORT":var d=n.getSortColumns();e.disabled=!d.length;break;case"CLEAR_ALL_FILTER":d=n.getCheckedFilters();e.disabled=!d.length;break;case"CLEAR_ALL_MERGE":var d=n.getMergeCells(),E=n.getMergeFooterItems();e.disabled=!d.length&&!E.length;break;case"CLEAR_MERGE_CELL":d=g(t);e.disabled=!d.length;break;case"COPY_TITLE":e.disabled=!r||"header"!==s;break;case"SELECT_ALL_AREA":E=n.getTableData().visibleData,d=n.getTableColumn().visibleColumn;e.disabled=!E.length||!d.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||!l;break;case"DELETE_CHECKBOX_ROW":E=n.getCheckboxRecords();e.disabled=!E.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 C=n.getComputeMaps().computeMouseOpts.value,f=!!r.parentId;switch(a){case"CLEAR_SORT":e.disabled=!r.sortable||!r.order;break;case"SORT_ASC":case"SORT_DESC":e.disabled=!r.sortable;break;case"FILTER_CELL":case"CLEAR_FILTER":e.disabled=!r.filters||!r.filters.length,e.disabled||"CLEAR_FILTER"===a&&(e.disabled=!r.filters.some(function(e){return e.checked}));break;case"REVERT_CELL":e.disabled=!l||!r.field||!n.isUpdateByRow(l,r.field);break;case"REVERT_ROW":e.disabled=!l||!r.field||!n.isUpdateByRow(l);break;case"OPEN_FIND":case"OPEN_REPLACE":e.disabled=!(b(c,C)&&C.area);break;case"EDIT_CELL":e.disabled=!i||!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 M=b(c,C)&&C.area?n.getCellAreas():[];if(e.disabled=1<M.length,!e.disabled)switch(a){case"PASTE_CELL":case"PASTE_AREA_CELL":var m=p();e.disabled=!m||!m.text}break;case"MERGE_OR_CLEAR":case"MERGE_CELL":M=b(c,C)&&C.area?n.getCellAreas():[];e.disabled=!M.length||1===M.length&&1===M[0].rows.length&&1===M[0].cols.length||!((e,t)=>{for(var a=e.$table,n=a.getTableData().visibleData,o=a.getTableColumn().visibleColumn,l={},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 C=i[d],f=R(a,n,C),M=0,m=c.length;M<m;M++){var b=c[M],b=f+":"+_(o,b);if(l[b])return;l[b]=!0}return 1})(t,M);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=!o}}function m(t){return t.options.forEach(function(e){e.forEach(function(e){M(e,t),e.children&&e.children.forEach(function(e){M(e,t)})})}),!0}function h(){return new Promise(function(t){var e,a;s.modal?(e=s.getComponent("VxeNumberInput"))?(a=(0,o.ref)(1),s.modal.alert({title:"请输入行数",width:220,maskClosable:!1,slots:{default:function(){return(0,o.h)(e,{modelValue:a.value,min:1,max:100,type:"integer",align:"center",controlConfig:{layout:"default"},style:{width:"100%"},"onUpdate:modelValue":function(e){a.value=e}})}}}).then(function(e){t("confirm"===e?{size:a.value||1}:{size:0})})):(console.error(s.getI18n("vxe.error.reqComp",["vxe-number-input"])),t({size:0})):t({size:0})})}function v(){location.reload()}function L(){history.forward()}function A(){history.back()}function T(e){e&&e.copy&&(u=e.copy)}return n||(n=1,n=r,Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.VxeUIPluginMenu=void 0,n.hasEnableConf=b,i=(e=e)&&e.__esModule?e:{default:e},o=t,_=function(e,t){return i.default.findIndexOf(e,function(e){return e.id===t.id})},R=function(e,t,a){return e.findRowIndexOf(t,a)},e=n.VxeUIPluginMenu={setConfig:T,install:function(e,t){(s=e).checkVersion?s.checkVersion(s.tableVersion,4,11)||console.error("[@vxe-ui/plugin-menu 4.4.0] ".concat(s.getI18n("vxe.error.errorVersion",["vxe-table@".concat(s.tableVersion||"?"),"vxe-table v".concat(4,".").concat(11,"+")])," https://vxeui.com/other4/#/plugin-menu/install")):/^(4)\./.test(s.uiVersion||s.tableVersion)||console.error("[@vxe-ui/plugin-menu 4.4.0] Requires vxe-table 4.7.0+ version. https://vxeui.com/other4/#/plugin-menu/install"),T(t),s.menus.mixin({SYSTEM_PAGE_REFRESH:{tableMenuMethod:v,treeMenuMethod:v,calendarMenuMethod:v,menuMenuMethod:v,formDesignMenuMethod:v},SYSTEM_PAGE_FORWARD:{tableMenuMethod:L,treeMenuMethod:L,calendarMenuMethod:L,menuMenuMethod:L,formDesignMenuMethod:L},SYSTEM_PAGE_BACK:{tableMenuMethod:A,treeMenuMethod:A,calendarMenuMethod:A,menuMenuMethod:A,formDesignMenuMethod:A},CLEAR_CELL:{tableMenuMethod:function(e){var t,n=e.$table,a=e.row,e=e.column;a&&e&&(b(n.props.mouseConfig,t=n.getComputeMaps().computeMouseOpts.value)&&t.area?(t=n.getCellAreas())&&t.length&&t.forEach(function(e){var a=e.rows;e.cols.forEach(function(t){a.forEach(function(e){n.clearData(e,t.field)})})}):n.clearData(a,e.field))}},CLEAR_AREA_CELL:{tableMenuMethod:function(e){var n=e.$table;e.row&&e.column&&b(n.props.mouseConfig,e=n.getComputeMaps().computeMouseOpts.value)&&e.area&&(e=n.getCellAreas())&&e.length&&e.forEach(function(e){var a=e.rows;e.cols.forEach(function(t){a.forEach(function(e){n.clearData(e,t.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 t=e.$table,a=e.row,e=e.column,n=t.props.mouseConfig,o=t.getComputeMaps().computeMouseOpts.value;b(n,o)&&o.area?(o.area?t.getCellAreas():[]).forEach(function(e){e=e.rows;t.clearData(e)}):a&&e&&t.clearData(a)}},CLEAR_ALL:{tableMenuMethod:function(e){e.$table.clearData()}},SELECT_ALL_AREA:{tableMenuMethod:function(e){var e=e.$table,t=e.props.mouseConfig,a=e.getComputeMaps().computeMouseOpts.value;b(t,a)&&a.area&&(t=e.getTableData().visibleData,a=e.getTableColumn().visibleColumn,e.setCellAreas([{startRow:i.default.first(t),endRow:i.default.last(t),startColumn:i.default.first(a),endColumn:i.default.last(a)}]))}},SELECT_AREA_TO_LEFT:{tableMenuMethod:function(e){var t=e.$table,a=e.row,e=e.column,n=t.props.mouseConfig,o=t.getComputeMaps().computeMouseOpts.value;a&&e&&b(n,o)&&o.area&&(n=t.getTableColumn().visibleColumn,1===(o=t.getCellAreas()).length?(o=o[0],t.setCellAreas([{startRow:i.default.first(o.rows),endRow:i.default.last(o.rows),startColumn:i.default.first(n),endColumn:i.default.last(o.cols)}],{column:e,row:a})):t.setCellAreas([{startRow:a,endRow:a,startColumn:i.default.first(n),endColumn:e}],{column:e,row:a}))}},SELECT_AREA_TO_RIGHT:{tableMenuMethod:function(e){var t=e.$table,a=e.row,e=e.column,n=t.props.mouseConfig,o=t.getComputeMaps().computeMouseOpts.value;a&&e&&b(n,o)&&o.area&&(n=t.getTableColumn().visibleColumn,1===(o=t.getCellAreas()).length?(o=o[0],t.setCellAreas([{startRow:i.default.first(o.rows),endRow:i.default.last(o.rows),startColumn:i.default.first(o.cols),endColumn:i.default.last(n)}],{column:e,row:a})):t.setCellAreas([{startRow:a,endRow:a,startColumn:e,endColumn:i.default.last(n)}],{column:e,row:a}))}},SELECT_AREA_TO_TOP:{tableMenuMethod:function(e){var t=e.$table,a=e.row,e=e.column,n=t.props.mouseConfig,o=t.getComputeMaps().computeMouseOpts.value;a&&e&&b(n,o)&&o.area&&(n=t.getTableData().visibleData,1===(o=t.getCellAreas()).length?(o=o[0],t.setCellAreas([{startRow:i.default.first(n),endRow:i.default.last(o.rows),startColumn:i.default.first(o.cols),endColumn:i.default.last(o.cols)}],{column:e,row:a})):t.setCellAreas([{startRow:i.default.first(n),endRow:a,startColumn:e,endColumn:e}],{column:e,row:a}))}},SELECT_AREA_TO_BOTTON:{tableMenuMethod:function(e){var t=e.$table,a=e.row,e=e.column,n=t.props.mouseConfig,o=t.getComputeMaps().computeMouseOpts.value;a&&e&&b(n,o)&&o.area&&(n=t.getTableData().visibleData,1===(o=t.getCellAreas()).length?(o=o[0],t.setCellAreas([{startRow:i.default.first(o.rows),endRow:i.default.last(n),startColumn:i.default.first(o.cols),endColumn:i.default.last(o.cols)}],{column:e,row:a})):t.setCellAreas([{startRow:a,endRow:i.default.last(n),startColumn:e,endColumn:e}],{column:e,row:a}))}},REVERT_CELL:{tableMenuMethod:function(e){var t,n=e.$table,a=e.row,e=e.column;a&&e&&(b(n.props.mouseConfig,t=n.getComputeMaps().computeMouseOpts.value)&&t.area?(t=n.getCellAreas())&&t.length&&t.forEach(function(e){var a=e.rows;e.cols.forEach(function(t){a.forEach(function(e){n.revertData(e,t.field)})})}):n.revertData(a,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&&(i.default.isFunction(u)?u:d)(e)}},COPY_CELL:{tableMenuMethod:function(e){E(e)}},COPY_AREA_CELL:{tableMenuMethod:function(e){E(e)}},CUT_CELL:{tableMenuMethod:function(e){E(e,!0)}},CUT_AREA_CELL:{tableMenuMethod:function(e){E(e,!0)}},PASTE_CELL:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,n=e.row,e=e.column,o=a.props.mouseConfig,l=a.getComputeMaps().computeMouseOpts.value;b(o,l)&&l.area?a.triggerPasteCellAreaEvent(t):(o=p())&&o.text&&i.default.set(n,e.field,o.text)}},PASTE_AREA_CELL:{tableMenuMethod:function(e){var t=e.$event,e=e.$table,a=e.props.mouseConfig,n=e.getComputeMaps().computeMouseOpts.value;b(a,n)&&n.area&&e.triggerPasteCellAreaEvent(t)}},MERGE_OR_CLEAR:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,n=a.getCellAreas(),e=g(e),o=!1,e=(e.length?a.removeMergeCells(e):(o=!0,a.setMergeCells(n.map(function(e){var t=e.rows,e=e.cols;return{row:t[0],col:e[0],rowspan:t.length,colspan:e.length}}))),n.map(function(e){return{rows:e.rows,cols:e.cols}}));a.dispatchEvent("cell-area-merge",{status:o,targetAreas:e},t)}},MERGE_CELL:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,n=a.getTableData().visibleData,o=a.getTableColumn().visibleColumn,l=a.getCellAreas();f(e),l.some(function(e){return e.rows.length===n.length||e.cols.length===o.length})?s.modal&&s.modal.message({content:s.getI18n("vxe.pro.area.mergeErr"),status:"error",id:"operErr"}):(a.setMergeCells(l.map(function(e){var t=e.rows,e=e.cols;return{row:t[0],col:e[0],rowspan:t.length,colspan:e.length}})),e=l.map(function(e){return{rows:e.rows,cols:e.cols}}),a.dispatchEvent("cell-area-merge",{status:!0,targetAreas:e},t))}},CLEAR_MERGE_CELL:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,e=f(e);e.length&&a.dispatchEvent("clear-cell-area-merge",{mergeCells:e},t)}},CLEAR_ALL_MERGE:{tableMenuMethod:function(e){var t=e.$event,e=e.$table,a=e.getMergeCells(),n=e.getMergeFooterItems();e.clearMergeCells(),e.clearMergeFooterItems(),e.dispatchEvent("clear-merge",{mergeCells:a,mergeFooterItems:n},t)}},EDIT_CELL:{tableMenuMethod:function(e){var t=e.$table,a=e.row,e=e.column;t.setEditCell?t.setEditCell(a,e):t.setActiveCell(a,e.field)}},EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.row;t.setEditRow?t.setEditRow(e):t.setActiveRow(e)}},INSERT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.menu,n=e.column,o=t.props.mouseConfig,l=t.getComputeMaps().computeMouseOpts.value;t.insert(a.params||{}).then(function(e){e=e.rows;n&&b(o,l)&&l.area&&t.setCellAreas([{startRow:i.default.first(e),endRow:i.default.last(e),startColumn:n,endColumn:n}])})}},INSERT_AT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.menu,n=e.row,o=e.column,l=t.props.mouseConfig,r=t.getComputeMaps().computeMouseOpts.value;(n?t.insertAt(a.params||{},n):t.insert(a.params||{})).then(function(e){e=e.rows;o&&b(l,r)&&r.area&&t.setCellAreas([{startRow:i.default.first(e),endRow:i.default.last(e),startColumn:o,endColumn:o}])})}},BATCH_INSERT_AT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.menu,n=e.row,o=e.column,l=t.props.mouseConfig,r=t.getComputeMaps().computeMouseOpts.value;h().then(function(e){var e=e.size;e&&(e=i.default.range(0,e).map(function(){return Object.assign({},a.params)}),(n?t.insertAt(e,n):t.insert(e)).then(function(e){e=e.rows;o&&b(l,r)&&r.area&&t.setCellAreas([{startRow:i.default.first(e),endRow:i.default.last(e),startColumn:o,endColumn:o}])}))})}},INSERT_NEXT_AT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.menu,n=e.row,o=e.column,l=t.props.mouseConfig,r=t.getComputeMaps().computeMouseOpts.value;(n?t.insertNextAt(a.params||{},n):t.insert(a.params||{})).then(function(e){e=e.rows;o&&b(l,r)&&r.area&&t.setCellAreas([{startRow:i.default.first(e),endRow:i.default.last(e),startColumn:o,endColumn:o}])})}},BATCH_INSERT_NEXT_AT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.menu,n=e.row,o=e.column,l=t.props.mouseConfig,r=t.getComputeMaps().computeMouseOpts.value;h().then(function(e){var e=e.size;e&&(e=i.default.range(0,e).map(function(){return Object.assign({},a.params)}),(n?t.insertNextAt(e,n):t.insert(e)).then(function(e){e=e.rows;o&&b(l,r)&&r.area&&t.setCellAreas([{startRow:i.default.first(e),endRow:i.default.last(e),startColumn:o,endColumn:o}])}))})}},INSERT_ACTIVED_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.column,n=e.menu.params||[],e=Object.assign({},n[0]||{});t.insert(e).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,n[1]||a):t.setActiveCell(e,n[1]||a.field)})}},INSERT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.column,n=e.menu.params||[],e=Object.assign({},n[0]||{});t.insert(e).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,n[1]||a):t.setActiveCell(e,n[1]||a.field)})}},INSERT_AT_ACTIVED_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.row,n=e.column,o=e.menu.params||[],e=Object.assign({},o[0]||{});(a?t.insertAt(e,a):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,o[1]||n):t.setActiveCell(e,o[1]||n.field)})}},INSERT_AT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.row,n=e.column,o=e.menu.params||[],e=Object.assign({},o[0]||{});(a?t.insertAt(e,a):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,o[1]||n):t.setActiveCell(e,o[1]||n.field)})}},BATCH_INSERT_AT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.row,n=e.column,o=e.menu.params||[];h().then(function(e){var e=e.size;e&&(e=i.default.range(0,e).map(function(){return Object.assign({},o[0])}),(a?t.insertAt(e,a):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,o[1]||n):t.setActiveCell(e,o[1]||n.field)}))})}},INSERT_NEXT_AT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.row,n=e.column,o=e.menu.params||[],e=Object.assign({},o[0]||{});(a?t.insertNextAt(e,a):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,o[1]||n):t.setActiveCell(e,o[1]||n.field)})}},BATCH_INSERT_NEXT_AT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.row,n=e.column,o=e.menu.params||[];h().then(function(e){var e=e.size;e&&(e=i.default.range(0,e).map(function(){return Object.assign({},o[0])}),(a?t.insertNextAt(e,a):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,o[1]||n):t.setActiveCell(e,o[1]||n.field)}))})}},DELETE_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.row;e&&t.remove(e)}},DELETE_AREA_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.row,a=t.props.mouseConfig,n=t.getComputeMaps().computeMouseOpts.value;b(a,n)&&n.area?t.getCellAreas().forEach(function(e){e=e.rows;t.remove(e)}):e&&t.remove(e)}},DELETE_CHECKBOX_ROW:{tableMenuMethod:function(e){e.$table.removeCheckboxRow()}},DELETE_ALL:{tableMenuMethod:function(e){e.$table.remove()}},CLEAR_SORT:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,e=e.column;e&&a.triggerSortEvent(t,e,null)}},CLEAR_ALL_SORT:{tableMenuMethod:function(e){var t=e.$event,e=e.$table,a=e.getSortColumns();a.length&&(e.clearSort(),e.dispatchEvent("clear-sort",{sortList:a},t))}},SORT_ASC:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,e=e.column;e&&a.triggerSortEvent(t,e,"asc")}},SORT_DESC:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,e=e.column;e&&a.triggerSortEvent(t,e,"desc")}},CLEAR_FILTER:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,e=e.column;e&&(a.handleClearFilter(e),a.confirmFilterEvent(t))}},CLEAR_ALL_FILTER:{tableMenuMethod:function(e){var t=e.$event,e=e.$table,a=e.getCheckedFilters();a.length&&(e.clearFilter(),e.dispatchEvent("clear-filter",{filterList:a},t))}},FILTER_CELL:{tableMenuMethod:function(e){var t,a=e.$table,n=e.row,e=e.column;n&&e&&(t=e.field,(e=e.filters).length)&&((e=e[0]).data=i.default.get(n,t),e.checked=!0,a.updateData())}},EXPORT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.menu,e=e.row;e&&t.exportData(i.default.assign({},a.params?a.params[0]:{},{data:[e]}))}},EXPORT_CHECKBOX_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.menu,a={data:t.getCheckboxRecords()};t.exportData(i.default.assign({},e.params?e.params[0]:{},a))}},EXPORT_ALL:{tableMenuMethod:function(e){e.$table.exportData(e.menu.params)}},PRINT_ALL:{tableMenuMethod:function(e){e.$table.print(e.menu.params)}},PRINT_CHECKBOX_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.menu,a={data:t.getCheckboxRecords()};t.print(i.default.assign(a,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:c("left"),FIXED_RIGHT_COLUMN:c("right"),CLEAR_FIXED_COLUMN:c(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:C("initial")},COMMIT_PROXY_QUERY:{tableMenuMethod:C("query")},COMMIT_PROXY_RELOAD:{tableMenuMethod:C("reload")},COMMIT_PROXY_DELETE:{tableMenuMethod:C("delete")},COMMIT_PROXY_SAVE:{tableMenuMethod:C("save")}}),s.interceptor.add("event.showMenu",m)}},"undefined"!=typeof window&&window.VxeUI&&window.VxeUI.use&&window.VxeUI.use(e),n.default=e),a(r)});
package/es/index.esm.js CHANGED
@@ -2,6 +2,15 @@ import XEUtils from 'xe-utils';
2
2
  import { ref, h } from 'vue';
3
3
  let VxeUI;
4
4
  let handleCopy;
5
+ /**
6
+ * 用于开关类型的配置项
7
+ * 局部启用规则:conf={}
8
+ * 局部禁用规则:conf={enabled:false}
9
+ * 全局默认启用规则:conf.enabled=true
10
+ */
11
+ export function hasEnableConf(conf, opts) {
12
+ return opts && (conf ? opts.enabled !== false : opts.enabled);
13
+ }
5
14
  const columnIndexOf = (cols, column) => {
6
15
  return XEUtils.findIndexOf(cols, item => item.id === column.id);
7
16
  };
@@ -77,7 +86,7 @@ function handleCopyOrCut(params, isCut) {
77
86
  const { computeMouseOpts } = $table.getComputeMaps();
78
87
  const mouseOpts = computeMouseOpts.value;
79
88
  let text;
80
- if (mouseConfig && mouseOpts.area) {
89
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
81
90
  if (isCut) {
82
91
  $table.triggerCutCellAreaEvent($event);
83
92
  }
@@ -141,7 +150,7 @@ function getBeenMerges(params) {
141
150
  const mouseOpts = computeMouseOpts.value;
142
151
  const { visibleData } = $table.getTableData();
143
152
  const { visibleColumn } = $table.getTableColumn();
144
- const cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
153
+ const cellAreas = hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area ? $table.getCellAreas() : [];
145
154
  const mergeList = $table.getMergeCells();
146
155
  return mergeList.filter(({ row: mergeRowIndex, col: mergeColIndex, rowspan: mergeRowspan, colspan: mergeColspan }) => {
147
156
  return cellAreas.some(areaItem => {
@@ -274,7 +283,7 @@ function checkPrivilege(item, params) {
274
283
  }
275
284
  case 'OPEN_FIND':
276
285
  case 'OPEN_REPLACE': {
277
- item.disabled = !(mouseConfig && mouseOpts.area);
286
+ item.disabled = !(hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area);
278
287
  break;
279
288
  }
280
289
  case 'EDIT_CELL': {
@@ -287,7 +296,7 @@ function checkPrivilege(item, params) {
287
296
  case 'CUT_AREA_CELL':
288
297
  case 'PASTE_CELL':
289
298
  case 'PASTE_AREA_CELL': {
290
- const cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
299
+ const cellAreas = hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area ? $table.getCellAreas() : [];
291
300
  item.disabled = cellAreas.length > 1;
292
301
  if (!item.disabled) {
293
302
  switch (code) {
@@ -303,7 +312,7 @@ function checkPrivilege(item, params) {
303
312
  }
304
313
  case 'MERGE_OR_CLEAR':
305
314
  case 'MERGE_CELL': {
306
- const cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
315
+ const cellAreas = hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area ? $table.getCellAreas() : [];
307
316
  item.disabled = !cellAreas.length || (cellAreas.length === 1 && cellAreas[0].rows.length === 1 && cellAreas[0].cols.length === 1) || !checkCellOverlay(params, cellAreas);
308
317
  break;
309
318
  }
@@ -435,12 +444,12 @@ export const VxeUIPluginMenu = {
435
444
  const pVersion = 4;
436
445
  const sVersion = 11;
437
446
  if (!VxeUI.checkVersion(VxeUI.tableVersion, pVersion, sVersion)) {
438
- console.error(`[@vxe-ui/plugin-menu 4.3.4] ${VxeUI.getI18n('vxe.error.errorVersion', [`vxe-table@${VxeUI.tableVersion || '?'}`, `vxe-table v${pVersion}.${sVersion}+`])} https://vxeui.com/other4/#/plugin-menu/install`);
447
+ console.error(`[@vxe-ui/plugin-menu 4.4.0] ${VxeUI.getI18n('vxe.error.errorVersion', [`vxe-table@${VxeUI.tableVersion || '?'}`, `vxe-table v${pVersion}.${sVersion}+`])} https://vxeui.com/other4/#/plugin-menu/install`);
439
448
  }
440
449
  }
441
450
  else {
442
451
  if (!/^(4)\./.test(VxeUI.uiVersion || VxeUI.tableVersion)) {
443
- console.error('[@vxe-ui/plugin-menu 4.3.4] Requires vxe-table 4.7.0+ version. https://vxeui.com/other4/#/plugin-menu/install');
452
+ console.error('[@vxe-ui/plugin-menu 4.4.0] Requires vxe-table 4.7.0+ version. https://vxeui.com/other4/#/plugin-menu/install');
444
453
  }
445
454
  }
446
455
  pluginSetup(options);
@@ -486,7 +495,7 @@ export const VxeUIPluginMenu = {
486
495
  const { mouseConfig } = tableProps;
487
496
  const { computeMouseOpts } = $table.getComputeMaps();
488
497
  const mouseOpts = computeMouseOpts.value;
489
- if (mouseConfig && mouseOpts.area) {
498
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
490
499
  const cellAreas = $table.getCellAreas();
491
500
  if (cellAreas && cellAreas.length) {
492
501
  cellAreas.forEach(areaItem => {
@@ -516,7 +525,7 @@ export const VxeUIPluginMenu = {
516
525
  const { mouseConfig } = tableProps;
517
526
  const { computeMouseOpts } = $table.getComputeMaps();
518
527
  const mouseOpts = computeMouseOpts.value;
519
- if (mouseConfig && mouseOpts.area) {
528
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
520
529
  const cellAreas = $table.getCellAreas();
521
530
  if (cellAreas && cellAreas.length) {
522
531
  cellAreas.forEach(areaItem => {
@@ -562,8 +571,8 @@ export const VxeUIPluginMenu = {
562
571
  const { mouseConfig } = tableProps;
563
572
  const { computeMouseOpts } = $table.getComputeMaps();
564
573
  const mouseOpts = computeMouseOpts.value;
565
- if (mouseConfig && mouseOpts.area) {
566
- const cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
574
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
575
+ const cellAreas = mouseOpts.area ? $table.getCellAreas() : [];
567
576
  cellAreas.forEach(areaItem => {
568
577
  const { rows } = areaItem;
569
578
  $table.clearData(rows);
@@ -595,7 +604,7 @@ export const VxeUIPluginMenu = {
595
604
  const { mouseConfig } = tableProps;
596
605
  const { computeMouseOpts } = $table.getComputeMaps();
597
606
  const mouseOpts = computeMouseOpts.value;
598
- if (mouseConfig && mouseOpts.area) {
607
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
599
608
  const { visibleData } = $table.getTableData();
600
609
  const { visibleColumn } = $table.getTableColumn();
601
610
  $table.setCellAreas([{
@@ -617,7 +626,7 @@ export const VxeUIPluginMenu = {
617
626
  const { mouseConfig } = tableProps;
618
627
  const { computeMouseOpts } = $table.getComputeMaps();
619
628
  const mouseOpts = computeMouseOpts.value;
620
- if (row && column && mouseConfig && mouseOpts.area) {
629
+ if (row && column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
621
630
  const { visibleColumn } = $table.getTableColumn();
622
631
  const cellAreas = $table.getCellAreas();
623
632
  if (cellAreas.length === 1) {
@@ -650,7 +659,7 @@ export const VxeUIPluginMenu = {
650
659
  const { mouseConfig } = tableProps;
651
660
  const { computeMouseOpts } = $table.getComputeMaps();
652
661
  const mouseOpts = computeMouseOpts.value;
653
- if (row && column && mouseConfig && mouseOpts.area) {
662
+ if (row && column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
654
663
  const { visibleColumn } = $table.getTableColumn();
655
664
  const cellAreas = $table.getCellAreas();
656
665
  if (cellAreas.length === 1) {
@@ -683,7 +692,7 @@ export const VxeUIPluginMenu = {
683
692
  const { mouseConfig } = tableProps;
684
693
  const { computeMouseOpts } = $table.getComputeMaps();
685
694
  const mouseOpts = computeMouseOpts.value;
686
- if (row && column && mouseConfig && mouseOpts.area) {
695
+ if (row && column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
687
696
  const { visibleData } = $table.getTableData();
688
697
  const cellAreas = $table.getCellAreas();
689
698
  if (cellAreas.length === 1) {
@@ -716,7 +725,7 @@ export const VxeUIPluginMenu = {
716
725
  const { mouseConfig } = tableProps;
717
726
  const { computeMouseOpts } = $table.getComputeMaps();
718
727
  const mouseOpts = computeMouseOpts.value;
719
- if (row && column && mouseConfig && mouseOpts.area) {
728
+ if (row && column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
720
729
  const { visibleData } = $table.getTableData();
721
730
  const cellAreas = $table.getCellAreas();
722
731
  if (cellAreas.length === 1) {
@@ -750,7 +759,7 @@ export const VxeUIPluginMenu = {
750
759
  const { mouseConfig } = tableProps;
751
760
  const { computeMouseOpts } = $table.getComputeMaps();
752
761
  const mouseOpts = computeMouseOpts.value;
753
- if (mouseConfig && mouseOpts.area) {
762
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
754
763
  const cellAreas = $table.getCellAreas();
755
764
  if (cellAreas && cellAreas.length) {
756
765
  cellAreas.forEach(areaItem => {
@@ -858,7 +867,7 @@ export const VxeUIPluginMenu = {
858
867
  const { mouseConfig } = tableProps;
859
868
  const { computeMouseOpts } = $table.getComputeMaps();
860
869
  const mouseOpts = computeMouseOpts.value;
861
- if (mouseConfig && mouseOpts.area) {
870
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
862
871
  $table.triggerPasteCellAreaEvent($event);
863
872
  }
864
873
  else {
@@ -880,7 +889,7 @@ export const VxeUIPluginMenu = {
880
889
  const { mouseConfig } = tableProps;
881
890
  const { computeMouseOpts } = $table.getComputeMaps();
882
891
  const mouseOpts = computeMouseOpts.value;
883
- if (mouseConfig && mouseOpts.area) {
892
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
884
893
  $table.triggerPasteCellAreaEvent($event);
885
894
  }
886
895
  }
@@ -1006,7 +1015,7 @@ export const VxeUIPluginMenu = {
1006
1015
  const { computeMouseOpts } = $table.getComputeMaps();
1007
1016
  const mouseOpts = computeMouseOpts.value;
1008
1017
  $table.insert(menu.params || {}).then(({ rows }) => {
1009
- if (column && mouseConfig && mouseOpts.area) {
1018
+ if (column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1010
1019
  $table.setCellAreas([
1011
1020
  { startRow: XEUtils.first(rows), endRow: XEUtils.last(rows), startColumn: column, endColumn: column }
1012
1021
  ]);
@@ -1025,7 +1034,7 @@ export const VxeUIPluginMenu = {
1025
1034
  const { computeMouseOpts } = $table.getComputeMaps();
1026
1035
  const mouseOpts = computeMouseOpts.value;
1027
1036
  (row ? $table.insertAt(menu.params || {}, row) : $table.insert(menu.params || {})).then(({ rows }) => {
1028
- if (column && mouseConfig && mouseOpts.area) {
1037
+ if (column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1029
1038
  $table.setCellAreas([
1030
1039
  { startRow: XEUtils.first(rows), endRow: XEUtils.last(rows), startColumn: column, endColumn: column }
1031
1040
  ]);
@@ -1047,7 +1056,7 @@ export const VxeUIPluginMenu = {
1047
1056
  if (size) {
1048
1057
  const records = XEUtils.range(0, size).map(() => Object.assign({}, menu.params));
1049
1058
  (row ? $table.insertAt(records, row) : $table.insert(records)).then(({ rows }) => {
1050
- if (column && mouseConfig && mouseOpts.area) {
1059
+ if (column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1051
1060
  $table.setCellAreas([
1052
1061
  { startRow: XEUtils.first(rows), endRow: XEUtils.last(rows), startColumn: column, endColumn: column }
1053
1062
  ]);
@@ -1068,7 +1077,7 @@ export const VxeUIPluginMenu = {
1068
1077
  const { computeMouseOpts } = $table.getComputeMaps();
1069
1078
  const mouseOpts = computeMouseOpts.value;
1070
1079
  (row ? $table.insertNextAt(menu.params || {}, row) : $table.insert(menu.params || {})).then(({ rows }) => {
1071
- if (column && mouseConfig && mouseOpts.area) {
1080
+ if (column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1072
1081
  $table.setCellAreas([
1073
1082
  { startRow: XEUtils.first(rows), endRow: XEUtils.last(rows), startColumn: column, endColumn: column }
1074
1083
  ]);
@@ -1090,7 +1099,7 @@ export const VxeUIPluginMenu = {
1090
1099
  if (size) {
1091
1100
  const records = XEUtils.range(0, size).map(() => Object.assign({}, menu.params));
1092
1101
  (row ? $table.insertNextAt(records, row) : $table.insert(records)).then(({ rows }) => {
1093
- if (column && mouseConfig && mouseOpts.area) {
1102
+ if (column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1094
1103
  $table.setCellAreas([
1095
1104
  { startRow: XEUtils.first(rows), endRow: XEUtils.last(rows), startColumn: column, endColumn: column }
1096
1105
  ]);
@@ -1264,7 +1273,7 @@ export const VxeUIPluginMenu = {
1264
1273
  const { mouseConfig } = tableProps;
1265
1274
  const { computeMouseOpts } = $table.getComputeMaps();
1266
1275
  const mouseOpts = computeMouseOpts.value;
1267
- if (mouseConfig && mouseOpts.area) {
1276
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1268
1277
  const cellAreas = $table.getCellAreas();
1269
1278
  cellAreas.forEach(areaItem => {
1270
1279
  const { rows } = areaItem;