@fileverse-dev/fortune-core 1.1.36 → 1.1.37
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
|
@@ -349,13 +349,15 @@ function handleShiftWithArrowKey(ctx, e) {
|
|
|
349
349
|
}
|
|
350
350
|
export function handleArrowKey(ctx, e) {
|
|
351
351
|
var _a, _b;
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
352
|
+
if (ctx.luckysheetCellUpdate.length > 0 || ctx.luckysheet_cell_selected_move || ctx.luckysheet_cell_selected_extend) {
|
|
353
|
+
var parser = new DOMParser();
|
|
354
|
+
var doc = parser.parseFromString("<div>".concat((_a = document.getElementById("luckysheet-rich-text-editor")) === null || _a === void 0 ? void 0 : _a.innerHTML, "</div>"), "text/html");
|
|
355
|
+
var spans = doc.querySelectorAll("span");
|
|
356
|
+
var lastSpan = spans[spans.length - 1];
|
|
357
|
+
var notFunctionInit = !((_b = document.getElementById("luckysheet-rich-text-editor")) === null || _b === void 0 ? void 0 : _b.innerText.includes("("));
|
|
358
|
+
if ((lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.includes(")")) || notFunctionInit && (lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.length) >= 1 && !_.includes(["="], lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText)) {
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
359
361
|
}
|
|
360
362
|
var moveCount = hideCRCount(ctx, e.key);
|
|
361
363
|
switch (e.key) {
|
package/es/modules/formula.js
CHANGED
|
@@ -1235,7 +1235,7 @@ export function setCaretPosition(ctx, textDom, children, pos) {
|
|
|
1235
1235
|
sel === null || sel === void 0 ? void 0 : sel.addRange(range);
|
|
1236
1236
|
el.focus();
|
|
1237
1237
|
} catch (err) {
|
|
1238
|
-
console.error
|
|
1238
|
+
console.warn("setCaretPosition error");
|
|
1239
1239
|
moveToEnd(ctx.formulaCache.rangeResizeTo[0]);
|
|
1240
1240
|
}
|
|
1241
1241
|
}
|
package/lib/events/keyboard.js
CHANGED
|
@@ -359,13 +359,15 @@ function handleShiftWithArrowKey(ctx, e) {
|
|
|
359
359
|
}
|
|
360
360
|
function handleArrowKey(ctx, e) {
|
|
361
361
|
var _a, _b;
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
362
|
+
if (ctx.luckysheetCellUpdate.length > 0 || ctx.luckysheet_cell_selected_move || ctx.luckysheet_cell_selected_extend) {
|
|
363
|
+
var parser = new DOMParser();
|
|
364
|
+
var doc = parser.parseFromString("<div>".concat((_a = document.getElementById("luckysheet-rich-text-editor")) === null || _a === void 0 ? void 0 : _a.innerHTML, "</div>"), "text/html");
|
|
365
|
+
var spans = doc.querySelectorAll("span");
|
|
366
|
+
var lastSpan = spans[spans.length - 1];
|
|
367
|
+
var notFunctionInit = !((_b = document.getElementById("luckysheet-rich-text-editor")) === null || _b === void 0 ? void 0 : _b.innerText.includes("("));
|
|
368
|
+
if ((lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.includes(")")) || notFunctionInit && (lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.length) >= 1 && !_lodash.default.includes(["="], lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText)) {
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
369
371
|
}
|
|
370
372
|
var moveCount = (0, _2.hideCRCount)(ctx, e.key);
|
|
371
373
|
switch (e.key) {
|
package/lib/modules/formula.js
CHANGED
|
@@ -1264,7 +1264,7 @@ function setCaretPosition(ctx, textDom, children, pos) {
|
|
|
1264
1264
|
sel === null || sel === void 0 ? void 0 : sel.addRange(range);
|
|
1265
1265
|
el.focus();
|
|
1266
1266
|
} catch (err) {
|
|
1267
|
-
console.error
|
|
1267
|
+
console.warn("setCaretPosition error");
|
|
1268
1268
|
(0, _cursor.moveToEnd)(ctx.formulaCache.rangeResizeTo[0]);
|
|
1269
1269
|
}
|
|
1270
1270
|
}
|