@fileverse-dev/fortune-core 1.0.82 → 1.0.83
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 +5 -6
- package/es/modules/formula.js +3 -3
- package/es/modules/selection.d.ts +1 -1
- package/es/modules/selection.js +5 -7
- package/lib/events/keyboard.js +5 -6
- package/lib/modules/formula.js +3 -3
- package/lib/modules/selection.d.ts +1 -1
- package/lib/modules/selection.js +5 -7
- package/package.json +1 -1
package/es/events/keyboard.js
CHANGED
|
@@ -151,7 +151,7 @@ export function handleWithCtrlOrMetaKey(ctx, cache, e, cellInput, fxInput, handl
|
|
|
151
151
|
handleItalic(ctx, cellInput);
|
|
152
152
|
} else if (e.code === "KeyU") {
|
|
153
153
|
handleUnderline(ctx, cellInput);
|
|
154
|
-
} else if (e.code ===
|
|
154
|
+
} else if (e.code === "Backslash") {
|
|
155
155
|
deleteSelectedCellFormat(ctx);
|
|
156
156
|
} else if (e.code === "KeyC") {
|
|
157
157
|
handleCopy(ctx);
|
|
@@ -257,18 +257,18 @@ export function handleArrowKey(ctx, e) {
|
|
|
257
257
|
}
|
|
258
258
|
export function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUndo, handleRedo, canvas) {
|
|
259
259
|
var _a;
|
|
260
|
-
if (e.shiftKey && e.code ===
|
|
260
|
+
if (e.shiftKey && e.code === "Space") {
|
|
261
261
|
e.stopImmediatePropagation();
|
|
262
262
|
e.stopPropagation();
|
|
263
263
|
e.preventDefault();
|
|
264
264
|
return;
|
|
265
265
|
}
|
|
266
266
|
if ((e.ctrlKey || e.metaKey && e.shiftKey) && e.code === "KeyE") {
|
|
267
|
-
textFormat(ctx,
|
|
267
|
+
textFormat(ctx, "center");
|
|
268
268
|
} else if ((e.ctrlKey || e.metaKey && e.shiftKey) && e.code === "KeyL") {
|
|
269
|
-
textFormat(ctx,
|
|
269
|
+
textFormat(ctx, "left");
|
|
270
270
|
} else if ((e.ctrlKey || e.metaKey && e.shiftKey) && e.code === "KeyR") {
|
|
271
|
-
textFormat(ctx,
|
|
271
|
+
textFormat(ctx, "right");
|
|
272
272
|
}
|
|
273
273
|
ctx.luckysheet_select_status = false;
|
|
274
274
|
var kcode = e.keyCode;
|
|
@@ -345,7 +345,6 @@ export function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUnd
|
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
|
-
console.log('kkkk');
|
|
349
348
|
if (cellInput !== document.activeElement) {
|
|
350
349
|
cellInput === null || cellInput === void 0 ? void 0 : cellInput.focus();
|
|
351
350
|
}
|
package/es/modules/formula.js
CHANGED
|
@@ -1198,9 +1198,9 @@ export function setCaretPosition(ctx, textDom, children, pos) {
|
|
|
1198
1198
|
var el = textDom;
|
|
1199
1199
|
var range = document.createRange();
|
|
1200
1200
|
var sel = window.getSelection();
|
|
1201
|
-
var mainSpan = document.querySelector(
|
|
1202
|
-
var textContent = ((_b = (_a = mainSpan === null || mainSpan === void 0 ? void 0 : mainSpan.firstChild) === null || _a === void 0 ? void 0 : _a.nodeValue) === null || _b === void 0 ? void 0 : _b.trim()) ||
|
|
1203
|
-
var innerSpan = mainSpan === null || mainSpan === void 0 ? void 0 : mainSpan.querySelector(
|
|
1201
|
+
var mainSpan = document.querySelector(".luckysheet-formula-text-string");
|
|
1202
|
+
var textContent = ((_b = (_a = mainSpan === null || mainSpan === void 0 ? void 0 : mainSpan.firstChild) === null || _a === void 0 ? void 0 : _a.nodeValue) === null || _b === void 0 ? void 0 : _b.trim()) || "";
|
|
1203
|
+
var innerSpan = mainSpan === null || mainSpan === void 0 ? void 0 : mainSpan.querySelector(".fortune-formula-functionrange-cell");
|
|
1204
1204
|
if (innerSpan && mainSpan) {
|
|
1205
1205
|
textContent += innerSpan.textContent;
|
|
1206
1206
|
el.innerHTML = textContent;
|
|
@@ -25,7 +25,7 @@ export declare function rangeValueToHtml(ctx: Context, sheetId: string, ranges?:
|
|
|
25
25
|
export declare function copy(ctx: Context): void;
|
|
26
26
|
export declare function deleteSelectedCellText(ctx: Context): string;
|
|
27
27
|
export declare function deleteSelectedCellFormat(ctx: Context): string;
|
|
28
|
-
export declare function textFormat(ctx: Context, type:
|
|
28
|
+
export declare function textFormat(ctx: Context, type: "left" | "center" | "right"): string;
|
|
29
29
|
export declare function selectIsOverlap(ctx: Context, range?: any): boolean;
|
|
30
30
|
export declare function selectAll(ctx: Context): void;
|
|
31
31
|
export declare function fixRowStyleOverflowInFreeze(ctx: Context, r1: number, r2: number, freeze: Freezen | undefined): {
|
package/es/modules/selection.js
CHANGED
|
@@ -1561,7 +1561,6 @@ export function deleteSelectedCellFormat(ctx) {
|
|
|
1561
1561
|
if (has_PartMC) {
|
|
1562
1562
|
return "partMC";
|
|
1563
1563
|
}
|
|
1564
|
-
var hyperlinkMap = ctx.luckysheetfile[getSheetIndex(ctx, ctx.currentSheetId)].hyperlink;
|
|
1565
1564
|
for (var s = 0; s < selection.length; s += 1) {
|
|
1566
1565
|
var r1 = selection[s].row[0];
|
|
1567
1566
|
var r2 = selection[s].row[1];
|
|
@@ -1610,7 +1609,6 @@ export function textFormat(ctx, type) {
|
|
|
1610
1609
|
if (has_PartMC) {
|
|
1611
1610
|
return "partMC";
|
|
1612
1611
|
}
|
|
1613
|
-
var hyperlinkMap = ctx.luckysheetfile[getSheetIndex(ctx, ctx.currentSheetId)].hyperlink;
|
|
1614
1612
|
for (var s = 0; s < selection.length; s += 1) {
|
|
1615
1613
|
var r1 = selection[s].row[0];
|
|
1616
1614
|
var r2 = selection[s].row[1];
|
|
@@ -1620,14 +1618,14 @@ export function textFormat(ctx, type) {
|
|
|
1620
1618
|
for (var c = c1; c <= c2; c += 1) {
|
|
1621
1619
|
if (_.isPlainObject(d[r][c])) {
|
|
1622
1620
|
var cell = d[r][c];
|
|
1623
|
-
if (type ===
|
|
1624
|
-
cell.tb = "
|
|
1621
|
+
if (type === "left") {
|
|
1622
|
+
cell.tb = "1";
|
|
1625
1623
|
cell.ht = 1;
|
|
1626
1624
|
} else if (type === "center") {
|
|
1627
|
-
cell.tb = "
|
|
1625
|
+
cell.tb = "1";
|
|
1628
1626
|
cell.ht = 0;
|
|
1629
|
-
} else if (type ===
|
|
1630
|
-
cell.tb = "
|
|
1627
|
+
} else if (type === "right") {
|
|
1628
|
+
cell.tb = "1";
|
|
1631
1629
|
cell.ht = 2;
|
|
1632
1630
|
}
|
|
1633
1631
|
}
|
package/lib/events/keyboard.js
CHANGED
|
@@ -161,7 +161,7 @@ function handleWithCtrlOrMetaKey(ctx, cache, e, cellInput, fxInput, handleUndo,
|
|
|
161
161
|
(0, _toolbar.handleItalic)(ctx, cellInput);
|
|
162
162
|
} else if (e.code === "KeyU") {
|
|
163
163
|
(0, _toolbar.handleUnderline)(ctx, cellInput);
|
|
164
|
-
} else if (e.code ===
|
|
164
|
+
} else if (e.code === "Backslash") {
|
|
165
165
|
(0, _selection.deleteSelectedCellFormat)(ctx);
|
|
166
166
|
} else if (e.code === "KeyC") {
|
|
167
167
|
(0, _copy.handleCopy)(ctx);
|
|
@@ -267,18 +267,18 @@ function handleArrowKey(ctx, e) {
|
|
|
267
267
|
}
|
|
268
268
|
function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUndo, handleRedo, canvas) {
|
|
269
269
|
var _a;
|
|
270
|
-
if (e.shiftKey && e.code ===
|
|
270
|
+
if (e.shiftKey && e.code === "Space") {
|
|
271
271
|
e.stopImmediatePropagation();
|
|
272
272
|
e.stopPropagation();
|
|
273
273
|
e.preventDefault();
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
276
276
|
if ((e.ctrlKey || e.metaKey && e.shiftKey) && e.code === "KeyE") {
|
|
277
|
-
(0, _selection.textFormat)(ctx,
|
|
277
|
+
(0, _selection.textFormat)(ctx, "center");
|
|
278
278
|
} else if ((e.ctrlKey || e.metaKey && e.shiftKey) && e.code === "KeyL") {
|
|
279
|
-
(0, _selection.textFormat)(ctx,
|
|
279
|
+
(0, _selection.textFormat)(ctx, "left");
|
|
280
280
|
} else if ((e.ctrlKey || e.metaKey && e.shiftKey) && e.code === "KeyR") {
|
|
281
|
-
(0, _selection.textFormat)(ctx,
|
|
281
|
+
(0, _selection.textFormat)(ctx, "right");
|
|
282
282
|
}
|
|
283
283
|
ctx.luckysheet_select_status = false;
|
|
284
284
|
var kcode = e.keyCode;
|
|
@@ -355,7 +355,6 @@ function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUndo, hand
|
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
console.log('kkkk');
|
|
359
358
|
if (cellInput !== document.activeElement) {
|
|
360
359
|
cellInput === null || cellInput === void 0 ? void 0 : cellInput.focus();
|
|
361
360
|
}
|
package/lib/modules/formula.js
CHANGED
|
@@ -1227,9 +1227,9 @@ function setCaretPosition(ctx, textDom, children, pos) {
|
|
|
1227
1227
|
var el = textDom;
|
|
1228
1228
|
var range = document.createRange();
|
|
1229
1229
|
var sel = window.getSelection();
|
|
1230
|
-
var mainSpan = document.querySelector(
|
|
1231
|
-
var textContent = ((_b = (_a = mainSpan === null || mainSpan === void 0 ? void 0 : mainSpan.firstChild) === null || _a === void 0 ? void 0 : _a.nodeValue) === null || _b === void 0 ? void 0 : _b.trim()) ||
|
|
1232
|
-
var innerSpan = mainSpan === null || mainSpan === void 0 ? void 0 : mainSpan.querySelector(
|
|
1230
|
+
var mainSpan = document.querySelector(".luckysheet-formula-text-string");
|
|
1231
|
+
var textContent = ((_b = (_a = mainSpan === null || mainSpan === void 0 ? void 0 : mainSpan.firstChild) === null || _a === void 0 ? void 0 : _a.nodeValue) === null || _b === void 0 ? void 0 : _b.trim()) || "";
|
|
1232
|
+
var innerSpan = mainSpan === null || mainSpan === void 0 ? void 0 : mainSpan.querySelector(".fortune-formula-functionrange-cell");
|
|
1233
1233
|
if (innerSpan && mainSpan) {
|
|
1234
1234
|
textContent += innerSpan.textContent;
|
|
1235
1235
|
el.innerHTML = textContent;
|
|
@@ -25,7 +25,7 @@ export declare function rangeValueToHtml(ctx: Context, sheetId: string, ranges?:
|
|
|
25
25
|
export declare function copy(ctx: Context): void;
|
|
26
26
|
export declare function deleteSelectedCellText(ctx: Context): string;
|
|
27
27
|
export declare function deleteSelectedCellFormat(ctx: Context): string;
|
|
28
|
-
export declare function textFormat(ctx: Context, type:
|
|
28
|
+
export declare function textFormat(ctx: Context, type: "left" | "center" | "right"): string;
|
|
29
29
|
export declare function selectIsOverlap(ctx: Context, range?: any): boolean;
|
|
30
30
|
export declare function selectAll(ctx: Context): void;
|
|
31
31
|
export declare function fixRowStyleOverflowInFreeze(ctx: Context, r1: number, r2: number, freeze: Freezen | undefined): {
|
package/lib/modules/selection.js
CHANGED
|
@@ -1592,7 +1592,6 @@ function deleteSelectedCellFormat(ctx) {
|
|
|
1592
1592
|
if (has_PartMC) {
|
|
1593
1593
|
return "partMC";
|
|
1594
1594
|
}
|
|
1595
|
-
var hyperlinkMap = ctx.luckysheetfile[(0, _utils.getSheetIndex)(ctx, ctx.currentSheetId)].hyperlink;
|
|
1596
1595
|
for (var s = 0; s < selection.length; s += 1) {
|
|
1597
1596
|
var r1 = selection[s].row[0];
|
|
1598
1597
|
var r2 = selection[s].row[1];
|
|
@@ -1641,7 +1640,6 @@ function textFormat(ctx, type) {
|
|
|
1641
1640
|
if (has_PartMC) {
|
|
1642
1641
|
return "partMC";
|
|
1643
1642
|
}
|
|
1644
|
-
var hyperlinkMap = ctx.luckysheetfile[(0, _utils.getSheetIndex)(ctx, ctx.currentSheetId)].hyperlink;
|
|
1645
1643
|
for (var s = 0; s < selection.length; s += 1) {
|
|
1646
1644
|
var r1 = selection[s].row[0];
|
|
1647
1645
|
var r2 = selection[s].row[1];
|
|
@@ -1651,14 +1649,14 @@ function textFormat(ctx, type) {
|
|
|
1651
1649
|
for (var c = c1; c <= c2; c += 1) {
|
|
1652
1650
|
if (_lodash.default.isPlainObject(d[r][c])) {
|
|
1653
1651
|
var cell = d[r][c];
|
|
1654
|
-
if (type ===
|
|
1655
|
-
cell.tb = "
|
|
1652
|
+
if (type === "left") {
|
|
1653
|
+
cell.tb = "1";
|
|
1656
1654
|
cell.ht = 1;
|
|
1657
1655
|
} else if (type === "center") {
|
|
1658
|
-
cell.tb = "
|
|
1656
|
+
cell.tb = "1";
|
|
1659
1657
|
cell.ht = 0;
|
|
1660
|
-
} else if (type ===
|
|
1661
|
-
cell.tb = "
|
|
1658
|
+
} else if (type === "right") {
|
|
1659
|
+
cell.tb = "1";
|
|
1662
1660
|
cell.ht = 2;
|
|
1663
1661
|
}
|
|
1664
1662
|
}
|