@fileverse-dev/fortune-core 1.2.62 → 1.2.64
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/locale/en.js +21 -0
- 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/locale/en.js +21 -0
- 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/locale/en.js
CHANGED
|
@@ -2935,6 +2935,27 @@ export default {
|
|
|
2935
2935
|
repeat: "n",
|
|
2936
2936
|
type: "rangeall"
|
|
2937
2937
|
}]
|
|
2938
|
+
}, {
|
|
2939
|
+
n: "EPOCHTODATE",
|
|
2940
|
+
t: 2,
|
|
2941
|
+
d: "Converts a Unix epoch timestamp in seconds, milliseconds, or microseconds to a datetime in UTC.",
|
|
2942
|
+
a: "Vertical lookup.",
|
|
2943
|
+
m: [3, 4],
|
|
2944
|
+
p: [{
|
|
2945
|
+
name: "timestamp",
|
|
2946
|
+
detail: "A Unix epoch timestamp in seconds, milliseconds, or microseconds.",
|
|
2947
|
+
example: "1655906568893",
|
|
2948
|
+
require: "m",
|
|
2949
|
+
repeat: "n",
|
|
2950
|
+
type: "rangeall"
|
|
2951
|
+
}, {
|
|
2952
|
+
name: "time_unit",
|
|
2953
|
+
detail: "The unit of time in which the timestamp is expressed. 1 (default) indicates the time unit is seconds. 2 indicates the time unit is milliseconds. 3 indicates the time unit is microseconds.",
|
|
2954
|
+
example: "2",
|
|
2955
|
+
require: "o",
|
|
2956
|
+
repeat: "n",
|
|
2957
|
+
type: "rangeall"
|
|
2958
|
+
}]
|
|
2938
2959
|
}, {
|
|
2939
2960
|
n: "HLOOKUP",
|
|
2940
2961
|
t: 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/locale/en.js
CHANGED
|
@@ -2941,6 +2941,27 @@ var _default = exports.default = {
|
|
|
2941
2941
|
repeat: "n",
|
|
2942
2942
|
type: "rangeall"
|
|
2943
2943
|
}]
|
|
2944
|
+
}, {
|
|
2945
|
+
n: "EPOCHTODATE",
|
|
2946
|
+
t: 2,
|
|
2947
|
+
d: "Converts a Unix epoch timestamp in seconds, milliseconds, or microseconds to a datetime in UTC.",
|
|
2948
|
+
a: "Vertical lookup.",
|
|
2949
|
+
m: [3, 4],
|
|
2950
|
+
p: [{
|
|
2951
|
+
name: "timestamp",
|
|
2952
|
+
detail: "A Unix epoch timestamp in seconds, milliseconds, or microseconds.",
|
|
2953
|
+
example: "1655906568893",
|
|
2954
|
+
require: "m",
|
|
2955
|
+
repeat: "n",
|
|
2956
|
+
type: "rangeall"
|
|
2957
|
+
}, {
|
|
2958
|
+
name: "time_unit",
|
|
2959
|
+
detail: "The unit of time in which the timestamp is expressed. 1 (default) indicates the time unit is seconds. 2 indicates the time unit is milliseconds. 3 indicates the time unit is microseconds.",
|
|
2960
|
+
example: "2",
|
|
2961
|
+
require: "o",
|
|
2962
|
+
repeat: "n",
|
|
2963
|
+
type: "rangeall"
|
|
2964
|
+
}]
|
|
2944
2965
|
}, {
|
|
2945
2966
|
n: "HLOOKUP",
|
|
2946
2967
|
t: 2,
|
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.64",
|
|
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.87",
|
|
19
19
|
"dayjs": "^1.11.0",
|
|
20
20
|
"immer": "^9.0.12",
|
|
21
21
|
"lodash": "^4.17.21",
|