@odoo/o-spreadsheet 18.4.2 → 18.4.3

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.4.2
6
- * @date 2025-07-11T11:11:12.642Z
7
- * @hash 29b6458
5
+ * @version 18.4.3
6
+ * @date 2025-07-28T13:39:06.036Z
7
+ * @hash 4b596d7
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -19034,13 +19034,19 @@ stores.inject(MyMetaStore, storeInstance);
19034
19034
  if (isEvaluationError(cellReference?.value)) {
19035
19035
  return cellReference;
19036
19036
  }
19037
- const column = cellReference === undefined
19038
- ? this.__originCellPosition?.col
19039
- : toZone(cellReference.value).left;
19040
- if (column === undefined) {
19041
- return new EvaluationError(_t("In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter."));
19037
+ if (cellReference === undefined) {
19038
+ if (this.__originCellPosition?.col === undefined) {
19039
+ return new EvaluationError(_t("In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter."));
19040
+ }
19041
+ return this.__originCellPosition.col + 1;
19042
+ }
19043
+ const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
19044
+ if (zone.left === zone.right) {
19045
+ return zone.left + 1;
19042
19046
  }
19043
- return column + 1;
19047
+ return generateMatrix(zone.right - zone.left + 1, 1, (col, row) => ({
19048
+ value: zone.left + col + 1,
19049
+ }));
19044
19050
  },
19045
19051
  isExported: true,
19046
19052
  };
@@ -19271,13 +19277,19 @@ stores.inject(MyMetaStore, storeInstance);
19271
19277
  if (isEvaluationError(cellReference?.value)) {
19272
19278
  return cellReference;
19273
19279
  }
19274
- const row = cellReference === undefined
19275
- ? this.__originCellPosition?.row
19276
- : toZone(cellReference.value).top;
19277
- if (row === undefined) {
19278
- return new EvaluationError(_t("In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter."));
19280
+ if (cellReference === undefined) {
19281
+ if (this.__originCellPosition?.row === undefined) {
19282
+ return new EvaluationError(_t("In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter."));
19283
+ }
19284
+ return this.__originCellPosition.row + 1;
19285
+ }
19286
+ const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
19287
+ if (zone.top === zone.bottom) {
19288
+ return zone.top + 1;
19279
19289
  }
19280
- return row + 1;
19290
+ return generateMatrix(1, zone.bottom - zone.top + 1, (col, row) => ({
19291
+ value: zone.top + row + 1,
19292
+ }));
19281
19293
  },
19282
19294
  isExported: true,
19283
19295
  };
@@ -32607,6 +32619,9 @@ stores.inject(MyMetaStore, storeInstance);
32607
32619
  get isAutoCompleteDisplayed() {
32608
32620
  return !!this.autoComplete.provider;
32609
32621
  }
32622
+ get canBeToggled() {
32623
+ return this.autoComplete.provider?.canBeToggled ?? true;
32624
+ }
32610
32625
  cycleReferences() {
32611
32626
  const locale = this.getters.getLocale();
32612
32627
  const updated = cycleFixedReference(this.composerSelection, this._currentContent, locale);
@@ -33136,6 +33151,7 @@ stores.inject(MyMetaStore, storeInstance);
33136
33151
  proposals,
33137
33152
  selectProposal: provider.selectProposal,
33138
33153
  autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
33154
+ canBeToggled: provider.canBeToggled,
33139
33155
  };
33140
33156
  }
33141
33157
  if (exactMatch && this._currentContent !== this.initialContent) {
@@ -33158,6 +33174,7 @@ stores.inject(MyMetaStore, storeInstance);
33158
33174
  proposals,
33159
33175
  selectProposal: provider.selectProposal,
33160
33176
  autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
33177
+ canBeToggled: provider.canBeToggled,
33161
33178
  };
33162
33179
  }
33163
33180
  }
@@ -33728,9 +33745,13 @@ stores.inject(MyMetaStore, storeInstance);
33728
33745
  }
33729
33746
  }
33730
33747
  closeAssistant() {
33748
+ if (!this.props.composerStore.canBeToggled)
33749
+ return;
33731
33750
  this.assistant.forcedClosed = true;
33732
33751
  }
33733
33752
  openAssistant() {
33753
+ if (!this.props.composerStore.canBeToggled)
33754
+ return;
33734
33755
  this.assistant.forcedClosed = false;
33735
33756
  }
33736
33757
  onWheel(event) {
@@ -33920,7 +33941,7 @@ stores.inject(MyMetaStore, storeInstance);
33920
33941
  return [...new Set(argsToFocus)];
33921
33942
  }
