@odoo/o-spreadsheet 17.2.6 → 17.2.7

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.
@@ -3,9 +3,9 @@
3
3
  /**
4
4
  * This file is generated by o-spreadsheet build tools. Do not edit it.
5
5
  * @see https://github.com/odoo/o-spreadsheet
6
- * @version 17.2.6
7
- * @date 2024-05-07T10:41:20.332Z
8
- * @hash a4f800c
6
+ * @version 17.2.7
7
+ * @date 2024-05-15T09:20:44.429Z
8
+ * @hash 57e89fa
9
9
  */
10
10
 
11
11
  'use strict';
@@ -5203,7 +5203,7 @@ function tokenizeString(chars) {
5203
5203
  }
5204
5204
  return null;
5205
5205
  }
5206
- const separatorRegexp = /^[\w\.!\$]+/;
5206
+ const SYMBOL_CHARS = new Set("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.!$");
5207
5207
  /**
5208
5208
  * A "Symbol" is just basically any word-like element that can appear in a
5209
5209
  * formula, which is not a string. So:
@@ -5243,11 +5243,8 @@ function tokenizeSymbol(chars) {
5243
5243
  };
5244
5244
  }
5245
5245
  }
5246
- const match = chars.remaining().match(separatorRegexp);
5247
- if (match) {
5248
- const value = match[0];
5249
- result += value;
5250
- chars.advanceBy(value.length);
5246
+ while (chars.current && SYMBOL_CHARS.has(chars.current)) {
5247
+ result += chars.shift();
5251
5248
  }
5252
5249
  if (result.length) {
5253
5250
  const value = result;
@@ -6799,7 +6796,7 @@ const machine = {
6799
6796
  function matchReference(tokens) {
6800
6797
  let head = 0;
6801
6798
  let transitions = machine[State.LeftRef];
6802
- const matchedTokens = [];
6799
+ let matchedTokens = "";
6803
6800
  while (transitions !== undefined) {
6804
6801
  const token = tokens[head++];
6805
6802
  if (!token) {
@@ -6811,15 +6808,15 @@ function matchReference(tokens) {
6811
6808
  case undefined:
6812
6809
  return null;
6813
6810
  case State.Found:
6814
- matchedTokens.push(token);
6811
+ matchedTokens += token.value;
6815
6812
  tokens.splice(0, head);
6816
6813
  return {
6817
6814
  type: "REFERENCE",
6818
- value: concat(matchedTokens.map((token) => token.value)),
6815
+ value: matchedTokens,
6819
6816
  };
6820
6817
  default:
6821
6818
  transitions = machine[nextState];
6822
- matchedTokens.push(token);
6819
+ matchedTokens += token.value;
6823
6820
  break;
6824
6821
  }
6825
6822
  }
@@ -47437,9 +47434,10 @@ class Evaluator {
47437
47434
  }
47438
47435
  if (!content) {
47439
47436
  // The previous content could have blocked some array formulas
47440
- impactedPositions.addMany(this.getArrayFormulasBlockedBy(position));
47437
+ impactedPositions.add(position);
47441
47438
  }
47442
47439
  }
47440
+ impactedPositions.addMany(this.getArrayFormulasBlockedBy(impactedPositions));
47443
47441
  return impactedPositions;
47444
47442
  }
47445
47443
  buildDependencyGraph() {
@@ -47481,23 +47479,25 @@ class Evaluator {
47481
47479
  return positions;
47482
47480
  }
47483
47481
  /**
47484
- * Return the position of formulas blocked by the given position
47482
+ * Return the position of formulas blocked by the given positions
47485
47483
  * as well as all their dependencies.
47486
47484
  */
