@odoo/o-spreadsheet 16.0.29 → 16.0.30

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.
@@ -1892,27 +1892,30 @@
1892
1892
  }
1893
1893
  function createLargeNumberFormat(format, magnitude, postFix) {
1894
1894
  const internalFormat = parseFormat(format || "#,##0");
1895
- const largeNumberFormat = internalFormat
1896
- .map((formatPart) => {
1897
- if (formatPart.type === "NUMBER") {
1898
- return [
1899
- {
1900
- ...formatPart,
1901
- format: {
1902
- ...formatPart.format,
1903
- magnitude,
1904
- decimalPart: undefined,
1905
- },
1906
- },
1907
- {
1908
- type: "STRING",
1909
- format: postFix,
1910
- },
1911
- ];
1895
+ const largeNumberFormat = [];
1896
+ for (let i = 0; i < internalFormat.length; i++) {
1897
+ const formatPart = internalFormat[i];
1898
+ if (formatPart.type !== "NUMBER") {
1899
+ largeNumberFormat.push(formatPart);
1900
+ continue;
1912
1901
  }
1913
- return formatPart;
1914
- })
1915
- .flat();
1902
+ largeNumberFormat.push({
1903
+ ...formatPart,
1904
+ format: {
1905
+ ...formatPart.format,
1906
+ magnitude,
1907
+ decimalPart: undefined,
1908
+ },
1909
+ });
1910
+ largeNumberFormat.push({
1911
+ type: "STRING",
1912
+ format: postFix,
1913
+ });
1914
+ const nextFormatPart = internalFormat[i + 1];
1915
+ if ((nextFormatPart === null || nextFormatPart === void 0 ? void 0 : nextFormatPart.type) === "STRING" && ["k", "m", "b"].includes(nextFormatPart.format)) {
1916
+ i++;
1917
+ }
1918
+ }
1916
1919
  return convertInternalFormatToFormat(largeNumberFormat);
1917
1920
  }
1918
1921
  function changeDecimalPlaces(format, step) {
@@ -3351,64 +3354,65 @@
3351
3354
  CommandResult[CommandResult["InvalidSheetId"] = 27] = "InvalidSheetId";
3352
3355
  CommandResult[CommandResult["InputAlreadyFocused"] = 28] = "InputAlreadyFocused";
3353
3356
  CommandResult[CommandResult["MaximumRangesReached"] = 29] = "MaximumRangesReached";
3354
- CommandResult[CommandResult["InvalidChartDefinition"] = 30] = "InvalidChartDefinition";
3355
- CommandResult[CommandResult["InvalidDataSet"] = 31] = "InvalidDataSet";
3356
- CommandResult[CommandResult["InvalidLabelRange"] = 32] = "InvalidLabelRange";
3357
- CommandResult[CommandResult["InvalidScorecardKeyValue"] = 33] = "InvalidScorecardKeyValue";
3358
- CommandResult[CommandResult["InvalidScorecardBaseline"] = 34] = "InvalidScorecardBaseline";
3359
- CommandResult[CommandResult["InvalidGaugeDataRange"] = 35] = "InvalidGaugeDataRange";
3360
- CommandResult[CommandResult["EmptyGaugeRangeMin"] = 36] = "EmptyGaugeRangeMin";
3361
- CommandResult[CommandResult["GaugeRangeMinNaN"] = 37] = "GaugeRangeMinNaN";
3362
- CommandResult[CommandResult["EmptyGaugeRangeMax"] = 38] = "EmptyGaugeRangeMax";
3363
- CommandResult[CommandResult["GaugeRangeMaxNaN"] = 39] = "GaugeRangeMaxNaN";
3364
- CommandResult[CommandResult["GaugeRangeMinBiggerThanRangeMax"] = 40] = "GaugeRangeMinBiggerThanRangeMax";
3365
- CommandResult[CommandResult["GaugeLowerInflectionPointNaN"] = 41] = "GaugeLowerInflectionPointNaN";
3366
- CommandResult[CommandResult["GaugeUpperInflectionPointNaN"] = 42] = "GaugeUpperInflectionPointNaN";
3367
- CommandResult[CommandResult["GaugeLowerBiggerThanUpper"] = 43] = "GaugeLowerBiggerThanUpper";
3368
- CommandResult[CommandResult["InvalidAutofillSelection"] = 44] = "InvalidAutofillSelection";
3369
- CommandResult[CommandResult["WrongComposerSelection"] = 45] = "WrongComposerSelection";
3370
- CommandResult[CommandResult["MinBiggerThanMax"] = 46] = "MinBiggerThanMax";
3371
- CommandResult[CommandResult["LowerBiggerThanUpper"] = 47] = "LowerBiggerThanUpper";
3372
- CommandResult[CommandResult["MidBiggerThanMax"] = 48] = "MidBiggerThanMax";
3373
- CommandResult[CommandResult["MinBiggerThanMid"] = 49] = "MinBiggerThanMid";
3374
- CommandResult[CommandResult["FirstArgMissing"] = 50] = "FirstArgMissing";
3375
- CommandResult[CommandResult["SecondArgMissing"] = 51] = "SecondArgMissing";
3376
- CommandResult[CommandResult["MinNaN"] = 52] = "MinNaN";
3377
- CommandResult[CommandResult["MidNaN"] = 53] = "MidNaN";
3378
- CommandResult[CommandResult["MaxNaN"] = 54] = "MaxNaN";
3379
- CommandResult[CommandResult["ValueUpperInflectionNaN"] = 55] = "ValueUpperInflectionNaN";
3380
- CommandResult[CommandResult["ValueLowerInflectionNaN"] = 56] = "ValueLowerInflectionNaN";
3381
- CommandResult[CommandResult["MinInvalidFormula"] = 57] = "MinInvalidFormula";
3382
- CommandResult[CommandResult["MidInvalidFormula"] = 58] = "MidInvalidFormula";
3383
- CommandResult[CommandResult["MaxInvalidFormula"] = 59] = "MaxInvalidFormula";
3384
- CommandResult[CommandResult["ValueUpperInvalidFormula"] = 60] = "ValueUpperInvalidFormula";
3385
- CommandResult[CommandResult["ValueLowerInvalidFormula"] = 61] = "ValueLowerInvalidFormula";
3386
- CommandResult[CommandResult["InvalidSortZone"] = 62] = "InvalidSortZone";
3387
- CommandResult[CommandResult["WaitingSessionConfirmation"] = 63] = "WaitingSessionConfirmation";
3388
- CommandResult[CommandResult["MergeOverlap"] = 64] = "MergeOverlap";
3389
- CommandResult[CommandResult["TooManyHiddenElements"] = 65] = "TooManyHiddenElements";
3390
- CommandResult[CommandResult["Readonly"] = 66] = "Readonly";
3391
- CommandResult[CommandResult["InvalidViewportSize"] = 67] = "InvalidViewportSize";
3392
- CommandResult[CommandResult["InvalidScrollingDirection"] = 68] = "InvalidScrollingDirection";
3393
- CommandResult[CommandResult["FigureDoesNotExist"] = 69] = "FigureDoesNotExist";
3394
- CommandResult[CommandResult["InvalidConditionalFormatId"] = 70] = "InvalidConditionalFormatId";
3395
- CommandResult[CommandResult["InvalidCellPopover"] = 71] = "InvalidCellPopover";
3396
- CommandResult[CommandResult["EmptyTarget"] = 72] = "EmptyTarget";
3397
- CommandResult[CommandResult["InvalidFreezeQuantity"] = 73] = "InvalidFreezeQuantity";
3398
- CommandResult[CommandResult["FrozenPaneOverlap"] = 74] = "FrozenPaneOverlap";
3399
- CommandResult[CommandResult["ValuesNotChanged"] = 75] = "ValuesNotChanged";
3400
- CommandResult[CommandResult["InvalidFilterZone"] = 76] = "InvalidFilterZone";
3401
- CommandResult[CommandResult["FilterOverlap"] = 77] = "FilterOverlap";
3402
- CommandResult[CommandResult["FilterNotFound"] = 78] = "FilterNotFound";
3403
- CommandResult[CommandResult["MergeInFilter"] = 79] = "MergeInFilter";
3404
- CommandResult[CommandResult["NonContinuousTargets"] = 80] = "NonContinuousTargets";
3405
- CommandResult[CommandResult["DuplicatedFigureId"] = 81] = "DuplicatedFigureId";
3406
- CommandResult[CommandResult["InvalidSelectionStep"] = 82] = "InvalidSelectionStep";
3407
- CommandResult[CommandResult["DuplicatedChartId"] = 83] = "DuplicatedChartId";
3408
- CommandResult[CommandResult["ChartDoesNotExist"] = 84] = "ChartDoesNotExist";
3409
- CommandResult[CommandResult["InvalidHeaderIndex"] = 85] = "InvalidHeaderIndex";
3410
- CommandResult[CommandResult["InvalidQuantity"] = 86] = "InvalidQuantity";
3411
- CommandResult[CommandResult["NoChanges"] = 87] = "NoChanges";
3357
+ CommandResult[CommandResult["InvalidInputId"] = 30] = "InvalidInputId";
3358
+ CommandResult[CommandResult["InvalidChartDefinition"] = 31] = "InvalidChartDefinition";
3359
+ CommandResult[CommandResult["InvalidDataSet"] = 32] = "InvalidDataSet";
3360
+ CommandResult[CommandResult["InvalidLabelRange"] = 33] = "InvalidLabelRange";
3361
+ CommandResult[CommandResult["InvalidScorecardKeyValue"] = 34] = "InvalidScorecardKeyValue";
3362
+ CommandResult[CommandResult["InvalidScorecardBaseline"] = 35] = "InvalidScorecardBaseline";
3363
+ CommandResult[CommandResult["InvalidGaugeDataRange"] = 36] = "InvalidGaugeDataRange";
3364
+ CommandResult[CommandResult["EmptyGaugeRangeMin"] = 37] = "EmptyGaugeRangeMin";
3365
+ CommandResult[CommandResult["GaugeRangeMinNaN"] = 38] = "GaugeRangeMinNaN";
3366
+ CommandResult[CommandResult["EmptyGaugeRangeMax"] = 39] = "EmptyGaugeRangeMax";
3367
+ CommandResult[CommandResult["GaugeRangeMaxNaN"] = 40] = "GaugeRangeMaxNaN";
3368
+ CommandResult[CommandResult["GaugeRangeMinBiggerThanRangeMax"] = 41] = "GaugeRangeMinBiggerThanRangeMax";
3369
+ CommandResult[CommandResult["GaugeLowerInflectionPointNaN"] = 42] = "GaugeLowerInflectionPointNaN";
3370
+ CommandResult[CommandResult["GaugeUpperInflectionPointNaN"] = 43] = "GaugeUpperInflectionPointNaN";
3371
+ CommandResult[CommandResult["GaugeLowerBiggerThanUpper"] = 44] = "GaugeLowerBiggerThanUpper";
3372
+ CommandResult[CommandResult["InvalidAutofillSelection"] = 45] = "InvalidAutofillSelection";
3373
+ CommandResult[CommandResult["WrongComposerSelection"] = 46] = "WrongComposerSelection";
3374
+ CommandResult[CommandResult["MinBiggerThanMax"] = 47] = "MinBiggerThanMax";
3375
+ CommandResult[CommandResult["LowerBiggerThanUpper"] = 48] = "LowerBiggerThanUpper";
3376
+ CommandResult[CommandResult["MidBiggerThanMax"] = 49] = "MidBiggerThanMax";
3377
+ CommandResult[CommandResult["MinBiggerThanMid"] = 50] = "MinBiggerThanMid";
3378
+ CommandResult[CommandResult["FirstArgMissing"] = 51] = "FirstArgMissing";
3379
+ CommandResult[CommandResult["SecondArgMissing"] = 52] = "SecondArgMissing";
3380
+ CommandResult[CommandResult["MinNaN"] = 53] = "MinNaN";
3381
+ CommandResult[CommandResult["MidNaN"] = 54] = "MidNaN";
3382
+ CommandResult[CommandResult["MaxNaN"] = 55] = "MaxNaN";
3383
+ CommandResult[CommandResult["ValueUpperInflectionNaN"] = 56] = "ValueUpperInflectionNaN";
3384
+ CommandResult[CommandResult["ValueLowerInflectionNaN"] = 57] = "ValueLowerInflectionNaN";
3385
+ CommandResult[CommandResult["MinInvalidFormula"] = 58] = "MinInvalidFormula";
3386
+ CommandResult[CommandResult["MidInvalidFormula"] = 59] = "MidInvalidFormula";
3387
+ CommandResult[CommandResult["MaxInvalidFormula"] = 60] = "MaxInvalidFormula";
3388
+ CommandResult[CommandResult["ValueUpperInvalidFormula"] = 61] = "ValueUpperInvalidFormula";
3389
+ CommandResult[CommandResult["ValueLowerInvalidFormula"] = 62] = "ValueLowerInvalidFormula";
3390
+ CommandResult[CommandResult["InvalidSortZone"] = 63] = "InvalidSortZone";
3391
+ CommandResult[CommandResult["WaitingSessionConfirmation"] = 64] = "WaitingSessionConfirmation";
3392
+ CommandResult[CommandResult["MergeOverlap"] = 65] = "MergeOverlap";
3393
+ CommandResult[CommandResult["TooManyHiddenElements"] = 66] = "TooManyHiddenElements";
3394
+ CommandResult[CommandResult["Readonly"] = 67] = "Readonly";
3395
+ CommandResult[CommandResult["InvalidViewportSize"] = 68] = "InvalidViewportSize";
3396
+ CommandResult[CommandResult["InvalidScrollingDirection"] = 69] = "InvalidScrollingDirection";
3397
+ CommandResult[CommandResult["FigureDoesNotExist"] = 70] = "FigureDoesNotExist";
3398
+ CommandResult[CommandResult["InvalidConditionalFormatId"] = 71] = "InvalidConditionalFormatId";
3399
+ CommandResult[CommandResult["InvalidCellPopover"] = 72] = "InvalidCellPopover";
3400
+ CommandResult[CommandResult["EmptyTarget"] = 73] = "EmptyTarget";
3401
+ CommandResult[CommandResult["InvalidFreezeQuantity"] = 74] = "InvalidFreezeQuantity";
3402
+ CommandResult[CommandResult["FrozenPaneOverlap"] = 75] = "FrozenPaneOverlap";
3403
+ CommandResult[CommandResult["ValuesNotChanged"] = 76] = "ValuesNotChanged";
3404
+ CommandResult[CommandResult["InvalidFilterZone"] = 77] = "InvalidFilterZone";
3405
+ CommandResult[CommandResult["FilterOverlap"] = 78] = "FilterOverlap";
3406
+ CommandResult[CommandResult["FilterNotFound"] = 79] = "FilterNotFound";
3407
+ CommandResult[CommandResult["MergeInFilter"] = 80] = "MergeInFilter";
3408
+ CommandResult[CommandResult["NonContinuousTargets"] = 81] = "NonContinuousTargets";
3409
+ CommandResult[CommandResult["DuplicatedFigureId"] = 82] = "DuplicatedFigureId";
3410
+ CommandResult[CommandResult["InvalidSelectionStep"] = 83] = "InvalidSelectionStep";
3411
+ CommandResult[CommandResult["DuplicatedChartId"] = 84] = "DuplicatedChartId";
3412
+ CommandResult[CommandResult["ChartDoesNotExist"] = 85] = "ChartDoesNotExist";
3413
+ CommandResult[CommandResult["InvalidHeaderIndex"] = 86] = "InvalidHeaderIndex";
3414
+ CommandResult[CommandResult["InvalidQuantity"] = 87] = "InvalidQuantity";
3415
+ CommandResult[CommandResult["NoChanges"] = 88] = "NoChanges";
3412
3416
  })(exports.CommandResult || (exports.CommandResult = {}));
