@odoo/o-spreadsheet 16.0.1 → 16.0.2

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.
@@ -2800,7 +2800,7 @@
2800
2800
  return `background-color: ${this.background}`;
2801
2801
  }
2802
2802
  get chartRuntime() {
2803
- const runtime = this.env.model.getters.getChartRuntime(this.env.model.getters.getActiveSheetId(), this.props.figure.id);
2803
+ const runtime = this.env.model.getters.getChartRuntime(this.props.figure.id);
2804
2804
  if (!("chartJsConfig" in runtime)) {
2805
2805
  throw new Error("Unsupported chart runtime");
2806
2806
  }
@@ -3169,6 +3169,7 @@
3169
3169
  CommandResult[CommandResult["DuplicatedFigureId"] = 81] = "DuplicatedFigureId";
3170
3170
  CommandResult[CommandResult["InvalidSelectionStep"] = 82] = "InvalidSelectionStep";
3171
3171
  CommandResult[CommandResult["DuplicatedChartId"] = 83] = "DuplicatedChartId";
3172
+ CommandResult[CommandResult["ChartDoesNotExist"] = 84] = "ChartDoesNotExist";
3172
3173
  })(exports.CommandResult || (exports.CommandResult = {}));
3173
3174
 
3174
3175
  var DIRECTION;
@@ -8637,7 +8638,7 @@
8637
8638
 
8638
8639
  class LineConfigPanel extends LineBarPieConfigPanel {
8639
8640
  get canTreatLabelsAsText() {
8640
- const chart = this.env.model.getters.getChart(this.props.sheetId, this.props.figureId);
8641
+ const chart = this.env.model.getters.getChart(this.props.figureId);
8641
8642
  if (chart && chart instanceof LineChart) {
8642
8643
  return canChartParseLabels(chart, this.env.model.getters);
8643
8644
  }
@@ -8830,7 +8831,7 @@
8830
8831
  else {
8831
8832
  this.shouldUpdateChart = true;
8832
8833
  }
8833
- if (!this.env.model.getters.isChartDefined(this.sheetId, this.figureId)) {
8834
+ if (!this.env.model.getters.isChartDefined(this.figureId)) {
8834
8835
  this.props.onCloseSidePanel();
8835
8836
  return;
8836
8837
  }
@@ -8851,7 +8852,7 @@
8851
8852
  });
8852
8853
  }
8853
8854
  onTypeChange(type) {
8854
- const context = this.env.model.getters.getContextCreationChart(this.sheetId, this.figureId);
8855
+ const context = this.env.model.getters.getContextCreationChart(this.figureId);
8855
8856
  if (!context) {
8856
8857
  throw new Error("Chart not defined.");
8857
8858
  }
@@ -8863,7 +8864,7 @@
8863
8864
  });
8864
8865
  }
8865
8866
  get chartPanel() {
8866
- const type = this.env.model.getters.getChartType(this.sheetId, this.figureId);
8867
+ const type = this.env.model.getters.getChartType(this.figureId);
8867
8868
  if (!type) {
8868
8869
  throw new Error("Chart not defined.");
8869
8870
  }
@@ -8873,8 +8874,8 @@
8873
8874
  }
8874
8875
  return chartPanel;
8875
8876
  }