33922
33943
  autoComplete(value) {
33923
- if (!value || this.assistant.forcedClosed) {
33944
+ if (!value || (this.assistant.forcedClosed && this.props.composerStore.canBeToggled)) {
33924
33945
  return;
33925
33946
  }
33926
33947
  this.props.composerStore.insertAutoCompleteValue(value);
@@ -55681,9 +55702,15 @@ stores.inject(MyMetaStore, storeInstance);
55681
55702
  return domain.reduce((current, acc) => this.filterDataEntriesFromDomainNode(current, acc), dataEntries);
55682
55703
  }
55683
55704
  filterDataEntriesFromDomainNode(dataEntries, domain) {
55684
- const { field, value } = domain;
55705
+ const { field, value, type } = domain;
55685
55706
  const { nameWithGranularity } = this.getDimension(field);
55686
- return dataEntries.filter((entry) => entry[nameWithGranularity]?.value === value);
55707
+ return dataEntries.filter((entry) => {
55708
+ const cellValue = entry[nameWithGranularity]?.value;
55709
+ if (type === "char") {
55710
+ return String(cellValue) === String(value);
55711
+ }
55712
+ return cellValue === value;
55713
+ });
55687
55714
  }
55688
55715
  getDimension(nameWithGranularity) {
55689
55716
  return this.definition.getDimension(nameWithGranularity);
@@ -67552,6 +67579,23 @@ stores.inject(MyMetaStore, storeInstance);
67552
67579
  static getters = ["getRowSize", "getHeaderSize", "getMaxAnchorOffset"];
67553
67580
  tallestCellInRow = {};
67554
67581
  ctx = document.createElement("canvas").getContext("2d");
67582
+ beforeHandle(cmd) {
67583
+ switch (cmd.type) {
67584
+ // Ensure rows are updated before "UPDATE_CELL" is dispatched from cell plugin.
67585
+ // "UPDATE_CELL" uses the Sheet core plugin to access row data.
67586
+ // If "ADD_COLUMNS_ROWS" has not been processed yet by header_sizes_ui,
67587
+ // size updates may apply to incorrect (pre-insert) rows.
67588
+ case "ADD_COLUMNS_ROWS":
67589
+ if (cmd.dimension === "COL") {
67590
+ return;
67591
+ }
67592
+ const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
67593
+ const newCells = Array(cmd.quantity).fill(undefined);
67594
+ const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
67595
+ this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
67596
+ break;
67597
+ }
67598
+ }
67555
67599
  handle(cmd) {
67556
67600
  switch (cmd.type) {
67557
67601
  case "START":
@@ -67581,16 +67625,6 @@ stores.inject(MyMetaStore, storeInstance);
67581
67625
  this.history.update("tallestCellInRow", cmd.sheetId, tallestCells);
67582
67626
  break;
67583
67627
  }
67584
- case "ADD_COLUMNS_ROWS": {
67585
- if (cmd.dimension === "COL") {
67586
- return;
67587
- }
67588
- const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
67589
- const newCells = Array(cmd.quantity).fill(undefined);
67590
- const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
67591
- this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
67592
- break;
67593
- }
67594
67628
  case "RESIZE_COLUMNS_ROWS":
67595
67629
  {
67596
67630
  const sheetId = cmd.sheetId;
@@ -74132,6 +74166,14 @@ stores.inject(MyMetaStore, storeInstance);
74132
74166
  const isBasedBefore = cmd.base < start;
74133
74167
  const deltaCol = isBasedBefore && isCol ? thickness : 0;
74134
74168
  const deltaRow = isBasedBefore && !isCol ? thickness : 0;
74169
+ const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
74170
+ const originalSize = Object.fromEntries(toRemove.map((element) => {
74171
+ const size = isCol
74172
+ ? this.getters.getColSize(cmd.sheetId, element)
74173
+ : this.getters.getUserRowSize(cmd.sheetId, element);
74174
+ const isDefaultCol = isCol && size === DEFAULT_CELL_WIDTH;
74175
+ return [element, isDefaultCol ? undefined : size];
74176
+ }));
74135
74177
  const target = [
74136
74178
  {
74137
74179
  left: isCol ? start + deltaCol : 0,
@@ -74162,13 +74204,12 @@ stores.inject(MyMetaStore, storeInstance);
74162
74204
  const col = selection.left;
74163
74205
  const row = selection.top;
74164
74206
  this.setSelectionMixin({ zone: selection, cell: { col, row } }, [selection]);
74165
- const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
74166
74207
  let currentIndex = isBasedBefore ? cmd.base : cmd.base + 1;
74167
74208
  const resizingGroups = {};
74168
74209
  for (const element of toRemove) {
74169
- const size = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, element);
74210
+ const size = originalSize[element];
74170
74211
  const currentSize = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, currentIndex);
74171
- if (size !== currentSize) {
74212
+ if (size && size !== currentSize) {
74172
74213
  resizingGroups[size] ??= [];
74173
74214
  resizingGroups[size].push(currentIndex);
74174
74215
  currentIndex += 1;
@@ -75594,6 +75635,7 @@ stores.inject(MyMetaStore, storeInstance);
75594
75635
 
75595
75636
  autoCompleteProviders.add("dataValidation", {
75596
75637
  displayAllOnInitialContent: true,
75638
+ canBeToggled: false,
75597
75639
  getProposals(tokenAtCursor, content) {
75598
75640
  if (isFormula(content)) {
75599
75641
  return [];
@@ -77159,14 +77201,12 @@ stores.inject(MyMetaStore, storeInstance);
77159
77201
  this.editionState = "initializing";
77160
77202
  }
77161
77203
  stopEdition() {
77162
- const input = this.sheetNameRef.el;
77163
- if (!this.state.isEditing || !input)
77204
+ if (!this.state.isEditing || !this.sheetNameRef.el)
77164
77205
  return;
77165
77206
  this.state.isEditing = false;
77166
77207
  this.editionState = "initializing";
77167
- input.blur();
77208
+ this.sheetNameRef.el.blur();
77168
77209
  const inputValue = this.getInputContent() || "";
77169
- input.innerText = inputValue;
77170
77210
  interactiveRenameSheet(this.env, this.props.sheetId, inputValue, () => this.startEdition());
77171
77211
  }
77172
77212
  cancelEdition() {
@@ -84605,9 +84645,9 @@ stores.inject(MyMetaStore, storeInstance);
84605
84645
  exports.tokenize = tokenize;
84606
84646
 
84607
84647
 
84608
- __info__.version = "18.4.2";
84609
- __info__.date = "2025-07-11T11:11:12.642Z";
84610
- __info__.hash = "29b6458";
84648
+ __info__.version = "18.4.3";
84649
+ __info__.date = "2025-07-28T13:39:06.036Z";
84650
+ __info__.hash = "4b596d7";
84611
84651
 
84612
84652
 
84613
84653
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);