3413
3417
 
3414
3418
  function isMatrix(x) {
@@ -4909,7 +4913,7 @@
4909
4913
  });
4910
4914
  }
4911
4915
  }
4912
- if (result.isCancelledBecause(62 /* CommandResult.InvalidSortZone */)) {
4916
+ if (result.isCancelledBecause(63 /* CommandResult.InvalidSortZone */)) {
4913
4917
  const { col, row } = anchor;
4914
4918
  env.model.selection.selectZone({ cell: { col, row }, zone });
4915
4919
  env.raiseError(_lt("Cannot sort. To sort, select only cells or only merges that have the same size."));
@@ -4932,13 +4936,13 @@
4932
4936
  };
4933
4937
  function interactiveAddFilter(env, sheetId, target) {
4934
4938
  const result = env.model.dispatch("CREATE_FILTER_TABLE", { target, sheetId });
4935
- if (result.isCancelledBecause(77 /* CommandResult.FilterOverlap */)) {
4939
+ if (result.isCancelledBecause(78 /* CommandResult.FilterOverlap */)) {
4936
4940
  env.raiseError(AddFilterInteractiveContent.filterOverlap);
4937
4941
  }
4938
- else if (result.isCancelledBecause(79 /* CommandResult.MergeInFilter */)) {
4942
+ else if (result.isCancelledBecause(80 /* CommandResult.MergeInFilter */)) {
4939
4943
  env.raiseError(AddFilterInteractiveContent.mergeInFilter);
4940
4944
  }
4941
- else if (result.isCancelledBecause(80 /* CommandResult.NonContinuousTargets */)) {
4945
+ else if (result.isCancelledBecause(81 /* CommandResult.NonContinuousTargets */)) {
4942
4946
  env.raiseError(AddFilterInteractiveContent.nonContinuousTargets);
4943
4947
  }
4944
4948
  }
@@ -4960,7 +4964,7 @@
4960
4964
  else if (result.reasons.includes(22 /* CommandResult.WrongFigurePasteOption */)) {
4961
4965
  env.raiseError(PasteInteractiveContent.wrongFigurePasteOption);
4962
4966
  }
4963
- else if (result.reasons.includes(74 /* CommandResult.FrozenPaneOverlap */)) {
4967
+ else if (result.reasons.includes(75 /* CommandResult.FrozenPaneOverlap */)) {
4964
4968
  env.raiseError(PasteInteractiveContent.frozenPaneOverlap);
4965
4969
  }
4966
4970
  }
@@ -6002,22 +6006,22 @@
6002
6006
  const CfTerms = {
6003
6007
  Errors: {
6004
6008
  [25 /* CommandResult.InvalidRange */]: _lt("The range is invalid"),
6005
- [50 /* CommandResult.FirstArgMissing */]: _lt("The argument is missing. Please provide a value"),
6006
- [51 /* CommandResult.SecondArgMissing */]: _lt("The second argument is missing. Please provide a value"),
6007
- [52 /* CommandResult.MinNaN */]: _lt("The minpoint must be a number"),
6008
- [53 /* CommandResult.MidNaN */]: _lt("The midpoint must be a number"),
6009
- [54 /* CommandResult.MaxNaN */]: _lt("The maxpoint must be a number"),
6010
- [55 /* CommandResult.ValueUpperInflectionNaN */]: _lt("The first value must be a number"),
6011
- [56 /* CommandResult.ValueLowerInflectionNaN */]: _lt("The second value must be a number"),
6012
- [46 /* CommandResult.MinBiggerThanMax */]: _lt("Minimum must be smaller then Maximum"),
6013
- [49 /* CommandResult.MinBiggerThanMid */]: _lt("Minimum must be smaller then Midpoint"),
6014
- [48 /* CommandResult.MidBiggerThanMax */]: _lt("Midpoint must be smaller then Maximum"),
6015
- [47 /* CommandResult.LowerBiggerThanUpper */]: _lt("Lower inflection point must be smaller than upper inflection point"),
6016
- [57 /* CommandResult.MinInvalidFormula */]: _lt("Invalid Minpoint formula"),
6017
- [59 /* CommandResult.MaxInvalidFormula */]: _lt("Invalid Maxpoint formula"),
6018
- [58 /* CommandResult.MidInvalidFormula */]: _lt("Invalid Midpoint formula"),
6019
- [60 /* CommandResult.ValueUpperInvalidFormula */]: _lt("Invalid upper inflection point formula"),
6020
- [61 /* CommandResult.ValueLowerInvalidFormula */]: _lt("Invalid lower inflection point formula"),
6009
+ [51 /* CommandResult.FirstArgMissing */]: _lt("The argument is missing. Please provide a value"),
6010
+ [52 /* CommandResult.SecondArgMissing */]: _lt("The second argument is missing. Please provide a value"),
6011
+ [53 /* CommandResult.MinNaN */]: _lt("The minpoint must be a number"),
6012
+ [54 /* CommandResult.MidNaN */]: _lt("The midpoint must be a number"),
6013
+ [55 /* CommandResult.MaxNaN */]: _lt("The maxpoint must be a number"),
6014
+ [56 /* CommandResult.ValueUpperInflectionNaN */]: _lt("The first value must be a number"),
6015
+ [57 /* CommandResult.ValueLowerInflectionNaN */]: _lt("The second value must be a number"),
6016
+ [47 /* CommandResult.MinBiggerThanMax */]: _lt("Minimum must be smaller then Maximum"),
6017
+ [50 /* CommandResult.MinBiggerThanMid */]: _lt("Minimum must be smaller then Midpoint"),
6018
+ [49 /* CommandResult.MidBiggerThanMax */]: _lt("Midpoint must be smaller then Maximum"),
6019
+ [48 /* CommandResult.LowerBiggerThanUpper */]: _lt("Lower inflection point must be smaller than upper inflection point"),
6020
+ [58 /* CommandResult.MinInvalidFormula */]: _lt("Invalid Minpoint formula"),
6021
+ [60 /* CommandResult.MaxInvalidFormula */]: _lt("Invalid Maxpoint formula"),
6022
+ [59 /* CommandResult.MidInvalidFormula */]: _lt("Invalid Midpoint formula"),
6023
+ [61 /* CommandResult.ValueUpperInvalidFormula */]: _lt("Invalid upper inflection point formula"),
6024
+ [62 /* CommandResult.ValueLowerInvalidFormula */]: _lt("Invalid lower inflection point formula"),
6021
6025
  [24 /* CommandResult.EmptyRange */]: _lt("A range needs to be defined"),
6022
6026
  Unexpected: _lt("The rule is invalid for an unknown reason"),
6023
6027
  },
@@ -6045,20 +6049,20 @@
6045
6049
  Errors: {
6046
6050
  Unexpected: _lt("The chart definition is invalid for an unknown reason"),
6047
6051
  // BASIC CHART ERRORS (LINE | BAR | PIE)
6048
- [31 /* CommandResult.InvalidDataSet */]: _lt("The dataset is invalid"),
6049
- [32 /* CommandResult.InvalidLabelRange */]: _lt("Labels are invalid"),
6052
+ [32 /* CommandResult.InvalidDataSet */]: _lt("The dataset is invalid"),
6053
+ [33 /* CommandResult.InvalidLabelRange */]: _lt("Labels are invalid"),
6050
6054
  // SCORECARD CHART ERRORS
6051
- [33 /* CommandResult.InvalidScorecardKeyValue */]: _lt("The key value is invalid"),
6052
- [34 /* CommandResult.InvalidScorecardBaseline */]: _lt("The baseline value is invalid"),
6055
+ [34 /* CommandResult.InvalidScorecardKeyValue */]: _lt("The key value is invalid"),
6056
+ [35 /* CommandResult.InvalidScorecardBaseline */]: _lt("The baseline value is invalid"),
6053
6057
  // GAUGE CHART ERRORS
6054
- [35 /* CommandResult.InvalidGaugeDataRange */]: _lt("The data range is invalid"),
6055
- [36 /* CommandResult.EmptyGaugeRangeMin */]: _lt("A minimum range limit value is needed"),
6056
- [37 /* CommandResult.GaugeRangeMinNaN */]: _lt("The minimum range limit value must be a number"),
6057
- [38 /* CommandResult.EmptyGaugeRangeMax */]: _lt("A maximum range limit value is needed"),
6058
- [39 /* CommandResult.GaugeRangeMaxNaN */]: _lt("The maximum range limit value must be a number"),
6059
- [40 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */]: _lt("Minimum range limit must be smaller than maximum range limit"),
6060
- [41 /* CommandResult.GaugeLowerInflectionPointNaN */]: _lt("The lower inflection point value must be a number"),
6061
- [42 /* CommandResult.GaugeUpperInflectionPointNaN */]: _lt("The upper inflection point value must be a number"),
6058
+ [36 /* CommandResult.InvalidGaugeDataRange */]: _lt("The data range is invalid"),
6059
+ [37 /* CommandResult.EmptyGaugeRangeMin */]: _lt("A minimum range limit value is needed"),
6060
+ [38 /* CommandResult.GaugeRangeMinNaN */]: _lt("The minimum range limit value must be a number"),
6061
+ [39 /* CommandResult.EmptyGaugeRangeMax */]: _lt("A maximum range limit value is needed"),
6062
+ [40 /* CommandResult.GaugeRangeMaxNaN */]: _lt("The maximum range limit value must be a number"),
6063
+ [41 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */]: _lt("Minimum range limit must be smaller than maximum range limit"),
6064
+ [42 /* CommandResult.GaugeLowerInflectionPointNaN */]: _lt("The lower inflection point value must be a number"),
6065
+ [43 /* CommandResult.GaugeUpperInflectionPointNaN */]: _lt("The upper inflection point value must be a number"),
6062
6066
  },
6063
6067
  };
6064
6068
  const NumberFormatTerms = {
@@ -6082,7 +6086,7 @@
6082
6086
  const sheetId = env.model.getters.getActiveSheetId();
6083
6087
  const cmd = dimension === "COL" ? "FREEZE_COLUMNS" : "FREEZE_ROWS";
6084
6088
  const result = env.model.dispatch(cmd, { sheetId, quantity: base });
6085
- if (result.isCancelledBecause(64 /* CommandResult.MergeOverlap */)) {
6089
+ if (result.isCancelledBecause(65 /* CommandResult.MergeOverlap */)) {
6086
6090
  env.raiseError(MergeErrorMessage);
6087
6091
  }
6088
6092
  }
@@ -6728,11 +6732,11 @@
6728
6732
  }
6729
6733
  get isDatasetInvalid() {
6730
6734
  var _a;
6731
- return !!((_a = this.state.datasetDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(31 /* CommandResult.InvalidDataSet */));
6735
+ return !!((_a = this.state.datasetDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(32 /* CommandResult.InvalidDataSet */));
6732
6736
  }
6733
6737
  get isLabelInvalid() {
6734
6738
  var _a;
6735
- return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(32 /* CommandResult.InvalidLabelRange */));
6739
+ return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(33 /* CommandResult.InvalidLabelRange */));
6736
6740
  }
6737
6741
  onUpdateDataSetsHaveTitle(ev) {
6738
6742
  this.props.updateChart(this.props.figureId, {
@@ -6953,14 +6957,8 @@
6953
6957
  : undefined));
6954
6958
  }
6955
6959
  }
6956
- else if (zone.left === zone.right && zone.top === zone.bottom) {
6957
- // A single cell. If it's only the title, the dataset is not added.
6958
- if (!dataSetsHaveTitle) {
6959
- dataSets.push(createDataSet(getters, dataSetSheetId, zone, undefined));
6960
- }
6961
- }
6962
6960
  else {
6963
- /* 1 row or 1 column */
6961
+ /* 1 cell, 1 row or 1 column */
6964
6962
  dataSets.push(createDataSet(getters, dataSetSheetId, zone, dataSetsHaveTitle
6965
6963
  ? {
6966
6964
  top: zone.top,
@@ -7010,8 +7008,10 @@
7010
7008
  }
7011
7009
  const dataRange = ds.dataRange.clone({ zone: dataZone });
7012
7010
  return {
7013
- label: ds.labelCell ? getters.getRangeString(ds.labelCell, "forceSheetReference") : undefined,
7014
- range: getters.getRangeString(dataRange, "forceSheetReference"),
7011
+ label: ds.labelCell
7012
+ ? getters.getRangeString(ds.labelCell, "forceSheetReference", true)
7013
+ : undefined,
7014
+ range: getters.getRangeString(dataRange, "forceSheetReference", true),
7015
7015
  };
7016
7016
  }
7017
7017
  /**
@@ -7080,11 +7080,11 @@
7080
7080
  if (definition.dataSets) {
7081
7081
  const invalidRanges = definition.dataSets.find((range) => !rangeReference.test(range)) !== undefined;
7082
7082
  if (invalidRanges) {
7083
- return 31 /* CommandResult.InvalidDataSet */;
7083
+ return 32 /* CommandResult.InvalidDataSet */;
7084
7084
  }
7085
7085
  const zones = definition.dataSets.map(toUnboundedZone);
7086
7086
  if (zones.some((zone) => zone.top !== zone.bottom && isFullRow(zone))) {
7087
- return 31 /* CommandResult.InvalidDataSet */;
7087
+ return 32 /* CommandResult.InvalidDataSet */;
7088
7088
  }
7089
7089
  }
7090
7090
  return 0 /* CommandResult.Success */;
@@ -7093,7 +7093,7 @@
7093
7093
  if (definition.labelRange) {
7094
7094
  const invalidLabels = !rangeReference.test(definition.labelRange || "");
7095
7095
  if (invalidLabels) {
7096
- return 32 /* CommandResult.InvalidLabelRange */;
7096
+ return 33 /* CommandResult.InvalidLabelRange */;
7097
7097
  }
7098
7098
  }
7099
7099
  return 0 /* CommandResult.Success */;
@@ -7394,6 +7394,9 @@
7394
7394
  .filter((ds) => ds.range !== ""); // && range !== INCORRECT_RANGE_STRING ? show incorrect #ref ?
7395
7395
  return {
7396
7396
  ...this.getDefinition(),
7397
+ labelRange: this.labelRange
7398
+ ? this.getters.getRangeString(this.labelRange, this.sheetId, true)
7399
+ : undefined,
7397
7400
  backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
7398
7401
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
7399
7402
  dataSets,
@@ -7551,7 +7554,7 @@
7551
7554
  });
7552
7555
  function isDataRangeValid(definition) {
7553
7556
  return definition.dataRange && !rangeReference.test(definition.dataRange)
7554
- ? 35 /* CommandResult.InvalidGaugeDataRange */
7557
+ ? 36 /* CommandResult.InvalidGaugeDataRange */
7555
7558
  : 0 /* CommandResult.Success */;
7556
7559
  }
7557
7560
  function checkRangeLimits(check, batchValidations) {
@@ -7583,7 +7586,7 @@
7583
7586
  function checkRangeMinBiggerThanRangeMax(definition) {
7584
7587
  if (definition.sectionRule) {
7585
7588
  if (Number(definition.sectionRule.rangeMin) >= Number(definition.sectionRule.rangeMax)) {
7586
- return 40 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */;
7589
+ return 41 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */;
7587
7590
  }
7588
7591
  }
7589
7592
  return 0 /* CommandResult.Success */;
@@ -7592,9 +7595,9 @@
7592
7595
  if (value === "") {
7593
7596
  switch (valueName) {
7594
7597
  case "rangeMin":
7595
- return 36 /* CommandResult.EmptyGaugeRangeMin */;
7598
+ return 37 /* CommandResult.EmptyGaugeRangeMin */;
7596
7599
  case "rangeMax":
7597
- return 38 /* CommandResult.EmptyGaugeRangeMax */;
7600
+ return 39 /* CommandResult.EmptyGaugeRangeMax */;
7598
7601
  }
7599
7602
  }
7600
7603
  return 0 /* CommandResult.Success */;
@@ -7603,13 +7606,13 @@
7603
7606
  if (isNaN(value)) {
7604
7607
  switch (valueName) {
7605
7608
  case "rangeMin":
7606
- return 37 /* CommandResult.GaugeRangeMinNaN */;
7609
+ return 38 /* CommandResult.GaugeRangeMinNaN */;
7607
7610
  case "rangeMax":
7608
- return 39 /* CommandResult.GaugeRangeMaxNaN */;
7611
+ return 40 /* CommandResult.GaugeRangeMaxNaN */;
7609
7612
  case "lowerInflectionPointValue":
7610
- return 41 /* CommandResult.GaugeLowerInflectionPointNaN */;
7613
+ return 42 /* CommandResult.GaugeLowerInflectionPointNaN */;
7611
7614
  case "upperInflectionPointValue":
7612
- return 42 /* CommandResult.GaugeUpperInflectionPointNaN */;
7615
+ return 43 /* CommandResult.GaugeUpperInflectionPointNaN */;
7613
7616
  }
7614
7617
  }
7615
7618
  return 0 /* CommandResult.Success */;
@@ -8022,6 +8025,9 @@
8022
8025
  .filter((ds) => ds.range !== ""); // && range !== INCORRECT_RANGE_STRING ? show incorrect #ref ?
8023
8026
  return {
8024
8027
  ...this.getDefinition(),
8028
+ labelRange: this.labelRange
8029
+ ? this.getters.getRangeString(this.labelRange, this.sheetId, true)
8030
+ : undefined,
8025
8031
  backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
8026
8032
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
8027
8033
  dataSets,
@@ -8282,6 +8288,9 @@
8282
8288
  .filter((ds) => ds.range !== ""); // && range !== INCORRECT_RANGE_STRING ? show incorrect #ref ?
8283
8289
  return {
8284
8290
  ...this.getDefinition(),
8291
+ labelRange: this.labelRange
8292
+ ? this.getters.getRangeString(this.labelRange, this.sheetId, true)
8293
+ : undefined,
8285
8294
  backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
8286
8295
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
8287
8296
  verticalAxisPosition: "left",
@@ -8362,12 +8371,12 @@
8362
8371
  });
8363
8372
  function checkKeyValue(definition) {
8364
8373
  return definition.keyValue && !rangeReference.test(definition.keyValue)
8365
- ? 33 /* CommandResult.InvalidScorecardKeyValue */
8374
+ ? 34 /* CommandResult.InvalidScorecardKeyValue */
8366
8375
  : 0 /* CommandResult.Success */;
8367
8376
  }
8368
8377
  function checkBaseline(definition) {
8369
8378
  return definition.baseline && !rangeReference.test(definition.baseline)
8370
- ? 34 /* CommandResult.InvalidScorecardBaseline */
8379
+ ? 35 /* CommandResult.InvalidScorecardBaseline */
8371
8380
  : 0 /* CommandResult.Success */;
8372
8381
  }
8373
8382
  class ScorecardChart$1 extends AbstractChart {
@@ -8796,7 +8805,7 @@
8796
8805
  }
8797
8806
  get isDataRangeInvalid() {
8798
8807
  var _a;
8799
- return !!((_a = this.state.dataRangeDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(35 /* CommandResult.InvalidGaugeDataRange */));
8808
+ return !!((_a = this.state.dataRangeDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(36 /* CommandResult.InvalidGaugeDataRange */));
8800
8809
  }
8801
8810
  onDataRangeChanged(ranges) {
8802
8811
  this.dataRange = ranges[0];
@@ -8883,28 +8892,28 @@
8883
8892
  }
8884
8893
  isRangeMinInvalid() {
8885
8894
  var _a, _b, _c;
8886
- return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(36 /* CommandResult.EmptyGaugeRangeMin */)) ||
8887
- ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(37 /* CommandResult.GaugeRangeMinNaN */)) ||
8888
- ((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(40 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
8895
+ return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(37 /* CommandResult.EmptyGaugeRangeMin */)) ||
8896
+ ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(38 /* CommandResult.GaugeRangeMinNaN */)) ||
8897
+ ((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(41 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
8889
8898
  }
8890
8899
  isRangeMaxInvalid() {
8891
8900
  var _a, _b, _c;
8892
- return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(38 /* CommandResult.EmptyGaugeRangeMax */)) ||
8893
- ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(39 /* CommandResult.GaugeRangeMaxNaN */)) ||
8894
- ((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(40 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
8901
+ return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(39 /* CommandResult.EmptyGaugeRangeMax */)) ||
8902
+ ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(40 /* CommandResult.GaugeRangeMaxNaN */)) ||
8903
+ ((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(41 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
8895
8904
  }
8896
8905
  // ---------------------------------------------------------------------------
8897
8906
  // COLOR_SECTION_TEMPLATE
8898
8907
  // ---------------------------------------------------------------------------
8899
8908
  get isLowerInflectionPointInvalid() {
8900
8909
  var _a, _b;
8901
- return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(41 /* CommandResult.GaugeLowerInflectionPointNaN */)) ||
8902
- ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(43 /* CommandResult.GaugeLowerBiggerThanUpper */)));
8910
+ return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(42 /* CommandResult.GaugeLowerInflectionPointNaN */)) ||
8911
+ ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(44 /* CommandResult.GaugeLowerBiggerThanUpper */)));
8903
8912
  }
8904
8913
  get isUpperInflectionPointInvalid() {
8905
8914
  var _a, _b;
8906
- return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(42 /* CommandResult.GaugeUpperInflectionPointNaN */)) ||
8907
- ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(43 /* CommandResult.GaugeLowerBiggerThanUpper */)));
8915
+ return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(43 /* CommandResult.GaugeUpperInflectionPointNaN */)) ||
8916
+ ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(44 /* CommandResult.GaugeLowerBiggerThanUpper */)));
8908
8917
  }
