@odoo/o-spreadsheet 19.2.20 → 19.2.22

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.2.20
6
- * @date 2026-07-13T06:27:12.484Z
7
- * @hash 99a9aef
5
+ * @version 19.2.22
6
+ * @date 2026-07-23T07:41:02.828Z
7
+ * @hash 2fb92b4
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.2.20
6
- * @date 2026-07-13T06:27:10.918Z
7
- * @hash 99a9aef
5
+ * @version 19.2.22
6
+ * @date 2026-07-23T07:41:01.568Z
7
+ * @hash 2fb92b4
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";
@@ -6268,7 +6268,7 @@ function getRangeString(range, forSheetId, getSheetName, options = {
6268
6268
  if (prefixSheet && !sheetName) return CellErrorType.InvalidReference;
6269
6269
  let rangeString = getRangePartString(range, 0, options);
6270
6270
  if (range.parts && range.parts.length === 2) {
6271
- 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) {
6271
+ 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) {
6272
6272
  rangeString += ":";
6273
6273
  rangeString += getRangePartString(range, 1, options);
6274
6274
  }
@@ -40478,7 +40478,7 @@ var ScorecardChartConfigPanel = class extends Component {
40478
40478
  return !!this.state.keyValueDispatchResult?.isCancelledBecause("InvalidScorecardKeyValue");
40479
40479
  }
40480
40480
  get isBaselineInvalid() {
40481
- return !!this.state.keyValueDispatchResult?.isCancelledBecause("InvalidScorecardBaseline");
40481
+ return !!this.state.baselineDispatchResult?.isCancelledBecause("InvalidScorecardBaseline");
40482
40482
  }
40483
40483
  onKeyValueRangeChanged(ranges) {
40484
40484
  this.keyValue = ranges[0];
@@ -43796,6 +43796,11 @@ var CompiledFormula = class CompiledFormula {
43796
43796
  const params = compileTokens(rangeTokenize(formula));
43797
43797
  return new CompiledFormula(sheetId, params.tokens, params.literalValues, params.symbols, params.dependencies.map((xc) => getters.getRangeFromSheetXC(sheetId, xc)), params.isBadExpression, params.normalizedFormula, params.execute);
43798
43798
  }
43799
+ areRangeShapesInLineWithNormalizedFormula() {
43800
+ return Array.from(this.normalizedFormula.matchAll(/\|C\||\|R\|/g)).every((value, index) => {
43801
+ 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;
43802
+ });
43803
+ }
43799
43804
  };
43800
43805
  function compileTokens(tokens) {
43801
43806
  try {
@@ -50225,7 +50230,8 @@ var Autofill = class extends Component {
50225
50230
  const { x, y } = this.state.handler ? this.state.position : this.props.position;
50226
50231
  return cssPropertiesToCss({
50227
50232
  top: `${y}px`,
50228
- left: `${x}px`
50233
+ left: `${x}px`,
50234
+ visibility: this.props.isVisible ? "visible" : "hidden"
50229
50235
  });
50230
50236
  }
50231
50237
  get styleNextValue() {
@@ -50646,7 +50652,7 @@ var CellComposerStore = class extends AbstractComposerStore {
50646
50652
  this._cancelEdition();
50647
50653
  this.resetContent();
50648
50654
  }
50649
- if (cmd.sheetIdFrom !== cmd.sheetIdTo) {
50655
+ if (this.model.selection.isListening(this) && cmd.sheetIdFrom !== cmd.sheetIdTo) {
50650
50656
  const activePosition = this.getters.getActivePosition();
50651
50657
  const { col, row } = this.getters.getNextVisibleCellPosition({
50652
50658
  sheetId: cmd.sheetIdTo,
@@ -55778,6 +55784,7 @@ var Squisher = class {
55778
55784
  alreadyAppliedNumberOffsets = [];
55779
55785
  previousStrings = [];
55780
55786
  baseFormulaWasTransformed = false;
55787
+ rangeToStringOptions = { doNotSimplifyRange: true };
55781
55788
  constructor(getters) {
55782
55789
  this.getters = getters;
55783
55790
  }
@@ -55834,9 +55841,9 @@ var Squisher = class {
55834
55841
  let references = [];
55835
55842
  if (!this.baseFormula || this.baseFormula.normalizedFormula !== cell.compiledFormula.normalizedFormula) {
55836
55843
  this.resetBaseTo(cell.compiledFormula);
55837
- return cell.compiledFormula.toFormulaString(this.getters);
55844
+ return cell.compiledFormula.toFormulaString(this.getters, this.rangeToStringOptions);
55838
55845
  } else {
55839
- if (!this.baseFormulaWasTransformed && deepEquals(cell.compiledFormula.literalValues, this.baseFormula.literalValues) && deepEquals(cell.compiledFormula.rangeDependencies, this.baseFormula.rangeDependencies)) return cell.compiledFormula.toFormulaString(this.getters);
55846
+ 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);
55840
55847
  numbers = this.squishNumbers(cell.compiledFormula.literalValues.numbers);
55841
55848
  strings = this.squishStrings(cell.compiledFormula.literalValues.strings);
55842
55849
  references = this.squishReferences(cell.compiledFormula.rangeDependencies, forSheetId);
@@ -55879,23 +55886,23 @@ var Squisher = class {
55879
55886
  squishOneReference(reference, previousReferences, index, forSheetId) {
55880
55887
  const previousReference = previousReferences[index];
55881
55888
  if (deepEquals(previousReference, reference)) return "=";
55882
- if (previousReference.sheetId !== reference.sheetId || previousReference.prefixSheet !== reference.prefixSheet || previousReference.invalidSheetName !== reference.invalidSheetName || previousReference.invalidXc !== reference.invalidXc) {
55889
+ if (previousReference.sheetId !== reference.sheetId || previousReference.prefixSheet !== reference.prefixSheet || previousReference.invalidSheetName !== reference.invalidSheetName || previousReference.invalidXc !== reference.invalidXc || previousReference.parts.length !== reference.parts.length) {
55883
55890
  previousReferences[index] = deepCopy(reference);
55884
- return getRangeString(reference, forSheetId, this.getters.getSheetName);
55891
+ return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
55885
55892
  }
55886
55893
  if (previousReference.unboundedZone.bottom === void 0 || previousReference.unboundedZone.right === void 0 || reference.unboundedZone.bottom === void 0 || reference.unboundedZone.right === void 0) {
55887
55894
  previousReferences[index] = deepCopy(reference);
55888
- return getRangeString(reference, forSheetId, this.getters.getSheetName);
55895
+ return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
55889
55896
  }
55890
55897
  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) {
55891
55898
  previousReferences[index] = deepCopy(reference);
55892
- return getRangeString(reference, forSheetId, this.getters.getSheetName);
55899
+ return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
55893
55900
  }
55894
55901
  const currentZone = reference.zone;
55895
55902
  const previousZone = previousReference.zone;
55896
55903
  if (currentZone.top !== currentZone.bottom || currentZone.left !== currentZone.right || previousZone.top !== previousZone.bottom || previousZone.left !== previousZone.right) {
55897
55904
  previousReferences[index] = deepCopy(reference);
55898
- return getRangeString(reference, forSheetId, this.getters.getSheetName);
55905
+ return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
55899
55906
  }
55900
55907
  const diffCol = reference.zone.left - previousReference.zone.left;
55901
55908
  const diffRow = reference.zone.top - previousReference.zone.top;
@@ -55903,7 +55910,7 @@ var Squisher = class {
55903
55910
  previousReference.unboundedZone = deepCopy(reference.unboundedZone);
55904
55911
  if (diffCol !== 0 && diffRow === 0) return `${diffCol > 0 ? "+" : "-"}C${Math.abs(diffCol)}`;
55905
55912
  else if (diffRow !== 0 && diffCol === 0) return `${diffRow > 0 ? "+" : "-"}R${Math.abs(diffRow)}`;
55906
- return getRangeString(reference, forSheetId, this.getters.getSheetName);
55913
+ return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
55907
55914
  }
55908
55915
  /**
55909
55916
  * Squish the number parameters. Result for each parameter should be compared the previous formula.
@@ -56014,10 +56021,19 @@ var Unsquisher = class {
56014
56021
  break;
56015
56022
  case "FIRST_OFFSET":
56016
56023
  this.previousOffset = current;
56017
- for (const position of positionsOfKey) yield {
56018
- position,
56019
- compiled: this.unsquish(current, sheetId, getters)
56020
- };
56024
+ for (const position of positionsOfKey) {
56025
+ const result = this.unsquish(current, sheetId, getters);
56026
+ if (!result.areRangeShapesInLineWithNormalizedFormula()) {
56027
+ const formulaString = result.toFormulaString(getters);
56028
+ yield {
56029
+ position,
56030
+ compiled: CompiledFormula.Compile(formulaString, sheetId, getters)
56031
+ };
56032
+ } else yield {
56033
+ position,
56034
+ compiled: result
56035
+ };
56036
+ }
56021
56037
  break;
56022
56038
  case "COMBINE_OFFSET":
56023
56039
  if (!this.previousOffset) throw new Error("No previous offset to combine with");
@@ -56025,10 +56041,19 @@ var Unsquisher = class {
56025
56041
  this.previousOffset.N = currentOffset.N ?? this.previousOffset.N;
56026
56042
  this.previousOffset.S = currentOffset.S ?? this.previousOffset.S;
56027
56043
  this.previousOffset.R = currentOffset.R ?? this.previousOffset.R;
56028
- for (const position of positionsOfKey) yield {
56029
- position,
56030
- compiled: this.unsquish(this.previousOffset, sheetId, getters)
56031
- };
56044
+ for (const position of positionsOfKey) {
56045
+ const result = this.unsquish(this.previousOffset, sheetId, getters);
56046
+ if (!result.areRangeShapesInLineWithNormalizedFormula()) {
56047
+ const formulaString = result.toFormulaString(getters);
56048
+ yield {
56049
+ position,
56050
+ compiled: CompiledFormula.Compile(formulaString, sheetId, getters)
56051
+ };
56052
+ } else yield {
56053
+ position,
56054
+ compiled: result
56055
+ };
56056
+ }
56032
56057
  break;
56033
56058
  }
56034
56059
  }
@@ -63545,6 +63570,8 @@ var PivotUIPlugin = class extends CoreViewPlugin {
63545
63570
  pivots = {};
63546
63571
  unusedPivotsInFormulas;
63547
63572
  custom;
63573
+ pivotPositionCache = new PositionMap();
63574
+ shouldInvalidateCache = false;
63548
63575
  constructor(config) {
63549
63576
  super(config);
63550
63577
  this.custom = config.custom;
@@ -63555,7 +63582,11 @@ var PivotUIPlugin = class extends CoreViewPlugin {
63555
63582
  }
63556
63583
  }
63557
63584
  handle(cmd) {
63558
- if (invalidateEvaluationCommands.has(cmd.type)) for (const pivotId of this.getters.getPivotIds()) this.setupPivot(pivotId, { recreate: true });
63585
+ if (invalidateEvaluationCommands.has(cmd.type)) {
63586
+ this.shouldInvalidateCache = true;
63587
+ for (const pivotId of this.getters.getPivotIds()) this.setupPivot(pivotId, { recreate: true });
63588
+ }
63589
+ if (cmd.type === "UPDATE_CELL") this.shouldInvalidateCache = true;
63559
63590
  switch (cmd.type) {
63560
63591
  case "REFRESH_PIVOT":
63561
63592
  this.refreshPivot(cmd.id);
@@ -63595,6 +63626,12 @@ var PivotUIPlugin = class extends CoreViewPlugin {
63595
63626
  break;
63596
63627
  }
63597
63628
  }
63629
+ finalize() {
63630
+ if (this.shouldInvalidateCache) {
63631
+ this.pivotPositionCache = new PositionMap();
63632
+ this.shouldInvalidateCache = false;
63633
+ }
63634
+ }
63598
63635
  /**
63599
63636
  * Get the id of the first pivot in the formula at the given position. Returns undefined if there
63600
63637
  * is no pivot at this position
@@ -63606,9 +63643,14 @@ var PivotUIPlugin = class extends CoreViewPlugin {
63606
63643
  * Get all of the ids of the pivot present in the formula at the given position.
63607
63644
  */
63608
63645
  getPivotIdsFromPosition(position) {
63609
- const cell = this.getters.getCorrespondingFormulaCell(position);
63610
- if (cell && cell.isFormula) return this.getPivotIdsFromFormula(position.sheetId, cell.compiledFormula);
63611
- return [];
63646
+ if (!this.pivotPositionCache.has(position)) {
63647
+ const cell = this.getters.getCorrespondingFormulaCell(position);
63648
+ if (cell && cell.isFormula) {
63649
+ const pivotIds = this.getPivotIdsFromFormula(position.sheetId, cell.compiledFormula);
63650
+ this.pivotPositionCache.set(position, pivotIds);
63651
+ }
63652
+ }
63653
+ return this.pivotPositionCache.get(position) || [];
63612
63654
  }
63613
63655
  getPivotIdsFromFormula(sheetId, formula) {
63614
63656
  return this.getPivotFunctions(sheetId, formula).map((pivotFunction) => {
@@ -65347,17 +65389,32 @@ var TableComputedStylePlugin = class extends UIPlugin {
65347
65389
  getCellTableStyle(position) {
65348
65390
  const table = this.getters.getTable(position);
65349
65391
  if (!table) return;
65350
- return this.tableStyles[position.sheetId][table.id]().styles[position.col]?.[position.row];
65392
+ try {
65393
+ return this.tableStyles[position.sheetId][table.id]().styles[position.col]?.[position.row];
65394
+ } catch (e) {
65395
+ if (isEvaluationError(e) || e instanceof EvaluationError) return;
65396
+ throw e;
65397
+ }
65351
65398
  }
65352
65399
  getCellTableBorder(position) {
65353
65400
  const table = this.getters.getTable(position);
65354
65401
  if (!table) return;
65355
- return this.tableStyles[position.sheetId][table.id]().borders[position.col]?.[position.row];
65402
+ try {
65403
+ return this.tableStyles[position.sheetId][table.id]().borders[position.col]?.[position.row];
65404
+ } catch (e) {
65405
+ if (isEvaluationError(e) || e instanceof EvaluationError) return;
65406
+ throw e;
65407
+ }
65356
65408
  }
65357
65409
  computeTableStyle(sheetId, table) {
65358
65410
  return lazy(() => {
65359
65411
  const style = this.getters.getTableStyle(table.config.styleId);
65360
- const { tableMetaData, config } = this.getTableMetaData(sheetId, table);
65412
+ const tableMetaDataAndConfig = this.getTableMetaData(sheetId, table);
65413
+ if (!tableMetaDataAndConfig) return {
65414
+ borders: {},
65415
+ styles: {}
65416
+ };
65417
+ const { tableMetaData, config } = tableMetaDataAndConfig;
65361
65418
  const relativeTableStyle = getComputedTableStyle(config, style, tableMetaData);
65362
65419
  const mapping = this.getTableMapping(sheetId, table);
65363
65420
  const absoluteTableStyle = {
@@ -65395,6 +65452,7 @@ var TableComputedStylePlugin = class extends UIPlugin {
65395
65452
  const pivotInfo = this.getters.getPivotStyleAtPosition(mainPosition);
65396
65453
  if (!pivotInfo) throw new Error("No dynamic pivot info found at pivot table position");
65397
65454
  const pivot = this.getters.getPivot(pivotInfo.pivotId);
65455
+ if (!pivot.isValid()) return;
65398
65456
  const pivotStyle = pivotInfo.pivotStyle;
65399
65457
  const maxRowDepth = pivot.getExpandedTableStructure().getNumberOfRowGroupBys();
65400
65458
  const pivotCells = pivot.getCollapsedTableStructure().getPivotCells(pivotStyle);
@@ -66832,8 +66890,8 @@ var HeaderVisibilityUIPlugin = class extends UIPlugin {
66832
66890
  getNextVisibleCellPosition({ sheetId, col, row }) {
66833
66891
  return {
66834
66892
  sheetId,
66835
- col: this.findVisibleHeader(sheetId, "COL", col, this.getters.getNumberCols(sheetId) - 1),
66836
- row: this.findVisibleHeader(sheetId, "ROW", row, this.getters.getNumberRows(sheetId) - 1)
66893
+ col: this.findVisibleHeader(sheetId, "COL", col, this.getters.getNumberCols(sheetId) - 1) || this.findVisibleHeader(sheetId, "COL", col, 0) || 0,
66894
+ row: this.findVisibleHeader(sheetId, "ROW", row, this.getters.getNumberRows(sheetId) - 1) || this.findVisibleHeader(sheetId, "ROW", row, 0) || 0
66837
66895
  };
66838
66896
  }
66839
66897
  /**
@@ -81544,7 +81602,8 @@ const helpers = {
81544
81602
  DateTime,
81545
81603
  parseFormat,
81546
81604
  isFormula,
81547
- domainToColRowDomain
81605
+ domainToColRowDomain,
81606
+ PositionMap
81548
81607
  };
81549
81608
  const links = {
81550
81609
  isMarkdownLink,
@@ -81664,6 +81723,6 @@ const chartHelpers = {
81664
81723
  //#endregion
81665
81724
  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 };
81666
81725
 
81667
- __info__.version = "19.2.20";
81668
- __info__.date = "2026-07-13T06:27:10.918Z";
81669
- __info__.hash = "99a9aef";
81726
+ __info__.version = "19.2.22";
81727
+ __info__.date = "2026-07-23T07:41:01.568Z";
81728
+ __info__.hash = "2fb92b4";
@@ -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.2.20
6
- * @date 2026-07-13T06:27:10.918Z
7
- * @hash 99a9aef
5
+ * @version 19.2.22
6
+ * @date 2026-07-23T07:41:01.568Z
7
+ * @hash 2fb92b4
8
8
  */
9
9
 
10
10
  (function(exports, _odoo_owl) {
@@ -6270,7 +6270,7 @@ stores.inject(MyMetaStore, storeInstance);
6270
6270
  if (prefixSheet && !sheetName) return CellErrorType.InvalidReference;
6271
6271
  let rangeString = getRangePartString(range, 0, options);
6272
6272
  if (range.parts && range.parts.length === 2) {
6273
- 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) {
6273
+ 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) {
6274
6274
  rangeString += ":";
6275
6275
  rangeString += getRangePartString(range, 1, options);
6276
6276
  }
@@ -40480,7 +40480,7 @@ stores.inject(MyMetaStore, storeInstance);
40480
40480
  return !!this.state.keyValueDispatchResult?.isCancelledBecause("InvalidScorecardKeyValue");
40481
40481
  }
40482
40482
  get isBaselineInvalid() {
40483
- return !!this.state.keyValueDispatchResult?.isCancelledBecause("InvalidScorecardBaseline");
40483
+ return !!this.state.baselineDispatchResult?.isCancelledBecause("InvalidScorecardBaseline");
40484
40484
  }
40485
40485
  onKeyValueRangeChanged(ranges) {
40486
40486
  this.keyValue = ranges[0];
@@ -43798,6 +43798,11 @@ stores.inject(MyMetaStore, storeInstance);
43798
43798
  const params = compileTokens(rangeTokenize(formula));
43799
43799
  return new CompiledFormula(sheetId, params.tokens, params.literalValues, params.symbols, params.dependencies.map((xc) => getters.getRangeFromSheetXC(sheetId, xc)), params.isBadExpression, params.normalizedFormula, params.execute);
43800
43800
  }
43801
+ areRangeShapesInLineWithNormalizedFormula() {
43802
+ return Array.from(this.normalizedFormula.matchAll(/\|C\||\|R\|/g)).every((value, index) => {
43803
+ 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;
43804
+ });
43805
+ }
43801
43806
  };
43802
43807
  function compileTokens(tokens) {
43803
43808
  try {
@@ -50227,7 +50232,8 @@ stores.inject(MyMetaStore, storeInstance);
50227
50232
  const { x, y } = this.state.handler ? this.state.position : this.props.position;
50228
50233
  return cssPropertiesToCss({
50229
50234
  top: `${y}px`,
50230
- left: `${x}px`
50235
+ left: `${x}px`,
50236
+ visibility: this.props.isVisible ? "visible" : "hidden"
50231
50237
  });
50232
50238
  }
50233
50239
  get styleNextValue() {
@@ -50648,7 +50654,7 @@ stores.inject(MyMetaStore, storeInstance);
50648
50654
  this._cancelEdition();
50649
50655
  this.resetContent();
50650
50656
  }
50651
- if (cmd.sheetIdFrom !== cmd.sheetIdTo) {
50657
+ if (this.model.selection.isListening(this) && cmd.sheetIdFrom !== cmd.sheetIdTo) {
50652
50658
  const activePosition = this.getters.getActivePosition();
50653
50659
  const { col, row } = this.getters.getNextVisibleCellPosition({
50654
50660
  sheetId: cmd.sheetIdTo,
@@ -55780,6 +55786,7 @@ stores.inject(MyMetaStore, storeInstance);
55780
55786
  alreadyAppliedNumberOffsets = [];
55781
55787
  previousStrings = [];
55782
55788
  baseFormulaWasTransformed = false;
55789
+ rangeToStringOptions = { doNotSimplifyRange: true };
55783
55790
  constructor(getters) {
55784
55791
  this.getters = getters;
55785
55792
  }
@@ -55836,9 +55843,9 @@ stores.inject(MyMetaStore, storeInstance);
55836
55843
  let references = [];
55837
55844
  if (!this.baseFormula || this.baseFormula.normalizedFormula !== cell.compiledFormula.normalizedFormula) {
55838
55845
  this.resetBaseTo(cell.compiledFormula);
55839
- return cell.compiledFormula.toFormulaString(this.getters);
55846
+ return cell.compiledFormula.toFormulaString(this.getters, this.rangeToStringOptions);
55840
55847
  } else {
55841
- if (!this.baseFormulaWasTransformed && deepEquals(cell.compiledFormula.literalValues, this.baseFormula.literalValues) && deepEquals(cell.compiledFormula.rangeDependencies, this.baseFormula.rangeDependencies)) return cell.compiledFormula.toFormulaString(this.getters);
55848
+ 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);
55842
55849
  numbers = this.squishNumbers(cell.compiledFormula.literalValues.numbers);
55843
55850
  strings = this.squishStrings(cell.compiledFormula.literalValues.strings);
55844
55851
  references = this.squishReferences(cell.compiledFormula.rangeDependencies, forSheetId);
@@ -55881,23 +55888,23 @@ stores.inject(MyMetaStore, storeInstance);
55881
55888
  squishOneReference(reference, previousReferences, index, forSheetId) {
55882
55889
  const previousReference = previousReferences[index];
55883
55890
  if (deepEquals(previousReference, reference)) return "=";
55884
- if (previousReference.sheetId !== reference.sheetId || previousReference.prefixSheet !== reference.prefixSheet || previousReference.invalidSheetName !== reference.invalidSheetName || previousReference.invalidXc !== reference.invalidXc) {
55891
+ if (previousReference.sheetId !== reference.sheetId || previousReference.prefixSheet !== reference.prefixSheet || previousReference.invalidSheetName !== reference.invalidSheetName || previousReference.invalidXc !== reference.invalidXc || previousReference.parts.length !== reference.parts.length) {
55885
55892
  previousReferences[index] = deepCopy(reference);
55886
- return getRangeString(reference, forSheetId, this.getters.getSheetName);
55893
+ return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
55887
55894
  }
55888
55895
  if (previousReference.unboundedZone.bottom === void 0 || previousReference.unboundedZone.right === void 0 || reference.unboundedZone.bottom === void 0 || reference.unboundedZone.right === void 0) {
55889
55896
  previousReferences[index] = deepCopy(reference);
55890
- return getRangeString(reference, forSheetId, this.getters.getSheetName);
55897
+ return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
55891
55898
  }
55892
55899
  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) {
55893
55900
  previousReferences[index] = deepCopy(reference);
55894
- return getRangeString(reference, forSheetId, this.getters.getSheetName);
55901
+ return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
55895
55902
  }
55896
55903
  const currentZone = reference.zone;
55897
55904
  const previousZone = previousReference.zone;
55898
55905
  if (currentZone.top !== currentZone.bottom || currentZone.left !== currentZone.right || previousZone.top !== previousZone.bottom || previousZone.left !== previousZone.right) {
55899
55906
  previousReferences[index] = deepCopy(reference);
55900
- return getRangeString(reference, forSheetId, this.getters.getSheetName);
55907
+ return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
55901
55908
  }
55902
55909
  const diffCol = reference.zone.left - previousReference.zone.left;
55903
55910
  const diffRow = reference.zone.top - previousReference.zone.top;
@@ -55905,7 +55912,7 @@ stores.inject(MyMetaStore, storeInstance);
55905
55912
  previousReference.unboundedZone = deepCopy(reference.unboundedZone);
55906
55913
  if (diffCol !== 0 && diffRow === 0) return `${diffCol > 0 ? "+" : "-"}C${Math.abs(diffCol)}`;
55907
55914
  else if (diffRow !== 0 && diffCol === 0) return `${diffRow > 0 ? "+" : "-"}R${Math.abs(diffRow)}`;
55908
- return getRangeString(reference, forSheetId, this.getters.getSheetName);
55915
+ return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
55909
55916
  }
55910
55917
  /**
55911
55918
  * Squish the number parameters. Result for each parameter should be compared the previous formula.
@@ -56016,10 +56023,19 @@ stores.inject(MyMetaStore, storeInstance);
56016
56023
  break;
56017
56024
  case "FIRST_OFFSET":
56018
56025
  this.previousOffset = current;
56019
- for (const position of positionsOfKey) yield {
56020
- position,
56021
- compiled: this.unsquish(current, sheetId, getters)
56022
- };
56026
+ for (const position of positionsOfKey) {
56027
+ const result = this.unsquish(current, sheetId, getters);
56028
+ if (!result.areRangeShapesInLineWithNormalizedFormula()) {
56029
+ const formulaString = result.toFormulaString(getters);
56030
+ yield {
56031
+ position,
56032
+ compiled: CompiledFormula.Compile(formulaString, sheetId, getters)
56033
+ };
56034
+ } else yield {
56035
+ position,
56036
+ compiled: result
56037
+ };
56038
+ }
56023
56039
  break;
56024
56040
  case "COMBINE_OFFSET":
56025
56041
  if (!this.previousOffset) throw new Error("No previous offset to combine with");
@@ -56027,10 +56043,19 @@ stores.inject(MyMetaStore, storeInstance);
56027
56043
  this.previousOffset.N = currentOffset.N ?? this.previousOffset.N;
56028
56044
  this.previousOffset.S = currentOffset.S ?? this.previousOffset.S;
56029
56045
  this.previousOffset.R = currentOffset.R ?? this.previousOffset.R;
56030
- for (const position of positionsOfKey) yield {
56031
- position,
56032
- compiled: this.unsquish(this.previousOffset, sheetId, getters)
56033
- };
56046
+ for (const position of positionsOfKey) {
56047
+ const result = this.unsquish(this.previousOffset, sheetId, getters);
56048
+ if (!result.areRangeShapesInLineWithNormalizedFormula()) {
56049
+ const formulaString = result.toFormulaString(getters);
56050
+ yield {
56051
+ position,
56052
+ compiled: CompiledFormula.Compile(formulaString, sheetId, getters)
56053
+ };
56054
+ } else yield {
56055
+ position,
56056
+ compiled: result
56057
+ };
56058
+ }
56034
56059
  break;
56035
56060
  }
56036
56061
  }
@@ -63547,6 +63572,8 @@ stores.inject(MyMetaStore, storeInstance);
63547
63572
  pivots = {};
63548
63573
  unusedPivotsInFormulas;
63549
63574
  custom;
63575
+ pivotPositionCache = new PositionMap();
63576
+ shouldInvalidateCache = false;
63550
63577
  constructor(config) {
63551
63578
  super(config);
63552
63579
  this.custom = config.custom;
@@ -63557,7 +63584,11 @@ stores.inject(MyMetaStore, storeInstance);
63557
63584
  }
63558
63585
  }
63559
63586
  handle(cmd) {
63560
- if (invalidateEvaluationCommands.has(cmd.type)) for (const pivotId of this.getters.getPivotIds()) this.setupPivot(pivotId, { recreate: true });
63587
+ if (invalidateEvaluationCommands.has(cmd.type)) {
63588
+ this.shouldInvalidateCache = true;
63589
+ for (const pivotId of this.getters.getPivotIds()) this.setupPivot(pivotId, { recreate: true });
63590
+ }
63591
+ if (cmd.type === "UPDATE_CELL") this.shouldInvalidateCache = true;
63561
63592
  switch (cmd.type) {
63562
63593
  case "REFRESH_PIVOT":
63563
63594
  this.refreshPivot(cmd.id);
@@ -63597,6 +63628,12 @@ stores.inject(MyMetaStore, storeInstance);
63597
63628
  break;
63598
63629
  }
63599
63630
  }
63631
+ finalize() {
63632
+ if (this.shouldInvalidateCache) {
63633
+ this.pivotPositionCache = new PositionMap();
63634
+ this.shouldInvalidateCache = false;
63635
+ }
63636
+ }
63600
63637
  /**
63601
63638
  * Get the id of the first pivot in the formula at the given position. Returns undefined if there
63602
63639
  * is no pivot at this position
@@ -63608,9 +63645,14 @@ stores.inject(MyMetaStore, storeInstance);
63608
63645
  * Get all of the ids of the pivot present in the formula at the given position.
63609
63646
  */
63610
63647
  getPivotIdsFromPosition(position) {
63611
- const cell = this.getters.getCorrespondingFormulaCell(position);
63612
- if (cell && cell.isFormula) return this.getPivotIdsFromFormula(position.sheetId, cell.compiledFormula);
63613
- return [];
63648
+ if (!this.pivotPositionCache.has(position)) {
63649
+ const cell = this.getters.getCorrespondingFormulaCell(position);
63650
+ if (cell && cell.isFormula) {
63651
+ const pivotIds = this.getPivotIdsFromFormula(position.sheetId, cell.compiledFormula);
63652
+ this.pivotPositionCache.set(position, pivotIds);
63653
+ }
63654
+ }
63655
+ return this.pivotPositionCache.get(position) || [];
63614
63656
  }
63615
63657
  getPivotIdsFromFormula(sheetId, formula) {
63616
63658
  return this.getPivotFunctions(sheetId, formula).map((pivotFunction) => {
@@ -65349,17 +65391,32 @@ stores.inject(MyMetaStore, storeInstance);
65349
65391
  getCellTableStyle(position) {
65350
65392
  const table = this.getters.getTable(position);
65351
65393
  if (!table) return;
65352
- return this.tableStyles[position.sheetId][table.id]().styles[position.col]?.[position.row];
65394
+ try {
65395
+ return this.tableStyles[position.sheetId][table.id]().styles[position.col]?.[position.row];
65396
+ } catch (e) {
65397
+ if (isEvaluationError(e) || e instanceof EvaluationError) return;
65398
+ throw e;
65399
+ }
65353
65400
  }
65354
65401
  getCellTableBorder(position) {
65355
65402
  const table = this.getters.getTable(position);
65356
65403
  if (!table) return;
65357
- return this.tableStyles[position.sheetId][table.id]().borders[position.col]?.[position.row];
65404
+ try {
65405
+ return this.tableStyles[position.sheetId][table.id]().borders[position.col]?.[position.row];
65406
+ } catch (e) {
65407
+ if (isEvaluationError(e) || e instanceof EvaluationError) return;
65408
+ throw e;
65409
+ }
65358
65410
  }
65359
65411
  computeTableStyle(sheetId, table) {
65360
65412
  return lazy(() => {
65361
65413
  const style = this.getters.getTableStyle(table.config.styleId);
65362
- const { tableMetaData, config } = this.getTableMetaData(sheetId, table);
65414
+ const tableMetaDataAndConfig = this.getTableMetaData(sheetId, table);
65415
+ if (!tableMetaDataAndConfig) return {
65416
+ borders: {},
65417
+ styles: {}
65418
+ };
65419
+ const { tableMetaData, config } = tableMetaDataAndConfig;
65363
65420
  const relativeTableStyle = getComputedTableStyle(config, style, tableMetaData);
65364
65421
  const mapping = this.getTableMapping(sheetId, table);
65365
65422
  const absoluteTableStyle = {
@@ -65397,6 +65454,7 @@ stores.inject(MyMetaStore, storeInstance);
65397
65454
  const pivotInfo = this.getters.getPivotStyleAtPosition(mainPosition);
65398
65455
  if (!pivotInfo) throw new Error("No dynamic pivot info found at pivot table position");
65399
65456
  const pivot = this.getters.getPivot(pivotInfo.pivotId);
65457
+ if (!pivot.isValid()) return;
65400
65458
  const pivotStyle = pivotInfo.pivotStyle;
65401
65459
  const maxRowDepth = pivot.getExpandedTableStructure().getNumberOfRowGroupBys();
65402
65460
  const pivotCells = pivot.getCollapsedTableStructure().getPivotCells(pivotStyle);
@@ -66834,8 +66892,8 @@ stores.inject(MyMetaStore, storeInstance);
66834
66892
  getNextVisibleCellPosition({ sheetId, col, row }) {
66835
66893
  return {
66836
66894
  sheetId,
66837
- col: this.findVisibleHeader(sheetId, "COL", col, this.getters.getNumberCols(sheetId) - 1),
66838
- row: this.findVisibleHeader(sheetId, "ROW", row, this.getters.getNumberRows(sheetId) - 1)
66895
+ col: this.findVisibleHeader(sheetId, "COL", col, this.getters.getNumberCols(sheetId) - 1) || this.findVisibleHeader(sheetId, "COL", col, 0) || 0,
66896
+ row: this.findVisibleHeader(sheetId, "ROW", row, this.getters.getNumberRows(sheetId) - 1) || this.findVisibleHeader(sheetId, "ROW", row, 0) || 0
66839
66897
  };
66840
66898
  }
66841
66899
  /**
@@ -81546,7 +81604,8 @@ stores.inject(MyMetaStore, storeInstance);
81546
81604
  DateTime,
81547
81605
  parseFormat,
81548
81606
  isFormula,
81549
- domainToColRowDomain
81607
+ domainToColRowDomain,
81608
+ PositionMap
81550
81609
  };
81551
81610
  const links = {
81552
81611
  isMarkdownLink,
@@ -81724,8 +81783,8 @@ exports.stores = stores;
81724
81783
  exports.tokenColors = tokenColors;
81725
81784
  exports.tokenize = tokenize;
81726
81785
 
81727
- __info__.version = "19.2.20";
81728
- __info__.date = "2026-07-13T06:27:10.918Z";
81729
- __info__.hash = "99a9aef";
81786
+ __info__.version = "19.2.22";
81787
+ __info__.date = "2026-07-23T07:41:01.568Z";
81788
+ __info__.hash = "2fb92b4";
81730
81789
 
81731
81790
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);