@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.
@@ -1895,27 +1895,30 @@ function createDefaultFormat(value) {
1895
1895
  }
1896
1896
  function createLargeNumberFormat(format, magnitude, postFix) {
1897
1897
  const internalFormat = parseFormat(format || "#,##0");
1898
- const largeNumberFormat = internalFormat
1899
- .map((formatPart) => {
1900
- if (formatPart.type === "NUMBER") {
1901
- return [
1902
- {
1903
- ...formatPart,
1904
- format: {
1905
- ...formatPart.format,
1906
- magnitude,
1907
- decimalPart: undefined,
1908
- },
1909
- },
1910
- {
1911
- type: "STRING",
1912
- format: postFix,
1913
- },
1914
- ];
1898
+ const largeNumberFormat = [];
1899
+ for (let i = 0; i < internalFormat.length; i++) {
1900
+ const formatPart = internalFormat[i];
1901
+ if (formatPart.type !== "NUMBER") {
1902
+ largeNumberFormat.push(formatPart);
1903
+ continue;
1915
1904
  }
1916
- return formatPart;
1917
- })
1918
- .flat();
1905
+ largeNumberFormat.push({
1906
+ ...formatPart,
1907
+ format: {
1908
+ ...formatPart.format,
1909
+ magnitude,
1910
+ decimalPart: undefined,
1911
+ },
1912
+ });
1913
+ largeNumberFormat.push({
1914
+ type: "STRING",
1915
+ format: postFix,
1916
+ });
1917
+ const nextFormatPart = internalFormat[i + 1];
1918
+ if ((nextFormatPart === null || nextFormatPart === void 0 ? void 0 : nextFormatPart.type) === "STRING" && ["k", "m", "b"].includes(nextFormatPart.format)) {
1919
+ i++;
1920
+ }
1921
+ }
1919
1922
  return convertInternalFormatToFormat(largeNumberFormat);
1920
1923
  }
1921
1924
  function changeDecimalPlaces(format, step) {
@@ -3354,64 +3357,65 @@ exports.CommandResult = void 0;
3354
3357
  CommandResult[CommandResult["InvalidSheetId"] = 27] = "InvalidSheetId";
3355
3358
  CommandResult[CommandResult["InputAlreadyFocused"] = 28] = "InputAlreadyFocused";
3356
3359
  CommandResult[CommandResult["MaximumRangesReached"] = 29] = "MaximumRangesReached";
3357
- CommandResult[CommandResult["InvalidChartDefinition"] = 30] = "InvalidChartDefinition";
3358
- CommandResult[CommandResult["InvalidDataSet"] = 31] = "InvalidDataSet";
3359
- CommandResult[CommandResult["InvalidLabelRange"] = 32] = "InvalidLabelRange";
3360
- CommandResult[CommandResult["InvalidScorecardKeyValue"] = 33] = "InvalidScorecardKeyValue";
3361
- CommandResult[CommandResult["InvalidScorecardBaseline"] = 34] = "InvalidScorecardBaseline";
3362
- CommandResult[CommandResult["InvalidGaugeDataRange"] = 35] = "InvalidGaugeDataRange";
3363
- CommandResult[CommandResult["EmptyGaugeRangeMin"] = 36] = "EmptyGaugeRangeMin";
3364
- CommandResult[CommandResult["GaugeRangeMinNaN"] = 37] = "GaugeRangeMinNaN";
3365
- CommandResult[CommandResult["EmptyGaugeRangeMax"] = 38] = "EmptyGaugeRangeMax";
3366
- CommandResult[CommandResult["GaugeRangeMaxNaN"] = 39] = "GaugeRangeMaxNaN";
3367
- CommandResult[CommandResult["GaugeRangeMinBiggerThanRangeMax"] = 40] = "GaugeRangeMinBiggerThanRangeMax";
3368
- CommandResult[CommandResult["GaugeLowerInflectionPointNaN"] = 41] = "GaugeLowerInflectionPointNaN";
3369
- CommandResult[CommandResult["GaugeUpperInflectionPointNaN"] = 42] = "GaugeUpperInflectionPointNaN";
3370
- CommandResult[CommandResult["GaugeLowerBiggerThanUpper"] = 43] = "GaugeLowerBiggerThanUpper";
3371
- CommandResult[CommandResult["InvalidAutofillSelection"] = 44] = "InvalidAutofillSelection";
3372
- CommandResult[CommandResult["WrongComposerSelection"] = 45] = "WrongComposerSelection";
3373
- CommandResult[CommandResult["MinBiggerThanMax"] = 46] = "MinBiggerThanMax";
3374
- CommandResult[CommandResult["LowerBiggerThanUpper"] = 47] = "LowerBiggerThanUpper";
3375
- CommandResult[CommandResult["MidBiggerThanMax"] = 48] = "MidBiggerThanMax";
3376
- CommandResult[CommandResult["MinBiggerThanMid"] = 49] = "MinBiggerThanMid";
3377
- CommandResult[CommandResult["FirstArgMissing"] = 50] = "FirstArgMissing";
3378
- CommandResult[CommandResult["SecondArgMissing"] = 51] = "SecondArgMissing";
3379
- CommandResult[CommandResult["MinNaN"] = 52] = "MinNaN";
3380
- CommandResult[CommandResult["MidNaN"] = 53] = "MidNaN";
3381
- CommandResult[CommandResult["MaxNaN"] = 54] = "MaxNaN";
3382
- CommandResult[CommandResult["ValueUpperInflectionNaN"] = 55] = "ValueUpperInflectionNaN";
3383
- CommandResult[CommandResult["ValueLowerInflectionNaN"] = 56] = "ValueLowerInflectionNaN";
3384
- CommandResult[CommandResult["MinInvalidFormula"] = 57] = "MinInvalidFormula";
3385
- CommandResult[CommandResult["MidInvalidFormula"] = 58] = "MidInvalidFormula";
3386
- CommandResult[CommandResult["MaxInvalidFormula"] = 59] = "MaxInvalidFormula";
3387
- CommandResult[CommandResult["ValueUpperInvalidFormula"] = 60] = "ValueUpperInvalidFormula";
3388
- CommandResult[CommandResult["ValueLowerInvalidFormula"] = 61] = "ValueLowerInvalidFormula";
3389
- CommandResult[CommandResult["InvalidSortZone"] = 62] = "InvalidSortZone";
3390
- CommandResult[CommandResult["WaitingSessionConfirmation"] = 63] = "WaitingSessionConfirmation";
3391
- CommandResult[CommandResult["MergeOverlap"] = 64] = "MergeOverlap";
3392
- CommandResult[CommandResult["TooManyHiddenElements"] = 65] = "TooManyHiddenElements";
3393
- CommandResult[CommandResult["Readonly"] = 66] = "Readonly";
3394
- CommandResult[CommandResult["InvalidViewportSize"] = 67] = "InvalidViewportSize";
3395
- CommandResult[CommandResult["InvalidScrollingDirection"] = 68] = "InvalidScrollingDirection";
3396
- CommandResult[CommandResult["FigureDoesNotExist"] = 69] = "FigureDoesNotExist";
3397
- CommandResult[CommandResult["InvalidConditionalFormatId"] = 70] = "InvalidConditionalFormatId";
3398
- CommandResult[CommandResult["InvalidCellPopover"] = 71] = "InvalidCellPopover";
3399
- CommandResult[CommandResult["EmptyTarget"] = 72] = "EmptyTarget";
3400
- CommandResult[CommandResult["InvalidFreezeQuantity"] = 73] = "InvalidFreezeQuantity";
3401
- CommandResult[CommandResult["FrozenPaneOverlap"] = 74] = "FrozenPaneOverlap";
3402
- CommandResult[CommandResult["ValuesNotChanged"] = 75] = "ValuesNotChanged";
3403
- CommandResult[CommandResult["InvalidFilterZone"] = 76] = "InvalidFilterZone";
3404
- CommandResult[CommandResult["FilterOverlap"] = 77] = "FilterOverlap";
3405
- CommandResult[CommandResult["FilterNotFound"] = 78] = "FilterNotFound";
3406
- CommandResult[CommandResult["MergeInFilter"] = 79] = "MergeInFilter";
3407
- CommandResult[CommandResult["NonContinuousTargets"] = 80] = "NonContinuousTargets";
3408
- CommandResult[CommandResult["DuplicatedFigureId"] = 81] = "DuplicatedFigureId";
3409
- CommandResult[CommandResult["InvalidSelectionStep"] = 82] = "InvalidSelectionStep";
3410
- CommandResult[CommandResult["DuplicatedChartId"] = 83] = "DuplicatedChartId";
3411
- CommandResult[CommandResult["ChartDoesNotExist"] = 84] = "ChartDoesNotExist";
3412
- CommandResult[CommandResult["InvalidHeaderIndex"] = 85] = "InvalidHeaderIndex";
3413
- CommandResult[CommandResult["InvalidQuantity"] = 86] = "InvalidQuantity";
3414
- CommandResult[CommandResult["NoChanges"] = 87] = "NoChanges";
3360
+ CommandResult[CommandResult["InvalidInputId"] = 30] = "InvalidInputId";
3361
+ CommandResult[CommandResult["InvalidChartDefinition"] = 31] = "InvalidChartDefinition";
3362
+ CommandResult[CommandResult["InvalidDataSet"] = 32] = "InvalidDataSet";
3363
+ CommandResult[CommandResult["InvalidLabelRange"] = 33] = "InvalidLabelRange";
3364
+ CommandResult[CommandResult["InvalidScorecardKeyValue"] = 34] = "InvalidScorecardKeyValue";
3365
+ CommandResult[CommandResult["InvalidScorecardBaseline"] = 35] = "InvalidScorecardBaseline";
3366
+ CommandResult[CommandResult["InvalidGaugeDataRange"] = 36] = "InvalidGaugeDataRange";
3367
+ CommandResult[CommandResult["EmptyGaugeRangeMin"] = 37] = "EmptyGaugeRangeMin";
3368
+ CommandResult[CommandResult["GaugeRangeMinNaN"] = 38] = "GaugeRangeMinNaN";
3369
+ CommandResult[CommandResult["EmptyGaugeRangeMax"] = 39] = "EmptyGaugeRangeMax";
3370
+ CommandResult[CommandResult["GaugeRangeMaxNaN"] = 40] = "GaugeRangeMaxNaN";
3371
+ CommandResult[CommandResult["GaugeRangeMinBiggerThanRangeMax"] = 41] = "GaugeRangeMinBiggerThanRangeMax";
3372
+ CommandResult[CommandResult["GaugeLowerInflectionPointNaN"] = 42] = "GaugeLowerInflectionPointNaN";
3373
+ CommandResult[CommandResult["GaugeUpperInflectionPointNaN"] = 43] = "GaugeUpperInflectionPointNaN";
3374
+ CommandResult[CommandResult["GaugeLowerBiggerThanUpper"] = 44] = "GaugeLowerBiggerThanUpper";
3375
+ CommandResult[CommandResult["InvalidAutofillSelection"] = 45] = "InvalidAutofillSelection";
3376
+ CommandResult[CommandResult["WrongComposerSelection"] = 46] = "WrongComposerSelection";
3377
+ CommandResult[CommandResult["MinBiggerThanMax"] = 47] = "MinBiggerThanMax";
3378
+ CommandResult[CommandResult["LowerBiggerThanUpper"] = 48] = "LowerBiggerThanUpper";
3379
+ CommandResult[CommandResult["MidBiggerThanMax"] = 49] = "MidBiggerThanMax";
3380
+ CommandResult[CommandResult["MinBiggerThanMid"] = 50] = "MinBiggerThanMid";
3381
+ CommandResult[CommandResult["FirstArgMissing"] = 51] = "FirstArgMissing";
3382
+ CommandResult[CommandResult["SecondArgMissing"] = 52] = "SecondArgMissing";
3383
+ CommandResult[CommandResult["MinNaN"] = 53] = "MinNaN";
3384
+ CommandResult[CommandResult["MidNaN"] = 54] = "MidNaN";
3385
+ CommandResult[CommandResult["MaxNaN"] = 55] = "MaxNaN";
3386
+ CommandResult[CommandResult["ValueUpperInflectionNaN"] = 56] = "ValueUpperInflectionNaN";
3387
+ CommandResult[CommandResult["ValueLowerInflectionNaN"] = 57] = "ValueLowerInflectionNaN";
3388
+ CommandResult[CommandResult["MinInvalidFormula"] = 58] = "MinInvalidFormula";
3389
+ CommandResult[CommandResult["MidInvalidFormula"] = 59] = "MidInvalidFormula";
3390
+ CommandResult[CommandResult["MaxInvalidFormula"] = 60] = "MaxInvalidFormula";
3391
+ CommandResult[CommandResult["ValueUpperInvalidFormula"] = 61] = "ValueUpperInvalidFormula";
3392
+ CommandResult[CommandResult["ValueLowerInvalidFormula"] = 62] = "ValueLowerInvalidFormula";
3393
+ CommandResult[CommandResult["InvalidSortZone"] = 63] = "InvalidSortZone";
3394
+ CommandResult[CommandResult["WaitingSessionConfirmation"] = 64] = "WaitingSessionConfirmation";
3395
+ CommandResult[CommandResult["MergeOverlap"] = 65] = "MergeOverlap";
3396
+ CommandResult[CommandResult["TooManyHiddenElements"] = 66] = "TooManyHiddenElements";
3397
+ CommandResult[CommandResult["Readonly"] = 67] = "Readonly";
3398
+ CommandResult[CommandResult["InvalidViewportSize"] = 68] = "InvalidViewportSize";
3399
+ CommandResult[CommandResult["InvalidScrollingDirection"] = 69] = "InvalidScrollingDirection";
3400
+ CommandResult[CommandResult["FigureDoesNotExist"] = 70] = "FigureDoesNotExist";
3401
+ CommandResult[CommandResult["InvalidConditionalFormatId"] = 71] = "InvalidConditionalFormatId";
3402
+ CommandResult[CommandResult["InvalidCellPopover"] = 72] = "InvalidCellPopover";
3403
+ CommandResult[CommandResult["EmptyTarget"] = 73] = "EmptyTarget";
3404
+ CommandResult[CommandResult["InvalidFreezeQuantity"] = 74] = "InvalidFreezeQuantity";
3405
+ CommandResult[CommandResult["FrozenPaneOverlap"] = 75] = "FrozenPaneOverlap";
3406
+ CommandResult[CommandResult["ValuesNotChanged"] = 76] = "ValuesNotChanged";
3407
+ CommandResult[CommandResult["InvalidFilterZone"] = 77] = "InvalidFilterZone";
3408
+ CommandResult[CommandResult["FilterOverlap"] = 78] = "FilterOverlap";
3409
+ CommandResult[CommandResult["FilterNotFound"] = 79] = "FilterNotFound";
3410
+ CommandResult[CommandResult["MergeInFilter"] = 80] = "MergeInFilter";
3411
+ CommandResult[CommandResult["NonContinuousTargets"] = 81] = "NonContinuousTargets";
3412
+ CommandResult[CommandResult["DuplicatedFigureId"] = 82] = "DuplicatedFigureId";
3413
+ CommandResult[CommandResult["InvalidSelectionStep"] = 83] = "InvalidSelectionStep";
3414
+ CommandResult[CommandResult["DuplicatedChartId"] = 84] = "DuplicatedChartId";
3415
+ CommandResult[CommandResult["ChartDoesNotExist"] = 85] = "ChartDoesNotExist";
3416
+ CommandResult[CommandResult["InvalidHeaderIndex"] = 86] = "InvalidHeaderIndex";
3417
+ CommandResult[CommandResult["InvalidQuantity"] = 87] = "InvalidQuantity";
3418
+ CommandResult[CommandResult["NoChanges"] = 88] = "NoChanges";
3415
3419
  })(exports.CommandResult || (exports.CommandResult = {}));
