@vxe-ui/plugin-menu 3.3.4 → 3.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/es/index.js CHANGED
@@ -1,6 +1,15 @@
1
1
  import XEUtils from 'xe-utils';
2
2
  let VxeUI;
3
3
  let handleCopy;
4
+ /**
5
+ * 用于开关类型的配置项
6
+ * 局部启用规则:conf={}
7
+ * 局部禁用规则:conf={enabled:false}
8
+ * 全局默认启用规则:conf.enabled=true
9
+ */
10
+ export function hasEnableConf(conf, opts) {
11
+ return opts && (conf ? opts.enabled !== false : opts.enabled);
12
+ }
4
13
  const columnIndexOf = (cols, column) => {
5
14
  return XEUtils.findIndexOf(cols, item => item.id === column.id);
6
15
  };
@@ -75,7 +84,7 @@ function handleCopyOrCut(params, isCut) {
75
84
  const { mouseConfig } = props;
76
85
  const mouseOpts = $table.computeMouseOpts;
77
86
  let text = '';
78
- if (mouseConfig && mouseOpts.area) {
87
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
79
88
  if (isCut) {
80
89
  $table.triggerCutCellAreaEvent($event);
81
90
  }
@@ -138,7 +147,7 @@ function getBeenMerges(params) {
138
147
  const mouseOpts = $table.computeMouseOpts;
139
148
  const { visibleData } = $table.getTableData();
140
149
  const { visibleColumn } = $table.getTableColumn();
141
- const cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
150
+ const cellAreas = hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area ? $table.getCellAreas() : [];
142
151
  const mergeList = $table.getMergeCells();
143
152
  return mergeList.filter(({ row: mergeRowIndex, col: mergeColIndex, rowspan: mergeRowspan, colspan: mergeColspan }) => {
144
153
  return cellAreas.some(areaItem => {
@@ -270,7 +279,7 @@ function checkPrivilege(item, params) {
270
279
  }
271
280
  case 'OPEN_FIND':
272
281
  case 'OPEN_REPLACE': {
273
- item.disabled = !(mouseConfig && mouseOpts.area);
282
+ item.disabled = !(hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area);
274
283
  break;
275
284
  }
276
285
  case 'EDIT_CELL': {
@@ -283,7 +292,7 @@ function checkPrivilege(item, params) {
283
292
  case 'CUT_AREA_CELL':
284
293
  case 'PASTE_CELL':
285
294
  case 'PASTE_AREA_CELL': {
286
- const cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
295
+ const cellAreas = hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area ? $table.getCellAreas() : [];
287
296
  item.disabled = cellAreas.length > 1;
288
297
  if (!item.disabled) {
289
298
  switch (code) {
@@ -299,7 +308,7 @@ function checkPrivilege(item, params) {
299
308
  }
300
309
  case 'MERGE_OR_CLEAR':
301
310
  case 'MERGE_CELL': {
302
- const cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
311
+ const cellAreas = hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area ? $table.getCellAreas() : [];
303
312
  item.disabled = !cellAreas.length || (cellAreas.length === 1 && cellAreas[0].rows.length === 1 && cellAreas[0].cols.length === 1) || !checkCellOverlay(params, cellAreas);
304
313
  break;
305
314
  }
@@ -432,12 +441,12 @@ export const VxeUIPluginMenu = {
432
441
  const pVersion = 3;
433
442
  const sVersion = 13;
434
443
  if (!VxeUI.checkVersion(VxeUI.tableVersion, pVersion, sVersion)) {
435
- console.error(`[@vxe-ui/plugin-menu 3.3.4] ${VxeUI.getI18n('vxe.error.errorVersion', [`vxe-table@${VxeUI.tableVersion || '?'}`, `vxe-table v${pVersion}.${sVersion}+`])}`);
444
+ console.error(`[@vxe-ui/plugin-menu 3.4.0] ${VxeUI.getI18n('vxe.error.errorVersion', [`vxe-table@${VxeUI.tableVersion || '?'}`, `vxe-table v${pVersion}.${sVersion}+`])}`);
436
445
  }
437
446
  }
438
447
  else {
439
448
  if (!/^(3)\./.test(VxeUI.uiVersion || VxeUI.tableVersion)) {
440
- console.error('[@vxe-ui/plugin-menu 3.3.4] Requires vxe-table 3.9.0+ version. https://vxeui.com/other3/#/plugin-menu/install');
449
+ console.error('[@vxe-ui/plugin-menu 3.4.0] Requires vxe-table 3.9.0+ version. https://vxeui.com/other3/#/plugin-menu/install');
441
450
  }
442
451
  }
443
452
  pluginConfig(options);
@@ -482,7 +491,7 @@ export const VxeUIPluginMenu = {
482
491
  const tableProps = $table;
483
492
  const { mouseConfig } = tableProps;
484
493
  const mouseOpts = $table.computeMouseOpts;
485
- if (mouseConfig && mouseOpts.area) {
494
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
486
495
  const cellAreas = $table.getCellAreas();
487
496
  if (cellAreas && cellAreas.length) {
488
497
  cellAreas.forEach(areaItem => {
@@ -511,7 +520,7 @@ export const VxeUIPluginMenu = {
511
520
  const tableProps = $table;
512
521
  const { mouseConfig } = tableProps;
513
522
  const mouseOpts = $table.computeMouseOpts;
514
- if (mouseConfig && mouseOpts.area) {
523
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
515
524
  const cellAreas = $table.getCellAreas();
516
525
  if (cellAreas && cellAreas.length) {
517
526
  cellAreas.forEach(areaItem => {
@@ -559,8 +568,8 @@ export const VxeUIPluginMenu = {
559
568
  const tableProps = $table;
560
569
  const { mouseConfig } = tableProps;
561
570
  const mouseOpts = $table.computeMouseOpts;
562
- if (mouseConfig && mouseOpts.area) {
563
- const cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
571
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
572
+ const cellAreas = mouseOpts.area ? $table.getCellAreas() : [];
564
573
  cellAreas.forEach(areaItem => {
565
574
  const { rows, cols } = areaItem;
566
575
  rows.forEach(row => {
@@ -595,7 +604,7 @@ export const VxeUIPluginMenu = {
595
604
  const tableProps = $table;
596
605
  const { mouseConfig } = tableProps;
597
606
  const mouseOpts = $table.computeMouseOpts;
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([{
@@ -616,7 +625,7 @@ export const VxeUIPluginMenu = {
616
625
  const tableProps = $table;
617
626
  const { mouseConfig } = tableProps;
618
627
  const mouseOpts = $table.computeMouseOpts;
619
- if (mouseConfig && mouseOpts.area) {
628
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
620
629
  const { visibleColumn } = $table.getTableColumn();
621
630
  const cellAreas = $table.getCellAreas();
622
631
  if (cellAreas.length === 1) {
@@ -648,7 +657,7 @@ export const VxeUIPluginMenu = {
648
657
  const tableProps = $table;
649
658
  const { mouseConfig } = tableProps;
650
659
  const mouseOpts = $table.computeMouseOpts;
651
- if (mouseConfig && mouseOpts.area) {
660
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
652
661
  const { visibleColumn } = $table.getTableColumn();
653
662
  const cellAreas = $table.getCellAreas();
654
663
  if (cellAreas.length === 1) {
@@ -680,7 +689,7 @@ export const VxeUIPluginMenu = {
680
689
  const tableProps = $table;
681
690
  const { mouseConfig } = tableProps;
682
691
  const mouseOpts = $table.computeMouseOpts;
683
- if (mouseConfig && mouseOpts.area) {
692
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
684
693
  const { visibleData } = $table.getTableData();
685
694
  const cellAreas = $table.getCellAreas();
686
695
  if (cellAreas.length === 1) {
@@ -712,7 +721,7 @@ export const VxeUIPluginMenu = {
712
721
  const tableProps = $table;
713
722
  const { mouseConfig } = tableProps;
714
723
  const mouseOpts = $table.computeMouseOpts;
715
- if (mouseConfig && mouseOpts.area) {
724
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
716
725
  const { visibleData } = $table.getTableData();
717
726
  const cellAreas = $table.getCellAreas();
718
727
  if (cellAreas.length === 1) {
@@ -745,7 +754,7 @@ export const VxeUIPluginMenu = {
745
754
  const tableProps = $table;
746
755
  const { mouseConfig } = tableProps;
747
756
  const mouseOpts = $table.computeMouseOpts;
748
- if (mouseConfig && mouseOpts.area) {
757
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
749
758
  const cellAreas = $table.getCellAreas();
750
759
  if (cellAreas && cellAreas.length) {
751
760
  cellAreas.forEach(areaItem => {
@@ -852,7 +861,7 @@ export const VxeUIPluginMenu = {
852
861
  const tableProps = $table;
853
862
  const { mouseConfig } = tableProps;
854
863
  const mouseOpts = $table.computeMouseOpts;
855
- if (mouseConfig && mouseOpts.area) {
864
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
856
865
  $table.triggerPasteCellAreaEvent($event);
857
866
  }
858
867
  else {
@@ -873,7 +882,7 @@ export const VxeUIPluginMenu = {
873
882
  const tableProps = $table;
874
883
  const { mouseConfig } = tableProps;
875
884
  const mouseOpts = $table.computeMouseOpts;
876
- if (mouseConfig && mouseOpts.area) {
885
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
877
886
  $table.triggerPasteCellAreaEvent($event);
878
887
  }
879
888
  }
@@ -998,7 +1007,7 @@ export const VxeUIPluginMenu = {
998
1007
  const { mouseConfig } = tableProps;
999
1008
  const mouseOpts = $table.computeMouseOpts;
1000
1009
  $table.insert(menu.params || {}).then(({ rows }) => {
1001
- if (column && mouseConfig && mouseOpts.area) {
1010
+ if (column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1002
1011
  $table.setCellAreas([
1003
1012
  { startRow: XEUtils.first(rows), endRow: XEUtils.last(rows), startColumn: column, endColumn: column }
1004
1013
  ]);
@@ -1016,7 +1025,7 @@ export const VxeUIPluginMenu = {
1016
1025
  const { mouseConfig } = tableProps;
1017
1026
  const mouseOpts = $table.computeMouseOpts;
1018
1027
  (row ? $table.insertAt(menu.params || {}, row) : $table.insert(menu.params || {})).then(({ rows }) => {
1019
- if (column && mouseConfig && mouseOpts.area) {
1028
+ if (column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1020
1029
  $table.setCellAreas([
1021
1030
  { startRow: XEUtils.first(rows), endRow: XEUtils.last(rows), startColumn: column, endColumn: column }
1022
1031
  ]);
@@ -1037,7 +1046,7 @@ export const VxeUIPluginMenu = {
1037
1046
  if (size) {
1038
1047
  const records = XEUtils.range(0, size).map(() => Object.assign({}, menu.params));
1039
1048
  (row ? $table.insertAt(records, row) : $table.insert(records)).then(({ rows }) => {
1040
- if (column && mouseConfig && mouseOpts.area) {
1049
+ if (column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1041
1050
  $table.setCellAreas([
1042
1051
  { startRow: XEUtils.first(rows), endRow: XEUtils.last(rows), startColumn: column, endColumn: column }
1043
1052
  ]);
@@ -1057,7 +1066,7 @@ export const VxeUIPluginMenu = {
1057
1066
  const { mouseConfig } = tableProps;
1058
1067
  const mouseOpts = $table.computeMouseOpts;
1059
1068
  (row ? $table.insertNextAt(menu.params || {}, row) : $table.insert(menu.params || {})).then(({ rows }) => {
1060
- if (column && mouseConfig && mouseOpts.area) {
1069
+ if (column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1061
1070
  $table.setCellAreas([
1062
1071
  { startRow: XEUtils.first(rows), endRow: XEUtils.last(rows), startColumn: column, endColumn: column }
1063
1072
  ]);
@@ -1078,7 +1087,7 @@ export const VxeUIPluginMenu = {
1078
1087
  if (size) {
1079
1088
  const records = XEUtils.range(0, size).map(() => Object.assign({}, menu.params));
1080
1089
  (row ? $table.insertNextAt(records, row) : $table.insert(records)).then(({ rows }) => {
1081
- if (column && mouseConfig && mouseOpts.area) {
1090
+ if (column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1082
1091
  $table.setCellAreas([
1083
1092
  { startRow: XEUtils.first(rows), endRow: XEUtils.last(rows), startColumn: column, endColumn: column }
1084
1093
  ]);
@@ -1251,8 +1260,8 @@ export const VxeUIPluginMenu = {
1251
1260
  const tableProps = $table;
1252
1261
  const { mouseConfig } = tableProps;
1253
1262
  const mouseOpts = $table.computeMouseOpts;
1254
- if (mouseConfig && mouseOpts.area) {
1255
- const cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
1263
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1264
+ const cellAreas = $table.getCellAreas();
1256
1265
  cellAreas.forEach(areaItem => {
1257
1266
  const { rows } = areaItem;
1258
1267
  $table.remove(rows);
@@ -4,10 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = exports.VxeUIPluginMenu = void 0;
7
+ exports.hasEnableConf = hasEnableConf;
7
8
  var _xeUtils = _interopRequireDefault(require("xe-utils"));
8
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
10
  var VxeUI;
10
11
  var handleCopy;
12
+ /**
13
+ * 用于开关类型的配置项
14
+ * 局部启用规则:conf={}
15
+ * 局部禁用规则:conf={enabled:false}
16
+ * 全局默认启用规则:conf.enabled=true
17
+ */
18
+ function hasEnableConf(conf, opts) {
19
+ return opts && (conf ? opts.enabled !== false : opts.enabled);
20
+ }
11
21
  var columnIndexOf = function columnIndexOf(cols, column) {
12
22
  return _xeUtils["default"].findIndexOf(cols, function (item) {
13
23
  return item.id === column.id;
@@ -86,7 +96,7 @@ function handleCopyOrCut(params, isCut) {
86
96
  var mouseConfig = props.mouseConfig;
87
97
  var mouseOpts = $table.computeMouseOpts;
88
98
  var text = '';
89
- if (mouseConfig && mouseOpts.area) {
99
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
90
100
  if (isCut) {
91
101
  $table.triggerCutCellAreaEvent($event);
92
102
  } else {
@@ -154,7 +164,7 @@ function getBeenMerges(params) {
154
164
  visibleData = _$table$getTableData2.visibleData;
155
165
  var _$table$getTableColum2 = $table.getTableColumn(),
156
166
  visibleColumn = _$table$getTableColum2.visibleColumn;
157
- var cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
167
+ var cellAreas = hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area ? $table.getCellAreas() : [];
158
168
  var mergeList = $table.getMergeCells();
159
169
  return mergeList.filter(function (_ref) {
160
170
  var mergeRowIndex = _ref.row,
@@ -313,7 +323,7 @@ function checkPrivilege(item, params) {
313
323
  case 'OPEN_FIND':
314
324
  case 'OPEN_REPLACE':
315
325
  {
316
- item.disabled = !(mouseConfig && mouseOpts.area);
326
+ item.disabled = !(hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area);
317
327
  break;
318
328
  }
319
329
  case 'EDIT_CELL':
@@ -328,7 +338,7 @@ function checkPrivilege(item, params) {
328
338
  case 'PASTE_CELL':
329
339
  case 'PASTE_AREA_CELL':
330
340
  {
331
- var cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
341
+ var cellAreas = hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area ? $table.getCellAreas() : [];
332
342
  item.disabled = cellAreas.length > 1;
333
343
  if (!item.disabled) {
334
344
  switch (code) {
@@ -346,7 +356,7 @@ function checkPrivilege(item, params) {
346
356
  case 'MERGE_OR_CLEAR':
347
357
  case 'MERGE_CELL':
348
358
  {
349
- var _cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
359
+ var _cellAreas = hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area ? $table.getCellAreas() : [];
350
360
  item.disabled = !_cellAreas.length || _cellAreas.length === 1 && _cellAreas[0].rows.length === 1 && _cellAreas[0].cols.length === 1 || !checkCellOverlay(params, _cellAreas);
351
361
  break;
352
362
  }
@@ -477,11 +487,11 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
477
487
  var pVersion = 3;
478
488
  var sVersion = 13;
479
489
  if (!VxeUI.checkVersion(VxeUI.tableVersion, pVersion, sVersion)) {
480
- console.error("[@vxe-ui/plugin-menu 3.3.4] ".concat(VxeUI.getI18n('vxe.error.errorVersion', ["vxe-table@".concat(VxeUI.tableVersion || '?'), "vxe-table v".concat(pVersion, ".").concat(sVersion, "+")])));
490
+ console.error("[@vxe-ui/plugin-menu 3.4.0] ".concat(VxeUI.getI18n('vxe.error.errorVersion', ["vxe-table@".concat(VxeUI.tableVersion || '?'), "vxe-table v".concat(pVersion, ".").concat(sVersion, "+")])));
481
491
  }
482
492
  } else {
483
493
  if (!/^(3)\./.test(VxeUI.uiVersion || VxeUI.tableVersion)) {
484
- console.error('[@vxe-ui/plugin-menu 3.3.4] Requires vxe-table 3.9.0+ version. https://vxeui.com/other3/#/plugin-menu/install');
494
+ console.error('[@vxe-ui/plugin-menu 3.4.0] Requires vxe-table 3.9.0+ version. https://vxeui.com/other3/#/plugin-menu/install');
485
495
  }
486
496
  }
487
497
  pluginConfig(options);
@@ -528,7 +538,7 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
528
538
  var tableProps = $table;
529
539
  var mouseConfig = tableProps.mouseConfig;
530
540
  var mouseOpts = $table.computeMouseOpts;
531
- if (mouseConfig && mouseOpts.area) {
541
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
532
542
  var cellAreas = $table.getCellAreas();
533
543
  if (cellAreas && cellAreas.length) {
534
544
  cellAreas.forEach(function (areaItem) {
@@ -559,7 +569,7 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
559
569
  var tableProps = $table;
560
570
  var mouseConfig = tableProps.mouseConfig;
561
571
  var mouseOpts = $table.computeMouseOpts;
562
- if (mouseConfig && mouseOpts.area) {
572
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
563
573
  var cellAreas = $table.getCellAreas();
564
574
  if (cellAreas && cellAreas.length) {
565
575
  cellAreas.forEach(function (areaItem) {
@@ -610,8 +620,8 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
610
620
  var tableProps = $table;
611
621
  var mouseConfig = tableProps.mouseConfig;
612
622
  var mouseOpts = $table.computeMouseOpts;
613
- if (mouseConfig && mouseOpts.area) {
614
- var cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
623
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
624
+ var cellAreas = mouseOpts.area ? $table.getCellAreas() : [];
615
625
  cellAreas.forEach(function (areaItem) {
616
626
  var rows = areaItem.rows,
617
627
  cols = areaItem.cols;
@@ -646,7 +656,7 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
646
656
  var tableProps = $table;
647
657
  var mouseConfig = tableProps.mouseConfig;
648
658
  var mouseOpts = $table.computeMouseOpts;
649
- if (mouseConfig && mouseOpts.area) {
659
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
650
660
  var _$table$getTableData4 = $table.getTableData(),
651
661
  visibleData = _$table$getTableData4.visibleData;
652
662
  var _$table$getTableColum4 = $table.getTableColumn(),
@@ -671,7 +681,7 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
671
681
  var tableProps = $table;
672
682
  var mouseConfig = tableProps.mouseConfig;
673
683
  var mouseOpts = $table.computeMouseOpts;
674
- if (mouseConfig && mouseOpts.area) {
684
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
675
685
  var _$table$getTableColum5 = $table.getTableColumn(),
676
686
  visibleColumn = _$table$getTableColum5.visibleColumn;
677
687
  var cellAreas = $table.getCellAreas();
@@ -711,7 +721,7 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
711
721
  var tableProps = $table;
712
722
  var mouseConfig = tableProps.mouseConfig;
713
723
  var mouseOpts = $table.computeMouseOpts;
714
- if (mouseConfig && mouseOpts.area) {
724
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
715
725
  var _$table$getTableColum6 = $table.getTableColumn(),
716
726
  visibleColumn = _$table$getTableColum6.visibleColumn;
717
727
  var cellAreas = $table.getCellAreas();
@@ -751,7 +761,7 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
751
761
  var tableProps = $table;
752
762
  var mouseConfig = tableProps.mouseConfig;
753
763
  var mouseOpts = $table.computeMouseOpts;
754
- if (mouseConfig && mouseOpts.area) {
764
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
755
765
  var _$table$getTableData5 = $table.getTableData(),
756
766
  visibleData = _$table$getTableData5.visibleData;
757
767
  var cellAreas = $table.getCellAreas();
@@ -791,7 +801,7 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
791
801
  var tableProps = $table;
792
802
  var mouseConfig = tableProps.mouseConfig;
793
803
  var mouseOpts = $table.computeMouseOpts;
794
- if (mouseConfig && mouseOpts.area) {
804
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
795
805
  var _$table$getTableData6 = $table.getTableData(),
796
806
  visibleData = _$table$getTableData6.visibleData;
797
807
  var cellAreas = $table.getCellAreas();
@@ -832,7 +842,7 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
832
842
  var tableProps = $table;
833
843
  var mouseConfig = tableProps.mouseConfig;
834
844
  var mouseOpts = $table.computeMouseOpts;
835
- if (mouseConfig && mouseOpts.area) {
845
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
836
846
  var cellAreas = $table.getCellAreas();
837
847
  if (cellAreas && cellAreas.length) {
838
848
  cellAreas.forEach(function (areaItem) {
@@ -942,7 +952,7 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
942
952
  var tableProps = $table;
943
953
  var mouseConfig = tableProps.mouseConfig;
944
954
  var mouseOpts = $table.computeMouseOpts;
945
- if (mouseConfig && mouseOpts.area) {
955
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
946
956
  $table.triggerPasteCellAreaEvent($event);
947
957
  } else {
948
958
  var clipboard = getClipboardObj();
@@ -963,7 +973,7 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
963
973
  var tableProps = $table;
964
974
  var mouseConfig = tableProps.mouseConfig;
965
975
  var mouseOpts = $table.computeMouseOpts;
966
- if (mouseConfig && mouseOpts.area) {
976
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
967
977
  $table.triggerPasteCellAreaEvent($event);
968
978
  }
969
979
  }
@@ -1134,7 +1144,7 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
1134
1144
  var mouseOpts = $table.computeMouseOpts;
1135
1145
  $table.insert(menu.params || {}).then(function (_ref7) {
1136
1146
  var rows = _ref7.rows;
1137
- if (column && mouseConfig && mouseOpts.area) {
1147
+ if (column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1138
1148
  $table.setCellAreas([{
1139
1149
  startRow: _xeUtils["default"].first(rows),
1140
1150
  endRow: _xeUtils["default"].last(rows),
@@ -1159,7 +1169,7 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
1159
1169
  var mouseOpts = $table.computeMouseOpts;
1160
1170
  (row ? $table.insertAt(menu.params || {}, row) : $table.insert(menu.params || {})).then(function (_ref8) {
1161
1171
  var rows = _ref8.rows;
1162
- if (column && mouseConfig && mouseOpts.area) {
1172
+ if (column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1163
1173
  $table.setCellAreas([{
1164
1174
  startRow: _xeUtils["default"].first(rows),
1165
1175
  endRow: _xeUtils["default"].last(rows),
@@ -1190,7 +1200,7 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
1190
1200
  });
1191
1201
  (row ? $table.insertAt(records, row) : $table.insert(records)).then(function (_ref0) {
1192
1202
  var rows = _ref0.rows;
1193
- if (column && mouseConfig && mouseOpts.area) {
1203
+ if (column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1194
1204
  $table.setCellAreas([{
1195
1205
  startRow: _xeUtils["default"].first(rows),
1196
1206
  endRow: _xeUtils["default"].last(rows),
@@ -1217,7 +1227,7 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
1217
1227
  var mouseOpts = $table.computeMouseOpts;
1218
1228
  (row ? $table.insertNextAt(menu.params || {}, row) : $table.insert(menu.params || {})).then(function (_ref1) {
1219
1229
  var rows = _ref1.rows;
1220
- if (column && mouseConfig && mouseOpts.area) {
1230
+ if (column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1221
1231
  $table.setCellAreas([{
1222
1232
  startRow: _xeUtils["default"].first(rows),
1223
1233
  endRow: _xeUtils["default"].last(rows),
@@ -1248,7 +1258,7 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
1248
1258
  });
1249
1259
  (row ? $table.insertNextAt(records, row) : $table.insert(records)).then(function (_ref11) {
1250
1260
  var rows = _ref11.rows;
1251
- if (column && mouseConfig && mouseOpts.area) {
1261
+ if (column && hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1252
1262
  $table.setCellAreas([{
1253
1263
  startRow: _xeUtils["default"].first(rows),
1254
1264
  endRow: _xeUtils["default"].last(rows),
@@ -1451,8 +1461,8 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
1451
1461
  var tableProps = $table;
1452
1462
  var mouseConfig = tableProps.mouseConfig;
1453
1463
  var mouseOpts = $table.computeMouseOpts;
1454
- if (mouseConfig && mouseOpts.area) {
1455
- var cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
1464
+ if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area) {
1465
+ var cellAreas = $table.getCellAreas();
1456
1466
  cellAreas.forEach(function (areaItem) {
1457
1467
  var rows = areaItem.rows;
1458
1468
  $table.remove(rows);