@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
  'use strict';
@@ -827,6 +827,7 @@ const specialWhiteSpaceSpecialCharacters = [
827
827
  ];
828
828
  const specialWhiteSpaceRegexp = new RegExp(specialWhiteSpaceSpecialCharacters.join("|"), "g");
829
829
  const newLineRegexp = /(\r\n|\r)/g;
830
+ const whiteSpaceCharacters = specialWhiteSpaceSpecialCharacters.concat([" "]);
830
831
  /**
831
832
  * Replace all different newlines characters by \n
832
833
  */
@@ -2802,8 +2803,9 @@ const INITIAL_JS_DAY = DateTime.fromTimestamp(0);
2802
2803
  const DATE_JS_1900_OFFSET = INITIAL_JS_DAY.getTime() - INITIAL_1900_DAY.getTime();
2803
2804
  const mdyDateRegexp = /^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/;
2804
2805
  const ymdDateRegexp = /^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/;
2805
- const dateSeparatorsRegex = /\/|-|\s/;
2806
- const dateRegexp = /^(\d{1,4})[\/-\s](\d{1,4})([\/-\s](\d{1,4}))?$/;
2806
+ const whiteSpaceChars = whiteSpaceCharacters.join("");
2807
+ const dateSeparatorsRegex = new RegExp(`\/|-|${whiteSpaceCharacters.join("|")}`);
2808
+ const dateRegexp = new RegExp(`^(\\d{1,4})[\/${whiteSpaceChars}\-](\\d{1,4})([\/${whiteSpaceChars}\-](\\d{1,4}))?$`);
2807
2809
  const timeRegexp = /((\d+(:\d+)?(:\d+)?\s*(AM|PM))|(\d+:\d+(:\d+)?))$/;
2808
2810
  /** Convert a value number representing a date, or return undefined if it isn't possible */
