@odoo/o-spreadsheet 18.0.33 → 18.0.34

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.0.33
6
- * @date 2025-06-12T09:17:53.747Z
7
- * @hash c1d64fb
5
+ * @version 18.0.34
6
+ * @date 2025-06-19T18:26:11.726Z
7
+ * @hash 5526881
8
8
  */
9
9
 
10
10
  'use strict';
@@ -33670,6 +33670,10 @@ const REMOVE_ROWS_ACTION = (env) => {
33670
33670
  });
33671
33671
  };
33672
33672
  const CAN_REMOVE_COLUMNS_ROWS = (dimension, env) => {
33673
+ if ((dimension === "COL" && env.model.getters.getActiveRows().size > 0) ||
33674
+ (dimension === "ROW" && env.model.getters.getActiveCols().size > 0)) {
33675
+ return false;
33676
+ }
33673
33677
  const sheetId = env.model.getters.getActiveSheetId();
33674
33678
  const selectedElements = env.model.getters.getElementsFromSelection(dimension);
33675
33679
  const includesAllVisibleHeaders = env.model.getters.checkElementsIncludeAllVisibleHeaders(sheetId, dimension, selectedElements);
@@ -36390,11 +36394,11 @@ class OTRegistry extends Registry {
36390
36394
  * transformation function given
36391
36395
  */
36392
36396
  addTransformation(executed, toTransforms, fn) {
36393
- for (let toTransform of toTransforms) {
36394
- if (!this.content[toTransform]) {
36395
- this.content[toTransform] = new Map();
36396
- }
36397
- this.content[toTransform].set(executed, fn);
36397
+ if (!this.content[executed]) {
36398
+ this.content[executed] = new Map();
36399
+ }
36400
+ for (const toTransform of toTransforms) {
36401
+ this.content[executed].set(toTransform, fn);
36398
36402
  }
36399
36403
  return this;
36400
36404
  }
@@ -36403,7 +36407,7 @@ class OTRegistry extends Registry {
36403
36407
  * that the executed command happened.
36404
36408
  */
36405
36409
  getTransformation(toTransform, executed) {
36406
- return this.content[toTransform] && this.content[toTransform].get(executed);
36410
+ return this.content[executed] && this.content[executed].get(toTransform);
36407
36411
  }
36408
36412
  }
36409
36413
  const otRegistry = new OTRegistry();
@@ -62202,10 +62206,20 @@ function transform(toTransform, executed) {
62202
62206
  */
62203
62207
  function transformAll(toTransform, executed) {
62204
62208
  let transformedCommands = [...toTransform];
62209
+ const possibleTransformations = new Set(otRegistry.getKeys());
62205
62210
  for (const executedCommand of executed) {
62206
- transformedCommands = transformedCommands
62207
- .map((cmd) => transform(cmd, executedCommand))
62208
- .filter(isDefined);
62211
+ // If the executed command is not in the registry, we skip it
62212
+ // because we know there won't be any transformation impacting the
62213
+ // commands to transform.
62214
+ if (possibleTransformations.has(executedCommand.type)) {
62215
+ transformedCommands = transformedCommands.reduce((acc, cmd) => {
62216
+ const transformed = transform(cmd, executedCommand);
62217
+ if (transformed) {
62218
+ acc.push(transformed);
62219
+ }
62220
+ return acc;
62221
+ }, []);
62222
+ }
62209
62223
  }
62210
62224
  return transformedCommands;
62211
62225
  }
@@ -62691,7 +62705,6 @@ class Session extends EventBus {
62691
62705
  if (this.waitingAck) {
62692
62706
  return;
62693
62707
  }
62694
- this.waitingAck = true;
62695
62708
  this.sendPendingMessage();
62696
62709
  }
62697
62710
  /**
@@ -62721,6 +62734,7 @@ class Session extends EventBus {
62721
62734
  throw new Error(`Trying to send a new revision while replaying initial revision. This can lead to endless dispatches every time the spreadsheet is open.
62722
62735
  ${JSON.stringify(message)}`);
62723
62736
  }
62737
+ this.waitingAck = true;
62724
62738
  this.transportService.sendMessage({
62725
62739
  ...message,
62726
62740
  serverRevisionId: this.serverRevisionId,
@@ -63861,7 +63875,7 @@ class SheetUIPlugin extends UIPlugin {
63861
63875
  }
63862
63876
  const position = this.getters.getCellPosition(cell.id);
63863
63877
  const colSize = this.getters.getColSize(sheetId, position.col);
63864
- if (cell.isFormula) {
63878
+ if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
63865
63879
  const content = this.getters.getEvaluatedCell(position).formattedValue;
63866
63880
  const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
63867
63881
  if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) {
@@ -74447,6 +74461,6 @@ exports.tokenColors = tokenColors;
74447
74461
  exports.tokenize = tokenize;
74448
74462
 
74449
74463
 
74450
- __info__.version = "18.0.33";
74451
- __info__.date = "2025-06-12T09:17:53.747Z";
74452
- __info__.hash = "c1d64fb";
74464
+ __info__.version = "18.0.34";
74465
+ __info__.date = "2025-06-19T18:26:11.726Z";
74466
+ __info__.hash = "5526881";
@@ -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.0.33
6
- * @date 2025-06-12T09:17:53.747Z
7
- * @hash c1d64fb
5
+ * @version 18.0.34
6
+ * @date 2025-06-19T18:26:11.726Z
7
+ * @hash 5526881
8
8
  */
9
9
 
10
10
  import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
@@ -33668,6 +33668,10 @@ const REMOVE_ROWS_ACTION = (env) => {
33668
33668
  });
33669
33669
  };
33670
33670
  const CAN_REMOVE_COLUMNS_ROWS = (dimension, env) => {
33671
+ if ((dimension === "COL" && env.model.getters.getActiveRows().size > 0) ||
33672
+ (dimension === "ROW" && env.model.getters.getActiveCols().size > 0)) {
33673
+ return false;
33674
+ }
33671
33675
  const sheetId = env.model.getters.getActiveSheetId();
33672
33676
  const selectedElements = env.model.getters.getElementsFromSelection(dimension);
33673
33677
  const includesAllVisibleHeaders = env.model.getters.checkElementsIncludeAllVisibleHeaders(sheetId, dimension, selectedElements);
@@ -36388,11 +36392,11 @@ class OTRegistry extends Registry {
36388
36392
  * transformation function given
36389
36393
  */
36390
36394
  addTransformation(executed, toTransforms, fn) {
36391
- for (let toTransform of toTransforms) {
36392
- if (!this.content[toTransform]) {
36393
- this.content[toTransform] = new Map();
36394
- }
36395
- this.content[toTransform].set(executed, fn);
36395
+ if (!this.content[executed]) {
36396
+ this.content[executed] = new Map();
36397
+ }
36398
+ for (const toTransform of toTransforms) {
36399
+ this.content[executed].set(toTransform, fn);
36396
36400
  }
36397
36401
  return this;
36398
36402
  }
@@ -36401,7 +36405,7 @@ class OTRegistry extends Registry {
36401
36405
  * that the executed command happened.
36402
36406
  */
36403
36407
  getTransformation(toTransform, executed) {
36404
- return this.content[toTransform] && this.content[toTransform].get(executed);
36408
+ return this.content[executed] && this.content[executed].get(toTransform);
36405
36409
  }
36406
36410
  }
36407
36411
  const otRegistry = new OTRegistry();
@@ -62200,10 +62204,20 @@ function transform(toTransform, executed) {
62200
62204
  */
62201
62205
  function transformAll(toTransform, executed) {
62202
62206
  let transformedCommands = [...toTransform];
62207
+ const possibleTransformations = new Set(otRegistry.getKeys());
62203
62208
  for (const executedCommand of executed) {
62204
- transformedCommands = transformedCommands
62205
- .map((cmd) => transform(cmd, executedCommand))
62206
- .filter(isDefined);
62209
+ // If the executed command is not in the registry, we skip it
62210
+ // because we know there won't be any transformation impacting the
62211
+ // commands to transform.
62212
+ if (possibleTransformations.has(executedCommand.type)) {
62213
+ transformedCommands = transformedCommands.reduce((acc, cmd) => {
62214
+ const transformed = transform(cmd, executedCommand);
62215
+ if (transformed) {
62216
+ acc.push(transformed);
62217
+ }
62218
+ return acc;
62219
+ }, []);
62220
+ }
62207
62221
  }
62208
62222
  return transformedCommands;
62209
62223
  }
@@ -62689,7 +62703,6 @@ class Session extends EventBus {
62689
62703
  if (this.waitingAck) {
62690
62704
  return;
62691
62705
  }
62692
- this.waitingAck = true;
62693
62706
  this.sendPendingMessage();
62694
62707
  }
62695
62708
  /**
@@ -62719,6 +62732,7 @@ class Session extends EventBus {
62719
62732
  throw new Error(`Trying to send a new revision while replaying initial revision. This can lead to endless dispatches every time the spreadsheet is open.
62720
62733
  ${JSON.stringify(message)}`);
62721
62734
  }
62735
+ this.waitingAck = true;
62722
62736
  this.transportService.sendMessage({
62723
62737
  ...message,
62724
62738
  serverRevisionId: this.serverRevisionId,
@@ -63859,7 +63873,7 @@ class SheetUIPlugin extends UIPlugin {
63859
63873
  }
63860
63874
  const position = this.getters.getCellPosition(cell.id);
63861
63875
  const colSize = this.getters.getColSize(sheetId, position.col);
63862
- if (cell.isFormula) {
63876
+ if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
63863
63877
  const content = this.getters.getEvaluatedCell(position).formattedValue;
63864
63878
  const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
63865
63879
  if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) {
@@ -74402,6 +74416,6 @@ const constants = {
74402
74416
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
74403
74417
 
74404
74418
 
74405
- __info__.version = "18.0.33";
74406
- __info__.date = "2025-06-12T09:17:53.747Z";
74407
- __info__.hash = "c1d64fb";
74419
+ __info__.version = "18.0.34";
74420
+ __info__.date = "2025-06-19T18:26:11.726Z";
74421
+ __info__.hash = "5526881";
@@ -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.0.33
6
- * @date 2025-06-12T09:17:53.747Z
7
- * @hash c1d64fb
5
+ * @version 18.0.34
6
+ * @date 2025-06-19T18:26:11.726Z
7
+ * @hash 5526881
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -33669,6 +33669,10 @@ stores.inject(MyMetaStore, storeInstance);
33669
33669
  });
33670
33670
  };
33671
33671
  const CAN_REMOVE_COLUMNS_ROWS = (dimension, env) => {
33672
+ if ((dimension === "COL" && env.model.getters.getActiveRows().size > 0) ||
33673
+ (dimension === "ROW" && env.model.getters.getActiveCols().size > 0)) {
33674
+ return false;
33675
+ }
33672
33676
  const sheetId = env.model.getters.getActiveSheetId();
33673
33677
  const selectedElements = env.model.getters.getElementsFromSelection(dimension);
33674
33678
  const includesAllVisibleHeaders = env.model.getters.checkElementsIncludeAllVisibleHeaders(sheetId, dimension, selectedElements);
@@ -36389,11 +36393,11 @@ stores.inject(MyMetaStore, storeInstance);
36389
36393
  * transformation function given
36390
36394
  */
36391
36395
  addTransformation(executed, toTransforms, fn) {
36392
- for (let toTransform of toTransforms) {
36393
- if (!this.content[toTransform]) {
36394
- this.content[toTransform] = new Map();
36395
- }
36396
- this.content[toTransform].set(executed, fn);
36396
+ if (!this.content[executed]) {
36397
+ this.content[executed] = new Map();
36398
+ }
36399
+ for (const toTransform of toTransforms) {
36400
+ this.content[executed].set(toTransform, fn);
36397
36401
  }
36398
36402
  return this;
36399
36403
  }
@@ -36402,7 +36406,7 @@ stores.inject(MyMetaStore, storeInstance);
36402
36406
  * that the executed command happened.
36403
36407
  */
36404
36408
  getTransformation(toTransform, executed) {
36405
- return this.content[toTransform] && this.content[toTransform].get(executed);
36409
+ return this.content[executed] && this.content[executed].get(toTransform);
36406
36410
  }
36407
36411
  }
36408
36412
  const otRegistry = new OTRegistry();
@@ -62201,10 +62205,20 @@ stores.inject(MyMetaStore, storeInstance);
62201
62205
  */
62202
62206
  function transformAll(toTransform, executed) {
62203
62207
  let transformedCommands = [...toTransform];
62208
+ const possibleTransformations = new Set(otRegistry.getKeys());
62204
62209
  for (const executedCommand of executed) {
62205
- transformedCommands = transformedCommands
62206
- .map((cmd) => transform(cmd, executedCommand))
62207
- .filter(isDefined);
62210
+ // If the executed command is not in the registry, we skip it
62211
+ // because we know there won't be any transformation impacting the
62212
+ // commands to transform.
62213
+ if (possibleTransformations.has(executedCommand.type)) {
62214
+ transformedCommands = transformedCommands.reduce((acc, cmd) => {
62215
+ const transformed = transform(cmd, executedCommand);
62216
+ if (transformed) {
62217
+ acc.push(transformed);
62218
+ }
62219
+ return acc;
62220
+ }, []);
62221
+ }
62208
62222
  }
62209
62223
  return transformedCommands;
62210
62224
  }
@@ -62690,7 +62704,6 @@ stores.inject(MyMetaStore, storeInstance);
62690
62704
  if (this.waitingAck) {
62691
62705
  return;
62692
62706
  }
62693
- this.waitingAck = true;
62694
62707
  this.sendPendingMessage();
62695
62708
  }
62696
62709
  /**
@@ -62720,6 +62733,7 @@ stores.inject(MyMetaStore, storeInstance);
62720
62733
  throw new Error(`Trying to send a new revision while replaying initial revision. This can lead to endless dispatches every time the spreadsheet is open.
62721
62734
  ${JSON.stringify(message)}`);
62722
62735
  }
62736
+ this.waitingAck = true;
62723
62737
  this.transportService.sendMessage({
62724
62738
  ...message,
62725
62739
  serverRevisionId: this.serverRevisionId,
@@ -63860,7 +63874,7 @@ stores.inject(MyMetaStore, storeInstance);
63860
63874
  }
63861
63875
  const position = this.getters.getCellPosition(cell.id);
63862
63876
  const colSize = this.getters.getColSize(sheetId, position.col);
63863
- if (cell.isFormula) {
63877
+ if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
63864
63878
  const content = this.getters.getEvaluatedCell(position).formattedValue;
63865
63879
  const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
63866
63880
  if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) {
@@ -74446,9 +74460,9 @@ stores.inject(MyMetaStore, storeInstance);
74446
74460
  exports.tokenize = tokenize;
74447
74461
 
74448
74462
 
74449
- __info__.version = "18.0.33";
74450
- __info__.date = "2025-06-12T09:17:53.747Z";
74451
- __info__.hash = "c1d64fb";
74463
+ __info__.version = "18.0.34";
74464
+ __info__.date = "2025-06-19T18:26:11.726Z";
74465
+ __info__.hash = "5526881";
74452
74466
 
74453
74467
 
74454
74468
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);