@odoo/o-spreadsheet 18.3.11 → 18.3.13

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.3.11
6
- * @date 2025-06-27T09:13:07.206Z
7
- * @hash 460d5d0
5
+ * @version 18.3.13
6
+ * @date 2025-07-28T13:39:23.645Z
7
+ * @hash d30327c
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -826,6 +826,7 @@
826
826
  ];
827
827
  const specialWhiteSpaceRegexp = new RegExp(specialWhiteSpaceSpecialCharacters.join("|"), "g");
828
828
  const newLineRegexp = /(\r\n|\r)/g;
829
+ const whiteSpaceCharacters = specialWhiteSpaceSpecialCharacters.concat([" "]);
829
830
  /**
830
831
  * Replace all different newlines characters by \n
831
832
  */
@@ -2801,8 +2802,9 @@
2801
2802
  const DATE_JS_1900_OFFSET = INITIAL_JS_DAY.getTime() - INITIAL_1900_DAY.getTime();
2802
2803
  const mdyDateRegexp = /^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/;
2803
2804
  const ymdDateRegexp = /^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/;
2804
- const dateSeparatorsRegex = /\/|-|\s/;
2805
- const dateRegexp = /^(\d{1,4})[\/-\s](\d{1,4})([\/-\s](\d{1,4}))?$/;
2805
+ const whiteSpaceChars = whiteSpaceCharacters.join("");
2806
+ const dateSeparatorsRegex = new RegExp(`\/|-|${whiteSpaceCharacters.join("|")}`);
2807
+ const dateRegexp = new RegExp(`^(\\d{1,4})[\/${whiteSpaceChars}\-](\\d{1,4})([\/${whiteSpaceChars}\-](\\d{1,4}))?$`);
2806
2808
  const timeRegexp = /((\d+(:\d+)?(:\d+)?\s*(AM|PM))|(\d+:\d+(:\d+)?))$/;
2807
2809
  /** Convert a value number representing a date, or return undefined if it isn't possible */
