@odoo/o-spreadsheet 17.0.65 → 17.0.67

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.67
6
+ * @date 2025-06-23T15:02:54.391Z
7
+ * @hash cb0b6a9
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();
@@ -37650,7 +37654,7 @@ class DataValidationPlugin extends CorePlugin {
37650
37654
  else if (newRule.criterion.type === "isValueInList") {
37651
37655
  newRule.criterion.values = Array.from(new Set(newRule.criterion.values));
37652
37656
  }
37653
- const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules);
37657
+ const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules, newRule.id);
37654
37658
  const ruleIndex = adaptedRules.findIndex((rule) => rule.id === newRule.id);
37655
37659
  if (ruleIndex !== -1) {
37656
37660
  adaptedRules[ruleIndex] = newRule;
@@ -37660,10 +37664,13 @@ class DataValidationPlugin extends CorePlugin {
37660
37664
  this.history.update("rules", sheetId, [...adaptedRules, newRule]);
37661
37665
  }
37662
37666
  }
37663
- removeRangesFromRules(sheetId, ranges, rules) {
37667
+ removeRangesFromRules(sheetId, ranges, rules, editingRuleId) {
37664
37668
  rules = deepCopy(rules);
37665
37669
  const rangesXcs = ranges.map((range) => this.getters.getRangeString(range, sheetId));
37666
37670
  for (const rule of rules) {
37671
+ if (rule.id === editingRuleId) {
37672
+ continue; // Skip the rule being edited to preserve its place in the list
37673
+ }
37667
37674
  const ruleRanges = rule.ranges.map((range) => this.getters.getRangeString(range, sheetId));
37668
37675
  rule.ranges = recomputeZones(ruleRanges, rangesXcs).map((xc) => this.getters.getRangeFromSheetXC(sheetId, xc));
37669
37676
  }
@@ -44628,10 +44635,20 @@ function transform(toTransform, executed) {
44628
44635
  */
44629
44636
  function transformAll(toTransform, executed) {
44630
44637
  let transformedCommands = [...toTransform];
44638
+ const possibleTransformations = new Set(otRegistry.getKeys());
44631
44639
  for (const executedCommand of executed) {
44632
- transformedCommands = transformedCommands
44633
- .map((cmd) => transform(cmd, executedCommand))
44634
- .filter(isDefined$1);
44640
+ // If the executed command is not in the registry, we skip it
44641
+ // because we know there won't be any transformation impacting the
44642
+ // commands to transform.
44643
+ if (possibleTransformations.has(executedCommand.type)) {
44644
+ transformedCommands = transformedCommands.reduce((acc, cmd) => {
44645
+ const transformed = transform(cmd, executedCommand);
44646
+ if (transformed) {
44647
+ acc.push(transformed);
44648
+ }
44649
+ return acc;
44650
+ }, []);
44651
+ }
44635
44652
  }
44636
44653
  return transformedCommands;
44637
44654
  }
@@ -45110,7 +45127,6 @@ class Session extends EventBus {
45110
45127
  if (this.waitingAck) {
45111
45128
  return;
45112
45129
  }
45113
- this.waitingAck = true;
45114
45130
  this.sendPendingMessage();
45115
45131
  }
45116
45132
  /**
@@ -45140,6 +45156,7 @@ class Session extends EventBus {
45140
45156
  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
45157
  ${JSON.stringify(message)}`);
45142
45158
  }
45159
+ this.waitingAck = true;
45143
45160
  this.transportService.sendMessage({
45144
45161
  ...message,
45145
45162
  serverRevisionId: this.serverRevisionId,
@@ -48186,7 +48203,7 @@ class SheetUIPlugin extends UIPlugin {
48186
48203
  }
48187
48204
  const position = this.getters.getCellPosition(cell.id);
48188
48205
  const colSize = this.getters.getColSize(sheetId, position.col);
48189
- if (cell.isFormula) {
48206
+ if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
48190
48207
  const content = this.getters.getEvaluatedCell(position).formattedValue;
48191
48208
  const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
48192
48209
  if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) {
@@ -58336,6 +58353,6 @@ exports.setTranslationMethod = setTranslationMethod;
58336
58353
  exports.tokenize = tokenize;
58337
58354
 
58338
58355
 
58339
- __info__.version = "17.0.65";
58340
- __info__.date = "2025-06-12T10:43:02.222Z";
58341
- __info__.hash = "5af6ebd";
58356
+ __info__.version = "17.0.67";
58357
+ __info__.date = "2025-06-23T15:02:54.391Z";
58358
+ __info__.hash = "cb0b6a9";
@@ -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.67
6
+ * @date 2025-06-23T15:02:54.391Z
7
+ * @hash cb0b6a9
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();
@@ -37648,7 +37652,7 @@ class DataValidationPlugin extends CorePlugin {
37648
37652
  else if (newRule.criterion.type === "isValueInList") {
37649
37653
  newRule.criterion.values = Array.from(new Set(newRule.criterion.values));
37650
37654
  }
37651
- const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules);
37655
+ const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules, newRule.id);
37652
37656
  const ruleIndex = adaptedRules.findIndex((rule) => rule.id === newRule.id);
37653
37657
  if (ruleIndex !== -1) {
37654
37658
  adaptedRules[ruleIndex] = newRule;
@@ -37658,10 +37662,13 @@ class DataValidationPlugin extends CorePlugin {
37658
37662
  this.history.update("rules", sheetId, [...adaptedRules, newRule]);
37659
37663
  }
37660
37664
  }
37661
- removeRangesFromRules(sheetId, ranges, rules) {
37665
+ removeRangesFromRules(sheetId, ranges, rules, editingRuleId) {
37662
37666
  rules = deepCopy(rules);
37663
37667
  const rangesXcs = ranges.map((range) => this.getters.getRangeString(range, sheetId));
37664
37668
  for (const rule of rules) {
37669
+ if (rule.id === editingRuleId) {
37670
+ continue; // Skip the rule being edited to preserve its place in the list
37671
+ }
37665
37672
  const ruleRanges = rule.ranges.map((range) => this.getters.getRangeString(range, sheetId));
37666
37673
  rule.ranges = recomputeZones(ruleRanges, rangesXcs).map((xc) => this.getters.getRangeFromSheetXC(sheetId, xc));
37667
37674
  }
@@ -44626,10 +44633,20 @@ function transform(toTransform, executed) {
44626
44633
  */
44627
44634
  function transformAll(toTransform, executed) {
44628
44635
  let transformedCommands = [...toTransform];
44636
+ const possibleTransformations = new Set(otRegistry.getKeys());
44629
44637
  for (const executedCommand of executed) {
44630
- transformedCommands = transformedCommands
44631
- .map((cmd) => transform(cmd, executedCommand))
44632
- .filter(isDefined$1);
44638
+ // If the executed command is not in the registry, we skip it
44639
+ // because we know there won't be any transformation impacting the
44640
+ // commands to transform.
44641
+ if (possibleTransformations.has(executedCommand.type)) {
44642
+ transformedCommands = transformedCommands.reduce((acc, cmd) => {
44643
+ const transformed = transform(cmd, executedCommand);
44644
+ if (transformed) {
44645
+ acc.push(transformed);
44646
+ }
44647
+ return acc;
44648
+ }, []);
44649
+ }
44633
44650
  }
44634
44651
  return transformedCommands;
44635
44652
  }
@@ -45108,7 +45125,6 @@ class Session extends EventBus {
45108
45125
  if (this.waitingAck) {
45109
45126
  return;
45110
45127
  }
45111
- this.waitingAck = true;
45112
45128
  this.sendPendingMessage();
45113
45129
  }
45114
45130
  /**
@@ -45138,6 +45154,7 @@ class Session extends EventBus {
45138
45154
  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
45155
  ${JSON.stringify(message)}`);
45140
45156
  }
45157
+ this.waitingAck = true;
45141
45158
  this.transportService.sendMessage({
45142
45159
  ...message,
45143
45160
  serverRevisionId: this.serverRevisionId,
@@ -48184,7 +48201,7 @@ class SheetUIPlugin extends UIPlugin {
48184
48201
  }
48185
48202
  const position = this.getters.getCellPosition(cell.id);
48186
48203
  const colSize = this.getters.getColSize(sheetId, position.col);
48187
- if (cell.isFormula) {
48204
+ if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
48188
48205
  const content = this.getters.getEvaluatedCell(position).formattedValue;
48189
48206
  const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
48190
48207
  if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) {
@@ -58299,6 +58316,6 @@ const constants = {
58299
58316
  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
58317
 
58301
58318
 
58302
- __info__.version = "17.0.65";
58303
- __info__.date = "2025-06-12T10:43:02.222Z";
58304
- __info__.hash = "5af6ebd";
58319
+ __info__.version = "17.0.67";
58320
+ __info__.date = "2025-06-23T15:02:54.391Z";
58321
+ __info__.hash = "cb0b6a9";
@@ -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.67
6
+ * @date 2025-06-23T15:02:54.391Z
7
+ * @hash cb0b6a9
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();
@@ -37649,7 +37653,7 @@
37649
37653
  else if (newRule.criterion.type === "isValueInList") {
37650
37654
  newRule.criterion.values = Array.from(new Set(newRule.criterion.values));
37651
37655
  }
37652
- const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules);
37656
+ const adaptedRules = this.removeRangesFromRules(sheetId, newRule.ranges, rules, newRule.id);
37653
37657
  const ruleIndex = adaptedRules.findIndex((rule) => rule.id === newRule.id);
37654
37658
  if (ruleIndex !== -1) {
37655
37659
  adaptedRules[ruleIndex] = newRule;
@@ -37659,10 +37663,13 @@
37659
37663
  this.history.update("rules", sheetId, [...adaptedRules, newRule]);
37660
37664
  }
37661
37665
  }
37662
- removeRangesFromRules(sheetId, ranges, rules) {
37666
+ removeRangesFromRules(sheetId, ranges, rules, editingRuleId) {
37663
37667
  rules = deepCopy(rules);
37664
37668
  const rangesXcs = ranges.map((range) => this.getters.getRangeString(range, sheetId));
37665
37669
  for (const rule of rules) {
37670
+ if (rule.id === editingRuleId) {
37671
+ continue; // Skip the rule being edited to preserve its place in the list
37672
+ }
37666
37673
  const ruleRanges = rule.ranges.map((range) => this.getters.getRangeString(range, sheetId));
37667
37674
  rule.ranges = recomputeZones(ruleRanges, rangesXcs).map((xc) => this.getters.getRangeFromSheetXC(sheetId, xc));
37668
37675
  }
@@ -44627,10 +44634,20 @@
44627
44634
  */
44628
44635
  function transformAll(toTransform, executed) {
44629
44636
  let transformedCommands = [...toTransform];
44637
+ const possibleTransformations = new Set(otRegistry.getKeys());
44630
44638
  for (const executedCommand of executed) {
44631
- transformedCommands = transformedCommands
44632
- .map((cmd) => transform(cmd, executedCommand))
44633
- .filter(isDefined$1);
44639
+ // If the executed command is not in the registry, we skip it
44640
+ // because we know there won't be any transformation impacting the
44641
+ // commands to transform.
44642
+ if (possibleTransformations.has(executedCommand.type)) {
44643
+ transformedCommands = transformedCommands.reduce((acc, cmd) => {
44644
+ const transformed = transform(cmd, executedCommand);
44645
+ if (transformed) {
44646
+ acc.push(transformed);
44647
+ }
44648
+ return acc;
44649
+ }, []);
44650
+ }
44634
44651
  }
44635
44652
  return transformedCommands;
44636
44653
  }
@@ -45109,7 +45126,6 @@
45109
45126
  if (this.waitingAck) {
45110
45127
  return;
45111
45128
  }
45112
- this.waitingAck = true;
45113
45129
  this.sendPendingMessage();
45114
45130
  }
45115
45131
  /**
@@ -45139,6 +45155,7 @@
45139
45155
  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
45156
  ${JSON.stringify(message)}`);
45141
45157
  }
45158
+ this.waitingAck = true;
45142
45159
  this.transportService.sendMessage({
45143
45160
  ...message,
45144
45161
  serverRevisionId: this.serverRevisionId,
@@ -48185,7 +48202,7 @@
48185
48202
  }
48186
48203
  const position = this.getters.getCellPosition(cell.id);
48187
48204
  const colSize = this.getters.getColSize(sheetId, position.col);
48188
- if (cell.isFormula) {
48205
+ if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
48189
48206
  const content = this.getters.getEvaluatedCell(position).formattedValue;
48190
48207
  const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
48191
48208
  if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) {
@@ -58335,9 +58352,9 @@
58335
58352
  exports.tokenize = tokenize;
58336
58353
 
58337
58354
 
58338
- __info__.version = "17.0.65";
58339
- __info__.date = "2025-06-12T10:43:02.222Z";
58340
- __info__.hash = "5af6ebd";
58355
+ __info__.version = "17.0.67";
58356
+ __info__.date = "2025-06-23T15:02:54.391Z";
58357
+ __info__.hash = "cb0b6a9";
58341
58358
 
58342
58359
 
58343
58360
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);