@odoo/o-spreadsheet 18.2.20 → 18.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 18.2.20
6
- * @date 2025-06-27T09:11:55.800Z
7
- * @hash 16dfc38
5
+ * @version 18.2.22
6
+ * @date 2025-07-28T13:37:29.067Z
7
+ * @hash 0e414b1
8
8
  */
9
9
 
10
10
  'use strict';
@@ -823,6 +823,7 @@ const specialWhiteSpaceSpecialCharacters = [
823
823
  ];
824
824
  const specialWhiteSpaceRegexp = new RegExp(specialWhiteSpaceSpecialCharacters.join("|"), "g");
825
825
  const newLineRegexp = /(\r\n|\r)/g;
826
+ const whiteSpaceCharacters = specialWhiteSpaceSpecialCharacters.concat([" "]);
826
827
  /**
827
828
  * Replace all different newlines characters by \n
828
829
  */
@@ -2839,8 +2840,9 @@ const INITIAL_JS_DAY = DateTime.fromTimestamp(0);
2839
2840
  const DATE_JS_1900_OFFSET = INITIAL_JS_DAY.getTime() - INITIAL_1900_DAY.getTime();
2840
2841
  const mdyDateRegexp = /^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/;
2841
2842
  const ymdDateRegexp = /^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/;
2842
- const dateSeparatorsRegex = /\/|-|\s/;
2843
- const dateRegexp = /^(\d{1,4})[\/-\s](\d{1,4})([\/-\s](\d{1,4}))?$/;
2843
+ const whiteSpaceChars = whiteSpaceCharacters.join("");
2844
+ const dateSeparatorsRegex = new RegExp(`\/|-|${whiteSpaceCharacters.join("|")}`);
2845
+ const dateRegexp = new RegExp(`^(\\d{1,4})[\/${whiteSpaceChars}\-](\\d{1,4})([\/${whiteSpaceChars}\-](\\d{1,4}))?$`);
2844
2846
  const timeRegexp = /((\d+(:\d+)?(:\d+)?\s*(AM|PM))|(\d+:\d+(:\d+)?))$/;
2845
2847
  /** Convert a value number representing a date, or return undefined if it isn't possible */
