@odoo/o-spreadsheet 19.3.11 → 19.3.12

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.
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 19.3.11
6
- * @date 2026-07-13T06:26:28.422Z
7
- * @hash 35c06d3
5
+ * @version 19.3.12
6
+ * @date 2026-07-20T11:02:44.416Z
7
+ * @hash 2b42707
8
8
  */
9
9
 
10
10
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
@@ -5568,7 +5568,7 @@ function getRangeString(range, forSheetId, getSheetName, options = {
5568
5568
  if (prefixSheet && !sheetName) return CellErrorType.InvalidReference;
5569
5569
  let rangeString = getRangePartString(range, 0, options);
5570
5570
  if (range.parts && range.parts.length === 2) {
5571
- if (range.zone.top !== range.zone.bottom || range.zone.left !== range.zone.right || range.parts[0].rowFixed || range.parts[0].colFixed || range.parts[1].rowFixed || range.parts[1].colFixed) {
5571
+ if (range.zone.top !== range.zone.bottom || range.zone.left !== range.zone.right || range.parts[0].rowFixed || range.parts[0].colFixed || range.parts[1].rowFixed || range.parts[1].colFixed || options.doNotSimplifyRange) {
5572
5572
  rangeString += ":";
5573
5573
  rangeString += getRangePartString(range, 1, options);
5574
5574
  }
@@ -6290,6 +6290,11 @@ var CompiledFormula = class CompiledFormula {
6290
6290
  const params = compileTokens(rangeTokenize(formula));
6291
6291
  return new CompiledFormula(sheetId, params.tokens, params.literalValues, params.symbols, params.dependencies.map((xc) => getters.getRangeFromSheetXC(sheetId, xc)), params.isBadExpression, params.normalizedFormula, params.execute);
6292
6292
  }
6293
+ areRangeShapesInLineWithNormalizedFormula() {
6294
+ return Array.from(this.normalizedFormula.matchAll(/\|C\||\|R\|/g)).every((value, index) => {
6295
+ return this.rangeDependencies[index].parts.length === 1 && value[0] === "|C|" || this.rangeDependencies[index].parts.length === 2 && value[0] === "|R|" || this.rangeDependencies[index].invalidXc || this.rangeDependencies[index].invalidSheetName;
6296
+ });
6297
+ }
6293
6298
  };
6294
6299
  function compileTokens(tokens) {
6295
6300
  try {
@@ -33915,7 +33920,7 @@ var ScorecardChartConfigPanel = class extends _odoo_owl.Component {
33915
33920
  return !!this.state.keyValueDispatchResult?.isCancelledBecause("InvalidScorecardKeyValue");
33916
33921
  }
33917
33922
  get isBaselineInvalid() {
33918
- return !!this.state.keyValueDispatchResult?.isCancelledBecause("InvalidScorecardBaseline");
33923
+ return !!this.state.baselineDispatchResult?.isCancelledBecause("InvalidScorecardBaseline");
33919
33924
  }
33920
33925
  onKeyValueRangeChanged(ranges) {
33921
33926
  this.keyValue = ranges[0];
@@ -49718,6 +49723,7 @@ var Squisher = class {
49718
49723
  alreadyAppliedNumberOffsets = [];
49719
49724
  previousStrings = [];
49720
49725
  baseFormulaWasTransformed = false;
49726
+ rangeToStringOptions = { doNotSimplifyRange: true };
49721
49727
  baseNumber = void 0;
49722
49728
  constructor(getters) {
49723
49729
  this.getters = getters;
@@ -49773,9 +49779,9 @@ var Squisher = class {
49773
49779
  let references = [];
49774
49780
  if (!this.baseFormula || this.baseFormula.normalizedFormula !== cell.compiledFormula.normalizedFormula) {
49775
49781
  this.resetBaseTo(cell.compiledFormula);
49776
- return cell.compiledFormula.toFormulaString(this.getters);
49782
+ return cell.compiledFormula.toFormulaString(this.getters, this.rangeToStringOptions);
49777
49783
  } else {
49778
- if (!this.baseFormulaWasTransformed && deepEquals(cell.compiledFormula.literalValues, this.baseFormula.literalValues) && deepEquals(cell.compiledFormula.rangeDependencies, this.baseFormula.rangeDependencies)) return cell.compiledFormula.toFormulaString(this.getters);
49784
+ if (!this.baseFormulaWasTransformed && deepEquals(cell.compiledFormula.literalValues, this.baseFormula.literalValues) && deepEquals(cell.compiledFormula.rangeDependencies, this.baseFormula.rangeDependencies)) return cell.compiledFormula.toFormulaString(this.getters, this.rangeToStringOptions);
49779
49785
  numbers = this.squishNumbers(cell.compiledFormula.literalValues.numbers);
49780
49786
  strings = this.squishStrings(cell.compiledFormula.literalValues.strings);
49781
49787
  references = this.squishReferences(cell.compiledFormula.rangeDependencies, forSheetId);
@@ -49852,23 +49858,23 @@ var Squisher = class {
49852
49858
  squishOneReference(reference, previousReferences, index, forSheetId) {
49853
49859
  const previousReference = previousReferences[index];
49854
49860
  if (deepEquals(previousReference, reference)) return "=";
49855
- if (previousReference.sheetId !== reference.sheetId || previousReference.prefixSheet !== reference.prefixSheet || previousReference.invalidSheetName !== reference.invalidSheetName || previousReference.invalidXc !== reference.invalidXc) {
49861
+ if (previousReference.sheetId !== reference.sheetId || previousReference.prefixSheet !== reference.prefixSheet || previousReference.invalidSheetName !== reference.invalidSheetName || previousReference.invalidXc !== reference.invalidXc || previousReference.parts.length !== reference.parts.length) {
49856
49862
  previousReferences[index] = deepCopy(reference);
49857
- return getRangeString(reference, forSheetId, this.getters.getSheetName);
49863
+ return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
49858
49864
  }
49859
49865
  if (previousReference.unboundedZone.bottom === void 0 || previousReference.unboundedZone.right === void 0 || reference.unboundedZone.bottom === void 0 || reference.unboundedZone.right === void 0) {
49860
49866
  previousReferences[index] = deepCopy(reference);
49861
- return getRangeString(reference, forSheetId, this.getters.getSheetName);
49867
+ return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
49862
49868
  }
49863
49869
  for (let i = 0; i < reference.parts.length; i++) if (previousReference.parts[i].colFixed !== reference.parts[i].colFixed || previousReference.parts[i].rowFixed !== reference.parts[i].rowFixed) {
49864
49870
  previousReferences[index] = deepCopy(reference);
49865
- return getRangeString(reference, forSheetId, this.getters.getSheetName);
49871
+ return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
49866
49872
  }
49867
49873
  const currentZone = reference.zone;
49868
49874
  const previousZone = previousReference.zone;
49869
49875
  if (currentZone.top !== currentZone.bottom || currentZone.left !== currentZone.right || previousZone.top !== previousZone.bottom || previousZone.left !== previousZone.right) {
49870
49876
  previousReferences[index] = deepCopy(reference);
49871
- return getRangeString(reference, forSheetId, this.getters.getSheetName);
49877
+ return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
49872
49878
  }
49873
49879
  const diffCol = reference.zone.left - previousReference.zone.left;
49874
49880
  const diffRow = reference.zone.top - previousReference.zone.top;
@@ -49876,7 +49882,7 @@ var Squisher = class {
49876
49882
  previousReference.unboundedZone = deepCopy(reference.unboundedZone);
49877
49883
  if (diffCol !== 0 && diffRow === 0) return `${diffCol > 0 ? "+" : "-"}C${Math.abs(diffCol)}`;
49878
49884
  else if (diffRow !== 0 && diffCol === 0) return `${diffRow > 0 ? "+" : "-"}R${Math.abs(diffRow)}`;
49879
- return getRangeString(reference, forSheetId, this.getters.getSheetName);
49885
+ return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
49880
49886
  }
49881
49887
  /**
49882
49888
  * Squish the number parameters. Result for each parameter should be compared the previous formula.
@@ -50085,10 +50091,19 @@ var Unsquisher = class {
50085
50091
  case "FIRST_OFFSET": {
50086
50092
  const currentOffset = current;
50087
50093
  this.previousOffset = currentOffset;
50088
- for (const position of targetPositions) yield {
50089
- position,
50090
- compiled: this.unsquishFormula(currentOffset, sheetId, getters)
50091
- };
50094
+ for (const position of targetPositions) {
50095
+ const result = this.unsquishFormula(currentOffset, sheetId, getters);
50096
+ if (!result.areRangeShapesInLineWithNormalizedFormula()) {
50097
+ const formulaString = result.toFormulaString(getters);
50098
+ yield {
50099
+ position,
50100
+ compiled: CompiledFormula.Compile(formulaString, sheetId, getters)
50101
+ };
50102
+ } else yield {
50103
+ position,
50104
+ compiled: result
50105
+ };
50106
+ }
50092
50107
  break;
50093
50108
  }
50094
50109
  case "COMBINE_OFFSET": {
@@ -50097,10 +50112,19 @@ var Unsquisher = class {
50097
50112
  this.previousOffset.N = currentOffset.N ?? this.previousOffset.N;
50098
50113
  this.previousOffset.S = currentOffset.S ?? this.previousOffset.S;
50099
50114
  this.previousOffset.R = currentOffset.R ?? this.previousOffset.R;
50100
- for (const position of targetPositions) yield {
50101
- position,
50102
- compiled: this.unsquishFormula(this.previousOffset, sheetId, getters)
50103
- };
50115
+ for (const position of targetPositions) {
50116
+ const result = this.unsquishFormula(this.previousOffset, sheetId, getters);
50117
+ if (!result.areRangeShapesInLineWithNormalizedFormula()) {
50118
+ const formulaString = result.toFormulaString(getters);
50119
+ yield {
50120
+ position,
50121
+ compiled: CompiledFormula.Compile(formulaString, sheetId, getters)
50122
+ };
50123
+ } else yield {
50124
+ position,
50125
+ compiled: result
50126
+ };
50127
+ }
50104
50128
  break;
50105
50129
  }
50106
50130
  case "NEW_NUMBER":
@@ -58045,6 +58069,8 @@ var PivotUIPlugin = class extends CoreViewPlugin {
58045
58069
  pivots = {};
58046
58070
  unusedPivotsInFormulas;
58047
58071
  custom;
58072
+ pivotPositionCache = new PositionMap();
58073
+ shouldInvalidateCache = false;
58048
58074
  constructor(config) {
58049
58075
  super(config);
58050
58076
  this.custom = config.custom;
@@ -58055,7 +58081,11 @@ var PivotUIPlugin = class extends CoreViewPlugin {
58055
58081
  }
58056
58082
  }
58057
58083
  handle(cmd) {
58058
- if (invalidateEvaluationCommands.has(cmd.type)) for (const pivotId of this.getters.getPivotIds()) this.setupPivot(pivotId, { recreate: true });
58084
+ if (invalidateEvaluationCommands.has(cmd.type)) {
58085
+ this.shouldInvalidateCache = true;
58086
+ for (const pivotId of this.getters.getPivotIds()) this.setupPivot(pivotId, { recreate: true });
58087
+ }
58088
+ if (cmd.type === "UPDATE_CELL") this.shouldInvalidateCache = true;
58059
58089
  switch (cmd.type) {
58060
58090
  case "REFRESH_PIVOT":
58061
58091
  this.refreshPivot(cmd.id);
@@ -58095,6 +58125,12 @@ var PivotUIPlugin = class extends CoreViewPlugin {
58095
58125
  break;
58096
58126
  }
58097
58127
  }
58128
+ finalize() {
58129
+ if (this.shouldInvalidateCache) {
58130
+ this.pivotPositionCache = new PositionMap();
58131
+ this.shouldInvalidateCache = false;
58132
+ }
58133
+ }
58098
58134
  /**
58099
58135
  * Get the id of the first pivot in the formula at the given position. Returns undefined if there
58100
58136
  * is no pivot at this position
@@ -58106,9 +58142,14 @@ var PivotUIPlugin = class extends CoreViewPlugin {
58106
58142
  * Get all of the ids of the pivot present in the formula at the given position.
58107
58143
  */
58108
58144
  getPivotIdsFromPosition(position) {
58109
- const cell = this.getters.getCorrespondingFormulaCell(position);
58110
- if (cell && cell.isFormula) return this.getPivotIdsFromFormula(position.sheetId, cell.compiledFormula);
58111
- return [];
58145
+ if (!this.pivotPositionCache.has(position)) {
58146
+ const cell = this.getters.getCorrespondingFormulaCell(position);
58147
+ if (cell && cell.isFormula) {
58148
+ const pivotIds = this.getPivotIdsFromFormula(position.sheetId, cell.compiledFormula);
58149
+ this.pivotPositionCache.set(position, pivotIds);
58150
+ }
58151
+ }
58152
+ return this.pivotPositionCache.get(position) || [];
58112
58153
  }
58113
58154
  getPivotIdsFromFormula(sheetId, formula) {
58114
58155
  return this.getPivotFunctions(sheetId, formula).map((pivotFunction) => {
@@ -59863,7 +59904,12 @@ var TableComputedStylePlugin = class extends UIPlugin {
59863
59904
  computeTableStyle(sheetId, table) {
59864
59905
  return lazy(() => {
59865
59906
  const style = this.getters.getTableStyle(table.config.styleId);
59866
- const { tableMetaData, config } = this.getTableMetaData(sheetId, table);
59907
+ const tableMetaDataAndConfig = this.getTableMetaData(sheetId, table);
59908
+ if (!tableMetaDataAndConfig) return {
59909
+ borders: {},
59910
+ styles: {}
59911
+ };
59912
+ const { tableMetaData, config } = tableMetaDataAndConfig;
59867
59913
  const relativeTableStyle = getComputedTableStyle(config, style, tableMetaData);
59868
59914
  const mapping = this.getTableMapping(sheetId, table);
59869
59915
  const absoluteTableStyle = {
@@ -59901,6 +59947,7 @@ var TableComputedStylePlugin = class extends UIPlugin {
59901
59947
  const pivotInfo = this.getters.getPivotStyleAtPosition(mainPosition);
59902
59948
  if (!pivotInfo) throw new Error("No dynamic pivot info found at pivot table position");
59903
59949
  const pivot = this.getters.getPivot(pivotInfo.pivotId);
59950
+ if (!pivot.isValid()) return;
59904
59951
  const pivotStyle = pivotInfo.pivotStyle;
59905
59952
  const maxRowDepth = pivot.getExpandedTableStructure().getNumberOfRowGroupBys();
59906
59953
  const pivotTable = pivot.getCollapsedTableStructure();
@@ -84609,7 +84656,8 @@ const helpers = {
84609
84656
  parseFormat,
84610
84657
  isFormula,
84611
84658
  domainToColRowDomain,
84612
- collapseHierarchicalDisplayName
84659
+ collapseHierarchicalDisplayName,
84660
+ PositionMap
84613
84661
  };
84614
84662
  const links = {
84615
84663
  isMarkdownLink,
@@ -84789,6 +84837,6 @@ exports.stores = stores;
84789
84837
  exports.tokenColors = tokenColors;
84790
84838
  exports.tokenize = tokenize;
84791
84839
 
84792
- __info__.version = "19.3.11";
84793
- __info__.date = "2026-07-13T06:26:28.422Z";
84794
- __info__.hash = "35c06d3";
84840
+ __info__.version = "19.3.12";
84841
+ __info__.date = "2026-07-20T11:02:44.416Z";
84842
+ __info__.hash = "2b42707";
@@ -2,9 +2,9 @@
2
2
  /*
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 19.3.11
6
- * @date 2026-07-13T06:26:30.150Z
7
- * @hash 35c06d3
5
+ * @version 19.3.12
6
+ * @date 2026-07-20T11:02:46.174Z
7
+ * @hash 2b42707
8
8
  */
9
9
  :root {
10
10
  --os-gray-100: light-dark(#f9fafb, #1b1d26);
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 19.3.11
6
- * @date 2026-07-13T06:26:28.422Z
7
- * @hash 35c06d3
5
+ * @version 19.3.12
6
+ * @date 2026-07-20T11:02:44.416Z
7
+ * @hash 2b42707
8
8
  */
9
9
 
10
10
  import { App, Component, blockDom, markRaw, onMounted, onPatched, onWillPatch, onWillStart, onWillUnmount, onWillUpdateProps, status, toRaw, useChildSubEnv, useComponent, useEffect, useEnv, useExternalListener, useRef, useState, useSubEnv, whenReady, xml } from "@odoo/owl";
@@ -5567,7 +5567,7 @@ function getRangeString(range, forSheetId, getSheetName, options = {
5567
5567
  if (prefixSheet && !sheetName) return CellErrorType.InvalidReference;
5568
5568
  let rangeString = getRangePartString(range, 0, options);
5569
5569
  if (range.parts && range.parts.length === 2) {
5570
- if (range.zone.top !== range.zone.bottom || range.zone.left !== range.zone.right || range.parts[0].rowFixed || range.parts[0].colFixed || range.parts[1].rowFixed || range.parts[1].colFixed) {
5570
+ if (range.zone.top !== range.zone.bottom || range.zone.left !== range.zone.right || range.parts[0].rowFixed || range.parts[0].colFixed || range.parts[1].rowFixed || range.parts[1].colFixed || options.doNotSimplifyRange) {
5571
5571
  rangeString += ":";
5572
5572
  rangeString += getRangePartString(range, 1, options);
5573
5573
  }
@@ -6289,6 +6289,11 @@ var CompiledFormula = class CompiledFormula {
6289
6289
  const params = compileTokens(rangeTokenize(formula));
6290
6290
  return new CompiledFormula(sheetId, params.tokens, params.literalValues, params.symbols, params.dependencies.map((xc) => getters.getRangeFromSheetXC(sheetId, xc)), params.isBadExpression, params.normalizedFormula, params.execute);
6291
6291
  }
6292
+ areRangeShapesInLineWithNormalizedFormula() {
6293
+ return Array.from(this.normalizedFormula.matchAll(/\|C\||\|R\|/g)).every((value, index) => {
6294
+ return this.rangeDependencies[index].parts.length === 1 && value[0] === "|C|" || this.rangeDependencies[index].parts.length === 2 && value[0] === "|R|" || this.rangeDependencies[index].invalidXc || this.rangeDependencies[index].invalidSheetName;
6295
+ });
6296
+ }
6292
6297
  };
6293
6298
  function compileTokens(tokens) {
6294
6299
  try {
@@ -33914,7 +33919,7 @@ var ScorecardChartConfigPanel = class extends Component {
33914
33919
  return !!this.state.keyValueDispatchResult?.isCancelledBecause("InvalidScorecardKeyValue");
33915
33920
  }
33916
33921
  get isBaselineInvalid() {
33917
- return !!this.state.keyValueDispatchResult?.isCancelledBecause("InvalidScorecardBaseline");
33922
+ return !!this.state.baselineDispatchResult?.isCancelledBecause("InvalidScorecardBaseline");
33918
33923
  }
33919
33924
  onKeyValueRangeChanged(ranges) {
33920
33925
  this.keyValue = ranges[0];
@@ -49717,6 +49722,7 @@ var Squisher = class {
49717
49722
  alreadyAppliedNumberOffsets = [];
49718
49723
  previousStrings = [];
49719
49724
  baseFormulaWasTransformed = false;
49725
+ rangeToStringOptions = { doNotSimplifyRange: true };
49720
49726
  baseNumber = void 0;
49721
49727
  constructor(getters) {
49722
49728
  this.getters = getters;
@@ -49772,9 +49778,9 @@ var Squisher = class {
49772
49778
  let references = [];
49773
49779
  if (!this.baseFormula || this.baseFormula.normalizedFormula !== cell.compiledFormula.normalizedFormula) {
49774
49780
  this.resetBaseTo(cell.compiledFormula);
49775
- return cell.compiledFormula.toFormulaString(this.getters);
49781
+ return cell.compiledFormula.toFormulaString(this.getters, this.rangeToStringOptions);
49776
49782
  } else {
49777
- if (!this.baseFormulaWasTransformed && deepEquals(cell.compiledFormula.literalValues, this.baseFormula.literalValues) && deepEquals(cell.compiledFormula.rangeDependencies, this.baseFormula.rangeDependencies)) return cell.compiledFormula.toFormulaString(this.getters);
49783
+ if (!this.baseFormulaWasTransformed && deepEquals(cell.compiledFormula.literalValues, this.baseFormula.literalValues) && deepEquals(cell.compiledFormula.rangeDependencies, this.baseFormula.rangeDependencies)) return cell.compiledFormula.toFormulaString(this.getters, this.rangeToStringOptions);
49778
49784
  numbers = this.squishNumbers(cell.compiledFormula.literalValues.numbers);
49779
49785
  strings = this.squishStrings(cell.compiledFormula.literalValues.strings);
49780
49786
  references = this.squishReferences(cell.compiledFormula.rangeDependencies, forSheetId);
@@ -49851,23 +49857,23 @@ var Squisher = class {
49851
49857
  squishOneReference(reference, previousReferences, index, forSheetId) {
49852
49858
  const previousReference = previousReferences[index];
49853
49859
  if (deepEquals(previousReference, reference)) return "=";
49854
- if (previousReference.sheetId !== reference.sheetId || previousReference.prefixSheet !== reference.prefixSheet || previousReference.invalidSheetName !== reference.invalidSheetName || previousReference.invalidXc !== reference.invalidXc) {
49860
+ if (previousReference.sheetId !== reference.sheetId || previousReference.prefixSheet !== reference.prefixSheet || previousReference.invalidSheetName !== reference.invalidSheetName || previousReference.invalidXc !== reference.invalidXc || previousReference.parts.length !== reference.parts.length) {
49855
49861
  previousReferences[index] = deepCopy(reference);
49856
- return getRangeString(reference, forSheetId, this.getters.getSheetName);
49862
+ return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
49857
49863
  }
49858
49864
  if (previousReference.unboundedZone.bottom === void 0 || previousReference.unboundedZone.right === void 0 || reference.unboundedZone.bottom === void 0 || reference.unboundedZone.right === void 0) {
49859
49865
  previousReferences[index] = deepCopy(reference);
49860
- return getRangeString(reference, forSheetId, this.getters.getSheetName);
49866
+ return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
49861
49867
  }
49862
49868
  for (let i = 0; i < reference.parts.length; i++) if (previousReference.parts[i].colFixed !== reference.parts[i].colFixed || previousReference.parts[i].rowFixed !== reference.parts[i].rowFixed) {
49863
49869
  previousReferences[index] = deepCopy(reference);
49864
- return getRangeString(reference, forSheetId, this.getters.getSheetName);
49870
+ return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
49865
49871
  }
49866
49872
  const currentZone = reference.zone;
49867
49873
  const previousZone = previousReference.zone;
49868
49874
  if (currentZone.top !== currentZone.bottom || currentZone.left !== currentZone.right || previousZone.top !== previousZone.bottom || previousZone.left !== previousZone.right) {
49869
49875
  previousReferences[index] = deepCopy(reference);
49870
- return getRangeString(reference, forSheetId, this.getters.getSheetName);
49876
+ return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
49871
49877
  }
49872
49878
  const diffCol = reference.zone.left - previousReference.zone.left;
49873
49879
  const diffRow = reference.zone.top - previousReference.zone.top;
@@ -49875,7 +49881,7 @@ var Squisher = class {
49875
49881
  previousReference.unboundedZone = deepCopy(reference.unboundedZone);
49876
49882
  if (diffCol !== 0 && diffRow === 0) return `${diffCol > 0 ? "+" : "-"}C${Math.abs(diffCol)}`;
49877
49883
  else if (diffRow !== 0 && diffCol === 0) return `${diffRow > 0 ? "+" : "-"}R${Math.abs(diffRow)}`;
49878
- return getRangeString(reference, forSheetId, this.getters.getSheetName);
49884
+ return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
49879
49885
  }
49880
49886
  /**
49881
49887
  * Squish the number parameters. Result for each parameter should be compared the previous formula.
@@ -50084,10 +50090,19 @@ var Unsquisher = class {
50084
50090
  case "FIRST_OFFSET": {
50085
50091
  const currentOffset = current;
50086
50092
  this.previousOffset = currentOffset;
50087
- for (const position of targetPositions) yield {
50088
- position,
50089
- compiled: this.unsquishFormula(currentOffset, sheetId, getters)
50090
- };
50093
+ for (const position of targetPositions) {
50094
+ const result = this.unsquishFormula(currentOffset, sheetId, getters);
50095
+ if (!result.areRangeShapesInLineWithNormalizedFormula()) {
50096
+ const formulaString = result.toFormulaString(getters);
50097
+ yield {
50098
+ position,
50099
+ compiled: CompiledFormula.Compile(formulaString, sheetId, getters)
50100
+ };
50101
+ } else yield {
50102
+ position,
50103
+ compiled: result
50104
+ };
50105
+ }
50091
50106
  break;
50092
50107
  }
50093
50108
  case "COMBINE_OFFSET": {
@@ -50096,10 +50111,19 @@ var Unsquisher = class {
50096
50111
  this.previousOffset.N = currentOffset.N ?? this.previousOffset.N;
50097
50112
  this.previousOffset.S = currentOffset.S ?? this.previousOffset.S;
50098
50113
  this.previousOffset.R = currentOffset.R ?? this.previousOffset.R;
50099
- for (const position of targetPositions) yield {
50100
- position,
50101
- compiled: this.unsquishFormula(this.previousOffset, sheetId, getters)
50102
- };
50114
+ for (const position of targetPositions) {
50115
+ const result = this.unsquishFormula(this.previousOffset, sheetId, getters);
50116
+ if (!result.areRangeShapesInLineWithNormalizedFormula()) {
50117
+ const formulaString = result.toFormulaString(getters);
50118
+ yield {
50119
+ position,
50120
+ compiled: CompiledFormula.Compile(formulaString, sheetId, getters)
50121
+ };
50122
+ } else yield {
50123
+ position,
50124
+ compiled: result
50125
+ };
50126
+ }
50103
50127
  break;
50104
50128
  }
50105
50129
  case "NEW_NUMBER":
@@ -57860,6 +57884,8 @@ var PivotUIPlugin = class extends CoreViewPlugin {
57860
57884
  pivots = {};
57861
57885
  unusedPivotsInFormulas;
57862
57886
  custom;
57887
+ pivotPositionCache = new PositionMap();
57888
+ shouldInvalidateCache = false;
57863
57889
  constructor(config) {
57864
57890
  super(config);
57865
57891
  this.custom = config.custom;
@@ -57870,7 +57896,11 @@ var PivotUIPlugin = class extends CoreViewPlugin {
57870
57896
  }
57871
57897
  }
57872
57898
  handle(cmd) {
57873
- if (invalidateEvaluationCommands.has(cmd.type)) for (const pivotId of this.getters.getPivotIds()) this.setupPivot(pivotId, { recreate: true });
57899
+ if (invalidateEvaluationCommands.has(cmd.type)) {
57900
+ this.shouldInvalidateCache = true;
57901
+ for (const pivotId of this.getters.getPivotIds()) this.setupPivot(pivotId, { recreate: true });
57902
+ }
57903
+ if (cmd.type === "UPDATE_CELL") this.shouldInvalidateCache = true;
57874
57904
  switch (cmd.type) {
57875
57905
  case "REFRESH_PIVOT":
57876
57906
  this.refreshPivot(cmd.id);
@@ -57910,6 +57940,12 @@ var PivotUIPlugin = class extends CoreViewPlugin {
57910
57940
  break;
57911
57941
  }
57912
57942
  }
57943
+ finalize() {
57944
+ if (this.shouldInvalidateCache) {
57945
+ this.pivotPositionCache = new PositionMap();
57946
+ this.shouldInvalidateCache = false;
57947
+ }
57948
+ }
57913
57949
  /**
57914
57950
  * Get the id of the first pivot in the formula at the given position. Returns undefined if there
57915
57951
  * is no pivot at this position
@@ -57921,9 +57957,14 @@ var PivotUIPlugin = class extends CoreViewPlugin {
57921
57957
  * Get all of the ids of the pivot present in the formula at the given position.
57922
57958
  */
57923
57959
  getPivotIdsFromPosition(position) {
57924
- const cell = this.getters.getCorrespondingFormulaCell(position);
57925
- if (cell && cell.isFormula) return this.getPivotIdsFromFormula(position.sheetId, cell.compiledFormula);
57926
- return [];
57960
+ if (!this.pivotPositionCache.has(position)) {
57961
+ const cell = this.getters.getCorrespondingFormulaCell(position);
57962
+ if (cell && cell.isFormula) {
57963
+ const pivotIds = this.getPivotIdsFromFormula(position.sheetId, cell.compiledFormula);
57964
+ this.pivotPositionCache.set(position, pivotIds);
57965
+ }
57966
+ }
57967
+ return this.pivotPositionCache.get(position) || [];
57927
57968
  }
57928
57969
  getPivotIdsFromFormula(sheetId, formula) {
57929
57970
  return this.getPivotFunctions(sheetId, formula).map((pivotFunction) => {
@@ -59678,7 +59719,12 @@ var TableComputedStylePlugin = class extends UIPlugin {
59678
59719
  computeTableStyle(sheetId, table) {
59679
59720
  return lazy(() => {
59680
59721
  const style = this.getters.getTableStyle(table.config.styleId);
59681
- const { tableMetaData, config } = this.getTableMetaData(sheetId, table);
59722
+ const tableMetaDataAndConfig = this.getTableMetaData(sheetId, table);
59723
+ if (!tableMetaDataAndConfig) return {
59724
+ borders: {},
59725
+ styles: {}
59726
+ };
59727
+ const { tableMetaData, config } = tableMetaDataAndConfig;
59682
59728
  const relativeTableStyle = getComputedTableStyle(config, style, tableMetaData);
59683
59729
  const mapping = this.getTableMapping(sheetId, table);
59684
59730
  const absoluteTableStyle = {
@@ -59716,6 +59762,7 @@ var TableComputedStylePlugin = class extends UIPlugin {
59716
59762
  const pivotInfo = this.getters.getPivotStyleAtPosition(mainPosition);
59717
59763
  if (!pivotInfo) throw new Error("No dynamic pivot info found at pivot table position");
59718
59764
  const pivot = this.getters.getPivot(pivotInfo.pivotId);
59765
+ if (!pivot.isValid()) return;
59719
59766
  const pivotStyle = pivotInfo.pivotStyle;
59720
59767
  const maxRowDepth = pivot.getExpandedTableStructure().getNumberOfRowGroupBys();
59721
59768
  const pivotTable = pivot.getCollapsedTableStructure();
@@ -84424,7 +84471,8 @@ const helpers = {
84424
84471
  parseFormat,
84425
84472
  isFormula,
84426
84473
  domainToColRowDomain,
84427
- collapseHierarchicalDisplayName
84474
+ collapseHierarchicalDisplayName,
84475
+ PositionMap
84428
84476
  };
84429
84477
  const links = {
84430
84478
  isMarkdownLink,
@@ -84546,6 +84594,6 @@ const chartHelpers = {
84546
84594
  //#endregion
84547
84595
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, ClientDisconnectedError, CommandResult, CompiledFormula, CorePlugin, CoreViewPlugin, DEFAULT_LOCALE, DEFAULT_LOCALES, DispatchResult, EvaluationError, LocalTransportService, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, canExecuteInReadonly, categories, chartHelpers, components, constants, convertAstNodes, coreTypes, createAutocompleteArgumentsProvider, findCellInNewZone, functionCache, getCaretDownSvg, getCaretUpSvg, helpers, hooks, invalidateCFEvaluationCommands, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, isCoreCommand, isSheetDependent, iterateAstNodes, links, load, lockedSheetAllowedCommands, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
84548
84596
 
84549
- __info__.version = "19.3.11";
84550
- __info__.date = "2026-07-13T06:26:28.422Z";
84551
- __info__.hash = "35c06d3";
84597
+ __info__.version = "19.3.12";
84598
+ __info__.date = "2026-07-20T11:02:44.416Z";
84599
+ __info__.hash = "2b42707";