@vxe-ui/plugin-menu 4.3.1 → 4.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
@@ -15,12 +15,12 @@
15
15
  function requireLib () {
16
16
  if (hasRequiredLib) return lib;
17
17
  hasRequiredLib = 1;
18
- (function (exports$1) {
18
+ (function (exports) {
19
19
 
20
- Object.defineProperty(exports$1, "__esModule", {
20
+ Object.defineProperty(exports, "__esModule", {
21
21
  value: true
22
22
  });
23
- exports$1["default"] = exports$1.VxeUIPluginMenu = void 0;
23
+ exports["default"] = exports.VxeUIPluginMenu = void 0;
24
24
  var _xeUtils = _interopRequireDefault(require$$0);
25
25
  var _vue = require$$1;
26
26
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
@@ -105,7 +105,7 @@
105
105
  var _$table$getComputeMap = $table.getComputeMaps(),
106
106
  computeMouseOpts = _$table$getComputeMap.computeMouseOpts;
107
107
  var mouseOpts = computeMouseOpts.value;
108
- var text = '';
108
+ var text;
109
109
  if (mouseConfig && mouseOpts.area) {
110
110
  if (isCut) {
111
111
  $table.triggerCutCellAreaEvent($event);
@@ -268,10 +268,14 @@
268
268
  }
269
269
  case 'EDIT_CELL':
270
270
  case 'CLEAR_CELL':
271
+ case 'CLEAR_AREA_CELL':
271
272
  case 'CLEAR_ROW':
272
273
  case 'COPY_CELL':
274
+ case 'COPY_AREA_CELL':
273
275
  case 'CUT_CELL':
276
+ case 'CUT_AREA_CELL':
274
277
  case 'PASTE_CELL':
278
+ case 'PASTE_AREA_CELL':
275
279
  case 'MERGE_OR_CLEAR':
276
280
  case 'MERGE_CELL':
277
281
  case 'REVERT_CELL':
@@ -342,14 +346,18 @@
342
346
  break;
343
347
  }
344
348
  case 'COPY_CELL':
349
+ case 'COPY_AREA_CELL':
345
350
  case 'CUT_CELL':
351
+ case 'CUT_AREA_CELL':
346
352
  case 'PASTE_CELL':
353
+ case 'PASTE_AREA_CELL':
347
354
  {
348
355
  var cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
349
356
  item.disabled = cellAreas.length > 1;
350
357
  if (!item.disabled) {
351
358
  switch (code) {
352
359
  case 'PASTE_CELL':
360
+ case 'PASTE_AREA_CELL':
353
361
  {
354
362
  var clipboard = getClipboardObj();
355
363
  item.disabled = !clipboard || !clipboard.text;
@@ -483,7 +491,7 @@
483
491
  /**
484
492
  * 基于 Vxe UI 的扩展插件,支持右键菜单
485
493
  */
486
- var VxeUIPluginMenu = exports$1.VxeUIPluginMenu = {
494
+ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
487
495
  setConfig: pluginSetup,
488
496
  install: function install(core, options) {
489
497
  VxeUI = core;
@@ -492,11 +500,11 @@
492
500
  var pVersion = 4;
493
501
  var sVersion = 11;
494
502
  if (!VxeUI.checkVersion(VxeUI.tableVersion, pVersion, sVersion)) {
495
- console.error("[@vxe-ui/plugin-menu 4.3.1] ".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"));
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"));
496
504
  }
497
505
  } else {
498
506
  if (!/^(4)\./.test(VxeUI.uiVersion || VxeUI.tableVersion)) {
499
- console.error('[@vxe-ui/plugin-menu 4.3.1] Requires vxe-table 4.7.0+ version. https://vxeui.com/other4/#/plugin-menu/install');
507
+ console.error('[@vxe-ui/plugin-menu 4.3.4] Requires vxe-table 4.7.0+ version. https://vxeui.com/other4/#/plugin-menu/install');
500
508
  }
501
509
  }
502
510
  pluginSetup(options);
@@ -564,6 +572,37 @@
564
572
  }
565
573
  }
566
574
  },
575
+ /**
576
+ * 用于 mouse-config.area 功能,清除区域范围内的单元格数据
577
+ */
578
+ CLEAR_AREA_CELL: {
579
+ tableMenuMethod: function tableMenuMethod(params) {
580
+ var $table = params.$table,
581
+ row = params.row,
582
+ column = params.column;
583
+ if (row && column) {
584
+ var tableProps = $table.props;
585
+ var mouseConfig = tableProps.mouseConfig;
586
+ var _$table$getComputeMap5 = $table.getComputeMaps(),
587
+ computeMouseOpts = _$table$getComputeMap5.computeMouseOpts;
588
+ var mouseOpts = computeMouseOpts.value;
589
+ if (mouseConfig && mouseOpts.area) {
590
+ var cellAreas = $table.getCellAreas();
591
+ if (cellAreas && cellAreas.length) {
592
+ cellAreas.forEach(function (areaItem) {
593
+ var rows = areaItem.rows,
594
+ cols = areaItem.cols;
595
+ cols.forEach(function (column) {
596
+ rows.forEach(function (row) {
597
+ $table.clearData(row, column.field);
598
+ });
599
+ });
600
+ });
601
+ }
602
+ }
603
+ }
604
+ }
605
+ },
567
606
  /**
568
607
  * 清除行数据的值
569
608
  */
@@ -595,8 +634,8 @@
595
634
  column = params.column;
596
635
  var tableProps = $table.props;
597
636
  var mouseConfig = tableProps.mouseConfig;
598
- var _$table$getComputeMap5 = $table.getComputeMaps(),
599
- computeMouseOpts = _$table$getComputeMap5.computeMouseOpts;
637
+ var _$table$getComputeMap6 = $table.getComputeMaps(),
638
+ computeMouseOpts = _$table$getComputeMap6.computeMouseOpts;
600
639
  var mouseOpts = computeMouseOpts.value;
601
640
  if (mouseConfig && mouseOpts.area) {
602
641
  var cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
@@ -628,8 +667,8 @@
628
667
  var $table = params.$table;
629
668
  var tableProps = $table.props;
630
669
  var mouseConfig = tableProps.mouseConfig;
631
- var _$table$getComputeMap6 = $table.getComputeMaps(),
632
- computeMouseOpts = _$table$getComputeMap6.computeMouseOpts;
670
+ var _$table$getComputeMap7 = $table.getComputeMaps(),
671
+ computeMouseOpts = _$table$getComputeMap7.computeMouseOpts;
633
672
  var mouseOpts = computeMouseOpts.value;
634
673
  if (mouseConfig && mouseOpts.area) {
635
674
  var _$table$getTableData4 = $table.getTableData(),
@@ -655,8 +694,8 @@
655
694
  column = params.column;
656
695
  var tableProps = $table.props;
657
696
  var mouseConfig = tableProps.mouseConfig;
658
- var _$table$getComputeMap7 = $table.getComputeMaps(),
659
- computeMouseOpts = _$table$getComputeMap7.computeMouseOpts;
697
+ var _$table$getComputeMap8 = $table.getComputeMaps(),
698
+ computeMouseOpts = _$table$getComputeMap8.computeMouseOpts;
660
699
  var mouseOpts = computeMouseOpts.value;
661
700
  if (row && column && mouseConfig && mouseOpts.area) {
662
701
  var _$table$getTableColum5 = $table.getTableColumn(),
@@ -697,8 +736,8 @@
697
736
  column = params.column;
698
737
  var tableProps = $table.props;
699
738
  var mouseConfig = tableProps.mouseConfig;
700
- var _$table$getComputeMap8 = $table.getComputeMaps(),
701
- computeMouseOpts = _$table$getComputeMap8.computeMouseOpts;
739
+ var _$table$getComputeMap9 = $table.getComputeMaps(),
740
+ computeMouseOpts = _$table$getComputeMap9.computeMouseOpts;
702
741
  var mouseOpts = computeMouseOpts.value;
703
742
  if (row && column && mouseConfig && mouseOpts.area) {
704
743
  var _$table$getTableColum6 = $table.getTableColumn(),
@@ -739,8 +778,8 @@
739
778
  column = params.column;
740
779
  var tableProps = $table.props;
741
780
  var mouseConfig = tableProps.mouseConfig;
742
- var _$table$getComputeMap9 = $table.getComputeMaps(),
743
- computeMouseOpts = _$table$getComputeMap9.computeMouseOpts;
781
+ var _$table$getComputeMap0 = $table.getComputeMaps(),
782
+ computeMouseOpts = _$table$getComputeMap0.computeMouseOpts;
744
783
  var mouseOpts = computeMouseOpts.value;
745
784
  if (row && column && mouseConfig && mouseOpts.area) {
746
785
  var _$table$getTableData5 = $table.getTableData(),
@@ -781,8 +820,8 @@
781
820
  column = params.column;
782
821
  var tableProps = $table.props;
783
822
  var mouseConfig = tableProps.mouseConfig;
784
- var _$table$getComputeMap0 = $table.getComputeMaps(),
785
- computeMouseOpts = _$table$getComputeMap0.computeMouseOpts;
823
+ var _$table$getComputeMap1 = $table.getComputeMaps(),
824
+ computeMouseOpts = _$table$getComputeMap1.computeMouseOpts;
786
825
  var mouseOpts = computeMouseOpts.value;
787
826
  if (row && column && mouseConfig && mouseOpts.area) {
788
827
  var _$table$getTableData6 = $table.getTableData(),
@@ -824,8 +863,8 @@
824
863
  if (row && column) {
825
864
  var tableProps = $table.props;
826
865
  var mouseConfig = tableProps.mouseConfig;
827
- var _$table$getComputeMap1 = $table.getComputeMaps(),
828
- computeMouseOpts = _$table$getComputeMap1.computeMouseOpts;
866
+ var _$table$getComputeMap10 = $table.getComputeMaps(),
867
+ computeMouseOpts = _$table$getComputeMap10.computeMouseOpts;
829
868
  var mouseOpts = computeMouseOpts.value;
830
869
  if (mouseConfig && mouseOpts.area) {
831
870
  var cellAreas = $table.getCellAreas();
@@ -901,6 +940,14 @@
901
940
  handleCopyOrCut(params);
902
941
  }
903
942
  },
943
+ /**
944
+ * 复制单元格数据的值;用于 mouse-config.area 功能,复制区域范围内的单元格数据,支持 Excel 和 WPS
945
+ */
946
+ COPY_AREA_CELL: {
947
+ tableMenuMethod: function tableMenuMethod(params) {
948
+ handleCopyOrCut(params);
949
+ }
950
+ },
904
951
  /**
905
952
  * 剪贴单元格数据的值;如果启用 mouse-config.area 功能,则剪贴区域范围内的单元格数据,支持 Excel 和 WPS
906
953
  */
@@ -909,6 +956,14 @@
909
956
  handleCopyOrCut(params, true);
910
957
  }
911
958
  },
959
+ /**
960
+ * 剪贴单元格数据的值;用于 mouse-config.area 功能,剪贴区域范围内的单元格数据,支持 Excel 和 WPS
961
+ */
962
+ CUT_AREA_CELL: {
963
+ tableMenuMethod: function tableMenuMethod(params) {
964
+ handleCopyOrCut(params, true);
965
+ }
966
+ },
912
967
  /**
913
968
  * 粘贴从表格中被复制的数据;如果启用 mouse-config.area 功能,则粘贴区域范围内的单元格数据,不支持读取剪贴板
914
969
  */
@@ -920,8 +975,8 @@
920
975
  column = params.column;
921
976
  var tableProps = $table.props;
922
977
  var mouseConfig = tableProps.mouseConfig;
923
- var _$table$getComputeMap10 = $table.getComputeMaps(),
924
- computeMouseOpts = _$table$getComputeMap10.computeMouseOpts;
978
+ var _$table$getComputeMap11 = $table.getComputeMaps(),
979
+ computeMouseOpts = _$table$getComputeMap11.computeMouseOpts;
925
980
  var mouseOpts = computeMouseOpts.value;
926
981
  if (mouseConfig && mouseOpts.area) {
927
982
  $table.triggerPasteCellAreaEvent($event);
@@ -934,6 +989,23 @@
934
989
  }
935
990
  }
936
991
  },
992
+ /**
993
+ * 粘贴从表格中被复制的数据;用于 mouse-config.area 功能,粘贴区域范围内的单元格数据,不支持读取剪贴板
994
+ */
995
+ PASTE_AREA_CELL: {
996
+ tableMenuMethod: function tableMenuMethod(params) {
997
+ var $event = params.$event,
998
+ $table = params.$table;
999
+ var tableProps = $table.props;
1000
+ var mouseConfig = tableProps.mouseConfig;
1001
+ var _$table$getComputeMap12 = $table.getComputeMaps(),
1002
+ computeMouseOpts = _$table$getComputeMap12.computeMouseOpts;
1003
+ var mouseOpts = computeMouseOpts.value;
1004
+ if (mouseConfig && mouseOpts.area) {
1005
+ $table.triggerPasteCellAreaEvent($event);
1006
+ }
1007
+ }
1008
+ },
937
1009
  /**
938
1010
  * 如果启用 mouse-config.area 功能,如果所选区域内已存在合并单元格,则取消临时合并,否则临时合并
939
1011
  */
@@ -1097,8 +1169,8 @@
1097
1169
  column = params.column;
1098
1170
  var tableProps = $table.props;
1099
1171
  var mouseConfig = tableProps.mouseConfig;
1100
- var _$table$getComputeMap11 = $table.getComputeMaps(),
1101
- computeMouseOpts = _$table$getComputeMap11.computeMouseOpts;
1172
+ var _$table$getComputeMap13 = $table.getComputeMaps(),
1173
+ computeMouseOpts = _$table$getComputeMap13.computeMouseOpts;
1102
1174
  var mouseOpts = computeMouseOpts.value;
1103
1175
  $table.insert(menu.params || {}).then(function (_ref7) {
1104
1176
  var rows = _ref7.rows;
@@ -1124,8 +1196,8 @@
1124
1196
  column = params.column;
1125
1197
  var tableProps = $table.props;
1126
1198
  var mouseConfig = tableProps.mouseConfig;
1127
- var _$table$getComputeMap12 = $table.getComputeMaps(),
1128
- computeMouseOpts = _$table$getComputeMap12.computeMouseOpts;
1199
+ var _$table$getComputeMap14 = $table.getComputeMaps(),
1200
+ computeMouseOpts = _$table$getComputeMap14.computeMouseOpts;
1129
1201
  var mouseOpts = computeMouseOpts.value;
1130
1202
  (row ? $table.insertAt(menu.params || {}, row) : $table.insert(menu.params || {})).then(function (_ref8) {
1131
1203
  var rows = _ref8.rows;
@@ -1151,8 +1223,8 @@
1151
1223
  column = params.column;
1152
1224
  var tableProps = $table.props;
1153
1225
  var mouseConfig = tableProps.mouseConfig;
1154
- var _$table$getComputeMap13 = $table.getComputeMaps(),
1155
- computeMouseOpts = _$table$getComputeMap13.computeMouseOpts;
1226
+ var _$table$getComputeMap15 = $table.getComputeMaps(),
1227
+ computeMouseOpts = _$table$getComputeMap15.computeMouseOpts;
1156
1228
  var mouseOpts = computeMouseOpts.value;
1157
1229
  selectMultipleRows().then(function (_ref9) {
1158
1230
  var size = _ref9.size;
@@ -1186,8 +1258,8 @@
1186
1258
  column = params.column;
1187
1259
  var tableProps = $table.props;
1188
1260
  var mouseConfig = tableProps.mouseConfig;
1189
- var _$table$getComputeMap14 = $table.getComputeMaps(),
1190
- computeMouseOpts = _$table$getComputeMap14.computeMouseOpts;
1261
+ var _$table$getComputeMap16 = $table.getComputeMaps(),
1262
+ computeMouseOpts = _$table$getComputeMap16.computeMouseOpts;
1191
1263
  var mouseOpts = computeMouseOpts.value;
1192
1264
  (row ? $table.insertNextAt(menu.params || {}, row) : $table.insert(menu.params || {})).then(function (_ref1) {
1193
1265
  var rows = _ref1.rows;
@@ -1213,8 +1285,8 @@
1213
1285
  column = params.column;
1214
1286
  var tableProps = $table.props;
1215
1287
  var mouseConfig = tableProps.mouseConfig;
1216
- var _$table$getComputeMap15 = $table.getComputeMaps(),
1217
- computeMouseOpts = _$table$getComputeMap15.computeMouseOpts;
1288
+ var _$table$getComputeMap17 = $table.getComputeMaps(),
1289
+ computeMouseOpts = _$table$getComputeMap17.computeMouseOpts;
1218
1290
  var mouseOpts = computeMouseOpts.value;
1219
1291
  selectMultipleRows().then(function (_ref10) {
1220
1292
  var size = _ref10.size;
@@ -1426,8 +1498,8 @@
1426
1498
  row = params.row;
1427
1499
  var tableProps = $table.props;
1428
1500
  var mouseConfig = tableProps.mouseConfig;
1429
- var _$table$getComputeMap16 = $table.getComputeMaps(),
1430
- computeMouseOpts = _$table$getComputeMap16.computeMouseOpts;
1501
+ var _$table$getComputeMap18 = $table.getComputeMaps(),
1502
+ computeMouseOpts = _$table$getComputeMap18.computeMouseOpts;
1431
1503
  var mouseOpts = computeMouseOpts.value;
1432
1504
  if (mouseConfig && mouseOpts.area) {
1433
1505
  var cellAreas = $table.getCellAreas();
@@ -1634,7 +1706,11 @@
1634
1706
  tableMenuMethod: function tableMenuMethod(params) {
1635
1707
  var $event = params.$event,
1636
1708
  $table = params.$table;
1637
- $table.triggerFNROpenEvent($event, 'find');
1709
+ if ($table.triggerFnrOpenEvent) {
1710
+ $table.triggerFnrOpenEvent($event, 'find');
1711
+ } else {
1712
+ $table.triggerFNROpenEvent($event, 'find');
1713
+ }
1638
1714
  }
1639
1715
  },
1640
1716
  /**
@@ -1644,7 +1720,11 @@
1644
1720
  tableMenuMethod: function tableMenuMethod(params) {
1645
1721
  var $event = params.$event,
1646
1722
  $table = params.$table;
1647
- $table.triggerFNROpenEvent($event, 'replace');
1723
+ if ($table.triggerFnrOpenEvent) {
1724
+ $table.triggerFnrOpenEvent($event, 'replace');
1725
+ } else {
1726
+ $table.triggerFNROpenEvent($event, 'replace');
1727
+ }
1648
1728
  }
1649
1729
  },
1650
1730
  /**
@@ -1741,7 +1821,7 @@
1741
1821
  if (typeof window !== 'undefined' && window.VxeUI && window.VxeUI.use) {
1742
1822
  window.VxeUI.use(VxeUIPluginMenu);
1743
1823
  }
1744
- exports$1["default"] = VxeUIPluginMenu;
1824
+ exports["default"] = VxeUIPluginMenu;
1745
1825
  } (lib));
1746
1826
  return lib;
1747
1827
  }
@@ -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,l,o,_,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 m(){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,o||((o=document.createElement("textarea")).id="$XECopy",(a=o.style).width="48px",a.height="24px",a.position="fixed",a.zIndex="0",a.left="-500px",a.top="-500px",document.body.appendChild(o)),o.value=null==t?"":""+t,o.select(),o.setSelectionRange(0,o.value.length),document.execCommand("copy"),o.blur()}catch(e){}}function E(e,t){var a,n,l,o=e.$event,r=e.$table,s=e.row,e=e.column;s&&e&&(a=r.props.mouseConfig,l=r.getComputeMaps().computeMouseOpts.value,n="",a&&l.area?(t?r.triggerCutCellAreaEvent(o):r.triggerCopyCellAreaEvent(o),n=(a=m())?a.text:""):(n=c.default.toValueString(c.default.get(s,e.field)),l={text:n,html:""},(t=u.globalStore)?t.clipboard=l:u.config&&(u.config.clipboard=l)),(c.default.isFunction(i)?i:d)(n))}function f(t){return function(e){e=e.$grid;e&&e.commitProxy(t)}}function b(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 l=e.row,o=e.col,r=e.rowspan,s=e.colspan;return a.some(function(e){var t=e.rows,e=e.cols,a=R(u,i,t[0]),t=R(u,i,t[t.length-1]),n=_(c,e[0]),e=_(c,e[e.length-1]);return a<=l&&l+r-1<=t&&n<=o&&o+s-1<=e})})}function C(e){var t=e.$table,e=b(e);return e.length&&t.removeMergeCells(e),e}function M(e,t){var a=e.code,n=t.$table,l=t.$grid,o=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=b(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||!o;break;case"DELETE_CHECKBOX_ROW":E=n.getCheckboxRecords();e.disabled=!E.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 f=n.getComputeMaps().computeMouseOpts.value,C=!!r.parentId;switch(a){case"CLEAR_SORT":e.disabled=!r.sortable||!r.order;break;case"SORT_ASC":case"SORT_DESC":e.disabled=!r.sortable;break;case"FILTER_CELL":case"CLEAR_FILTER":e.disabled=!r.filters||!r.filters.length,e.disabled||"CLEAR_FILTER"===a&&(e.disabled=!r.filters.some(function(e){return e.checked}));break;case"REVERT_CELL":e.disabled=!o||!r.field||!n.isUpdateByRow(o,r.field);break;case"REVERT_ROW":e.disabled=!o||!r.field||!n.isUpdateByRow(o);break;case"OPEN_FIND":case"OPEN_REPLACE":e.disabled=!(c&&f.area);break;case"EDIT_CELL":e.disabled=!i||!r.editRender;break;case"COPY_CELL":case"CUT_CELL":case"PASTE_CELL":var M=c&&f.area?n.getCellAreas():[];e.disabled=1<M.length,e.disabled||"PASTE_CELL"===a&&(M=m(),e.disabled=!M||!M.text);break;case"MERGE_OR_CLEAR":case"MERGE_CELL":M=c&&f.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,l=a.getTableColumn().visibleColumn,o={},r=0,s=t.length;r<s;r++)for(var u=t[r],i=u.rows,c=u.cols,d=0,E=i.length;d<E;d++)for(var f=i[d],C=R(a,n,f),M=0,m=c.length;M<m;M++){var b=c[M],b=C+":"+_(l,b);if(o[b])return;o[b]=!0}return 1})(t,M);break;case"FIXED_LEFT_COLUMN":e.disabled=C||"left"===r.fixed;break;case"FIXED_RIGHT_COLUMN":e.disabled=C||"right"===r.fixed;break;case"CLEAR_FIXED_COLUMN":e.disabled=C||!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 g(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 p(){return new Promise(function(t){var e,a;u.modal?(e=u.getComponent("VxeNumberInput"))?(a=(0,l.ref)(1),u.modal.alert({title:"请输入行数",width:220,maskClosable:!1,slots:{default:function(){return(0,l.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 T(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},l=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:T,install:function(e,t){(u=e).checkVersion?u.checkVersion(u.tableVersion,4,11)||console.error("[@vxe-ui/plugin-menu 4.3.1] ".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.1] Requires vxe-table 4.7.0+ version. https://vxeui.com/other4/#/plugin-menu/install"),T(t),u.menus.mixin({SYSTEM_PAGE_REFRESH:{tableMenuMethod:h,treeMenuMethod:h,calendarMenuMethod:h,menuMenuMethod:h,formDesignMenuMethod:h},SYSTEM_PAGE_FORWARD:{tableMenuMethod: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,l=e.row,e=e.column;l&&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(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 t=e.$table,a=e.row,e=e.column,n=t.props.mouseConfig,l=t.getComputeMaps().computeMouseOpts.value;n&&l.area?(n&&l.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,l=t.getComputeMaps().computeMouseOpts.value;a&&e&&n&&l.area&&(n=t.getTableColumn().visibleColumn,1===(l=t.getCellAreas()).length?(l=l[0],t.setCellAreas([{startRow:c.default.first(l.rows),endRow:c.default.last(l.rows),startColumn:c.default.first(n),endColumn:c.default.last(l.cols)}],{column:e,row:a})):t.setCellAreas([{startRow:a,endRow:a,startColumn:c.default.first(n),endColumn:e}],{column:e,row:a}))}},SELECT_AREA_TO_RIGHT:{tableMenuMethod:function(e){var t=e.$table,a=e.row,e=e.column,n=t.props.mouseConfig,l=t.getComputeMaps().computeMouseOpts.value;a&&e&&n&&l.area&&(n=t.getTableColumn().visibleColumn,1===(l=t.getCellAreas()).length?(l=l[0],t.setCellAreas([{startRow:c.default.first(l.rows),endRow:c.default.last(l.rows),startColumn:c.default.first(l.cols),endColumn:c.default.last(n)}],{column:e,row:a})):t.setCellAreas([{startRow:a,endRow:a,startColumn:e,endColumn:c.default.last(n)}],{column:e,row:a}))}},SELECT_AREA_TO_TOP:{tableMenuMethod:function(e){var t=e.$table,a=e.row,e=e.column,n=t.props.mouseConfig,l=t.getComputeMaps().computeMouseOpts.value;a&&e&&n&&l.area&&(n=t.getTableData().visibleData,1===(l=t.getCellAreas()).length?(l=l[0],t.setCellAreas([{startRow:c.default.first(n),endRow:c.default.last(l.rows),startColumn:c.default.first(l.cols),endColumn:c.default.last(l.cols)}],{column:e,row:a})):t.setCellAreas([{startRow:c.default.first(n),endRow:a,startColumn:e,endColumn:e}],{column:e,row:a}))}},SELECT_AREA_TO_BOTTON:{tableMenuMethod:function(e){var t=e.$table,a=e.row,e=e.column,n=t.props.mouseConfig,l=t.getComputeMaps().computeMouseOpts.value;a&&e&&n&&l.area&&(n=t.getTableData().visibleData,1===(l=t.getCellAreas()).length?(l=l[0],t.setCellAreas([{startRow:c.default.first(l.rows),endRow:c.default.last(n),startColumn:c.default.first(l.cols),endColumn:c.default.last(l.cols)}],{column:e,row:a})):t.setCellAreas([{startRow:a,endRow:c.default.last(n),startColumn:e,endColumn:e}],{column:e,row:a}))}},REVERT_CELL:{tableMenuMethod:function(e){var t,a,n=e.$table,l=e.row,e=e.column;l&&e&&(a=n.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(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){E(e)}},CUT_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,l=a.props.mouseConfig,o=a.getComputeMaps().computeMouseOpts.value;l&&o.area?a.triggerPasteCellAreaEvent(t):(l=m())&&l.text&&c.default.set(n,e.field,l.text)}},MERGE_OR_CLEAR:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,n=a.getCellAreas(),e=b(e),l=!1,e=(e.length?a.removeMergeCells(e):(l=!0,a.setMergeCells(n.map(function(e){var t=e.rows,e=e.cols;return{row:t[0],col:e[0],rowspan:t.length,colspan:e.length}}))),n.map(function(e){return{rows:e.rows,cols:e.cols}}));a.dispatchEvent("cell-area-merge",{status:l,targetAreas:e},t)}},MERGE_CELL:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,n=a.getTableData().visibleData,l=a.getTableColumn().visibleColumn,o=a.getCellAreas();C(e),o.some(function(e){return e.rows.length===n.length||e.cols.length===l.length})?u.modal&&u.modal.message({content:u.getI18n("vxe.pro.area.mergeErr"),status:"error",id:"operErr"}):(a.setMergeCells(o.map(function(e){var t=e.rows,e=e.cols;return{row:t[0],col:e[0],rowspan:t.length,colspan:e.length}})),e=o.map(function(e){return{rows:e.rows,cols:e.cols}}),a.dispatchEvent("cell-area-merge",{status:!0,targetAreas:e},t))}},CLEAR_MERGE_CELL:{tableMenuMethod:function(e){var t=e.$event,a=e.$table,e=C(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,l=t.props.mouseConfig,o=t.getComputeMaps().computeMouseOpts.value;t.insert(a.params||{}).then(function(e){e=e.rows;n&&l&&o.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,l=e.column,o=t.props.mouseConfig,r=t.getComputeMaps().computeMouseOpts.value;(n?t.insertAt(a.params||{},n):t.insert(a.params||{})).then(function(e){e=e.rows;l&&o&&r.area&&t.setCellAreas([{startRow:c.default.first(e),endRow:c.default.last(e),startColumn:l,endColumn:l}])})}},BATCH_INSERT_AT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.menu,n=e.row,l=e.column,o=t.props.mouseConfig,r=t.getComputeMaps().computeMouseOpts.value;p().then(function(e){var e=e.size;e&&(e=c.default.range(0,e).map(function(){return Object.assign({},a.params)}),(n?t.insertAt(e,n):t.insert(e)).then(function(e){e=e.rows;l&&o&&r.area&&t.setCellAreas([{startRow:c.default.first(e),endRow:c.default.last(e),startColumn:l,endColumn:l}])}))})}},INSERT_NEXT_AT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.menu,n=e.row,l=e.column,o=t.props.mouseConfig,r=t.getComputeMaps().computeMouseOpts.value;(n?t.insertNextAt(a.params||{},n):t.insert(a.params||{})).then(function(e){e=e.rows;l&&o&&r.area&&t.setCellAreas([{startRow:c.default.first(e),endRow:c.default.last(e),startColumn:l,endColumn:l}])})}},BATCH_INSERT_NEXT_AT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.menu,n=e.row,l=e.column,o=t.props.mouseConfig,r=t.getComputeMaps().computeMouseOpts.value;p().then(function(e){var e=e.size;e&&(e=c.default.range(0,e).map(function(){return Object.assign({},a.params)}),(n?t.insertNextAt(e,n):t.insert(e)).then(function(e){e=e.rows;l&&o&&r.area&&t.setCellAreas([{startRow:c.default.first(e),endRow:c.default.last(e),startColumn:l,endColumn:l}])}))})}},INSERT_ACTIVED_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.column,n=e.menu.params||[],e=Object.assign({},n[0]||{});t.insert(e).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,n[1]||a):t.setActiveCell(e,n[1]||a.field)})}},INSERT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.column,n=e.menu.params||[],e=Object.assign({},n[0]||{});t.insert(e).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,n[1]||a):t.setActiveCell(e,n[1]||a.field)})}},INSERT_AT_ACTIVED_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.row,n=e.column,l=e.menu.params||[],e=Object.assign({},l[0]||{});(a?t.insertAt(e,a):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,l[1]||n):t.setActiveCell(e,l[1]||n.field)})}},INSERT_AT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.row,n=e.column,l=e.menu.params||[],e=Object.assign({},l[0]||{});(a?t.insertAt(e,a):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,l[1]||n):t.setActiveCell(e,l[1]||n.field)})}},BATCH_INSERT_AT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.row,n=e.column,l=e.menu.params||[];p().then(function(e){var e=e.size;e&&(e=c.default.range(0,e).map(function(){return Object.assign({},l[0])}),(a?t.insertAt(e,a):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,l[1]||n):t.setActiveCell(e,l[1]||n.field)}))})}},INSERT_NEXT_AT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.row,n=e.column,l=e.menu.params||[],e=Object.assign({},l[0]||{});(a?t.insertNextAt(e,a):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,l[1]||n):t.setActiveCell(e,l[1]||n.field)})}},BATCH_INSERT_NEXT_AT_EDIT_ROW:{tableMenuMethod:function(e){var t=e.$table,a=e.row,n=e.column,l=e.menu.params||[];p().then(function(e){var e=e.size;e&&(e=c.default.range(0,e).map(function(){return Object.assign({},l[0])}),(a?t.insertNextAt(e,a):t.insert(e)).then(function(e){e=e.row;t.setEditCell?t.setEditCell(e,l[1]||n):t.setActiveCell(e,l[1]||n.field)}))})}},DELETE_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.row;e&&t.remove(e)}},DELETE_AREA_ROW:{tableMenuMethod:function(e){var t=e.$table,e=e.row,a=t.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.$table.triggerFNROpenEvent(t,"find")}},OPEN_REPLACE:{tableMenuMethod:function(e){var t=e.$event;e.$table.triggerFNROpenEvent(t,"replace")}},HIDDEN_COLUMN:{tableMenuMethod:function(e){var t=e.$table,e=e.column;e&&t.hideColumn(e)}},FIXED_LEFT_COLUMN: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:f("initial")},COMMIT_PROXY_QUERY:{tableMenuMethod:f("query")},COMMIT_PROXY_RELOAD:{tableMenuMethod:f("reload")},COMMIT_PROXY_DELETE:{tableMenuMethod:f("delete")},COMMIT_PROXY_SAVE:{tableMenuMethod:f("save")}}),u.interceptor.add("event.showMenu",g)}},"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,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)});
package/es/index.esm.js CHANGED
@@ -76,7 +76,7 @@ function handleCopyOrCut(params, isCut) {
76
76
  const { mouseConfig } = tableProps;
77
77
  const { computeMouseOpts } = $table.getComputeMaps();
78
78
  const mouseOpts = computeMouseOpts.value;
79
- let text = '';
79
+ let text;
80
80
  if (mouseConfig && mouseOpts.area) {
81
81
  if (isCut) {
82
82
  $table.triggerCutCellAreaEvent($event);
@@ -213,10 +213,14 @@ function checkPrivilege(item, params) {
213
213
  }
214
214
  case 'EDIT_CELL':
215
215
  case 'CLEAR_CELL':
216
+ case 'CLEAR_AREA_CELL':
216
217
  case 'CLEAR_ROW':
217
218
  case 'COPY_CELL':
219
+ case 'COPY_AREA_CELL':
218
220
  case 'CUT_CELL':
221
+ case 'CUT_AREA_CELL':
219
222
  case 'PASTE_CELL':
223
+ case 'PASTE_AREA_CELL':
220
224
  case 'MERGE_OR_CLEAR':
221
225
  case 'MERGE_CELL':
222
226
  case 'REVERT_CELL':
@@ -278,13 +282,17 @@ function checkPrivilege(item, params) {
278
282
  break;
279
283
  }
280
284
  case 'COPY_CELL':
285
+ case 'COPY_AREA_CELL':
281
286
  case 'CUT_CELL':
282
- case 'PASTE_CELL': {
287
+ case 'CUT_AREA_CELL':
288
+ case 'PASTE_CELL':
289
+ case 'PASTE_AREA_CELL': {
283
290
  const cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
284
291
  item.disabled = cellAreas.length > 1;
285
292
  if (!item.disabled) {
286
293
  switch (code) {
287
- case 'PASTE_CELL': {
294
+ case 'PASTE_CELL':
295
+ case 'PASTE_AREA_CELL': {
288
296
  const clipboard = getClipboardObj();
289
297
  item.disabled = !clipboard || !clipboard.text;
290
298
  break;
@@ -427,12 +435,12 @@ export const VxeUIPluginMenu = {
427
435
  const pVersion = 4;
428
436
  const sVersion = 11;
429
437
  if (!VxeUI.checkVersion(VxeUI.tableVersion, pVersion, sVersion)) {
430
- console.error(`[@vxe-ui/plugin-menu 4.3.1] ${VxeUI.getI18n('vxe.error.errorVersion', [`vxe-table@${VxeUI.tableVersion || '?'}`, `vxe-table v${pVersion}.${sVersion}+`])} https://vxeui.com/other4/#/plugin-menu/install`);
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`);
431
439
  }
432
440
  }
433
441
  else {
434
442
  if (!/^(4)\./.test(VxeUI.uiVersion || VxeUI.tableVersion)) {
435
- console.error('[@vxe-ui/plugin-menu 4.3.1] Requires vxe-table 4.7.0+ version. https://vxeui.com/other4/#/plugin-menu/install');
443
+ console.error('[@vxe-ui/plugin-menu 4.3.4] Requires vxe-table 4.7.0+ version. https://vxeui.com/other4/#/plugin-menu/install');
436
444
  }
437
445
  }
438
446
  pluginSetup(options);
@@ -497,6 +505,33 @@ export const VxeUIPluginMenu = {
497
505
  }
498
506
  }
499
507
  },
508
+ /**
509
+ * 用于 mouse-config.area 功能,清除区域范围内的单元格数据
510
+ */
511
+ CLEAR_AREA_CELL: {
512
+ tableMenuMethod(params) {
513
+ const { $table, row, column } = params;
514
+ if (row && column) {
515
+ const tableProps = $table.props;
516
+ const { mouseConfig } = tableProps;
517
+ const { computeMouseOpts } = $table.getComputeMaps();
518
+ const mouseOpts = computeMouseOpts.value;
519
+ if (mouseConfig && mouseOpts.area) {
520
+ const cellAreas = $table.getCellAreas();
521
+ if (cellAreas && cellAreas.length) {
522
+ cellAreas.forEach(areaItem => {
523
+ const { rows, cols } = areaItem;
524
+ cols.forEach(column => {
525
+ rows.forEach(row => {
526
+ $table.clearData(row, column.field);
527
+ });
528
+ });
529
+ });
530
+ }
531
+ }
532
+ }
533
+ }
534
+ },
500
535
  /**
501
536
  * 清除行数据的值
502
537
  */
@@ -789,6 +824,14 @@ export const VxeUIPluginMenu = {
789
824
  handleCopyOrCut(params);
790
825
  }
791
826
  },
827
+ /**
828
+ * 复制单元格数据的值;用于 mouse-config.area 功能,复制区域范围内的单元格数据,支持 Excel 和 WPS
829
+ */
830
+ COPY_AREA_CELL: {
831
+ tableMenuMethod(params) {
832
+ handleCopyOrCut(params);
833
+ }
834
+ },
792
835
  /**
793
836
  * 剪贴单元格数据的值;如果启用 mouse-config.area 功能,则剪贴区域范围内的单元格数据,支持 Excel 和 WPS
794
837
  */
@@ -797,6 +840,14 @@ export const VxeUIPluginMenu = {
797
840
  handleCopyOrCut(params, true);
798
841
  }
799
842
  },
843
+ /**
844
+ * 剪贴单元格数据的值;用于 mouse-config.area 功能,剪贴区域范围内的单元格数据,支持 Excel 和 WPS
845
+ */
846
+ CUT_AREA_CELL: {
847
+ tableMenuMethod(params) {
848
+ handleCopyOrCut(params, true);
849
+ }
850
+ },
800
851
  /**
801
852
  * 粘贴从表格中被复制的数据;如果启用 mouse-config.area 功能,则粘贴区域范围内的单元格数据,不支持读取剪贴板
802
853
  */
@@ -819,6 +870,21 @@ export const VxeUIPluginMenu = {
819
870
  }
820
871
  }
821
872
  },
873
+ /**
874
+ * 粘贴从表格中被复制的数据;用于 mouse-config.area 功能,粘贴区域范围内的单元格数据,不支持读取剪贴板
875
+ */
876
+ PASTE_AREA_CELL: {
877
+ tableMenuMethod(params) {
878
+ const { $event, $table } = params;
879
+ const tableProps = $table.props;
880
+ const { mouseConfig } = tableProps;
881
+ const { computeMouseOpts } = $table.getComputeMaps();
882
+ const mouseOpts = computeMouseOpts.value;
883
+ if (mouseConfig && mouseOpts.area) {
884
+ $table.triggerPasteCellAreaEvent($event);
885
+ }
886
+ }
887
+ },
822
888
  /**
823
889
  * 如果启用 mouse-config.area 功能,如果所选区域内已存在合并单元格,则取消临时合并,否则临时合并
824
890
  */
@@ -1374,7 +1440,12 @@ export const VxeUIPluginMenu = {
1374
1440
  OPEN_FIND: {
1375
1441
  tableMenuMethod(params) {
1376
1442
  const { $event, $table } = params;
1377
- $table.triggerFNROpenEvent($event, 'find');
1443
+ if ($table.triggerFnrOpenEvent) {
1444
+ $table.triggerFnrOpenEvent($event, 'find');
1445
+ }
1446
+ else {
1447
+ $table.triggerFNROpenEvent($event, 'find');
1448
+ }
1378
1449
  }
1379
1450
  },
1380
1451
  /**
@@ -1383,7 +1454,12 @@ export const VxeUIPluginMenu = {
1383
1454
  OPEN_REPLACE: {
1384
1455
  tableMenuMethod(params) {
1385
1456
  const { $event, $table } = params;
1386
- $table.triggerFNROpenEvent($event, 'replace');
1457
+ if ($table.triggerFnrOpenEvent) {
1458
+ $table.triggerFnrOpenEvent($event, 'replace');
1459
+ }
1460
+ else {
1461
+ $table.triggerFNROpenEvent($event, 'replace');
1462
+ }
1387
1463
  }
1388
1464
  },
1389
1465
  /**