8909
8918
  updateInflectionPointValue(attr, ev) {
8910
8919
  const sectionRule = deepCopy(this.props.definition.sectionRule);
@@ -9007,11 +9016,11 @@
9007
9016
  }
9008
9017
  get isKeyValueInvalid() {
9009
9018
  var _a;
9010
- return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(33 /* CommandResult.InvalidScorecardKeyValue */));
9019
+ return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(34 /* CommandResult.InvalidScorecardKeyValue */));
9011
9020
  }
9012
9021
  get isBaselineInvalid() {
9013
9022
  var _a;
9014
- return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(34 /* CommandResult.InvalidScorecardBaseline */));
9023
+ return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(35 /* CommandResult.InvalidScorecardBaseline */));
9015
9024
  }
9016
9025
  onKeyValueRangeChanged(ranges) {
9017
9026
  this.keyValue = ranges[0];
@@ -9851,11 +9860,11 @@
9851
9860
  ****************************************************************************/
9852
9861
  get isValue1Invalid() {
9853
9862
  var _a;
9854
- return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(50 /* CommandResult.FirstArgMissing */));
9863
+ return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(51 /* CommandResult.FirstArgMissing */));
9855
9864
  }
9856
9865
  get isValue2Invalid() {
9857
9866
  var _a;
9858
- return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(51 /* CommandResult.SecondArgMissing */));
9867
+ return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(52 /* CommandResult.SecondArgMissing */));
9859
9868
  }