8876
- getChartDefinition() {
8877
- return this.env.model.getters.getChartDefinition(this.sheetId, this.figureId);
8877
+ getChartDefinition(figureId = this.figureId) {
8878
+ return this.env.model.getters.getChartDefinition(figureId);
8878
8879
  }
8879
8880
  get chartTypes() {
8880
8881
  return getChartTypes();
@@ -10010,7 +10011,7 @@
10010
10011
  this.ctx = document.createElement("canvas").getContext("2d");
10011
10012
  }
10012
10013
  get runtime() {
10013
- return this.env.model.getters.getChartRuntime(this.env.model.getters.getActiveSheetId(), this.props.figure.id);
10014
+ return this.env.model.getters.getChartRuntime(this.props.figure.id);
10014
10015
  }
10015
10016
  get title() {
10016
10017
  return this.runtime.title;
@@ -10240,7 +10241,7 @@
10240
10241
  return registry;
10241
10242
  }
10242
10243
  get chartType() {
10243
- return this.env.model.getters.getChartType(this.env.model.getters.getActiveSheetId(), this.props.figure.id);
10244
+ return this.env.model.getters.getChartType(this.props.figure.id);
10244
10245
  }
10245
10246
  onContextMenu(ev) {
10246
10247
  const position = {
@@ -26267,13 +26268,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
26267
26268
  data = migrate(data);
26268
26269
  }
26269
26270
  }
26270
- // sanity check: try to fix missing fields/corrupted state by providing
26271
- // sensible default values
26272
- data = Object.assign(createEmptyWorkbookData(), data, { version: CURRENT_VERSION });
26273
- data.sheets = data.sheets.map((s, i) => Object.assign(createEmptySheet(`Sheet${i + 1}`, `Sheet${i + 1}`), s));
26274
- if (data.sheets.length === 0) {
26275
- data.sheets.push(createEmptySheet(INITIAL_SHEET_ID, "Sheet1"));
26276
- }
26271
+ data = repairData(data);
26277
26272
  return data;
26278
26273
  }
26279
26274
  function migrate(data) {
@@ -26511,6 +26506,48 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
26511
26506
  },
26512
26507
  },
26513
26508
  ];
26509
+ /**
26510
+ * This function is used to repair faulty data independently of the migration.
26511
+ */
26512
+ function repairData(data) {
26513
+ data = forceUnicityOfFigure(data);
26514
+ data = setDefaults(data);
26515
+ return data;
26516
+ }
26517
+ /**
26518
+ * Force the unicity of figure ids accross sheets
26519
+ */
26520
+ function forceUnicityOfFigure(data) {
26521
+ if (data.uniqueFigureIds) {
26522
+ return data;
26523
+ }
26524
+ const figureIds = new Set();
26525
+ const uuidGenerator = new UuidGenerator();
26526
+ for (const sheet of data.sheets || []) {
26527
+ for (const figure of sheet.figures || []) {
26528
+ if (figureIds.has(figure.id)) {
26529
+ figure.id += uuidGenerator.uuidv4();
26530
+ }
26531
+ figureIds.add(figure.id);
26532
+ }
26533
+ }
26534
+ data.uniqueFigureIds = true;
26535
+ return data;
26536
+ }
26537
+ /**
26538
+ * sanity check: try to fix missing fields/corrupted state by providing
26539
+ * sensible default values
26540
+ */
26541
+ function setDefaults(data) {
26542
+ data = Object.assign(createEmptyWorkbookData(), data, { version: CURRENT_VERSION });
26543
+ data.sheets = data.sheets
26544
+ ? data.sheets.map((s, i) => Object.assign(createEmptySheet(`Sheet${i + 1}`, `Sheet${i + 1}`), s))
26545
+ : [];
26546
+ if (data.sheets.length === 0) {
26547
+ data.sheets.push(createEmptySheet(INITIAL_SHEET_ID, "Sheet1"));
26548
+ }
26549
+ return data;
26550
+ }
26514
26551
  /**
26515
26552
  * The goal of this function is to repair corrupted/wrong initial messages caused by
26516
26553
  * a bug.
@@ -26649,6 +26686,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
26649
26686
  formats: {},
26650
26687
  borders: {},
26651
26688
  revisionId: DEFAULT_REVISION_ID,
26689
+ uniqueFigureIds: true,
26652
26690
  };
26653
26691
  return data;
26654
26692
  }
@@ -27571,10 +27609,8 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
27571
27609
  this.validateChartDefinition = (cmd) => validateChartDefinition(this, cmd.definition);
27572
27610
  }
27573
27611
  adaptRanges(applyChange) {
27574
- for (const sheetId of Object.keys(this.charts)) {
27575
- for (const [chartId, chart] of Object.entries(this.charts[sheetId] || {})) {
27576
- this.history.update("charts", sheetId, chartId, chart === null || chart === void 0 ? void 0 : chart.updateRanges(applyChange));
27577
- }
27612
+ for (const [chartId, chart] of Object.entries(this.charts)) {
27613
+ this.history.update("charts", chartId, chart === null || chart === void 0 ? void 0 : chart.updateRanges(applyChange));
27578
27614
  }
27579
27615
  }
27580
27616
  // ---------------------------------------------------------------------------
@@ -27585,20 +27621,20 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
27585
27621
  case "CREATE_CHART":
27586
27622
  return this.checkValidations(cmd, this.chainValidations(this.validateChartDefinition, this.checkChartDuplicate));
27587
27623
  case "UPDATE_CHART":
27588
- return this.validateChartDefinition(cmd);
27624
+ return this.checkValidations(cmd, this.chainValidations(this.validateChartDefinition, this.checkChartExists));
27589
27625
  default:
27590
27626
  return 0 /* CommandResult.Success */;
