@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/LICENSE +20 -20
- package/README.md +149 -149
- package/dist/index.umd.js +118 -38
- package/dist/index.umd.min.js +1 -1
- package/es/index.esm.js +83 -7
- package/es/index.js +83 -7
- package/lib/index.common.js +113 -33
- package/lib/index.js +113 -33
- package/lib/index.umd.js +118 -38
- package/lib/index.umd.min.js +1 -1
- package/package.json +77 -77
- package/src/index.ts +1562 -1488
- package/types/index.d.ts +15 -15
package/lib/index.js
CHANGED
|
@@ -88,7 +88,7 @@ function handleCopyOrCut(params, isCut) {
|
|
|
88
88
|
var _$table$getComputeMap = $table.getComputeMaps(),
|
|
89
89
|
computeMouseOpts = _$table$getComputeMap.computeMouseOpts;
|
|
90
90
|
var mouseOpts = computeMouseOpts.value;
|
|
91
|
-
var text
|
|
91
|
+
var text;
|
|
92
92
|
if (mouseConfig && mouseOpts.area) {
|
|
93
93
|
if (isCut) {
|
|
94
94
|
$table.triggerCutCellAreaEvent($event);
|
|
@@ -251,10 +251,14 @@ function checkPrivilege(item, params) {
|
|
|
251
251
|
}
|
|
252
252
|
case 'EDIT_CELL':
|
|
253
253
|
case 'CLEAR_CELL':
|
|
254
|
+
case 'CLEAR_AREA_CELL':
|
|
254
255
|
case 'CLEAR_ROW':
|
|
255
256
|
case 'COPY_CELL':
|
|
257
|
+
case 'COPY_AREA_CELL':
|
|
256
258
|
case 'CUT_CELL':
|
|
259
|
+
case 'CUT_AREA_CELL':
|
|
257
260
|
case 'PASTE_CELL':
|
|
261
|
+
case 'PASTE_AREA_CELL':
|
|
258
262
|
case 'MERGE_OR_CLEAR':
|
|
259
263
|
case 'MERGE_CELL':
|
|
260
264
|
case 'REVERT_CELL':
|
|
@@ -325,14 +329,18 @@ function checkPrivilege(item, params) {
|
|
|
325
329
|
break;
|
|
326
330
|
}
|
|
327
331
|
case 'COPY_CELL':
|
|
332
|
+
case 'COPY_AREA_CELL':
|
|
328
333
|
case 'CUT_CELL':
|
|
334
|
+
case 'CUT_AREA_CELL':
|
|
329
335
|
case 'PASTE_CELL':
|
|
336
|
+
case 'PASTE_AREA_CELL':
|
|
330
337
|
{
|
|
331
338
|
var cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
|
|
332
339
|
item.disabled = cellAreas.length > 1;
|
|
333
340
|
if (!item.disabled) {
|
|
334
341
|
switch (code) {
|
|
335
342
|
case 'PASTE_CELL':
|
|
343
|
+
case 'PASTE_AREA_CELL':
|
|
336
344
|
{
|
|
337
345
|
var clipboard = getClipboardObj();
|
|
338
346
|
item.disabled = !clipboard || !clipboard.text;
|
|
@@ -475,11 +483,11 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
475
483
|
var pVersion = 4;
|
|
476
484
|
var sVersion = 11;
|
|
477
485
|
if (!VxeUI.checkVersion(VxeUI.tableVersion, pVersion, sVersion)) {
|
|
478
|
-
console.error("[@vxe-ui/plugin-menu 4.3.
|
|
486
|
+
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"));
|
|
479
487
|
}
|
|
480
488
|
} else {
|
|
481
489
|
if (!/^(4)\./.test(VxeUI.uiVersion || VxeUI.tableVersion)) {
|
|
482
|
-
console.error('[@vxe-ui/plugin-menu 4.3.
|
|
490
|
+
console.error('[@vxe-ui/plugin-menu 4.3.4] Requires vxe-table 4.7.0+ version. https://vxeui.com/other4/#/plugin-menu/install');
|
|
483
491
|
}
|
|
484
492
|
}
|
|
485
493
|
pluginSetup(options);
|
|
@@ -547,6 +555,37 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
547
555
|
}
|
|
548
556
|
}
|
|
549
557
|
},
|
|
558
|
+
/**
|
|
559
|
+
* 用于 mouse-config.area 功能,清除区域范围内的单元格数据
|
|
560
|
+
*/
|
|
561
|
+
CLEAR_AREA_CELL: {
|
|
562
|
+
tableMenuMethod: function tableMenuMethod(params) {
|
|
563
|
+
var $table = params.$table,
|
|
564
|
+
row = params.row,
|
|
565
|
+
column = params.column;
|
|
566
|
+
if (row && column) {
|
|
567
|
+
var tableProps = $table.props;
|
|
568
|
+
var mouseConfig = tableProps.mouseConfig;
|
|
569
|
+
var _$table$getComputeMap5 = $table.getComputeMaps(),
|
|
570
|
+
computeMouseOpts = _$table$getComputeMap5.computeMouseOpts;
|
|
571
|
+
var mouseOpts = computeMouseOpts.value;
|
|
572
|
+
if (mouseConfig && mouseOpts.area) {
|
|
573
|
+
var cellAreas = $table.getCellAreas();
|
|
574
|
+
if (cellAreas && cellAreas.length) {
|
|
575
|
+
cellAreas.forEach(function (areaItem) {
|
|
576
|
+
var rows = areaItem.rows,
|
|
577
|
+
cols = areaItem.cols;
|
|
578
|
+
cols.forEach(function (column) {
|
|
579
|
+
rows.forEach(function (row) {
|
|
580
|
+
$table.clearData(row, column.field);
|
|
581
|
+
});
|
|
582
|
+
});
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
},
|
|
550
589
|
/**
|
|
551
590
|
* 清除行数据的值
|
|
552
591
|
*/
|
|
@@ -578,8 +617,8 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
578
617
|
column = params.column;
|
|
579
618
|
var tableProps = $table.props;
|
|
580
619
|
var mouseConfig = tableProps.mouseConfig;
|
|
581
|
-
var _$table$
|
|
582
|
-
computeMouseOpts = _$table$
|
|
620
|
+
var _$table$getComputeMap6 = $table.getComputeMaps(),
|
|
621
|
+
computeMouseOpts = _$table$getComputeMap6.computeMouseOpts;
|
|
583
622
|
var mouseOpts = computeMouseOpts.value;
|
|
584
623
|
if (mouseConfig && mouseOpts.area) {
|
|
585
624
|
var cellAreas = mouseConfig && mouseOpts.area ? $table.getCellAreas() : [];
|
|
@@ -611,8 +650,8 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
611
650
|
var $table = params.$table;
|
|
612
651
|
var tableProps = $table.props;
|
|
613
652
|
var mouseConfig = tableProps.mouseConfig;
|
|
614
|
-
var _$table$
|
|
615
|
-
computeMouseOpts = _$table$
|
|
653
|
+
var _$table$getComputeMap7 = $table.getComputeMaps(),
|
|
654
|
+
computeMouseOpts = _$table$getComputeMap7.computeMouseOpts;
|
|
616
655
|
var mouseOpts = computeMouseOpts.value;
|
|
617
656
|
if (mouseConfig && mouseOpts.area) {
|
|
618
657
|
var _$table$getTableData4 = $table.getTableData(),
|
|
@@ -638,8 +677,8 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
638
677
|
column = params.column;
|
|
639
678
|
var tableProps = $table.props;
|
|
640
679
|
var mouseConfig = tableProps.mouseConfig;
|
|
641
|
-
var _$table$
|
|
642
|
-
computeMouseOpts = _$table$
|
|
680
|
+
var _$table$getComputeMap8 = $table.getComputeMaps(),
|
|
681
|
+
computeMouseOpts = _$table$getComputeMap8.computeMouseOpts;
|
|
643
682
|
var mouseOpts = computeMouseOpts.value;
|
|
644
683
|
if (row && column && mouseConfig && mouseOpts.area) {
|
|
645
684
|
var _$table$getTableColum5 = $table.getTableColumn(),
|
|
@@ -680,8 +719,8 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
680
719
|
column = params.column;
|
|
681
720
|
var tableProps = $table.props;
|
|
682
721
|
var mouseConfig = tableProps.mouseConfig;
|
|
683
|
-
var _$table$
|
|
684
|
-
computeMouseOpts = _$table$
|
|
722
|
+
var _$table$getComputeMap9 = $table.getComputeMaps(),
|
|
723
|
+
computeMouseOpts = _$table$getComputeMap9.computeMouseOpts;
|
|
685
724
|
var mouseOpts = computeMouseOpts.value;
|
|
686
725
|
if (row && column && mouseConfig && mouseOpts.area) {
|
|
687
726
|
var _$table$getTableColum6 = $table.getTableColumn(),
|
|
@@ -722,8 +761,8 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
722
761
|
column = params.column;
|
|
723
762
|
var tableProps = $table.props;
|
|
724
763
|
var mouseConfig = tableProps.mouseConfig;
|
|
725
|
-
var _$table$
|
|
726
|
-
computeMouseOpts = _$table$
|
|
764
|
+
var _$table$getComputeMap0 = $table.getComputeMaps(),
|
|
765
|
+
computeMouseOpts = _$table$getComputeMap0.computeMouseOpts;
|
|
727
766
|
var mouseOpts = computeMouseOpts.value;
|
|
728
767
|
if (row && column && mouseConfig && mouseOpts.area) {
|
|
729
768
|
var _$table$getTableData5 = $table.getTableData(),
|
|
@@ -764,8 +803,8 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
764
803
|
column = params.column;
|
|
765
804
|
var tableProps = $table.props;
|
|
766
805
|
var mouseConfig = tableProps.mouseConfig;
|
|
767
|
-
var _$table$
|
|
768
|
-
computeMouseOpts = _$table$
|
|
806
|
+
var _$table$getComputeMap1 = $table.getComputeMaps(),
|
|
807
|
+
computeMouseOpts = _$table$getComputeMap1.computeMouseOpts;
|
|
769
808
|
var mouseOpts = computeMouseOpts.value;
|
|
770
809
|
if (row && column && mouseConfig && mouseOpts.area) {
|
|
771
810
|
var _$table$getTableData6 = $table.getTableData(),
|
|
@@ -807,8 +846,8 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
807
846
|
if (row && column) {
|
|
808
847
|
var tableProps = $table.props;
|
|
809
848
|
var mouseConfig = tableProps.mouseConfig;
|
|
810
|
-
var _$table$
|
|
811
|
-
computeMouseOpts = _$table$
|
|
849
|
+
var _$table$getComputeMap10 = $table.getComputeMaps(),
|
|
850
|
+
computeMouseOpts = _$table$getComputeMap10.computeMouseOpts;
|
|
812
851
|
var mouseOpts = computeMouseOpts.value;
|
|
813
852
|
if (mouseConfig && mouseOpts.area) {
|
|
814
853
|
var cellAreas = $table.getCellAreas();
|
|
@@ -884,6 +923,14 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
884
923
|
handleCopyOrCut(params);
|
|
885
924
|
}
|
|
886
925
|
},
|
|
926
|
+
/**
|
|
927
|
+
* 复制单元格数据的值;用于 mouse-config.area 功能,复制区域范围内的单元格数据,支持 Excel 和 WPS
|
|
928
|
+
*/
|
|
929
|
+
COPY_AREA_CELL: {
|
|
930
|
+
tableMenuMethod: function tableMenuMethod(params) {
|
|
931
|
+
handleCopyOrCut(params);
|
|
932
|
+
}
|
|
933
|
+
},
|
|
887
934
|
/**
|
|
888
935
|
* 剪贴单元格数据的值;如果启用 mouse-config.area 功能,则剪贴区域范围内的单元格数据,支持 Excel 和 WPS
|
|
889
936
|
*/
|
|
@@ -892,6 +939,14 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
892
939
|
handleCopyOrCut(params, true);
|
|
893
940
|
}
|
|
894
941
|
},
|
|
942
|
+
/**
|
|
943
|
+
* 剪贴单元格数据的值;用于 mouse-config.area 功能,剪贴区域范围内的单元格数据,支持 Excel 和 WPS
|
|
944
|
+
*/
|
|
945
|
+
CUT_AREA_CELL: {
|
|
946
|
+
tableMenuMethod: function tableMenuMethod(params) {
|
|
947
|
+
handleCopyOrCut(params, true);
|
|
948
|
+
}
|
|
949
|
+
},
|
|
895
950
|
/**
|
|
896
951
|
* 粘贴从表格中被复制的数据;如果启用 mouse-config.area 功能,则粘贴区域范围内的单元格数据,不支持读取剪贴板
|
|
897
952
|
*/
|
|
@@ -903,8 +958,8 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
903
958
|
column = params.column;
|
|
904
959
|
var tableProps = $table.props;
|
|
905
960
|
var mouseConfig = tableProps.mouseConfig;
|
|
906
|
-
var _$table$
|
|
907
|
-
computeMouseOpts = _$table$
|
|
961
|
+
var _$table$getComputeMap11 = $table.getComputeMaps(),
|
|
962
|
+
computeMouseOpts = _$table$getComputeMap11.computeMouseOpts;
|
|
908
963
|
var mouseOpts = computeMouseOpts.value;
|
|
909
964
|
if (mouseConfig && mouseOpts.area) {
|
|
910
965
|
$table.triggerPasteCellAreaEvent($event);
|
|
@@ -917,6 +972,23 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
917
972
|
}
|
|
918
973
|
}
|
|
919
974
|
},
|
|
975
|
+
/**
|
|
976
|
+
* 粘贴从表格中被复制的数据;用于 mouse-config.area 功能,粘贴区域范围内的单元格数据,不支持读取剪贴板
|
|
977
|
+
*/
|
|
978
|
+
PASTE_AREA_CELL: {
|
|
979
|
+
tableMenuMethod: function tableMenuMethod(params) {
|
|
980
|
+
var $event = params.$event,
|
|
981
|
+
$table = params.$table;
|
|
982
|
+
var tableProps = $table.props;
|
|
983
|
+
var mouseConfig = tableProps.mouseConfig;
|
|
984
|
+
var _$table$getComputeMap12 = $table.getComputeMaps(),
|
|
985
|
+
computeMouseOpts = _$table$getComputeMap12.computeMouseOpts;
|
|
986
|
+
var mouseOpts = computeMouseOpts.value;
|
|
987
|
+
if (mouseConfig && mouseOpts.area) {
|
|
988
|
+
$table.triggerPasteCellAreaEvent($event);
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
},
|
|
920
992
|
/**
|
|
921
993
|
* 如果启用 mouse-config.area 功能,如果所选区域内已存在合并单元格,则取消临时合并,否则临时合并
|
|
922
994
|
*/
|
|
@@ -1080,8 +1152,8 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
1080
1152
|
column = params.column;
|
|
1081
1153
|
var tableProps = $table.props;
|
|
1082
1154
|
var mouseConfig = tableProps.mouseConfig;
|
|
1083
|
-
var _$table$
|
|
1084
|
-
computeMouseOpts = _$table$
|
|
1155
|
+
var _$table$getComputeMap13 = $table.getComputeMaps(),
|
|
1156
|
+
computeMouseOpts = _$table$getComputeMap13.computeMouseOpts;
|
|
1085
1157
|
var mouseOpts = computeMouseOpts.value;
|
|
1086
1158
|
$table.insert(menu.params || {}).then(function (_ref7) {
|
|
1087
1159
|
var rows = _ref7.rows;
|
|
@@ -1107,8 +1179,8 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
1107
1179
|
column = params.column;
|
|
1108
1180
|
var tableProps = $table.props;
|
|
1109
1181
|
var mouseConfig = tableProps.mouseConfig;
|
|
1110
|
-
var _$table$
|
|
1111
|
-
computeMouseOpts = _$table$
|
|
1182
|
+
var _$table$getComputeMap14 = $table.getComputeMaps(),
|
|
1183
|
+
computeMouseOpts = _$table$getComputeMap14.computeMouseOpts;
|
|
1112
1184
|
var mouseOpts = computeMouseOpts.value;
|
|
1113
1185
|
(row ? $table.insertAt(menu.params || {}, row) : $table.insert(menu.params || {})).then(function (_ref8) {
|
|
1114
1186
|
var rows = _ref8.rows;
|
|
@@ -1134,8 +1206,8 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
1134
1206
|
column = params.column;
|
|
1135
1207
|
var tableProps = $table.props;
|
|
1136
1208
|
var mouseConfig = tableProps.mouseConfig;
|
|
1137
|
-
var _$table$
|
|
1138
|
-
computeMouseOpts = _$table$
|
|
1209
|
+
var _$table$getComputeMap15 = $table.getComputeMaps(),
|
|
1210
|
+
computeMouseOpts = _$table$getComputeMap15.computeMouseOpts;
|
|
1139
1211
|
var mouseOpts = computeMouseOpts.value;
|
|
1140
1212
|
selectMultipleRows().then(function (_ref9) {
|
|
1141
1213
|
var size = _ref9.size;
|
|
@@ -1169,8 +1241,8 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
1169
1241
|
column = params.column;
|
|
1170
1242
|
var tableProps = $table.props;
|
|
1171
1243
|
var mouseConfig = tableProps.mouseConfig;
|
|
1172
|
-
var _$table$
|
|
1173
|
-
computeMouseOpts = _$table$
|
|
1244
|
+
var _$table$getComputeMap16 = $table.getComputeMaps(),
|
|
1245
|
+
computeMouseOpts = _$table$getComputeMap16.computeMouseOpts;
|
|
1174
1246
|
var mouseOpts = computeMouseOpts.value;
|
|
1175
1247
|
(row ? $table.insertNextAt(menu.params || {}, row) : $table.insert(menu.params || {})).then(function (_ref1) {
|
|
1176
1248
|
var rows = _ref1.rows;
|
|
@@ -1196,8 +1268,8 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
1196
1268
|
column = params.column;
|
|
1197
1269
|
var tableProps = $table.props;
|
|
1198
1270
|
var mouseConfig = tableProps.mouseConfig;
|
|
1199
|
-
var _$table$
|
|
1200
|
-
computeMouseOpts = _$table$
|
|
1271
|
+
var _$table$getComputeMap17 = $table.getComputeMaps(),
|
|
1272
|
+
computeMouseOpts = _$table$getComputeMap17.computeMouseOpts;
|
|
1201
1273
|
var mouseOpts = computeMouseOpts.value;
|
|
1202
1274
|
selectMultipleRows().then(function (_ref10) {
|
|
1203
1275
|
var size = _ref10.size;
|
|
@@ -1409,8 +1481,8 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
1409
1481
|
row = params.row;
|
|
1410
1482
|
var tableProps = $table.props;
|
|
1411
1483
|
var mouseConfig = tableProps.mouseConfig;
|
|
1412
|
-
var _$table$
|
|
1413
|
-
computeMouseOpts = _$table$
|
|
1484
|
+
var _$table$getComputeMap18 = $table.getComputeMaps(),
|
|
1485
|
+
computeMouseOpts = _$table$getComputeMap18.computeMouseOpts;
|
|
1414
1486
|
var mouseOpts = computeMouseOpts.value;
|
|
1415
1487
|
if (mouseConfig && mouseOpts.area) {
|
|
1416
1488
|
var cellAreas = $table.getCellAreas();
|
|
@@ -1617,7 +1689,11 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
1617
1689
|
tableMenuMethod: function tableMenuMethod(params) {
|
|
1618
1690
|
var $event = params.$event,
|
|
1619
1691
|
$table = params.$table;
|
|
1620
|
-
$table.
|
|
1692
|
+
if ($table.triggerFnrOpenEvent) {
|
|
1693
|
+
$table.triggerFnrOpenEvent($event, 'find');
|
|
1694
|
+
} else {
|
|
1695
|
+
$table.triggerFNROpenEvent($event, 'find');
|
|
1696
|
+
}
|
|
1621
1697
|
}
|
|
1622
1698
|
},
|
|
1623
1699
|
/**
|
|
@@ -1627,7 +1703,11 @@ var VxeUIPluginMenu = exports.VxeUIPluginMenu = {
|
|
|
1627
1703
|
tableMenuMethod: function tableMenuMethod(params) {
|
|
1628
1704
|
var $event = params.$event,
|
|
1629
1705
|
$table = params.$table;
|
|
1630
|
-
$table.
|
|
1706
|
+
if ($table.triggerFnrOpenEvent) {
|
|
1707
|
+
$table.triggerFnrOpenEvent($event, 'replace');
|
|
1708
|
+
} else {
|
|
1709
|
+
$table.triggerFNROpenEvent($event, 'replace');
|
|
1710
|
+
}
|
|
1631
1711
|
}
|
|
1632
1712
|
},
|
|
1633
1713
|
/**
|
package/lib/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
|
|
18
|
+
(function (exports) {
|
|
19
19
|
|
|
20
|
-
Object.defineProperty(exports
|
|
20
|
+
Object.defineProperty(exports, "__esModule", {
|
|
21
21
|
value: true
|
|
22
22
|
});
|
|
23
|
-
exports
|
|
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
|
|
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.
|
|
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.
|
|
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$
|
|
599
|
-
computeMouseOpts = _$table$
|
|
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$
|
|
632
|
-
computeMouseOpts = _$table$
|
|
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$
|
|
659
|
-
computeMouseOpts = _$table$
|
|
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$
|
|
701
|
-
computeMouseOpts = _$table$
|
|
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$
|
|
743
|
-
computeMouseOpts = _$table$
|
|
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$
|
|
785
|
-
computeMouseOpts = _$table$
|
|
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$
|
|
828
|
-
computeMouseOpts = _$table$
|
|
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$
|
|
924
|
-
computeMouseOpts = _$table$
|
|
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$
|
|
1101
|
-
computeMouseOpts = _$table$
|
|
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$
|
|
1128
|
-
computeMouseOpts = _$table$
|
|
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$
|
|
1155
|
-
computeMouseOpts = _$table$
|
|
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$
|
|
1190
|
-
computeMouseOpts = _$table$
|
|
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$
|
|
1217
|
-
computeMouseOpts = _$table$
|
|
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$
|
|
1430
|
-
computeMouseOpts = _$table$
|
|
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.
|
|
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.
|
|
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
|
|
1824
|
+
exports["default"] = VxeUIPluginMenu;
|
|
1745
1825
|
} (lib));
|
|
1746
1826
|
return lib;
|
|
1747
1827
|
}
|