9860
9869
  toggleStyle(tool) {
9861
9870
  const style = this.state.rules.cellIs.style;
@@ -9872,17 +9881,17 @@
9872
9881
  isValueInvalid(threshold) {
9873
9882
  switch (threshold) {
9874
9883
  case "minimum":
9875
- return (this.state.errors.includes(57 /* CommandResult.MinInvalidFormula */) ||
9876
- this.state.errors.includes(49 /* CommandResult.MinBiggerThanMid */) ||
9877
- this.state.errors.includes(46 /* CommandResult.MinBiggerThanMax */) ||
9878
- this.state.errors.includes(52 /* CommandResult.MinNaN */));
9884
+ return (this.state.errors.includes(58 /* CommandResult.MinInvalidFormula */) ||
9885
+ this.state.errors.includes(50 /* CommandResult.MinBiggerThanMid */) ||
9886
+ this.state.errors.includes(47 /* CommandResult.MinBiggerThanMax */) ||
9887
+ this.state.errors.includes(53 /* CommandResult.MinNaN */));
9879
9888
  case "midpoint":
9880
- return (this.state.errors.includes(58 /* CommandResult.MidInvalidFormula */) ||
9881
- this.state.errors.includes(53 /* CommandResult.MidNaN */) ||
9882
- this.state.errors.includes(48 /* CommandResult.MidBiggerThanMax */));
9889
+ return (this.state.errors.includes(59 /* CommandResult.MidInvalidFormula */) ||
9890
+ this.state.errors.includes(54 /* CommandResult.MidNaN */) ||
9891
+ this.state.errors.includes(49 /* CommandResult.MidBiggerThanMax */));
9883
9892
  case "maximum":
9884
- return (this.state.errors.includes(59 /* CommandResult.MaxInvalidFormula */) ||
9885
- this.state.errors.includes(54 /* CommandResult.MaxNaN */));
9893
+ return (this.state.errors.includes(60 /* CommandResult.MaxInvalidFormula */) ||
9894
+ this.state.errors.includes(55 /* CommandResult.MaxNaN */));
9886
9895
  default:
9887
9896
  return false;
9888
9897
  }
@@ -9931,13 +9940,13 @@
9931
9940
  isInflectionPointInvalid(inflectionPoint) {
9932
9941
  switch (inflectionPoint) {
9933
9942
  case "lowerInflectionPoint":
9934
- return (this.state.errors.includes(56 /* CommandResult.ValueLowerInflectionNaN */) ||
9935
- this.state.errors.includes(61 /* CommandResult.ValueLowerInvalidFormula */) ||
9936
- this.state.errors.includes(47 /* CommandResult.LowerBiggerThanUpper */));
9943
+ return (this.state.errors.includes(57 /* CommandResult.ValueLowerInflectionNaN */) ||
9944
+ this.state.errors.includes(62 /* CommandResult.ValueLowerInvalidFormula */) ||
9945
+ this.state.errors.includes(48 /* CommandResult.LowerBiggerThanUpper */));
9937
9946
  case "upperInflectionPoint":
9938
- return (this.state.errors.includes(55 /* CommandResult.ValueUpperInflectionNaN */) ||
9939
- this.state.errors.includes(60 /* CommandResult.ValueUpperInvalidFormula */) ||
9940
- this.state.errors.includes(47 /* CommandResult.LowerBiggerThanUpper */));
9947
+ return (this.state.errors.includes(56 /* CommandResult.ValueUpperInflectionNaN */) ||
9948
+ this.state.errors.includes(61 /* CommandResult.ValueUpperInvalidFormula */) ||
9949
+ this.state.errors.includes(48 /* CommandResult.LowerBiggerThanUpper */));
9941
9950
  default:
9942
9951
  return true;
9943
9952
  }
@@ -19582,7 +19591,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
19582
19591
  validateSelection(length, start, end) {
19583
19592
  return start >= 0 && start <= length && end >= 0 && end <= length
19584
19593
  ? 0 /* CommandResult.Success */
19585
- : 45 /* CommandResult.WrongComposerSelection */;
19594
+ : 46 /* CommandResult.WrongComposerSelection */;
19586
19595
  }
19587
19596
  onColumnsRemoved(cmd) {
19588
19597
  if (cmd.elements.includes(this.col) && this.mode !== "inactive") {
@@ -19866,9 +19875,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
19866
19875
  */
19867
19876
  getReferencedRanges() {
19868
19877
  const editionSheetId = this.getters.getEditionSheet();
19869
- return this.currentTokens
19878
+ const referenceRanges = this.currentTokens
19870
19879
  .filter((token) => token.type === "REFERENCE")
19871
19880
  .map((token) => this.getters.getRangeFromSheetXC(editionSheetId, token.value));
19881
+ return referenceRanges.filter((range) => !range.invalidSheetName && !range.invalidXc);
19872
19882
  }
19873
19883
  /**
19874
19884
  * Function used to determine when composer selection can start.
@@ -27639,7 +27649,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
27639
27649
  const currentBorder = this.getCellBorder(cmd.sheetId, cmd.col, cmd.row);
27640
27650
  const areAllNewBordersUndefined = !((_a = cmd.border) === null || _a === void 0 ? void 0 : _a.bottom) && !((_b = cmd.border) === null || _b === void 0 ? void 0 : _b.left) && !((_c = cmd.border) === null || _c === void 0 ? void 0 : _c.right) && !((_d = cmd.border) === null || _d === void 0 ? void 0 : _d.top);
27641
27651
  if ((!currentBorder && areAllNewBordersUndefined) || deepEquals(currentBorder, cmd.border)) {
27642
- return 87 /* CommandResult.NoChanges */;
27652
+ return 88 /* CommandResult.NoChanges */;
27643
27653
  }
27644
27654
  return 0 /* CommandResult.Success */;
27645
27655
  }
@@ -27881,6 +27891,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
27881
27891
  format: cell.format ? getItemId(cell.format, formats) : undefined,
27882
27892
  content: cell.content || undefined,
27883
27893
  };
27894
+ if (cell.isFormula()) {
27895
+ cells[xc].content = this.buildFormulaContent(_sheet.id, cell, cell.dependencies, true);
27896
+ }
27884
27897
  }
27885
27898
  _sheet.cells = cells;
27886
27899
  }
