@odoo/o-spreadsheet 18.2.39 → 18.2.41

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 18.2.39
6
- * @date 2025-12-26T10:18:44.735Z
7
- * @hash 3de2479
5
+ * @version 18.2.41
6
+ * @date 2026-01-21T11:04:23.927Z
7
+ * @hash 2d9316b
8
8
  */
9
9
 
10
10
  'use strict';
@@ -34,7 +34,8 @@ function createAction(item) {
34
34
  return children
35
35
  .map((child) => (typeof child === "function" ? child(env) : child))
36
36
  .flat()
37
- .map(createAction);
37
+ .map(createAction)
38
+ .sort((a, b) => a.sequence - b.sequence);
38
39
  }
39
40
  : () => [],
40
41
  isReadonlyAllowed: item.isReadonlyAllowed || false,
@@ -304,6 +305,7 @@ const DEFAULT_STYLE = {
304
305
  fillColor: "",
305
306
  textColor: "",
306
307
  };
308
+ const DEFAULT_NUMBER_STYLE = { ...DEFAULT_STYLE, align: "right" };
307
309
  const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
308
310
  const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
309
311
  // Fonts
@@ -6493,11 +6495,20 @@ function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
6493
6495
  /**
6494
6496
  * Get the default height of the cell given its style.
6495
6497
  */
