@fileverse-dev/fortune-core 1.2.62 → 1.2.63
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/modules/format.js +1 -1
- package/es/modules/formula.js +2 -4
- package/es/modules/inline-string.d.ts +1 -1
- package/es/modules/inline-string.js +1 -1
- package/es/modules/sort.js +1 -1
- package/es/modules/toolbar.js +1 -4
- package/lib/modules/format.js +1 -1
- package/lib/modules/formula.js +2 -4
- package/lib/modules/inline-string.d.ts +1 -1
- package/lib/modules/inline-string.js +1 -1
- package/lib/modules/sort.js +1 -1
- package/lib/modules/toolbar.js +1 -4
- package/package.json +2 -2
package/es/modules/format.js
CHANGED
|
@@ -40,7 +40,7 @@ export function genarate(value) {
|
|
|
40
40
|
if (_.isNil(value)) {
|
|
41
41
|
return null;
|
|
42
42
|
}
|
|
43
|
-
if (/^-?[0-9]{1,}[,][0-9]{3}(.[0-9]{1,2})?$/.test(value)) {
|
|
43
|
+
if (/^-?[0-9]{1,}[,][0-9]{3}(.[0-9]{1,2})?$/.test(value) && !Array.isArray(value)) {
|
|
44
44
|
value = value;
|
|
45
45
|
m = value;
|
|
46
46
|
v = Number(value.split(".")[0].replace(",", ""));
|
package/es/modules/formula.js
CHANGED
|
@@ -695,7 +695,7 @@ function replaceDotsInFunctionName(str) {
|
|
|
695
695
|
if (openParenIndex === -1) return str;
|
|
696
696
|
var fnName = str.substring(1, openParenIndex);
|
|
697
697
|
var fixedFnName = fnName.replace(/\./g, "_");
|
|
698
|
-
return "="
|
|
698
|
+
return "=".concat(fixedFnName).concat(str.substring(openParenIndex));
|
|
699
699
|
}
|
|
700
700
|
export function execfunction(ctx, txt, r, c, id, calcChainSet, isrefresh, notInsertFunc) {
|
|
701
701
|
var originalTxt = txt;
|
|
@@ -1635,9 +1635,7 @@ export function handleFormulaInput(ctx, $copyTo, $editor, kcode, preText, refres
|
|
|
1635
1635
|
} else if (!_.startsWith(value1txt, "=")) {
|
|
1636
1636
|
if (!$copyTo) return;
|
|
1637
1637
|
if ($copyTo.id === "luckysheet-rich-text-editor") {
|
|
1638
|
-
|
|
1639
|
-
$copyTo.innerHTML = escapeHTMLTag(value);
|
|
1640
|
-
}
|
|
1638
|
+
$copyTo.innerHTML = escapeHTMLTag(value);
|
|
1641
1639
|
} else {
|
|
1642
1640
|
$copyTo.innerHTML = escapeHTMLTag(value);
|
|
1643
1641
|
}
|
|
@@ -33,4 +33,4 @@ export declare function getInlineStringNoStyle(r: number, c: number, data: CellM
|
|
|
33
33
|
export declare function convertCssToStyleList(cssText: string, originCell: Cell): CellStyle;
|
|
34
34
|
export declare function convertSpanToShareString($dom: NodeListOf<HTMLSpanElement>, originCell: Cell): CellStyle[];
|
|
35
35
|
export declare function updateInlineStringFormatOutside(cell: Cell, key: string, value: any): void;
|
|
36
|
-
export declare function updateInlineStringFormat(ctx: Context,
|
|
36
|
+
export declare function updateInlineStringFormat(ctx: Context, attr: keyof Cell, value: any, cellInput: HTMLDivElement): void;
|
|
@@ -284,7 +284,7 @@ function extendCssText(origin, cover, isLimit) {
|
|
|
284
284
|
}
|
|
285
285
|
return newCss;
|
|
286
286
|
}
|
|
287
|
-
export function updateInlineStringFormat(ctx,
|
|
287
|
+
export function updateInlineStringFormat(ctx, attr, value, cellInput) {
|
|
288
288
|
var _a, _b, _c;
|
|
289
289
|
var w = window.getSelection();
|
|
290
290
|
if (!w) return;
|
package/es/modules/sort.js
CHANGED
|
@@ -174,7 +174,7 @@ function createRowsOrColumnsForSpilledValues(ctx, startRow, startColumn, spillRo
|
|
|
174
174
|
export function spillSortResult(ctx, startRow, startCol, formulaResult, flowdata) {
|
|
175
175
|
var formulaString = formulaResult === null || formulaResult === void 0 ? void 0 : formulaResult.f;
|
|
176
176
|
var formulaValue = formulaResult === null || formulaResult === void 0 ? void 0 : formulaResult.v;
|
|
177
|
-
if (typeof formulaString !== "string" || !(/= *SORT\s*\(/i.test(formulaString) || /= *XLOOKUP\s*\(/i.test(formulaString))) return false;
|
|
177
|
+
if (typeof formulaString !== "string" || !(/= *SORT\s*\(/i.test(formulaString) || /= *XLOOKUP\s*\(/i.test(formulaString) || /= *SEQUENCE\s*\(/i.test(formulaString))) return false;
|
|
178
178
|
if (!Array.isArray(formulaValue)) return false;
|
|
179
179
|
var valueMatrix = Array.isArray(formulaValue[0]) ? formulaValue : formulaValue.map(function (x) {
|
|
180
180
|
return [x];
|
package/es/modules/toolbar.js
CHANGED
|
@@ -210,10 +210,7 @@ export function updateFormat(ctx, $input, d, attr, foucsStatus, canvas) {
|
|
|
210
210
|
if (ctx.luckysheetCellUpdate.length > 0) {
|
|
211
211
|
var value = $input.innerText;
|
|
212
212
|
if (value.substring(0, 1) !== "=") {
|
|
213
|
-
|
|
214
|
-
if (cell) {
|
|
215
|
-
updateInlineStringFormat(ctx, cell, attr, foucsStatus, $input);
|
|
216
|
-
}
|
|
213
|
+
updateInlineStringFormat(ctx, attr, foucsStatus, $input);
|
|
217
214
|
return;
|
|
218
215
|
}
|
|
219
216
|
}
|
package/lib/modules/format.js
CHANGED
|
@@ -51,7 +51,7 @@ function genarate(value) {
|
|
|
51
51
|
if (_lodash.default.isNil(value)) {
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
54
|
-
if (/^-?[0-9]{1,}[,][0-9]{3}(.[0-9]{1,2})?$/.test(value)) {
|
|
54
|
+
if (/^-?[0-9]{1,}[,][0-9]{3}(.[0-9]{1,2})?$/.test(value) && !Array.isArray(value)) {
|
|
55
55
|
value = value;
|
|
56
56
|
m = value;
|
|
57
57
|
v = Number(value.split(".")[0].replace(",", ""));
|
package/lib/modules/formula.js
CHANGED
|
@@ -725,7 +725,7 @@ function replaceDotsInFunctionName(str) {
|
|
|
725
725
|
if (openParenIndex === -1) return str;
|
|
726
726
|
var fnName = str.substring(1, openParenIndex);
|
|
727
727
|
var fixedFnName = fnName.replace(/\./g, "_");
|
|
728
|
-
return "="
|
|
728
|
+
return "=".concat(fixedFnName).concat(str.substring(openParenIndex));
|
|
729
729
|
}
|
|
730
730
|
function execfunction(ctx, txt, r, c, id, calcChainSet, isrefresh, notInsertFunc) {
|
|
731
731
|
var originalTxt = txt;
|
|
@@ -1665,9 +1665,7 @@ function handleFormulaInput(ctx, $copyTo, $editor, kcode, preText, refreshRangeS
|
|
|
1665
1665
|
} else if (!_lodash.default.startsWith(value1txt, "=")) {
|
|
1666
1666
|
if (!$copyTo) return;
|
|
1667
1667
|
if ($copyTo.id === "luckysheet-rich-text-editor") {
|
|
1668
|
-
|
|
1669
|
-
$copyTo.innerHTML = (0, _utils.escapeHTMLTag)(value);
|
|
1670
|
-
}
|
|
1668
|
+
$copyTo.innerHTML = (0, _utils.escapeHTMLTag)(value);
|
|
1671
1669
|
} else {
|
|
1672
1670
|
$copyTo.innerHTML = (0, _utils.escapeHTMLTag)(value);
|
|
1673
1671
|
}
|
|
@@ -33,4 +33,4 @@ export declare function getInlineStringNoStyle(r: number, c: number, data: CellM
|
|
|
33
33
|
export declare function convertCssToStyleList(cssText: string, originCell: Cell): CellStyle;
|
|
34
34
|
export declare function convertSpanToShareString($dom: NodeListOf<HTMLSpanElement>, originCell: Cell): CellStyle[];
|
|
35
35
|
export declare function updateInlineStringFormatOutside(cell: Cell, key: string, value: any): void;
|
|
36
|
-
export declare function updateInlineStringFormat(ctx: Context,
|
|
36
|
+
export declare function updateInlineStringFormat(ctx: Context, attr: keyof Cell, value: any, cellInput: HTMLDivElement): void;
|
|
@@ -299,7 +299,7 @@ function extendCssText(origin, cover, isLimit) {
|
|
|
299
299
|
}
|
|
300
300
|
return newCss;
|
|
301
301
|
}
|
|
302
|
-
function updateInlineStringFormat(ctx,
|
|
302
|
+
function updateInlineStringFormat(ctx, attr, value, cellInput) {
|
|
303
303
|
var _a, _b, _c;
|
|
304
304
|
var w = window.getSelection();
|
|
305
305
|
if (!w) return;
|
package/lib/modules/sort.js
CHANGED
|
@@ -184,7 +184,7 @@ function createRowsOrColumnsForSpilledValues(ctx, startRow, startColumn, spillRo
|
|
|
184
184
|
function spillSortResult(ctx, startRow, startCol, formulaResult, flowdata) {
|
|
185
185
|
var formulaString = formulaResult === null || formulaResult === void 0 ? void 0 : formulaResult.f;
|
|
186
186
|
var formulaValue = formulaResult === null || formulaResult === void 0 ? void 0 : formulaResult.v;
|
|
187
|
-
if (typeof formulaString !== "string" || !(/= *SORT\s*\(/i.test(formulaString) || /= *XLOOKUP\s*\(/i.test(formulaString))) return false;
|
|
187
|
+
if (typeof formulaString !== "string" || !(/= *SORT\s*\(/i.test(formulaString) || /= *XLOOKUP\s*\(/i.test(formulaString) || /= *SEQUENCE\s*\(/i.test(formulaString))) return false;
|
|
188
188
|
if (!Array.isArray(formulaValue)) return false;
|
|
189
189
|
var valueMatrix = Array.isArray(formulaValue[0]) ? formulaValue : formulaValue.map(function (x) {
|
|
190
190
|
return [x];
|
package/lib/modules/toolbar.js
CHANGED
|
@@ -243,10 +243,7 @@ function updateFormat(ctx, $input, d, attr, foucsStatus, canvas) {
|
|
|
243
243
|
if (ctx.luckysheetCellUpdate.length > 0) {
|
|
244
244
|
var value = $input.innerText;
|
|
245
245
|
if (value.substring(0, 1) !== "=") {
|
|
246
|
-
|
|
247
|
-
if (cell) {
|
|
248
|
-
(0, _inlineString.updateInlineStringFormat)(ctx, cell, attr, foucsStatus, $input);
|
|
249
|
-
}
|
|
246
|
+
(0, _inlineString.updateInlineStringFormat)(ctx, attr, foucsStatus, $input);
|
|
250
247
|
return;
|
|
251
248
|
}
|
|
252
249
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fileverse-dev/fortune-core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.63",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dev": "father-build --watch"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@fileverse-dev/formula-parser": "0.2.
|
|
18
|
+
"@fileverse-dev/formula-parser": "0.2.86",
|
|
19
19
|
"dayjs": "^1.11.0",
|
|
20
20
|
"immer": "^9.0.12",
|
|
21
21
|
"lodash": "^4.17.21",
|