@@ -27928,13 +27941,13 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
27928
27941
  /*
27929
27942
  * Reconstructs the original formula string based on a normalized form and its dependencies
27930
27943
  */
27931
- buildFormulaContent(sheetId, cell, dependencies) {
27944
+ buildFormulaContent(sheetId, cell, dependencies, useFixedZone = false) {
27932
27945
  const ranges = dependencies || cell.dependencies;
27933
27946
  let rangeIndex = 0;
27934
27947
  return concat(cell.compiledFormula.tokens.map((token) => {
27935
27948
  if (token.type === "REFERENCE") {
27936
27949
  const range = ranges[rangeIndex++];
27937
- return this.getters.getRangeString(range, sheetId);
27950
+ return this.getters.getRangeString(range, sheetId, useFixedZone);
27938
27951
  }
27939
27952
  return token.value;
27940
27953
  }));
@@ -28099,9 +28112,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28099
28112
  checkUselessClearCell(cmd) {
28100
28113
  const cell = this.getters.getCell(cmd.sheetId, cmd.col, cmd.row);
28101
28114
  if (!cell)
28102
- return 87 /* CommandResult.NoChanges */;
28115
+ return 88 /* CommandResult.NoChanges */;
28103
28116
  if (!cell.content && !cell.style && !cell.format) {
28104
- return 87 /* CommandResult.NoChanges */;
28117
+ return 88 /* CommandResult.NoChanges */;
28105
28118
  }
28106
28119
  return 0 /* CommandResult.Success */;
28107
28120
  }
@@ -28310,13 +28323,13 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28310
28323
  }
28311
28324
  checkChartDuplicate(cmd) {
28312
28325
  return this.getters.getFigureSheetId(cmd.id)
28313
- ? 83 /* CommandResult.DuplicatedChartId */
28326
+ ? 84 /* CommandResult.DuplicatedChartId */
28314
28327
  : 0 /* CommandResult.Success */;
28315
28328
  }
28316
28329
  checkChartExists(cmd) {
28317
28330
  return this.getters.getFigureSheetId(cmd.id)
28318
28331
  ? 0 /* CommandResult.Success */
28319
- : 84 /* CommandResult.ChartDoesNotExist */;
28332
+ : 85 /* CommandResult.ChartDoesNotExist */;
28320
28333
  }
28321
28334
  }
28322
28335
  ChartPlugin.getters = [
@@ -28431,7 +28444,13 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28431
28444
  }
28432
28445
  }
28433
28446
  exportForExcel(data) {
28434
- this.export(data);
28447
+ if (data.sheets) {
28448
+ for (let sheet of data.sheets) {
28449
+ if (this.cfRules[sheet.id]) {
28450
+ sheet.conditionalFormats = this.cfRules[sheet.id].map((rule) => this.mapToConditionalFormat(sheet.id, rule, { useFixedReference: true }));
28451
+ }
28452
+ }
28453
+ }
28435
28454
  }
28436
28455
  // ---------------------------------------------------------------------------
28437
28456
  // Getters
@@ -28481,11 +28500,11 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28481
28500
  // ---------------------------------------------------------------------------
28482
28501
  // Private
28483
28502
  // ---------------------------------------------------------------------------
28484
- mapToConditionalFormat(sheetId, cf) {
28503
+ mapToConditionalFormat(sheetId, cf, options = { useFixedReference: false }) {
28485
28504
  return {
28486
28505
  ...cf,
28487
28506
  ranges: cf.ranges.map((range) => {
28488
- return this.getters.getRangeString(range, sheetId);
28507
+ return this.getters.getRangeString(range, sheetId, options.useFixedReference);
28489
28508
  }),
28490
28509
  };
28491
28510
  }
@@ -28518,10 +28537,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28518
28537
  return 27 /* CommandResult.InvalidSheetId */;
28519
28538
  const ruleIndex = this.cfRules[sheetId].findIndex((cf) => cf.id === cfId);
28520
28539
  if (ruleIndex === -1)
28521
- return 70 /* CommandResult.InvalidConditionalFormatId */;
28540
+ return 71 /* CommandResult.InvalidConditionalFormatId */;
28522
28541
  const cfIndex2 = direction === "up" ? ruleIndex - 1 : ruleIndex + 1;
28523
28542
  if (cfIndex2 < 0 || cfIndex2 >= this.cfRules[sheetId].length) {
28524
- return 70 /* CommandResult.InvalidConditionalFormatId */;
28543
+ return 71 /* CommandResult.InvalidConditionalFormatId */;
28525
28544
  }
28526
28545
  return 0 /* CommandResult.Success */;
28527
28546
  }
@@ -28562,10 +28581,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28562
28581
  const errors = [];
28563
28582
  const isEmpty = (value) => value === undefined || value === "";
28564
28583
  if (expectedNumber >= 1 && isEmpty(rule.values[0])) {
28565
- errors.push(50 /* CommandResult.FirstArgMissing */);
28584
+ errors.push(51 /* CommandResult.FirstArgMissing */);
28566
28585
  }