3416
3420
 
3417
3421
  function isMatrix(x) {
@@ -4912,7 +4916,7 @@ function interactiveSortSelection(env, sheetId, anchor, zone, sortDirection) {
4912
4916
  });
4913
4917
  }
4914
4918
  }
4915
- if (result.isCancelledBecause(62 /* CommandResult.InvalidSortZone */)) {
4919
+ if (result.isCancelledBecause(63 /* CommandResult.InvalidSortZone */)) {
4916
4920
  const { col, row } = anchor;
4917
4921
  env.model.selection.selectZone({ cell: { col, row }, zone });
4918
4922
  env.raiseError(_lt("Cannot sort. To sort, select only cells or only merges that have the same size."));
@@ -4935,13 +4939,13 @@ const AddFilterInteractiveContent = {
4935
4939
  };
4936
4940
  function interactiveAddFilter(env, sheetId, target) {
4937
4941
  const result = env.model.dispatch("CREATE_FILTER_TABLE", { target, sheetId });
4938
- if (result.isCancelledBecause(77 /* CommandResult.FilterOverlap */)) {
4942
+ if (result.isCancelledBecause(78 /* CommandResult.FilterOverlap */)) {
4939
4943
  env.raiseError(AddFilterInteractiveContent.filterOverlap);
4940
4944
  }
4941
- else if (result.isCancelledBecause(79 /* CommandResult.MergeInFilter */)) {
4945
+ else if (result.isCancelledBecause(80 /* CommandResult.MergeInFilter */)) {
4942
4946
  env.raiseError(AddFilterInteractiveContent.mergeInFilter);
4943
4947
  }
4944
- else if (result.isCancelledBecause(80 /* CommandResult.NonContinuousTargets */)) {
4948
+ else if (result.isCancelledBecause(81 /* CommandResult.NonContinuousTargets */)) {
4945
4949
  env.raiseError(AddFilterInteractiveContent.nonContinuousTargets);
4946
4950
  }
4947
4951
  }
@@ -4963,7 +4967,7 @@ function handlePasteResult(env, result) {
4963
4967
  else if (result.reasons.includes(22 /* CommandResult.WrongFigurePasteOption */)) {
4964
4968
  env.raiseError(PasteInteractiveContent.wrongFigurePasteOption);
4965
4969
  }
4966
- else if (result.reasons.includes(74 /* CommandResult.FrozenPaneOverlap */)) {
4970
+ else if (result.reasons.includes(75 /* CommandResult.FrozenPaneOverlap */)) {
4967
4971
  env.raiseError(PasteInteractiveContent.frozenPaneOverlap);
4968
4972
  }
4969
4973
  }
@@ -6005,22 +6009,22 @@ sheetMenuRegistry
6005
6009
  const CfTerms = {
6006
6010
  Errors: {
6007
6011
  [25 /* CommandResult.InvalidRange */]: _lt("The range is invalid"),
6008
- [50 /* CommandResult.FirstArgMissing */]: _lt("The argument is missing. Please provide a value"),
6009
- [51 /* CommandResult.SecondArgMissing */]: _lt("The second argument is missing. Please provide a value"),
6010
- [52 /* CommandResult.MinNaN */]: _lt("The minpoint must be a number"),
6011
- [53 /* CommandResult.MidNaN */]: _lt("The midpoint must be a number"),
6012
- [54 /* CommandResult.MaxNaN */]: _lt("The maxpoint must be a number"),
6013
- [55 /* CommandResult.ValueUpperInflectionNaN */]: _lt("The first value must be a number"),
6014
- [56 /* CommandResult.ValueLowerInflectionNaN */]: _lt("The second value must be a number"),
6015
- [46 /* CommandResult.MinBiggerThanMax */]: _lt("Minimum must be smaller then Maximum"),
6016
- [49 /* CommandResult.MinBiggerThanMid */]: _lt("Minimum must be smaller then Midpoint"),
6017
- [48 /* CommandResult.MidBiggerThanMax */]: _lt("Midpoint must be smaller then Maximum"),
6018
- [47 /* CommandResult.LowerBiggerThanUpper */]: _lt("Lower inflection point must be smaller than upper inflection point"),
6019
- [57 /* CommandResult.MinInvalidFormula */]: _lt("Invalid Minpoint formula"),
6020
- [59 /* CommandResult.MaxInvalidFormula */]: _lt("Invalid Maxpoint formula"),
6021
- [58 /* CommandResult.MidInvalidFormula */]: _lt("Invalid Midpoint formula"),
6022
- [60 /* CommandResult.ValueUpperInvalidFormula */]: _lt("Invalid upper inflection point formula"),
6023
- [61 /* CommandResult.ValueLowerInvalidFormula */]: _lt("Invalid lower inflection point formula"),
6012
+ [51 /* CommandResult.FirstArgMissing */]: _lt("The argument is missing. Please provide a value"),
6013
+ [52 /* CommandResult.SecondArgMissing */]: _lt("The second argument is missing. Please provide a value"),
6014
+ [53 /* CommandResult.MinNaN */]: _lt("The minpoint must be a number"),
6015
+ [54 /* CommandResult.MidNaN */]: _lt("The midpoint must be a number"),
6016
+ [55 /* CommandResult.MaxNaN */]: _lt("The maxpoint must be a number"),
6017
+ [56 /* CommandResult.ValueUpperInflectionNaN */]: _lt("The first value must be a number"),
6018
+ [57 /* CommandResult.ValueLowerInflectionNaN */]: _lt("The second value must be a number"),
6019
+ [47 /* CommandResult.MinBiggerThanMax */]: _lt("Minimum must be smaller then Maximum"),
6020
+ [50 /* CommandResult.MinBiggerThanMid */]: _lt("Minimum must be smaller then Midpoint"),
6021
+ [49 /* CommandResult.MidBiggerThanMax */]: _lt("Midpoint must be smaller then Maximum"),
6022
+ [48 /* CommandResult.LowerBiggerThanUpper */]: _lt("Lower inflection point must be smaller than upper inflection point"),
6023
+ [58 /* CommandResult.MinInvalidFormula */]: _lt("Invalid Minpoint formula"),
6024
+ [60 /* CommandResult.MaxInvalidFormula */]: _lt("Invalid Maxpoint formula"),
6025
+ [59 /* CommandResult.MidInvalidFormula */]: _lt("Invalid Midpoint formula"),
6026
+ [61 /* CommandResult.ValueUpperInvalidFormula */]: _lt("Invalid upper inflection point formula"),
6027
+ [62 /* CommandResult.ValueLowerInvalidFormula */]: _lt("Invalid lower inflection point formula"),
6024
6028
  [24 /* CommandResult.EmptyRange */]: _lt("A range needs to be defined"),
6025
6029
  Unexpected: _lt("The rule is invalid for an unknown reason"),
6026
6030
  },
@@ -6048,20 +6052,20 @@ const ChartTerms = {
6048
6052
  Errors: {
6049
6053
  Unexpected: _lt("The chart definition is invalid for an unknown reason"),
6050
6054
  // BASIC CHART ERRORS (LINE | BAR | PIE)
6051
- [31 /* CommandResult.InvalidDataSet */]: _lt("The dataset is invalid"),
6052
- [32 /* CommandResult.InvalidLabelRange */]: _lt("Labels are invalid"),
6055
+ [32 /* CommandResult.InvalidDataSet */]: _lt("The dataset is invalid"),
6056
+ [33 /* CommandResult.InvalidLabelRange */]: _lt("Labels are invalid"),
6053
6057
  // SCORECARD CHART ERRORS
6054
- [33 /* CommandResult.InvalidScorecardKeyValue */]: _lt("The key value is invalid"),
6055
- [34 /* CommandResult.InvalidScorecardBaseline */]: _lt("The baseline value is invalid"),
6058
+ [34 /* CommandResult.InvalidScorecardKeyValue */]: _lt("The key value is invalid"),
6059
+ [35 /* CommandResult.InvalidScorecardBaseline */]: _lt("The baseline value is invalid"),
6056
6060
  // GAUGE CHART ERRORS
6057
- [35 /* CommandResult.InvalidGaugeDataRange */]: _lt("The data range is invalid"),
6058
- [36 /* CommandResult.EmptyGaugeRangeMin */]: _lt("A minimum range limit value is needed"),
6059
- [37 /* CommandResult.GaugeRangeMinNaN */]: _lt("The minimum range limit value must be a number"),
6060
- [38 /* CommandResult.EmptyGaugeRangeMax */]: _lt("A maximum range limit value is needed"),
6061
- [39 /* CommandResult.GaugeRangeMaxNaN */]: _lt("The maximum range limit value must be a number"),
6062
- [40 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */]: _lt("Minimum range limit must be smaller than maximum range limit"),
6063
- [41 /* CommandResult.GaugeLowerInflectionPointNaN */]: _lt("The lower inflection point value must be a number"),
6064
- [42 /* CommandResult.GaugeUpperInflectionPointNaN */]: _lt("The upper inflection point value must be a number"),
6061
+ [36 /* CommandResult.InvalidGaugeDataRange */]: _lt("The data range is invalid"),
6062
+ [37 /* CommandResult.EmptyGaugeRangeMin */]: _lt("A minimum range limit value is needed"),
6063
+ [38 /* CommandResult.GaugeRangeMinNaN */]: _lt("The minimum range limit value must be a number"),
6064
+ [39 /* CommandResult.EmptyGaugeRangeMax */]: _lt("A maximum range limit value is needed"),
6065
+ [40 /* CommandResult.GaugeRangeMaxNaN */]: _lt("The maximum range limit value must be a number"),
6066
+ [41 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */]: _lt("Minimum range limit must be smaller than maximum range limit"),
6067
+ [42 /* CommandResult.GaugeLowerInflectionPointNaN */]: _lt("The lower inflection point value must be a number"),
6068
+ [43 /* CommandResult.GaugeUpperInflectionPointNaN */]: _lt("The upper inflection point value must be a number"),
6065
6069
  },
6066
6070
  };
6067
6071
  const NumberFormatTerms = {
@@ -6085,7 +6089,7 @@ function interactiveFreezeColumnsRows(env, dimension, base) {
6085
6089
  const sheetId = env.model.getters.getActiveSheetId();
6086
6090
  const cmd = dimension === "COL" ? "FREEZE_COLUMNS" : "FREEZE_ROWS";
6087
6091
  const result = env.model.dispatch(cmd, { sheetId, quantity: base });
6088
- if (result.isCancelledBecause(64 /* CommandResult.MergeOverlap */)) {
6092
+ if (result.isCancelledBecause(65 /* CommandResult.MergeOverlap */)) {
6089
6093
  env.raiseError(MergeErrorMessage);
6090
6094
  }
6091
6095
  }
@@ -6731,11 +6735,11 @@ class LineBarPieConfigPanel extends owl.Component {
6731
6735
  }
6732
6736
  get isDatasetInvalid() {
6733
6737
  var _a;
6734
- return !!((_a = this.state.datasetDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(31 /* CommandResult.InvalidDataSet */));
6738
+ return !!((_a = this.state.datasetDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(32 /* CommandResult.InvalidDataSet */));
6735
6739
  }
6736
6740
  get isLabelInvalid() {
6737
6741
  var _a;
6738
- return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(32 /* CommandResult.InvalidLabelRange */));
6742
+ return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(33 /* CommandResult.InvalidLabelRange */));
6739
6743
  }
6740
6744
  onUpdateDataSetsHaveTitle(ev) {
6741
6745
  this.props.updateChart(this.props.figureId, {
@@ -6956,14 +6960,8 @@ function createDataSets(getters, dataSetsString, sheetId, dataSetsHaveTitle) {
6956
6960
  : undefined));
6957
6961
  }
6958
6962
  }
6959
- else if (zone.left === zone.right && zone.top === zone.bottom) {
6960
- // A single cell. If it's only the title, the dataset is not added.
6961
- if (!dataSetsHaveTitle) {
6962
- dataSets.push(createDataSet(getters, dataSetSheetId, zone, undefined));
6963
- }
6964
- }
6965
6963
  else {
6966
- /* 1 row or 1 column */
6964
+ /* 1 cell, 1 row or 1 column */
6967
6965
  dataSets.push(createDataSet(getters, dataSetSheetId, zone, dataSetsHaveTitle
6968
6966
  ? {
6969
6967
  top: zone.top,
@@ -7013,8 +7011,10 @@ function toExcelDataset(getters, ds) {
7013
7011
  }
7014
7012
  const dataRange = ds.dataRange.clone({ zone: dataZone });
7015
7013
  return {
7016
- label: ds.labelCell ? getters.getRangeString(ds.labelCell, "forceSheetReference") : undefined,
7017
- range: getters.getRangeString(dataRange, "forceSheetReference"),
7014
+ label: ds.labelCell
7015
+ ? getters.getRangeString(ds.labelCell, "forceSheetReference", true)
7016
+ : undefined,
7017
+ range: getters.getRangeString(dataRange, "forceSheetReference", true),
7018
7018
  };
7019
7019
  }
7020
7020
  /**
@@ -7083,11 +7083,11 @@ function checkDataset(definition) {
7083
7083
  if (definition.dataSets) {
7084
7084
  const invalidRanges = definition.dataSets.find((range) => !rangeReference.test(range)) !== undefined;
7085
7085
  if (invalidRanges) {
7086
- return 31 /* CommandResult.InvalidDataSet */;
7086
+ return 32 /* CommandResult.InvalidDataSet */;
7087
7087
  }
7088
7088
  const zones = definition.dataSets.map(toUnboundedZone);
7089
7089
  if (zones.some((zone) => zone.top !== zone.bottom && isFullRow(zone))) {
7090
- return 31 /* CommandResult.InvalidDataSet */;
7090
+ return 32 /* CommandResult.InvalidDataSet */;
7091
7091
  }
7092
7092
  }
7093
7093
  return 0 /* CommandResult.Success */;
@@ -7096,7 +7096,7 @@ function checkLabelRange(definition) {
7096
7096
  if (definition.labelRange) {
7097
7097
  const invalidLabels = !rangeReference.test(definition.labelRange || "");
7098
7098
  if (invalidLabels) {
7099
- return 32 /* CommandResult.InvalidLabelRange */;
7099
+ return 33 /* CommandResult.InvalidLabelRange */;
7100
7100
  }
7101
7101
  }
7102
7102
  return 0 /* CommandResult.Success */;
@@ -7397,6 +7397,9 @@ class BarChart extends AbstractChart {
7397
7397
  .filter((ds) => ds.range !== ""); // && range !== INCORRECT_RANGE_STRING ? show incorrect #ref ?
7398
7398
  return {
7399
7399
  ...this.getDefinition(),
7400
+ labelRange: this.labelRange
7401
+ ? this.getters.getRangeString(this.labelRange, this.sheetId, true)
7402
+ : undefined,
7400
7403
  backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
7401
7404
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
7402
7405
  dataSets,
@@ -7554,7 +7557,7 @@ chartRegistry.add("gauge", {
7554
7557
  });
7555
7558
  function isDataRangeValid(definition) {
7556
7559
  return definition.dataRange && !rangeReference.test(definition.dataRange)
7557
- ? 35 /* CommandResult.InvalidGaugeDataRange */
7560
+ ? 36 /* CommandResult.InvalidGaugeDataRange */
7558
7561
  : 0 /* CommandResult.Success */;
7559
7562
  }
7560
7563
  function checkRangeLimits(check, batchValidations) {
@@ -7586,7 +7589,7 @@ function checkInflectionPointsValue(check, batchValidations) {
7586
7589
  function checkRangeMinBiggerThanRangeMax(definition) {
7587
7590
  if (definition.sectionRule) {
7588
7591
  if (Number(definition.sectionRule.rangeMin) >= Number(definition.sectionRule.rangeMax)) {
7589
- return 40 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */;
7592
+ return 41 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */;
7590
7593
  }
7591
7594
  }
7592
7595
  return 0 /* CommandResult.Success */;
@@ -7595,9 +7598,9 @@ function checkEmpty(value, valueName) {
7595
7598
  if (value === "") {
7596
7599
  switch (valueName) {
7597
7600
  case "rangeMin":
7598
- return 36 /* CommandResult.EmptyGaugeRangeMin */;
7601
+ return 37 /* CommandResult.EmptyGaugeRangeMin */;
7599
7602
  case "rangeMax":
7600
- return 38 /* CommandResult.EmptyGaugeRangeMax */;
7603
+ return 39 /* CommandResult.EmptyGaugeRangeMax */;
7601
7604
  }
7602
7605
  }
7603
7606
  return 0 /* CommandResult.Success */;
@@ -7606,13 +7609,13 @@ function checkNaN(value, valueName) {
7606
7609
  if (isNaN(value)) {
7607
7610
  switch (valueName) {
7608
7611
  case "rangeMin":
7609
- return 37 /* CommandResult.GaugeRangeMinNaN */;
7612
+ return 38 /* CommandResult.GaugeRangeMinNaN */;
7610
7613
  case "rangeMax":
7611
- return 39 /* CommandResult.GaugeRangeMaxNaN */;
7614
+ return 40 /* CommandResult.GaugeRangeMaxNaN */;
7612
7615
  case "lowerInflectionPointValue":
7613
- return 41 /* CommandResult.GaugeLowerInflectionPointNaN */;
7616
+ return 42 /* CommandResult.GaugeLowerInflectionPointNaN */;
7614
7617
  case "upperInflectionPointValue":
7615
- return 42 /* CommandResult.GaugeUpperInflectionPointNaN */;
7618
+ return 43 /* CommandResult.GaugeUpperInflectionPointNaN */;
7616
7619
  }
7617
7620
  }
7618
7621
  return 0 /* CommandResult.Success */;
@@ -8025,6 +8028,9 @@ class LineChart extends AbstractChart {
8025
8028
  .filter((ds) => ds.range !== ""); // && range !== INCORRECT_RANGE_STRING ? show incorrect #ref ?
8026
8029
  return {
8027
8030
  ...this.getDefinition(),
8031
+ labelRange: this.labelRange
8032
+ ? this.getters.getRangeString(this.labelRange, this.sheetId, true)
8033
+ : undefined,
8028
8034
  backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
8029
8035
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
8030
8036
  dataSets,
@@ -8285,6 +8291,9 @@ class PieChart extends AbstractChart {
8285
8291
  .filter((ds) => ds.range !== ""); // && range !== INCORRECT_RANGE_STRING ? show incorrect #ref ?
8286
8292
  return {
8287
8293
  ...this.getDefinition(),
8294
+ labelRange: this.labelRange
8295
+ ? this.getters.getRangeString(this.labelRange, this.sheetId, true)
8296
+ : undefined,
8288
8297
  backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
8289
8298
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
8290
8299
  verticalAxisPosition: "left",
@@ -8365,12 +8374,12 @@ chartRegistry.add("scorecard", {
8365
8374
  });
8366
8375
  function checkKeyValue(definition) {
8367
8376
  return definition.keyValue && !rangeReference.test(definition.keyValue)
8368
- ? 33 /* CommandResult.InvalidScorecardKeyValue */
8377
+ ? 34 /* CommandResult.InvalidScorecardKeyValue */
8369
8378
  : 0 /* CommandResult.Success */;
8370
8379
  }
8371
8380
  function checkBaseline(definition) {
8372
8381
  return definition.baseline && !rangeReference.test(definition.baseline)
8373
- ? 34 /* CommandResult.InvalidScorecardBaseline */
8382
+ ? 35 /* CommandResult.InvalidScorecardBaseline */
8374
8383
  : 0 /* CommandResult.Success */;
8375
8384
  }
8376
8385
  class ScorecardChart$1 extends AbstractChart {
@@ -8799,7 +8808,7 @@ class GaugeChartConfigPanel extends owl.Component {
8799
8808
  }
8800
8809
  get isDataRangeInvalid() {
8801
8810
  var _a;
8802
- return !!((_a = this.state.dataRangeDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(35 /* CommandResult.InvalidGaugeDataRange */));
8811
+ return !!((_a = this.state.dataRangeDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(36 /* CommandResult.InvalidGaugeDataRange */));
8803
8812
  }
8804
8813
  onDataRangeChanged(ranges) {
8805
8814
  this.dataRange = ranges[0];
@@ -8886,28 +8895,28 @@ class GaugeChartDesignPanel extends owl.Component {
8886
8895
  }
8887
8896
  isRangeMinInvalid() {
8888
8897
  var _a, _b, _c;
8889
- return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(36 /* CommandResult.EmptyGaugeRangeMin */)) ||
8890
- ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(37 /* CommandResult.GaugeRangeMinNaN */)) ||
8891
- ((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(40 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
8898
+ return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(37 /* CommandResult.EmptyGaugeRangeMin */)) ||
8899
+ ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(38 /* CommandResult.GaugeRangeMinNaN */)) ||
8900
+ ((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(41 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
8892
8901
  }
8893
8902
  isRangeMaxInvalid() {
8894
8903
  var _a, _b, _c;
8895
- return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(38 /* CommandResult.EmptyGaugeRangeMax */)) ||
8896
- ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(39 /* CommandResult.GaugeRangeMaxNaN */)) ||
8897
- ((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(40 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
8904
+ return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(39 /* CommandResult.EmptyGaugeRangeMax */)) ||
8905
+ ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(40 /* CommandResult.GaugeRangeMaxNaN */)) ||
8906
+ ((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(41 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
8898
8907
  }
8899
8908
  // ---------------------------------------------------------------------------
8900
8909
  // COLOR_SECTION_TEMPLATE
8901
8910
  // ---------------------------------------------------------------------------
8902
8911
  get isLowerInflectionPointInvalid() {
8903
8912
  var _a, _b;
8904
- return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(41 /* CommandResult.GaugeLowerInflectionPointNaN */)) ||
8905
- ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(43 /* CommandResult.GaugeLowerBiggerThanUpper */)));
8913
+ return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(42 /* CommandResult.GaugeLowerInflectionPointNaN */)) ||
8914
+ ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(44 /* CommandResult.GaugeLowerBiggerThanUpper */)));
8906
8915
  }
8907
8916
  get isUpperInflectionPointInvalid() {
8908
8917
  var _a, _b;
8909
- return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(42 /* CommandResult.GaugeUpperInflectionPointNaN */)) ||
8910
- ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(43 /* CommandResult.GaugeLowerBiggerThanUpper */)));
8918
+ return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(43 /* CommandResult.GaugeUpperInflectionPointNaN */)) ||
8919
+ ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(44 /* CommandResult.GaugeLowerBiggerThanUpper */)));
8911
8920
  }
8912
8921
  updateInflectionPointValue(attr, ev) {
8913
8922
  const sectionRule = deepCopy(this.props.definition.sectionRule);
@@ -9010,11 +9019,11 @@ class ScorecardChartConfigPanel extends owl.Component {
9010
9019
  }
9011
9020
  get isKeyValueInvalid() {
9012
9021
  var _a;
9013
- return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(33 /* CommandResult.InvalidScorecardKeyValue */));
9022
+ return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(34 /* CommandResult.InvalidScorecardKeyValue */));
9014
9023
  }
9015
9024
  get isBaselineInvalid() {
9016
9025
  var _a;
9017
- return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(34 /* CommandResult.InvalidScorecardBaseline */));
9026
+ return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(35 /* CommandResult.InvalidScorecardBaseline */));
9018
9027
  }
9019
9028
  onKeyValueRangeChanged(ranges) {
9020
9029
  this.keyValue = ranges[0];
@@ -9854,11 +9863,11 @@ class ConditionalFormattingPanel extends owl.Component {
9854
9863
  ****************************************************************************/
9855
9864
  get isValue1Invalid() {
9856
9865
  var _a;
9857
- return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(50 /* CommandResult.FirstArgMissing */));
9866
+ return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(51 /* CommandResult.FirstArgMissing */));
9858
9867
  }
9859
9868
  get isValue2Invalid() {
9860
9869
  var _a;
9861
- return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(51 /* CommandResult.SecondArgMissing */));
9870
+ return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(52 /* CommandResult.SecondArgMissing */));
9862
9871
  }
9863
9872
  toggleStyle(tool) {
9864
9873
  const style = this.state.rules.cellIs.style;
@@ -9875,17 +9884,17 @@ class ConditionalFormattingPanel extends owl.Component {
9875
9884
  isValueInvalid(threshold) {
9876
9885
  switch (threshold) {
9877
9886
  case "minimum":
9878
- return (this.state.errors.includes(57 /* CommandResult.MinInvalidFormula */) ||
9879
- this.state.errors.includes(49 /* CommandResult.MinBiggerThanMid */) ||
9880
- this.state.errors.includes(46 /* CommandResult.MinBiggerThanMax */) ||
9881
- this.state.errors.includes(52 /* CommandResult.MinNaN */));
9887
+ return (this.state.errors.includes(58 /* CommandResult.MinInvalidFormula */) ||
9888
+ this.state.errors.includes(50 /* CommandResult.MinBiggerThanMid */) ||
9889
+ this.state.errors.includes(47 /* CommandResult.MinBiggerThanMax */) ||
9890
+ this.state.errors.includes(53 /* CommandResult.MinNaN */));
9882
9891
  case "midpoint":
9883
- return (this.state.errors.includes(58 /* CommandResult.MidInvalidFormula */) ||
9884
- this.state.errors.includes(53 /* CommandResult.MidNaN */) ||
9885
- this.state.errors.includes(48 /* CommandResult.MidBiggerThanMax */));
9892
+ return (this.state.errors.includes(59 /* CommandResult.MidInvalidFormula */) ||
9893
+ this.state.errors.includes(54 /* CommandResult.MidNaN */) ||
9894
+ this.state.errors.includes(49 /* CommandResult.MidBiggerThanMax */));
9886
9895
  case "maximum":
9887
- return (this.state.errors.includes(59 /* CommandResult.MaxInvalidFormula */) ||
9888
- this.state.errors.includes(54 /* CommandResult.MaxNaN */));
9896
+ return (this.state.errors.includes(60 /* CommandResult.MaxInvalidFormula */) ||
9897
+ this.state.errors.includes(55 /* CommandResult.MaxNaN */));
9889
9898
  default:
9890
9899
  return false;
9891
9900
  }
@@ -9934,13 +9943,13 @@ class ConditionalFormattingPanel extends owl.Component {
9934
9943
  isInflectionPointInvalid(inflectionPoint) {
9935
9944
  switch (inflectionPoint) {
9936
9945
  case "lowerInflectionPoint":
9937
- return (this.state.errors.includes(56 /* CommandResult.ValueLowerInflectionNaN */) ||
9938
- this.state.errors.includes(61 /* CommandResult.ValueLowerInvalidFormula */) ||
9939
- this.state.errors.includes(47 /* CommandResult.LowerBiggerThanUpper */));
9946
+ return (this.state.errors.includes(57 /* CommandResult.ValueLowerInflectionNaN */) ||
9947
+ this.state.errors.includes(62 /* CommandResult.ValueLowerInvalidFormula */) ||
9948
+ this.state.errors.includes(48 /* CommandResult.LowerBiggerThanUpper */));
9940
9949
  case "upperInflectionPoint":
9941
- return (this.state.errors.includes(55 /* CommandResult.ValueUpperInflectionNaN */) ||
9942
- this.state.errors.includes(60 /* CommandResult.ValueUpperInvalidFormula */) ||
9943
- this.state.errors.includes(47 /* CommandResult.LowerBiggerThanUpper */));
9950
+ return (this.state.errors.includes(56 /* CommandResult.ValueUpperInflectionNaN */) ||
9951
+ this.state.errors.includes(61 /* CommandResult.ValueUpperInvalidFormula */) ||
9952
+ this.state.errors.includes(48 /* CommandResult.LowerBiggerThanUpper */));
9944
9953
  default:
9945
9954
  return true;
9946
9955
  }
@@ -19585,7 +19594,7 @@ class EditionPlugin extends UIPlugin {
19585
19594
  validateSelection(length, start, end) {
19586
19595
  return start >= 0 && start <= length && end >= 0 && end <= length
19587
19596
  ? 0 /* CommandResult.Success */
19588
- : 45 /* CommandResult.WrongComposerSelection */;
19597
+ : 46 /* CommandResult.WrongComposerSelection */;
19589
19598
  }
19590
19599
  onColumnsRemoved(cmd) {
19591
19600
  if (cmd.elements.includes(this.col) && this.mode !== "inactive") {
@@ -19869,9 +19878,10 @@ class EditionPlugin extends UIPlugin {
19869
19878
  */
19870
19879
  getReferencedRanges() {
19871
19880
  const editionSheetId = this.getters.getEditionSheet();
19872
- return this.currentTokens
19881
+ const referenceRanges = this.currentTokens
19873
19882
  .filter((token) => token.type === "REFERENCE")
19874
19883
  .map((token) => this.getters.getRangeFromSheetXC(editionSheetId, token.value));
19884
+ return referenceRanges.filter((range) => !range.invalidSheetName && !range.invalidXc);
19875
19885
  }
19876
19886
  /**
19877
19887
  * Function used to determine when composer selection can start.
@@ -27642,7 +27652,7 @@ class BordersPlugin extends CorePlugin {
27642
27652
  const currentBorder = this.getCellBorder(cmd.sheetId, cmd.col, cmd.row);
27643
27653
  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);
27644
27654
  if ((!currentBorder && areAllNewBordersUndefined) || deepEquals(currentBorder, cmd.border)) {
27645
- return 87 /* CommandResult.NoChanges */;
27655
+ return 88 /* CommandResult.NoChanges */;
27646
27656
  }
27647
27657
  return 0 /* CommandResult.Success */;
27648
27658
  }
@@ -27884,6 +27894,9 @@ class CellPlugin extends CorePlugin {
27884
27894
  format: cell.format ? getItemId(cell.format, formats) : undefined,
27885
27895
  content: cell.content || undefined,
27886
27896
  };
27897
+ if (cell.isFormula()) {
27898
+ cells[xc].content = this.buildFormulaContent(_sheet.id, cell, cell.dependencies, true);
27899
+ }
27887
27900
  }
27888
27901
  _sheet.cells = cells;
27889
27902
  }
@@ -27931,13 +27944,13 @@ class CellPlugin extends CorePlugin {
27931
27944
  /*
27932
27945
  * Reconstructs the original formula string based on a normalized form and its dependencies
27933
27946
  */
27934
- buildFormulaContent(sheetId, cell, dependencies) {
27947
+ buildFormulaContent(sheetId, cell, dependencies, useFixedZone = false) {
27935
27948
  const ranges = dependencies || cell.dependencies;
27936
27949
  let rangeIndex = 0;
27937
27950
  return concat(cell.compiledFormula.tokens.map((token) => {
27938
27951
  if (token.type === "REFERENCE") {
27939
27952
  const range = ranges[rangeIndex++];
27940
- return this.getters.getRangeString(range, sheetId);
27953
+ return this.getters.getRangeString(range, sheetId, useFixedZone);
27941
27954
  }
27942
27955
  return token.value;
27943
27956
  }));
@@ -28102,9 +28115,9 @@ class CellPlugin extends CorePlugin {
28102
28115
  checkUselessClearCell(cmd) {
28103
28116
  const cell = this.getters.getCell(cmd.sheetId, cmd.col, cmd.row);
28104
28117
  if (!cell)
28105
- return 87 /* CommandResult.NoChanges */;
28118
+ return 88 /* CommandResult.NoChanges */;
28106
28119
  if (!cell.content && !cell.style && !cell.format) {
28107
- return 87 /* CommandResult.NoChanges */;
28120
+ return 88 /* CommandResult.NoChanges */;
28108
28121
  }
28109
28122
  return 0 /* CommandResult.Success */;
28110
28123
  }
@@ -28313,13 +28326,13 @@ class ChartPlugin extends CorePlugin {
28313
28326
  }
28314
28327
  checkChartDuplicate(cmd) {
28315
28328
  return this.getters.getFigureSheetId(cmd.id)
28316
- ? 83 /* CommandResult.DuplicatedChartId */
28329
+ ? 84 /* CommandResult.DuplicatedChartId */
28317
28330
  : 0 /* CommandResult.Success */;
28318
28331
  }
28319
28332
  checkChartExists(cmd) {
28320
28333
  return this.getters.getFigureSheetId(cmd.id)
28321
28334
  ? 0 /* CommandResult.Success */
28322
- : 84 /* CommandResult.ChartDoesNotExist */;
28335
+ : 85 /* CommandResult.ChartDoesNotExist */;
28323
28336
  }
28324
28337
  }
28325
28338
  ChartPlugin.getters = [
@@ -28434,7 +28447,13 @@ class ConditionalFormatPlugin extends CorePlugin {
28434
28447
  }
28435
28448
  }
28436
28449
  exportForExcel(data) {
28437
- this.export(data);
28450
+ if (data.sheets) {
28451
+ for (let sheet of data.sheets) {
28452
+ if (this.cfRules[sheet.id]) {
28453
+ sheet.conditionalFormats = this.cfRules[sheet.id].map((rule) => this.mapToConditionalFormat(sheet.id, rule, { useFixedReference: true }));
28454
+ }
28455
+ }
28456
+ }
28438
28457
  }
28439
28458
  // ---------------------------------------------------------------------------
28440
28459
  // Getters
@@ -28484,11 +28503,11 @@ class ConditionalFormatPlugin extends CorePlugin {
28484
28503
  // ---------------------------------------------------------------------------
28485
28504
  // Private
28486
28505
  // ---------------------------------------------------------------------------
28487
- mapToConditionalFormat(sheetId, cf) {
28506
+ mapToConditionalFormat(sheetId, cf, options = { useFixedReference: false }) {
28488
28507
  return {
28489
28508
  ...cf,
28490
28509
  ranges: cf.ranges.map((range) => {
28491
- return this.getters.getRangeString(range, sheetId);
28510
+ return this.getters.getRangeString(range, sheetId, options.useFixedReference);
28492
28511
  }),
28493
28512
  };
28494
28513
  }
@@ -28521,10 +28540,10 @@ class ConditionalFormatPlugin extends CorePlugin {
28521
28540
  return 27 /* CommandResult.InvalidSheetId */;
28522
28541
  const ruleIndex = this.cfRules[sheetId].findIndex((cf) => cf.id === cfId);
28523
28542
  if (ruleIndex === -1)
28524
- return 70 /* CommandResult.InvalidConditionalFormatId */;
28543
+ return 71 /* CommandResult.InvalidConditionalFormatId */;
28525
28544
  const cfIndex2 = direction === "up" ? ruleIndex - 1 : ruleIndex + 1;
28526
28545
  if (cfIndex2 < 0 || cfIndex2 >= this.cfRules[sheetId].length) {
28527
- return 70 /* CommandResult.InvalidConditionalFormatId */;
28546
+ return 71 /* CommandResult.InvalidConditionalFormatId */;
28528
28547
  }
28529
28548
  return 0 /* CommandResult.Success */;
28530
28549
  }
@@ -28565,10 +28584,10 @@ class ConditionalFormatPlugin extends CorePlugin {
28565
28584
  const errors = [];
28566
28585
  const isEmpty = (value) => value === undefined || value === "";
28567
28586
  if (expectedNumber >= 1 && isEmpty(rule.values[0])) {
28568
- errors.push(50 /* CommandResult.FirstArgMissing */);
28587
+ errors.push(51 /* CommandResult.FirstArgMissing */);
28569
28588
  }
28570
28589
  if (expectedNumber >= 2 && isEmpty(rule.values[1])) {
28571
- errors.push(51 /* CommandResult.SecondArgMissing */);
28590
+ errors.push(52 /* CommandResult.SecondArgMissing */);
28572
28591
  }
28573
28592
  return errors.length ? errors : 0 /* CommandResult.Success */;
28574
28593
  }
@@ -28580,15 +28599,15 @@ class ConditionalFormatPlugin extends CorePlugin {
28580
28599
  (threshold.value === "" || isNaN(threshold.value))) {
28581
28600
  switch (thresholdName) {
28582
28601
  case "min":
28583
- return 52 /* CommandResult.MinNaN */;
28602
+ return 53 /* CommandResult.MinNaN */;
28584
28603
  case "max":
28585
- return 54 /* CommandResult.MaxNaN */;
28604
+ return 55 /* CommandResult.MaxNaN */;
28586
28605
  case "mid":
28587
- return 53 /* CommandResult.MidNaN */;
28606
+ return 54 /* CommandResult.MidNaN */;
28588
28607
  case "upperInflectionPoint":
28589
- return 55 /* CommandResult.ValueUpperInflectionNaN */;
28608
+ return 56 /* CommandResult.ValueUpperInflectionNaN */;
28590
28609
  case "lowerInflectionPoint":
28591
- return 56 /* CommandResult.ValueLowerInflectionNaN */;
28610
+ return 57 /* CommandResult.ValueLowerInflectionNaN */;
28592
28611
  }
28593
28612
  }
28594
28613
  return 0 /* CommandResult.Success */;
@@ -28602,15 +28621,15 @@ class ConditionalFormatPlugin extends CorePlugin {
28602
28621
  catch (error) {
28603
28622
  switch (thresholdName) {
28604
28623
  case "min":
28605
- return 57 /* CommandResult.MinInvalidFormula */;
28624
+ return 58 /* CommandResult.MinInvalidFormula */;
28606
28625
  case "max":
28607
- return 59 /* CommandResult.MaxInvalidFormula */;
28626
+ return 60 /* CommandResult.MaxInvalidFormula */;
28608
28627
  case "mid":
28609
- return 58 /* CommandResult.MidInvalidFormula */;
28628
+ return 59 /* CommandResult.MidInvalidFormula */;
28610
28629
  case "upperInflectionPoint":
28611
- return 60 /* CommandResult.ValueUpperInvalidFormula */;
28630
+ return 61 /* CommandResult.ValueUpperInvalidFormula */;
28612
28631
  case "lowerInflectionPoint":
28613
- return 61 /* CommandResult.ValueLowerInvalidFormula */;
28632
+ return 62 /* CommandResult.ValueLowerInvalidFormula */;
28614
28633
  }
28615
28634
  }
28616
28635
  return 0 /* CommandResult.Success */;
@@ -28627,7 +28646,7 @@ class ConditionalFormatPlugin extends CorePlugin {
28627
28646
  if (["number", "percentage", "percentile"].includes(rule.lowerInflectionPoint.type) &&
28628
28647
  rule.lowerInflectionPoint.type === rule.upperInflectionPoint.type &&
28629
28648
  Number(minValue) > Number(maxValue)) {
28630
- return 47 /* CommandResult.LowerBiggerThanUpper */;
28649
+ return 48 /* CommandResult.LowerBiggerThanUpper */;
28631
28650
  }
28632
28651
  return 0 /* CommandResult.Success */;
28633
28652
  }
@@ -28637,7 +28656,7 @@ class ConditionalFormatPlugin extends CorePlugin {
28637
28656
  if (["number", "percentage", "percentile"].includes(rule.minimum.type) &&
28638
28657
  rule.minimum.type === rule.maximum.type &&
28639
28658
  stringToNumber(minValue) >= stringToNumber(maxValue)) {
28640
- return 46 /* CommandResult.MinBiggerThanMax */;
28659
+ return 47 /* CommandResult.MinBiggerThanMax */;
28641
28660
  }
28642
28661
  return 0 /* CommandResult.Success */;
28643
28662
  }
@@ -28649,7 +28668,7 @@ class ConditionalFormatPlugin extends CorePlugin {
28649
28668
  ["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
28650
28669
  rule.midpoint.type === rule.maximum.type &&
28651
28670
  stringToNumber(midValue) >= stringToNumber(maxValue)) {
28652
- return 48 /* CommandResult.MidBiggerThanMax */;
28671
+ return 49 /* CommandResult.MidBiggerThanMax */;
28653
28672
  }
28654
28673
  return 0 /* CommandResult.Success */;
28655
28674
  }
@@ -28661,7 +28680,7 @@ class ConditionalFormatPlugin extends CorePlugin {
28661
28680
  ["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
28662
28681
  rule.minimum.type === rule.midpoint.type &&
28663
28682
  stringToNumber(minValue) >= stringToNumber(midValue)) {
28664
- return 49 /* CommandResult.MinBiggerThanMid */;
28683
+ return 50 /* CommandResult.MinBiggerThanMid */;
28665
28684
  }
28666
28685
  return 0 /* CommandResult.Success */;
28667
28686
  }
@@ -28762,13 +28781,13 @@ class FigurePlugin extends CorePlugin {
28762
28781
  checkFigureExists(sheetId, figureId) {
28763
28782
  var _a;
28764
28783
  if (((_a = this.figures[sheetId]) === null || _a === void 0 ? void 0 : _a[figureId]) === undefined) {
28765
- return 69 /* CommandResult.FigureDoesNotExist */;
28784
+ return 70 /* CommandResult.FigureDoesNotExist */;
28766
28785
  }
28767
28786
  return 0 /* CommandResult.Success */;
28768
28787
  }
28769
28788
  checkFigureDuplicate(figureId) {
28770
28789
  if (Object.values(this.figures).find((sheet) => sheet === null || sheet === void 0 ? void 0 : sheet[figureId])) {
28771
- return 81 /* CommandResult.DuplicatedFigureId */;
28790
+ return 82 /* CommandResult.DuplicatedFigureId */;
28772
28791
  }
28773
28792
  return 0 /* CommandResult.Success */;
28774
28793
  }
@@ -28870,12 +28889,12 @@ class FiltersPlugin extends CorePlugin {
28870
28889
  switch (cmd.type) {
28871
28890
  case "CREATE_FILTER_TABLE":
28872
28891
  if (!areZonesContinuous(...cmd.target)) {
28873
- return 80 /* CommandResult.NonContinuousTargets */;
28892
+ return 81 /* CommandResult.NonContinuousTargets */;
28874
28893
  }
28875
28894
  const zone = union(...cmd.target);
28876
28895
  const checkFilterOverlap = () => {
28877
28896
  if (this.getFilterTables(cmd.sheetId).some((filter) => overlap(filter.zone, zone))) {
28878
- return 77 /* CommandResult.FilterOverlap */;
28897
+ return 78 /* CommandResult.FilterOverlap */;
28879
28898
  }
28880
28899
  return 0 /* CommandResult.Success */;
28881
28900
  };
@@ -28883,7 +28902,7 @@ class FiltersPlugin extends CorePlugin {
28883
28902
  const mergesInTarget = this.getters.getMergesInZone(cmd.sheetId, zone);
28884
28903
  for (let merge of mergesInTarget) {
28885
28904
  if (overlap(zone, merge)) {
28886
- return 79 /* CommandResult.MergeInFilter */;
28905
+ return 80 /* CommandResult.MergeInFilter */;
28887
28906
  }
28888
28907
  }
28889
28908
  return 0 /* CommandResult.Success */;
@@ -28893,7 +28912,7 @@ class FiltersPlugin extends CorePlugin {
28893
28912
  for (let merge of cmd.target) {
28894
28913
  for (let filterTable of this.getFilterTables(cmd.sheetId)) {
28895
28914
  if (overlap(filterTable.zone, merge)) {
28896
- return 79 /* CommandResult.MergeInFilter */;
28915
+ return 80 /* CommandResult.MergeInFilter */;
28897
28916
  }
28898
28917
  }
28899
28918
  }
@@ -29393,10 +29412,10 @@ class HeaderVisibilityPlugin extends CorePlugin {
29393
29412
  : this.getters.getNumberRows(cmd.sheetId);
29394
29413
  const hiddenElements = new Set((hiddenGroup || []).flat().concat(cmd.elements));
29395
29414
  if (hiddenElements.size >= elements) {
29396
- return 65 /* CommandResult.TooManyHiddenElements */;
29415
+ return 66 /* CommandResult.TooManyHiddenElements */;
29397
29416
  }
29398
29417
  else if (Math.min(...cmd.elements) < 0 || Math.max(...cmd.elements) > elements) {
29399
- return 85 /* CommandResult.InvalidHeaderIndex */;
29418
+ return 86 /* CommandResult.InvalidHeaderIndex */;
29400
29419
  }
29401
29420
  else {
29402
29421
  return 0 /* CommandResult.Success */;
@@ -29799,7 +29818,7 @@ class MergePlugin extends CorePlugin {
29799
29818
  for (const zone of target) {
29800
29819
  for (const zone2 of target) {
29801
29820
  if (zone !== zone2 && overlap(zone, zone2)) {
29802
- return 64 /* CommandResult.MergeOverlap */;
29821
+ return 65 /* CommandResult.MergeOverlap */;
29803
29822
  }
29804
29823
  }
29805
29824
  }
@@ -29813,7 +29832,7 @@ class MergePlugin extends CorePlugin {
29813
29832
  for (const zone of target) {
29814
29833
  if ((zone.left < xSplit && zone.right >= xSplit) ||
29815
29834
  (zone.top < ySplit && zone.bottom >= ySplit)) {
29816
- return 74 /* CommandResult.FrozenPaneOverlap */;
29835
+ return 75 /* CommandResult.FrozenPaneOverlap */;
29817
29836
  }
29818
29837
  }
29819
29838
  return 0 /* CommandResult.Success */;
@@ -30060,10 +30079,10 @@ class SheetPlugin extends CorePlugin {
30060
30079
  ? this.getNumberCols(cmd.sheetId)
30061
30080
  : this.getNumberRows(cmd.sheetId);
30062
30081
  if (cmd.base < 0 || cmd.base >= elements) {
30063
- return 85 /* CommandResult.InvalidHeaderIndex */;
30082
+ return 86 /* CommandResult.InvalidHeaderIndex */;
30064
30083
  }
30065
30084
  else if (cmd.quantity <= 0) {
30066
- return 86 /* CommandResult.InvalidQuantity */;
30085
+ return 87 /* CommandResult.InvalidQuantity */;
30067
30086
  }
30068
30087
  return 0 /* CommandResult.Success */;
30069
30088
  case "REMOVE_COLUMNS_ROWS": {
@@ -30071,7 +30090,7 @@ class SheetPlugin extends CorePlugin {
30071
30090
  ? this.getNumberCols(cmd.sheetId)
30072
30091
  : this.getNumberRows(cmd.sheetId);
30073
30092
  if (Math.min(...cmd.elements) < 0 || Math.max(...cmd.elements) > elements) {
30074
- return 85 /* CommandResult.InvalidHeaderIndex */;
30093
+ return 86 /* CommandResult.InvalidHeaderIndex */;
30075
30094
  }
30076
30095
  else if (this.checkElementsIncludeAllNonFrozenHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) {
30077
30096
  return 8 /* CommandResult.NotEnoughElements */;
@@ -30528,18 +30547,18 @@ class SheetPlugin extends CorePlugin {
30528
30547
  checkRowFreezeQuantity(cmd) {
30529
30548
  return cmd.quantity >= 1 && cmd.quantity < this.getNumberRows(cmd.sheetId)
30530
30549
  ? 0 /* CommandResult.Success */
30531
- : 73 /* CommandResult.InvalidFreezeQuantity */;
30550
+ : 74 /* CommandResult.InvalidFreezeQuantity */;
30532
30551
  }
30533
30552
  checkColFreezeQuantity(cmd) {
30534
30553
  return cmd.quantity >= 1 && cmd.quantity < this.getNumberCols(cmd.sheetId)
30535
30554
  ? 0 /* CommandResult.Success */
30536
- : 73 /* CommandResult.InvalidFreezeQuantity */;
30555
+ : 74 /* CommandResult.InvalidFreezeQuantity */;
30537
30556
  }
30538
30557
  checkRowFreezeOverlapMerge(cmd) {
30539
30558
  const merges = this.getters.getMerges(cmd.sheetId);
30540
30559
  for (let merge of merges) {
30541
30560
  if (merge.top < cmd.quantity && cmd.quantity <= merge.bottom) {
30542
- return 64 /* CommandResult.MergeOverlap */;
30561
+ return 65 /* CommandResult.MergeOverlap */;
30543
30562
  }
30544
30563
  }
30545
30564
  return 0 /* CommandResult.Success */;
@@ -30548,7 +30567,7 @@ class SheetPlugin extends CorePlugin {
30548
30567
  const merges = this.getters.getMerges(cmd.sheetId);
30549
30568
  for (let merge of merges) {
30550
30569
  if (merge.left < cmd.quantity && cmd.quantity <= merge.right) {
30551
- return 64 /* CommandResult.MergeOverlap */;
30570
+ return 65 /* CommandResult.MergeOverlap */;
30552
30571
  }
30553
30572
  }
30554
30573
  return 0 /* CommandResult.Success */;
@@ -30989,7 +31008,7 @@ class AutofillPlugin extends UIPlugin {
30989
31008
  if (this.lastCellSelected.col !== undefined && this.lastCellSelected.row !== undefined) {
30990
31009
  return 0 /* CommandResult.Success */;
30991
31010
  }
30992
- return 44 /* CommandResult.InvalidAutofillSelection */;
31011
+ return 45 /* CommandResult.InvalidAutofillSelection */;
30993
31012
  case "AUTOFILL_AUTO":
30994
31013
  const zone = this.getters.getSelectedZone();
30995
31014
  return zone.top === zone.bottom
@@ -31589,7 +31608,7 @@ class CellPopoverPlugin extends UIPlugin {
31589
31608
  cellPopoverRegistry.get(cmd.popoverType);
31590
31609
  }
31591
31610
  catch (error) {
31592
- return 71 /* CommandResult.InvalidCellPopover */;
31611
+ return 72 /* CommandResult.InvalidCellPopover */;
31593
31612
  }
31594
31613
  return 0 /* CommandResult.Success */;
31595
31614
  default:
@@ -31813,7 +31832,7 @@ class ClipboardCellsState extends ClipboardCellsAbstractState {
31813
31832
  for (const zone of this.getPasteZones(target)) {
31814
31833
  if ((zone.left < xSplit && zone.right >= xSplit) ||
31815
31834
  (zone.top < ySplit && zone.bottom >= ySplit)) {
31816
- return 74 /* CommandResult.FrozenPaneOverlap */;
31835
+ return 75 /* CommandResult.FrozenPaneOverlap */;
31817
31836
  }
31818
31837
  }
31819
31838
  return 0 /* CommandResult.Success */;
@@ -32173,7 +32192,7 @@ class ClipboardFigureState {
32173
32192
  }
32174
32193
  isPasteAllowed(target, option) {
32175
32194
  if (target.length === 0) {
32176
- return 72 /* CommandResult.EmptyTarget */;
32195
+ return 73 /* CommandResult.EmptyTarget */;
32177
32196
  }
32178
32197
  if ((option === null || option === void 0 ? void 0 : option.pasteOption) !== undefined) {
32179
32198
  return 22 /* CommandResult.WrongFigurePasteOption */;
@@ -32817,10 +32836,8 @@ class EvaluationPlugin extends UIPlugin {
32817
32836
  * that are actually present in the grid.
32818
32837
  */
32819
32838
  function range(range) {
32839
+ assertRangeValid(range);
32820
32840
  const sheetId = range.sheetId;
32821
- if (!isZoneValid(range.zone)) {
32822
- throw new InvalidReferenceError();
32823
- }
32824
32841
  // Performance issue: Avoid fetching data on positions that are out of the spreadsheet
32825
32842
  // e.g. A1:ZZZ9999 in a sheet with 10 cols and 10 rows should ignore everything past J10 and return a 10x10 array
32826
32843
  const sheetZone = getters.getSheetZone(sheetId);
@@ -32855,23 +32872,26 @@ class EvaluationPlugin extends UIPlugin {
32855
32872
  * The `compute` of the formula's function must process it completely
32856
32873
  */
32857
32874
  function refFn(range, isMeta, functionName, paramNumber) {
32875
+ assertRangeValid(range);
32858
32876
  if (isMeta) {
32859
32877
  // Use zoneToXc of zone instead of getRangeString to avoid sending unbounded ranges
32860
32878
  return { value: zoneToXc(range.zone) };
32861
32879
  }
32862
- if (!isZoneValid(range.zone)) {
32863
- throw new InvalidReferenceError();
32864
- }
32865
32880
  // if the formula definition could have accepted a range, we would pass through the _range function and not here
32866
32881
  if (range.zone.bottom !== range.zone.top || range.zone.left !== range.zone.right) {
32867
32882
  throw new Error(paramNumber
32868
32883
  ? _lt("Function %s expects the parameter %s to be a single value or a single cell reference, not a range.", functionName.toString(), paramNumber.toString())
32869
32884
  : _lt("Function %s expects its parameters to be single values or single cell references, not ranges.", functionName.toString()));
32870
32885
  }
32886
+ return readCell(range);
32887
+ }
32888
+ function assertRangeValid(range) {
32889
+ if (!isZoneValid(range.zone)) {
32890
+ throw new InvalidReferenceError();
32891
+ }
32871
32892
  if (range.invalidSheetName) {
32872
32893
  throw new Error(_lt("Invalid sheet name: %s", range.invalidSheetName));
32873
32894
  }
32874
- return readCell(range);
32875
32895
  }
32876
32896
  return [refFn, range, evalContext];
32877
32897
  }
@@ -33335,7 +33355,7 @@ class FilterEvaluationPlugin extends UIPlugin {
33335
33355
  switch (cmd.type) {
33336
33356
  case "UPDATE_FILTER":
33337
33357
  if (!this.getters.getFilterId(cmd.sheetId, cmd.col, cmd.row)) {
33338
- return 78 /* CommandResult.FilterNotFound */;
33358
+ return 79 /* CommandResult.FilterNotFound */;
33339
33359
  }
33340
33360
  break;
33341
33361
  }
@@ -35155,7 +35175,7 @@ class GridSelectionPlugin extends UIPlugin {
35155
35175
  const headers = [cmd.base, ...cmd.elements];
35156
35176
  const maxHeaderValue = isCol ? this.getters.getNumberCols(id) : this.getters.getNumberRows(id);
35157
35177
  if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
35158
- return 85 /* CommandResult.InvalidHeaderIndex */;
35178
+ return 86 /* CommandResult.InvalidHeaderIndex */;
35159
35179
  }
35160
35180
  return 0 /* CommandResult.Success */;
35161
35181
  }
@@ -35286,21 +35306,6 @@ class SelectionInputPlugin extends UIPlugin {
35286
35306
  // ---------------------------------------------------------------------------
35287
35307
  // Command Handling
35288
35308
  // ---------------------------------------------------------------------------
35289
- allowDispatch(cmd) {
35290
- switch (cmd.type) {
35291
- case "ADD_EMPTY_RANGE":
35292
- if (this.inputHasSingleRange && this.ranges.length === 1) {
35293
- return 29 /* CommandResult.MaximumRangesReached */;
35294
- }
35295
- break;
35296
- case "CHANGE_RANGE":
35297
- if (this.inputHasSingleRange && cmd.value.split(",").length > 1) {
35298
- return 29 /* CommandResult.MaximumRangesReached */;
35299
- }
35300
- break;
35301
- }
35302
- return 0 /* CommandResult.Success */;
35303
- }
35304
35309
  handleEvent(event) {
35305
35310
  const xc = zoneToXc(event.anchor.zone);
35306
35311
  const inputSheetId = this.activeSheet;
@@ -35510,6 +35515,15 @@ class SelectionInputsManagerPlugin extends UIPlugin {
35510
35515
  // ---------------------------------------------------------------------------
35511
35516
  allowDispatch(cmd) {
35512
35517
  var _a, _b;
35518
+ switch (cmd.type) {
35519
+ case "FOCUS_RANGE":
35520
+ case "CHANGE_RANGE":
35521
+ case "ADD_EMPTY_RANGE":
35522
+ case "REMOVE_RANGE":
35523
+ if (!this.inputs[cmd.id]) {
35524
+ return 30 /* CommandResult.InvalidInputId */;
35525
+ }
35526
+ }
35513
35527
  switch (cmd.type) {
35514
35528
  case "FOCUS_RANGE":
35515
35529
  const index = (_a = this.currentInput) === null || _a === void 0 ? void 0 : _a.getIndex(cmd.rangeId);
@@ -35517,9 +35531,19 @@ class SelectionInputsManagerPlugin extends UIPlugin {
35517
35531
  return 28 /* CommandResult.InputAlreadyFocused */;
35518
35532
  }
35519
35533
  break;
35520
- }
35521
- if (this.currentInput) {
35522
- return this.currentInput.allowDispatch(cmd);
35534
+ case "ADD_EMPTY_RANGE":
35535
+ const input = this.inputs[cmd.id];
35536
+ if (input.inputHasSingleRange && input.ranges.length === 1) {
35537
+ return 29 /* CommandResult.MaximumRangesReached */;
35538
+ }
35539
+ break;
35540
+ case "CHANGE_RANGE": {
35541
+ const input = this.inputs[cmd.id];
35542
+ if (input.inputHasSingleRange && cmd.value.split(",").length > 1) {
35543
+ return 29 /* CommandResult.MaximumRangesReached */;
35544
+ }
35545
+ break;
35546
+ }
35523
35547
  }
35524
35548
  return 0 /* CommandResult.Success */;
35525
35549
  }
@@ -37174,7 +37198,7 @@ class SheetViewPlugin extends UIPlugin {
37174
37198
  }
37175
37199
  checkPositiveDimension(cmd) {
37176
37200
  if (cmd.width < 0 || cmd.height < 0) {
37177
- return 67 /* CommandResult.InvalidViewportSize */;
37201
+ return 68 /* CommandResult.InvalidViewportSize */;
37178
37202
  }
37179
37203
  return 0 /* CommandResult.Success */;
37180
37204
  }
@@ -37184,7 +37208,7 @@ class SheetViewPlugin extends UIPlugin {
37184
37208
  cmd.gridOffsetY === this.gridOffsetY &&
37185
37209
  cmd.width === width &&
37186
37210
  cmd.height === height) {
37187
- return 75 /* CommandResult.ValuesNotChanged */;
37211
+ return 76 /* CommandResult.ValuesNotChanged */;
37188
37212
  }
37189
37213
  return 0 /* CommandResult.Success */;
37190
37214
  }
@@ -37192,7 +37216,7 @@ class SheetViewPlugin extends UIPlugin {
37192
37216
  const pane = this.getMainInternalViewport(this.getters.getActiveSheetId());
37193
37217
  if ((!pane.canScrollHorizontally && offsetX > 0) ||
37194
37218
  (!pane.canScrollVertically && offsetY > 0)) {
37195
- return 68 /* CommandResult.InvalidScrollingDirection */;
37219
+ return 69 /* CommandResult.InvalidScrollingDirection */;
37196
37220
  }
37197
37221
  return 0 /* CommandResult.Success */;
37198
37222
  }
@@ -37394,7 +37418,7 @@ class SortPlugin extends UIPlugin {
37394
37418
  for (let row = zone.top; row <= zone.bottom; row++) {
37395
37419
  for (let col = zone.left; col <= zone.right; col++) {
37396
37420
  if (!this.getters.isInMerge(sheetId, col, row)) {
37397
- return 62 /* CommandResult.InvalidSortZone */;
37421
+ return 63 /* CommandResult.InvalidSortZone */;
37398
37422
  }
37399
37423
  }
37400
37424
  }
@@ -37415,7 +37439,7 @@ class SortPlugin extends UIPlugin {
37415
37439
  ];
37416
37440
  return widthCurrent === widthFirst && heightCurrent === heightFirst;
37417
37441
  })) {
37418
- return 62 /* CommandResult.InvalidSortZone */;
37442
+ return 63 /* CommandResult.InvalidSortZone */;
37419
37443
  }
37420
37444
  return 0 /* CommandResult.Success */;
37421
37445
  }
@@ -38559,7 +38583,7 @@ const AddMergeInteractiveContent = {
38559
38583
  };
38560
38584
  function interactiveAddMerge(env, sheetId, target) {
38561
38585
  const result = env.model.dispatch("ADD_MERGE", { sheetId, target });
38562
- if (result.isCancelledBecause(79 /* CommandResult.MergeInFilter */)) {
38586
+ if (result.isCancelledBecause(80 /* CommandResult.MergeInFilter */)) {
38563
38587
  env.raiseError(AddMergeInteractiveContent.MergeInFilter);
38564
38588
  }
38565
38589
  else if (result.isCancelledBecause(3 /* CommandResult.MergeIsDestructive */)) {
@@ -40458,8 +40482,9 @@ class RangeAdapter {
40458
40482
  *
40459
40483
  * @param range the range (received from getRangeFromXC or getRangeFromZone)
40460
40484
  * @param forSheetId the id of the sheet where the range string is supposed to be used.
40485
+ * @param [useFixedZone=false] if true, the range will be returned with fixed row and column
40461
40486
  */
40462
- getRangeString(range, forSheetId) {
40487
+ getRangeString(range, forSheetId, useFixedZone = false) {
40463
40488
  if (!range) {
40464
40489
  return INCORRECT_RANGE_STRING;
40465
40490
  }
@@ -40486,7 +40511,7 @@ class RangeAdapter {
40486
40511
  if (prefixSheet && !sheetName) {
40487
40512
  return INCORRECT_RANGE_STRING;
40488
40513
  }
40489
- let rangeString = this.getRangePartString(rangeImpl, 0);
40514
+ let rangeString = this.getRangePartString(rangeImpl, 0, useFixedZone);
40490
40515
  if (rangeImpl.parts && rangeImpl.parts.length === 2) {
40491
40516
  // this if converts A2:A2 into A2 except if any part of the original range had fixed row or column (with $)
40492
40517
  if (rangeImpl.zone.top !== rangeImpl.zone.bottom ||
@@ -40496,7 +40521,7 @@ class RangeAdapter {
40496
40521
  rangeImpl.parts[1].rowFixed ||
40497
40522
  rangeImpl.parts[1].colFixed) {
40498
40523
  rangeString += ":";
40499
- rangeString += this.getRangePartString(rangeImpl, 1);
40524
+ rangeString += this.getRangePartString(rangeImpl, 1, useFixedZone);
40500
40525
  }
40501
40526
  }
40502
40527
  return `${prefixSheet ? sheetName + "!" : ""}${rangeString}`;
@@ -40526,14 +40551,14 @@ class RangeAdapter {
40526
40551
  /**
40527
40552
  * Get a Xc string that represent a part of a range
40528
40553
  */
40529
- getRangePartString(range, part) {
40554
+ getRangePartString(range, part, useFixedZone = false) {
40530
40555
  var _a, _b;
40531
40556
  const colFixed = range.parts && ((_a = range.parts[part]) === null || _a === void 0 ? void 0 : _a.colFixed) ? "$" : "";
40532
40557
  const col = part === 0 ? numberToLetters(range.zone.left) : numberToLetters(range.zone.right);
40533
40558
  const rowFixed = range.parts && ((_b = range.parts[part]) === null || _b === void 0 ? void 0 : _b.rowFixed) ? "$" : "";
40534
40559
  const row = part === 0 ? String(range.zone.top + 1) : String(range.zone.bottom + 1);
40535
40560
  let str = "";
40536
- if (range.isFullCol) {
40561
+ if (range.isFullCol && !useFixedZone) {
40537
40562
  if (part === 0 && range.unboundedZone.hasHeader) {
40538
40563
  str = colFixed + col + rowFixed + row;
40539
40564
  }
@@ -40541,7 +40566,7 @@ class RangeAdapter {
40541
40566
  str = colFixed + col;
40542
40567
  }
40543
40568
  }
40544
- else if (range.isFullRow) {
40569
+ else if (range.isFullRow && !useFixedZone) {
40545
40570
  if (part === 0 && range.unboundedZone.hasHeader) {
40546
40571
  str = colFixed + col + rowFixed + row;
40547
40572
  }
@@ -40742,7 +40767,7 @@ class SelectionStreamProcessor {
40742
40767
  */
40743
40768
  moveAnchorCell(direction, step = 1) {
40744
40769
  if (step !== "end" && step <= 0) {
40745
- return new DispatchResult(82 /* CommandResult.InvalidSelectionStep */);
40770
+ return new DispatchResult(83 /* CommandResult.InvalidSelectionStep */);
40746
40771
  }
40747
40772
  const { col, row } = this.getNextAvailablePosition(direction, step);
40748
40773
  return this.selectCell(col, row);
@@ -40788,7 +40813,7 @@ class SelectionStreamProcessor {
40788
40813
  */
40789
40814
  resizeAnchorZone(direction, step = 1) {
40790
40815
  if (step !== "end" && step <= 0) {
40791
- return new DispatchResult(82 /* CommandResult.InvalidSelectionStep */);
40816
+ return new DispatchResult(83 /* CommandResult.InvalidSelectionStep */);
40792
40817
  }
40793
40818
  const sheetId = this.getters.getActiveSheetId();
40794
40819
  const anchor = this.anchor;
@@ -41599,12 +41624,7 @@ function addFormula(cell) {
41599
41624
  attrs.push(["t", "str"]);
41600
41625
  cycle = escapeXml /*xml*/ `<v>${cell.value}</v>`;
41601
41626
  }
41602
- node = escapeXml /*xml*/ `
41603
- <f>
41604
- ${XlsxFormula}
41605
- </f>
41606
- ${cycle}
41607
- `;
41627
+ node = escapeXml /*xml*/ `<f> ${XlsxFormula} </f> ${cycle}`;
41608
41628
  return { attrs, node };
41609
41629
  }
41610
41630
  else {
@@ -42345,11 +42365,10 @@ function addRows(construct, data, sheet) {
42345
42365
  ({ attrs: additionalAttrs, node: cellNode } = addContent(cell.content, construct.sharedStrings, isTableHeader));
42346
42366
  }
42347
42367
  attributes.push(...additionalAttrs);
42348
- cellNodes.push(escapeXml /*xml*/ `
42349
- <c ${formatAttributes(attributes)}>
42350
- ${cellNode}
42351
- </c>
42352
- `);
42368
+ // prettier-ignore
42369
+ cellNodes.push(escapeXml /*xml*/ `<c ${formatAttributes(attributes)}>
42370
+ ${cellNode}
42371
+ </c>`);
42353
42372
  }
42354
42373
  }
42355
42374
  if (cellNodes.length || row.size !== DEFAULT_CELL_HEIGHT || row.isHidden) {
@@ -42728,10 +42747,10 @@ class Model extends EventBus {
42728
42747
  const command = { type, ...payload };
42729
42748
  let status = this.status;
42730
42749
  if (this.getters.isReadonly() && !canExecuteInReadonly(command)) {
42731
- return new DispatchResult(66 /* CommandResult.Readonly */);
42750
+ return new DispatchResult(67 /* CommandResult.Readonly */);
42732
42751
  }
42733
42752
  if (!this.session.canApplyOptimisticUpdate()) {
42734
- return new DispatchResult(63 /* CommandResult.WaitingSessionConfirmation */);
42753
+ return new DispatchResult(64 /* CommandResult.WaitingSessionConfirmation */);
42735
42754
  }
42736
42755
  switch (status) {
42737
42756
  case 0 /* Status.Ready */:
@@ -43171,6 +43190,6 @@ exports.setTranslationMethod = setTranslationMethod;
43171
43190
  exports.tokenize = tokenize;
43172
43191
 
43173
43192
 
43174
- __info__.version = '16.0.29';
43175
- __info__.date = '2024-01-17T10:24:52.885Z';
43176
- __info__.hash = '3fda985';
43193
+ __info__.version = '16.0.30';
43194
+ __info__.date = '2024-01-29T13:49:32.243Z';
43195
+ __info__.hash = '49966d6';