47487
- getArrayFormulasBlockedBy(position) {
47488
- if (!this.spreadingRelations.hasArrayFormulaResult(position)) {
47489
- return [];
47490
- }
47491
- const arrayFormulas = this.spreadingRelations.getFormulaPositionsSpreadingOn(position);
47492
- const positions = this.createEmptyPositionSet();
47493
- positions.addMany(arrayFormulas);
47494
- const arrayFormulaPosition = this.getArrayFormulaSpreadingOn(position);
47495
- if (arrayFormulaPosition) {
47496
- // ignore the formula spreading on the position. Keep only the blocked ones
47497
- positions.delete(arrayFormulaPosition);
47485
+ getArrayFormulasBlockedBy(positions) {
47486
+ const arrayFormulaPositions = this.createEmptyPositionSet();
47487
+ for (const position of positions) {
47488
+ if (!this.spreadingRelations.hasArrayFormulaResult(position)) {
47489
+ continue;
47490
+ }
47491
+ const arrayFormulas = this.spreadingRelations.getFormulaPositionsSpreadingOn(position);
47492
+ arrayFormulaPositions.addMany(arrayFormulas);
47493
+ const arrayFormulaPosition = this.getArrayFormulaSpreadingOn(position);
47494
+ if (arrayFormulaPosition) {
47495
+ // ignore the formula spreading on the position. Keep only the blocked ones
47496
+ arrayFormulaPositions.delete(arrayFormulaPosition);
47497
+ }
47498
47498
  }
47499
- positions.addMany(this.getCellsDependingOn(positions));
47500
- return positions;
47499
+ arrayFormulaPositions.addMany(this.getCellsDependingOn(arrayFormulaPositions));
47500
+ return arrayFormulaPositions;
47501
47501
  }
47502
47502
  nextPositionsToUpdate = new PositionSet({});
47503
47503
  cellsBeingComputed = new Set();
@@ -47627,6 +47627,7 @@ class Evaluator {
47627
47627
  if (!this.spreadingRelations.isArrayFormula(position)) {
47628
47628
  return;
47629
47629
  }
47630
+ const invalidated = this.createEmptyPositionSet();
47630
47631
  for (const child of this.spreadingRelations.getArrayResultPositions(position)) {
47631
47632
  const content = this.getters.getCell(child)?.content;
47632
47633
  if (content) {
@@ -47634,10 +47635,11 @@ class Evaluator {
47634
47635
  // there's still a collision
47635
47636
  continue;
47636
47637
  }
47638
+ invalidated.add(child);
47637
47639
  this.evaluatedCells.delete(child);
47638
- this.nextPositionsToUpdate.addMany(this.getCellsDependingOn([child]));
47639
- this.nextPositionsToUpdate.addMany(this.getArrayFormulasBlockedBy(child));
47640
47640
  }
47641
+ this.nextPositionsToUpdate.addMany(this.getCellsDependingOn(invalidated));
47642
+ this.nextPositionsToUpdate.addMany(this.getArrayFormulasBlockedBy(invalidated));
47641
47643
  this.spreadingRelations.removeNode(position);
47642
47644
  }
47643
47645
  // ----------------------------------------------------------
@@ -60615,6 +60617,6 @@ exports.tokenColors = tokenColors;
60615
60617
  exports.tokenize = tokenize;
60616
60618
 
60617
60619
 
60618
- __info__.version = "17.2.6";
60619
- __info__.date = "2024-05-07T10:41:20.332Z";
60620
- __info__.hash = "a4f800c";
60620
+ __info__.version = "17.2.7";
60621
+ __info__.date = "2024-05-15T09:20:44.429Z";
60622
+ __info__.hash = "57e89fa";
@@ -3,9 +3,9 @@
3
3
  /**
4
4
  * This file is generated by o-spreadsheet build tools. Do not edit it.
5
5
  * @see https://github.com/odoo/o-spreadsheet
6
- * @version 17.2.6
7
- * @date 2024-05-07T10:41:20.332Z
8
- * @hash a4f800c
6
+ * @version 17.2.7
7
+ * @date 2024-05-15T09:20:44.429Z
8
+ * @hash 57e89fa
9
9
  */
10
10
 
11
11
  import { reactive, useEnv, useSubEnv, useState, onWillUnmount, markRaw, toRaw, Component, useRef, onMounted, useEffect, onPatched, useComponent, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv } from '@odoo/owl';
@@ -5201,7 +5201,7 @@ function tokenizeString(chars) {
5201
5201
  }
5202
5202
  return null;
5203
5203
  }
5204
- const separatorRegexp = /^[\w\.!\$]+/;
5204
+ const SYMBOL_CHARS = new Set("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.!$");
5205
5205
  /**
5206
5206
  * A "Symbol" is just basically any word-like element that can appear in a
5207
5207
  * formula, which is not a string. So:
@@ -5241,11 +5241,8 @@ function tokenizeSymbol(chars) {
5241
5241
  };
5242
5242
  }
5243
5243
  }
5244
- const match = chars.remaining().match(separatorRegexp);
5245
- if (match) {
5246
- const value = match[0];
5247
- result += value;
5248
- chars.advanceBy(value.length);
5244
+ while (chars.current && SYMBOL_CHARS.has(chars.current)) {
5245
+ result += chars.shift();
5249
5246
  }
5250
5247
  if (result.length) {
5251
5248
  const value = result;
@@ -6797,7 +6794,7 @@ const machine = {
6797
6794
  function matchReference(tokens) {
6798
6795
  let head = 0;
6799
6796
  let transitions = machine[State.LeftRef];
6800
- const matchedTokens = [];
6797
+ let matchedTokens = "";
6801
6798
  while (transitions !== undefined) {
6802
6799
  const token = tokens[head++];
6803
6800
  if (!token) {
@@ -6809,15 +6806,15 @@ function matchReference(tokens) {
6809
6806
  case undefined:
6810
6807
  return null;
6811
6808
  case State.Found:
6812
- matchedTokens.push(token);
6809
+ matchedTokens += token.value;
6813
6810
  tokens.splice(0, head);
6814
6811
  return {
6815
6812
  type: "REFERENCE",
6816
- value: concat(matchedTokens.map((token) => token.value)),
6813
+ value: matchedTokens,
6817
6814
  };
6818
6815
  default:
6819
6816
  transitions = machine[nextState];
6820
- matchedTokens.push(token);
6817
+ matchedTokens += token.value;
6821
6818
  break;
6822
6819
  }
6823
6820
  }
@@ -47435,9 +47432,10 @@ class Evaluator {
47435
47432
  }
47436
47433
  if (!content) {
47437
47434
  // The previous content could have blocked some array formulas
47438
- impactedPositions.addMany(this.getArrayFormulasBlockedBy(position));
47435
+ impactedPositions.add(position);
47439
47436
  }
47440
47437
  }
47438
+ impactedPositions.addMany(this.getArrayFormulasBlockedBy(impactedPositions));
47441
47439
  return impactedPositions;
47442
47440
  }
47443
47441
  buildDependencyGraph() {
@@ -47479,23 +47477,25 @@ class Evaluator {
47479
47477
  return positions;
47480
47478
  }
47481
47479
  /**
47482
- * Return the position of formulas blocked by the given position
47480
+ * Return the position of formulas blocked by the given positions
47483
47481
  * as well as all their dependencies.
47484
47482
  */
47485
- getArrayFormulasBlockedBy(position) {
47486
- if (!this.spreadingRelations.hasArrayFormulaResult(position)) {
47487
- return [];
47488
- }
47489
- const arrayFormulas = this.spreadingRelations.getFormulaPositionsSpreadingOn(position);
47490
- const positions = this.createEmptyPositionSet();
47491
- positions.addMany(arrayFormulas);
47492
- const arrayFormulaPosition = this.getArrayFormulaSpreadingOn(position);
47493
- if (arrayFormulaPosition) {
47494
- // ignore the formula spreading on the position. Keep only the blocked ones
47495
- positions.delete(arrayFormulaPosition);
47483
+ getArrayFormulasBlockedBy(positions) {
47484
+ const arrayFormulaPositions = this.createEmptyPositionSet();
47485
+ for (const position of positions) {
47486
+ if (!this.spreadingRelations.hasArrayFormulaResult(position)) {
47487
+ continue;
47488
+ }
47489
+ const arrayFormulas = this.spreadingRelations.getFormulaPositionsSpreadingOn(position);
47490
+ arrayFormulaPositions.addMany(arrayFormulas);
47491
+ const arrayFormulaPosition = this.getArrayFormulaSpreadingOn(position);
47492
+ if (arrayFormulaPosition) {
47493
+ // ignore the formula spreading on the position. Keep only the blocked ones
47494
+ arrayFormulaPositions.delete(arrayFormulaPosition);
47495
+ }
47496
47496
  }
47497
- positions.addMany(this.getCellsDependingOn(positions));
47498
- return positions;
47497
+ arrayFormulaPositions.addMany(this.getCellsDependingOn(arrayFormulaPositions));
47498
+ return arrayFormulaPositions;
47499
47499
  }
47500
47500
  nextPositionsToUpdate = new PositionSet({});
47501
47501
  cellsBeingComputed = new Set();
@@ -47625,6 +47625,7 @@ class Evaluator {
47625
47625
  if (!this.spreadingRelations.isArrayFormula(position)) {
47626
47626
  return;
47627
47627
  }
47628
+ const invalidated = this.createEmptyPositionSet();
47628
47629
  for (const child of this.spreadingRelations.getArrayResultPositions(position)) {
47629
47630
  const content = this.getters.getCell(child)?.content;
47630
47631
  if (content) {
@@ -47632,10 +47633,11 @@ class Evaluator {
47632
47633
  // there's still a collision
47633
47634
  continue;
47634
47635
  }
47636
+ invalidated.add(child);
47635
47637
  this.evaluatedCells.delete(child);
47636
- this.nextPositionsToUpdate.addMany(this.getCellsDependingOn([child]));
47637
- this.nextPositionsToUpdate.addMany(this.getArrayFormulasBlockedBy(child));
47638
47638
  }
47639
+ this.nextPositionsToUpdate.addMany(this.getCellsDependingOn(invalidated));
47640
+ this.nextPositionsToUpdate.addMany(this.getArrayFormulasBlockedBy(invalidated));
47639
47641
  this.spreadingRelations.removeNode(position);
47640
47642
  }
47641
47643
  // ----------------------------------------------------------
@@ -60572,6 +60574,6 @@ const constants = {
60572
60574
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, 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 };
60573
60575
 
60574
60576
 
60575
- __info__.version = "17.2.6";
60576
- __info__.date = "2024-05-07T10:41:20.332Z";
60577
- __info__.hash = "a4f800c";
60577
+ __info__.version = "17.2.7";
60578
+ __info__.date = "2024-05-15T09:20:44.429Z";
60579
+ __info__.hash = "57e89fa";
@@ -3,9 +3,9 @@
3
3
  /**
4
4
  * This file is generated by o-spreadsheet build tools. Do not edit it.
5
5
  * @see https://github.com/odoo/o-spreadsheet
6
- * @version 17.2.6
7
- * @date 2024-05-07T10:41:20.332Z
8
- * @hash a4f800c
6
+ * @version 17.2.7
7
+ * @date 2024-05-15T09:20:44.429Z
8
+ * @hash 57e89fa
9
9
  */
10
10
 
11
11
  (function (exports, owl) {
@@ -5202,7 +5202,7 @@
5202
5202
  }
5203
5203
  return null;
5204
5204
  }
5205
- const separatorRegexp = /^[\w\.!\$]+/;
5205
+ const SYMBOL_CHARS = new Set("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.!$");
5206
5206
  /**
5207
5207
  * A "Symbol" is just basically any word-like element that can appear in a
5208
5208
  * formula, which is not a string. So:
@@ -5242,11 +5242,8 @@
5242
5242
  };
5243
5243
  }
5244
5244
  }
5245
- const match = chars.remaining().match(separatorRegexp);
5246
- if (match) {
5247
- const value = match[0];
5248
- result += value;
5249
- chars.advanceBy(value.length);
5245
+ while (chars.current && SYMBOL_CHARS.has(chars.current)) {
5246
+ result += chars.shift();
5250
5247
  }
5251
5248
  if (result.length) {
5252
5249
  const value = result;
@@ -6798,7 +6795,7 @@
6798
6795
  function matchReference(tokens) {
6799
6796
  let head = 0;
6800
6797
  let transitions = machine[State.LeftRef];
6801
- const matchedTokens = [];
6798
+ let matchedTokens = "";
6802
6799
  while (transitions !== undefined) {
6803
6800
  const token = tokens[head++];
6804
6801
  if (!token) {
@@ -6810,15 +6807,15 @@
6810
6807
  case undefined:
6811
6808
  return null;
6812
6809
  case State.Found:
6813
- matchedTokens.push(token);
6810
+ matchedTokens += token.value;
6814
6811
  tokens.splice(0, head);
6815
6812
  return {
6816
6813
  type: "REFERENCE",
6817
- value: concat(matchedTokens.map((token) => token.value)),
6814
+ value: matchedTokens,
6818
6815
  };
6819
6816
  default:
6820
6817
  transitions = machine[nextState];
6821
- matchedTokens.push(token);
6818
+ matchedTokens += token.value;
6822
6819
  break;
6823
6820
  }
6824
6821
  }
@@ -47436,9 +47433,10 @@ stores.inject(MyMetaStore, storeInstance);
47436
47433
  }
47437
47434
  if (!content) {
47438
47435
  // The previous content could have blocked some array formulas
47439
- impactedPositions.addMany(this.getArrayFormulasBlockedBy(position));
47436
+ impactedPositions.add(position);
47440
47437
  }
47441
47438
  }
47439
+ impactedPositions.addMany(this.getArrayFormulasBlockedBy(impactedPositions));
47442
47440
  return impactedPositions;
47443
47441
  }
47444
47442
  buildDependencyGraph() {
@@ -47480,23 +47478,25 @@ stores.inject(MyMetaStore, storeInstance);
47480
47478
  return positions;
47481
47479
  }
47482
47480
  /**
47483
- * Return the position of formulas blocked by the given position
47481
+ * Return the position of formulas blocked by the given positions
47484
47482
  * as well as all their dependencies.
47485
47483
  */
47486
- getArrayFormulasBlockedBy(position) {
47487
- if (!this.spreadingRelations.hasArrayFormulaResult(position)) {
47488
- return [];
47489
- }
47490
- const arrayFormulas = this.spreadingRelations.getFormulaPositionsSpreadingOn(position);
47491
- const positions = this.createEmptyPositionSet();
47492
- positions.addMany(arrayFormulas);
47493
- const arrayFormulaPosition = this.getArrayFormulaSpreadingOn(position);
47494
- if (arrayFormulaPosition) {
47495
- // ignore the formula spreading on the position. Keep only the blocked ones
47496
- positions.delete(arrayFormulaPosition);
47484
+ getArrayFormulasBlockedBy(positions) {
47485
+ const arrayFormulaPositions = this.createEmptyPositionSet();
47486
+ for (const position of positions) {
47487
+ if (!this.spreadingRelations.hasArrayFormulaResult(position)) {
47488
+ continue;
47489
+ }
47490
+ const arrayFormulas = this.spreadingRelations.getFormulaPositionsSpreadingOn(position);
47491
+ arrayFormulaPositions.addMany(arrayFormulas);
47492
+ const arrayFormulaPosition = this.getArrayFormulaSpreadingOn(position);
47493
+ if (arrayFormulaPosition) {
47494
+ // ignore the formula spreading on the position. Keep only the blocked ones
47495
+ arrayFormulaPositions.delete(arrayFormulaPosition);
47496
+ }
47497
47497
  }
47498
- positions.addMany(this.getCellsDependingOn(positions));
47499
- return positions;
47498
+ arrayFormulaPositions.addMany(this.getCellsDependingOn(arrayFormulaPositions));
47499
+ return arrayFormulaPositions;
47500
47500
  }
47501
47501
  nextPositionsToUpdate = new PositionSet({});
47502
47502
  cellsBeingComputed = new Set();
@@ -47626,6 +47626,7 @@ stores.inject(MyMetaStore, storeInstance);
47626
47626
  if (!this.spreadingRelations.isArrayFormula(position)) {
47627
47627
  return;
47628
47628
  }
47629
+ const invalidated = this.createEmptyPositionSet();
47629
47630
  for (const child of this.spreadingRelations.getArrayResultPositions(position)) {
47630
47631
  const content = this.getters.getCell(child)?.content;
47631
47632
  if (content) {
@@ -47633,10 +47634,11 @@ stores.inject(MyMetaStore, storeInstance);
47633
47634
  // there's still a collision
47634
47635
  continue;
47635
47636
  }
47637
+ invalidated.add(child);
47636
47638
  this.evaluatedCells.delete(child);
47637
- this.nextPositionsToUpdate.addMany(this.getCellsDependingOn([child]));
47638
- this.nextPositionsToUpdate.addMany(this.getArrayFormulasBlockedBy(child));
47639
47639
  }
47640
+ this.nextPositionsToUpdate.addMany(this.getCellsDependingOn(invalidated));
47641
+ this.nextPositionsToUpdate.addMany(this.getArrayFormulasBlockedBy(invalidated));
47640
47642
  this.spreadingRelations.removeNode(position);
47641
47643
  }
47642
47644
  // ----------------------------------------------------------
@@ -60614,9 +60616,9 @@ stores.inject(MyMetaStore, storeInstance);
60614
60616
  exports.tokenize = tokenize;
60615
60617
 
60616
60618
 
60617
- __info__.version = "17.2.6";
60618
- __info__.date = "2024-05-07T10:41:20.332Z";
60619
- __info__.hash = "a4f800c";
60619
+ __info__.version = "17.2.7";
60620
+ __info__.date = "2024-05-15T09:20:44.429Z";
60621
+ __info__.hash = "57e89fa";
60620
60622
 
60621
60623
 
60622
60624
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);