2809
2811
  function valueToDateNumber(value, locale) {
@@ -6795,6 +6797,8 @@ function splitWordToSpecificWidth(ctx, word, width, style) {
6795
6797
  function splitTextToWidth(ctx, text, style, width) {
6796
6798
  if (!style)
6797
6799
  style = {};
6800
+ if (isMarkdownLink(text))
6801
+ text = parseMarkdownLink(text).label;
6798
6802
  const brokenText = [];
6799
6803
  // Checking if text contains NEWLINE before split makes it very slightly slower if text contains it,
6800
6804
  // but 5-10x faster if it doesn't
@@ -8809,6 +8813,10 @@ function toNormalizedPivotValue(dimension, groupValue) {
8809
8813
  if (groupValue === null || groupValue === "null") {
8810
8814
  return null;
8811
8815
  }
8816
+ const extractedGroupValue = typeof groupValue === "object" ? groupValue.value : groupValue;
8817
+ if (isEvaluationError(extractedGroupValue)) {
8818
+ return extractedGroupValue;
8819
+ }
8812
8820
  const groupValueString = typeof groupValue === "boolean"
8813
8821
  ? toString(groupValue).toLocaleLowerCase()
8814
8822
  : toString(groupValue);
@@ -18400,11 +18408,17 @@ const COLUMN = {
18400
18408
  if (isEvaluationError(cellReference?.value)) {
18401
18409
  return cellReference;
18402
18410
  }
18403
- const column = cellReference === undefined
18404
- ? this.__originCellPosition?.col
18405
- : toZone(cellReference.value).left;
18406
- assert(() => column !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
18407
- return column + 1;
18411
+ if (cellReference === undefined) {
18412
+ assert(() => this.__originCellPosition?.col !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
18413
+ return this.__originCellPosition.col + 1;
18414
+ }
18415
+ const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
18416
+ if (zone.left === zone.right) {
18417
+ return zone.left + 1;
18418
+ }
18419
+ return generateMatrix(zone.right - zone.left + 1, 1, (col, row) => ({
18420
+ value: zone.left + col + 1,
18421
+ }));
18408
18422
  },
18409
18423
  isExported: true,
18410
18424
  };
@@ -18623,11 +18637,17 @@ const ROW = {
18623
18637
  if (isEvaluationError(cellReference?.value)) {
18624
18638
  return cellReference;
18625
18639
  }
18626
- const row = cellReference === undefined
18627
- ? this.__originCellPosition?.row
18628
- : toZone(cellReference.value).top;
18629
- assert(() => row !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
18630
- return row + 1;
18640
+ if (cellReference === undefined) {
18641
+ assert(() => this.__originCellPosition?.row !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
18642
+ return this.__originCellPosition.row + 1;
18643
+ }
18644
+ const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
18645
+ if (zone.top === zone.bottom) {
18646
+ return zone.top + 1;
18647
+ }
18648
+ return generateMatrix(1, zone.bottom - zone.top + 1, (col, row) => ({
18649
+ value: zone.top + row + 1,
18650
+ }));
18631
18651
  },
18632
18652
  isExported: true,
18633
18653
  };
@@ -22607,6 +22627,7 @@ const autoCompleteProviders = new Registry();
22607
22627
 
22608
22628
  autoCompleteProviders.add("dataValidation", {
22609
22629
  displayAllOnInitialContent: true,
22630
+ canBeToggled: false,
22610
22631
  getProposals(tokenAtCursor, content) {
22611
22632
  if (isFormula(content)) {
22612
22633
  return [];
@@ -23503,6 +23524,7 @@ class AbstractComposerStore extends SpreadsheetStore {
23503
23524
  proposals,
23504
23525
  selectProposal: provider.selectProposal,
23505
23526
  autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
23527
+ canBeToggled: provider.canBeToggled,
23506
23528
  };
23507
23529
  }
23508
23530
  if (exactMatch && this._currentContent !== this.initialContent) {
@@ -23525,6 +23547,7 @@ class AbstractComposerStore extends SpreadsheetStore {
23525
23547
  proposals,
23526
23548
  selectProposal: provider.selectProposal,
23527
23549
  autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
23550
+ canBeToggled: provider.canBeToggled,
23528
23551
  };
23529
23552
  }
23530
23553
  }
@@ -32905,40 +32928,112 @@ function convertPivotTableConfig(pivotTable) {
32905
32928
  * In all the sheets, replace the table-only references in the formula cells with standard references.
32906
32929
  */
32907
32930
  function convertTableFormulaReferences(convertedSheets, xlsxSheets) {
32931
+ let deconstructedSheets = null;
32908
32932
  for (let tableSheet of convertedSheets) {
32909
32933
  const tables = xlsxSheets.find((s) => isSheetNameEqual(s.sheetName, tableSheet.name)).tables;
32934
+ if (!tables || tables.length === 0) {
32935
+ continue;
32936
+ }
32937
+ // Only deconstruct sheets if we are sure there are tables to process
32938
+ if (!deconstructedSheets) {
32939
+ deconstructedSheets = deconstructSheets(convertedSheets);
32940
+ }
32910
32941
  for (let table of tables) {
32911
- const tabRef = table.name + "[";
32912
- for (let sheet of convertedSheets) {
32913
- for (let xc in sheet.cells) {
32914
- const cell = sheet.cells[xc];
32915
- let cellContent = sheet.cells[xc];
32916
- if (cell && cellContent && cellContent.startsWith("=")) {
32917
- let refIndex;
32918
- while ((refIndex = cellContent.indexOf(tabRef)) !== -1) {
32919
- let endIndex = refIndex + tabRef.length;
32920
- let openBrackets = 1;
32921
- while (openBrackets > 0 && endIndex < cellContent.length) {
32922
- if (cellContent[endIndex] === "[") {
32923
- openBrackets++;
32924
- }
32925
- else if (cellContent[endIndex] === "]") {
32926
- openBrackets--;
32927
- }
32928
- endIndex++;
32929
- }
32930
- let reference = cellContent.slice(refIndex + tabRef.length, endIndex - 1);
32931
- const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
32932
- const convertedRef = convertTableReference(sheetPrefix, reference, table, xc);
32933
- cellContent =
32934
- cellContent.slice(0, refIndex) + convertedRef + cellContent.slice(endIndex);
32942
+ for (let sheetId in deconstructedSheets) {
32943
+ const sheet = convertedSheets.find((s) => s.id === sheetId);
32944
+ for (let xc in deconstructedSheets[sheetId]) {
32945
+ const deconstructedCell = deconstructedSheets[sheetId][xc];
32946
+ for (let i = deconstructedCell.length - 3; i >= 0; i -= 2) {
32947
+ const possibleTable = deconstructedSheets[sheetId][xc][i];
32948
+ if (!possibleTable.endsWith(table.name)) {
32949
+ continue;
32935
32950
  }
32951
+ const possibleRef = deconstructedSheets[sheetId][xc][i + 1];
32952
+ const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
32953
+ const convertedRef = convertTableReference(sheetPrefix, possibleRef, table, xc);
32954
+ deconstructedSheets[sheetId][xc][i + 2] =
32955
+ possibleTable.slice(0, possibleTable.indexOf(table.name)) +
32956
+ convertedRef +
32957
+ deconstructedSheets[sheetId][xc][i + 2];
32958
+ deconstructedSheets[sheetId][xc].splice(i, 2);
32936
32959
  }
32937
- sheet.cells[xc] = cellContent;
32960
+ // sheet.cells[xc] = cellContent;
32961
+ }
32962
+ }
32963
+ }
32964
+ }
32965
+ if (!deconstructedSheets) {
32966
+ return;
32967
+ }
32968
+ for (let sheetId in deconstructedSheets) {
32969
+ const sheet = convertedSheets.find((s) => s.id === sheetId);
32970
+ for (let xc in deconstructedSheets[sheetId]) {
32971
+ const deconstructedCell = deconstructedSheets[sheetId][xc];
32972
+ if (deconstructedCell.length === 1) {
32973
+ sheet.cells[xc] = deconstructedCell[0];
32974
+ continue;
32975
+ }
32976
+ let newContent = "";
32977
+ for (let i = 0; i < deconstructedCell.length; i += 2) {
32978
+ newContent += deconstructedCell[i] + "[" + deconstructedCell[i + 1] + "]";
32979
+ }
32980
+ newContent += deconstructedCell[deconstructedCell.length - 1];
32981
+ sheet.cells[xc] = newContent;
32982
+ }
32983
+ }
32984
+ }
32985
+ /**
32986
+ * Deconstruct the content of the cells in the sheets to extract possible table references.
32987
+ * Example from "=AVERAGE(Table1[colName1])-AVERAGE(Table2[colName2])":
32988
+ * return --> ["=AVERAGE(Table1", "colName1", ")-AVERAGE(Table2", "colName2", ")"]
32989
+ */
32990
+ function deconstructSheets(convertedSheets) {
32991
+ const deconstructedSheets = {};
32992
+ for (let sheet of convertedSheets) {
32993
+ for (let xc in sheet.cells) {
32994
+ const cellContent = sheet.cells[xc];
32995
+ if (!cellContent || !cellContent.startsWith("=")) {
32996
+ continue;
32997
+ }
32998
+ const startIndex = cellContent.indexOf("[");
32999
+ if (startIndex === -1) {
33000
+ continue;
33001
+ }
33002
+ const deconstructedCell = [];
33003
+ let possibleTable = cellContent.slice(0, startIndex);
33004
+ let possibleRef = "";
33005
+ let openBrackets = 1;
33006
+ let mainPossibleTableIndex = 0;
33007
+ let mainOpenBracketIndex = startIndex;
33008
+ for (let index = startIndex + 1; index < cellContent.length; index++) {
33009
+ if (cellContent[index] === "[") {
33010
+ if (openBrackets === 0) {
33011
+ possibleTable = cellContent.slice(mainPossibleTableIndex, index);
33012
+ mainOpenBracketIndex = index;
33013
+ }
33014
+ openBrackets++;
33015
+ continue;
33016
+ }
33017
+ if (cellContent[index] === "]") {
33018
+ openBrackets--;
33019
+ if (openBrackets === 0) {
33020
+ possibleRef = cellContent.slice(mainOpenBracketIndex + 1, index);
33021
+ deconstructedCell.push(possibleTable);
33022
+ deconstructedCell.push(possibleRef);
33023
+ mainPossibleTableIndex = index + 1;
33024
+ }
33025
+ }
33026
+ }
33027
+ if (deconstructedCell.length) {
33028
+ if (!deconstructedSheets[sheet.id]) {
33029
+ deconstructedSheets[sheet.id] = {};
32938
33030
  }
33031
+ deconstructedCell.push(cellContent.slice(mainPossibleTableIndex));
33032
+ deconstructedSheets[sheet.id][xc] = [...deconstructedCell];
32939
33033
  }
32940
33034
  }
32941
33035
  }
33036
+ return deconstructedSheets;
32942
33037
  }
32943
33038
  /**
32944
33039
  * Convert table-specific references in formulas into standard references. A table reference is composed of columns names,
@@ -36000,6 +36095,9 @@ class ErrorToolTip extends owl.Component {
36000
36095
  return undefined;
36001
36096
  }
36002
36097
  get errorOriginPositionString() {
36098
+ if (this.env.model.getters.isDashboard()) {
36099
+ return "";
36100
+ }
36003
36101
  const evaluationError = this.evaluationError;
36004
36102
  const position = evaluationError?.errorOriginPosition;
36005
36103
  if (!position || deepEquals(position, this.props.cellPosition)) {
@@ -43694,9 +43792,13 @@ class Composer extends owl.Component {
43694
43792
  }
43695
43793
  }
43696
43794
  closeAssistant() {
43795
+ if (!this.canBeToggled)
43796
+ return;
43697
43797
  this.assistant.forcedClosed = true;
43698
43798
  }
43699
43799
  openAssistant() {
43800
+ if (!this.canBeToggled)
43801
+ return;
43700
43802
  this.assistant.forcedClosed = false;
43701
43803
  }
43702
43804
  onWheel(event) {
@@ -43706,6 +43808,9 @@ class Composer extends owl.Component {
43706
43808
  event.stopPropagation();
43707
43809
  }
43708
43810
  }
43811
+ get canBeToggled() {
43812
+ return this.autoCompleteState.provider?.canBeToggled ?? true;
43813
+ }
43709
43814
  // ---------------------------------------------------------------------------
43710
43815
  // Private
43711
43816
  // ---------------------------------------------------------------------------
@@ -43893,7 +43998,7 @@ class Composer extends owl.Component {
43893
43998
  return [...new Set(argsToFocus)];
43894
43999
  }
43895
44000
  autoComplete(value) {
43896
- if (!value || this.assistant.forcedClosed) {
44001
+ if (!value || (this.assistant.forcedClosed && this.canBeToggled)) {
43897
44002
  return;
43898
44003
  }
43899
44004
  this.autoCompleteState.provider?.selectProposal(value);
@@ -49779,10 +49884,7 @@ class SpreadsheetPivot {
49779
49884
  if (finalCell.value === null) {
49780
49885
  return { value: _t("(Undefined)") };
49781
49886
  }
49782
- return {
49783
- value: finalCell.value,
49784
- format: finalCell.format,
49785
- };
49887
+ return finalCell;
49786
49888
  }
49787
49889
  getPivotCellValueAndFormat(measureId, domain) {
49788
49890
  const dataEntries = this.filterDataEntriesFromDomain(this.dataEntries, domain);
@@ -49875,9 +49977,15 @@ class SpreadsheetPivot {
49875
49977
  return domain.reduce((current, acc) => this.filterDataEntriesFromDomainNode(current, acc), dataEntries);
49876
49978
  }
49877
49979
  filterDataEntriesFromDomainNode(dataEntries, domain) {
49878
- const { field, value } = domain;
49980
+ const { field, value, type } = domain;
49879
49981
  const { nameWithGranularity } = this.getDimension(field);
49880
- return dataEntries.filter((entry) => entry[nameWithGranularity]?.value === value);
49982
+ return dataEntries.filter((entry) => {
49983
+ const cellValue = entry[nameWithGranularity]?.value;
49984
+ if (type === "char") {
49985
+ return String(cellValue) === String(value);
49986
+ }
49987
+ return cellValue === value;
49988
+ });
49881
49989
  }
49882
49990
  getDimension(nameWithGranularity) {
49883
49991
  return this.definition.getDimension(nameWithGranularity);
@@ -50011,7 +50119,6 @@ pivotRegistry.add("SPREADSHEET", {
50011
50119
  ui: SpreadsheetPivot,
50012
50120
  definition: SpreadsheetPivotRuntimeDefinition,
50013
50121
  externalData: false,
50014
- onIterationEndEvaluation: (pivot) => pivot.markAsDirtyForEvaluation(),
50015
50122
  dateGranularities: [...dateGranularities],
50016
50123
  datetimeGranularities: [...dateGranularities, "hour_number", "minute_number", "second_number"],
50017
50124
  isMeasureCandidate: (field) => field.type !== "boolean",
@@ -52544,6 +52651,11 @@ class GridComposer extends owl.Component {
52544
52651
  rect = this.defaultRect;
52545
52652
  isEditing = false;
52546
52653
  isCellReferenceVisible = false;
52654
+ currentEditedCell = {
52655
+ col: 0,
52656
+ row: 0,
52657
+ sheetId: this.env.model.getters.getActiveSheetId(),
52658
+ };
52547
52659
  composerStore;
52548
52660
  composerFocusStore;
52549
52661
  composerInterface;
@@ -52573,7 +52685,7 @@ class GridComposer extends owl.Component {
52573
52685
  return this.isCellReferenceVisible;
52574
52686
  }
52575
52687
  get cellReference() {
52576
- const { col, row, sheetId } = this.composerStore.currentEditedCell;
52688
+ const { col, row, sheetId } = this.currentEditedCell;
52577
52689
  const prefixSheet = sheetId !== this.env.model.getters.getActiveSheetId();
52578
52690
  return getFullReference(prefixSheet ? this.env.model.getters.getSheetName(sheetId) : undefined, toXC(col, row));
52579
52691
  }
@@ -52665,12 +52777,17 @@ class GridComposer extends owl.Component {
52665
52777
  if (!isEditing && this.composerFocusStore.activeComposer !== this.composerInterface) {
52666
52778
  this.composerFocusStore.focusComposer(this.composerInterface, { focusMode: "inactive" });
52667
52779
  }
52780
+ let shouldRecomputeRect = isEditing && !deepEquals(this.currentEditedCell, this.composerStore.currentEditedCell);
52668
52781
  if (this.isEditing !== isEditing) {
52669
52782
  this.isEditing = isEditing;
52670
52783
  if (!isEditing) {
52671
52784
  this.rect = this.defaultRect;
52672
52785
  return;
52673
52786
  }
52787
+ this.currentEditedCell = this.composerStore.currentEditedCell;
52788
+ shouldRecomputeRect = true;
52789
+ }
52790
+ if (shouldRecomputeRect) {
52674
52791
  const position = this.env.model.getters.getActivePosition();
52675
52792
  const zone = this.env.model.getters.expandZone(position.sheetId, positionToZone(position));
52676
52793
  this.rect = this.env.model.getters.getVisibleRect(zone);
@@ -62965,7 +63082,7 @@ const onIterationEndEvaluationRegistry = new Registry();
62965
63082
  onIterationEndEvaluationRegistry.add("pivots", (getters) => {
62966
63083
  for (const pivotId of getters.getPivotIds()) {
62967
63084
  const pivot = getters.getPivot(pivotId);
62968
- pivotRegistry.get(pivot.type).onIterationEndEvaluation(pivot);
63085
+ pivot.markAsDirtyForEvaluation?.();
62969
63086
  }
62970
63087
  });
62971
63088
 
@@ -65797,6 +65914,23 @@ class HeaderSizeUIPlugin extends CoreViewPlugin {
65797
65914
  static getters = ["getRowSize", "getHeaderSize", "getMaxAnchorOffset"];
65798
65915
  tallestCellInRow = {};
65799
65916
  ctx = document.createElement("canvas").getContext("2d");
65917
+ beforeHandle(cmd) {
65918
+ switch (cmd.type) {
65919
+ // Ensure rows are updated before "UPDATE_CELL" is dispatched from cell plugin.
65920
+ // "UPDATE_CELL" uses the Sheet core plugin to access row data.
65921
+ // If "ADD_COLUMNS_ROWS" has not been processed yet by header_sizes_ui,
65922
+ // size updates may apply to incorrect (pre-insert) rows.
65923
+ case "ADD_COLUMNS_ROWS":
65924
+ if (cmd.dimension === "COL") {
65925
+ return;
65926
+ }
65927
+ const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
65928
+ const newCells = Array(cmd.quantity).fill(undefined);
65929
+ const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
65930
+ this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
65931
+ break;
65932
+ }
65933
+ }
65800
65934
  handle(cmd) {
65801
65935
  switch (cmd.type) {
65802
65936
  case "START":
@@ -65826,16 +65960,6 @@ class HeaderSizeUIPlugin extends CoreViewPlugin {
65826
65960
  this.history.update("tallestCellInRow", cmd.sheetId, tallestCells);
65827
65961
  break;
65828
65962
  }
65829
- case "ADD_COLUMNS_ROWS": {
65830
- if (cmd.dimension === "COL") {
65831
- return;
65832
- }
65833
- const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
65834
- const newCells = Array(cmd.quantity).fill(undefined);
65835
- const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
65836
- this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
65837
- break;
65838
- }
65839
65963
  case "RESIZE_COLUMNS_ROWS":
65840
65964
  {
65841
65965
  const sheetId = cmd.sheetId;
@@ -65987,13 +66111,13 @@ function withPivotPresentationLayer (PivotClass) {
65987
66111
  super(custom, params);
65988
66112
  this.getters = params.getters;
65989
66113
  }
65990
- init(params) {
66114
+ markAsDirtyForEvaluation() {
65991
66115
  this.cache = {};
65992
66116
  this.rankAsc = {};
65993
66117
  this.rankDesc = {};
65994
66118
  this.runningTotal = {};
65995
66119
  this.runningTotalInPercent = {};
65996
- super.init(params);
66120
+ super.markAsDirtyForEvaluation?.();
65997
66121
  }
65998
66122
  getPivotCellValueAndFormat(measureName, domain) {
65999
66123
  return this.getMeasureDisplayValue(measureName, domain);
@@ -66118,7 +66242,7 @@ function withPivotPresentationLayer (PivotClass) {
66118
66242
  return this.getSubTreeMatchingDomain(node.children, domain, domainLevel + 1);
66119
66243
  }
66120
66244
  }
66121
- return tree;
66245
+ return [];
66122
66246
  }
66123
66247
  treeToLeafDomains(tree, parentDomain = []) {
66124
66248
  const domains = [];
@@ -71836,6 +71960,14 @@ class GridSelectionPlugin extends UIPlugin {
71836
71960
  const isBasedBefore = cmd.base < start;
71837
71961
  const deltaCol = isBasedBefore && isCol ? thickness : 0;
71838
71962
  const deltaRow = isBasedBefore && !isCol ? thickness : 0;
71963
+ const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
71964
+ const originalSize = Object.fromEntries(toRemove.map((element) => {
71965
+ const size = isCol
71966
+ ? this.getters.getColSize(cmd.sheetId, element)
71967
+ : this.getters.getUserRowSize(cmd.sheetId, element);
71968
+ const isDefaultCol = isCol && size === DEFAULT_CELL_WIDTH;
71969
+ return [element, isDefaultCol ? undefined : size];
71970
+ }));
71839
71971
  const target = [
71840
71972
  {
71841
71973
  left: isCol ? start + deltaCol : 0,
@@ -71866,13 +71998,12 @@ class GridSelectionPlugin extends UIPlugin {
71866
71998
  const col = selection.left;
71867
71999
  const row = selection.top;
71868
72000
  this.setSelectionMixin({ zone: selection, cell: { col, row } }, [selection]);
71869
- const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
71870
72001
  let currentIndex = isBasedBefore ? cmd.base : cmd.base + 1;
71871
72002
  const resizingGroups = {};
71872
72003
  for (const element of toRemove) {
71873
- const size = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, element);
72004
+ const size = originalSize[element];
71874
72005
  const currentSize = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, currentIndex);
71875
- if (size != currentSize) {
72006
+ if (size && size != currentSize) {
71876
72007
  resizingGroups[size] ??= [];
71877
72008
  resizingGroups[size].push(currentIndex);
71878
72009
  currentIndex += 1;
@@ -73666,14 +73797,12 @@ class BottomBarSheet extends owl.Component {
73666
73797
  this.editionState = "initializing";
73667
73798
  }
73668
73799
  stopEdition() {
73669
- const input = this.sheetNameRef.el;
73670
- if (!this.state.isEditing || !input)
73800
+ if (!this.state.isEditing || !this.sheetNameRef.el)
73671
73801
  return;
73672
73802
  this.state.isEditing = false;
73673
73803
  this.editionState = "initializing";
73674
- input.blur();
73804
+ this.sheetNameRef.el.blur();
73675
73805
  const inputValue = this.getInputContent() || "";
73676
- input.innerText = inputValue;
73677
73806
  interactiveRenameSheet(this.env, this.props.sheetId, inputValue, () => this.startEdition());
73678
73807
  }
73679
73808
  cancelEdition() {
@@ -80771,6 +80900,6 @@ exports.tokenColors = tokenColors;
80771
80900
  exports.tokenize = tokenize;
80772
80901
 
80773
80902
 
80774
- __info__.version = "18.3.11";
80775
- __info__.date = "2025-06-27T09:13:07.206Z";
80776
- __info__.hash = "460d5d0";
80903
+ __info__.version = "18.3.13";
80904
+ __info__.date = "2025-07-28T13:39:23.645Z";
80905
+ __info__.hash = "d30327c";
@@ -5546,6 +5546,7 @@ declare class HeaderSizeUIPlugin extends CoreViewPlugin<HeaderSizeState> impleme
5546
5546
  static getters: readonly ["getRowSize", "getHeaderSize", "getMaxAnchorOffset"];
5547
5547
  readonly tallestCellInRow: Immutable<Record<UID, Array<CellWithSize | undefined>>>;
5548
5548
  private ctx;
5549
+ beforeHandle(cmd: Command): void;
5549
5550
  handle(cmd: Command): void;
5550
5551
  getRowSize(sheetId: UID, row: HeaderIndex): Pixel;
5551
5552
  getMaxAnchorOffset(sheetId: UID, height: Pixel, width: Pixel): AnchorOffset;
@@ -5684,6 +5685,7 @@ interface Pivot<T = PivotRuntimeDefinition> {
5684
5685
  label: string;
5685
5686
  }[];
5686
5687
  needsReevaluation: boolean;
5688
+ markAsDirtyForEvaluation?(): void;
5687
5689
  }
5688
5690
 
5689
5691
  declare class PivotUIPlugin extends CoreViewPlugin {
@@ -6603,7 +6605,6 @@ interface PivotRegistryItem {
6603
6605
  ui: PivotUIConstructor;
6604
6606
  definition: PivotDefinitionConstructor;
6605
6607
  externalData: boolean;
6606
- onIterationEndEvaluation: (pivot: Pivot) => void;
6607
6608
  dateGranularities: string[];
6608
6609
  datetimeGranularities: string[];
6609
6610
  isMeasureCandidate: (field: PivotField) => boolean;
@@ -8540,6 +8541,7 @@ declare class Composer extends Component<CellComposerProps, SpreadsheetChildEnv>
8540
8541
  closeAssistant(): void;
8541
8542
  openAssistant(): void;
8542
8543
  onWheel(event: WheelEvent): void;
8544
+ get canBeToggled(): boolean;
8543
8545
  private processContent;
8544
8546
  /**
8545
8547
  * Get the HTML content corresponding to the current composer token, divided by lines.
@@ -8592,6 +8594,7 @@ interface AutoCompleteProvider {
8592
8594
  proposals: AutoCompleteProposal[];
8593
8595
  selectProposal(text: string): void;
8594
8596
  autoSelectFirstProposal: boolean;
8597
+ canBeToggled?: boolean;
8595
8598
  }
8596
8599
  interface ComposerStoreInterface {
8597
8600
  currentEditedCell?: CellPosition;
@@ -8611,6 +8614,7 @@ interface ComposerStoreInterface {
8611
8614
  interface AutoCompleteProviderDefinition {
8612
8615
  sequence?: number;
8613
8616
  autoSelectFirstProposal?: boolean;
8617
+ canBeToggled?: boolean;
8614
8618
  displayAllOnInitialContent?: boolean;
8615
8619
  maxDisplayedProposals?: number;
8616
8620
  getProposals(this: {
@@ -9232,6 +9236,7 @@ declare class GridComposer extends Component<Props$I, SpreadsheetChildEnv> {
9232
9236
  private rect;
9233
9237
  private isEditing;
9234
9238
  private isCellReferenceVisible;
9239
+ private currentEditedCell;
9235
9240
  private composerStore;
9236
9241
  composerFocusStore: Store<ComposerFocusStore>;
9237
9242
  private composerInterface;
@@ -10494,7 +10499,7 @@ declare function createPivotFormula(formulaId: string, cell: PivotTableCell): st
10494
10499
  * e.g. given the following formula PIVOT.VALUE("1", "stage_id", "42", "status", "won"),
10495
10500
  * the two group values are "42" and "won".
10496
10501
  */
10497
- declare function toNormalizedPivotValue(dimension: Pick<PivotDimension$1, "type" | "displayName" | "granularity">, groupValue: any): CellValue;
10502
+ declare function toNormalizedPivotValue(dimension: Pick<PivotDimension$1, "type" | "displayName" | "granularity">, groupValue: Maybe<CellValue | FunctionResultObject>): CellValue;
10498
10503
  declare function toFunctionPivotValue(value: CellValue, dimension: Pick<PivotDimension$1, "type" | "granularity">): string;
10499
10504
 
10500
10505
  interface Props$h {