27591
27627
  }
27592
27628
  }
27593
27629
  handle(cmd) {
27594
- var _a, _b;
27630
+ var _a;
27595
27631
  switch (cmd.type) {
27596
27632
  case "CREATE_CHART":
27597
27633
  this.addFigure(cmd.id, cmd.sheetId, cmd.position, cmd.size);
27598
- this.addChart(cmd.id, cmd.sheetId, cmd.definition);
27634
+ this.addChart(cmd.id, cmd.definition);
27599
27635
  break;
27600
27636
  case "UPDATE_CHART": {
27601
- this.addChart(cmd.id, cmd.sheetId, cmd.definition);
27637
+ this.addChart(cmd.id, cmd.definition);
27602
27638
  break;
27603
27639
  }
27604
27640
  case "DUPLICATE_SHEET": {
@@ -27607,7 +27643,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
27607
27643
  if (fig.tag === "chart") {
27608
27644
  const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
27609
27645
  const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
27610
- const chart = (_b = (_a = this.charts[cmd.sheetId]) === null || _a === void 0 ? void 0 : _a[fig.id]) === null || _b === void 0 ? void 0 : _b.copyForSheetId(cmd.sheetIdTo);
27646
+ const chart = (_a = this.charts[fig.id]) === null || _a === void 0 ? void 0 : _a.copyForSheetId(cmd.sheetIdTo);
27611
27647
  if (chart) {
27612
27648
  this.dispatch("CREATE_CHART", {
27613
27649
  id: duplicatedFigureId,
@@ -27622,41 +27658,44 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
27622
27658
  break;
27623
27659
  }
27624
27660
  case "DELETE_FIGURE":
27625
- this.history.update("charts", cmd.sheetId, cmd.id, undefined);
27661
+ this.history.update("charts", cmd.id, undefined);
27626
27662
  break;
27627
27663
  case "DELETE_SHEET":
27628
- this.history.update("charts", cmd.sheetId, undefined);
27664
+ for (let id of this.getChartIds(cmd.sheetId)) {
27665
+ this.history.update("charts", id, undefined);
27666
+ }
27629
27667
  break;
27630
27668
  }
27631
27669
  }
27632
27670
  // ---------------------------------------------------------------------------
27633
27671
  // Getters
27634
27672
  // ---------------------------------------------------------------------------
27635
- getContextCreationChart(sheetId, figureId) {
27636
- var _a, _b;
27637
- return (_b = (_a = this.charts[sheetId]) === null || _a === void 0 ? void 0 : _a[figureId]) === null || _b === void 0 ? void 0 : _b.getContextCreation();
27638
- }
27639
- getChart(sheetId, figureId) {
27673
+ getContextCreationChart(figureId) {
27640
27674
  var _a;
27641
- return (_a = this.charts[sheetId]) === null || _a === void 0 ? void 0 : _a[figureId];
27675
+ return (_a = this.charts[figureId]) === null || _a === void 0 ? void 0 : _a.getContextCreation();
27642
27676
  }
27643
- getChartType(sheetId, figureId) {
27644
- var _a, _b;
27645
- const type = (_b = (_a = this.charts[sheetId]) === null || _a === void 0 ? void 0 : _a[figureId]) === null || _b === void 0 ? void 0 : _b.type;
27677
+ getChart(figureId) {
27678
+ return this.charts[figureId];
27679
+ }
27680
+ getChartType(figureId) {
27681
+ var _a;
27682
+ const type = (_a = this.charts[figureId]) === null || _a === void 0 ? void 0 : _a.type;
27646
27683
  if (!type) {
27647
27684
  throw new Error("Chart not defined.");
27648
27685
  }
27649
27686
  return type;
27650
27687
  }
27651
- isChartDefined(sheetId, figureId) {
27652
- return figureId in (this.charts[sheetId] || {});
27688
+ isChartDefined(figureId) {
27689
+ return figureId in this.charts && this.charts !== undefined;
27653
27690
  }
27654
27691
  getChartIds(sheetId) {
27655
- return Object.keys(this.charts[sheetId] || {});
27692
+ return Object.entries(this.charts)
27693
+ .filter(([, chart]) => (chart === null || chart === void 0 ? void 0 : chart.sheetId) === sheetId)
27694
+ .map(([id]) => id);
27656
27695
  }
27657
- getChartDefinition(sheetId, figureId) {
27658
- var _a, _b;
27659
- const definition = (_b = (_a = this.charts[sheetId]) === null || _a === void 0 ? void 0 : _a[figureId]) === null || _b === void 0 ? void 0 : _b.getDefinition();
27696
+ getChartDefinition(figureId) {
27697
+ var _a;
27698
+ const definition = (_a = this.charts[figureId]) === null || _a === void 0 ? void 0 : _a.getDefinition();
27660
27699
  if (!definition) {
27661
27700
  throw new Error(`There is no chart with the given figureId: ${figureId}`);
27662
27701
  }
@@ -27668,28 +27707,35 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
27668
27707
  import(data) {
27669
27708
  for (let sheet of data.sheets) {
27670
27709
  if (sheet.figures) {
27671
- const charts = {};
27672
27710
  for (let figure of sheet.figures) {
27673
27711
  // TODO:
27674
27712
  // figure data should be external IMO => chart should be in sheet.chart
27675
27713
  // instead of in figure.data
27676
27714
  if (figure.tag === "chart") {
27677
- charts[figure.id] = this.createChart(figure.id, figure.data, sheet.id);
27715
+ this.charts[figure.id] = this.createChart(figure.id, figure.data, sheet.id);
27678
27716
  }
27679
27717
  }
27680
- this.charts[sheet.id] = charts;
27681
27718
  }
27682
27719
  }
27683
27720
  }
27684
27721
  export(data) {
27722
+ var _a;
27685
27723
  if (data.sheets) {
27686
27724
  for (let sheet of data.sheets) {
27687
27725
  // TODO This code is false, if two plugins want ot insert figures on the sheet, it will crash !
27688
27726
  const sheetFigures = this.getters.getFigures(sheet.id);
27689
- const figures = sheetFigures;
27690
- for (let figure of figures) {
27727
+ const figures = [];
27728
+ for (let sheetFigure of sheetFigures) {
27729
+ const figure = sheetFigure;
27691
27730
  if (figure && figure.tag === "chart") {
27692
- figure.data = this.getChartDefinition(sheet.id, figure.id);
27731
+ const data = (_a = this.charts[figure.id]) === null || _a === void 0 ? void 0 : _a.getDefinition();
27732
+ if (data) {
27733
+ figure.data = data;
27734
+ figures.push(figure);
27735
+ }
27736
+ }
27737
+ else {
27738
+ figures.push(figure);
27693
27739
  }
27694
27740
  }
27695
27741
  sheet.figures = figures;
@@ -27697,13 +27743,13 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
27697
27743
  }
27698
27744
  }
27699
27745
  exportForExcel(data) {
27700
- var _a, _b;
27746
+ var _a;
27701
27747
  for (let sheet of data.sheets) {
27702
27748
  const sheetFigures = this.getters.getFigures(sheet.id);
27703
27749
  const figures = [];
27704
27750
  for (let figure of sheetFigures) {
27705
27751
  if (figure && figure.tag === "chart") {
27706
- const figureData = (_b = (_a = this.charts[sheet.id]) === null || _a === void 0 ? void 0 : _a[figure.id]) === null || _b === void 0 ? void 0 : _b.getDefinitionForExcel();
27752
+ const figureData = (_a = this.charts[figure.id]) === null || _a === void 0 ? void 0 : _a.getDefinitionForExcel();
27707
27753
  if (figureData) {
27708
27754
  figures.push({
27709
27755
  ...figure,
@@ -27742,15 +27788,21 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
27742
27788
  * Add a chart in the local state. If a chart already exists, this chart is
27743
27789
  * replaced
27744
27790
  */
27745
- addChart(id, sheetId, definition) {
27746
- this.history.update("charts", sheetId, id, this.createChart(id, definition, sheetId));
27791
+ addChart(id, definition) {
27792
+ const sheetId = this.getters.getFigureSheetId(id);
27793
+ if (sheetId) {
27794
+ this.history.update("charts", id, this.createChart(id, definition, sheetId));
27795
+ }
27747
27796
  }
27748
27797
  checkChartDuplicate(cmd) {
27749
- var _a;
27750
- if ((_a = this.charts[cmd.sheetId]) === null || _a === void 0 ? void 0 : _a[cmd.id]) {
27751
- return 83 /* CommandResult.DuplicatedChartId */;
27752
- }
27753
- return 0 /* CommandResult.Success */;
27798
+ return this.getters.getFigureSheetId(cmd.id)
27799
+ ? 83 /* CommandResult.DuplicatedChartId */
27800
+ : 0 /* CommandResult.Success */;
27801
+ }
27802
+ checkChartExists(cmd) {
27803
+ return this.getters.getFigureSheetId(cmd.id)
27804
+ ? 0 /* CommandResult.Success */
27805
+ : 84 /* CommandResult.ChartDoesNotExist */;
27754
27806
  }
27755
27807
  }
27756
27808
  ChartPlugin.getters = [
@@ -28131,7 +28183,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28131
28183
  allowDispatch(cmd) {
28132
28184
  switch (cmd.type) {
28133
28185
  case "CREATE_FIGURE":
28134
- return this.checkFigureDuplicate(cmd.sheetId, cmd.figure.id);
28186
+ return this.checkFigureDuplicate(cmd.figure.id);
28135
28187
  case "UPDATE_FIGURE":
28136
28188
  case "DELETE_FIGURE":
28137
28189
  return this.checkFigureExists(cmd.sheetId, cmd.id);
@@ -28197,9 +28249,8 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28197
28249
  }
28198
28250
  return 0 /* CommandResult.Success */;
28199
28251
  }
28200
- checkFigureDuplicate(sheetId, figureId) {
28201
- var _a;
28202
- if ((_a = this.figures[sheetId]) === null || _a === void 0 ? void 0 : _a[figureId]) {
28252
+ checkFigureDuplicate(figureId) {
28253
+ if (Object.values(this.figures).find((sheet) => sheet === null || sheet === void 0 ? void 0 : sheet[figureId])) {
28203
28254
  return 81 /* CommandResult.DuplicatedFigureId */;
28204
28255
  }
28205
28256
  return 0 /* CommandResult.Success */;
@@ -28214,6 +28265,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28214
28265
  var _a;
28215
28266
  return (_a = this.figures[sheetId]) === null || _a === void 0 ? void 0 : _a[figureId];
28216
28267
  }
28268
+ getFigureSheetId(figureId) {
28269
+ return Object.keys(this.figures).find((sheetId) => { var _a; return ((_a = this.figures[sheetId]) === null || _a === void 0 ? void 0 : _a[figureId]) !== undefined; });
28270
+ }
28217
28271
  // ---------------------------------------------------------------------------
28218
28272
  // Import/Export
28219
28273
  // ---------------------------------------------------------------------------
@@ -28238,7 +28292,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28238
28292
  this.export(data);
28239
28293
  }
28240
28294
  }
28241
- FigurePlugin.getters = ["getFigures", "getFigure"];
28295
+ FigurePlugin.getters = ["getFigures", "getFigure", "getFigureSheetId"];
28242
28296
 
28243
28297
  class FilterTable {
28244
28298
  constructor(zone) {
@@ -31530,7 +31584,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
31530
31584
  throw new Error(`No figure for the given id: ${copiedFigureId}`);
31531
31585
  }
31532
31586
  this.copiedFigure = { ...figure };
31533
- const chart = getters.getChart(this.sheetId, copiedFigureId);
31587
+ const chart = getters.getChart(copiedFigureId);
31534
31588
  if (!chart) {
31535
31589
  throw new Error(`No chart for the given id: ${copiedFigureId}`);
31536
31590
  }
@@ -31982,9 +32036,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
31982
32036
  return formatColors.filter(isDefined$1);
31983
32037
  }
31984
32038
  getChartColors(sheetId) {
31985
- const charts = this.getters
31986
- .getChartIds(sheetId)
31987
- .map((cid) => this.getters.getChart(sheetId, cid));
32039
+ const charts = this.getters.getChartIds(sheetId).map((cid) => this.getters.getChart(cid));
31988
32040
  let chartsColors = new Set();
31989
32041
  for (let chart of charts) {
31990
32042
  if (chart === undefined) {
@@ -32251,37 +32303,34 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
32251
32303
  invalidateCFEvaluationCommands.has(cmd.type) ||
32252
32304
  cmd.type === "EVALUATE_CELLS" ||
32253
32305
  cmd.type === "UPDATE_CELL") {
32254
- for (const sheetId in this.charts) {
32255
- for (const chartId in this.charts[sheetId]) {
32256
- this.charts[sheetId][chartId] = undefined;
32257
- }
32306
+ for (const chartId in this.charts) {
32307
+ this.charts[chartId] = undefined;
32258
32308
  }
32259
32309
  }
32260
32310
  switch (cmd.type) {
32261
32311
  case "UPDATE_CHART":
32262
32312
  case "CREATE_CHART":
32263
32313
  case "DELETE_FIGURE":
32264
- if (this.charts[cmd.sheetId]) {
32265
- this.charts[cmd.sheetId][cmd.id] = undefined;
32266
- }
32314
+ this.charts[cmd.id] = undefined;
32267
32315
  break;
32268
32316
  case "DELETE_SHEET":
32269
- delete this.charts[cmd.sheetId];
32317
+ for (let chartId in this.charts) {
32318
+ if (!this.getters.isChartDefined(chartId)) {
32319
+ this.charts[chartId] = undefined;
32320
+ }
32321
+ }
32270
32322
  break;
32271
32323
  }
32272
32324
  }
32273
- getChartRuntime(sheetId, figureId) {
32274
- var _a;
32275
- if (!((_a = this.charts[sheetId]) === null || _a === void 0 ? void 0 : _a[figureId])) {
32276
- const chart = this.getters.getChart(sheetId, figureId);
32325
+ getChartRuntime(figureId) {
32326
+ if (!this.charts[figureId]) {
32327
+ const chart = this.getters.getChart(figureId);
32277
32328
  if (!chart) {
32278
32329
  throw new Error(`No chart for the given id: ${figureId}`);
32279
32330
  }
32280
- if (!this.charts[sheetId])
32281
- this.charts[sheetId] = {};
32282
- this.charts[sheetId][figureId] = this.createRuntimeChart(chart);
32331
+ this.charts[figureId] = this.createRuntimeChart(chart);
32283
32332
  }
32284
- return this.charts[sheetId][figureId];
32333
+ return this.charts[figureId];
32285
32334
  }
32286
32335
  /**
32287
32336
  * Get the background color of a chart based on the color of the first cell of the main range
@@ -42405,9 +42454,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
42405
42454
  Object.defineProperty(exports, '__esModule', { value: true });
42406
42455
 
42407
42456
 
42408
- __info__.version = '16.0.1';
42409
- __info__.date = '2023-03-01T14:43:41.736Z';
42410
- __info__.hash = '2ac9223';
42457
+ __info__.version = '16.0.2';
42458
+ __info__.date = '2023-03-06T07:17:51.313Z';
42459
+ __info__.hash = '6b4d816';
42411
42460
 
42412
42461
 
42413
42462
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);