@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
  (function (exports, owl) {
@@ -822,6 +822,7 @@
822
822
  ];
823
823
  const specialWhiteSpaceRegexp = new RegExp(specialWhiteSpaceSpecialCharacters.join("|"), "g");
824
824
  const newLineRegexp = /(\r\n|\r)/g;
825
+ const whiteSpaceCharacters = specialWhiteSpaceSpecialCharacters.concat([" "]);
825
826
  /**
826
827
  * Replace all different newlines characters by \n
827
828
  */
@@ -2838,8 +2839,9 @@
2838
2839
  const DATE_JS_1900_OFFSET = INITIAL_JS_DAY.getTime() - INITIAL_1900_DAY.getTime();
2839
2840
  const mdyDateRegexp = /^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/;
2840
2841
  const ymdDateRegexp = /^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/;
2841
- const dateSeparatorsRegex = /\/|-|\s/;
2842
- const dateRegexp = /^(\d{1,4})[\/-\s](\d{1,4})([\/-\s](\d{1,4}))?$/;
2842
+ const whiteSpaceChars = whiteSpaceCharacters.join("");
2843
+ const dateSeparatorsRegex = new RegExp(`\/|-|${whiteSpaceCharacters.join("|")}`);
2844
+ const dateRegexp = new RegExp(`^(\\d{1,4})[\/${whiteSpaceChars}\-](\\d{1,4})([\/${whiteSpaceChars}\-](\\d{1,4}))?$`);
2843
2845
  const timeRegexp = /((\d+(:\d+)?(:\d+)?\s*(AM|PM))|(\d+:\d+(:\d+)?))$/;
2844
2846
  /** Convert a value number representing a date, or return undefined if it isn't possible */
2845
2847
  function valueToDateNumber(value, locale) {
@@ -6542,6 +6544,8 @@
6542
6544
  function splitTextToWidth(ctx, text, style, width) {
6543
6545
  if (!style)
6544
6546
  style = {};
6547
+ if (isMarkdownLink(text))
6548
+ text = parseMarkdownLink(text).label;
6545
6549
  const brokenText = [];
6546
6550
  // Checking if text contains NEWLINE before split makes it very slightly slower if text contains it,
6547
6551
  // but 5-10x faster if it doesn't
@@ -8506,6 +8510,10 @@
8506
8510
  if (groupValue === null || groupValue === "null") {
8507
8511
  return null;
8508
8512
  }
8513
+ const extractedGroupValue = typeof groupValue === "object" ? groupValue.value : groupValue;
8514
+ if (isEvaluationError(extractedGroupValue)) {
8515
+ return extractedGroupValue;
8516
+ }
8509
8517
  const groupValueString = typeof groupValue === "boolean"
8510
8518
  ? toString(groupValue).toLocaleLowerCase()
8511
8519
  : toString(groupValue);
@@ -11300,6 +11308,7 @@ stores.inject(MyMetaStore, storeInstance);
11300
11308
 
11301
11309
  autoCompleteProviders.add("dataValidation", {
11302
11310
  displayAllOnInitialContent: true,
11311
+ canBeToggled: false,
11303
11312
  getProposals(tokenAtCursor, content) {
11304
11313
  if (content.startsWith("=")) {
11305
11314
  return [];
@@ -19102,11 +19111,17 @@ stores.inject(MyMetaStore, storeInstance);
19102
19111
  if (isEvaluationError(cellReference?.value)) {
19103
19112
  return cellReference;
19104
19113
  }
19105
- const column = cellReference === undefined
19106
- ? this.__originCellPosition?.col
19107
- : toZone(cellReference.value).left;
19108
- assert(() => column !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
19109
- return column + 1;
19114
+ if (cellReference === undefined) {
19115
+ assert(() => this.__originCellPosition?.col !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
19116
+ return this.__originCellPosition.col + 1;
19117
+ }
19118
+ const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
19119
+ if (zone.left === zone.right) {
19120
+ return zone.left + 1;
19121
+ }
19122
+ return generateMatrix(zone.right - zone.left + 1, 1, (col, row) => ({
19123
+ value: zone.left + col + 1,
19124
+ }));
19110
19125
  },
19111
19126
  isExported: true,
19112
19127
  };
@@ -19325,11 +19340,17 @@ stores.inject(MyMetaStore, storeInstance);
19325
19340
  if (isEvaluationError(cellReference?.value)) {
19326
19341
  return cellReference;
19327
19342
  }
19328
- const row = cellReference === undefined
19329
- ? this.__originCellPosition?.row
19330
- : toZone(cellReference.value).top;
19331
- assert(() => row !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
19332
- return row + 1;
19343
+ if (cellReference === undefined) {
19344
+ assert(() => this.__originCellPosition?.row !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
19345
+ return this.__originCellPosition.row + 1;
19346
+ }
19347
+ const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
19348
+ if (zone.top === zone.bottom) {
19349
+ return zone.top + 1;
19350
+ }
19351
+ return generateMatrix(1, zone.bottom - zone.top + 1, (col, row) => ({
19352
+ value: zone.top + row + 1,
19353
+ }));
19333
19354
  },
19334
19355
  isExported: true,
19335
19356
  };
@@ -21605,6 +21626,7 @@ stores.inject(MyMetaStore, storeInstance);
21605
21626
  proposals,
21606
21627
  selectProposal: provider.selectProposal,
21607
21628
  autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
21629
+ canBeToggled: provider.canBeToggled,
21608
21630
  };
21609
21631
  }
21610
21632
  if (exactMatch && this._currentContent !== this.initialContent) {
@@ -21627,6 +21649,7 @@ stores.inject(MyMetaStore, storeInstance);
21627
21649
  proposals,
21628
21650
  selectProposal: provider.selectProposal,
21629
21651
  autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
21652
+ canBeToggled: provider.canBeToggled,
21630
21653
  };
21631
21654
  }
21632
21655
  }
@@ -25810,40 +25833,112 @@ stores.inject(MyMetaStore, storeInstance);
25810
25833
  * In all the sheets, replace the table-only references in the formula cells with standard references.
25811
25834
  */
25812
25835
  function convertTableFormulaReferences(convertedSheets, xlsxSheets) {
25836
+ let deconstructedSheets = null;
25813
25837
  for (let tableSheet of convertedSheets) {
25814
25838
  const tables = xlsxSheets.find((s) => isSheetNameEqual(s.sheetName, tableSheet.name)).tables;
25839
+ if (!tables || tables.length === 0) {
25840
+ continue;
25841
+ }
25842
+ // Only deconstruct sheets if we are sure there are tables to process
25843
+ if (!deconstructedSheets) {
25844
+ deconstructedSheets = deconstructSheets(convertedSheets);
25845
+ }
25815
25846
  for (let table of tables) {
25816
- const tabRef = table.name + "[";
25817
- for (let sheet of convertedSheets) {
25818
- for (let xc in sheet.cells) {
25819
- const cell = sheet.cells[xc];
25820
- let cellContent = sheet.cells[xc];
25821
- if (cell && cellContent && cellContent.startsWith("=")) {
25822
- let refIndex;
25823
- while ((refIndex = cellContent.indexOf(tabRef)) !== -1) {
25824
- let endIndex = refIndex + tabRef.length;
25825
- let openBrackets = 1;
25826
- while (openBrackets > 0 && endIndex < cellContent.length) {
25827
- if (cellContent[endIndex] === "[") {
25828
- openBrackets++;
25829
- }
25830
- else if (cellContent[endIndex] === "]") {
25831
- openBrackets--;
25832
- }
25833
- endIndex++;
25834
- }
25835
- let reference = cellContent.slice(refIndex + tabRef.length, endIndex - 1);
25836
- const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
25837
- const convertedRef = convertTableReference(sheetPrefix, reference, table, xc);
25838
- cellContent =
25839
- cellContent.slice(0, refIndex) + convertedRef + cellContent.slice(endIndex);
25847
+ for (let sheetId in deconstructedSheets) {
25848
+ const sheet = convertedSheets.find((s) => s.id === sheetId);
25849
+ for (let xc in deconstructedSheets[sheetId]) {
25850
+ const deconstructedCell = deconstructedSheets[sheetId][xc];
25851
+ for (let i = deconstructedCell.length - 3; i >= 0; i -= 2) {
25852
+ const possibleTable = deconstructedSheets[sheetId][xc][i];
25853
+ if (!possibleTable.endsWith(table.name)) {
25854
+ continue;
25840
25855
  }
25856
+ const possibleRef = deconstructedSheets[sheetId][xc][i + 1];
25857
+ const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
25858
+ const convertedRef = convertTableReference(sheetPrefix, possibleRef, table, xc);
25859
+ deconstructedSheets[sheetId][xc][i + 2] =
25860
+ possibleTable.slice(0, possibleTable.indexOf(table.name)) +
25861
+ convertedRef +
25862
+ deconstructedSheets[sheetId][xc][i + 2];
25863
+ deconstructedSheets[sheetId][xc].splice(i, 2);
25841
25864
  }
25842
- sheet.cells[xc] = cellContent;
25865
+ // sheet.cells[xc] = cellContent;
25866
+ }
25867
+ }
25868
+ }
25869
+ }
25870
+ if (!deconstructedSheets) {
25871
+ return;
25872
+ }
25873
+ for (let sheetId in deconstructedSheets) {
25874
+ const sheet = convertedSheets.find((s) => s.id === sheetId);
25875
+ for (let xc in deconstructedSheets[sheetId]) {
25876
+ const deconstructedCell = deconstructedSheets[sheetId][xc];
25877
+ if (deconstructedCell.length === 1) {
25878
+ sheet.cells[xc] = deconstructedCell[0];
25879
+ continue;
25880
+ }
25881
+ let newContent = "";
25882
+ for (let i = 0; i < deconstructedCell.length; i += 2) {
25883
+ newContent += deconstructedCell[i] + "[" + deconstructedCell[i + 1] + "]";
25884
+ }
25885
+ newContent += deconstructedCell[deconstructedCell.length - 1];
25886
+ sheet.cells[xc] = newContent;
25887
+ }
25888
+ }
25889
+ }
25890
+ /**
25891
+ * Deconstruct the content of the cells in the sheets to extract possible table references.
25892
+ * Example from "=AVERAGE(Table1[colName1])-AVERAGE(Table2[colName2])":
25893
+ * return --> ["=AVERAGE(Table1", "colName1", ")-AVERAGE(Table2", "colName2", ")"]
25894
+ */
25895
+ function deconstructSheets(convertedSheets) {
25896
+ const deconstructedSheets = {};
25897
+ for (let sheet of convertedSheets) {
25898
+ for (let xc in sheet.cells) {
25899
+ const cellContent = sheet.cells[xc];
25900
+ if (!cellContent || !cellContent.startsWith("=")) {
25901
+ continue;
25902
+ }
25903
+ const startIndex = cellContent.indexOf("[");
25904
+ if (startIndex === -1) {
25905
+ continue;
25906
+ }
25907
+ const deconstructedCell = [];
25908
+ let possibleTable = cellContent.slice(0, startIndex);
25909
+ let possibleRef = "";
25910
+ let openBrackets = 1;
25911
+ let mainPossibleTableIndex = 0;
25912
+ let mainOpenBracketIndex = startIndex;
25913
+ for (let index = startIndex + 1; index < cellContent.length; index++) {
25914
+ if (cellContent[index] === "[") {
25915
+ if (openBrackets === 0) {
25916
+ possibleTable = cellContent.slice(mainPossibleTableIndex, index);
25917
+ mainOpenBracketIndex = index;
25918
+ }
25919
+ openBrackets++;
25920
+ continue;
25921
+ }
25922
+ if (cellContent[index] === "]") {
25923
+ openBrackets--;
25924
+ if (openBrackets === 0) {
25925
+ possibleRef = cellContent.slice(mainOpenBracketIndex + 1, index);
25926
+ deconstructedCell.push(possibleTable);
25927
+ deconstructedCell.push(possibleRef);
25928
+ mainPossibleTableIndex = index + 1;
25929
+ }
25930
+ }
25931
+ }
25932
+ if (deconstructedCell.length) {
25933
+ if (!deconstructedSheets[sheet.id]) {
25934
+ deconstructedSheets[sheet.id] = {};
25843
25935
  }
25936
+ deconstructedCell.push(cellContent.slice(mainPossibleTableIndex));
25937
+ deconstructedSheets[sheet.id][xc] = [...deconstructedCell];
25844
25938
  }
25845
25939
  }
25846
25940
  }
25941
+ return deconstructedSheets;
25847
25942
  }
25848
25943
  /**
25849
25944
  * Convert table-specific references in formulas into standard references. A table reference is composed of columns names,
@@ -33287,6 +33382,9 @@ stores.inject(MyMetaStore, storeInstance);
33287
33382
  return undefined;
33288
33383
  }
33289
33384
  get errorOriginPositionString() {
33385
+ if (this.env.model.getters.isDashboard()) {
33386
+ return "";
33387
+ }
33290
33388
  const evaluationError = this.evaluationError;
33291
33389
  const position = evaluationError?.errorOriginPosition;
33292
33390
  if (!position || deepEquals(position, this.props.cellPosition)) {
@@ -41223,9 +41321,13 @@ stores.inject(MyMetaStore, storeInstance);
41223
41321
  }
41224
41322
  }
41225
41323
  closeAssistant() {
41324
+ if (!this.canBeToggled)
41325
+ return;
41226
41326
  this.assistant.forcedClosed = true;
41227
41327
  }
41228
41328
  openAssistant() {
41329
+ if (!this.canBeToggled)
41330
+ return;
41229
41331
  this.assistant.forcedClosed = false;
41230
41332
  }
41231
41333
  onWheel(event) {
@@ -41235,6 +41337,9 @@ stores.inject(MyMetaStore, storeInstance);
41235
41337
  event.stopPropagation();
41236
41338
  }
41237
41339
  }
41340
+ get canBeToggled() {
41341
+ return this.autoCompleteState.provider?.canBeToggled ?? true;
41342
+ }
41238
41343
  // ---------------------------------------------------------------------------
41239
41344
  // Private
41240
41345
  // ---------------------------------------------------------------------------
@@ -41370,7 +41475,7 @@ stores.inject(MyMetaStore, storeInstance);
41370
41475
  }
41371
41476
  }
41372
41477
  autoComplete(value) {
41373
- if (!value || this.assistant.forcedClosed) {
41478
+ if (!value || (this.assistant.forcedClosed && this.canBeToggled)) {
41374
41479
  return;
41375
41480
  }
41376
41481
  this.autoCompleteState.provider?.selectProposal(value);
@@ -47061,10 +47166,7 @@ stores.inject(MyMetaStore, storeInstance);
47061
47166
  if (finalCell.value === null) {
47062
47167
  return { value: _t("(Undefined)") };
47063
47168
  }
47064
- return {
47065
- value: finalCell.value,
47066
- format: finalCell.format,
47067
- };
47169
+ return finalCell;
47068
47170
  }
47069
47171
  getPivotCellValueAndFormat(measureId, domain) {
47070
47172
  const dataEntries = this.filterDataEntriesFromDomain(this.dataEntries, domain);
@@ -47157,9 +47259,15 @@ stores.inject(MyMetaStore, storeInstance);
47157
47259
  return domain.reduce((current, acc) => this.filterDataEntriesFromDomainNode(current, acc), dataEntries);
47158
47260
  }
47159
47261
  filterDataEntriesFromDomainNode(dataEntries, domain) {
47160
- const { field, value } = domain;
47262
+ const { field, value, type } = domain;
47161
47263
  const { nameWithGranularity } = this.getDimension(field);
47162
- return dataEntries.filter((entry) => entry[nameWithGranularity]?.value === value);
47264
+ return dataEntries.filter((entry) => {
47265
+ const cellValue = entry[nameWithGranularity]?.value;
47266
+ if (type === "char") {
47267
+ return String(cellValue) === String(value);
47268
+ }
47269
+ return cellValue === value;
47270
+ });
47163
47271
  }
47164
47272
  getDimension(nameWithGranularity) {
47165
47273
  return this.definition.getDimension(nameWithGranularity);
@@ -47293,7 +47401,6 @@ stores.inject(MyMetaStore, storeInstance);
47293
47401
  ui: SpreadsheetPivot,
47294
47402
  definition: SpreadsheetPivotRuntimeDefinition,
47295
47403
  externalData: false,
47296
- onIterationEndEvaluation: (pivot) => pivot.markAsDirtyForEvaluation(),
47297
47404
  dateGranularities: [...dateGranularities],
47298
47405
  datetimeGranularities: [...dateGranularities, "hour_number", "minute_number", "second_number"],
47299
47406
  isMeasureCandidate: (field) => field.type !== "boolean",
@@ -49656,6 +49763,11 @@ stores.inject(MyMetaStore, storeInstance);
49656
49763
  rect = this.defaultRect;
49657
49764
  isEditing = false;
49658
49765
  isCellReferenceVisible = false;
49766
+ currentEditedCell = {
49767
+ col: 0,
49768
+ row: 0,
49769
+ sheetId: this.env.model.getters.getActiveSheetId(),
49770
+ };
49659
49771
  composerStore;
49660
49772
  composerFocusStore;
49661
49773
  composerInterface;
@@ -49685,7 +49797,7 @@ stores.inject(MyMetaStore, storeInstance);
49685
49797
  return this.isCellReferenceVisible;
49686
49798
  }
49687
49799
  get cellReference() {
49688
- const { col, row, sheetId } = this.composerStore.currentEditedCell;
49800
+ const { col, row, sheetId } = this.currentEditedCell;
49689
49801
  const prefixSheet = sheetId !== this.env.model.getters.getActiveSheetId();
49690
49802
  return getFullReference(prefixSheet ? this.env.model.getters.getSheetName(sheetId) : undefined, toXC(col, row));
49691
49803
  }
@@ -49777,12 +49889,17 @@ stores.inject(MyMetaStore, storeInstance);
49777
49889
  if (!isEditing && this.composerFocusStore.activeComposer !== this.composerInterface) {
49778
49890
  this.composerFocusStore.focusComposer(this.composerInterface, { focusMode: "inactive" });
49779
49891
  }
49892
+ let shouldRecomputeRect = isEditing && !deepEquals(this.currentEditedCell, this.composerStore.currentEditedCell);
49780
49893
  if (this.isEditing !== isEditing) {
49781
49894
  this.isEditing = isEditing;
49782
49895
  if (!isEditing) {
49783
49896
  this.rect = this.defaultRect;
49784
49897
  return;
49785
49898
  }
49899
+ this.currentEditedCell = this.composerStore.currentEditedCell;
49900
+ shouldRecomputeRect = true;
49901
+ }
49902
+ if (shouldRecomputeRect) {
49786
49903
  const position = this.env.model.getters.getActivePosition();
49787
49904
  const zone = this.env.model.getters.expandZone(position.sheetId, positionToZone(position));
49788
49905
  this.rect = this.env.model.getters.getVisibleRect(zone);
@@ -60059,7 +60176,7 @@ stores.inject(MyMetaStore, storeInstance);
60059
60176
  onIterationEndEvaluationRegistry.add("pivots", (getters) => {
60060
60177
  for (const pivotId of getters.getPivotIds()) {
60061
60178
  const pivot = getters.getPivot(pivotId);
60062
- pivotRegistry.get(pivot.type).onIterationEndEvaluation(pivot);
60179
+ pivot.markAsDirtyForEvaluation?.();
60063
60180
  }
60064
60181
  });
60065
60182
 
@@ -62891,6 +63008,23 @@ stores.inject(MyMetaStore, storeInstance);
62891
63008
  static getters = ["getRowSize", "getHeaderSize"];
62892
63009
  tallestCellInRow = {};
62893
63010
  ctx = document.createElement("canvas").getContext("2d");
63011
+ beforeHandle(cmd) {
63012
+ switch (cmd.type) {
63013
+ // Ensure rows are updated before "UPDATE_CELL" is dispatched from cell plugin.
63014
+ // "UPDATE_CELL" uses the Sheet core plugin to access row data.
63015
+ // If "ADD_COLUMNS_ROWS" has not been processed yet by header_sizes_ui,
63016
+ // size updates may apply to incorrect (pre-insert) rows.
63017
+ case "ADD_COLUMNS_ROWS":
63018
+ if (cmd.dimension === "COL") {
63019
+ return;
63020
+ }
63021
+ const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
63022
+ const newCells = Array(cmd.quantity).fill(undefined);
63023
+ const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
63024
+ this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
63025
+ break;
63026
+ }
63027
+ }
62894
63028
  handle(cmd) {
62895
63029
  switch (cmd.type) {
62896
63030
  case "START":
@@ -62920,16 +63054,6 @@ stores.inject(MyMetaStore, storeInstance);
62920
63054
  this.history.update("tallestCellInRow", cmd.sheetId, tallestCells);
62921
63055
  break;
62922
63056
  }
62923
- case "ADD_COLUMNS_ROWS": {
62924
- if (cmd.dimension === "COL") {
62925
- return;
62926
- }
62927
- const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
62928
- const newCells = Array(cmd.quantity).fill(undefined);
62929
- const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
62930
- this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
62931
- break;
62932
- }
62933
63057
  case "RESIZE_COLUMNS_ROWS":
62934
63058
  {
62935
63059
  const sheetId = cmd.sheetId;
@@ -63065,13 +63189,13 @@ stores.inject(MyMetaStore, storeInstance);
63065
63189
  super(custom, params);
63066
63190
  this.getters = params.getters;
63067
63191
  }
63068
- init(params) {
63192
+ markAsDirtyForEvaluation() {
63069
63193
  this.cache = {};
63070
63194
  this.rankAsc = {};
63071
63195
  this.rankDesc = {};
63072
63196
  this.runningTotal = {};
63073
63197
  this.runningTotalInPercent = {};
63074
- super.init(params);
63198
+ super.markAsDirtyForEvaluation?.();
63075
63199
  }
63076
63200
  getPivotCellValueAndFormat(measureName, domain) {
63077
63201
  return this.getMeasureDisplayValue(measureName, domain);
@@ -63196,7 +63320,7 @@ stores.inject(MyMetaStore, storeInstance);
63196
63320
  return this.getSubTreeMatchingDomain(node.children, domain, domainLevel + 1);
63197
63321
  }
63198
63322
  }
63199
- return tree;
63323
+ return [];
63200
63324
  }
63201
63325
  treeToLeafDomains(tree, parentDomain = []) {
63202
63326
  const domains = [];
@@ -68682,6 +68806,14 @@ stores.inject(MyMetaStore, storeInstance);
68682
68806
  const isBasedBefore = cmd.base < start;
68683
68807
  const deltaCol = isBasedBefore && isCol ? thickness : 0;
68684
68808
  const deltaRow = isBasedBefore && !isCol ? thickness : 0;
68809
+ const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
68810
+ const originalSize = Object.fromEntries(toRemove.map((element) => {
68811
+ const size = isCol
68812
+ ? this.getters.getColSize(cmd.sheetId, element)
68813
+ : this.getters.getUserRowSize(cmd.sheetId, element);
68814
+ const isDefaultCol = isCol && size === DEFAULT_CELL_WIDTH;
68815
+ return [element, isDefaultCol ? undefined : size];
68816
+ }));
68685
68817
  const target = [
68686
68818
  {
68687
68819
  left: isCol ? start + deltaCol : 0,
@@ -68712,13 +68844,12 @@ stores.inject(MyMetaStore, storeInstance);
68712
68844
  const col = selection.left;
68713
68845
  const row = selection.top;
68714
68846
  this.setSelectionMixin({ zone: selection, cell: { col, row } }, [selection]);
68715
- const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
68716
68847
  let currentIndex = isBasedBefore ? cmd.base : cmd.base + 1;
68717
68848
  const resizingGroups = {};
68718
68849
  for (const element of toRemove) {
68719
- const size = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, element);
68850
+ const size = originalSize[element];
68720
68851
  const currentSize = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, currentIndex);
68721
- if (size != currentSize) {
68852
+ if (size && size != currentSize) {
68722
68853
  resizingGroups[size] ??= [];
68723
68854
  resizingGroups[size].push(currentIndex);
68724
68855
  currentIndex += 1;
@@ -70403,14 +70534,12 @@ stores.inject(MyMetaStore, storeInstance);
70403
70534
  this.editionState = "initializing";
70404
70535
  }
70405
70536
  stopEdition() {
70406
- const input = this.sheetNameRef.el;
70407
- if (!this.state.isEditing || !input)
70537
+ if (!this.state.isEditing || !this.sheetNameRef.el)
70408
70538
  return;
70409
70539
  this.state.isEditing = false;
70410
70540
  this.editionState = "initializing";
70411
- input.blur();
70541
+ this.sheetNameRef.el.blur();
70412
70542
  const inputValue = this.getInputContent() || "";
70413
- input.innerText = inputValue;
70414
70543
  interactiveRenameSheet(this.env, this.props.sheetId, inputValue, () => this.startEdition());
70415
70544
  }
70416
70545
  cancelEdition() {
@@ -77107,9 +77236,9 @@ stores.inject(MyMetaStore, storeInstance);
77107
77236
  exports.tokenize = tokenize;
77108
77237
 
77109
77238
 
77110
- __info__.version = "18.2.20";
77111
- __info__.date = "2025-06-27T09:11:55.800Z";
77112
- __info__.hash = "16dfc38";
77239
+ __info__.version = "18.2.22";
77240
+ __info__.date = "2025-07-28T13:37:29.067Z";
77241
+ __info__.hash = "0e414b1";
77113
77242
 
77114
77243
 
77115
77244
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);