28567
28586
  if (expectedNumber >= 2 && isEmpty(rule.values[1])) {
28568
- errors.push(51 /* CommandResult.SecondArgMissing */);
28587
+ errors.push(52 /* CommandResult.SecondArgMissing */);
28569
28588
  }
28570
28589
  return errors.length ? errors : 0 /* CommandResult.Success */;
28571
28590
  }
@@ -28577,15 +28596,15 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28577
28596
  (threshold.value === "" || isNaN(threshold.value))) {
28578
28597
  switch (thresholdName) {
28579
28598
  case "min":
28580
- return 52 /* CommandResult.MinNaN */;
28599
+ return 53 /* CommandResult.MinNaN */;
28581
28600
  case "max":
28582
- return 54 /* CommandResult.MaxNaN */;
28601
+ return 55 /* CommandResult.MaxNaN */;
28583
28602
  case "mid":
28584
- return 53 /* CommandResult.MidNaN */;
28603
+ return 54 /* CommandResult.MidNaN */;
28585
28604
  case "upperInflectionPoint":
28586
- return 55 /* CommandResult.ValueUpperInflectionNaN */;
28605
+ return 56 /* CommandResult.ValueUpperInflectionNaN */;
28587
28606
  case "lowerInflectionPoint":
28588
- return 56 /* CommandResult.ValueLowerInflectionNaN */;
28607
+ return 57 /* CommandResult.ValueLowerInflectionNaN */;
28589
28608
  }
28590
28609
  }
28591
28610
  return 0 /* CommandResult.Success */;
@@ -28599,15 +28618,15 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28599
28618
  catch (error) {
28600
28619
  switch (thresholdName) {
28601
28620
  case "min":
28602
- return 57 /* CommandResult.MinInvalidFormula */;
28621
+ return 58 /* CommandResult.MinInvalidFormula */;
28603
28622
  case "max":
28604
- return 59 /* CommandResult.MaxInvalidFormula */;
28623
+ return 60 /* CommandResult.MaxInvalidFormula */;
28605
28624
  case "mid":
28606
- return 58 /* CommandResult.MidInvalidFormula */;
28625
+ return 59 /* CommandResult.MidInvalidFormula */;
28607
28626
  case "upperInflectionPoint":
28608
- return 60 /* CommandResult.ValueUpperInvalidFormula */;
28627
+ return 61 /* CommandResult.ValueUpperInvalidFormula */;
28609
28628
  case "lowerInflectionPoint":
28610
- return 61 /* CommandResult.ValueLowerInvalidFormula */;
28629
+ return 62 /* CommandResult.ValueLowerInvalidFormula */;
28611
28630
  }
28612
28631
  }
28613
28632
  return 0 /* CommandResult.Success */;
@@ -28624,7 +28643,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28624
28643
  if (["number", "percentage", "percentile"].includes(rule.lowerInflectionPoint.type) &&
28625
28644
  rule.lowerInflectionPoint.type === rule.upperInflectionPoint.type &&
28626
28645
  Number(minValue) > Number(maxValue)) {
28627
- return 47 /* CommandResult.LowerBiggerThanUpper */;
28646
+ return 48 /* CommandResult.LowerBiggerThanUpper */;
28628
28647
  }
28629
28648
  return 0 /* CommandResult.Success */;
28630
28649
  }
@@ -28634,7 +28653,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28634
28653
  if (["number", "percentage", "percentile"].includes(rule.minimum.type) &&
28635
28654
  rule.minimum.type === rule.maximum.type &&
28636
28655
  stringToNumber(minValue) >= stringToNumber(maxValue)) {
28637
- return 46 /* CommandResult.MinBiggerThanMax */;
28656
+ return 47 /* CommandResult.MinBiggerThanMax */;
28638
28657
  }
28639
28658
  return 0 /* CommandResult.Success */;
28640
28659
  }
@@ -28646,7 +28665,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28646
28665
  ["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
28647
28666
  rule.midpoint.type === rule.maximum.type &&
28648
28667
  stringToNumber(midValue) >= stringToNumber(maxValue)) {
28649
- return 48 /* CommandResult.MidBiggerThanMax */;
28668
+ return 49 /* CommandResult.MidBiggerThanMax */;
28650
28669
  }
28651
28670
  return 0 /* CommandResult.Success */;
28652
28671
  }
@@ -28658,7 +28677,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28658
28677
  ["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
28659
28678
  rule.minimum.type === rule.midpoint.type &&
28660
28679
  stringToNumber(minValue) >= stringToNumber(midValue)) {
28661
- return 49 /* CommandResult.MinBiggerThanMid */;
28680
+ return 50 /* CommandResult.MinBiggerThanMid */;
28662
28681
  }
28663
28682
  return 0 /* CommandResult.Success */;
28664
28683
  }
@@ -28759,13 +28778,13 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28759
28778
  checkFigureExists(sheetId, figureId) {
28760
28779
  var _a;
28761
28780
  if (((_a = this.figures[sheetId]) === null || _a === void 0 ? void 0 : _a[figureId]) === undefined) {
28762
- return 69 /* CommandResult.FigureDoesNotExist */;
28781
+ return 70 /* CommandResult.FigureDoesNotExist */;
28763
28782
  }
28764
28783
  return 0 /* CommandResult.Success */;
28765
28784
  }
28766
28785
  checkFigureDuplicate(figureId) {
28767
28786
  if (Object.values(this.figures).find((sheet) => sheet === null || sheet === void 0 ? void 0 : sheet[figureId])) {
28768
- return 81 /* CommandResult.DuplicatedFigureId */;
28787
+ return 82 /* CommandResult.DuplicatedFigureId */;
28769
28788
  }
28770
28789
  return 0 /* CommandResult.Success */;
28771
28790
  }
