@fileverse-dev/fortune-core 1.2.61 → 1.2.62-patch-2

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 CHANGED
@@ -3460,7 +3460,7 @@ export default {
3460
3460
  type: "rangeall"
3461
3461
  }]
3462
3462
  }, {
3463
- n: "NETWORKDAYS_INTL",
3463
+ n: "NETWORKDAYS.INTL",
3464
3464
  t: 6,
3465
3465
  d: "Returns the number of net working days between two provided days excluding specified weekend days and holidays.",
3466
3466
  a: "Net working days between two dates (specifying weekends).",
@@ -3712,7 +3712,7 @@ export default {
3712
3712
  type: "rangeall"
3713
3713
  }]
3714
3714
  }, {
3715
- n: "WORKDAY_INTL",
3715
+ n: "WORKDAY.INTL",
3716
3716
  t: 6,
3717
3717
  d: "Calculates the date after a specified number of workdays excluding specified weekend days and holidays.",
3718
3718
  a: "Date after a number of workdays (specifying weekends).",
@@ -689,7 +689,19 @@ export function insertUpdateFunctionGroup(ctx, r, c, id, calcChainSet) {
689
689
  file.calcChain = calcChain;
690
690
  ctx.luckysheetfile = luckysheetfile;
691
691
  }
692
+ function replaceDotsInFunctionName(str) {
693
+ if (!str.startsWith("=")) return str;
694
+ var openParenIndex = str.indexOf("(");
695
+ if (openParenIndex === -1) return str;
696
+ var fnName = str.substring(1, openParenIndex);
697
+ var fixedFnName = fnName.replace(/\./g, "_");
698
+ return "=".concat(fixedFnName).concat(str.substring(openParenIndex));
699
+ }
692
700
  export function execfunction(ctx, txt, r, c, id, calcChainSet, isrefresh, notInsertFunc) {
701
+ var originalTxt = txt;
702
+ if (txt.toUpperCase().includes("NETWORKDAYS.INTL") || txt.toUpperCase().includes("WORKDAY.INTL")) {
703
+ txt = replaceDotsInFunctionName(txt);
704
+ }
693
705
  if (txt.indexOf(error.r) > -1) {
694
706
  return [false, error.r, txt];
695
707
  }
@@ -740,7 +752,7 @@ export function execfunction(ctx, txt, r, c, id, calcChainSet, isrefresh, notIns
740
752
  } else {
741
753
  clearCellError(ctx, r, c);
742
754
  }
743
- return [true, !isError ? finalResult : "#ERROR", txt, isError && {
755
+ return [true, !isError ? finalResult : "#ERROR", originalTxt, isError && {
744
756
  row_column: "".concat(r, "_").concat(c),
745
757
  title: "Error",
746
758
  message: (formulaError === null || formulaError === void 0 ? void 0 : formulaError.toString()) || detectedErrorFromValue || "Unknown Error"
@@ -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, cell: Cell, attr: keyof Cell, value: any, cellInput: HTMLDivElement): void;
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, cell, attr, value, cellInput) {
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;
@@ -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];
@@ -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
- var cell = d[ctx.luckysheetCellUpdate[0]][ctx.luckysheetCellUpdate[1]];
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
@@ -3466,7 +3466,7 @@ var _default = exports.default = {
3466
3466
  type: "rangeall"
3467
3467
  }]
3468
3468
  }, {
3469
- n: "NETWORKDAYS_INTL",
3469
+ n: "NETWORKDAYS.INTL",
3470
3470
  t: 6,
3471
3471
  d: "Returns the number of net working days between two provided days excluding specified weekend days and holidays.",
3472
3472
  a: "Net working days between two dates (specifying weekends).",
@@ -3718,7 +3718,7 @@ var _default = exports.default = {
3718
3718
  type: "rangeall"
3719
3719
  }]
3720
3720
  }, {
3721
- n: "WORKDAY_INTL",
3721
+ n: "WORKDAY.INTL",
3722
3722
  t: 6,
3723
3723
  d: "Calculates the date after a specified number of workdays excluding specified weekend days and holidays.",
3724
3724
  a: "Date after a number of workdays (specifying weekends).",
@@ -719,7 +719,19 @@ function insertUpdateFunctionGroup(ctx, r, c, id, calcChainSet) {
719
719
  file.calcChain = calcChain;
720
720
  ctx.luckysheetfile = luckysheetfile;
721
721
  }
722
+ function replaceDotsInFunctionName(str) {
723
+ if (!str.startsWith("=")) return str;
724
+ var openParenIndex = str.indexOf("(");
725
+ if (openParenIndex === -1) return str;
726
+ var fnName = str.substring(1, openParenIndex);
727
+ var fixedFnName = fnName.replace(/\./g, "_");
728
+ return "=".concat(fixedFnName).concat(str.substring(openParenIndex));
729
+ }
722
730
  function execfunction(ctx, txt, r, c, id, calcChainSet, isrefresh, notInsertFunc) {
731
+ var originalTxt = txt;
732
+ if (txt.toUpperCase().includes("NETWORKDAYS.INTL") || txt.toUpperCase().includes("WORKDAY.INTL")) {
733
+ txt = replaceDotsInFunctionName(txt);
734
+ }
723
735
  if (txt.indexOf(_validation.error.r) > -1) {
724
736
  return [false, _validation.error.r, txt];
725
737
  }
@@ -770,7 +782,7 @@ function execfunction(ctx, txt, r, c, id, calcChainSet, isrefresh, notInsertFunc
770
782
  } else {
771
783
  (0, _2.clearCellError)(ctx, r, c);
772
784
  }
773
- return [true, !isError ? finalResult : "#ERROR", txt, isError && {
785
+ return [true, !isError ? finalResult : "#ERROR", originalTxt, isError && {
774
786
  row_column: "".concat(r, "_").concat(c),
775
787
  title: "Error",
776
788
  message: (formulaError === null || formulaError === void 0 ? void 0 : formulaError.toString()) || detectedErrorFromValue || "Unknown Error"
@@ -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, cell: Cell, attr: keyof Cell, value: any, cellInput: HTMLDivElement): void;
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, cell, attr, value, cellInput) {
302
+ function updateInlineStringFormat(ctx, attr, value, cellInput) {
303
303
  var _a, _b, _c;
304
304
  var w = window.getSelection();
305
305
  if (!w) return;
@@ -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];
@@ -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
- var cell = d[ctx.luckysheetCellUpdate[0]][ctx.luckysheetCellUpdate[1]];
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.61",
3
+ "version": "1.2.62-patch-2",
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.84",
18
+ "@fileverse-dev/formula-parser": "0.2.85-patch-1",
19
19
  "dayjs": "^1.11.0",
20
20
  "immer": "^9.0.12",
21
21
  "lodash": "^4.17.21",