@odoo/o-spreadsheet 17.0.65 → 17.0.66

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 17.0.65
6
- * @date 2025-06-12T10:43:02.222Z
7
- * @hash 5af6ebd
5
+ * @version 17.0.66
6
+ * @date 2025-06-19T18:23:36.231Z
7
+ * @hash fbd5c00
8
8
  */
9
9
 
10
10
  'use strict';
@@ -10751,6 +10751,10 @@ const REMOVE_ROWS_ACTION = (env) => {
10751
10751
  });
10752
10752
  };
10753
10753
  const CAN_REMOVE_COLUMNS_ROWS = (dimension, env) => {
10754
+ if ((dimension === "COL" && env.model.getters.getActiveRows().size > 0) ||
10755
+ (dimension === "ROW" && env.model.getters.getActiveCols().size > 0)) {
10756
+ return false;
10757
+ }
10754
10758
  const sheetId = env.model.getters.getActiveSheetId();
10755
10759
  const selectedElements = env.model.getters.getElementsFromSelection(dimension);
10756
10760
  const includesAllVisibleHeaders = env.model.getters.checkElementsIncludeAllVisibleHeaders(sheetId, dimension, selectedElements);
@@ -21568,11 +21572,11 @@ class OTRegistry extends Registry {
21568
21572
  * transformation function given
21569
21573
  */
21570
21574
  addTransformation(executed, toTransforms, fn) {
21571
- for (let toTransform of toTransforms) {
21572
- if (!this.content[toTransform]) {
21573
- this.content[toTransform] = new Map();
21574
- }
21575
- this.content[toTransform].set(executed, fn);
21575
+ if (!this.content[executed]) {
21576
+ this.content[executed] = new Map();
21577
+ }
21578
+ for (const toTransform of toTransforms) {
21579
+ this.content[executed].set(toTransform, fn);
21576
21580
  }
21577
21581
  return this;
21578
21582
  }
@@ -21581,7 +21585,7 @@ class OTRegistry extends Registry {
21581
21585
  * that the executed command happened.
21582
21586
  */
21583
21587
  getTransformation(toTransform, executed) {
21584
- return this.content[toTransform] && this.content[toTransform].get(executed);
21588
+ return this.content[executed] && this.content[executed].get(toTransform);
21585
21589
  }
21586
21590
  }
21587
21591
  const otRegistry = new OTRegistry();
@@ -44628,10 +44632,20 @@ function transform(toTransform, executed) {
44628
44632
  */
44629
44633
  function transformAll(toTransform, executed) {
44630
44634
  let transformedCommands = [...toTransform];
44635
+ const possibleTransformations = new Set(otRegistry.getKeys());
44631
44636
  for (const executedCommand of executed) {
44632
- transformedCommands = transformedCommands
44633
- .map((cmd) => transform(cmd, executedCommand))
44634
- .filter(isDefined$1);
44637
+ // If the executed command is not in the registry, we skip it
44638
+ // because we know there won't be any transformation impacting the
44639
+ // commands to transform.
44640
+ if (possibleTransformations.has(executedCommand.type)) {
44641
+ transformedCommands = transformedCommands.reduce((acc, cmd) => {
44642
+ const transformed = transform(cmd, executedCommand);
44643
+ if (transformed) {
44644
+ acc.push(transformed);
44645
+ }
44646
+ return acc;
44647
+ }, []);
44648
+ }
44635
44649
  }
44636
44650
  return transformedCommands;
44637
44651
  }
@@ -45110,7 +45124,6 @@ class Session extends EventBus {
45110
45124
  if (this.waitingAck) {
45111
45125
  return;
45112
45126
  }
45113
- this.waitingAck = true;
45114
45127
  this.sendPendingMessage();
45115
45128
  }
45116
45129
  /**
@@ -45140,6 +45153,7 @@ class Session extends EventBus {
45140
45153
  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.
45141
45154
  ${JSON.stringify(message)}`);
45142
45155
  }
45156
+ this.waitingAck = true;
45143
45157
  this.transportService.sendMessage({
45144
45158
  ...message,
45145
45159
  serverRevisionId: this.serverRevisionId,
@@ -48186,7 +48200,7 @@ class SheetUIPlugin extends UIPlugin {
48186
48200
  }
48187
48201
  const position = this.getters.getCellPosition(cell.id);
48188
48202
  const colSize = this.getters.getColSize(sheetId, position.col);
48189
- if (cell.isFormula) {
48203
+ if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
48190
48204
  const content = this.getters.getEvaluatedCell(position).formattedValue;
48191
48205
  const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
48192
48206
  if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) {
@@ -58336,6 +58350,6 @@ exports.setTranslationMethod = setTranslationMethod;
58336
58350
  exports.tokenize = tokenize;
58337
58351
 
58338
58352
 
58339
- __info__.version = "17.0.65";
58340
- __info__.date = "2025-06-12T10:43:02.222Z";
58341
- __info__.hash = "5af6ebd";
58353
+ __info__.version = "17.0.66";
58354
+ __info__.date = "2025-06-19T18:23:36.231Z";
58355
+ __info__.hash = "fbd5c00";
@@ -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 17.0.65
6
- * @date 2025-06-12T10:43:02.222Z
7
- * @hash 5af6ebd
5
+ * @version 17.0.66
6
+ * @date 2025-06-19T18:23:36.231Z
7
+ * @hash fbd5c00
8
8
  */
9
9
 
10
10
  import { Component, useRef, onMounted, useEffect, onWillPatch, useState, onWillUpdateProps, onPatched, useComponent, useExternalListener, onWillUnmount, onWillStart, xml, useChildSubEnv, useSubEnv, markRaw } from '@odoo/owl';
@@ -10749,6 +10749,10 @@ const REMOVE_ROWS_ACTION = (env) => {
10749
10749
  });
10750
10750
  };
10751
10751
  const CAN_REMOVE_COLUMNS_ROWS = (dimension, env) => {
10752
+ if ((dimension === "COL" && env.model.getters.getActiveRows().size > 0) ||
10753
+ (dimension === "ROW" && env.model.getters.getActiveCols().size > 0)) {
10754
+ return false;
10755
+ }
10752
10756
  const sheetId = env.model.getters.getActiveSheetId();
10753
10757
  const selectedElements = env.model.getters.getElementsFromSelection(dimension);
10754
10758
  const includesAllVisibleHeaders = env.model.getters.checkElementsIncludeAllVisibleHeaders(sheetId, dimension, selectedElements);
@@ -21566,11 +21570,11 @@ class OTRegistry extends Registry {
21566
21570
  * transformation function given
21567
21571
  */
21568
21572
  addTransformation(executed, toTransforms, fn) {
21569
- for (let toTransform of toTransforms) {
21570
- if (!this.content[toTransform]) {
21571
- this.content[toTransform] = new Map();
21572
- }
21573
- this.content[toTransform].set(executed, fn);
21573
+ if (!this.content[executed]) {
21574
+ this.content[executed] = new Map();
21575
+ }
21576
+ for (const toTransform of toTransforms) {
21577
+ this.content[executed].set(toTransform, fn);
21574
21578
  }
21575
21579
  return this;
21576
21580
  }
@@ -21579,7 +21583,7 @@ class OTRegistry extends Registry {
21579
21583
  * that the executed command happened.
21580
21584
  */
21581
21585
  getTransformation(toTransform, executed) {
21582
- return this.content[toTransform] && this.content[toTransform].get(executed);
21586
+ return this.content[executed] && this.content[executed].get(toTransform);
21583
21587
  }
21584
21588
  }
21585
21589
  const otRegistry = new OTRegistry();
@@ -44626,10 +44630,20 @@ function transform(toTransform, executed) {
44626
44630
  */
44627
44631
  function transformAll(toTransform, executed) {
44628
44632
  let transformedCommands = [...toTransform];
44633
+ const possibleTransformations = new Set(otRegistry.getKeys());
44629
44634
  for (const executedCommand of executed) {
44630
- transformedCommands = transformedCommands
44631
- .map((cmd) => transform(cmd, executedCommand))
44632
- .filter(isDefined$1);
44635
+ // If the executed command is not in the registry, we skip it
44636
+ // because we know there won't be any transformation impacting the
44637
+ // commands to transform.
44638
+ if (possibleTransformations.has(executedCommand.type)) {
44639
+ transformedCommands = transformedCommands.reduce((acc, cmd) => {
44640
+ const transformed = transform(cmd, executedCommand);
44641
+ if (transformed) {
44642
+ acc.push(transformed);
44643
+ }
44644
+ return acc;
44645
+ }, []);
44646
+ }
44633
44647
  }
44634
44648
  return transformedCommands;
44635
44649
  }
@@ -45108,7 +45122,6 @@ class Session extends EventBus {
45108
45122
  if (this.waitingAck) {
45109
45123
  return;
45110
45124
  }
45111
- this.waitingAck = true;
45112
45125
  this.sendPendingMessage();
45113
45126
  }
45114
45127
  /**
@@ -45138,6 +45151,7 @@ class Session extends EventBus {
45138
45151
  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.
45139
45152
  ${JSON.stringify(message)}`);
45140
45153
  }
45154
+ this.waitingAck = true;
45141
45155
  this.transportService.sendMessage({
45142
45156
  ...message,
45143
45157
  serverRevisionId: this.serverRevisionId,
@@ -48184,7 +48198,7 @@ class SheetUIPlugin extends UIPlugin {
48184
48198
  }
48185
48199
  const position = this.getters.getCellPosition(cell.id);
48186
48200
  const colSize = this.getters.getColSize(sheetId, position.col);
48187
- if (cell.isFormula) {
48201
+ if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
48188
48202
  const content = this.getters.getEvaluatedCell(position).formattedValue;
48189
48203
  const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
48190
48204
  if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) {
@@ -58299,6 +58313,6 @@ const constants = {
58299
58313
  export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
58300
58314
 
58301
58315
 
58302
- __info__.version = "17.0.65";
58303
- __info__.date = "2025-06-12T10:43:02.222Z";
58304
- __info__.hash = "5af6ebd";
58316
+ __info__.version = "17.0.66";
58317
+ __info__.date = "2025-06-19T18:23:36.231Z";
58318
+ __info__.hash = "fbd5c00";
@@ -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 17.0.65
6
- * @date 2025-06-12T10:43:02.222Z
7
- * @hash 5af6ebd
5
+ * @version 17.0.66
6
+ * @date 2025-06-19T18:23:36.231Z
7
+ * @hash fbd5c00
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -10750,6 +10750,10 @@
10750
10750
  });
10751
10751
  };
10752
10752
  const CAN_REMOVE_COLUMNS_ROWS = (dimension, env) => {
10753
+ if ((dimension === "COL" && env.model.getters.getActiveRows().size > 0) ||
10754
+ (dimension === "ROW" && env.model.getters.getActiveCols().size > 0)) {
10755
+ return false;
10756
+ }
10753
10757
  const sheetId = env.model.getters.getActiveSheetId();
10754
10758
  const selectedElements = env.model.getters.getElementsFromSelection(dimension);
10755
10759
  const includesAllVisibleHeaders = env.model.getters.checkElementsIncludeAllVisibleHeaders(sheetId, dimension, selectedElements);
@@ -21567,11 +21571,11 @@
21567
21571
  * transformation function given
21568
21572
  */
21569
21573
  addTransformation(executed, toTransforms, fn) {
21570
- for (let toTransform of toTransforms) {
21571
- if (!this.content[toTransform]) {
21572
- this.content[toTransform] = new Map();
21573
- }
21574
- this.content[toTransform].set(executed, fn);
21574
+ if (!this.content[executed]) {
21575
+ this.content[executed] = new Map();
21576
+ }
21577
+ for (const toTransform of toTransforms) {
21578
+ this.content[executed].set(toTransform, fn);
21575
21579
  }
21576
21580
  return this;
21577
21581
  }
@@ -21580,7 +21584,7 @@
21580
21584
  * that the executed command happened.
21581
21585
  */
21582
21586
  getTransformation(toTransform, executed) {
21583
- return this.content[toTransform] && this.content[toTransform].get(executed);
21587
+ return this.content[executed] && this.content[executed].get(toTransform);
21584
21588
  }
21585
21589
  }
21586
21590
  const otRegistry = new OTRegistry();
@@ -44627,10 +44631,20 @@
44627
44631
  */
44628
44632
  function transformAll(toTransform, executed) {
44629
44633
  let transformedCommands = [...toTransform];
44634
+ const possibleTransformations = new Set(otRegistry.getKeys());
44630
44635
  for (const executedCommand of executed) {
44631
- transformedCommands = transformedCommands
44632
- .map((cmd) => transform(cmd, executedCommand))
44633
- .filter(isDefined$1);
44636
+ // If the executed command is not in the registry, we skip it
44637
+ // because we know there won't be any transformation impacting the
44638
+ // commands to transform.
44639
+ if (possibleTransformations.has(executedCommand.type)) {
44640
+ transformedCommands = transformedCommands.reduce((acc, cmd) => {
44641
+ const transformed = transform(cmd, executedCommand);
44642
+ if (transformed) {
44643
+ acc.push(transformed);
44644
+ }
44645
+ return acc;
44646
+ }, []);
44647
+ }
44634
44648
  }
44635
44649
  return transformedCommands;
44636
44650
  }
@@ -45109,7 +45123,6 @@
45109
45123
  if (this.waitingAck) {
45110
45124
  return;
45111
45125
  }
45112
- this.waitingAck = true;
45113
45126
  this.sendPendingMessage();
45114
45127
  }
45115
45128
  /**
@@ -45139,6 +45152,7 @@
45139
45152
  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.
45140
45153
  ${JSON.stringify(message)}`);
45141
45154
  }
45155
+ this.waitingAck = true;
45142
45156
  this.transportService.sendMessage({
45143
45157
  ...message,
45144
45158
  serverRevisionId: this.serverRevisionId,
@@ -48185,7 +48199,7 @@
48185
48199
  }
48186
48200
  const position = this.getters.getCellPosition(cell.id);
48187
48201
  const colSize = this.getters.getColSize(sheetId, position.col);
48188
- if (cell.isFormula) {
48202
+ if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
48189
48203
  const content = this.getters.getEvaluatedCell(position).formattedValue;
48190
48204
  const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
48191
48205
  if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) {
@@ -58335,9 +58349,9 @@
58335
58349
  exports.tokenize = tokenize;
58336
58350
 
58337
58351
 
58338
- __info__.version = "17.0.65";
58339
- __info__.date = "2025-06-12T10:43:02.222Z";
58340
- __info__.hash = "5af6ebd";
58352
+ __info__.version = "17.0.66";
58353
+ __info__.date = "2025-06-19T18:23:36.231Z";
58354
+ __info__.hash = "fbd5c00";
58341
58355
 
58342
58356
 
58343
58357
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);