@@ -28867,12 +28886,12 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28867
28886
  switch (cmd.type) {
28868
28887
  case "CREATE_FILTER_TABLE":
28869
28888
  if (!areZonesContinuous(...cmd.target)) {
28870
- return 80 /* CommandResult.NonContinuousTargets */;
28889
+ return 81 /* CommandResult.NonContinuousTargets */;
28871
28890
  }
28872
28891
  const zone = union(...cmd.target);
28873
28892
  const checkFilterOverlap = () => {
28874
28893
  if (this.getFilterTables(cmd.sheetId).some((filter) => overlap(filter.zone, zone))) {
28875
- return 77 /* CommandResult.FilterOverlap */;
28894
+ return 78 /* CommandResult.FilterOverlap */;
28876
28895
  }
28877
28896
  return 0 /* CommandResult.Success */;
28878
28897
  };
@@ -28880,7 +28899,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28880
28899
  const mergesInTarget = this.getters.getMergesInZone(cmd.sheetId, zone);
28881
28900
  for (let merge of mergesInTarget) {
28882
28901
  if (overlap(zone, merge)) {
28883
- return 79 /* CommandResult.MergeInFilter */;
28902
+ return 80 /* CommandResult.MergeInFilter */;
28884
28903
  }
28885
28904
  }
28886
28905
  return 0 /* CommandResult.Success */;
@@ -28890,7 +28909,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28890
28909
  for (let merge of cmd.target) {
28891
28910
  for (let filterTable of this.getFilterTables(cmd.sheetId)) {
28892
28911
  if (overlap(filterTable.zone, merge)) {
28893
- return 79 /* CommandResult.MergeInFilter */;
28912
+ return 80 /* CommandResult.MergeInFilter */;
28894
28913
  }
28895
28914
  }
28896
28915
  }
@@ -29390,10 +29409,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29390
29409
  : this.getters.getNumberRows(cmd.sheetId);
29391
29410
  const hiddenElements = new Set((hiddenGroup || []).flat().concat(cmd.elements));
29392
29411
  if (hiddenElements.size >= elements) {
29393
- return 65 /* CommandResult.TooManyHiddenElements */;
29412
+ return 66 /* CommandResult.TooManyHiddenElements */;
29394
29413
  }
29395
29414
  else if (Math.min(...cmd.elements) < 0 || Math.max(...cmd.elements) > elements) {
29396
- return 85 /* CommandResult.InvalidHeaderIndex */;
29415
+ return 86 /* CommandResult.InvalidHeaderIndex */;
29397
29416
  }
29398
29417
  else {
29399
29418
  return 0 /* CommandResult.Success */;
@@ -29796,7 +29815,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29796
29815
  for (const zone of target) {
29797
29816
  for (const zone2 of target) {
29798
29817
  if (zone !== zone2 && overlap(zone, zone2)) {
29799
- return 64 /* CommandResult.MergeOverlap */;
29818
+ return 65 /* CommandResult.MergeOverlap */;
29800
29819
  }
29801
29820
  }
29802
29821
  }
@@ -29810,7 +29829,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29810
29829
  for (const zone of target) {
29811
29830
  if ((zone.left < xSplit && zone.right >= xSplit) ||
29812
29831
  (zone.top < ySplit && zone.bottom >= ySplit)) {
29813
- return 74 /* CommandResult.FrozenPaneOverlap */;
29832
+ return 75 /* CommandResult.FrozenPaneOverlap */;
29814
29833
  }
29815
29834
  }
29816
29835
  return 0 /* CommandResult.Success */;
@@ -30057,10 +30076,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
30057
30076
  ? this.getNumberCols(cmd.sheetId)
30058
30077
  : this.getNumberRows(cmd.sheetId);
30059
30078
  if (cmd.base < 0 || cmd.base >= elements) {
30060
- return 85 /* CommandResult.InvalidHeaderIndex */;
30079
+ return 86 /* CommandResult.InvalidHeaderIndex */;
30061
30080
  }
30062
30081
  else if (cmd.quantity <= 0) {
30063
- return 86 /* CommandResult.InvalidQuantity */;
30082
+ return 87 /* CommandResult.InvalidQuantity */;
30064
30083
  }
30065
30084
  return 0 /* CommandResult.Success */;
30066
30085
  case "REMOVE_COLUMNS_ROWS": {
@@ -30068,7 +30087,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
30068
30087
  ? this.getNumberCols(cmd.sheetId)
30069
30088
  : this.getNumberRows(cmd.sheetId);
30070
30089
  if (Math.min(...cmd.elements) < 0 || Math.max(...cmd.elements) > elements) {
30071
- return 85 /* CommandResult.InvalidHeaderIndex */;
30090
+ return 86 /* CommandResult.InvalidHeaderIndex */;
30072
30091
  }
30073
30092
  else if (this.checkElementsIncludeAllNonFrozenHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) {
30074
30093
  return 8 /* CommandResult.NotEnoughElements */;
@@ -30525,18 +30544,18 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
30525
30544
  checkRowFreezeQuantity(cmd) {
30526
30545
  return cmd.quantity >= 1 && cmd.quantity < this.getNumberRows(cmd.sheetId)
30527
30546
  ? 0 /* CommandResult.Success */
30528
- : 73 /* CommandResult.InvalidFreezeQuantity */;
30547
+ : 74 /* CommandResult.InvalidFreezeQuantity */;
30529
30548
  }
30530
30549
  checkColFreezeQuantity(cmd) {
30531
30550
  return cmd.quantity >= 1 && cmd.quantity < this.getNumberCols(cmd.sheetId)
30532
30551
  ? 0 /* CommandResult.Success */
30533
- : 73 /* CommandResult.InvalidFreezeQuantity */;
30552
+ : 74 /* CommandResult.InvalidFreezeQuantity */;
30534
30553
  }
30535
30554
  checkRowFreezeOverlapMerge(cmd) {
30536
30555
  const merges = this.getters.getMerges(cmd.sheetId);
30537
30556
  for (let merge of merges) {
30538
30557
  if (merge.top < cmd.quantity && cmd.quantity <= merge.bottom) {
30539
- return 64 /* CommandResult.MergeOverlap */;
30558
+ return 65 /* CommandResult.MergeOverlap */;
30540
30559
  }
30541
30560
  }
30542
30561
  return 0 /* CommandResult.Success */;
@@ -30545,7 +30564,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
30545
30564
  const merges = this.getters.getMerges(cmd.sheetId);
30546
30565
  for (let merge of merges) {
30547
30566
  if (merge.left < cmd.quantity && cmd.quantity <= merge.right) {
30548
- return 64 /* CommandResult.MergeOverlap */;
30567
+ return 65 /* CommandResult.MergeOverlap */;
30549
30568
  }
30550
30569
  }
30551
30570
  return 0 /* CommandResult.Success */;
@@ -30986,7 +31005,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
30986
31005
  if (this.lastCellSelected.col !== undefined && this.lastCellSelected.row !== undefined) {
30987
31006
  return 0 /* CommandResult.Success */;
30988
31007
  }
30989
- return 44 /* CommandResult.InvalidAutofillSelection */;
31008
+ return 45 /* CommandResult.InvalidAutofillSelection */;
30990
31009
  case "AUTOFILL_AUTO":
30991
31010
  const zone = this.getters.getSelectedZone();
30992
31011
  return zone.top === zone.bottom
@@ -31586,7 +31605,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
31586
31605
  cellPopoverRegistry.get(cmd.popoverType);
31587
31606
  }
31588
31607
  catch (error) {
31589
- return 71 /* CommandResult.InvalidCellPopover */;
31608
+ return 72 /* CommandResult.InvalidCellPopover */;
31590
31609
  }
31591
31610
  return 0 /* CommandResult.Success */;
31592
31611
  default:
@@ -31810,7 +31829,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
31810
31829
  for (const zone of this.getPasteZones(target)) {
31811
31830
  if ((zone.left < xSplit && zone.right >= xSplit) ||
31812
31831
  (zone.top < ySplit && zone.bottom >= ySplit)) {
31813
- return 74 /* CommandResult.FrozenPaneOverlap */;
31832
+ return 75 /* CommandResult.FrozenPaneOverlap */;
31814
31833
  }
31815
31834
  }
31816
31835
  return 0 /* CommandResult.Success */;
@@ -32170,7 +32189,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
32170
32189
  }
32171
32190
  isPasteAllowed(target, option) {
32172
32191
  if (target.length === 0) {
32173
- return 72 /* CommandResult.EmptyTarget */;
32192
+ return 73 /* CommandResult.EmptyTarget */;
32174
32193
  }
32175
32194
  if ((option === null || option === void 0 ? void 0 : option.pasteOption) !== undefined) {
32176
32195
  return 22 /* CommandResult.WrongFigurePasteOption */;
@@ -32814,10 +32833,8 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
32814
32833
  * that are actually present in the grid.
32815
32834
  */
32816
32835
  function range(range) {
32836
+ assertRangeValid(range);
32817
32837
  const sheetId = range.sheetId;
32818
- if (!isZoneValid(range.zone)) {
32819
- throw new InvalidReferenceError();
32820
- }
32821
32838
  // Performance issue: Avoid fetching data on positions that are out of the spreadsheet
32822
32839
  // e.g. A1:ZZZ9999 in a sheet with 10 cols and 10 rows should ignore everything past J10 and return a 10x10 array
32823
32840
  const sheetZone = getters.getSheetZone(sheetId);
@@ -32852,23 +32869,26 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
32852
32869
  * The `compute` of the formula's function must process it completely
32853
32870
  */
32854
32871
  function refFn(range, isMeta, functionName, paramNumber) {
32872
+ assertRangeValid(range);
32855
32873
  if (isMeta) {
32856
32874
  // Use zoneToXc of zone instead of getRangeString to avoid sending unbounded ranges
32857
32875
  return { value: zoneToXc(range.zone) };
32858
32876
  }
32859
- if (!isZoneValid(range.zone)) {
32860
- throw new InvalidReferenceError();
32861
- }
32862
32877
  // if the formula definition could have accepted a range, we would pass through the _range function and not here
32863
32878
  if (range.zone.bottom !== range.zone.top || range.zone.left !== range.zone.right) {
32864
32879
  throw new Error(paramNumber
32865
32880
  ? _lt("Function %s expects the parameter %s to be a single value or a single cell reference, not a range.", functionName.toString(), paramNumber.toString())
32866
32881
  : _lt("Function %s expects its parameters to be single values or single cell references, not ranges.", functionName.toString()));
32867
32882
  }
32883
+ return readCell(range);
32884
+ }
32885
+ function assertRangeValid(range) {
32886
+ if (!isZoneValid(range.zone)) {
32887
+ throw new InvalidReferenceError();
32888
+ }
32868
32889
  if (range.invalidSheetName) {
32869
32890
  throw new Error(_lt("Invalid sheet name: %s", range.invalidSheetName));
32870
32891
  }
32871
- return readCell(range);
32872
32892
  }
32873
32893
  return [refFn, range, evalContext];
32874
32894
  }
@@ -33332,7 +33352,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
33332
33352
  switch (cmd.type) {
33333
33353
  case "UPDATE_FILTER":
33334
33354
  if (!this.getters.getFilterId(cmd.sheetId, cmd.col, cmd.row)) {
33335
- return 78 /* CommandResult.FilterNotFound */;
33355
+ return 79 /* CommandResult.FilterNotFound */;
33336
33356
  }
33337
33357
  break;
33338
33358
  }
@@ -35152,7 +35172,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
35152
35172
  const headers = [cmd.base, ...cmd.elements];
35153
35173
  const maxHeaderValue = isCol ? this.getters.getNumberCols(id) : this.getters.getNumberRows(id);
35154
35174
  if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
35155
- return 85 /* CommandResult.InvalidHeaderIndex */;
35175
+ return 86 /* CommandResult.InvalidHeaderIndex */;
35156
35176
  }
35157
35177
  return 0 /* CommandResult.Success */;
35158
35178
  }
@@ -35283,21 +35303,6 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
35283
35303
  // ---------------------------------------------------------------------------
35284
35304
  // Command Handling
35285
35305
  // ---------------------------------------------------------------------------
35286
- allowDispatch(cmd) {
35287
- switch (cmd.type) {
35288
- case "ADD_EMPTY_RANGE":
35289
- if (this.inputHasSingleRange && this.ranges.length === 1) {
35290
- return 29 /* CommandResult.MaximumRangesReached */;
35291
- }
35292
- break;
35293
- case "CHANGE_RANGE":
35294
- if (this.inputHasSingleRange && cmd.value.split(",").length > 1) {
35295
- return 29 /* CommandResult.MaximumRangesReached */;
35296
- }
35297
- break;
35298
- }
35299
- return 0 /* CommandResult.Success */;
35300
- }
35301
35306
  handleEvent(event) {
35302
35307
  const xc = zoneToXc(event.anchor.zone);
35303
35308
  const inputSheetId = this.activeSheet;
@@ -35507,6 +35512,15 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
35507
35512
  // ---------------------------------------------------------------------------
35508
35513
  allowDispatch(cmd) {
35509
35514
  var _a, _b;
35515
+ switch (cmd.type) {
35516
+ case "FOCUS_RANGE":
35517
+ case "CHANGE_RANGE":
35518
+ case "ADD_EMPTY_RANGE":
35519
+ case "REMOVE_RANGE":
35520
+ if (!this.inputs[cmd.id]) {
35521
+ return 30 /* CommandResult.InvalidInputId */;
35522
+ }
35523
+ }
35510
35524
  switch (cmd.type) {
35511
35525
  case "FOCUS_RANGE":
35512
35526
  const index = (_a = this.currentInput) === null || _a === void 0 ? void 0 : _a.getIndex(cmd.rangeId);
@@ -35514,9 +35528,19 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
35514
35528
  return 28 /* CommandResult.InputAlreadyFocused */;
35515
35529
  }
35516
35530
  break;
35517
- }
35518
- if (this.currentInput) {
35519
- return this.currentInput.allowDispatch(cmd);
35531
+ case "ADD_EMPTY_RANGE":
35532
+ const input = this.inputs[cmd.id];
35533
+ if (input.inputHasSingleRange && input.ranges.length === 1) {
35534
+ return 29 /* CommandResult.MaximumRangesReached */;
35535
+ }
35536
+ break;
35537
+ case "CHANGE_RANGE": {
35538
+ const input = this.inputs[cmd.id];
35539
+ if (input.inputHasSingleRange && cmd.value.split(",").length > 1) {
35540
+ return 29 /* CommandResult.MaximumRangesReached */;
35541
+ }
35542
+ break;
35543
+ }
35520
35544
  }
35521
35545
  return 0 /* CommandResult.Success */;
35522
35546
  }
@@ -37171,7 +37195,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
37171
37195
  }
37172
37196
  checkPositiveDimension(cmd) {
37173
37197
  if (cmd.width < 0 || cmd.height < 0) {
37174
- return 67 /* CommandResult.InvalidViewportSize */;
37198
+ return 68 /* CommandResult.InvalidViewportSize */;
37175
37199
  }
37176
37200
  return 0 /* CommandResult.Success */;
37177
37201
  }
@@ -37181,7 +37205,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
37181
37205
  cmd.gridOffsetY === this.gridOffsetY &&
37182
37206
  cmd.width === width &&
37183
37207
  cmd.height === height) {
37184
- return 75 /* CommandResult.ValuesNotChanged */;
37208
+ return 76 /* CommandResult.ValuesNotChanged */;
37185
37209
  }
37186
37210
  return 0 /* CommandResult.Success */;
37187
37211
  }
