@fileverse-dev/fortune-core 1.1.2 → 1.1.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/es/events/keyboard.d.ts +1 -1
- package/es/events/keyboard.js +226 -99
- package/es/locale/en.d.ts +6 -0
- package/es/locale/en.js +11 -0
- package/es/modules/ConditionFormat.js +107 -16
- package/es/modules/selection.d.ts +2 -0
- package/es/modules/selection.js +86 -0
- package/lib/events/keyboard.d.ts +1 -1
- package/lib/events/keyboard.js +225 -98
- package/lib/locale/en.d.ts +6 -0
- package/lib/locale/en.js +11 -0
- package/lib/modules/ConditionFormat.js +107 -16
- package/lib/modules/selection.d.ts +2 -0
- package/lib/modules/selection.js +88 -0
- package/package.json +1 -1
package/es/modules/selection.js
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var __assign = this && this.__assign || function () {
|
|
3
|
+
__assign = Object.assign || function (t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
2
12
|
import _, { isPlainObject } from "lodash";
|
|
3
13
|
import { getFlowdata } from "../context";
|
|
4
14
|
import { getCellValue, getdatabyselection, getDataBySelectionNoCopy, getStyleByCell, mergeBorder, mergeMoveMain } from "./cell";
|
|
@@ -1586,6 +1596,82 @@ export function deleteSelectedCellFormat(ctx) {
|
|
|
1586
1596
|
}
|
|
1587
1597
|
return "success";
|
|
1588
1598
|
}
|
|
1599
|
+
export function fillRightData(ctx) {
|
|
1600
|
+
var allowEdit = isAllowEdit(ctx);
|
|
1601
|
+
if (allowEdit === false) {
|
|
1602
|
+
return "allowEdit";
|
|
1603
|
+
}
|
|
1604
|
+
var selection = ctx.luckysheet_select_save;
|
|
1605
|
+
if (selection && !_.isEmpty(selection)) {
|
|
1606
|
+
var d = getFlowdata(ctx);
|
|
1607
|
+
if (!d) return "dataNullError";
|
|
1608
|
+
var has_PartMC = false;
|
|
1609
|
+
for (var s = 0; s < selection.length; s += 1) {
|
|
1610
|
+
var r1 = selection[s].row[0];
|
|
1611
|
+
var r2 = selection[s].row[1];
|
|
1612
|
+
var c1 = selection[s].column[0];
|
|
1613
|
+
var c2 = selection[s].column[1];
|
|
1614
|
+
if (hasPartMC(ctx, ctx.config, r1, r2, c1, c2)) {
|
|
1615
|
+
has_PartMC = true;
|
|
1616
|
+
break;
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
if (has_PartMC) {
|
|
1620
|
+
return "partMC";
|
|
1621
|
+
}
|
|
1622
|
+
for (var s = 0; s < selection.length; s += 1) {
|
|
1623
|
+
var r1 = selection[s].row[0];
|
|
1624
|
+
var r2 = selection[s].row[1];
|
|
1625
|
+
var c1 = selection[s].column[0];
|
|
1626
|
+
var c2 = selection[s].column[1];
|
|
1627
|
+
for (var r = r1; r <= r2; r += 1) {
|
|
1628
|
+
for (var c = c1; c <= c2; c += 1) {
|
|
1629
|
+
var previousCell = d[r][c - 1];
|
|
1630
|
+
d[r][c] = __assign({}, previousCell);
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
return "success";
|
|
1636
|
+
}
|
|
1637
|
+
export function fillDownData(ctx) {
|
|
1638
|
+
var allowEdit = isAllowEdit(ctx);
|
|
1639
|
+
if (allowEdit === false) {
|
|
1640
|
+
return "allowEdit";
|
|
1641
|
+
}
|
|
1642
|
+
var selection = ctx.luckysheet_select_save;
|
|
1643
|
+
if (selection && !_.isEmpty(selection)) {
|
|
1644
|
+
var d = getFlowdata(ctx);
|
|
1645
|
+
if (!d) return "dataNullError";
|
|
1646
|
+
var has_PartMC = false;
|
|
1647
|
+
for (var s = 0; s < selection.length; s += 1) {
|
|
1648
|
+
var r1 = selection[s].row[0];
|
|
1649
|
+
var r2 = selection[s].row[1];
|
|
1650
|
+
var c1 = selection[s].column[0];
|
|
1651
|
+
var c2 = selection[s].column[1];
|
|
1652
|
+
if (hasPartMC(ctx, ctx.config, r1, r2, c1, c2)) {
|
|
1653
|
+
has_PartMC = true;
|
|
1654
|
+
break;
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
if (has_PartMC) {
|
|
1658
|
+
return "partMC";
|
|
1659
|
+
}
|
|
1660
|
+
for (var s = 0; s < selection.length; s += 1) {
|
|
1661
|
+
var r1 = selection[s].row[0];
|
|
1662
|
+
var r2 = selection[s].row[1];
|
|
1663
|
+
var c1 = selection[s].column[0];
|
|
1664
|
+
var c2 = selection[s].column[1];
|
|
1665
|
+
for (var r = r1; r <= r2; r += 1) {
|
|
1666
|
+
for (var c = c1; c <= c2; c += 1) {
|
|
1667
|
+
var previousCell = d[r - 1][c];
|
|
1668
|
+
d[r][c] = __assign({}, previousCell);
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
return "success";
|
|
1674
|
+
}
|
|
1589
1675
|
export function textFormat(ctx, type) {
|
|
1590
1676
|
var allowEdit = isAllowEdit(ctx);
|
|
1591
1677
|
if (allowEdit === false) {
|
package/lib/events/keyboard.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ import { GlobalCache } from "../types";
|
|
|
3
3
|
export declare function handleGlobalEnter(ctx: Context, cellInput: HTMLDivElement, e: KeyboardEvent, canvas?: CanvasRenderingContext2D): void;
|
|
4
4
|
export declare function handleWithCtrlOrMetaKey(ctx: Context, cache: GlobalCache, e: KeyboardEvent, cellInput: HTMLDivElement, fxInput: HTMLDivElement | null | undefined, handleUndo: () => void, handleRedo: () => void): void;
|
|
5
5
|
export declare function handleArrowKey(ctx: Context, e: KeyboardEvent): void;
|
|
6
|
-
export declare function handleGlobalKeyDown(ctx: Context, cellInput: HTMLDivElement, fxInput: HTMLDivElement | null | undefined, e: KeyboardEvent, cache: GlobalCache, handleUndo: () => void, handleRedo: () => void, canvas?: CanvasRenderingContext2D): void
|
|
6
|
+
export declare function handleGlobalKeyDown(ctx: Context, cellInput: HTMLDivElement, fxInput: HTMLDivElement | null | undefined, e: KeyboardEvent, cache: GlobalCache, handleUndo: () => void, handleRedo: () => void, canvas?: CanvasRenderingContext2D): Promise<void>;
|
package/lib/events/keyboard.js
CHANGED
|
@@ -19,6 +19,121 @@ var _utils = require("../utils");
|
|
|
19
19
|
var _copy = require("./copy");
|
|
20
20
|
var _refresh = require("../modules/refresh");
|
|
21
21
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
|
+
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
23
|
+
function adopt(value) {
|
|
24
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
25
|
+
resolve(value);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
29
|
+
function fulfilled(value) {
|
|
30
|
+
try {
|
|
31
|
+
step(generator.next(value));
|
|
32
|
+
} catch (e) {
|
|
33
|
+
reject(e);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function rejected(value) {
|
|
37
|
+
try {
|
|
38
|
+
step(generator["throw"](value));
|
|
39
|
+
} catch (e) {
|
|
40
|
+
reject(e);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function step(result) {
|
|
44
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
45
|
+
}
|
|
46
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
50
|
+
var _ = {
|
|
51
|
+
label: 0,
|
|
52
|
+
sent: function sent() {
|
|
53
|
+
if (t[0] & 1) throw t[1];
|
|
54
|
+
return t[1];
|
|
55
|
+
},
|
|
56
|
+
trys: [],
|
|
57
|
+
ops: []
|
|
58
|
+
},
|
|
59
|
+
f,
|
|
60
|
+
y,
|
|
61
|
+
t,
|
|
62
|
+
g;
|
|
63
|
+
return g = {
|
|
64
|
+
next: verb(0),
|
|
65
|
+
"throw": verb(1),
|
|
66
|
+
"return": verb(2)
|
|
67
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
68
|
+
return this;
|
|
69
|
+
}), g;
|
|
70
|
+
function verb(n) {
|
|
71
|
+
return function (v) {
|
|
72
|
+
return step([n, v]);
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function step(op) {
|
|
76
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
77
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
78
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
79
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
80
|
+
switch (op[0]) {
|
|
81
|
+
case 0:
|
|
82
|
+
case 1:
|
|
83
|
+
t = op;
|
|
84
|
+
break;
|
|
85
|
+
case 4:
|
|
86
|
+
_.label++;
|
|
87
|
+
return {
|
|
88
|
+
value: op[1],
|
|
89
|
+
done: false
|
|
90
|
+
};
|
|
91
|
+
case 5:
|
|
92
|
+
_.label++;
|
|
93
|
+
y = op[1];
|
|
94
|
+
op = [0];
|
|
95
|
+
continue;
|
|
96
|
+
case 7:
|
|
97
|
+
op = _.ops.pop();
|
|
98
|
+
_.trys.pop();
|
|
99
|
+
continue;
|
|
100
|
+
default:
|
|
101
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
102
|
+
_ = 0;
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
106
|
+
_.label = op[1];
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
110
|
+
_.label = t[1];
|
|
111
|
+
t = op;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
if (t && _.label < t[2]) {
|
|
115
|
+
_.label = t[2];
|
|
116
|
+
_.ops.push(op);
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
if (t[2]) _.ops.pop();
|
|
120
|
+
_.trys.pop();
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
op = body.call(thisArg, _);
|
|
124
|
+
} catch (e) {
|
|
125
|
+
op = [6, e];
|
|
126
|
+
y = 0;
|
|
127
|
+
} finally {
|
|
128
|
+
f = t = 0;
|
|
129
|
+
}
|
|
130
|
+
if (op[0] & 5) throw op[1];
|
|
131
|
+
return {
|
|
132
|
+
value: op[0] ? op[1] : void 0,
|
|
133
|
+
done: true
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
};
|
|
22
137
|
function handleGlobalEnter(ctx, cellInput, e, canvas) {
|
|
23
138
|
var _a, _b, _c;
|
|
24
139
|
if ((e.altKey || e.metaKey) && ctx.luckysheetCellUpdate.length > 0) {
|
|
@@ -266,105 +381,117 @@ function handleArrowKey(ctx, e) {
|
|
|
266
381
|
}
|
|
267
382
|
function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUndo, handleRedo, canvas) {
|
|
268
383
|
var _a;
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
} else if ((e.ctrlKey || e.metaKey && e.shiftKey) && e.code === "KeyL") {
|
|
278
|
-
(0, _selection.textFormat)(ctx, "left");
|
|
279
|
-
} else if ((e.ctrlKey || e.metaKey && e.shiftKey) && e.code === "KeyR") {
|
|
280
|
-
(0, _selection.textFormat)(ctx, "right");
|
|
281
|
-
}
|
|
282
|
-
if ((e.metaKey || e.ctrlKey) && e.code === "KeyK") {
|
|
283
|
-
(0, _toolbar.handleLink)(ctx);
|
|
284
|
-
}
|
|
285
|
-
if ((e.metaKey || e.ctrlKey) && !e.shiftKey && e.code === "Semicolon") {
|
|
286
|
-
(0, _selection.fillDate)(ctx);
|
|
287
|
-
}
|
|
288
|
-
if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.code === "Semicolon") {
|
|
289
|
-
(0, _selection.fillTime)(ctx);
|
|
290
|
-
}
|
|
291
|
-
ctx.luckysheet_select_status = false;
|
|
292
|
-
var kcode = e.keyCode;
|
|
293
|
-
var kstr = e.key;
|
|
294
|
-
if (!_lodash.default.isEmpty(ctx.contextMenu) || ctx.filterContextMenu) {
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
if (kstr === "Escape" && !!ctx.luckysheet_selection_range) {
|
|
298
|
-
ctx.luckysheet_selection_range = [];
|
|
299
|
-
}
|
|
300
|
-
var allowEdit = (0, _utils.isAllowEdit)(ctx);
|
|
301
|
-
if (ctx.luckysheetCellUpdate.length > 0 && kstr !== "Enter" && kstr !== "Tab" && kstr !== "ArrowUp" && kstr !== "ArrowDown" && kstr !== "ArrowLeft" && kstr !== "ArrowRight") {
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
if (kstr === "Enter") {
|
|
305
|
-
if (!allowEdit) return;
|
|
306
|
-
handleGlobalEnter(ctx, cellInput, e, canvas);
|
|
307
|
-
} else if (kstr === "Tab") {
|
|
308
|
-
if (ctx.luckysheetCellUpdate.length > 0) {
|
|
309
|
-
return;
|
|
310
|
-
}
|
|
311
|
-
if (e.shiftKey) {
|
|
312
|
-
(0, _selection.moveHighlightCell)(ctx, "right", -1, "rangeOfSelect");
|
|
313
|
-
} else {
|
|
314
|
-
(0, _selection.moveHighlightCell)(ctx, "right", 1, "rangeOfSelect");
|
|
315
|
-
}
|
|
316
|
-
e.preventDefault();
|
|
317
|
-
} else if (kstr === "F2") {
|
|
318
|
-
if (!allowEdit) return;
|
|
319
|
-
if (ctx.luckysheetCellUpdate.length > 0) {
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
var last = (_a = ctx.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[ctx.luckysheet_select_save.length - 1];
|
|
323
|
-
if (!last) return;
|
|
324
|
-
var row_index = last.row_focus;
|
|
325
|
-
var col_index = last.column_focus;
|
|
326
|
-
ctx.luckysheetCellUpdate = [row_index, col_index];
|
|
327
|
-
e.preventDefault();
|
|
328
|
-
} else if (kstr === "F4" && ctx.luckysheetCellUpdate.length > 0) {
|
|
329
|
-
e.preventDefault();
|
|
330
|
-
} else if (kstr === "Escape" && ctx.luckysheetCellUpdate.length > 0) {
|
|
331
|
-
(0, _cell.cancelNormalSelected)(ctx);
|
|
332
|
-
(0, _selection.moveHighlightCell)(ctx, "down", 0, "rangeOfSelect");
|
|
333
|
-
e.preventDefault();
|
|
334
|
-
} else {
|
|
335
|
-
if (e.ctrlKey || e.metaKey) {
|
|
336
|
-
handleWithCtrlOrMetaKey(ctx, cache, e, cellInput, fxInput, handleUndo, handleRedo);
|
|
337
|
-
return;
|
|
338
|
-
}
|
|
339
|
-
if (e.shiftKey && (kstr === "ArrowUp" || kstr === "ArrowDown" || kstr === "ArrowLeft" || kstr === "ArrowRight")) {
|
|
340
|
-
handleShiftWithArrowKey(ctx, e);
|
|
341
|
-
} else if (kstr === "Escape") {
|
|
342
|
-
ctx.contextMenu = {};
|
|
343
|
-
} else if (kstr === "Delete" || kstr === "Backspace") {
|
|
344
|
-
if (!allowEdit) return;
|
|
345
|
-
if (ctx.activeImg != null) {
|
|
346
|
-
(0, _2.removeActiveImage)(ctx);
|
|
347
|
-
} else {
|
|
348
|
-
(0, _selection.deleteSelectedCellText)(ctx);
|
|
384
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
385
|
+
var kcode, kstr, allowEdit, last, row_index, col_index, last, row_index, col_index;
|
|
386
|
+
return __generator(this, function (_b) {
|
|
387
|
+
if (e.shiftKey && e.code === "Space") {
|
|
388
|
+
e.stopImmediatePropagation();
|
|
389
|
+
e.stopPropagation();
|
|
390
|
+
e.preventDefault();
|
|
391
|
+
return [2];
|
|
349
392
|
}
|
|
350
|
-
(
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
393
|
+
if ((e.ctrlKey || e.metaKey && e.shiftKey) && e.code === "KeyE") {
|
|
394
|
+
(0, _selection.textFormat)(ctx, "center");
|
|
395
|
+
} else if ((e.ctrlKey || e.metaKey && e.shiftKey) && e.code === "KeyL") {
|
|
396
|
+
(0, _selection.textFormat)(ctx, "left");
|
|
397
|
+
} else if ((e.ctrlKey || e.metaKey && e.shiftKey) && e.code === "KeyR") {
|
|
398
|
+
(0, _selection.textFormat)(ctx, "right");
|
|
399
|
+
}
|
|
400
|
+
if ((e.metaKey || e.ctrlKey) && e.code === "KeyK") {
|
|
401
|
+
(0, _toolbar.handleLink)(ctx);
|
|
402
|
+
}
|
|
403
|
+
if ((e.metaKey || e.ctrlKey) && !e.shiftKey && e.code === "Semicolon") {
|
|
404
|
+
(0, _selection.fillDate)(ctx);
|
|
405
|
+
}
|
|
406
|
+
if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.code === "Semicolon") {
|
|
407
|
+
(0, _selection.fillTime)(ctx);
|
|
408
|
+
}
|
|
409
|
+
if ((e.metaKey || e.ctrlKey) && e.code === "KeyR") {
|
|
410
|
+
(0, _selection.fillRightData)(ctx);
|
|
411
|
+
}
|
|
412
|
+
if ((e.metaKey || e.ctrlKey) && e.code === "KeyD") {
|
|
413
|
+
(0, _selection.fillDownData)(ctx);
|
|
414
|
+
}
|
|
415
|
+
ctx.luckysheet_select_status = false;
|
|
416
|
+
kcode = e.keyCode;
|
|
417
|
+
kstr = e.key;
|
|
418
|
+
if (!_lodash.default.isEmpty(ctx.contextMenu) || ctx.filterContextMenu) {
|
|
419
|
+
return [2];
|
|
420
|
+
}
|
|
421
|
+
if (kstr === "Escape" && !!ctx.luckysheet_selection_range) {
|
|
422
|
+
ctx.luckysheet_selection_range = [];
|
|
423
|
+
}
|
|
424
|
+
allowEdit = (0, _utils.isAllowEdit)(ctx);
|
|
425
|
+
if (ctx.luckysheetCellUpdate.length > 0 && kstr !== "Enter" && kstr !== "Tab" && kstr !== "ArrowUp" && kstr !== "ArrowDown" && kstr !== "ArrowLeft" && kstr !== "ArrowRight") {
|
|
426
|
+
return [2];
|
|
427
|
+
}
|
|
428
|
+
if (kstr === "Enter") {
|
|
429
|
+
if (!allowEdit) return [2];
|
|
430
|
+
handleGlobalEnter(ctx, cellInput, e, canvas);
|
|
431
|
+
} else if (kstr === "Tab") {
|
|
432
|
+
if (ctx.luckysheetCellUpdate.length > 0) {
|
|
433
|
+
return [2];
|
|
434
|
+
}
|
|
435
|
+
if (e.shiftKey) {
|
|
436
|
+
(0, _selection.moveHighlightCell)(ctx, "right", -1, "rangeOfSelect");
|
|
437
|
+
} else {
|
|
438
|
+
(0, _selection.moveHighlightCell)(ctx, "right", 1, "rangeOfSelect");
|
|
439
|
+
}
|
|
440
|
+
e.preventDefault();
|
|
441
|
+
} else if (kstr === "F2") {
|
|
442
|
+
if (!allowEdit) return [2];
|
|
443
|
+
if (ctx.luckysheetCellUpdate.length > 0) {
|
|
444
|
+
return [2];
|
|
445
|
+
}
|
|
446
|
+
last = (_a = ctx.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[ctx.luckysheet_select_save.length - 1];
|
|
447
|
+
if (!last) return [2];
|
|
448
|
+
row_index = last.row_focus;
|
|
449
|
+
col_index = last.column_focus;
|
|
360
450
|
ctx.luckysheetCellUpdate = [row_index, col_index];
|
|
361
|
-
|
|
362
|
-
|
|
451
|
+
e.preventDefault();
|
|
452
|
+
} else if (kstr === "F4" && ctx.luckysheetCellUpdate.length > 0) {
|
|
453
|
+
e.preventDefault();
|
|
454
|
+
} else if (kstr === "Escape" && ctx.luckysheetCellUpdate.length > 0) {
|
|
455
|
+
(0, _cell.cancelNormalSelected)(ctx);
|
|
456
|
+
(0, _selection.moveHighlightCell)(ctx, "down", 0, "rangeOfSelect");
|
|
457
|
+
e.preventDefault();
|
|
458
|
+
} else {
|
|
459
|
+
if (e.ctrlKey || e.metaKey) {
|
|
460
|
+
handleWithCtrlOrMetaKey(ctx, cache, e, cellInput, fxInput, handleUndo, handleRedo);
|
|
461
|
+
return [2];
|
|
462
|
+
}
|
|
463
|
+
if (e.shiftKey && (kstr === "ArrowUp" || kstr === "ArrowDown" || kstr === "ArrowLeft" || kstr === "ArrowRight")) {
|
|
464
|
+
handleShiftWithArrowKey(ctx, e);
|
|
465
|
+
} else if (kstr === "Escape") {
|
|
466
|
+
ctx.contextMenu = {};
|
|
467
|
+
} else if (kstr === "Delete" || kstr === "Backspace") {
|
|
468
|
+
if (!allowEdit) return [2];
|
|
469
|
+
if (ctx.activeImg != null) {
|
|
470
|
+
(0, _2.removeActiveImage)(ctx);
|
|
471
|
+
} else {
|
|
472
|
+
(0, _selection.deleteSelectedCellText)(ctx);
|
|
473
|
+
}
|
|
474
|
+
(0, _refresh.jfrefreshgrid)(ctx, null, undefined);
|
|
475
|
+
e.preventDefault();
|
|
476
|
+
} else if (kstr === "ArrowUp" || kstr === "ArrowDown" || kstr === "ArrowLeft" || kstr === "ArrowRight") {
|
|
477
|
+
handleArrowKey(ctx, e);
|
|
478
|
+
} else if (!(kcode >= 112 && kcode <= 123 || kcode <= 46 || kcode === 144 || kcode === 108 || e.ctrlKey || e.altKey || e.shiftKey && (kcode === 37 || kcode === 38 || kcode === 39 || kcode === 40)) || kcode === 8 || kcode === 32 || kcode === 46 || kcode === 0 || e.ctrlKey && kcode === 86) {
|
|
479
|
+
if (!allowEdit) return [2];
|
|
480
|
+
if (String.fromCharCode(kcode) != null && !_lodash.default.isEmpty(ctx.luckysheet_select_save) && kstr !== "CapsLock" && kstr !== "Win" && kcode !== 18) {
|
|
481
|
+
last = ctx.luckysheet_select_save[ctx.luckysheet_select_save.length - 1];
|
|
482
|
+
row_index = last.row_focus;
|
|
483
|
+
col_index = last.column_focus;
|
|
484
|
+
ctx.luckysheetCellUpdate = [row_index, col_index];
|
|
485
|
+
cache.overwriteCell = true;
|
|
486
|
+
(0, _formula.handleFormulaInput)(ctx, fxInput, cellInput, kcode);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
363
489
|
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
490
|
+
if (cellInput !== document.activeElement) {
|
|
491
|
+
cellInput === null || cellInput === void 0 ? void 0 : cellInput.focus();
|
|
492
|
+
}
|
|
493
|
+
e.stopPropagation();
|
|
494
|
+
return [2];
|
|
495
|
+
});
|
|
496
|
+
});
|
|
370
497
|
}
|
package/lib/locale/en.d.ts
CHANGED
|
@@ -517,8 +517,12 @@ declare const _default: {
|
|
|
517
517
|
conditionformat: {
|
|
518
518
|
conditionformat_greaterThan: string;
|
|
519
519
|
conditionformat_greaterThan_title: string;
|
|
520
|
+
conditionformat_greaterThanOrEqual: string;
|
|
521
|
+
conditionformat_greaterThanOrEqual_title: string;
|
|
520
522
|
conditionformat_lessThan: string;
|
|
521
523
|
conditionformat_lessThan_title: string;
|
|
524
|
+
conditionformat_lessThanOrEqual: string;
|
|
525
|
+
conditionformat_lessThanOrEqual_title: string;
|
|
522
526
|
conditionformat_between: string;
|
|
523
527
|
conditionformat_between_title: string;
|
|
524
528
|
conditionformat_equal: string;
|
|
@@ -619,7 +623,9 @@ declare const _default: {
|
|
|
619
623
|
specificText: string;
|
|
620
624
|
occurrenceDate: string;
|
|
621
625
|
greaterThan: string;
|
|
626
|
+
greaterThanOrEqual: string;
|
|
622
627
|
lessThan: string;
|
|
628
|
+
lessThanOrEqual: string;
|
|
623
629
|
between: string;
|
|
624
630
|
equal: string;
|
|
625
631
|
in: string;
|
package/lib/locale/en.js
CHANGED
|
@@ -9081,6 +9081,11 @@ var _default = exports.default = {
|
|
|
9081
9081
|
pos: "before",
|
|
9082
9082
|
value: "CLP$",
|
|
9083
9083
|
geckoId: "clp"
|
|
9084
|
+
}, {
|
|
9085
|
+
name: "Czech Koruna",
|
|
9086
|
+
pos: "after",
|
|
9087
|
+
value: "CZK",
|
|
9088
|
+
geckoId: "czk"
|
|
9084
9089
|
}, {
|
|
9085
9090
|
name: "Danish Krone",
|
|
9086
9091
|
pos: "after",
|
|
@@ -9665,8 +9670,12 @@ var _default = exports.default = {
|
|
|
9665
9670
|
conditionformat: {
|
|
9666
9671
|
conditionformat_greaterThan: "Conditional format - Greater than",
|
|
9667
9672
|
conditionformat_greaterThan_title: "Format cells greater than",
|
|
9673
|
+
conditionformat_greaterThanOrEqual: "Conditional format - Greater than or equal",
|
|
9674
|
+
conditionformat_greaterThanOrEqual_title: "Format cells greater than or equal",
|
|
9668
9675
|
conditionformat_lessThan: "Conditional format - Less than",
|
|
9669
9676
|
conditionformat_lessThan_title: "Format cells smaller than",
|
|
9677
|
+
conditionformat_lessThanOrEqual: "Conditional format - Less than or equal",
|
|
9678
|
+
conditionformat_lessThanOrEqual_title: "Format cells less than or equal",
|
|
9670
9679
|
conditionformat_between: "Conditional format - Betweenness",
|
|
9671
9680
|
conditionformat_between_title: "Format cells with values between",
|
|
9672
9681
|
conditionformat_equal: "Conditional format - Equal",
|
|
@@ -9767,7 +9776,9 @@ var _default = exports.default = {
|
|
|
9767
9776
|
specificText: "Specific text",
|
|
9768
9777
|
occurrenceDate: "Date",
|
|
9769
9778
|
greaterThan: "Greater than",
|
|
9779
|
+
greaterThanOrEqual: "Greater than or equal",
|
|
9770
9780
|
lessThan: "Less than",
|
|
9781
|
+
lessThanOrEqual: "Less than or equal",
|
|
9771
9782
|
between: "Between",
|
|
9772
9783
|
equal: "Equal",
|
|
9773
9784
|
in: "In",
|