@odoo/o-spreadsheet 17.3.8 → 17.3.9

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.3.8
7
- * @date 2024-07-08T05:43:16.647Z
8
- * @hash e1e7bae
6
+ * @version 17.3.9
7
+ * @date 2024-07-11T06:37:05.603Z
8
+ * @hash 2346a16
9
9
  */
10
10
 
11
11
  'use strict';
@@ -593,7 +593,7 @@ function getAddHeaderStartIndex(position, base) {
593
593
  /**
594
594
  * Compares two objects.
595
595
  */
596
- function deepEquals(o1, o2, ignoreFunctions) {
596
+ function deepEquals(o1, o2) {
597
597
  if (o1 === o2)
598
598
  return true;
599
599
  if ((o1 && !o2) || (o2 && !o1))
@@ -609,17 +609,13 @@ function deepEquals(o1, o2, ignoreFunctions) {
609
609
  }
610
610
  }
611
611
  for (const key in o1) {
612
- const typeOfO1Key = typeof o1[key];
613
- if (typeOfO1Key !== typeof o2[key])
612
+ if (typeof o1[key] !== typeof o2[key])
614
613
  return false;
615
- if (typeOfO1Key === "object") {
616
- if (!deepEquals(o1[key], o2[key], ignoreFunctions))
614
+ if (typeof o1[key] === "object") {
615
+ if (!deepEquals(o1[key], o2[key]))
617
616
  return false;
618
617
  }
619
618
  else {
620
- if (ignoreFunctions && typeOfO1Key === "function") {
621
- continue;
622
- }
623
619
  if (o1[key] !== o2[key])
624
620
  return false;
625
621
  }
@@ -2766,6 +2762,9 @@ function getPredicate(descr, locale) {
2766
2762
  * If the character is a special regular expression character, it is escaped with "\\".
2767
2763
  */
2768
2764
  const wildcardToRegExp = memoize(function wildcardToRegExp(operand) {
2765
+ if (operand === "*") {
2766
+ return /.+/;
2767
+ }
2769
2768
  let exp = "";
2770
2769
  let predecessor = "";
2771
2770
  for (let char of operand) {
@@ -2789,9 +2788,9 @@ const wildcardToRegExp = memoize(function wildcardToRegExp(operand) {
2789
2788
  }
2790
2789
  return new RegExp("^" + exp + "$", "i");
2791
2790
  });
2792
- function evaluatePredicate(value, criterion) {
2791
+ function evaluatePredicate(value = "", criterion) {
2793
2792
  const { operator, operand } = criterion;
2794
- if (value === undefined || operand === undefined || value === null || operand === null) {
2793
+ if (operand === undefined || value === null || operand === null) {
2795
2794
  return false;
2796
2795
  }
2797
2796
  if (typeof operand === "number" && operator === "=") {
@@ -9842,7 +9841,6 @@ class ChartJsComponent extends owl.Component {
9842
9841
  };
9843
9842
  canvas = owl.useRef("graphContainer");
9844
9843
  chart;
9845
- currentRuntime;
9846
9844
  get background() {
9847
9845
  return this.chartRuntime.background;
9848
9846
  }
@@ -9859,18 +9857,11 @@ class ChartJsComponent extends owl.Component {
9859
9857
  setup() {
9860
9858
  owl.onMounted(() => {
9861
9859
  const runtime = this.chartRuntime;
9862
- this.currentRuntime = runtime;
9863
9860
  // Note: chartJS modify the runtime in place, so it's important to give it a copy
9864
9861
  this.createChart(deepCopy(runtime.chartJsConfig));
9865
9862
  });
9866
9863
  owl.onWillUnmount(() => this.chart?.destroy());
9867
- owl.useEffect(() => {
9868
- const runtime = this.chartRuntime;
9869
- if (!deepEquals(runtime, this.currentRuntime, "ignoreFunctions")) {
9870
- this.currentRuntime = runtime;
9871
- this.updateChartJs(deepCopy(runtime));
9872
- }
9873
- });
9864
+ owl.useEffect(() => this.updateChartJs(deepCopy(this.chartRuntime)), () => [this.chartRuntime]);
9874
9865
  }
9875
9866
  createChart(chartData) {
9876
9867
  const canvas = this.canvas.el;
@@ -22704,7 +22695,7 @@ function truncateLabel(label) {
22704
22695
  /**
22705
22696
  * Get a default chart js configuration
22706
22697
  */
22707
- function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, truncateLabels }) {
22698
+ function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, truncateLabels = true }) {
22708
22699
  const chartTitle = chart.title.text ? chart.title : { ...chart.title, content: "" };
22709
22700
  const options = {
22710
22701
  // https://www.chartjs.org/docs/latest/general/responsive.html
@@ -45139,7 +45130,7 @@ function getRelationFile(file, xmls) {
45139
45130
  return relsFile;
45140
45131
  }
45141
45132
 
45142
- const EXCEL_IMPORT_VERSION = 16;
45133
+ const EXCEL_IMPORT_VERSION = 17;
45143
45134
  class XlsxReader {
45144
45135
  warningManager;
45145
45136
  xmls;
@@ -45271,7 +45262,7 @@ function normalizeV9(formula) {
45271
45262
  * a breaking change is made in the way the state is handled, and an upgrade
45272
45263
  * function should be defined
45273
45264
  */
45274
- const CURRENT_VERSION = 16;
45265
+ const CURRENT_VERSION = 17;
45275
45266
  const INITIAL_SHEET_ID = "Sheet1";
45276
45267
  /**
45277
45268
  * This function tries to load anything that could look like a valid
@@ -52614,7 +52605,7 @@ class PositionSet {
52614
52605
  return this.sheets[position.sheetId].getValue(position) === 1;
52615
52606
  }
52616
52607
  clear() {
52617
- const insertions = this.insertions;
52608
+ const insertions = [...this];
52618
52609
  this.insertions = [];
52619
52610
  for (const sheetId in this.sheets) {
52620
52611
  this.sheets[sheetId].clear();
@@ -52952,6 +52943,7 @@ class Evaluator {
52952
52943
  }
52953
52944
  finally {
52954
52945
  this.cellsBeingComputed.delete(cellId);
52946
+ this.nextPositionsToUpdate.delete(position);
52955
52947
  }
52956
52948
  }
52957
52949
  computeAndSave(position) {
@@ -52978,8 +52970,33 @@ class Evaluator {
52978
52970
  forEachSpreadPositionInMatrix(nbColumns, nbRows,
52979
52971
  // thanks to the isMatrix check above, we know that formulaReturn is MatrixFunctionReturn
52980
52972
  this.spreadValues(formulaPosition, formulaReturn));
52973
+ this.invalidatePositionsDependingOnSpread(formulaPosition, nbColumns, nbRows);
52981
52974
  return createEvaluatedCell(nullValueToZeroValue(formulaReturn[0][0]), this.getters.getLocale(), cellData);
52982
52975
  }
52976
+ invalidatePositionsDependingOnSpread(arrayFormulaPosition, nbColumns, nbRows) {
52977
+ // the result matrix is split in 2 zones to exclude the array formula position
52978
+ const top = arrayFormulaPosition.row;
52979
+ const left = arrayFormulaPosition.col;
52980
+ const bottom = top + nbRows - 1;
52981
+ const leftColumnZone = {
52982
+ top: top + 1,
52983
+ bottom,
52984
+ left,
52985
+ right: left,
52986
+ };
52987
+ const rightPartZone = {
52988
+ top,
52989
+ bottom,
52990
+ left: left + 1,
52991
+ right: left + nbColumns - 1,
52992
+ };
52993
+ const sheetId = arrayFormulaPosition.sheetId;
52994
+ const invalidatedPositions = this.formulaDependencies().getCellsDependingOn([
52995
+ { sheetId, zone: rightPartZone },
52996
+ { sheetId, zone: leftColumnZone },
52997
+ ]);
52998
+ this.nextPositionsToUpdate.addMany(invalidatedPositions);
52999
+ }
52983
53000
  assertSheetHasEnoughSpaceToSpreadFormulaResult({ sheetId, col, row }, matrixResult) {
52984
53001
  const numberOfCols = this.getters.getNumberCols(sheetId);
52985
53002
  const numberOfRows = this.getters.getNumberRows(sheetId);
@@ -53034,9 +53051,6 @@ class Evaluator {
53034
53051
  const cell = this.getters.getCell(position);
53035
53052
  const evaluatedCell = createEvaluatedCell(nullValueToZeroValue(matrixResult[i][j]), this.getters.getLocale(), cell);
53036
53053
  this.evaluatedCells.set(position, evaluatedCell);
53037
- // check if formula dependencies present in the spread zone
53038
- // if so, they need to be recomputed
53039
- this.nextPositionsToUpdate.addMany(this.getCellsDependingOn([position]));
53040
53054
  };
53041
53055
  }
53042
53056
  invalidateSpreading(position) {
@@ -67074,6 +67088,6 @@ exports.tokenColors = tokenColors;
67074
67088
  exports.tokenize = tokenize;
67075
67089
 
67076
67090
 
67077
- __info__.version = "17.3.8";
67078
- __info__.date = "2024-07-08T05:43:16.647Z";
67079
- __info__.hash = "e1e7bae";
67091
+ __info__.version = "17.3.9";
67092
+ __info__.date = "2024-07-11T06:37:05.603Z";
67093
+ __info__.hash = "2346a16";
@@ -5517,7 +5517,7 @@ declare function lazy<T>(fn: (() => T) | T): Lazy<T>;
5517
5517
  /**
5518
5518
  * Compares two objects.
5519
5519
  */
5520
- declare function deepEquals(o1: any, o2: any, ignoreFunctions?: "ignoreFunctions"): boolean;
5520
+ declare function deepEquals(o1: any, o2: any): boolean;
5521
5521
 
5522
5522
  interface ConstructorArgs {
5523
5523
  readonly zone: Readonly<Zone | UnboundedZone>;
@@ -7796,7 +7796,6 @@ declare class ChartJsComponent extends Component<Props$F, SpreadsheetChildEnv> {
7796
7796
  };
7797
7797
  private canvas;
7798
7798
  private chart?;
7799
- private currentRuntime;
7800
7799
  get background(): string;
7801
7800
  get canvasStyle(): string;
7802
7801
  get chartRuntime(): ChartJSRuntime;
@@ -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.3.8
7
- * @date 2024-07-08T05:43:16.647Z
8
- * @hash e1e7bae
6
+ * @version 17.3.9
7
+ * @date 2024-07-11T06:37:05.603Z
8
+ * @hash 2346a16
9
9
  */
10
10
 
11
11
  import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
@@ -591,7 +591,7 @@ function getAddHeaderStartIndex(position, base) {
591
591
  /**
592
592
  * Compares two objects.
593
593
  */
594
- function deepEquals(o1, o2, ignoreFunctions) {
594
+ function deepEquals(o1, o2) {
595
595
  if (o1 === o2)
596
596
  return true;
597
597
  if ((o1 && !o2) || (o2 && !o1))
@@ -607,17 +607,13 @@ function deepEquals(o1, o2, ignoreFunctions) {
607
607
  }
608
608
  }
609
609
  for (const key in o1) {
610
- const typeOfO1Key = typeof o1[key];
611
- if (typeOfO1Key !== typeof o2[key])
610
+ if (typeof o1[key] !== typeof o2[key])
612
611
  return false;
613
- if (typeOfO1Key === "object") {
614
- if (!deepEquals(o1[key], o2[key], ignoreFunctions))
612
+ if (typeof o1[key] === "object") {
613
+ if (!deepEquals(o1[key], o2[key]))
615
614
  return false;
616
615
  }
617
616
  else {
618
- if (ignoreFunctions && typeOfO1Key === "function") {
619
- continue;
620
- }
621
617
  if (o1[key] !== o2[key])
622
618
  return false;
623
619
  }
@@ -2764,6 +2760,9 @@ function getPredicate(descr, locale) {
2764
2760
  * If the character is a special regular expression character, it is escaped with "\\".
2765
2761
  */
2766
2762
  const wildcardToRegExp = memoize(function wildcardToRegExp(operand) {
2763
+ if (operand === "*") {
2764
+ return /.+/;
2765
+ }
2767
2766
  let exp = "";
2768
2767
  let predecessor = "";
2769
2768
  for (let char of operand) {
@@ -2787,9 +2786,9 @@ const wildcardToRegExp = memoize(function wildcardToRegExp(operand) {
2787
2786
  }
2788
2787
  return new RegExp("^" + exp + "$", "i");
2789
2788
  });
2790
- function evaluatePredicate(value, criterion) {
2789
+ function evaluatePredicate(value = "", criterion) {
2791
2790
  const { operator, operand } = criterion;
2792
- if (value === undefined || operand === undefined || value === null || operand === null) {
2791
+ if (operand === undefined || value === null || operand === null) {
2793
2792
  return false;
2794
2793
  }
2795
2794
  if (typeof operand === "number" && operator === "=") {
@@ -9840,7 +9839,6 @@ class ChartJsComponent extends Component {
9840
9839
  };
9841
9840
  canvas = useRef("graphContainer");
9842
9841
  chart;
9843
- currentRuntime;
9844
9842
  get background() {
9845
9843
  return this.chartRuntime.background;
9846
9844
  }
@@ -9857,18 +9855,11 @@ class ChartJsComponent extends Component {
9857
9855
  setup() {
9858
9856
  onMounted(() => {
9859
9857
  const runtime = this.chartRuntime;
9860
- this.currentRuntime = runtime;
9861
9858
  // Note: chartJS modify the runtime in place, so it's important to give it a copy
9862
9859
  this.createChart(deepCopy(runtime.chartJsConfig));
9863
9860
  });
9864
9861
  onWillUnmount(() => this.chart?.destroy());
9865
- useEffect(() => {
9866
- const runtime = this.chartRuntime;
9867
- if (!deepEquals(runtime, this.currentRuntime, "ignoreFunctions")) {
9868
- this.currentRuntime = runtime;
9869
- this.updateChartJs(deepCopy(runtime));
9870
- }
9871
- });
9862
+ useEffect(() => this.updateChartJs(deepCopy(this.chartRuntime)), () => [this.chartRuntime]);
9872
9863
  }
9873
9864
  createChart(chartData) {
9874
9865
  const canvas = this.canvas.el;
@@ -22702,7 +22693,7 @@ function truncateLabel(label) {
22702
22693
  /**
22703
22694
  * Get a default chart js configuration
22704
22695
  */
22705
- function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, truncateLabels }) {
22696
+ function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, truncateLabels = true }) {
22706
22697
  const chartTitle = chart.title.text ? chart.title : { ...chart.title, content: "" };
22707
22698
  const options = {
22708
22699
  // https://www.chartjs.org/docs/latest/general/responsive.html
@@ -45137,7 +45128,7 @@ function getRelationFile(file, xmls) {
45137
45128
  return relsFile;
45138
45129
  }
45139
45130
 
45140
- const EXCEL_IMPORT_VERSION = 16;
45131
+ const EXCEL_IMPORT_VERSION = 17;
45141
45132
  class XlsxReader {
45142
45133
  warningManager;
45143
45134
  xmls;
@@ -45269,7 +45260,7 @@ function normalizeV9(formula) {
45269
45260
  * a breaking change is made in the way the state is handled, and an upgrade
45270
45261
  * function should be defined
45271
45262
  */
45272
- const CURRENT_VERSION = 16;
45263
+ const CURRENT_VERSION = 17;
45273
45264
  const INITIAL_SHEET_ID = "Sheet1";
45274
45265
  /**
45275
45266
  * This function tries to load anything that could look like a valid
@@ -52612,7 +52603,7 @@ class PositionSet {
52612
52603
  return this.sheets[position.sheetId].getValue(position) === 1;
52613
52604
  }
52614
52605
  clear() {
52615
- const insertions = this.insertions;
52606
+ const insertions = [...this];
52616
52607
  this.insertions = [];
52617
52608
  for (const sheetId in this.sheets) {
52618
52609
  this.sheets[sheetId].clear();
@@ -52950,6 +52941,7 @@ class Evaluator {
52950
52941
  }
52951
52942
  finally {
52952
52943
  this.cellsBeingComputed.delete(cellId);
52944
+ this.nextPositionsToUpdate.delete(position);
52953
52945
  }
52954
52946
  }
52955
52947
  computeAndSave(position) {
@@ -52976,8 +52968,33 @@ class Evaluator {
52976
52968
  forEachSpreadPositionInMatrix(nbColumns, nbRows,
52977
52969
  // thanks to the isMatrix check above, we know that formulaReturn is MatrixFunctionReturn
52978
52970
  this.spreadValues(formulaPosition, formulaReturn));
52971
+ this.invalidatePositionsDependingOnSpread(formulaPosition, nbColumns, nbRows);
52979
52972
  return createEvaluatedCell(nullValueToZeroValue(formulaReturn[0][0]), this.getters.getLocale(), cellData);
52980
52973
  }
52974
+ invalidatePositionsDependingOnSpread(arrayFormulaPosition, nbColumns, nbRows) {
52975
+ // the result matrix is split in 2 zones to exclude the array formula position
52976
+ const top = arrayFormulaPosition.row;
52977
+ const left = arrayFormulaPosition.col;
52978
+ const bottom = top + nbRows - 1;
52979
+ const leftColumnZone = {
52980
+ top: top + 1,
52981
+ bottom,
52982
+ left,
52983
+ right: left,
52984
+ };
52985
+ const rightPartZone = {
52986
+ top,
52987
+ bottom,
52988
+ left: left + 1,
52989
+ right: left + nbColumns - 1,
52990
+ };
52991
+ const sheetId = arrayFormulaPosition.sheetId;
52992
+ const invalidatedPositions = this.formulaDependencies().getCellsDependingOn([
52993
+ { sheetId, zone: rightPartZone },
52994
+ { sheetId, zone: leftColumnZone },
52995
+ ]);
52996
+ this.nextPositionsToUpdate.addMany(invalidatedPositions);
52997
+ }
52981
52998
  assertSheetHasEnoughSpaceToSpreadFormulaResult({ sheetId, col, row }, matrixResult) {
52982
52999
  const numberOfCols = this.getters.getNumberCols(sheetId);
52983
53000
  const numberOfRows = this.getters.getNumberRows(sheetId);
@@ -53032,9 +53049,6 @@ class Evaluator {
53032
53049
  const cell = this.getters.getCell(position);
53033
53050
  const evaluatedCell = createEvaluatedCell(nullValueToZeroValue(matrixResult[i][j]), this.getters.getLocale(), cell);
53034
53051
  this.evaluatedCells.set(position, evaluatedCell);
53035
- // check if formula dependencies present in the spread zone
53036
- // if so, they need to be recomputed
53037
- this.nextPositionsToUpdate.addMany(this.getCellsDependingOn([position]));
53038
53052
  };
53039
53053
  }
53040
53054
  invalidateSpreading(position) {
@@ -67029,6 +67043,6 @@ const constants = {
67029
67043
  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 };
67030
67044
 
67031
67045
 
67032
- __info__.version = "17.3.8";
67033
- __info__.date = "2024-07-08T05:43:16.647Z";
67034
- __info__.hash = "e1e7bae";
67046
+ __info__.version = "17.3.9";
67047
+ __info__.date = "2024-07-11T06:37:05.603Z";
67048
+ __info__.hash = "2346a16";
@@ -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.3.8
7
- * @date 2024-07-08T05:43:16.647Z
8
- * @hash e1e7bae
6
+ * @version 17.3.9
7
+ * @date 2024-07-11T06:37:05.603Z
8
+ * @hash 2346a16
9
9
  */
10
10
 
11
11
  (function (exports, owl) {
@@ -592,7 +592,7 @@
592
592
  /**
593
593
  * Compares two objects.
594
594
  */
595
- function deepEquals(o1, o2, ignoreFunctions) {
595
+ function deepEquals(o1, o2) {
596
596
  if (o1 === o2)
597
597
  return true;
598
598
  if ((o1 && !o2) || (o2 && !o1))
@@ -608,17 +608,13 @@
608
608
  }
609
609
  }
610
610
  for (const key in o1) {
611
- const typeOfO1Key = typeof o1[key];
612
- if (typeOfO1Key !== typeof o2[key])
611
+ if (typeof o1[key] !== typeof o2[key])
613
612
  return false;
614
- if (typeOfO1Key === "object") {
615
- if (!deepEquals(o1[key], o2[key], ignoreFunctions))
613
+ if (typeof o1[key] === "object") {
614
+ if (!deepEquals(o1[key], o2[key]))
616
615
  return false;
617
616
  }
618
617
  else {
619
- if (ignoreFunctions && typeOfO1Key === "function") {
620
- continue;
621
- }
622
618
  if (o1[key] !== o2[key])
623
619
  return false;
624
620
  }
@@ -2765,6 +2761,9 @@
2765
2761
  * If the character is a special regular expression character, it is escaped with "\\".
2766
2762
  */
2767
2763
  const wildcardToRegExp = memoize(function wildcardToRegExp(operand) {
2764
+ if (operand === "*") {
2765
+ return /.+/;
2766
+ }
2768
2767
  let exp = "";
2769
2768
  let predecessor = "";
2770
2769
  for (let char of operand) {
@@ -2788,9 +2787,9 @@
2788
2787
  }
2789
2788
  return new RegExp("^" + exp + "$", "i");
2790
2789
  });
2791
- function evaluatePredicate(value, criterion) {
2790
+ function evaluatePredicate(value = "", criterion) {
2792
2791
  const { operator, operand } = criterion;
2793
- if (value === undefined || operand === undefined || value === null || operand === null) {
2792
+ if (operand === undefined || value === null || operand === null) {
2794
2793
  return false;
2795
2794
  }
2796
2795
  if (typeof operand === "number" && operator === "=") {
@@ -9841,7 +9840,6 @@ stores.inject(MyMetaStore, storeInstance);
9841
9840
  };
9842
9841
  canvas = owl.useRef("graphContainer");
9843
9842
  chart;
9844
- currentRuntime;
9845
9843
  get background() {
9846
9844
  return this.chartRuntime.background;
9847
9845
  }
@@ -9858,18 +9856,11 @@ stores.inject(MyMetaStore, storeInstance);
9858
9856
  setup() {
9859
9857
  owl.onMounted(() => {
9860
9858
  const runtime = this.chartRuntime;
9861
- this.currentRuntime = runtime;
9862
9859
  // Note: chartJS modify the runtime in place, so it's important to give it a copy
9863
9860
  this.createChart(deepCopy(runtime.chartJsConfig));
9864
9861
  });
9865
9862
  owl.onWillUnmount(() => this.chart?.destroy());
9866
- owl.useEffect(() => {
9867
- const runtime = this.chartRuntime;
9868
- if (!deepEquals(runtime, this.currentRuntime, "ignoreFunctions")) {
9869
- this.currentRuntime = runtime;
9870
- this.updateChartJs(deepCopy(runtime));
9871
- }
9872
- });
9863
+ owl.useEffect(() => this.updateChartJs(deepCopy(this.chartRuntime)), () => [this.chartRuntime]);
9873
9864
  }
9874
9865
  createChart(chartData) {
9875
9866
  const canvas = this.canvas.el;
@@ -22703,7 +22694,7 @@ stores.inject(MyMetaStore, storeInstance);
22703
22694
  /**
22704
22695
  * Get a default chart js configuration
22705
22696
  */
22706
- function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, truncateLabels }) {
22697
+ function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, truncateLabels = true }) {
22707
22698
  const chartTitle = chart.title.text ? chart.title : { ...chart.title, content: "" };
22708
22699
  const options = {
22709
22700
  // https://www.chartjs.org/docs/latest/general/responsive.html
@@ -45138,7 +45129,7 @@ stores.inject(MyMetaStore, storeInstance);
45138
45129
  return relsFile;
45139
45130
  }
45140
45131
 
45141
- const EXCEL_IMPORT_VERSION = 16;
45132
+ const EXCEL_IMPORT_VERSION = 17;
45142
45133
  class XlsxReader {
45143
45134
  warningManager;
45144
45135
  xmls;
@@ -45270,7 +45261,7 @@ stores.inject(MyMetaStore, storeInstance);
45270
45261
  * a breaking change is made in the way the state is handled, and an upgrade
45271
45262
  * function should be defined
45272
45263
  */
45273
- const CURRENT_VERSION = 16;
45264
+ const CURRENT_VERSION = 17;
45274
45265
  const INITIAL_SHEET_ID = "Sheet1";
45275
45266
  /**
45276
45267
  * This function tries to load anything that could look like a valid
@@ -52613,7 +52604,7 @@ stores.inject(MyMetaStore, storeInstance);
52613
52604
  return this.sheets[position.sheetId].getValue(position) === 1;
52614
52605
  }
52615
52606
  clear() {
52616
- const insertions = this.insertions;
52607
+ const insertions = [...this];
52617
52608
  this.insertions = [];
52618
52609
  for (const sheetId in this.sheets) {
52619
52610
  this.sheets[sheetId].clear();
@@ -52951,6 +52942,7 @@ stores.inject(MyMetaStore, storeInstance);
52951
52942
  }
52952
52943
  finally {
52953
52944
  this.cellsBeingComputed.delete(cellId);
52945
+ this.nextPositionsToUpdate.delete(position);
52954
52946
  }
52955
52947
  }
52956
52948
  computeAndSave(position) {
@@ -52977,8 +52969,33 @@ stores.inject(MyMetaStore, storeInstance);
52977
52969
  forEachSpreadPositionInMatrix(nbColumns, nbRows,
52978
52970
  // thanks to the isMatrix check above, we know that formulaReturn is MatrixFunctionReturn
52979
52971
  this.spreadValues(formulaPosition, formulaReturn));
52972
+ this.invalidatePositionsDependingOnSpread(formulaPosition, nbColumns, nbRows);
52980
52973
  return createEvaluatedCell(nullValueToZeroValue(formulaReturn[0][0]), this.getters.getLocale(), cellData);
52981
52974
  }
52975
+ invalidatePositionsDependingOnSpread(arrayFormulaPosition, nbColumns, nbRows) {
52976
+ // the result matrix is split in 2 zones to exclude the array formula position
52977
+ const top = arrayFormulaPosition.row;
52978
+ const left = arrayFormulaPosition.col;
52979
+ const bottom = top + nbRows - 1;
52980
+ const leftColumnZone = {
52981
+ top: top + 1,
52982
+ bottom,
52983
+ left,
52984
+ right: left,
52985
+ };
52986
+ const rightPartZone = {
52987
+ top,
52988
+ bottom,
52989
+ left: left + 1,
52990
+ right: left + nbColumns - 1,
52991
+ };
52992
+ const sheetId = arrayFormulaPosition.sheetId;
52993
+ const invalidatedPositions = this.formulaDependencies().getCellsDependingOn([
52994
+ { sheetId, zone: rightPartZone },
52995
+ { sheetId, zone: leftColumnZone },
52996
+ ]);
52997
+ this.nextPositionsToUpdate.addMany(invalidatedPositions);
52998
+ }
52982
52999
  assertSheetHasEnoughSpaceToSpreadFormulaResult({ sheetId, col, row }, matrixResult) {
52983
53000
  const numberOfCols = this.getters.getNumberCols(sheetId);
52984
53001
  const numberOfRows = this.getters.getNumberRows(sheetId);
@@ -53033,9 +53050,6 @@ stores.inject(MyMetaStore, storeInstance);
53033
53050
  const cell = this.getters.getCell(position);
53034
53051
  const evaluatedCell = createEvaluatedCell(nullValueToZeroValue(matrixResult[i][j]), this.getters.getLocale(), cell);
53035
53052
  this.evaluatedCells.set(position, evaluatedCell);
53036
- // check if formula dependencies present in the spread zone
53037
- // if so, they need to be recomputed
53038
- this.nextPositionsToUpdate.addMany(this.getCellsDependingOn([position]));
53039
53053
  };
53040
53054
  }
53041
53055
  invalidateSpreading(position) {
@@ -67073,9 +67087,9 @@ stores.inject(MyMetaStore, storeInstance);
67073
67087
  exports.tokenize = tokenize;
67074
67088
 
67075
67089
 
67076
- __info__.version = "17.3.8";
67077
- __info__.date = "2024-07-08T05:43:16.647Z";
67078
- __info__.hash = "e1e7bae";
67090
+ __info__.version = "17.3.9";
67091
+ __info__.date = "2024-07-11T06:37:05.603Z";
67092
+ __info__.hash = "2346a16";
67079
67093
 
67080
67094
 
67081
67095
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);