@fileverse-dev/fortune-react 1.0.82 → 1.0.84
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.
|
@@ -478,7 +478,7 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
478
478
|
noHistory: true
|
|
479
479
|
});
|
|
480
480
|
}, [context.currentSheetId, context.luckysheetfile.length, originalData, mergedSettings.defaultRowHeight, mergedSettings.defaultColWidth, mergedSettings.column, mergedSettings.row, mergedSettings.defaultFontSize, mergedSettings.devicePixelRatio, mergedSettings.lang, mergedSettings.allowEdit, mergedSettings.hooks, mergedSettings.generateSheetId, setContextWithProduce, initSheetData, mergedSettings.rowHeaderWidth, mergedSettings.columnHeaderHeight, mergedSettings.addRows, mergedSettings.currency]);
|
|
481
|
-
var isMac = navigator.platform.toUpperCase().includes(
|
|
481
|
+
var isMac = navigator.platform.toUpperCase().includes("MAC");
|
|
482
482
|
var waitingForRInsertRow = false;
|
|
483
483
|
var resetInsertRowTimer;
|
|
484
484
|
var waitingForDelRow = false;
|
|
@@ -491,7 +491,7 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
491
491
|
setSelection = _c.setSelection;
|
|
492
492
|
var isMacShortcutInsertRow = isMac && e.ctrlKey && e.altKey;
|
|
493
493
|
var isWindowsShortcutInsertRow = !isMac && e.altKey;
|
|
494
|
-
if ((isMacShortcutInsertRow || isWindowsShortcutInsertRow) && e.code ===
|
|
494
|
+
if ((isMacShortcutInsertRow || isWindowsShortcutInsertRow) && e.code === "KeyI") {
|
|
495
495
|
waitingForRInsertRow = true;
|
|
496
496
|
clearTimeout(resetInsertRowTimer);
|
|
497
497
|
resetInsertRowTimer = setTimeout(function () {
|
|
@@ -500,11 +500,11 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
500
500
|
e.preventDefault();
|
|
501
501
|
return;
|
|
502
502
|
}
|
|
503
|
-
if (waitingForRInsertRow && (e.code ===
|
|
503
|
+
if (waitingForRInsertRow && (e.code === "KeyR" || e.code === "KeyC")) {
|
|
504
504
|
var direction = "rightbottom";
|
|
505
|
-
var position = void 0
|
|
506
|
-
|
|
507
|
-
if (e.code ===
|
|
505
|
+
var position = void 0;
|
|
506
|
+
var insertRowColOp_1;
|
|
507
|
+
if (e.code === "KeyR") {
|
|
508
508
|
position = getSelection()[0].row[1];
|
|
509
509
|
insertRowColOp_1 = {
|
|
510
510
|
type: "row",
|
|
@@ -535,21 +535,22 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
535
535
|
clearTimeout(resetInsertRowTimer);
|
|
536
536
|
e.preventDefault();
|
|
537
537
|
}
|
|
538
|
-
var isDashKey = e.key ===
|
|
538
|
+
var isDashKey = e.key === "-" || e.code === "Minus";
|
|
539
539
|
var isSecondShortcut = isMac ? e.metaKey && e.altKey && isDashKey : e.ctrlKey && e.altKey && isDashKey;
|
|
540
540
|
if (isSecondShortcut) {
|
|
541
541
|
waitingForDelRow = true;
|
|
542
542
|
clearTimeout(resetDeleteRowTimer);
|
|
543
543
|
resetDeleteRowTimer = setTimeout(function () {
|
|
544
544
|
waitingForDelRow = false;
|
|
545
|
-
console.log(
|
|
545
|
+
console.log("Timeout: No second key (R or C) pressed in time.");
|
|
546
546
|
}, 3000);
|
|
547
547
|
e.preventDefault();
|
|
548
548
|
return;
|
|
549
549
|
}
|
|
550
|
-
if (waitingForDelRow && (e.code ===
|
|
551
|
-
var st_index_1
|
|
552
|
-
|
|
550
|
+
if (waitingForDelRow && (e.code === "KeyR" || e.code === "KeyC")) {
|
|
551
|
+
var st_index_1;
|
|
552
|
+
var ed_index_1;
|
|
553
|
+
if (e.code === "KeyR") {
|
|
553
554
|
_a = getSelection()[0].row, st_index_1 = _a[0], ed_index_1 = _a[1];
|
|
554
555
|
var range_2 = context.luckysheet_select_save;
|
|
555
556
|
setContextWithProduce(function (draftCtx) {
|
|
@@ -579,7 +580,7 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
579
580
|
e.preventDefault();
|
|
580
581
|
return;
|
|
581
582
|
}
|
|
582
|
-
if (e.
|
|
583
|
+
if (e.ctrlKey && e.code === "Space") {
|
|
583
584
|
e.stopPropagation();
|
|
584
585
|
e.preventDefault();
|
|
585
586
|
var selection = getSelection();
|
|
@@ -590,7 +591,7 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
590
591
|
column: selectedCol
|
|
591
592
|
}]);
|
|
592
593
|
}
|
|
593
|
-
if (e.
|
|
594
|
+
if (e.shiftKey && e.code === "Space") {
|
|
594
595
|
e.stopPropagation();
|
|
595
596
|
e.preventDefault();
|
|
596
597
|
var selection = getSelection();
|
|
@@ -487,7 +487,7 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
|
|
|
487
487
|
noHistory: true
|
|
488
488
|
});
|
|
489
489
|
}, [context.currentSheetId, context.luckysheetfile.length, originalData, mergedSettings.defaultRowHeight, mergedSettings.defaultColWidth, mergedSettings.column, mergedSettings.row, mergedSettings.defaultFontSize, mergedSettings.devicePixelRatio, mergedSettings.lang, mergedSettings.allowEdit, mergedSettings.hooks, mergedSettings.generateSheetId, setContextWithProduce, initSheetData, mergedSettings.rowHeaderWidth, mergedSettings.columnHeaderHeight, mergedSettings.addRows, mergedSettings.currency]);
|
|
490
|
-
var isMac = navigator.platform.toUpperCase().includes(
|
|
490
|
+
var isMac = navigator.platform.toUpperCase().includes("MAC");
|
|
491
491
|
var waitingForRInsertRow = false;
|
|
492
492
|
var resetInsertRowTimer;
|
|
493
493
|
var waitingForDelRow = false;
|
|
@@ -500,7 +500,7 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
|
|
|
500
500
|
setSelection = _c.setSelection;
|
|
501
501
|
var isMacShortcutInsertRow = isMac && e.ctrlKey && e.altKey;
|
|
502
502
|
var isWindowsShortcutInsertRow = !isMac && e.altKey;
|
|
503
|
-
if ((isMacShortcutInsertRow || isWindowsShortcutInsertRow) && e.code ===
|
|
503
|
+
if ((isMacShortcutInsertRow || isWindowsShortcutInsertRow) && e.code === "KeyI") {
|
|
504
504
|
waitingForRInsertRow = true;
|
|
505
505
|
clearTimeout(resetInsertRowTimer);
|
|
506
506
|
resetInsertRowTimer = setTimeout(function () {
|
|
@@ -509,11 +509,11 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
|
|
|
509
509
|
e.preventDefault();
|
|
510
510
|
return;
|
|
511
511
|
}
|
|
512
|
-
if (waitingForRInsertRow && (e.code ===
|
|
512
|
+
if (waitingForRInsertRow && (e.code === "KeyR" || e.code === "KeyC")) {
|
|
513
513
|
var direction = "rightbottom";
|
|
514
|
-
var position = void 0
|
|
515
|
-
|
|
516
|
-
if (e.code ===
|
|
514
|
+
var position = void 0;
|
|
515
|
+
var insertRowColOp_1;
|
|
516
|
+
if (e.code === "KeyR") {
|
|
517
517
|
position = getSelection()[0].row[1];
|
|
518
518
|
insertRowColOp_1 = {
|
|
519
519
|
type: "row",
|
|
@@ -544,21 +544,22 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
|
|
|
544
544
|
clearTimeout(resetInsertRowTimer);
|
|
545
545
|
e.preventDefault();
|
|
546
546
|
}
|
|
547
|
-
var isDashKey = e.key ===
|
|
547
|
+
var isDashKey = e.key === "-" || e.code === "Minus";
|
|
548
548
|
var isSecondShortcut = isMac ? e.metaKey && e.altKey && isDashKey : e.ctrlKey && e.altKey && isDashKey;
|
|
549
549
|
if (isSecondShortcut) {
|
|
550
550
|
waitingForDelRow = true;
|
|
551
551
|
clearTimeout(resetDeleteRowTimer);
|
|
552
552
|
resetDeleteRowTimer = setTimeout(function () {
|
|
553
553
|
waitingForDelRow = false;
|
|
554
|
-
console.log(
|
|
554
|
+
console.log("Timeout: No second key (R or C) pressed in time.");
|
|
555
555
|
}, 3000);
|
|
556
556
|
e.preventDefault();
|
|
557
557
|
return;
|
|
558
558
|
}
|
|
559
|
-
if (waitingForDelRow && (e.code ===
|
|
560
|
-
var st_index_1
|
|
561
|
-
|
|
559
|
+
if (waitingForDelRow && (e.code === "KeyR" || e.code === "KeyC")) {
|
|
560
|
+
var st_index_1;
|
|
561
|
+
var ed_index_1;
|
|
562
|
+
if (e.code === "KeyR") {
|
|
562
563
|
_a = getSelection()[0].row, st_index_1 = _a[0], ed_index_1 = _a[1];
|
|
563
564
|
var range_2 = context.luckysheet_select_save;
|
|
564
565
|
setContextWithProduce(function (draftCtx) {
|
|
@@ -588,7 +589,7 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
|
|
|
588
589
|
e.preventDefault();
|
|
589
590
|
return;
|
|
590
591
|
}
|
|
591
|
-
if (e.
|
|
592
|
+
if (e.ctrlKey && e.code === "Space") {
|
|
592
593
|
e.stopPropagation();
|
|
593
594
|
e.preventDefault();
|
|
594
595
|
var selection = getSelection();
|
|
@@ -599,7 +600,7 @@ var Workbook = /*#__PURE__*/_react.default.forwardRef(function (_a, ref) {
|
|
|
599
600
|
column: selectedCol
|
|
600
601
|
}]);
|
|
601
602
|
}
|
|
602
|
-
if (e.
|
|
603
|
+
if (e.shiftKey && e.code === "Space") {
|
|
603
604
|
e.stopPropagation();
|
|
604
605
|
e.preventDefault();
|
|
605
606
|
var selection = getSelection();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fileverse-dev/fortune-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.84",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"tsc": "tsc"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@fileverse-dev/fortune-core": "1.0.
|
|
19
|
+
"@fileverse-dev/fortune-core": "1.0.84",
|
|
20
20
|
"@fileverse/ui": "^4.1.7-patch-21",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|