@odoo/o-spreadsheet 18.0.54 → 18.0.55

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.0.54
6
- * @date 2026-01-14T10:00:02.287Z
7
- * @hash c0048a0
5
+ * @version 18.0.55
6
+ * @date 2026-01-21T11:03:48.979Z
7
+ * @hash 0c94015
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,
@@ -302,6 +303,7 @@ const DEFAULT_STYLE = {
302
303
  fillColor: "",
303
304
  textColor: "",
304
305
  };
306
+ const DEFAULT_NUMBER_STYLE = { ...DEFAULT_STYLE, align: "right" };
305
307
  const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
306
308
  const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
307
309
  // Fonts
@@ -6315,11 +6317,20 @@ function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
6315
6317
  /**
6316
6318
  * Get the default height of the cell given its style.
6317
6319
  */
6318
- function getDefaultCellHeight(ctx, cell, colSize) {
6320
+ function getDefaultCellHeight(ctx, cell, locale, colSize) {
6319
6321
  if (!cell || (!cell.isFormula && !cell.content)) {
6320
6322
  return DEFAULT_CELL_HEIGHT;
6321
6323
  }
6322
- const content = cell.isFormula ? "" : cell.content;
6324
+ let content = "";
6325
+ try {
6326
+ if (!cell.isFormula) {
6327
+ const localeFormat = { format: cell.format, locale };
6328
+ content = formatValue(parseLiteral(cell.content, locale), localeFormat);
6329
+ }
6330
+ }
6331
+ catch {
6332
+ content = CellErrorType.GenericError;
6333
+ }
6323
6334
  return getCellContentHeight(ctx, content, cell.style, colSize);
6324
6335
  }
6325
6336
  function getCellContentHeight(ctx, content, style, colSize) {
@@ -20321,7 +20332,16 @@ function createComputeFunction(descr, functionName) {
20321
20332
  }
20322
20333
  acceptToVectorize.push(!argDefinition.acceptMatrix);
20323
20334
  }
20324
- return applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize);
20335
+ return replaceErrorPlaceholderInResult(applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize));
20336
+ }
20337
+ function replaceErrorPlaceholderInResult(result) {
20338
+ if (!isMatrix(result)) {
20339
+ replaceFunctionNamePlaceholder(result, functionName);
20340
+ }
20341
+ else {
20342
+ matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, functionName));
20343
+ }
20344
+ return result;
20325
20345
  }
20326
20346
  function errorHandlingCompute(...args) {
20327
20347
  for (let i = 0; i < args.length; i++) {
@@ -20345,13 +20365,11 @@ function createComputeFunction(descr, functionName) {
20345
20365
  const result = descr.compute.apply(this, args);
20346
20366
  if (!isMatrix(result)) {
20347
20367
  if (typeof result === "object" && result !== null && "value" in result) {
20348
- replaceFunctionNamePlaceholder(result, functionName);
20349
20368
  return result;
20350
20369
  }
20351
20370
  return { value: result };
20352
20371
  }
20353
20372
  if (typeof result[0][0] === "object" && result[0][0] !== null && "value" in result[0][0]) {
20354
- matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, functionName));
20355
20373
  return result;
20356
20374
  }
20357
20375
  return matrixMap(result, (row) => ({ value: row }));
@@ -21797,6 +21815,7 @@ function extractStyle(cell, data) {
21797
21815
  ? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign]
21798
21816
  : undefined,
21799
21817
  wrapText: style.wrapping === "wrap" || cell.content?.includes(NEWLINE) ? true : undefined,
21818
+ shrinkToFit: style.wrapping === "clip" ? true : undefined,
21800
21819
  },
21801
21820
  };
21802
21821
  styles.font["strike"] = !!style?.strikethrough || undefined;
@@ -21823,6 +21842,7 @@ function normalizeStyle(construct, styles) {
21823
21842
  vertical: styles.alignment.vertical,
21824
21843
  horizontal: styles.alignment.horizontal,
21825
21844
  wrapText: styles.alignment.wrapText,
21845
+ shrinkToFit: styles.alignment.shrinkToFit,
21826
21846
  },