2846
2848
  function valueToDateNumber(value, locale) {
@@ -6543,6 +6545,8 @@ function splitWordToSpecificWidth(ctx, word, width, style) {
6543
6545
  function splitTextToWidth(ctx, text, style, width) {
6544
6546
  if (!style)
6545
6547
  style = {};
6548
+ if (isMarkdownLink(text))
6549
+ text = parseMarkdownLink(text).label;
6546
6550
  const brokenText = [];
6547
6551
  // Checking if text contains NEWLINE before split makes it very slightly slower if text contains it,
6548
6552
  // but 5-10x faster if it doesn't
@@ -8507,6 +8511,10 @@ function toNormalizedPivotValue(dimension, groupValue) {
8507
8511
  if (groupValue === null || groupValue === "null") {
8508
8512
  return null;
8509
8513
  }
8514
+ const extractedGroupValue = typeof groupValue === "object" ? groupValue.value : groupValue;
8515
+ if (isEvaluationError(extractedGroupValue)) {
8516
+ return extractedGroupValue;
8517
+ }
8510
8518
  const groupValueString = typeof groupValue === "boolean"
8511
8519
  ? toString(groupValue).toLocaleLowerCase()
8512
8520
  : toString(groupValue);
@@ -11301,6 +11309,7 @@ const autoCompleteProviders = new Registry();
11301
11309
 
11302
11310
  autoCompleteProviders.add("dataValidation", {
11303
11311
  displayAllOnInitialContent: true,
11312
+ canBeToggled: false,
11304
11313
  getProposals(tokenAtCursor, content) {
11305
11314
  if (content.startsWith("=")) {
11306
11315
  return [];
@@ -19103,11 +19112,17 @@ const COLUMN = {
19103
19112
  if (isEvaluationError(cellReference?.value)) {
19104
19113
  return cellReference;
19105
19114
  }
19106
- const column = cellReference === undefined
19107
- ? this.__originCellPosition?.col
19108
- : toZone(cellReference.value).left;
19109
- assert(() => column !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
19110
- return column + 1;
19115
+ if (cellReference === undefined) {
19116
+ assert(() => this.__originCellPosition?.col !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
19117
+ return this.__originCellPosition.col + 1;
19118
+ }
19119
+ const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
19120
+ if (zone.left === zone.right) {
19121
+ return zone.left + 1;
19122
+ }
19123
+ return generateMatrix(zone.right - zone.left + 1, 1, (col, row) => ({
19124
+ value: zone.left + col + 1,
19125
+ }));
19111
19126
  },
19112
19127
  isExported: true,
19113
19128
  };
@@ -19326,11 +19341,17 @@ const ROW = {
19326
19341
  if (isEvaluationError(cellReference?.value)) {
19327
19342
  return cellReference;
19328
19343
  }
19329
- const row = cellReference === undefined
19330
- ? this.__originCellPosition?.row
19331
- : toZone(cellReference.value).top;
19332
- assert(() => row !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
19333
- return row + 1;
19344
+ if (cellReference === undefined) {
19345
+ assert(() => this.__originCellPosition?.row !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
19346
+ return this.__originCellPosition.row + 1;
19347
+ }
19348
+ const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
19349
+ if (zone.top === zone.bottom) {
19350
+ return zone.top + 1;
19351
+ }
19352
+ return generateMatrix(1, zone.bottom - zone.top + 1, (col, row) => ({
19353
+ value: zone.top + row + 1,
19354
+ }));
19334
19355
  },
19335
19356
  isExported: true,
19336
19357
  };
@@ -21606,6 +21627,7 @@ class AbstractComposerStore extends SpreadsheetStore {
21606
21627
  proposals,
21607
21628
  selectProposal: provider.selectProposal,
21608
21629
  autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
21630
+ canBeToggled: provider.canBeToggled,
21609
21631
  };
21610
21632
  }
21611
21633
  if (exactMatch && this._currentContent !== this.initialContent) {
@@ -21628,6 +21650,7 @@ class AbstractComposerStore extends SpreadsheetStore {
21628
21650
  proposals,
21629
21651
  selectProposal: provider.selectProposal,
21630
21652
  autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
21653
+ canBeToggled: provider.canBeToggled,
21631
21654
  };
21632
21655
  }
21633
21656
  }
@@ -25811,40 +25834,112 @@ function convertPivotTableConfig(pivotTable) {
25811
25834
  * In all the sheets, replace the table-only references in the formula cells with standard references.
25812
25835
  */
25813
25836
  function convertTableFormulaReferences(convertedSheets, xlsxSheets) {
25837
+ let deconstructedSheets = null;
25814
25838
  for (let tableSheet of convertedSheets) {
25815
25839
  const tables = xlsxSheets.find((s) => isSheetNameEqual(s.sheetName, tableSheet.name)).tables;
25840
+ if (!tables || tables.length === 0) {
25841
+ continue;
25842
+ }
25843
+ // Only deconstruct sheets if we are sure there are tables to process
25844
+ if (!deconstructedSheets) {
25845
+ deconstructedSheets = deconstructSheets(convertedSheets);
25846
+ }
25816
25847
  for (let table of tables) {
25817
- const tabRef = table.name + "[";
25818
- for (let sheet of convertedSheets) {
25819
- for (let xc in sheet.cells) {
25820
- const cell = sheet.cells[xc];
25821
- let cellContent = sheet.cells[xc];
25822
- if (cell && cellContent && cellContent.startsWith("=")) {
25823
- let refIndex;
25824
- while ((refIndex = cellContent.indexOf(tabRef)) !== -1) {
25825
- let endIndex = refIndex + tabRef.length;
25826
- let openBrackets = 1;
25827
- while (openBrackets > 0 && endIndex < cellContent.length) {
25828
- if (cellContent[endIndex] === "[") {
25829
- openBrackets++;
25830
- }
25831
- else if (cellContent[endIndex] === "]") {
25832
- openBrackets--;
25833
- }
25834
- endIndex++;
25835
- }
25836
- let reference = cellContent.slice(refIndex + tabRef.length, endIndex - 1);
25837
- const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
25838
- const convertedRef = convertTableReference(sheetPrefix, reference, table, xc);
25839
- cellContent =
25840
- cellContent.slice(0, refIndex) + convertedRef + cellContent.slice(endIndex);
25848
+ for (let sheetId in deconstructedSheets) {
25849
+ const sheet = convertedSheets.find((s) => s.id === sheetId);
25850
+ for (let xc in deconstructedSheets[sheetId]) {
25851
+ const deconstructedCell = deconstructedSheets[sheetId][xc];
25852
+ for (let i = deconstructedCell.length - 3; i >= 0; i -= 2) {
25853
+ const possibleTable = deconstructedSheets[sheetId][xc][i];
25854
+ if (!possibleTable.endsWith(table.name)) {
25855
+ continue;
25841
25856
  }
25857
+ const possibleRef = deconstructedSheets[sheetId][xc][i + 1];
25858
+ const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
25859
+ const convertedRef = convertTableReference(sheetPrefix, possibleRef, table, xc);
25860
+ deconstructedSheets[sheetId][xc][i + 2] =
25861
+ possibleTable.slice(0, possibleTable.indexOf(table.name)) +
25862
+ convertedRef +
25863
+ deconstructedSheets[sheetId][xc][i + 2];
25864
+ deconstructedSheets[sheetId][xc].splice(i, 2);
25842
25865
  }
25843
- sheet.cells[xc] = cellContent;
25866
+ // sheet.cells[xc] = cellContent;
25867
+ }
25868
+ }
25869
+ }
25870
+ }
25871
+ if (!deconstructedSheets) {
25872
+ return;
25873
+ }
25874
+ for (let sheetId in deconstructedSheets) {
25875
+ const sheet = convertedSheets.find((s) => s.id === sheetId);
25876
+ for (let xc in deconstructedSheets[sheetId]) {
25877
+ const deconstructedCell = deconstructedSheets[sheetId][xc];
25878
+ if (deconstructedCell.length === 1) {
25879
+ sheet.cells[xc] = deconstructedCell[0];
25880
+ continue;
25881
+ }
25882
+ let newContent = "";
25883
+ for (let i = 0; i < deconstructedCell.length; i += 2) {
25884
+ newContent += deconstructedCell[i] + "[" + deconstructedCell[i + 1] + "]";
25885
+ }
25886
+ newContent += deconstructedCell[deconstructedCell.length - 1];
25887
+ sheet.cells[xc] = newContent;
25888
+ }
25889
+ }
25890
+ }
25891
+ /**
25892
+ * Deconstruct the content of the cells in the sheets to extract possible table references.
25893
+ * Example from "=AVERAGE(Table1[colName1])-AVERAGE(Table2[colName2])":
25894
+ * return --> ["=AVERAGE(Table1", "colName1", ")-AVERAGE(Table2", "colName2", ")"]
25895
+ */
25896
+ function deconstructSheets(convertedSheets) {
25897
+ const deconstructedSheets = {};
25898
+ for (let sheet of convertedSheets) {
25899
+ for (let xc in sheet.cells) {
25900
+ const cellContent = sheet.cells[xc];
25901
+ if (!cellContent || !cellContent.startsWith("=")) {
25902
+ continue;
25903
+ }
25904
+ const startIndex = cellContent.indexOf("[");
25905
+ if (startIndex === -1) {
25906
+ continue;
25907
+ }
25908
+ const deconstructedCell = [];
25909
+ let possibleTable = cellContent.slice(0, startIndex);
25910
+ let possibleRef = "";
25911
+ let openBrackets = 1;
25912
+ let mainPossibleTableIndex = 0;
25913
+ let mainOpenBracketIndex = startIndex;
25914
+ for (let index = startIndex + 1; index < cellContent.length; index++) {
25915
+ if (cellContent[index] === "[") {
25916
+ if (openBrackets === 0) {
25917
+ possibleTable = cellContent.slice(mainPossibleTableIndex, index);
25918
+ mainOpenBracketIndex = index;
25919
+ }
25920
+ openBrackets++;
25921
+ continue;
25922
+ }
25923
+ if (cellContent[index] === "]") {
25924
+ openBrackets--;
25925
+ if (openBrackets === 0) {
25926
+ possibleRef = cellContent.slice(mainOpenBracketIndex + 1, index);
25927
+ deconstructedCell.push(possibleTable);
25928
+ deconstructedCell.push(possibleRef);
25929
+ mainPossibleTableIndex = index + 1;
25930
+ }
25931
+ }
25932
+ }
25933
+ if (deconstructedCell.length) {
25934
+ if (!deconstructedSheets[sheet.id]) {
25935
+ deconstructedSheets[sheet.id] = {};
25844
25936
  }
25937
+ deconstructedCell.push(cellContent.slice(mainPossibleTableIndex));
25938
+ deconstructedSheets[sheet.id][xc] = [...deconstructedCell];
25845
25939
  }
25846
25940
  }
25847
25941
  }
25942
+ return deconstructedSheets;
25848
25943
  }
25849
25944
  /**
25850
25945
  * Convert table-specific references in formulas into standard references. A table reference is composed of columns names,
@@ -33288,6 +33383,9 @@ class ErrorToolTip extends owl.Component {
33288
33383
  return undefined;
33289
33384
  }
33290
33385
  get errorOriginPositionString() {
33386
+ if (this.env.model.getters.isDashboard()) {
33387
+ return "";
33388
+ }
33291
33389
  const evaluationError = this.evaluationError;
33292
33390
  const position = evaluationError?.errorOriginPosition;
33293
33391
  if (!position || deepEquals(position, this.props.cellPosition)) {
@@ -41224,9 +41322,13 @@ class Composer extends owl.Component {
41224
41322
  }
41225
41323
  }
41226
41324
  closeAssistant() {
41325
+ if (!this.canBeToggled)
41326
+ return;
41227
41327
  this.assistant.forcedClosed = true;
41228
41328
  }
41229
41329
  openAssistant() {
41330
+ if (!this.canBeToggled)
41331
+ return;
41230
41332
  this.assistant.forcedClosed = false;
41231
41333
  }
41232
41334
  onWheel(event) {
@@ -41236,6 +41338,9 @@ class Composer extends owl.Component {
41236
41338
  event.stopPropagation();
41237
41339
  }
41238
41340
  }
41341
+ get canBeToggled() {
41342
+ return this.autoCompleteState.provider?.canBeToggled ?? true;
41343
+ }
41239
41344
  // ---------------------------------------------------------------------------
41240
41345
  // Private
41241
41346
  // ---------------------------------------------------------------------------
@@ -41371,7 +41476,7 @@ class Composer extends owl.Component {
41371
41476
  }
41372
41477
  }
41373
41478
  autoComplete(value) {
41374
- if (!value || this.assistant.forcedClosed) {
41479
+ if (!value || (this.assistant.forcedClosed && this.canBeToggled)) {
41375
41480
  return;
41376
41481
  }
41377
41482
  this.autoCompleteState.provider?.selectProposal(value);
@@ -47062,10 +47167,7 @@ class SpreadsheetPivot {
47062
47167
  if (finalCell.value === null) {
47063
47168
  return { value: _t("(Undefined)") };
47064
47169
  }
47065
- return {
47066
- value: finalCell.value,
47067
- format: finalCell.format,
47068
- };
47170
+ return finalCell;
47069
47171
  }
47070
47172
  getPivotCellValueAndFormat(measureId, domain) {
47071
47173
  const dataEntries = this.filterDataEntriesFromDomain(this.dataEntries, domain);
@@ -47158,9 +47260,15 @@ class SpreadsheetPivot {
47158
47260
  return domain.reduce((current, acc) => this.filterDataEntriesFromDomainNode(current, acc), dataEntries);
47159
47261
  }
47160
47262
  filterDataEntriesFromDomainNode(dataEntries, domain) {
47161
- const { field, value } = domain;
47263
+ const { field, value, type } = domain;
47162
47264
  const { nameWithGranularity } = this.getDimension(field);
47163
- return dataEntries.filter((entry) => entry[nameWithGranularity]?.value === value);
47265
+ return dataEntries.filter((entry) => {
47266
+ const cellValue = entry[nameWithGranularity]?.value;
47267
+ if (type === "char") {
47268
+ return String(cellValue) === String(value);
47269
+ }
47270
+ return cellValue === value;
47271
+ });
47164
47272
  }
47165
47273
  getDimension(nameWithGranularity) {
47166
47274
  return this.definition.getDimension(nameWithGranularity);
@@ -47294,7 +47402,6 @@ pivotRegistry.add("SPREADSHEET", {
47294
47402
  ui: SpreadsheetPivot,
47295
47403
  definition: SpreadsheetPivotRuntimeDefinition,
47296
47404
  externalData: false,
47297
- onIterationEndEvaluation: (pivot) => pivot.markAsDirtyForEvaluation(),
47298
47405
  dateGranularities: [...dateGranularities],
47299
47406
  datetimeGranularities: [...dateGranularities, "hour_number", "minute_number", "second_number"],
47300
47407
  isMeasureCandidate: (field) => field.type !== "boolean",
@@ -49657,6 +49764,11 @@ class GridComposer extends owl.Component {
49657
49764
  rect = this.defaultRect;
49658
49765
  isEditing = false;
49659
49766
  isCellReferenceVisible = false;
49767
+ currentEditedCell = {
49768
+ col: 0,
49769
+ row: 0,
49770
+ sheetId: this.env.model.getters.getActiveSheetId(),
49771
+ };
49660
49772
  composerStore;
49661
49773
  composerFocusStore;
49662
49774
  composerInterface;
@@ -49686,7 +49798,7 @@ class GridComposer extends owl.Component {
49686
49798
  return this.isCellReferenceVisible;
49687
49799
  }
49688
49800
  get cellReference() {
49689
- const { col, row, sheetId } = this.composerStore.currentEditedCell;
49801
+ const { col, row, sheetId } = this.currentEditedCell;
49690
49802
  const prefixSheet = sheetId !== this.env.model.getters.getActiveSheetId();
49691
49803
  return getFullReference(prefixSheet ? this.env.model.getters.getSheetName(sheetId) : undefined, toXC(col, row));
49692
49804
  }
@@ -49778,12 +49890,17 @@ class GridComposer extends owl.Component {
49778
49890
  if (!isEditing && this.composerFocusStore.activeComposer !== this.composerInterface) {
49779
49891
  this.composerFocusStore.focusComposer(this.composerInterface, { focusMode: "inactive" });
49780
49892
  }
49893
+ let shouldRecomputeRect = isEditing && !deepEquals(this.currentEditedCell, this.composerStore.currentEditedCell);
49781
49894
  if (this.isEditing !== isEditing) {
49782
49895
  this.isEditing = isEditing;
49783
49896
  if (!isEditing) {
49784
49897
  this.rect = this.defaultRect;
49785
49898
  return;
49786
49899
  }
49900
+ this.currentEditedCell = this.composerStore.currentEditedCell;
49901
+ shouldRecomputeRect = true;
49902
+ }
49903
+ if (shouldRecomputeRect) {
49787
49904
  const position = this.env.model.getters.getActivePosition();
49788
49905
  const zone = this.env.model.getters.expandZone(position.sheetId, positionToZone(position));
49789
49906
  this.rect = this.env.model.getters.getVisibleRect(zone);
@@ -60060,7 +60177,7 @@ const onIterationEndEvaluationRegistry = new Registry();
60060
60177
  onIterationEndEvaluationRegistry.add("pivots", (getters) => {
60061
60178
  for (const pivotId of getters.getPivotIds()) {
60062
60179
  const pivot = getters.getPivot(pivotId);
60063
- pivotRegistry.get(pivot.type).onIterationEndEvaluation(pivot);
60180
+ pivot.markAsDirtyForEvaluation?.();
60064
60181
  }
60065
60182
  });
60066
60183
 
@@ -62892,6 +63009,23 @@ class HeaderSizeUIPlugin extends CoreViewPlugin {
62892
63009
  static getters = ["getRowSize", "getHeaderSize"];
62893
63010
  tallestCellInRow = {};
62894
63011
  ctx = document.createElement("canvas").getContext("2d");
63012
+ beforeHandle(cmd) {
63013
+ switch (cmd.type) {
63014
+ // Ensure rows are updated before "UPDATE_CELL" is dispatched from cell plugin.
63015
+ // "UPDATE_CELL" uses the Sheet core plugin to access row data.
63016
+ // If "ADD_COLUMNS_ROWS" has not been processed yet by header_sizes_ui,
63017
+ // size updates may apply to incorrect (pre-insert) rows.
63018
+ case "ADD_COLUMNS_ROWS":
63019
+ if (cmd.dimension === "COL") {
63020
+ return;
63021
+ }
63022
+ const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
63023
+ const newCells = Array(cmd.quantity).fill(undefined);
63024
+ const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
63025
+ this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
63026
+ break;
63027
+ }
63028
+ }
62895
63029
  handle(cmd) {
62896
63030
  switch (cmd.type) {
62897
63031
  case "START":
@@ -62921,16 +63055,6 @@ class HeaderSizeUIPlugin extends CoreViewPlugin {
62921
63055
  this.history.update("tallestCellInRow", cmd.sheetId, tallestCells);
62922
63056
  break;
62923
63057
  }
62924
- case "ADD_COLUMNS_ROWS": {
62925
- if (cmd.dimension === "COL") {
62926
- return;
62927
- }
62928
- const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
62929
- const newCells = Array(cmd.quantity).fill(undefined);
62930
- const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
62931
- this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
62932
- break;
62933
- }
62934
63058
  case "RESIZE_COLUMNS_ROWS":
62935
63059
  {
62936
63060
  const sheetId = cmd.sheetId;
@@ -63066,13 +63190,13 @@ function withPivotPresentationLayer (PivotClass) {
63066
63190
  super(custom, params);
63067
63191
  this.getters = params.getters;
63068
63192
  }
63069
- init(params) {
63193
+ markAsDirtyForEvaluation() {
63070
63194
  this.cache = {};
63071
63195
  this.rankAsc = {};
63072
63196
  this.rankDesc = {};
63073
63197
  this.runningTotal = {};
63074
63198
  this.runningTotalInPercent = {};
63075
- super.init(params);
63199
+ super.markAsDirtyForEvaluation?.();
63076
63200
  }
63077
63201
  getPivotCellValueAndFormat(measureName, domain) {
63078
63202
  return this.getMeasureDisplayValue(measureName, domain);
@@ -63197,7 +63321,7 @@ function withPivotPresentationLayer (PivotClass) {
63197
63321
  return this.getSubTreeMatchingDomain(node.children, domain, domainLevel + 1);
63198
63322
  }
63199
63323
  }
63200
- return tree;
63324
+ return [];
63201
63325
  }
63202
63326
  treeToLeafDomains(tree, parentDomain = []) {
63203
63327
  const domains = [];
@@ -68683,6 +68807,14 @@ class GridSelectionPlugin extends UIPlugin {
68683
68807
  const isBasedBefore = cmd.base < start;
68684
68808
  const deltaCol = isBasedBefore && isCol ? thickness : 0;
68685
68809
  const deltaRow = isBasedBefore && !isCol ? thickness : 0;
68810
+ const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
68811
+ const originalSize = Object.fromEntries(toRemove.map((element) => {
68812
+ const size = isCol
68813
+ ? this.getters.getColSize(cmd.sheetId, element)
68814
+ : this.getters.getUserRowSize(cmd.sheetId, element);
68815
+ const isDefaultCol = isCol && size === DEFAULT_CELL_WIDTH;
68816
+ return [element, isDefaultCol ? undefined : size];
68817
+ }));
68686
68818
  const target = [
68687
68819
  {
68688
68820
  left: isCol ? start + deltaCol : 0,
@@ -68713,13 +68845,12 @@ class GridSelectionPlugin extends UIPlugin {
68713
68845
  const col = selection.left;
68714
68846
  const row = selection.top;
68715
68847
  this.setSelectionMixin({ zone: selection, cell: { col, row } }, [selection]);
68716
- const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
68717
68848
  let currentIndex = isBasedBefore ? cmd.base : cmd.base + 1;
68718
68849
  const resizingGroups = {};
68719
68850
  for (const element of toRemove) {
68720
- const size = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, element);
68851
+ const size = originalSize[element];
68721
68852
  const currentSize = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, currentIndex);
68722
- if (size != currentSize) {
68853
+ if (size && size != currentSize) {
68723
68854
  resizingGroups[size] ??= [];
68724
68855
  resizingGroups[size].push(currentIndex);
68725
68856
  currentIndex += 1;
@@ -70404,14 +70535,12 @@ class BottomBarSheet extends owl.Component {
70404
70535
  this.editionState = "initializing";
70405
70536
  }
70406
70537
  stopEdition() {
70407
- const input = this.sheetNameRef.el;
70408
- if (!this.state.isEditing || !input)
70538
+ if (!this.state.isEditing || !this.sheetNameRef.el)
70409
70539
  return;
70410
70540
  this.state.isEditing = false;
70411
70541
  this.editionState = "initializing";
70412
- input.blur();
70542
+ this.sheetNameRef.el.blur();
70413
70543
  const inputValue = this.getInputContent() || "";
70414
- input.innerText = inputValue;
70415
70544
  interactiveRenameSheet(this.env, this.props.sheetId, inputValue, () => this.startEdition());
70416
70545
  }
70417
70546
  cancelEdition() {
@@ -77108,6 +77237,6 @@ exports.tokenColors = tokenColors;
77108
77237
  exports.tokenize = tokenize;
77109
77238
 
77110
77239
 
77111
- __info__.version = "18.2.20";
77112
- __info__.date = "2025-06-27T09:11:55.800Z";
77113
- __info__.hash = "16dfc38";
77240
+ __info__.version = "18.2.22";
77241
+ __info__.date = "2025-07-28T13:37:29.067Z";
77242
+ __info__.hash = "0e414b1";
@@ -5316,6 +5316,7 @@ declare class HeaderSizeUIPlugin extends CoreViewPlugin<HeaderSizeState> impleme
5316
5316
  static getters: readonly ["getRowSize", "getHeaderSize"];
5317
5317
  readonly tallestCellInRow: Immutable<Record<UID, Array<CellWithSize | undefined>>>;
5318
5318
  private ctx;
5319
+ beforeHandle(cmd: Command): void;
5319
5320
  handle(cmd: Command): void;
5320
5321
  getRowSize(sheetId: UID, row: HeaderIndex): Pixel;
5321
5322
  getHeaderSize(sheetId: UID, dimension: Dimension, index: HeaderIndex): Pixel;
@@ -5453,6 +5454,7 @@ interface Pivot<T = PivotRuntimeDefinition> {
5453
5454
  label: string;
5454
5455
  }[];
5455
5456
  needsReevaluation: boolean;
5457
+ markAsDirtyForEvaluation?(): void;
5456
5458
  }
5457
5459
 
5458
5460
  declare class PivotUIPlugin extends CoreViewPlugin {
@@ -6359,7 +6361,6 @@ interface PivotRegistryItem {
6359
6361
  ui: PivotUIConstructor;
6360
6362
  definition: PivotDefinitionConstructor;
6361
6363
  externalData: boolean;
6362
- onIterationEndEvaluation: (pivot: Pivot) => void;
6363
6364
  dateGranularities: string[];
6364
6365
  datetimeGranularities: string[];
6365
6366
  isMeasureCandidate: (field: PivotField) => boolean;
@@ -8313,6 +8314,7 @@ declare class Composer extends Component<CellComposerProps, SpreadsheetChildEnv>
8313
8314
  closeAssistant(): void;
8314
8315
  openAssistant(): void;
8315
8316
  onWheel(event: WheelEvent): void;
8317
+ get canBeToggled(): boolean;
8316
8318
  private processContent;
8317
8319
  /**
8318
8320
  * Get the HTML content corresponding to the current composer token, divided by lines.
@@ -8354,6 +8356,7 @@ interface AutoCompleteProvider {
8354
8356
  proposals: AutoCompleteProposal[];
8355
8357
  selectProposal(text: string): void;
8356
8358
  autoSelectFirstProposal: boolean;
8359
+ canBeToggled?: boolean;
8357
8360
  }
8358
8361
  interface ComposerStoreInterface {
8359
8362
  currentEditedCell?: CellPosition;
@@ -8373,6 +8376,7 @@ interface ComposerStoreInterface {
8373
8376
  interface AutoCompleteProviderDefinition {
8374
8377
  sequence?: number;
8375
8378
  autoSelectFirstProposal?: boolean;
8379
+ canBeToggled?: boolean;
8376
8380
  displayAllOnInitialContent?: boolean;
8377
8381
  maxDisplayedProposals?: number;
8378
8382
  getProposals(this: {
@@ -8972,6 +8976,7 @@ declare class GridComposer extends Component<Props$J, SpreadsheetChildEnv> {
8972
8976
  private rect;
8973
8977
  private isEditing;
8974
8978
  private isCellReferenceVisible;
8979
+ private currentEditedCell;
8975
8980
  private composerStore;
8976
8981
  composerFocusStore: Store<ComposerFocusStore>;
8977
8982
  private composerInterface;
@@ -10218,7 +10223,7 @@ declare function createPivotFormula(formulaId: string, cell: PivotTableCell): st
10218
10223
  * e.g. given the following formula PIVOT.VALUE("1", "stage_id", "42", "status", "won"),
10219
10224
  * the two group values are "42" and "won".
10220
10225
  */
10221
- declare function toNormalizedPivotValue(dimension: Pick<PivotDimension$1, "type" | "displayName" | "granularity">, groupValue: any): CellValue;
10226
+ declare function toNormalizedPivotValue(dimension: Pick<PivotDimension$1, "type" | "displayName" | "granularity">, groupValue: Maybe<CellValue | FunctionResultObject>): CellValue;
10222
10227
 
10223
10228
  interface Props$i {
10224
10229
  pivotId: string;