@@ -37189,7 +37213,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
37189
37213
  const pane = this.getMainInternalViewport(this.getters.getActiveSheetId());
37190
37214
  if ((!pane.canScrollHorizontally && offsetX > 0) ||
37191
37215
  (!pane.canScrollVertically && offsetY > 0)) {
37192
- return 68 /* CommandResult.InvalidScrollingDirection */;
37216
+ return 69 /* CommandResult.InvalidScrollingDirection */;
37193
37217
  }
37194
37218
  return 0 /* CommandResult.Success */;
37195
37219
  }
@@ -37391,7 +37415,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
37391
37415
  for (let row = zone.top; row <= zone.bottom; row++) {
37392
37416
  for (let col = zone.left; col <= zone.right; col++) {
37393
37417
  if (!this.getters.isInMerge(sheetId, col, row)) {
37394
- return 62 /* CommandResult.InvalidSortZone */;
37418
+ return 63 /* CommandResult.InvalidSortZone */;
37395
37419
  }
37396
37420
  }
37397
37421
  }
@@ -37412,7 +37436,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
37412
37436
  ];
37413
37437
  return widthCurrent === widthFirst && heightCurrent === heightFirst;
37414
37438
  })) {
37415
- return 62 /* CommandResult.InvalidSortZone */;
37439
+ return 63 /* CommandResult.InvalidSortZone */;
37416
37440
  }
37417
37441
  return 0 /* CommandResult.Success */;
37418
37442
  }
@@ -38556,7 +38580,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
38556
38580
  };
38557
38581
  function interactiveAddMerge(env, sheetId, target) {
38558
38582
  const result = env.model.dispatch("ADD_MERGE", { sheetId, target });
38559
- if (result.isCancelledBecause(79 /* CommandResult.MergeInFilter */)) {
38583
+ if (result.isCancelledBecause(80 /* CommandResult.MergeInFilter */)) {
38560
38584
  env.raiseError(AddMergeInteractiveContent.MergeInFilter);
38561
38585
  }
38562
38586
  else if (result.isCancelledBecause(3 /* CommandResult.MergeIsDestructive */)) {
@@ -40455,8 +40479,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
40455
40479
  *
40456
40480
  * @param range the range (received from getRangeFromXC or getRangeFromZone)
40457
40481
  * @param forSheetId the id of the sheet where the range string is supposed to be used.
40482
+ * @param [useFixedZone=false] if true, the range will be returned with fixed row and column
40458
40483
  */
40459
- getRangeString(range, forSheetId) {
40484
+ getRangeString(range, forSheetId, useFixedZone = false) {
40460
40485
  if (!range) {
40461
40486
  return INCORRECT_RANGE_STRING;
40462
40487
  }
@@ -40483,7 +40508,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
40483
40508
  if (prefixSheet && !sheetName) {
40484
40509
  return INCORRECT_RANGE_STRING;
40485
40510
  }
40486
- let rangeString = this.getRangePartString(rangeImpl, 0);
40511
+ let rangeString = this.getRangePartString(rangeImpl, 0, useFixedZone);
40487
40512
  if (rangeImpl.parts && rangeImpl.parts.length === 2) {
40488
40513
  // this if converts A2:A2 into A2 except if any part of the original range had fixed row or column (with $)
40489
40514
  if (rangeImpl.zone.top !== rangeImpl.zone.bottom ||
@@ -40493,7 +40518,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
40493
40518
  rangeImpl.parts[1].rowFixed ||
40494
40519
  rangeImpl.parts[1].colFixed) {
40495
40520
  rangeString += ":";
40496
- rangeString += this.getRangePartString(rangeImpl, 1);
40521
+ rangeString += this.getRangePartString(rangeImpl, 1, useFixedZone);
40497
40522
  }
40498
40523
  }
40499
40524
  return `${prefixSheet ? sheetName + "!" : ""}${rangeString}`;
@@ -40523,14 +40548,14 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
40523
40548
  /**
40524
40549
  * Get a Xc string that represent a part of a range
40525
40550
  */
40526
- getRangePartString(range, part) {
40551
+ getRangePartString(range, part, useFixedZone = false) {
40527
40552
  var _a, _b;
40528
40553
  const colFixed = range.parts && ((_a = range.parts[part]) === null || _a === void 0 ? void 0 : _a.colFixed) ? "$" : "";
40529
40554
  const col = part === 0 ? numberToLetters(range.zone.left) : numberToLetters(range.zone.right);
40530
40555
  const rowFixed = range.parts && ((_b = range.parts[part]) === null || _b === void 0 ? void 0 : _b.rowFixed) ? "$" : "";
40531
40556
  const row = part === 0 ? String(range.zone.top + 1) : String(range.zone.bottom + 1);
40532
40557
  let str = "";
40533
- if (range.isFullCol) {
40558
+ if (range.isFullCol && !useFixedZone) {
40534
40559
  if (part === 0 && range.unboundedZone.hasHeader) {
40535
40560
  str = colFixed + col + rowFixed + row;
40536
40561
  }
@@ -40538,7 +40563,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
40538
40563
  str = colFixed + col;
40539
40564
  }
40540
40565
  }
40541
- else if (range.isFullRow) {
40566
+ else if (range.isFullRow && !useFixedZone) {
40542
40567
  if (part === 0 && range.unboundedZone.hasHeader) {
40543
40568
  str = colFixed + col + rowFixed + row;
40544
40569
  }
@@ -40739,7 +40764,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
40739
40764
  */
40740
40765
  moveAnchorCell(direction, step = 1) {
40741
40766
  if (step !== "end" && step <= 0) {
40742
- return new DispatchResult(82 /* CommandResult.InvalidSelectionStep */);
40767
+ return new DispatchResult(83 /* CommandResult.InvalidSelectionStep */);
40743
40768
  }
40744
40769
  const { col, row } = this.getNextAvailablePosition(direction, step);
40745
40770
  return this.selectCell(col, row);
@@ -40785,7 +40810,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
40785
40810
  */
40786
40811
  resizeAnchorZone(direction, step = 1) {
40787
40812
  if (step !== "end" && step <= 0) {
40788
- return new DispatchResult(82 /* CommandResult.InvalidSelectionStep */);
40813
+ return new DispatchResult(83 /* CommandResult.InvalidSelectionStep */);
40789
40814
  }
40790
40815
  const sheetId = this.getters.getActiveSheetId();
40791
40816
  const anchor = this.anchor;
@@ -41596,12 +41621,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
41596
41621
  attrs.push(["t", "str"]);
41597
41622
  cycle = escapeXml /*xml*/ `<v>${cell.value}</v>`;
41598
41623
  }
41599
- node = escapeXml /*xml*/ `
41600
- <f>
41601
- ${XlsxFormula}
41602
- </f>
41603
- ${cycle}
41604
- `;
41624
+ node = escapeXml /*xml*/ `<f> ${XlsxFormula} </f> ${cycle}`;
41605
41625
  return { attrs, node };
41606
41626
  }
41607
41627
  else {
@@ -42342,11 +42362,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
42342
42362
  ({ attrs: additionalAttrs, node: cellNode } = addContent(cell.content, construct.sharedStrings, isTableHeader));
42343
42363
  }
42344
42364
  attributes.push(...additionalAttrs);
42345
- cellNodes.push(escapeXml /*xml*/ `
42346
- <c ${formatAttributes(attributes)}>
42347
- ${cellNode}
42348
- </c>
42349
- `);
42365
+ // prettier-ignore
42366
+ cellNodes.push(escapeXml /*xml*/ `<c ${formatAttributes(attributes)}>
42367
+ ${cellNode}
42368
+ </c>`);
42350
42369
  }
42351
42370
  }
42352
42371
  if (cellNodes.length || row.size !== DEFAULT_CELL_HEIGHT || row.isHidden) {
@@ -42725,10 +42744,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
42725
42744
  const command = { type, ...payload };
42726
42745
  let status = this.status;
42727
42746
  if (this.getters.isReadonly() && !canExecuteInReadonly(command)) {
42728
- return new DispatchResult(66 /* CommandResult.Readonly */);
42747
+ return new DispatchResult(67 /* CommandResult.Readonly */);
42729
42748
  }
42730
42749
  if (!this.session.canApplyOptimisticUpdate()) {
42731
- return new DispatchResult(63 /* CommandResult.WaitingSessionConfirmation */);
42750
+ return new DispatchResult(64 /* CommandResult.WaitingSessionConfirmation */);
42732
42751
  }
42733
42752
  switch (status) {
42734
42753
  case 0 /* Status.Ready */:
@@ -43170,9 +43189,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
43170
43189
  Object.defineProperty(exports, '__esModule', { value: true });
43171
43190
 
43172
43191
 
43173
- __info__.version = '16.0.29';
43174
- __info__.date = '2024-01-17T10:24:52.885Z';
43175
- __info__.hash = '3fda985';
43192
+ __info__.version = '16.0.30';
43193
+ __info__.date = '2024-01-29T13:49:32.243Z';
43194
+ __info__.hash = '49966d6';
43176
43195
 
43177
43196
 
43178
43197
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);