21827
21847
  };
21828
21848
  return pushElement(style, construct.styles);
@@ -52630,7 +52650,7 @@ class CellPlugin extends CorePlugin {
52630
52650
  for (const position of positions) {
52631
52651
  const cell = this.getters.getCell(position);
52632
52652
  const xc = toXC(position.col, position.row);
52633
- const style = this.removeDefaultStyleValues(cell.style);
52653
+ const style = this.extractCustomStyle(cell);
52634
52654
  if (Object.keys(style).length) {
52635
52655
  const styleId = getItemId(style, styles);
52636
52656
  positionsByStyle[styleId] ??= [];
@@ -52671,7 +52691,7 @@ class CellPlugin extends CorePlugin {
52671
52691
  }
52672
52692
  if (cell?.style) {
52673
52693
  sheet.cells[xc] ??= {};
52674
- sheet.cells[xc].style = getItemId(this.removeDefaultStyleValues(cell.style), data.styles);
52694
+ sheet.cells[xc].style = getItemId(this.extractCustomStyle(cell), data.styles);
52675
52695
  }
52676
52696
  }
52677
52697
  }
@@ -52694,10 +52714,14 @@ class CellPlugin extends CorePlugin {
52694
52714
  }
52695
52715
  }
52696
52716
  }
52697
- removeDefaultStyleValues(style) {
52698
- const cleanedStyle = { ...style };
52699
- for (const property in DEFAULT_STYLE) {
52700
- if (cleanedStyle[property] === DEFAULT_STYLE[property]) {
52717
+ extractCustomStyle(cell) {
52718
+ const cleanedStyle = { ...cell.style };
52719
+ const defaultStyle = isNumber(cell.content, DEFAULT_LOCALE)
52720
+ ? DEFAULT_NUMBER_STYLE
52721
+ : DEFAULT_STYLE;
52722
+ for (const property in cleanedStyle) {
52723
+ if ((property !== "align" || !cell.isFormula) &&
52724
+ cleanedStyle[property] === defaultStyle[property]) {
52701
52725
  delete cleanedStyle[property];
52702
52726
  }
52703
52727
  }
@@ -58893,11 +58917,16 @@ class SpreadingRelation {
58893
58917
  return this.arrayFormulasToResults.get(formulasPosition);
58894
58918
  }
58895
58919
  /**
58896
- * Remove a node, also remove it from other nodes adjacency list
58920
+ * Remove a spreading relation for a given array formula position
58921
+ * and its result zone
58897
58922
  */
58898
58923
  removeNode(position) {
58924
+ const resultZone = this.arrayFormulasToResults.get(position);
58925
+ if (!resultZone) {
58926
+ return;
58927
+ }
58899
58928
  this.resultsToArrayFormulas.remove({
58900
- boundingBox: { sheetId: position.sheetId, zone: positionToZone(position) },
58929
+ boundingBox: { sheetId: position.sheetId, zone: resultZone },
58901
58930
  data: position,
58902
58931
  });
58903
58932
  this.arrayFormulasToResults.delete(position);
@@ -59181,6 +59210,10 @@ class Evaluator {
59181
59210
  // empty matrix
59182
59211
  return createEvaluatedCell({ value: 0 }, this.getters.getLocale(), cellData);
59183
59212
  }
59213
+ if (nbRows === 1 && nbColumns === 1) {
59214
+ // single value matrix
59215
+ return createEvaluatedCell(nullValueToZeroValue(formulaReturn[0][0]), this.getters.getLocale(), cellData);
59216
+ }
59184
59217
  const resultZone = {
59185
59218
  top: formulaPosition.row,
59186
59219
  bottom: formulaPosition.row + nbRows - 1,
@@ -60640,6 +60673,7 @@ class HeaderSizeUIPlugin extends UIPlugin {
60640
60673
  handle(cmd) {
60641
60674
  switch (cmd.type) {
60642
60675
  case "START":
60676
+ case "UPDATE_LOCALE":
60643
60677
  for (const sheetId of this.getters.getSheetIds()) {
60644
60678
  this.initializeSheet(sheetId);
60645
60679
  }
@@ -60745,7 +60779,7 @@ class HeaderSizeUIPlugin extends UIPlugin {
60745
60779
  }
60746
60780
  const cell = this.getters.getCell(position);
60747
60781
  const colSize = this.getters.getColSize(position.sheetId, position.col);
60748
- return getDefaultCellHeight(this.ctx, cell, colSize);
60782
+ return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
60749
60783
  }
60750
60784
  isInMultiRowMerge(position) {
60751
60785
  const merge = this.getters.getMerge(position);
@@ -73376,6 +73410,9 @@ function addStyles(styles) {
73376
73410
  if (style.alignment && style.alignment.wrapText) {
73377
73411
  alignAttrs.push(["wrapText", "1"]);
73378
73412
  }
73413
+ if (style.alignment && style.alignment.shrinkToFit) {
73414
+ alignAttrs.push(["shrinkToFit", "1"]);
73415
+ }
73379
73416
  if (alignAttrs.length > 0) {
73380
73417
  attributes.push(["applyAlignment", "1"]); // for Libre Office
73381
73418
  styleNodes.push(escapeXml /*xml*/ `<xf ${formatAttributes(attributes)}><alignment ${formatAttributes(alignAttrs)} /></xf> `);
@@ -74843,6 +74880,6 @@ exports.tokenColors = tokenColors;
74843
74880
  exports.tokenize = tokenize;
74844
74881
 
74845
74882
 
74846
- __info__.version = "18.0.54";
74847
- __info__.date = "2026-01-14T10:00:02.287Z";
74848
- __info__.hash = "c0048a0";
74883
+ __info__.version = "18.0.55";
74884
+ __info__.date = "2026-01-21T11:03:48.979Z";
74885
+ __info__.hash = "0c94015";
@@ -3764,7 +3764,7 @@ declare class CellPlugin extends CorePlugin<CoreState$1> implements CoreState$1
3764
3764
  export(data: WorkbookData): void;
3765
3765
  importCell(sheetId: UID, content?: string, style?: Style, format?: Format): Cell;
3766
3766
  exportForExcel(data: ExcelWorkbookData): void;
3767
- private removeDefaultStyleValues;
3767
+ private extractCustomStyle;
3768
3768
  getCells(sheetId: UID): Record<UID, Cell>;
3769
3769
  /**
3770
3770
  * get a cell by ID. Used in evaluation when evaluating an async cell, we need to be able to find it back after
@@ -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.0.54
6
- * @date 2026-01-14T10:00:02.287Z
7
- * @hash c0048a0
5
+ * @version 18.0.55
6
+ * @date 2026-01-21T11:03:48.979Z
7
+ * @hash 0c94015
8
8
  */
9
9
 
10
10
  import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
@@ -32,7 +32,8 @@ function createAction(item) {
32
32
  return children
33
33
  .map((child) => (typeof child === "function" ? child(env) : child))
34
34
  .flat()
35
- .map(createAction);
35
+ .map(createAction)
36
+ .sort((a, b) => a.sequence - b.sequence);
36
37
  }
37
38
  : () => [],
38
39
  isReadonlyAllowed: item.isReadonlyAllowed || false,
@@ -300,6 +301,7 @@ const DEFAULT_STYLE = {
300
301
  fillColor: "",
301
302
  textColor: "",
302
303
  };
304
+ const DEFAULT_NUMBER_STYLE = { ...DEFAULT_STYLE, align: "right" };
303
305
  const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
304
306
  const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
305
307
  // Fonts
@@ -6313,11 +6315,20 @@ function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
6313
6315
  /**
6314
6316
  * Get the default height of the cell given its style.
6315
6317
  */
6316
- function getDefaultCellHeight(ctx, cell, colSize) {
6318
+ function getDefaultCellHeight(ctx, cell, locale, colSize) {
6317
6319
  if (!cell || (!cell.isFormula && !cell.content)) {
6318
6320
  return DEFAULT_CELL_HEIGHT;
6319
6321
  }
6320
- const content = cell.isFormula ? "" : cell.content;
6322
+ let content = "";
6323
+ try {
6324
+ if (!cell.isFormula) {
6325
+ const localeFormat = { format: cell.format, locale };
6326
+ content = formatValue(parseLiteral(cell.content, locale), localeFormat);
6327
+ }
6328
+ }
6329
+ catch {
6330
+ content = CellErrorType.GenericError;
6331
+ }
6321
6332
  return getCellContentHeight(ctx, content, cell.style, colSize);
6322
6333
  }
6323
6334
  function getCellContentHeight(ctx, content, style, colSize) {
@@ -20319,7 +20330,16 @@ function createComputeFunction(descr, functionName) {
20319
20330
  }
20320
20331
  acceptToVectorize.push(!argDefinition.acceptMatrix);
20321
20332
  }
20322
- return applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize);
20333
+ return replaceErrorPlaceholderInResult(applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize));
20334
+ }
20335
+ function replaceErrorPlaceholderInResult(result) {
20336
+ if (!isMatrix(result)) {
20337
+ replaceFunctionNamePlaceholder(result, functionName);
20338
+ }
20339
+ else {
20340
+ matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, functionName));
20341
+ }
20342
+ return result;
20323
20343
  }
20324
20344
  function errorHandlingCompute(...args) {
20325
20345
  for (let i = 0; i < args.length; i++) {
@@ -20343,13 +20363,11 @@ function createComputeFunction(descr, functionName) {
20343
20363
  const result = descr.compute.apply(this, args);
20344
20364
  if (!isMatrix(result)) {
20345
20365
  if (typeof result === "object" && result !== null && "value" in result) {
20346
- replaceFunctionNamePlaceholder(result, functionName);
20347
20366
  return result;
20348
20367
  }
20349
20368
  return { value: result };
20350
20369
  }
20351
20370
  if (typeof result[0][0] === "object" && result[0][0] !== null && "value" in result[0][0]) {
20352
- matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, functionName));
20353
20371
  return result;
20354
20372
  }
20355
20373
  return matrixMap(result, (row) => ({ value: row }));
@@ -21795,6 +21813,7 @@ function extractStyle(cell, data) {
21795
21813
  ? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign]
21796
21814
  : undefined,
21797
21815
  wrapText: style.wrapping === "wrap" || cell.content?.includes(NEWLINE) ? true : undefined,
21816
+ shrinkToFit: style.wrapping === "clip" ? true : undefined,
21798
21817
  },
21799
21818
  };
21800
21819
  styles.font["strike"] = !!style?.strikethrough || undefined;
@@ -21821,6 +21840,7 @@ function normalizeStyle(construct, styles) {
21821
21840
  vertical: styles.alignment.vertical,
21822
21841
  horizontal: styles.alignment.horizontal,
21823
21842
  wrapText: styles.alignment.wrapText,
21843
+ shrinkToFit: styles.alignment.shrinkToFit,
21824
21844
  },
21825
21845
  };
21826
21846
  return pushElement(style, construct.styles);
@@ -52628,7 +52648,7 @@ class CellPlugin extends CorePlugin {
52628
52648
  for (const position of positions) {
52629
52649
  const cell = this.getters.getCell(position);
52630
52650
  const xc = toXC(position.col, position.row);
52631
- const style = this.removeDefaultStyleValues(cell.style);
52651
+ const style = this.extractCustomStyle(cell);
52632
52652
  if (Object.keys(style).length) {
52633
52653
  const styleId = getItemId(style, styles);
52634
52654
  positionsByStyle[styleId] ??= [];
@@ -52669,7 +52689,7 @@ class CellPlugin extends CorePlugin {
52669
52689
  }
52670
52690
  if (cell?.style) {
52671
52691
  sheet.cells[xc] ??= {};
52672
- sheet.cells[xc].style = getItemId(this.removeDefaultStyleValues(cell.style), data.styles);
52692
+ sheet.cells[xc].style = getItemId(this.extractCustomStyle(cell), data.styles);
52673
52693
  }
52674
52694
  }
52675
52695
  }
@@ -52692,10 +52712,14 @@ class CellPlugin extends CorePlugin {
52692
52712
  }
52693
52713
  }
52694
52714
  }
52695
- removeDefaultStyleValues(style) {
52696
- const cleanedStyle = { ...style };
52697
- for (const property in DEFAULT_STYLE) {
52698
- if (cleanedStyle[property] === DEFAULT_STYLE[property]) {
52715
+ extractCustomStyle(cell) {
52716
+ const cleanedStyle = { ...cell.style };
52717
+ const defaultStyle = isNumber(cell.content, DEFAULT_LOCALE)
52718
+ ? DEFAULT_NUMBER_STYLE
52719
+ : DEFAULT_STYLE;
52720
+ for (const property in cleanedStyle) {
52721
+ if ((property !== "align" || !cell.isFormula) &&
52722
+ cleanedStyle[property] === defaultStyle[property]) {
52699
52723
  delete cleanedStyle[property];
52700
52724
  }
52701
52725
  }
@@ -58891,11 +58915,16 @@ class SpreadingRelation {
58891
58915
  return this.arrayFormulasToResults.get(formulasPosition);
58892
58916
  }
58893
58917
  /**
58894
- * Remove a node, also remove it from other nodes adjacency list
58918
+ * Remove a spreading relation for a given array formula position
58919
+ * and its result zone
58895
58920
  */
58896
58921
  removeNode(position) {
58922
+ const resultZone = this.arrayFormulasToResults.get(position);
58923
+ if (!resultZone) {
58924
+ return;
58925
+ }
58897
58926
  this.resultsToArrayFormulas.remove({
58898
- boundingBox: { sheetId: position.sheetId, zone: positionToZone(position) },
58927
+ boundingBox: { sheetId: position.sheetId, zone: resultZone },
58899
58928
  data: position,
58900
58929
  });
58901
58930
  this.arrayFormulasToResults.delete(position);
@@ -59179,6 +59208,10 @@ class Evaluator {
59179
59208
  // empty matrix
59180
59209
  return createEvaluatedCell({ value: 0 }, this.getters.getLocale(), cellData);
59181
59210
  }
59211
+ if (nbRows === 1 && nbColumns === 1) {
59212
+ // single value matrix
59213
+ return createEvaluatedCell(nullValueToZeroValue(formulaReturn[0][0]), this.getters.getLocale(), cellData);
59214
+ }
59182
59215
  const resultZone = {
59183
59216
  top: formulaPosition.row,
59184
59217
  bottom: formulaPosition.row + nbRows - 1,
@@ -60638,6 +60671,7 @@ class HeaderSizeUIPlugin extends UIPlugin {
60638
60671
  handle(cmd) {
60639
60672
  switch (cmd.type) {
60640
60673
  case "START":
60674
+ case "UPDATE_LOCALE":
60641
60675
  for (const sheetId of this.getters.getSheetIds()) {
60642
60676
  this.initializeSheet(sheetId);
60643
60677
  }
@@ -60743,7 +60777,7 @@ class HeaderSizeUIPlugin extends UIPlugin {
60743
60777
  }
60744
60778
  const cell = this.getters.getCell(position);
60745
60779
  const colSize = this.getters.getColSize(position.sheetId, position.col);
60746
- return getDefaultCellHeight(this.ctx, cell, colSize);
60780
+ return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
60747
60781
  }
60748
60782
  isInMultiRowMerge(position) {
60749
60783
  const merge = this.getters.getMerge(position);
@@ -73374,6 +73408,9 @@ function addStyles(styles) {
73374
73408
  if (style.alignment && style.alignment.wrapText) {
73375
73409
  alignAttrs.push(["wrapText", "1"]);
73376
73410
  }
73411
+ if (style.alignment && style.alignment.shrinkToFit) {
73412
+ alignAttrs.push(["shrinkToFit", "1"]);
73413
+ }
73377
73414
  if (alignAttrs.length > 0) {
73378
73415
  attributes.push(["applyAlignment", "1"]); // for Libre Office
73379
73416
  styleNodes.push(escapeXml /*xml*/ `<xf ${formatAttributes(attributes)}><alignment ${formatAttributes(alignAttrs)} /></xf> `);
@@ -74798,6 +74835,6 @@ const constants = {
74798
74835
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
74799
74836
 
74800
74837
 
74801
- __info__.version = "18.0.54";
74802
- __info__.date = "2026-01-14T10:00:02.287Z";
74803
- __info__.hash = "c0048a0";
74838
+ __info__.version = "18.0.55";
74839
+ __info__.date = "2026-01-21T11:03:48.979Z";
74840
+ __info__.hash = "0c94015";
@@ -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.0.54
6
- * @date 2026-01-14T10:00:02.287Z
7
- * @hash c0048a0
5
+ * @version 18.0.55
6
+ * @date 2026-01-21T11:03:48.979Z
7
+ * @hash 0c94015
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -33,7 +33,8 @@
33
33
  return children
34
34
  .map((child) => (typeof child === "function" ? child(env) : child))
35
35
  .flat()
36
- .map(createAction);
36
+ .map(createAction)
37
+ .sort((a, b) => a.sequence - b.sequence);
37
38
  }
38
39
  : () => [],
39
40
  isReadonlyAllowed: item.isReadonlyAllowed || false,
@@ -301,6 +302,7 @@
301
302
  fillColor: "",
302
303
  textColor: "",
303
304
  };
305
+ const DEFAULT_NUMBER_STYLE = { ...DEFAULT_STYLE, align: "right" };
304
306
  const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
305
307
  const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
306
308
  // Fonts
@@ -6314,11 +6316,20 @@
6314
6316
  /**
6315
6317
  * Get the default height of the cell given its style.
6316
6318
  */
6317
- function getDefaultCellHeight(ctx, cell, colSize) {
6319
+ function getDefaultCellHeight(ctx, cell, locale, colSize) {
6318
6320
  if (!cell || (!cell.isFormula && !cell.content)) {
6319
6321
  return DEFAULT_CELL_HEIGHT;
6320
6322
  }
6321
- const content = cell.isFormula ? "" : cell.content;
6323
+ let content = "";
6324
+ try {
6325
+ if (!cell.isFormula) {
6326
+ const localeFormat = { format: cell.format, locale };
6327
+ content = formatValue(parseLiteral(cell.content, locale), localeFormat);
6328
+ }
6329
+ }
6330
+ catch {
6331
+ content = CellErrorType.GenericError;
6332
+ }
6322
6333
  return getCellContentHeight(ctx, content, cell.style, colSize);
6323
6334
  }
6324
6335
  function getCellContentHeight(ctx, content, style, colSize) {
@@ -20320,7 +20331,16 @@ stores.inject(MyMetaStore, storeInstance);
20320
20331
  }
20321
20332
  acceptToVectorize.push(!argDefinition.acceptMatrix);
20322
20333
  }
20323
- return applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize);
20334
+ return replaceErrorPlaceholderInResult(applyVectorization(errorHandlingCompute.bind(this), args, acceptToVectorize));
20335
+ }
20336
+ function replaceErrorPlaceholderInResult(result) {
20337
+ if (!isMatrix(result)) {
20338
+ replaceFunctionNamePlaceholder(result, functionName);
20339
+ }
20340
+ else {
20341
+ matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, functionName));
20342
+ }
20343
+ return result;
20324
20344
  }
20325
20345
  function errorHandlingCompute(...args) {
20326
20346
  for (let i = 0; i < args.length; i++) {
@@ -20344,13 +20364,11 @@ stores.inject(MyMetaStore, storeInstance);
20344
20364
  const result = descr.compute.apply(this, args);
20345
20365
  if (!isMatrix(result)) {
20346
20366
  if (typeof result === "object" && result !== null && "value" in result) {
20347
- replaceFunctionNamePlaceholder(result, functionName);
20348
20367
  return result;
20349
20368
  }
20350
20369
  return { value: result };
20351
20370
  }
20352
20371
  if (typeof result[0][0] === "object" && result[0][0] !== null && "value" in result[0][0]) {
20353
- matrixForEach(result, (result) => replaceFunctionNamePlaceholder(result, functionName));
20354
20372
  return result;
20355
20373
  }
20356
20374
  return matrixMap(result, (row) => ({ value: row }));
@@ -21796,6 +21814,7 @@ stores.inject(MyMetaStore, storeInstance);
21796
21814
  ? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign]
21797
21815
  : undefined,
21798
21816
  wrapText: style.wrapping === "wrap" || cell.content?.includes(NEWLINE) ? true : undefined,
21817
+ shrinkToFit: style.wrapping === "clip" ? true : undefined,
21799
21818
  },
21800
21819
  };
21801
21820
  styles.font["strike"] = !!style?.strikethrough || undefined;
@@ -21822,6 +21841,7 @@ stores.inject(MyMetaStore, storeInstance);
21822
21841
  vertical: styles.alignment.vertical,
21823
21842
  horizontal: styles.alignment.horizontal,
21824
21843
  wrapText: styles.alignment.wrapText,
21844
+ shrinkToFit: styles.alignment.shrinkToFit,
21825
21845
  },
21826
21846
  };
21827
21847
  return pushElement(style, construct.styles);
@@ -52629,7 +52649,7 @@ stores.inject(MyMetaStore, storeInstance);
52629
52649
  for (const position of positions) {
52630
52650
  const cell = this.getters.getCell(position);
52631
52651
  const xc = toXC(position.col, position.row);
52632
- const style = this.removeDefaultStyleValues(cell.style);
52652
+ const style = this.extractCustomStyle(cell);
52633
52653
  if (Object.keys(style).length) {
52634
52654
  const styleId = getItemId(style, styles);
52635
52655
  positionsByStyle[styleId] ??= [];
@@ -52670,7 +52690,7 @@ stores.inject(MyMetaStore, storeInstance);
52670
52690
  }
52671
52691
  if (cell?.style) {
52672
52692
  sheet.cells[xc] ??= {};
52673
- sheet.cells[xc].style = getItemId(this.removeDefaultStyleValues(cell.style), data.styles);
52693
+ sheet.cells[xc].style = getItemId(this.extractCustomStyle(cell), data.styles);
52674
52694
  }
52675
52695
  }
52676
52696
  }
@@ -52693,10 +52713,14 @@ stores.inject(MyMetaStore, storeInstance);
52693
52713
  }
52694
52714
  }
52695
52715
  }
52696
- removeDefaultStyleValues(style) {
52697
- const cleanedStyle = { ...style };
52698
- for (const property in DEFAULT_STYLE) {
52699
- if (cleanedStyle[property] === DEFAULT_STYLE[property]) {
52716
+ extractCustomStyle(cell) {
52717
+ const cleanedStyle = { ...cell.style };
52718
+ const defaultStyle = isNumber(cell.content, DEFAULT_LOCALE)
52719
+ ? DEFAULT_NUMBER_STYLE
52720
+ : DEFAULT_STYLE;
52721
+ for (const property in cleanedStyle) {
52722
+ if ((property !== "align" || !cell.isFormula) &&
52723
+ cleanedStyle[property] === defaultStyle[property]) {
52700
52724
  delete cleanedStyle[property];
52701
52725
  }
52702
52726
  }
@@ -58892,11 +58916,16 @@ stores.inject(MyMetaStore, storeInstance);
58892
58916
  return this.arrayFormulasToResults.get(formulasPosition);
58893
58917
  }
58894
58918
  /**
58895
- * Remove a node, also remove it from other nodes adjacency list
58919
+ * Remove a spreading relation for a given array formula position
58920
+ * and its result zone
58896
58921
  */
58897
58922
  removeNode(position) {
58923
+ const resultZone = this.arrayFormulasToResults.get(position);
58924
+ if (!resultZone) {
58925
+ return;
58926
+ }
58898
58927
  this.resultsToArrayFormulas.remove({
58899
- boundingBox: { sheetId: position.sheetId, zone: positionToZone(position) },
58928
+ boundingBox: { sheetId: position.sheetId, zone: resultZone },
58900
58929
  data: position,
58901
58930
  });
58902
58931
  this.arrayFormulasToResults.delete(position);
@@ -59180,6 +59209,10 @@ stores.inject(MyMetaStore, storeInstance);
59180
59209
  // empty matrix
59181
59210
  return createEvaluatedCell({ value: 0 }, this.getters.getLocale(), cellData);
59182
59211
  }
59212
+ if (nbRows === 1 && nbColumns === 1) {
59213
+ // single value matrix
59214
+ return createEvaluatedCell(nullValueToZeroValue(formulaReturn[0][0]), this.getters.getLocale(), cellData);
59215
+ }
59183
59216
  const resultZone = {
59184
59217
  top: formulaPosition.row,
59185
59218
  bottom: formulaPosition.row + nbRows - 1,
@@ -60639,6 +60672,7 @@ stores.inject(MyMetaStore, storeInstance);
60639
60672
  handle(cmd) {
60640
60673
  switch (cmd.type) {
60641
60674
  case "START":
60675
+ case "UPDATE_LOCALE":
60642
60676
  for (const sheetId of this.getters.getSheetIds()) {
60643
60677
  this.initializeSheet(sheetId);
60644
60678
  }
@@ -60744,7 +60778,7 @@ stores.inject(MyMetaStore, storeInstance);
60744
60778
  }
60745
60779
  const cell = this.getters.getCell(position);
60746
60780
  const colSize = this.getters.getColSize(position.sheetId, position.col);
60747
- return getDefaultCellHeight(this.ctx, cell, colSize);
60781
+ return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
60748
60782
  }
60749
60783
  isInMultiRowMerge(position) {
60750
60784
  const merge = this.getters.getMerge(position);
@@ -73375,6 +73409,9 @@ stores.inject(MyMetaStore, storeInstance);
73375
73409
  if (style.alignment && style.alignment.wrapText) {
73376
73410
  alignAttrs.push(["wrapText", "1"]);
73377
73411
  }
73412
+ if (style.alignment && style.alignment.shrinkToFit) {
73413
+ alignAttrs.push(["shrinkToFit", "1"]);
73414
+ }
73378
73415
  if (alignAttrs.length > 0) {
73379
73416
  attributes.push(["applyAlignment", "1"]); // for Libre Office
73380
73417
  styleNodes.push(escapeXml /*xml*/ `<xf ${formatAttributes(attributes)}><alignment ${formatAttributes(alignAttrs)} /></xf> `);
@@ -74842,9 +74879,9 @@ stores.inject(MyMetaStore, storeInstance);
74842
74879
  exports.tokenize = tokenize;
74843
74880
 
74844
74881
 
74845
- __info__.version = "18.0.54";
74846
- __info__.date = "2026-01-14T10:00:02.287Z";
74847
- __info__.hash = "c0048a0";
74882
+ __info__.version = "18.0.55";
74883
+ __info__.date = "2026-01-21T11:03:48.979Z";
74884
+ __info__.hash = "0c94015";
74848
74885
 
74849
74886
 
74850
74887
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);