@fileverse-dev/fortune-core 1.0.84 → 1.0.85
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/events/keyboard.js
CHANGED
|
@@ -4,9 +4,8 @@ import { getFlowdata } from "../context";
|
|
|
4
4
|
import { updateCell, cancelNormalSelected } from "../modules/cell";
|
|
5
5
|
import { handleFormulaInput } from "../modules/formula";
|
|
6
6
|
import { copy, deleteSelectedCellText, deleteSelectedCellFormat, textFormat, fillDate, fillTime, moveHighlightCell, moveHighlightRange, selectAll, selectionCache } from "../modules/selection";
|
|
7
|
-
import { cancelPaintModel, handleBold, handleItalic, handleUnderline } from "../modules/toolbar";
|
|
7
|
+
import { cancelPaintModel, handleBold, handleItalic, handleUnderline, handleLink } from "../modules/toolbar";
|
|
8
8
|
import { hasPartMC } from "../modules/validation";
|
|
9
|
-
import { handleLink } from "../modules/toolbar";
|
|
10
9
|
import { getNowDateTime, getSheetIndex, isAllowEdit } from "../utils";
|
|
11
10
|
import { handleCopy } from "./copy";
|
|
12
11
|
import { jfrefreshgrid } from "../modules/refresh";
|
|
@@ -120,7 +119,6 @@ function handleControlPlusArrowKey(ctx, e, shiftPressed) {
|
|
|
120
119
|
}
|
|
121
120
|
export function handleWithCtrlOrMetaKey(ctx, cache, e, cellInput, fxInput, handleUndo, handleRedo) {
|
|
122
121
|
var _a, _b, _c, _d;
|
|
123
|
-
console.log(e.key, e.code);
|
|
124
122
|
var flowdata = getFlowdata(ctx);
|
|
125
123
|
if (!flowdata) return;
|
|
126
124
|
if (e.shiftKey) {
|
|
@@ -258,7 +256,6 @@ export function handleArrowKey(ctx, e) {
|
|
|
258
256
|
}
|
|
259
257
|
export function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUndo, handleRedo, canvas) {
|
|
260
258
|
var _a;
|
|
261
|
-
console.log(e.code);
|
|
262
259
|
if (e.shiftKey && e.code === "Space") {
|
|
263
260
|
e.stopImmediatePropagation();
|
|
264
261
|
e.stopPropagation();
|
|
@@ -272,13 +269,13 @@ export function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUnd
|
|
|
272
269
|
} else if ((e.ctrlKey || e.metaKey && e.shiftKey) && e.code === "KeyR") {
|
|
273
270
|
textFormat(ctx, "right");
|
|
274
271
|
}
|
|
275
|
-
if ((e.metaKey || e.ctrlKey) && e.code ===
|
|
272
|
+
if ((e.metaKey || e.ctrlKey) && e.code === "KeyK") {
|
|
276
273
|
handleLink(ctx);
|
|
277
274
|
}
|
|
278
|
-
if ((e.metaKey || e.ctrlKey) && !e.shiftKey && e.code ===
|
|
275
|
+
if ((e.metaKey || e.ctrlKey) && !e.shiftKey && e.code === "Semicolon") {
|
|
279
276
|
fillDate(ctx);
|
|
280
277
|
}
|
|
281
|
-
if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.code ===
|
|
278
|
+
if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.code === "Semicolon") {
|
|
282
279
|
fillTime(ctx);
|
|
283
280
|
}
|
|
284
281
|
ctx.luckysheet_select_status = false;
|
package/es/modules/selection.js
CHANGED
|
@@ -1666,7 +1666,7 @@ export function fillDate(ctx) {
|
|
|
1666
1666
|
for (var r = r1; r <= r2; r += 1) {
|
|
1667
1667
|
for (var c = c1; c <= c2; c += 1) {
|
|
1668
1668
|
var today = new Date();
|
|
1669
|
-
var formattedDate = "".concat(String(today.getDate()).padStart(2,
|
|
1669
|
+
var formattedDate = "".concat(String(today.getDate()).padStart(2, "0"), "/").concat(String(today.getMonth() + 1).padStart(2, "0"), "/").concat(today.getFullYear());
|
|
1670
1670
|
d[r][c] = {
|
|
1671
1671
|
v: formattedDate
|
|
1672
1672
|
};
|
|
@@ -1707,7 +1707,7 @@ export function fillTime(ctx) {
|
|
|
1707
1707
|
for (var r = r1; r <= r2; r += 1) {
|
|
1708
1708
|
for (var c = c1; c <= c2; c += 1) {
|
|
1709
1709
|
var now = new Date();
|
|
1710
|
-
var formattedTime = "".concat(String(now.getHours()).padStart(2,
|
|
1710
|
+
var formattedTime = "".concat(String(now.getHours()).padStart(2, "0"), ":").concat(String(now.getMinutes()).padStart(2, "0"), ":").concat(String(now.getSeconds()).padStart(2, "0"));
|
|
1711
1711
|
d[r][c] = {
|
|
1712
1712
|
v: formattedTime
|
|
1713
1713
|
};
|
package/es/modules/zoom.js
CHANGED
package/lib/events/keyboard.js
CHANGED
|
@@ -129,7 +129,6 @@ function handleControlPlusArrowKey(ctx, e, shiftPressed) {
|
|
|
129
129
|
}
|
|
130
130
|
function handleWithCtrlOrMetaKey(ctx, cache, e, cellInput, fxInput, handleUndo, handleRedo) {
|
|
131
131
|
var _a, _b, _c, _d;
|
|
132
|
-
console.log(e.key, e.code);
|
|
133
132
|
var flowdata = (0, _context.getFlowdata)(ctx);
|
|
134
133
|
if (!flowdata) return;
|
|
135
134
|
if (e.shiftKey) {
|
|
@@ -267,7 +266,6 @@ function handleArrowKey(ctx, e) {
|
|
|
267
266
|
}
|
|
268
267
|
function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUndo, handleRedo, canvas) {
|
|
269
268
|
var _a;
|
|
270
|
-
console.log(e.code);
|
|
271
269
|
if (e.shiftKey && e.code === "Space") {
|
|
272
270
|
e.stopImmediatePropagation();
|
|
273
271
|
e.stopPropagation();
|
|
@@ -281,13 +279,13 @@ function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUndo, hand
|
|
|
281
279
|
} else if ((e.ctrlKey || e.metaKey && e.shiftKey) && e.code === "KeyR") {
|
|
282
280
|
(0, _selection.textFormat)(ctx, "right");
|
|
283
281
|
}
|
|
284
|
-
if ((e.metaKey || e.ctrlKey) && e.code ===
|
|
282
|
+
if ((e.metaKey || e.ctrlKey) && e.code === "KeyK") {
|
|
285
283
|
(0, _toolbar.handleLink)(ctx);
|
|
286
284
|
}
|
|
287
|
-
if ((e.metaKey || e.ctrlKey) && !e.shiftKey && e.code ===
|
|
285
|
+
if ((e.metaKey || e.ctrlKey) && !e.shiftKey && e.code === "Semicolon") {
|
|
288
286
|
(0, _selection.fillDate)(ctx);
|
|
289
287
|
}
|
|
290
|
-
if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.code ===
|
|
288
|
+
if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.code === "Semicolon") {
|
|
291
289
|
(0, _selection.fillTime)(ctx);
|
|
292
290
|
}
|
|
293
291
|
ctx.luckysheet_select_status = false;
|
package/lib/modules/selection.js
CHANGED
|
@@ -1699,7 +1699,7 @@ function fillDate(ctx) {
|
|
|
1699
1699
|
for (var r = r1; r <= r2; r += 1) {
|
|
1700
1700
|
for (var c = c1; c <= c2; c += 1) {
|
|
1701
1701
|
var today = new Date();
|
|
1702
|
-
var formattedDate = "".concat(String(today.getDate()).padStart(2,
|
|
1702
|
+
var formattedDate = "".concat(String(today.getDate()).padStart(2, "0"), "/").concat(String(today.getMonth() + 1).padStart(2, "0"), "/").concat(today.getFullYear());
|
|
1703
1703
|
d[r][c] = {
|
|
1704
1704
|
v: formattedDate
|
|
1705
1705
|
};
|
|
@@ -1740,7 +1740,7 @@ function fillTime(ctx) {
|
|
|
1740
1740
|
for (var r = r1; r <= r2; r += 1) {
|
|
1741
1741
|
for (var c = c1; c <= c2; c += 1) {
|
|
1742
1742
|
var now = new Date();
|
|
1743
|
-
var formattedTime = "".concat(String(now.getHours()).padStart(2,
|
|
1743
|
+
var formattedTime = "".concat(String(now.getHours()).padStart(2, "0"), ":").concat(String(now.getMinutes()).padStart(2, "0"), ":").concat(String(now.getSeconds()).padStart(2, "0"));
|
|
1744
1744
|
d[r][c] = {
|
|
1745
1745
|
v: formattedTime
|
|
1746
1746
|
};
|
package/lib/modules/zoom.js
CHANGED
|
@@ -9,7 +9,7 @@ var ZOOM_STEP = 0.1;
|
|
|
9
9
|
var MAX_ZOOM_RATIO = exports.MAX_ZOOM_RATIO = 4;
|
|
10
10
|
var MIN_ZOOM_RATIO = exports.MIN_ZOOM_RATIO = 0.1;
|
|
11
11
|
function handleKeydownForZoom(ev, currentZoom) {
|
|
12
|
-
if (!ev.ctrlKey) {
|
|
12
|
+
if (!ev.ctrlKey || ev.altKey) {
|
|
13
13
|
return currentZoom;
|
|
14
14
|
}
|
|
15
15
|
var handled = false;
|