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