2808
2810
  function valueToDateNumber(value, locale) {
@@ -6794,6 +6796,8 @@
6794
6796
  function splitTextToWidth(ctx, text, style, width) {
6795
6797
  if (!style)
6796
6798
  style = {};
6799
+ if (isMarkdownLink(text))
6800
+ text = parseMarkdownLink(text).label;
6797
6801
  const brokenText = [];
6798
6802
  // Checking if text contains NEWLINE before split makes it very slightly slower if text contains it,
6799
6803
  // but 5-10x faster if it doesn't
@@ -8808,6 +8812,10 @@
8808
8812
  if (groupValue === null || groupValue === "null") {
8809
8813
  return null;
8810
8814
  }
8815
+ const extractedGroupValue = typeof groupValue === "object" ? groupValue.value : groupValue;
8816
+ if (isEvaluationError(extractedGroupValue)) {
8817
+ return extractedGroupValue;
8818
+ }
8811
8819
  const groupValueString = typeof groupValue === "boolean"
8812
8820
  ? toString(groupValue).toLocaleLowerCase()
8813
8821
  : toString(groupValue);
@@ -18399,11 +18407,17 @@ stores.inject(MyMetaStore, storeInstance);
18399
18407
  if (isEvaluationError(cellReference?.value)) {
18400
18408
  return cellReference;
18401
18409
  }
18402
- const column = cellReference === undefined
18403
- ? this.__originCellPosition?.col
18404
- : toZone(cellReference.value).left;
18405
- assert(() => column !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
18406
- return column + 1;
18410
+ if (cellReference === undefined) {
18411
+ assert(() => this.__originCellPosition?.col !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
18412
+ return this.__originCellPosition.col + 1;
18413
+ }
18414
+ const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
18415
+ if (zone.left === zone.right) {
18416
+ return zone.left + 1;
18417
+ }
18418
+ return generateMatrix(zone.right - zone.left + 1, 1, (col, row) => ({
18419
+ value: zone.left + col + 1,
18420
+ }));
18407
18421
  },
18408
18422
  isExported: true,
18409
18423
  };
@@ -18622,11 +18636,17 @@ stores.inject(MyMetaStore, storeInstance);
18622
18636
  if (isEvaluationError(cellReference?.value)) {
18623
18637
  return cellReference;
18624
18638
  }
18625
- const row = cellReference === undefined
18626
- ? this.__originCellPosition?.row
18627
- : toZone(cellReference.value).top;
18628
- assert(() => row !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
18629
- return row + 1;
18639
+ if (cellReference === undefined) {
18640
+ assert(() => this.__originCellPosition?.row !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
18641
+ return this.__originCellPosition.row + 1;
18642
+ }
18643
+ const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
18644
+ if (zone.top === zone.bottom) {
18645
+ return zone.top + 1;
18646
+ }
18647
+ return generateMatrix(1, zone.bottom - zone.top + 1, (col, row) => ({
18648
+ value: zone.top + row + 1,
18649
+ }));
18630
18650
  },
18631
18651
  isExported: true,
18632
18652
  };
@@ -22606,6 +22626,7 @@ stores.inject(MyMetaStore, storeInstance);
22606
22626
 
22607
22627
  autoCompleteProviders.add("dataValidation", {
22608
22628
  displayAllOnInitialContent: true,
22629
+ canBeToggled: false,
22609
22630
  getProposals(tokenAtCursor, content) {
22610
22631
  if (isFormula(content)) {
22611
22632
  return [];
@@ -23502,6 +23523,7 @@ stores.inject(MyMetaStore, storeInstance);
23502
23523
  proposals,
23503
23524
  selectProposal: provider.selectProposal,
23504
23525
  autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
23526
+ canBeToggled: provider.canBeToggled,
23505
23527
  };
23506
23528
  }
23507
23529
  if (exactMatch && this._currentContent !== this.initialContent) {
@@ -23524,6 +23546,7 @@ stores.inject(MyMetaStore, storeInstance);
23524
23546
  proposals,
23525
23547
  selectProposal: provider.selectProposal,
23526
23548
  autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
23549
+ canBeToggled: provider.canBeToggled,
23527
23550
  };
23528
23551
  }
23529
23552
  }
@@ -32904,40 +32927,112 @@ stores.inject(MyMetaStore, storeInstance);
32904
32927
  * In all the sheets, replace the table-only references in the formula cells with standard references.
32905
32928
  */
32906
32929
  function convertTableFormulaReferences(convertedSheets, xlsxSheets) {
32930
+ let deconstructedSheets = null;
32907
32931
  for (let tableSheet of convertedSheets) {
32908
32932
  const tables = xlsxSheets.find((s) => isSheetNameEqual(s.sheetName, tableSheet.name)).tables;
32933
+ if (!tables || tables.length === 0) {
32934
+ continue;
32935
+ }
32936
+ // Only deconstruct sheets if we are sure there are tables to process
32937
+ if (!deconstructedSheets) {
32938
+ deconstructedSheets = deconstructSheets(convertedSheets);
32939
+ }
32909
32940
  for (let table of tables) {
32910
- const tabRef = table.name + "[";
32911
- for (let sheet of convertedSheets) {
32912
- for (let xc in sheet.cells) {
32913
- const cell = sheet.cells[xc];
32914
- let cellContent = sheet.cells[xc];
32915
- if (cell && cellContent && cellContent.startsWith("=")) {
32916
- let refIndex;
32917
- while ((refIndex = cellContent.indexOf(tabRef)) !== -1) {
32918
- let endIndex = refIndex + tabRef.length;
32919
- let openBrackets = 1;
32920
- while (openBrackets > 0 && endIndex < cellContent.length) {
32921
- if (cellContent[endIndex] === "[") {
32922
- openBrackets++;
32923
- }
32924
- else if (cellContent[endIndex] === "]") {
32925
- openBrackets--;
32926
- }
32927
- endIndex++;
32928
- }
32929
- let reference = cellContent.slice(refIndex + tabRef.length, endIndex - 1);
32930
- const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
32931
- const convertedRef = convertTableReference(sheetPrefix, reference, table, xc);
32932
- cellContent =
32933
- cellContent.slice(0, refIndex) + convertedRef + cellContent.slice(endIndex);
32941
+ for (let sheetId in deconstructedSheets) {
32942
+ const sheet = convertedSheets.find((s) => s.id === sheetId);
32943
+ for (let xc in deconstructedSheets[sheetId]) {
32944
+ const deconstructedCell = deconstructedSheets[sheetId][xc];
32945
+ for (let i = deconstructedCell.length - 3; i >= 0; i -= 2) {
32946
+ const possibleTable = deconstructedSheets[sheetId][xc][i];
32947
+ if (!possibleTable.endsWith(table.name)) {
32948
+ continue;
32934
32949
  }
32950
+ const possibleRef = deconstructedSheets[sheetId][xc][i + 1];
32951
+ const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
32952
+ const convertedRef = convertTableReference(sheetPrefix, possibleRef, table, xc);
32953
+ deconstructedSheets[sheetId][xc][i + 2] =
32954
+ possibleTable.slice(0, possibleTable.indexOf(table.name)) +
32955
+ convertedRef +
32956
+ deconstructedSheets[sheetId][xc][i + 2];
32957
+ deconstructedSheets[sheetId][xc].splice(i, 2);
32935
32958
  }
32936
- sheet.cells[xc] = cellContent;
32959
+ // sheet.cells[xc] = cellContent;
32960
+ }
32961
+ }
32962
+ }
32963
+ }
32964
+ if (!deconstructedSheets) {
32965
+ return;
32966
+ }
32967
+ for (let sheetId in deconstructedSheets) {
32968
+ const sheet = convertedSheets.find((s) => s.id === sheetId);
32969
+ for (let xc in deconstructedSheets[sheetId]) {
32970
+ const deconstructedCell = deconstructedSheets[sheetId][xc];
32971
+ if (deconstructedCell.length === 1) {
32972
+ sheet.cells[xc] = deconstructedCell[0];
32973
+ continue;
32974
+ }
32975
+ let newContent = "";
32976
+ for (let i = 0; i < deconstructedCell.length; i += 2) {
32977
+ newContent += deconstructedCell[i] + "[" + deconstructedCell[i + 1] + "]";
32978
+ }
32979
+ newContent += deconstructedCell[deconstructedCell.length - 1];
32980
+ sheet.cells[xc] = newContent;
32981
+ }
32982
+ }
32983
+ }
32984
+ /**
32985
+ * Deconstruct the content of the cells in the sheets to extract possible table references.
32986
+ * Example from "=AVERAGE(Table1[colName1])-AVERAGE(Table2[colName2])":
32987
+ * return --> ["=AVERAGE(Table1", "colName1", ")-AVERAGE(Table2", "colName2", ")"]
32988
+ */
32989
+ function deconstructSheets(convertedSheets) {
32990
+ const deconstructedSheets = {};
32991
+ for (let sheet of convertedSheets) {
32992
+ for (let xc in sheet.cells) {
32993
+ const cellContent = sheet.cells[xc];
32994
+ if (!cellContent || !cellContent.startsWith("=")) {
32995
+ continue;
32996
+ }
32997
+ const startIndex = cellContent.indexOf("[");
32998
+ if (startIndex === -1) {
32999
+ continue;
33000
+ }
33001
+ const deconstructedCell = [];
33002
+ let possibleTable = cellContent.slice(0, startIndex);
33003
+ let possibleRef = "";
33004
+ let openBrackets = 1;
33005
+ let mainPossibleTableIndex = 0;
33006
+ let mainOpenBracketIndex = startIndex;
33007
+ for (let index = startIndex + 1; index < cellContent.length; index++) {
33008
+ if (cellContent[index] === "[") {
33009
+ if (openBrackets === 0) {
33010
+ possibleTable = cellContent.slice(mainPossibleTableIndex, index);
33011
+ mainOpenBracketIndex = index;
33012
+ }
33013
+ openBrackets++;
33014
+ continue;
33015
+ }
33016
+ if (cellContent[index] === "]") {
33017
+ openBrackets--;
33018
+ if (openBrackets === 0) {
33019
+ possibleRef = cellContent.slice(mainOpenBracketIndex + 1, index);
33020
+ deconstructedCell.push(possibleTable);
33021
+ deconstructedCell.push(possibleRef);
33022
+ mainPossibleTableIndex = index + 1;
33023
+ }
33024
+ }
33025
+ }
33026
+ if (deconstructedCell.length) {
33027
+ if (!deconstructedSheets[sheet.id]) {
33028
+ deconstructedSheets[sheet.id] = {};
32937
33029
  }
33030
+ deconstructedCell.push(cellContent.slice(mainPossibleTableIndex));
33031
+ deconstructedSheets[sheet.id][xc] = [...deconstructedCell];
32938
33032
  }
32939
33033
  }
32940
33034
  }
33035
+ return deconstructedSheets;
32941
33036
  }
32942
33037
  /**
32943
33038
  * Convert table-specific references in formulas into standard references. A table reference is composed of columns names,
@@ -35999,6 +36094,9 @@ stores.inject(MyMetaStore, storeInstance);
35999
36094
  return undefined;
36000
36095
  }
36001
36096
  get errorOriginPositionString() {
36097
+ if (this.env.model.getters.isDashboard()) {
36098
+ return "";
36099
+ }
36002
36100
  const evaluationError = this.evaluationError;
36003
36101
  const position = evaluationError?.errorOriginPosition;
36004
36102
  if (!position || deepEquals(position, this.props.cellPosition)) {
@@ -43693,9 +43791,13 @@ stores.inject(MyMetaStore, storeInstance);
43693
43791
  }
43694
43792
  }
43695
43793
  closeAssistant() {
43794
+ if (!this.canBeToggled)
43795
+ return;
43696
43796
  this.assistant.forcedClosed = true;
43697
43797
  }
43698
43798
  openAssistant() {
43799
+ if (!this.canBeToggled)
43800
+ return;
43699
43801
  this.assistant.forcedClosed = false;
43700
43802
  }
43701
43803
  onWheel(event) {
@@ -43705,6 +43807,9 @@ stores.inject(MyMetaStore, storeInstance);
43705
43807
  event.stopPropagation();
43706
43808
  }
43707
43809
  }
43810
+ get canBeToggled() {
43811
+ return this.autoCompleteState.provider?.canBeToggled ?? true;
43812
+ }
43708
43813
  // ---------------------------------------------------------------------------
43709
43814
  // Private
43710
43815
  // ---------------------------------------------------------------------------
@@ -43892,7 +43997,7 @@ stores.inject(MyMetaStore, storeInstance);
43892
43997
  return [...new Set(argsToFocus)];
43893
43998
  }
43894
43999
  autoComplete(value) {
43895
- if (!value || this.assistant.forcedClosed) {
44000
+ if (!value || (this.assistant.forcedClosed && this.canBeToggled)) {
43896
44001
  return;
43897
44002
  }
43898
44003
  this.autoCompleteState.provider?.selectProposal(value);
@@ -49778,10 +49883,7 @@ stores.inject(MyMetaStore, storeInstance);
49778
49883
  if (finalCell.value === null) {
49779
49884
  return { value: _t("(Undefined)") };
49780
49885
  }
49781
- return {
49782
- value: finalCell.value,
49783
- format: finalCell.format,
49784
- };
49886
+ return finalCell;
49785
49887
  }
49786
49888
  getPivotCellValueAndFormat(measureId, domain) {
49787
49889
  const dataEntries = this.filterDataEntriesFromDomain(this.dataEntries, domain);
@@ -49874,9 +49976,15 @@ stores.inject(MyMetaStore, storeInstance);
49874
49976
  return domain.reduce((current, acc) => this.filterDataEntriesFromDomainNode(current, acc), dataEntries);
49875
49977
  }
49876
49978
  filterDataEntriesFromDomainNode(dataEntries, domain) {
49877
- const { field, value } = domain;
49979
+ const { field, value, type } = domain;
49878
49980
  const { nameWithGranularity } = this.getDimension(field);
49879
- return dataEntries.filter((entry) => entry[nameWithGranularity]?.value === value);
49981
+ return dataEntries.filter((entry) => {
49982
+ const cellValue = entry[nameWithGranularity]?.value;
49983
+ if (type === "char") {
49984
+ return String(cellValue) === String(value);
49985
+ }
49986
+ return cellValue === value;
49987
+ });
49880
49988
  }
49881
49989
  getDimension(nameWithGranularity) {
49882
49990
  return this.definition.getDimension(nameWithGranularity);
@@ -50010,7 +50118,6 @@ stores.inject(MyMetaStore, storeInstance);
50010
50118
  ui: SpreadsheetPivot,
50011
50119
  definition: SpreadsheetPivotRuntimeDefinition,
50012
50120
  externalData: false,
50013
- onIterationEndEvaluation: (pivot) => pivot.markAsDirtyForEvaluation(),
50014
50121
  dateGranularities: [...dateGranularities],
50015
50122
  datetimeGranularities: [...dateGranularities, "hour_number", "minute_number", "second_number"],
50016
50123
  isMeasureCandidate: (field) => field.type !== "boolean",
@@ -52543,6 +52650,11 @@ stores.inject(MyMetaStore, storeInstance);
52543
52650
  rect = this.defaultRect;
52544
52651
  isEditing = false;
52545
52652
  isCellReferenceVisible = false;
52653
+ currentEditedCell = {
52654
+ col: 0,
52655
+ row: 0,
52656
+ sheetId: this.env.model.getters.getActiveSheetId(),
52657
+ };
52546
52658
  composerStore;
52547
52659
  composerFocusStore;
52548
52660
  composerInterface;
@@ -52572,7 +52684,7 @@ stores.inject(MyMetaStore, storeInstance);
52572
52684
  return this.isCellReferenceVisible;
52573
52685
  }
52574
52686
  get cellReference() {
52575
- const { col, row, sheetId } = this.composerStore.currentEditedCell;
52687
+ const { col, row, sheetId } = this.currentEditedCell;
52576
52688
  const prefixSheet = sheetId !== this.env.model.getters.getActiveSheetId();
52577
52689
  return getFullReference(prefixSheet ? this.env.model.getters.getSheetName(sheetId) : undefined, toXC(col, row));
52578
52690
  }
@@ -52664,12 +52776,17 @@ stores.inject(MyMetaStore, storeInstance);
52664
52776
  if (!isEditing && this.composerFocusStore.activeComposer !== this.composerInterface) {
52665
52777
  this.composerFocusStore.focusComposer(this.composerInterface, { focusMode: "inactive" });
52666
52778
  }
52779
+ let shouldRecomputeRect = isEditing && !deepEquals(this.currentEditedCell, this.composerStore.currentEditedCell);
52667
52780
  if (this.isEditing !== isEditing) {
52668
52781
  this.isEditing = isEditing;
52669
52782
  if (!isEditing) {
52670
52783
  this.rect = this.defaultRect;
52671
52784
  return;
52672
52785
  }
52786
+ this.currentEditedCell = this.composerStore.currentEditedCell;
52787
+ shouldRecomputeRect = true;
52788
+ }
52789
+ if (shouldRecomputeRect) {
52673
52790
  const position = this.env.model.getters.getActivePosition();
52674
52791
  const zone = this.env.model.getters.expandZone(position.sheetId, positionToZone(position));
52675
52792
  this.rect = this.env.model.getters.getVisibleRect(zone);
@@ -62964,7 +63081,7 @@ stores.inject(MyMetaStore, storeInstance);
62964
63081
  onIterationEndEvaluationRegistry.add("pivots", (getters) => {
62965
63082
  for (const pivotId of getters.getPivotIds()) {
62966
63083
  const pivot = getters.getPivot(pivotId);
62967
- pivotRegistry.get(pivot.type).onIterationEndEvaluation(pivot);
63084
+ pivot.markAsDirtyForEvaluation?.();
62968
63085
  }
62969
63086
  });
62970
63087
 
@@ -65796,6 +65913,23 @@ stores.inject(MyMetaStore, storeInstance);
65796
65913
  static getters = ["getRowSize", "getHeaderSize", "getMaxAnchorOffset"];
65797
65914
  tallestCellInRow = {};
65798
65915
  ctx = document.createElement("canvas").getContext("2d");
65916
+ beforeHandle(cmd) {
65917
+ switch (cmd.type) {
65918
+ // Ensure rows are updated before "UPDATE_CELL" is dispatched from cell plugin.
65919
+ // "UPDATE_CELL" uses the Sheet core plugin to access row data.
65920
+ // If "ADD_COLUMNS_ROWS" has not been processed yet by header_sizes_ui,
65921
+ // size updates may apply to incorrect (pre-insert) rows.
65922
+ case "ADD_COLUMNS_ROWS":
65923
+ if (cmd.dimension === "COL") {
65924
+ return;
65925
+ }
65926
+ const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
65927
+ const newCells = Array(cmd.quantity).fill(undefined);
65928
+ const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
65929
+ this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
65930
+ break;
65931
+ }
65932
+ }
65799
65933
  handle(cmd) {
65800
65934
  switch (cmd.type) {
65801
65935
  case "START":
@@ -65825,16 +65959,6 @@ stores.inject(MyMetaStore, storeInstance);
65825
65959
  this.history.update("tallestCellInRow", cmd.sheetId, tallestCells);
65826
65960
  break;
65827
65961
  }
65828
- case "ADD_COLUMNS_ROWS": {
65829
- if (cmd.dimension === "COL") {
65830
- return;
65831
- }
65832
- const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
65833
- const newCells = Array(cmd.quantity).fill(undefined);
65834
- const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
65835
- this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
65836
- break;
65837
- }
65838
65962
  case "RESIZE_COLUMNS_ROWS":
65839
65963
  {
65840
65964
  const sheetId = cmd.sheetId;
@@ -65986,13 +66110,13 @@ stores.inject(MyMetaStore, storeInstance);
65986
66110
  super(custom, params);
65987
66111
  this.getters = params.getters;
65988
66112
  }
65989
- init(params) {
66113
+ markAsDirtyForEvaluation() {
65990
66114
  this.cache = {};
65991
66115
  this.rankAsc = {};
65992
66116
  this.rankDesc = {};
65993
66117
  this.runningTotal = {};
65994
66118
  this.runningTotalInPercent = {};
65995
- super.init(params);
66119
+ super.markAsDirtyForEvaluation?.();
65996
66120
  }
65997
66121
  getPivotCellValueAndFormat(measureName, domain) {
65998
66122
  return this.getMeasureDisplayValue(measureName, domain);
@@ -66117,7 +66241,7 @@ stores.inject(MyMetaStore, storeInstance);
66117
66241
  return this.getSubTreeMatchingDomain(node.children, domain, domainLevel + 1);
66118
66242
  }
66119
66243
  }
66120
- return tree;
66244
+ return [];
66121
66245
  }
66122
66246
  treeToLeafDomains(tree, parentDomain = []) {
66123
66247
  const domains = [];
@@ -71835,6 +71959,14 @@ stores.inject(MyMetaStore, storeInstance);
71835
71959
  const isBasedBefore = cmd.base < start;
71836
71960
  const deltaCol = isBasedBefore && isCol ? thickness : 0;
71837
71961
  const deltaRow = isBasedBefore && !isCol ? thickness : 0;
71962
+ const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
71963
+ const originalSize = Object.fromEntries(toRemove.map((element) => {
71964
+ const size = isCol
71965
+ ? this.getters.getColSize(cmd.sheetId, element)
71966
+ : this.getters.getUserRowSize(cmd.sheetId, element);
71967
+ const isDefaultCol = isCol && size === DEFAULT_CELL_WIDTH;
71968
+ return [element, isDefaultCol ? undefined : size];
71969
+ }));
71838
71970
  const target = [
71839
71971
  {
71840
71972
  left: isCol ? start + deltaCol : 0,
@@ -71865,13 +71997,12 @@ stores.inject(MyMetaStore, storeInstance);
71865
71997
  const col = selection.left;
71866
71998
  const row = selection.top;
71867
71999
  this.setSelectionMixin({ zone: selection, cell: { col, row } }, [selection]);
71868
- const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
71869
72000
  let currentIndex = isBasedBefore ? cmd.base : cmd.base + 1;
71870
72001
  const resizingGroups = {};
71871
72002
  for (const element of toRemove) {
71872
- const size = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, element);
72003
+ const size = originalSize[element];
71873
72004
  const currentSize = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, currentIndex);
71874
- if (size != currentSize) {
72005
+ if (size && size != currentSize) {
71875
72006
  resizingGroups[size] ??= [];
71876
72007
  resizingGroups[size].push(currentIndex);
71877
72008
  currentIndex += 1;
@@ -73665,14 +73796,12 @@ stores.inject(MyMetaStore, storeInstance);
73665
73796
  this.editionState = "initializing";
73666
73797
  }
73667
73798
  stopEdition() {
73668
- const input = this.sheetNameRef.el;
73669
- if (!this.state.isEditing || !input)
73799
+ if (!this.state.isEditing || !this.sheetNameRef.el)
73670
73800
  return;
73671
73801
  this.state.isEditing = false;
73672
73802
  this.editionState = "initializing";
73673
- input.blur();
73803
+ this.sheetNameRef.el.blur();
73674
73804
  const inputValue = this.getInputContent() || "";
73675
- input.innerText = inputValue;
73676
73805
  interactiveRenameSheet(this.env, this.props.sheetId, inputValue, () => this.startEdition());
73677
73806
  }
73678
73807
  cancelEdition() {
@@ -80770,9 +80899,9 @@ stores.inject(MyMetaStore, storeInstance);
80770
80899
  exports.tokenize = tokenize;
80771
80900
 
80772
80901
 
80773
- __info__.version = "18.3.11";
80774
- __info__.date = "2025-06-27T09:13:07.206Z";
80775
- __info__.hash = "460d5d0";
80902
+ __info__.version = "18.3.13";
80903
+ __info__.date = "2025-07-28T13:39:23.645Z";
80904
+ __info__.hash = "d30327c";
80776
80905
 
80777
80906
 
80778
80907
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);