6496
- function getDefaultCellHeight(ctx, cell, colSize) {
6498
+ function getDefaultCellHeight(ctx, cell, locale, colSize) {
6497
6499
  if (!cell || (!cell.isFormula && !cell.content)) {
6498
6500
  return DEFAULT_CELL_HEIGHT;
6499
6501
  }
6500
- const content = cell.isFormula ? "" : cell.content;
6502
+ let content = "";
6503
+ try {
6504
+ if (!cell.isFormula) {
6505
+ const localeFormat = { format: cell.format, locale };
6506
+ content = formatValue(parseLiteral(cell.content, locale), localeFormat);
6507
+ }
6508
+ }
6509
+ catch {
6510
+ content = CellErrorType.GenericError;
6511
+ }
6501
6512
  return getCellContentHeight(ctx, content, cell.style, colSize);
6502
6513
  }
6503
6514
  function getCellContentHeight(ctx, content, style, colSize) {
@@ -19119,9 +19130,10 @@ function assertDomainLength(domain) {
19119
19130
  throw new EvaluationError(_t("Function PIVOT takes an even number of arguments."));
19120
19131
  }
19121
19132
  }
19122
- function addPivotDependencies(evalContext, coreDefinition, forMeasures) {
19133
+ function addPivotDependencies(evalContext, pivotId, forMeasures) {
19123
19134
  //TODO This function can be very costly when used with PIVOT.VALUE and PIVOT.HEADER
19124
19135
  const dependencies = [];
19136
+ const coreDefinition = evalContext.getters.getPivotCoreDefinition(pivotId);
19125
19137
  if (coreDefinition.type === "SPREADSHEET" && coreDefinition.dataSet) {
19126
19138
  const { sheetId, zone } = coreDefinition.dataSet;
19127
19139
  const xc = zoneToXc(zone);
@@ -19138,8 +19150,7 @@ function addPivotDependencies(evalContext, coreDefinition, forMeasures) {
19138
19150
  }
19139
19151
  for (const measure of forMeasures) {
19140
19152
  if (measure.computedBy) {
19141
- const formula = evalContext.getters.getMeasureCompiledFormula(measure);
19142
- dependencies.push(...formula.dependencies.filter((range) => !range.invalidXc));
19153
+ dependencies.push(...evalContext.getters.getMeasureFullDependencies(pivotId, measure));
19143
19154
  }
19144
19155
  }
19145
19156
  const originPosition = evalContext.__originCellPosition;
@@ -19580,7 +19591,7 @@ const PIVOT_VALUE = {
19580
19591
  assertDomainLength(domainArgs);
19581
19592
  const pivot = this.getters.getPivot(pivotId);
19582
19593
  const coreDefinition = this.getters.getPivotCoreDefinition(pivotId);
19583
- addPivotDependencies(this, coreDefinition, coreDefinition.measures.filter((m) => m.id === _measure));
19594
+ addPivotDependencies(this, pivotId, coreDefinition.measures.filter((m) => m.id === _measure));
19584
19595
  pivot.init({ reload: pivot.needsReevaluation });
19585
19596
  const error = pivot.assertIsValid({ throwOnError: false });
19586
19597
  if (error) {
@@ -19613,8 +19624,7 @@ const PIVOT_HEADER = {
19613
19624
  const _pivotId = getPivotId(_pivotFormulaId, this.getters);
19614
19625
  assertDomainLength(domainArgs);
19615
19626
  const pivot = this.getters.getPivot(_pivotId);
19616
- const coreDefinition = this.getters.getPivotCoreDefinition(_pivotId);
19617
- addPivotDependencies(this, coreDefinition, []);
19627
+ addPivotDependencies(this, _pivotId, []);
19618
19628
  pivot.init({ reload: pivot.needsReevaluation });
19619
19629
  const error = pivot.assertIsValid({ throwOnError: false });
19620
19630
  if (error) {
@@ -19668,7 +19678,7 @@ const PIVOT = {
19668
19678
  const pivotId = getPivotId(_pivotFormulaId, this.getters);
19669
19679
  const pivot = this.getters.getPivot(pivotId);
19670
19680
  const coreDefinition = this.getters.getPivotCoreDefinition(pivotId);
19671
- addPivotDependencies(this, coreDefinition, coreDefinition.measures);
19681
+ addPivotDependencies(this, pivotId, coreDefinition.measures);
19672
19682
  pivot.init({ reload: pivot.needsReevaluation });
19673
19683
  const error = pivot.assertIsValid({ throwOnError: false });
19674
19684
  if (error) {
@@ -20894,7 +20904,16 @@ function createComputeFunction(descr, functionName) {
20894
20904
  }
20895
20905
  acceptToVectorize.push(!argDefinition.acceptMatrix);
20896
20906
  }
20897
- return applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize);
20907
+ return replaceErrorPlaceholderInResult(applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize));
20908
+ }
20909
+ function replaceErrorPlaceholderInResult(result) {
20910
+ if (!isMatrix(result)) {
20911
+ replaceFunctionNamePlaceholder(result, functionName);
20912
+ }
20913
+ else {
20914
+ matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, functionName));
20915
+ }
20916
+ return result;
20898
20917
  }
20899
20918
  function errorHandlingCompute(...args) {
20900
20919
  for (let i = 0; i < args.length; i++) {
@@ -20921,13 +20940,11 @@ function createComputeFunction(descr, functionName) {
20921
20940
  const result = descr.compute.apply(this, args);
20922
20941
  if (!isMatrix(result)) {
20923
20942
  if (typeof result === "object" && result !== null && "value" in result) {
20924
- replaceFunctionNamePlaceholder(result, functionName);
20925
20943
  return result;
20926
20944
  }
20927
20945
  return { value: result };
20928
20946
  }
20929
20947
  if (typeof result[0][0] === "object" && result[0][0] !== null && "value" in result[0][0]) {
20930
- matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, functionName));
20931
20948
  return result;
20932
20949
  }
20933
20950
  return matrixMap(result, (row) => ({ value: row }));
@@ -21325,7 +21342,7 @@ class AbstractComposerStore extends SpreadsheetStore {
21325
21342
  }
21326
21343
  captureSelection(zone, col, row) {
21327
21344
  this.model.selection.capture(this, {
21328
- cell: { col: col ?? zone.left, row: row ?? zone.right },
21345
+ cell: { col: col ?? zone.left, row: row ?? zone.top },
21329
21346
  zone,
21330
21347
  }, {
21331
21348
  handleEvent: this.handleEvent.bind(this),
@@ -24840,6 +24857,7 @@ function extractStyle(data, content, styleId, formatId, borderId) {
24840
24857
  ? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign]
24841
24858
  : undefined,
24842
24859
  wrapText: style.wrapping === "wrap" || content?.includes(NEWLINE) ? true : undefined,
24860
+ shrinkToFit: style.wrapping === "clip" ? true : undefined,
24843
24861
  },
24844
24862
  };
24845
24863
  styles.font["strike"] = !!style?.strikethrough || undefined;
@@ -24860,6 +24878,7 @@ function normalizeStyle(construct, styles) {
24860
24878
  vertical: styles.alignment.vertical,
24861
24879
  horizontal: styles.alignment.horizontal,
24862
24880
  wrapText: styles.alignment.wrapText,
24881
+ shrinkToFit: styles.alignment.shrinkToFit,
24863
24882
  },
24864
24883
  };
24865
24884
  return pushElement(style, construct.styles);
@@ -40552,7 +40571,7 @@ class GaugeChartConfigPanel extends owl.Component {
40552
40571
  });
40553
40572
  dataRange = this.props.definition.dataRange;
40554
40573
  get configurationErrorMessages() {
40555
- const cancelledReasons = [...(this.state.dataRangeDispatchResult?.reasons || [])];
40574
+ const cancelledReasons = [...(this.state.dataRangeDispatchResult?.reasons || [])].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
40556
40575
  return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
40557
40576
  }
40558
40577
  get isDataRangeInvalid() {
@@ -41819,7 +41838,7 @@ class GaugeChartDesignPanel extends owl.Component {
41819
41838
  });
41820
41839
  }
41821
41840
  get designErrorMessages() {
41822
- const cancelledReasons = [...(this.state.sectionRuleCancelledReasons || [])];
41841
+ const cancelledReasons = [...(this.state.sectionRuleCancelledReasons || [])].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
41823
41842
  return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
41824
41843
  }
41825
41844
  get isRangeMinInvalid() {
@@ -42140,7 +42159,7 @@ class ScorecardChartConfigPanel extends owl.Component {
42140
42159
  const cancelledReasons = [
42141
42160
  ...(this.state.keyValueDispatchResult?.reasons || []),
42142
42161
  ...(this.state.baselineDispatchResult?.reasons || []),
42143
- ];
42162
+ ].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
42144
42163
  return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
42145
42164
  }
42146
42165
  get isKeyValueInvalid() {
@@ -44866,6 +44885,11 @@ class FindAndReplaceStore extends SpreadsheetStore {
44866
44885
  case "ACTIVATE_SHEET":
44867
44886
  this.isSearchDirty = true;
44868
44887
  this.shouldFinalizeUpdateSelection = true;
44888
+ if (this.searchOptions.specificRange) {
44889
+ this.searchOptions.specificRange = this.searchOptions.specificRange.clone({
44890
+ sheetId: this.getters.getActiveSheetId(),
44891
+ });
44892
+ }
44869
44893
  break;
44870
44894
  case "REPLACE_SEARCH":
44871
44895
  for (const match of cmd.matches) {
@@ -45287,9 +45311,20 @@ class FindAndReplacePanel extends owl.Component {
45287
45311
  const specificRange = this.env.model.getters.getRangeFromSheetXC(this.env.model.getters.getActiveSheetId(), this.state.dataRange);
45288
45312
  this.store.updateSearchOptions({ specificRange });
45289
45313
  }
45314
+ get specificRange() {
45315
+ const range = this.store.searchOptions.specificRange;
45316
+ return range ? this.env.model.getters.getRangeString(range, "forceSheetReference") : "";
45317
+ }
45290
45318
  get pendingSearch() {
45291
45319
  return this.updateSearchContent.isDebouncePending();
45292
45320
  }
45321
+ get selectionInputKey() {
45322
+ // Selections input are made to work with objects linked to a sheet id. They store the active sheet id at their creation,
45323
+ // and have specific behaviour linked to it (eg. go back to the initial sheet after confirmation).
45324
+ // We don't want all those behaviors here, so we force the recreation of the component when the active sheet changes.
45325
+ // The only drawback is that the input loses focus when changing sheet.
45326
+ return this.env.model.getters.getActiveSheetId();
45327
+ }
45293
45328
  }
45294
45329
 
45295
45330
  css /* scss */ `
@@ -55200,7 +55235,7 @@ class CellPlugin extends CorePlugin {
55200
55235
  for (const position of positions) {
55201
55236
  const cell = this.getters.getCell(position);
55202
55237
  const xc = toXC(position.col, position.row);
55203
- const style = this.removeDefaultStyleValues(cell.style);
55238
+ const style = this.extractCustomStyle(cell);
55204
55239
  if (Object.keys(style).length) {
55205
55240
  const styleId = getItemId(style, styles);
55206
55241
  positionsByStyle[styleId] ??= [];
@@ -55246,10 +55281,14 @@ class CellPlugin extends CorePlugin {
55246
55281
  }
55247
55282
  }
55248
55283
  }
55249
- removeDefaultStyleValues(style) {
55250
- const cleanedStyle = { ...style };
55251
- for (const property in DEFAULT_STYLE) {
55252
- if (cleanedStyle[property] === DEFAULT_STYLE[property]) {
55284
+ extractCustomStyle(cell) {
55285
+ const cleanedStyle = { ...cell.style };
55286
+ const defaultStyle = isNumber(cell.content, DEFAULT_LOCALE)
55287
+ ? DEFAULT_NUMBER_STYLE
55288
+ : DEFAULT_STYLE;
55289
+ for (const property in cleanedStyle) {
55290
+ if ((property !== "align" || !cell.isFormula) &&
55291
+ cleanedStyle[property] === defaultStyle[property]) {
55253
55292
  delete cleanedStyle[property];
55254
55293
  }
55255
55294
  }
@@ -59820,6 +59859,7 @@ class PivotCorePlugin extends CorePlugin {
59820
59859
  "getMeasureCompiledFormula",
59821
59860
  "getPivotName",
59822
59861
  "isExistingPivot",
59862
+ "getMeasureFullDependencies",
59823
59863
  ];
59824
59864
  nextFormulaId = 1;
59825
59865
  pivots = {};
@@ -59902,7 +59942,7 @@ class PivotCorePlugin extends CorePlugin {
59902
59942
  }
59903
59943
  case "UPDATE_PIVOT": {
59904
59944
  this.history.update("pivots", cmd.pivotId, "definition", this.repairSortedColumn(deepCopy(cmd.pivot)));
59905
- this.compileCalculatedMeasures(cmd.pivot.measures);
59945
+ this.compileCalculatedMeasures(cmd.pivotId, cmd.pivot.measures);
59906
59946
  break;
59907
59947
  }
59908
59948
  }
@@ -59920,9 +59960,14 @@ class PivotCorePlugin extends CorePlugin {
59920
59960
  this.history.update("pivots", pivotId, "definition", newDefinition);
59921
59961
  }
59922
59962
  }
59923
- for (const sheetId in this.compiledMeasureFormulas) {
59924
- for (const formulaString in this.compiledMeasureFormulas[sheetId]) {
59925
- const compiledFormula = this.compiledMeasureFormulas[sheetId][formulaString];
59963
+ for (const pivotId in this.compiledMeasureFormulas) {
59964
+ for (const measureId in this.compiledMeasureFormulas[pivotId]) {
59965
+ const measure = this.pivots[pivotId]?.definition.measures.find((m) => m.id === measureId);
59966
+ if (!measure || !measure.computedBy) {
59967
+ continue;
59968
+ }
59969
+ const sheetId = measure.computedBy.sheetId;
59970
+ const compiledFormula = this.compiledMeasureFormulas[pivotId][measureId].formula;
59926
59971
  const newDependencies = [];
59927
59972
  for (const range of compiledFormula.dependencies) {
59928
59973
  const change = applyChange(range);
@@ -59934,8 +59979,9 @@ class PivotCorePlugin extends CorePlugin {
59934
59979
  }
59935
59980
  }
59936
59981
  const newFormulaString = this.getters.getFormulaString(sheetId, compiledFormula.tokens, newDependencies);
59937
- if (newFormulaString !== formulaString) {
59938
- this.replaceMeasureFormula(sheetId, formulaString, newFormulaString);
59982
+ const oldFormulaString = measure.computedBy.formula;
59983
+ if (newFormulaString !== oldFormulaString) {
59984
+ this.replaceMeasureFormula(pivotId, measure, newFormulaString);
59939
59985
  }
59940
59986
  }
59941
59987
  }
@@ -59973,12 +60019,17 @@ class PivotCorePlugin extends CorePlugin {
59973
60019
  isExistingPivot(pivotId) {
59974
60020
  return pivotId in this.pivots;
59975
60021
  }
59976
- getMeasureCompiledFormula(measure) {
60022
+ getMeasureCompiledFormula(pivotId, measure) {
59977
60023
  if (!measure.computedBy) {
59978
60024
  throw new Error(`Measure ${measure.fieldName} is not computed by formula`);
59979
60025
  }
59980
- const sheetId = measure.computedBy.sheetId;
59981
- return this.compiledMeasureFormulas[sheetId][measure.computedBy.formula];
60026
+ return this.compiledMeasureFormulas[pivotId][measure.id].formula;
60027
+ }
60028
+ getMeasureFullDependencies(pivotId, measure) {
60029
+ if (!measure.computedBy) {
60030
+ throw new Error(`Measure ${measure.fieldName} is not computed by formula`);
60031
+ }
60032
+ return this.compiledMeasureFormulas[pivotId][measure.id].dependencies;
59982
60033
  }
59983
60034
  // -------------------------------------------------------------------------
59984
60035
  // Private
@@ -59988,19 +60039,43 @@ class PivotCorePlugin extends CorePlugin {
59988
60039
  definition: this.repairSortedColumn(deepCopy(pivot)),
59989
60040
  formulaId,
59990
60041
  });
59991
- this.compileCalculatedMeasures(pivot.measures);
60042
+ this.compileCalculatedMeasures(pivotId, pivot.measures);
59992
60043
  this.history.update("formulaIds", formulaId, pivotId);
59993
60044
  this.history.update("nextFormulaId", this.nextFormulaId + 1);
59994
60045
  }
59995
- compileCalculatedMeasures(measures) {
60046
+ compileCalculatedMeasures(pivotId, measures) {
59996
60047
  for (const measure of measures) {
59997
60048
  if (measure.computedBy) {
59998
- const sheetId = measure.computedBy.sheetId;
59999
60049
  const compiledFormula = this.compileMeasureFormula(measure.computedBy.sheetId, measure.computedBy.formula);
60000
- this.history.update("compiledMeasureFormulas", sheetId, measure.computedBy.formula, compiledFormula);
60050
+ this.history.update("compiledMeasureFormulas", pivotId, measure.id, "formula", compiledFormula);
60051
+ }
60052
+ }
60053
+ for (const measure of measures) {
60054
+ if (measure.computedBy) {
60055
+ const dependencies = this.computeMeasureFullDependencies(pivotId, measure);
60056
+ this.history.update("compiledMeasureFormulas", pivotId, measure.id, "dependencies", dependencies);
60001
60057
  }
60002
60058
  }
60003
60059
  }
60060
+ computeMeasureFullDependencies(pivotId, measure, exploredMeasures = new Set()) {
60061
+ const rangeDependencies = [];
60062
+ const definition = this.getPivotCoreDefinition(pivotId);
60063
+ const formula = this.getMeasureCompiledFormula(pivotId, measure);
60064
+ exploredMeasures.add(measure.id);
60065
+ for (const token of formula.tokens) {
60066
+ if (token.type !== "SYMBOL") {
60067
+ continue;
60068
+ }
60069
+ const otherMeasure = definition.measures.find((measureCandidate) => getCanonicalSymbolName(measureCandidate.id) === token.value &&
60070
+ measure.id !== measureCandidate.id);
60071
+ if (!otherMeasure || exploredMeasures.has(otherMeasure.id) || !otherMeasure.computedBy) {
60072
+ continue;
60073
+ }
60074
+ rangeDependencies.push(...this.computeMeasureFullDependencies(pivotId, otherMeasure, exploredMeasures));
60075
+ }
60076
+ rangeDependencies.push(...formula.dependencies.filter((range) => !range.invalidXc));
60077
+ return rangeDependencies;
60078
+ }
60004
60079
  insertPivot(position, formulaId, table) {
60005
60080
  this.resizeSheet(position.sheetId, position, table);
60006
60081
  const pivotCells = table.getPivotCells();
@@ -60057,21 +60132,17 @@ class PivotCorePlugin extends CorePlugin {
60057
60132
  dependencies: rangeDependencies,
60058
60133
  };
60059
60134
  }
60060
- replaceMeasureFormula(sheetId, formulaString, newFormulaString) {
60061
- this.history.update("compiledMeasureFormulas", sheetId, formulaString, undefined);
60062
- this.history.update("compiledMeasureFormulas", sheetId, newFormulaString, this.compileMeasureFormula(sheetId, newFormulaString));
60063
- for (const pivotId in this.pivots) {
60064
- const pivot = this.pivots[pivotId];
60065
- if (!pivot) {
60066
- continue;
60067
- }
60068
- for (const measure of pivot.definition.measures) {
60069
- if (measure.computedBy?.formula === formulaString) {
60070
- const measureIndex = pivot.definition.measures.indexOf(measure);
60071
- this.history.update("pivots", pivotId, "definition", "measures", measureIndex, "computedBy", { formula: newFormulaString, sheetId });
60072
- }
60073
- }
60135
+ replaceMeasureFormula(pivotId, measure, newFormulaString) {
60136
+ const pivot = this.pivots[pivotId];
60137
+ if (!pivot) {
60138
+ return;
60074
60139
  }
60140
+ const measureIndex = pivot.definition.measures.indexOf(measure);
60141
+ this.history.update("pivots", pivotId, "definition", "measures", measureIndex, "computedBy", {
60142
+ formula: newFormulaString,
60143
+ sheetId: measure.computedBy.sheetId,
60144
+ });
60145
+ this.compileCalculatedMeasures(pivotId, pivot.definition.measures);
60075
60146
  }
60076
60147
  checkDuplicatedMeasureIds(definition) {
60077
60148
  const uniqueIds = new Set(definition.measures.map((m) => m.id));
@@ -61468,11 +61539,16 @@ class SpreadingRelation {
61468
61539
  return this.arrayFormulasToResults.get(formulasPosition);
61469
61540
  }
61470
61541
  /**
61471
- * Remove a node, also remove it from other nodes adjacency list
61542
+ * Remove a spreading relation for a given array formula position
61543
+ * and its result zone
61472
61544
  */
61473
61545
  removeNode(position) {
61546
+ const resultZone = this.arrayFormulasToResults.get(position);
61547
+ if (!resultZone) {
61548
+ return;
61549
+ }
61474
61550
  this.resultsToArrayFormulas.remove({
61475
- boundingBox: { sheetId: position.sheetId, zone: positionToZone(position) },
61551
+ boundingBox: { sheetId: position.sheetId, zone: resultZone },
61476
61552
  data: position,
61477
61553
  });
61478
61554
  this.arrayFormulasToResults.delete(position);
@@ -61760,6 +61836,10 @@ class Evaluator {
61760
61836
  // empty matrix
61761
61837
  return createEvaluatedCell({ value: 0 }, this.getters.getLocale(), cellData);
61762
61838
  }
61839
+ if (nbRows === 1 && nbColumns === 1) {
61840
+ // single value matrix
61841
+ return createEvaluatedCell(nullValueToZeroValue(formulaReturn[0][0]), this.getters.getLocale(), cellData);
61842
+ }
61763
61843
  const resultZone = {
61764
61844
  top: formulaPosition.row,
61765
61845
  bottom: formulaPosition.row + nbRows - 1,
@@ -63184,6 +63264,7 @@ class HeaderSizeUIPlugin extends CoreViewPlugin {
63184
63264
  handle(cmd) {
63185
63265
  switch (cmd.type) {
63186
63266
  case "START":
63267
+ case "UPDATE_LOCALE":
63187
63268
  for (const sheetId of this.getters.getSheetIds()) {
63188
63269
  this.initializeSheet(sheetId);
63189
63270
  }
@@ -63289,7 +63370,7 @@ class HeaderSizeUIPlugin extends CoreViewPlugin {
63289
63370
  }
63290
63371
  const cell = this.getters.getCell(position);
63291
63372
  const colSize = this.getters.getColSize(position.sheetId, position.col);
63292
- return getDefaultCellHeight(this.ctx, cell, colSize);
63373
+ return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
63293
63374
  }
63294
63375
  isInMultiRowMerge(position) {
63295
63376
  const merge = this.getters.getMerge(position);
@@ -63336,14 +63417,16 @@ const PERCENT_FORMAT = "0.00%";
63336
63417
  function withPivotPresentationLayer (PivotClass) {
63337
63418
  class PivotPresentationLayer extends PivotClass {
63338
63419
  getters;
63420
+ pivotId;
63339
63421
  cache = {};
63340
63422
  rankAsc = {};
63341
63423
  rankDesc = {};
63342
63424
  runningTotal = {};
63343
63425
  runningTotalInPercent = {};
63344
- constructor(custom, params) {
63426
+ constructor(pivotId, custom, params) {
63345
63427
  super(custom, params);
63346
63428
  this.getters = params.getters;
63429
+ this.pivotId = pivotId;
63347
63430
  }
63348
63431
  markAsDirtyForEvaluation() {
63349
63432
  this.cache = {};
@@ -63393,7 +63476,7 @@ function withPivotPresentationLayer (PivotClass) {
63393
63476
  return handleError(error, measure.aggregator.toUpperCase());
63394
63477
  }
63395
63478
  }
63396
- const formula = this.getters.getMeasureCompiledFormula(measure);
63479
+ const formula = this.getters.getMeasureCompiledFormula(this.pivotId, measure);
63397
63480
  const getSymbolValue = (symbolName) => {
63398
63481
  const { columns, rows } = this.definition;
63399
63482
  if (columns.find((col) => col.nameWithGranularity === symbolName)) {
@@ -64121,7 +64204,7 @@ class PivotUIPlugin extends CoreViewPlugin {
64121
64204
  const definition = deepCopy(this.getters.getPivotCoreDefinition(pivotId));
64122
64205
  if (!(pivotId in this.pivots)) {
64123
64206
  const Pivot = withPivotPresentationLayer(pivotRegistry.get(definition.type).ui);
64124
- this.pivots[pivotId] = new Pivot(this.custom, { definition, getters: this.getters });
64207
+ this.pivots[pivotId] = new Pivot(pivotId, this.custom, { definition, getters: this.getters });
64125
64208
  }
64126
64209
  else if (recreate) {
64127
64210
  this.pivots[pivotId].onDefinitionChange(definition);
@@ -75927,6 +76010,9 @@ function addStyles(styles) {
75927
76010
  if (style.alignment && style.alignment.wrapText) {
75928
76011
  alignAttrs.push(["wrapText", "1"]);
75929
76012
  }
76013
+ if (style.alignment && style.alignment.shrinkToFit) {
76014
+ alignAttrs.push(["shrinkToFit", "1"]);
76015
+ }
75930
76016
  if (alignAttrs.length > 0) {
75931
76017
  attributes.push(["applyAlignment", "1"]); // for Libre Office
75932
76018
  styleNodes.push(escapeXml /*xml*/ `<xf ${formatAttributes(attributes)}><alignment ${formatAttributes(alignAttrs)} /></xf> `);
@@ -77421,6 +77507,6 @@ exports.tokenColors = tokenColors;
77421
77507
  exports.tokenize = tokenize;
77422
77508
 
77423
77509
 
77424
- __info__.version = "18.2.39";
77425
- __info__.date = "2025-12-26T10:18:44.735Z";
77426
- __info__.hash = "3de2479";
77510
+ __info__.version = "18.2.41";
77511
+ __info__.date = "2026-01-21T11:04:23.927Z";
77512
+ __info__.hash = "2d9316b";