@odoo/o-spreadsheet 16.1.12 → 16.1.13

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.
@@ -19943,7 +19943,7 @@ class LineBarPieConfigPanel extends owl.Component {
19943
19943
  return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(33 /* CommandResult.InvalidLabelRange */));
19944
19944
  }
19945
19945
  onUpdateDataSetsHaveTitle(ev) {
19946
- this.props.updateChart({
19946
+ this.props.updateChart(this.props.figureId, {
19947
19947
  dataSetsHaveTitle: ev.target.checked,
19948
19948
  });
19949
19949
  }
@@ -19955,7 +19955,7 @@ class LineBarPieConfigPanel extends owl.Component {
19955
19955
  this.dataSeriesRanges = ranges;
19956
19956
  }
19957
19957
  onDataSeriesConfirmed() {
19958
- this.state.datasetDispatchResult = this.props.updateChart({
19958
+ this.state.datasetDispatchResult = this.props.updateChart(this.props.figureId, {
19959
19959
  dataSets: this.dataSeriesRanges,
19960
19960
  });
19961
19961
  }
@@ -19967,12 +19967,12 @@ class LineBarPieConfigPanel extends owl.Component {
19967
19967
  this.labelRange = ranges[0];
19968
19968
  }
19969
19969
  onLabelRangeConfirmed() {
19970
- this.state.labelsDispatchResult = this.props.updateChart({
19970
+ this.state.labelsDispatchResult = this.props.updateChart(this.props.figureId, {
19971
19971
  labelRange: this.labelRange,
19972
19972
  });
19973
19973
  }
19974
19974
  onUpdateAggregated(ev) {
19975
- this.props.updateChart({
19975
+ this.props.updateChart(this.props.figureId, {
19976
19976
  aggregated: ev.target.checked,
19977
19977
  });
19978
19978
  }
@@ -19987,12 +19987,12 @@ LineBarPieConfigPanel.props = {
19987
19987
 
19988
19988
  class BarConfigPanel extends LineBarPieConfigPanel {
19989
19989
  onUpdateStacked(ev) {
19990
- this.props.updateChart({
19990
+ this.props.updateChart(this.props.figureId, {
19991
19991
  stacked: ev.target.checked,
19992
19992
  });
19993
19993
  }
19994
19994
  onUpdateAggregated(ev) {
19995
- this.props.updateChart({
19995
+ this.props.updateChart(this.props.figureId, {
19996
19996
  aggregated: ev.target.checked,
19997
19997
  });
19998
19998
  }
@@ -20270,17 +20270,17 @@ class LineBarPieDesignPanel extends owl.Component {
20270
20270
  this.state.fillColorTool = !this.state.fillColorTool;
20271
20271
  }
20272
20272
  updateBackgroundColor(color) {
20273
- this.props.updateChart({
20273
+ this.props.updateChart(this.props.figureId, {
20274
20274
  background: color,
20275
20275
  });
20276
20276
  }
20277
20277
  updateTitle(ev) {
20278
- this.props.updateChart({
20278
+ this.props.updateChart(this.props.figureId, {
20279
20279
  title: ev.target.value,
20280
20280
  });
20281
20281
  }
20282
20282
  updateSelect(attr, ev) {
20283
- this.props.updateChart({
20283
+ this.props.updateChart(this.props.figureId, {
20284
20284
  [attr]: ev.target.value,
20285
20285
  });
20286
20286
  }
@@ -20318,7 +20318,7 @@ class GaugeChartConfigPanel extends owl.Component {
20318
20318
  this.dataRange = ranges[0];
20319
20319
  }
20320
20320
  updateDataRange() {
20321
- this.state.dataRangeDispatchResult = this.props.updateChart({
20321
+ this.state.dataRangeDispatchResult = this.props.updateChart(this.props.figureId, {
20322
20322
  dataRange: this.dataRange,
20323
20323
  });
20324
20324
  }
@@ -20393,12 +20393,12 @@ class GaugeChartDesignPanel extends owl.Component {
20393
20393
  }
20394
20394
  updateBackgroundColor(color) {
20395
20395
  this.state.openedMenu = undefined;
20396
- this.props.updateChart({
20396
+ this.props.updateChart(this.props.figureId, {
20397
20397
  background: color,
20398
20398
  });
20399
20399
  }
20400
20400
  updateTitle(ev) {
20401
- this.props.updateChart({
20401
+ this.props.updateChart(this.props.figureId, {
20402
20402
  title: ev.target.value,
20403
20403
  });
20404
20404
  }
@@ -20467,7 +20467,7 @@ class GaugeChartDesignPanel extends owl.Component {
20467
20467
  }
20468
20468
  }
20469
20469
  updateSectionRule(sectionRule) {
20470
- this.state.sectionRuleDispatchResult = this.props.updateChart({
20470
+ this.state.sectionRuleDispatchResult = this.props.updateChart(this.props.figureId, {
20471
20471
  sectionRule,
20472
20472
  });
20473
20473
  }
@@ -20492,17 +20492,17 @@ class LineConfigPanel extends LineBarPieConfigPanel {
20492
20492
  return false;
20493
20493
  }
20494
20494
  onUpdateLabelsAsText(ev) {
20495
- this.props.updateChart({
20495
+ this.props.updateChart(this.props.figureId, {
20496
20496
  labelsAsText: ev.target.checked,
20497
20497
  });
20498
20498
  }
20499
20499
  onUpdateStacked(ev) {
20500
- this.props.updateChart({
20500
+ this.props.updateChart(this.props.figureId, {
20501
20501
  stacked: ev.target.checked,
20502
20502
  });
20503
20503
  }
20504
20504
  onUpdateAggregated(ev) {
20505
- this.props.updateChart({
20505
+ this.props.updateChart(this.props.figureId, {
20506
20506
  aggregated: ev.target.checked,
20507
20507
  });
20508
20508
  }
@@ -20543,7 +20543,7 @@ class ScorecardChartConfigPanel extends owl.Component {
20543
20543
  this.keyValue = ranges[0];
20544
20544
  }
20545
20545
  updateKeyValueRange() {
20546
- this.state.keyValueDispatchResult = this.props.updateChart({
20546
+ this.state.keyValueDispatchResult = this.props.updateChart(this.props.figureId, {
20547
20547
  keyValue: this.keyValue,
20548
20548
  });
20549
20549
  }
@@ -20551,12 +20551,12 @@ class ScorecardChartConfigPanel extends owl.Component {
20551
20551
  this.baseline = ranges[0];
20552
20552
  }
20553
20553
  updateBaselineRange() {
20554
- this.state.baselineDispatchResult = this.props.updateChart({
20554
+ this.state.baselineDispatchResult = this.props.updateChart(this.props.figureId, {
20555
20555
  baseline: this.baseline,
20556
20556
  });
20557
20557
  }
20558
20558
  updateBaselineMode(ev) {
20559
- this.props.updateChart({ baselineMode: ev.target.value });
20559
+ this.props.updateChart(this.props.figureId, { baselineMode: ev.target.value });
20560
20560
  }
20561
20561
  }
20562
20562
  ScorecardChartConfigPanel.template = "o-spreadsheet-ScorecardChartConfigPanel";
@@ -20581,12 +20581,12 @@ class ScorecardChartDesignPanel extends owl.Component {
20581
20581
  owl.useExternalListener(window, "click", this.onClick);
20582
20582
  }
20583
20583
  updateTitle(ev) {
20584
- this.props.updateChart({
20584
+ this.props.updateChart(this.props.figureId, {
20585
20585
  title: ev.target.value,
20586
20586
  });
20587
20587
  }
20588
20588
  updateBaselineDescr(ev) {
20589
- this.props.updateChart({ baselineDescr: ev.target.value });
20589
+ this.props.updateChart(this.props.figureId, { baselineDescr: ev.target.value });
20590
20590
  }
20591
20591
  openColorPicker(colorPickerId) {
20592
20592
  this.state.openedColorPicker = colorPickerId;
@@ -20594,13 +20594,13 @@ class ScorecardChartDesignPanel extends owl.Component {
20594
20594
  setColor(color, colorPickerId) {
20595
20595
  switch (colorPickerId) {
20596
20596
  case "backgroundColor":
20597
- this.props.updateChart({ background: color });
20597
+ this.props.updateChart(this.props.figureId, { background: color });
20598
20598
  break;
20599
20599
  case "baselineColorDown":
20600
- this.props.updateChart({ baselineColorDown: color });
20600
+ this.props.updateChart(this.props.figureId, { baselineColorDown: color });
20601
20601
  break;
20602
20602
  case "baselineColorUp":
20603
- this.props.updateChart({ baselineColorUp: color });
20603
+ this.props.updateChart(this.props.figureId, { baselineColorUp: color });
20604
20604
  break;
20605
20605
  }
20606
20606
  this.state.openedColorPicker = undefined;
@@ -20669,16 +20669,9 @@ css /* scss */ `
20669
20669
  }
20670
20670
  `;
20671
20671
  class ChartPanel extends owl.Component {
20672
- constructor() {
20673
- super(...arguments);
20674
- this.shouldUpdateChart = true;
20675
- }
20676
20672
  get figureId() {
20677
20673
  return this.state.figureId;
20678
20674
  }
20679
- get sheetId() {
20680
- return this.state.sheetId;
20681
- }
20682
20675
  setup() {
20683
20676
  const selectedFigureId = this.env.model.getters.getSelectedFigureId();
20684
20677
  if (!selectedFigureId) {
@@ -20687,17 +20680,11 @@ class ChartPanel extends owl.Component {
20687
20680
  this.state = owl.useState({
20688
20681
  panel: "configuration",
20689
20682
  figureId: selectedFigureId,
20690
- sheetId: this.env.model.getters.getActiveSheetId(),
20691
20683
  });
20692
20684
  owl.onWillUpdateProps(() => {
20693
20685
  const selectedFigureId = this.env.model.getters.getSelectedFigureId();
20694
20686
  if (selectedFigureId && selectedFigureId !== this.state.figureId) {
20695
20687
  this.state.figureId = selectedFigureId;
20696
- this.state.sheetId = this.env.model.getters.getActiveSheetId();
20697
- this.shouldUpdateChart = false;
20698
- }
20699
- else {
20700
- this.shouldUpdateChart = true;
20701
20688
  }
20702
20689
  if (!this.env.model.getters.isChartDefined(this.figureId)) {
20703
20690
  this.props.onCloseSidePanel();
@@ -20705,8 +20692,8 @@ class ChartPanel extends owl.Component {
20705
20692
  }
20706
20693
  });
20707
20694
  }
20708
- updateChart(updateDefinition) {
20709
- if (!this.shouldUpdateChart) {
20695
+ updateChart(figureId, updateDefinition) {
20696
+ if (figureId !== this.figureId) {
20710
20697
  return;
20711
20698
  }
20712
20699
  const definition = {
@@ -20715,8 +20702,8 @@ class ChartPanel extends owl.Component {
20715
20702
  };
20716
20703
  return this.env.model.dispatch("UPDATE_CHART", {
20717
20704
  definition,
20718
- id: this.figureId,
20719
- sheetId: this.sheetId,
20705
+ id: figureId,
20706
+ sheetId: this.env.model.getters.getFigureSheetId(figureId),
20720
20707
  });
20721
20708
  }
20722
20709
  onTypeChange(type) {
@@ -20728,7 +20715,7 @@ class ChartPanel extends owl.Component {
20728
20715
  this.env.model.dispatch("UPDATE_CHART", {
20729
20716
  definition,
20730
20717
  id: this.figureId,
20731
- sheetId: this.sheetId,
20718
+ sheetId: this.env.model.getters.getFigureSheetId(this.figureId),
20732
20719
  });
20733
20720
  }
20734
20721
  get chartPanel() {
@@ -44271,6 +44258,6 @@ exports.setTranslationMethod = setTranslationMethod;
44271
44258
  exports.tokenize = tokenize;
44272
44259
 
44273
44260
 
44274
- __info__.version = '16.1.12';
44275
- __info__.date = '2023-05-25T12:56:29.735Z';
44276
- __info__.hash = 'b80dc51';
44261
+ __info__.version = '16.1.13';
44262
+ __info__.date = '2023-06-02T10:12:21.173Z';
44263
+ __info__.hash = '5386a5b';
@@ -5025,7 +5025,7 @@ declare class SelectionInput extends Component<Props$x, SpreadsheetChildEnv> {
5025
5025
  interface Props$w {
5026
5026
  figureId: UID;
5027
5027
  definition: LineChartDefinition | BarChartDefinition | PieChartDefinition;
5028
- updateChart: (definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
5028
+ updateChart: (figureId: UID, definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => DispatchResult;
5029
5029
  }
5030
5030
  declare class LineBarPieConfigPanel extends Component<Props$w, SpreadsheetChildEnv> {
5031
5031
  static template: string;
@@ -5091,7 +5091,7 @@ declare class ColorPicker extends Component<ColorPickerProps, SpreadsheetChildEn
5091
5091
  interface Props$v {
5092
5092
  figureId: UID;
5093
5093
  definition: LineChartDefinition | BarChartDefinition | PieChartDefinition;
5094
- updateChart: (definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => CommandResult | CommandResult[];
5094
+ updateChart: (figureId: UID, definition: Partial<LineChartDefinition | BarChartDefinition | PieChartDefinition>) => CommandResult | CommandResult[];
5095
5095
  }
5096
5096
  declare class LineBarPieDesignPanel extends Component<Props$v, SpreadsheetChildEnv> {
5097
5097
  static template: string;
@@ -5110,7 +5110,7 @@ declare class LineBarPieDesignPanel extends Component<Props$v, SpreadsheetChildE
5110
5110
  interface Props$u {
5111
5111
  figureId: UID;
5112
5112
  definition: GaugeChartDefinition;
5113
- updateChart: (definition: Partial<GaugeChartDefinition>) => DispatchResult;
5113
+ updateChart: (figureId: UID, definition: Partial<GaugeChartDefinition>) => DispatchResult;
5114
5114
  }
5115
5115
  declare class GaugeChartConfigPanel extends Component<Props$u, SpreadsheetChildEnv> {
5116
5116
  static template: string;
@@ -5129,7 +5129,7 @@ declare type GaugeMenu = "backgroundColor" | "sectionColor-lowerColor" | "sectio
5129
5129
  interface Props$t {
5130
5130
  figureId: UID;
5131
5131
  definition: GaugeChartDefinition;
5132
- updateChart: (definition: Partial<GaugeChartDefinition>) => DispatchResult;
5132
+ updateChart: (figureId: UID, definition: Partial<GaugeChartDefinition>) => DispatchResult;
5133
5133
  }
5134
5134
  declare class GaugeChartDesignPanel extends Component<Props$t, SpreadsheetChildEnv> {
5135
5135
  static template: string;
@@ -5167,7 +5167,7 @@ declare class LineConfigPanel extends LineBarPieConfigPanel {
5167
5167
  interface Props$s {
5168
5168
  figureId: UID;
5169
5169
  definition: ScorecardChartDefinition;
5170
- updateChart: (definition: Partial<ScorecardChartDefinition>) => DispatchResult;
5170
+ updateChart: (figureId: UID, definition: Partial<ScorecardChartDefinition>) => DispatchResult;
5171
5171
  }
5172
5172
  declare class ScorecardChartConfigPanel extends Component<Props$s, SpreadsheetChildEnv> {
5173
5173
  static template: string;
@@ -5191,7 +5191,7 @@ declare type ColorPickerId = undefined | "backgroundColor" | "baselineColorUp" |
5191
5191
  interface Props$r {
5192
5192
  figureId: UID;
5193
5193
  definition: ScorecardChartDefinition;
5194
- updateChart: (definition: Partial<ScorecardChartDefinition>) => DispatchResult;
5194
+ updateChart: (figureId: UID, definition: Partial<ScorecardChartDefinition>) => DispatchResult;
5195
5195
  }
5196
5196
  declare class ScorecardChartDesignPanel extends Component<Props$r, SpreadsheetChildEnv> {
5197
5197
  static template: string;
@@ -6462,11 +6462,9 @@ interface Props {
6462
6462
  declare class ChartPanel extends Component<Props, SpreadsheetChildEnv> {
6463
6463
  static template: string;
6464
6464
  private state;
6465
- private shouldUpdateChart;
6466
6465
  get figureId(): UID;
6467
- get sheetId(): UID;
6468
6466
  setup(): void;
6469
- updateChart<T extends ChartDefinition>(updateDefinition: Partial<T>): DispatchResult | undefined;
6467
+ updateChart<T extends ChartDefinition>(figureId: UID, updateDefinition: Partial<T>): DispatchResult | undefined;
6470
6468
  onTypeChange(type: ChartType): void;
6471
6469
  get chartPanel(): ChartSidePanel;
6472
6470
  private getChartDefinition;
@@ -19939,7 +19939,7 @@ class LineBarPieConfigPanel extends Component {
19939
19939
  return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(33 /* CommandResult.InvalidLabelRange */));
19940
19940
  }
19941
19941
  onUpdateDataSetsHaveTitle(ev) {
19942
- this.props.updateChart({
19942
+ this.props.updateChart(this.props.figureId, {
19943
19943
  dataSetsHaveTitle: ev.target.checked,
19944
19944
  });
19945
19945
  }
@@ -19951,7 +19951,7 @@ class LineBarPieConfigPanel extends Component {
19951
19951
  this.dataSeriesRanges = ranges;
19952
19952
  }
19953
19953
  onDataSeriesConfirmed() {
19954
- this.state.datasetDispatchResult = this.props.updateChart({
19954
+ this.state.datasetDispatchResult = this.props.updateChart(this.props.figureId, {
19955
19955
  dataSets: this.dataSeriesRanges,
19956
19956
  });
19957
19957
  }
@@ -19963,12 +19963,12 @@ class LineBarPieConfigPanel extends Component {
19963
19963
  this.labelRange = ranges[0];
19964
19964
  }
19965
19965
  onLabelRangeConfirmed() {
19966
- this.state.labelsDispatchResult = this.props.updateChart({
19966
+ this.state.labelsDispatchResult = this.props.updateChart(this.props.figureId, {
19967
19967
  labelRange: this.labelRange,
19968
19968
  });
19969
19969
  }
19970
19970
  onUpdateAggregated(ev) {
19971
- this.props.updateChart({
19971
+ this.props.updateChart(this.props.figureId, {
19972
19972
  aggregated: ev.target.checked,
19973
19973
  });
19974
19974
  }
@@ -19983,12 +19983,12 @@ LineBarPieConfigPanel.props = {
19983
19983
 
19984
19984
  class BarConfigPanel extends LineBarPieConfigPanel {
19985
19985
  onUpdateStacked(ev) {
19986
- this.props.updateChart({
19986
+ this.props.updateChart(this.props.figureId, {
19987
19987
  stacked: ev.target.checked,
19988
19988
  });
19989
19989
  }
19990
19990
  onUpdateAggregated(ev) {
19991
- this.props.updateChart({
19991
+ this.props.updateChart(this.props.figureId, {
19992
19992
  aggregated: ev.target.checked,
19993
19993
  });
19994
19994
  }
@@ -20266,17 +20266,17 @@ class LineBarPieDesignPanel extends Component {
20266
20266
  this.state.fillColorTool = !this.state.fillColorTool;
20267
20267
  }
20268
20268
  updateBackgroundColor(color) {
20269
- this.props.updateChart({
20269
+ this.props.updateChart(this.props.figureId, {
20270
20270
  background: color,
20271
20271
  });
20272
20272
  }
20273
20273
  updateTitle(ev) {
20274
- this.props.updateChart({
20274
+ this.props.updateChart(this.props.figureId, {
20275
20275
  title: ev.target.value,
20276
20276
  });
20277
20277
  }
20278
20278
  updateSelect(attr, ev) {
20279
- this.props.updateChart({
20279
+ this.props.updateChart(this.props.figureId, {
20280
20280
  [attr]: ev.target.value,
20281
20281
  });
20282
20282
  }
@@ -20314,7 +20314,7 @@ class GaugeChartConfigPanel extends Component {
20314
20314
  this.dataRange = ranges[0];
20315
20315
  }
20316
20316
  updateDataRange() {
20317
- this.state.dataRangeDispatchResult = this.props.updateChart({
20317
+ this.state.dataRangeDispatchResult = this.props.updateChart(this.props.figureId, {
20318
20318
  dataRange: this.dataRange,
20319
20319
  });
20320
20320
  }
@@ -20389,12 +20389,12 @@ class GaugeChartDesignPanel extends Component {
20389
20389
  }
20390
20390
  updateBackgroundColor(color) {
20391
20391
  this.state.openedMenu = undefined;
20392
- this.props.updateChart({
20392
+ this.props.updateChart(this.props.figureId, {
20393
20393
  background: color,
20394
20394
  });
20395
20395
  }
20396
20396
  updateTitle(ev) {
20397
- this.props.updateChart({
20397
+ this.props.updateChart(this.props.figureId, {
20398
20398
  title: ev.target.value,
20399
20399
  });
20400
20400
  }
@@ -20463,7 +20463,7 @@ class GaugeChartDesignPanel extends Component {
20463
20463
  }
20464
20464
  }
20465
20465
  updateSectionRule(sectionRule) {
20466
- this.state.sectionRuleDispatchResult = this.props.updateChart({
20466
+ this.state.sectionRuleDispatchResult = this.props.updateChart(this.props.figureId, {
20467
20467
  sectionRule,
20468
20468
  });
20469
20469
  }
@@ -20488,17 +20488,17 @@ class LineConfigPanel extends LineBarPieConfigPanel {
20488
20488
  return false;
20489
20489
  }
20490
20490
  onUpdateLabelsAsText(ev) {
20491
- this.props.updateChart({
20491
+ this.props.updateChart(this.props.figureId, {
20492
20492
  labelsAsText: ev.target.checked,
20493
20493
  });
20494
20494
  }
20495
20495
  onUpdateStacked(ev) {
20496
- this.props.updateChart({
20496
+ this.props.updateChart(this.props.figureId, {
20497
20497
  stacked: ev.target.checked,
20498
20498
  });
20499
20499
  }
20500
20500
  onUpdateAggregated(ev) {
20501
- this.props.updateChart({
20501
+ this.props.updateChart(this.props.figureId, {
20502
20502
  aggregated: ev.target.checked,
20503
20503
  });
20504
20504
  }
@@ -20539,7 +20539,7 @@ class ScorecardChartConfigPanel extends Component {
20539
20539
  this.keyValue = ranges[0];
20540
20540
  }
20541
20541
  updateKeyValueRange() {
20542
- this.state.keyValueDispatchResult = this.props.updateChart({
20542
+ this.state.keyValueDispatchResult = this.props.updateChart(this.props.figureId, {
20543
20543
  keyValue: this.keyValue,
20544
20544
  });
20545
20545
  }
@@ -20547,12 +20547,12 @@ class ScorecardChartConfigPanel extends Component {
20547
20547
  this.baseline = ranges[0];
20548
20548
  }
20549
20549
  updateBaselineRange() {
20550
- this.state.baselineDispatchResult = this.props.updateChart({
20550
+ this.state.baselineDispatchResult = this.props.updateChart(this.props.figureId, {
20551
20551
  baseline: this.baseline,
20552
20552
  });
20553
20553
  }
20554
20554
  updateBaselineMode(ev) {
20555
- this.props.updateChart({ baselineMode: ev.target.value });
20555
+ this.props.updateChart(this.props.figureId, { baselineMode: ev.target.value });
20556
20556
  }
20557
20557
  }
20558
20558
  ScorecardChartConfigPanel.template = "o-spreadsheet-ScorecardChartConfigPanel";
@@ -20577,12 +20577,12 @@ class ScorecardChartDesignPanel extends Component {
20577
20577
  useExternalListener(window, "click", this.onClick);
20578
20578
  }
20579
20579
  updateTitle(ev) {
20580
- this.props.updateChart({
20580
+ this.props.updateChart(this.props.figureId, {
20581
20581
  title: ev.target.value,
20582
20582
  });
20583
20583
  }
20584
20584
  updateBaselineDescr(ev) {
20585
- this.props.updateChart({ baselineDescr: ev.target.value });
20585
+ this.props.updateChart(this.props.figureId, { baselineDescr: ev.target.value });
20586
20586
  }
20587
20587
  openColorPicker(colorPickerId) {
20588
20588
  this.state.openedColorPicker = colorPickerId;
@@ -20590,13 +20590,13 @@ class ScorecardChartDesignPanel extends Component {
20590
20590
  setColor(color, colorPickerId) {
20591
20591
  switch (colorPickerId) {
20592
20592
  case "backgroundColor":
20593
- this.props.updateChart({ background: color });
20593
+ this.props.updateChart(this.props.figureId, { background: color });
20594
20594
  break;
20595
20595
  case "baselineColorDown":
20596
- this.props.updateChart({ baselineColorDown: color });
20596
+ this.props.updateChart(this.props.figureId, { baselineColorDown: color });
20597
20597
  break;
20598
20598
  case "baselineColorUp":
20599
- this.props.updateChart({ baselineColorUp: color });
20599
+ this.props.updateChart(this.props.figureId, { baselineColorUp: color });
20600
20600
  break;
20601
20601
  }
20602
20602
  this.state.openedColorPicker = undefined;
@@ -20665,16 +20665,9 @@ css /* scss */ `
20665
20665
  }
20666
20666
  `;
20667
20667
  class ChartPanel extends Component {
20668
- constructor() {
20669
- super(...arguments);
20670
- this.shouldUpdateChart = true;
20671
- }
20672
20668
  get figureId() {
20673
20669
  return this.state.figureId;
20674
20670
  }
20675
- get sheetId() {
20676
- return this.state.sheetId;
20677
- }
20678
20671
  setup() {
20679
20672
  const selectedFigureId = this.env.model.getters.getSelectedFigureId();
20680
20673
  if (!selectedFigureId) {
@@ -20683,17 +20676,11 @@ class ChartPanel extends Component {
20683
20676
  this.state = useState({
20684
20677
  panel: "configuration",
20685
20678
  figureId: selectedFigureId,
20686
- sheetId: this.env.model.getters.getActiveSheetId(),
20687
20679
  });
20688
20680
  onWillUpdateProps(() => {
20689
20681
  const selectedFigureId = this.env.model.getters.getSelectedFigureId();
20690
20682
  if (selectedFigureId && selectedFigureId !== this.state.figureId) {
20691
20683
  this.state.figureId = selectedFigureId;
20692
- this.state.sheetId = this.env.model.getters.getActiveSheetId();
20693
- this.shouldUpdateChart = false;
20694
- }
20695
- else {
20696
- this.shouldUpdateChart = true;
20697
20684
  }
20698
20685
  if (!this.env.model.getters.isChartDefined(this.figureId)) {
20699
20686
  this.props.onCloseSidePanel();
@@ -20701,8 +20688,8 @@ class ChartPanel extends Component {
20701
20688
  }
20702
20689
  });
20703
20690
  }
20704
- updateChart(updateDefinition) {
20705
- if (!this.shouldUpdateChart) {
20691
+ updateChart(figureId, updateDefinition) {
20692
+ if (figureId !== this.figureId) {
20706
20693
  return;
20707
20694
  }
20708
20695
  const definition = {
@@ -20711,8 +20698,8 @@ class ChartPanel extends Component {
20711
20698
  };
20712
20699
  return this.env.model.dispatch("UPDATE_CHART", {
20713
20700
  definition,
20714
- id: this.figureId,
20715
- sheetId: this.sheetId,
20701
+ id: figureId,
20702
+ sheetId: this.env.model.getters.getFigureSheetId(figureId),
20716
20703
  });
20717
20704
  }
20718
20705
  onTypeChange(type) {
@@ -20724,7 +20711,7 @@ class ChartPanel extends Component {
20724
20711
  this.env.model.dispatch("UPDATE_CHART", {
20725
20712
  definition,
20726
20713
  id: this.figureId,
20727
- sheetId: this.sheetId,
20714
+ sheetId: this.env.model.getters.getFigureSheetId(this.figureId),
20728
20715
  });
20729
20716
  }
20730
20717
  get chartPanel() {
@@ -44239,6 +44226,6 @@ function addFunction(functionName, functionDescription) {
44239
44226
  export { AbstractChart, CommandResult, CorePlugin, DATETIME_FORMAT, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, links, load, parse, readonlyAllowedCommands, registries, setTranslationMethod, tokenize };
44240
44227
 
44241
44228
 
44242
- __info__.version = '16.1.12';
44243
- __info__.date = '2023-05-25T12:56:29.735Z';
44244
- __info__.hash = 'b80dc51';
44229
+ __info__.version = '16.1.13';
44230
+ __info__.date = '2023-06-02T10:12:21.173Z';
44231
+ __info__.hash = '5386a5b';
@@ -19940,7 +19940,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
19940
19940
  return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(33 /* CommandResult.InvalidLabelRange */));
19941
19941
  }
19942
19942
  onUpdateDataSetsHaveTitle(ev) {
19943
- this.props.updateChart({
19943
+ this.props.updateChart(this.props.figureId, {
19944
19944
  dataSetsHaveTitle: ev.target.checked,
19945
19945
  });
19946
19946
  }
@@ -19952,7 +19952,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
19952
19952
  this.dataSeriesRanges = ranges;
19953
19953
  }
19954
19954
  onDataSeriesConfirmed() {
19955
- this.state.datasetDispatchResult = this.props.updateChart({
19955
+ this.state.datasetDispatchResult = this.props.updateChart(this.props.figureId, {
19956
19956
  dataSets: this.dataSeriesRanges,
19957
19957
  });
19958
19958
  }
@@ -19964,12 +19964,12 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
19964
19964
  this.labelRange = ranges[0];
19965
19965
  }
19966
19966
  onLabelRangeConfirmed() {
19967
- this.state.labelsDispatchResult = this.props.updateChart({
19967
+ this.state.labelsDispatchResult = this.props.updateChart(this.props.figureId, {
19968
19968
  labelRange: this.labelRange,
19969
19969
  });
19970
19970
  }
19971
19971
  onUpdateAggregated(ev) {
19972
- this.props.updateChart({
19972
+ this.props.updateChart(this.props.figureId, {
19973
19973
  aggregated: ev.target.checked,
19974
19974
  });
19975
19975
  }
@@ -19984,12 +19984,12 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
19984
19984
 
19985
19985
  class BarConfigPanel extends LineBarPieConfigPanel {
19986
19986
  onUpdateStacked(ev) {
19987
- this.props.updateChart({
19987
+ this.props.updateChart(this.props.figureId, {
19988
19988
  stacked: ev.target.checked,
19989
19989
  });
19990
19990
  }
19991
19991
  onUpdateAggregated(ev) {
19992
- this.props.updateChart({
19992
+ this.props.updateChart(this.props.figureId, {
19993
19993
  aggregated: ev.target.checked,
19994
19994
  });
19995
19995
  }
@@ -20267,17 +20267,17 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20267
20267
  this.state.fillColorTool = !this.state.fillColorTool;
20268
20268
  }
20269
20269
  updateBackgroundColor(color) {
20270
- this.props.updateChart({
20270
+ this.props.updateChart(this.props.figureId, {
20271
20271
  background: color,
20272
20272
  });
20273
20273
  }
20274
20274
  updateTitle(ev) {
20275
- this.props.updateChart({
20275
+ this.props.updateChart(this.props.figureId, {
20276
20276
  title: ev.target.value,
20277
20277
  });
20278
20278
  }
20279
20279
  updateSelect(attr, ev) {
20280
- this.props.updateChart({
20280
+ this.props.updateChart(this.props.figureId, {
20281
20281
  [attr]: ev.target.value,
20282
20282
  });
20283
20283
  }
@@ -20315,7 +20315,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20315
20315
  this.dataRange = ranges[0];
20316
20316
  }
20317
20317
  updateDataRange() {
20318
- this.state.dataRangeDispatchResult = this.props.updateChart({
20318
+ this.state.dataRangeDispatchResult = this.props.updateChart(this.props.figureId, {
20319
20319
  dataRange: this.dataRange,
20320
20320
  });
20321
20321
  }
@@ -20390,12 +20390,12 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20390
20390
  }
20391
20391
  updateBackgroundColor(color) {
20392
20392
  this.state.openedMenu = undefined;
20393
- this.props.updateChart({
20393
+ this.props.updateChart(this.props.figureId, {
20394
20394
  background: color,
20395
20395
  });
20396
20396
  }
20397
20397
  updateTitle(ev) {
20398
- this.props.updateChart({
20398
+ this.props.updateChart(this.props.figureId, {
20399
20399
  title: ev.target.value,
20400
20400
  });
20401
20401
  }
@@ -20464,7 +20464,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20464
20464
  }
20465
20465
  }
20466
20466
  updateSectionRule(sectionRule) {
20467
- this.state.sectionRuleDispatchResult = this.props.updateChart({
20467
+ this.state.sectionRuleDispatchResult = this.props.updateChart(this.props.figureId, {
20468
20468
  sectionRule,
20469
20469
  });
20470
20470
  }
@@ -20489,17 +20489,17 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20489
20489
  return false;
20490
20490
  }
20491
20491
  onUpdateLabelsAsText(ev) {
20492
- this.props.updateChart({
20492
+ this.props.updateChart(this.props.figureId, {
20493
20493
  labelsAsText: ev.target.checked,
20494
20494
  });
20495
20495
  }
20496
20496
  onUpdateStacked(ev) {
20497
- this.props.updateChart({
20497
+ this.props.updateChart(this.props.figureId, {
20498
20498
  stacked: ev.target.checked,
20499
20499
  });
20500
20500
  }
20501
20501
  onUpdateAggregated(ev) {
20502
- this.props.updateChart({
20502
+ this.props.updateChart(this.props.figureId, {
20503
20503
  aggregated: ev.target.checked,
20504
20504
  });
20505
20505
  }
@@ -20540,7 +20540,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20540
20540
  this.keyValue = ranges[0];
20541
20541
  }
20542
20542
  updateKeyValueRange() {
20543
- this.state.keyValueDispatchResult = this.props.updateChart({
20543
+ this.state.keyValueDispatchResult = this.props.updateChart(this.props.figureId, {
20544
20544
  keyValue: this.keyValue,
20545
20545
  });
20546
20546
  }
@@ -20548,12 +20548,12 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20548
20548
  this.baseline = ranges[0];
20549
20549
  }
20550
20550
  updateBaselineRange() {
20551
- this.state.baselineDispatchResult = this.props.updateChart({
20551
+ this.state.baselineDispatchResult = this.props.updateChart(this.props.figureId, {
20552
20552
  baseline: this.baseline,
20553
20553
  });
20554
20554
  }
20555
20555
  updateBaselineMode(ev) {
20556
- this.props.updateChart({ baselineMode: ev.target.value });
20556
+ this.props.updateChart(this.props.figureId, { baselineMode: ev.target.value });
20557
20557
  }
20558
20558
  }
20559
20559
  ScorecardChartConfigPanel.template = "o-spreadsheet-ScorecardChartConfigPanel";
@@ -20578,12 +20578,12 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20578
20578
  owl.useExternalListener(window, "click", this.onClick);
20579
20579
  }
20580
20580
  updateTitle(ev) {
20581
- this.props.updateChart({
20581
+ this.props.updateChart(this.props.figureId, {
20582
20582
  title: ev.target.value,
20583
20583
  });
20584
20584
  }
20585
20585
  updateBaselineDescr(ev) {
20586
- this.props.updateChart({ baselineDescr: ev.target.value });
20586
+ this.props.updateChart(this.props.figureId, { baselineDescr: ev.target.value });
20587
20587
  }
20588
20588
  openColorPicker(colorPickerId) {
20589
20589
  this.state.openedColorPicker = colorPickerId;
@@ -20591,13 +20591,13 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20591
20591
  setColor(color, colorPickerId) {
20592
20592
  switch (colorPickerId) {
20593
20593
  case "backgroundColor":
20594
- this.props.updateChart({ background: color });
20594
+ this.props.updateChart(this.props.figureId, { background: color });
20595
20595
  break;
20596
20596
  case "baselineColorDown":
20597
- this.props.updateChart({ baselineColorDown: color });
20597
+ this.props.updateChart(this.props.figureId, { baselineColorDown: color });
20598
20598
  break;
20599
20599
  case "baselineColorUp":
20600
- this.props.updateChart({ baselineColorUp: color });
20600
+ this.props.updateChart(this.props.figureId, { baselineColorUp: color });
20601
20601
  break;
20602
20602
  }
20603
20603
  this.state.openedColorPicker = undefined;
@@ -20666,16 +20666,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20666
20666
  }
20667
20667
  `;
20668
20668
  class ChartPanel extends owl.Component {
20669
- constructor() {
20670
- super(...arguments);
20671
- this.shouldUpdateChart = true;
20672
- }
20673
20669
  get figureId() {
20674
20670
  return this.state.figureId;
20675
20671
  }
20676
- get sheetId() {
20677
- return this.state.sheetId;
20678
- }
20679
20672
  setup() {
20680
20673
  const selectedFigureId = this.env.model.getters.getSelectedFigureId();
20681
20674
  if (!selectedFigureId) {
@@ -20684,17 +20677,11 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20684
20677
  this.state = owl.useState({
20685
20678
  panel: "configuration",
20686
20679
  figureId: selectedFigureId,
20687
- sheetId: this.env.model.getters.getActiveSheetId(),
20688
20680
  });
20689
20681
  owl.onWillUpdateProps(() => {
20690
20682
  const selectedFigureId = this.env.model.getters.getSelectedFigureId();
20691
20683
  if (selectedFigureId && selectedFigureId !== this.state.figureId) {
20692
20684
  this.state.figureId = selectedFigureId;
20693
- this.state.sheetId = this.env.model.getters.getActiveSheetId();
20694
- this.shouldUpdateChart = false;
20695
- }
20696
- else {
20697
- this.shouldUpdateChart = true;
20698
20685
  }
20699
20686
  if (!this.env.model.getters.isChartDefined(this.figureId)) {
20700
20687
  this.props.onCloseSidePanel();
@@ -20702,8 +20689,8 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20702
20689
  }
20703
20690
  });
20704
20691
  }
20705
- updateChart(updateDefinition) {
20706
- if (!this.shouldUpdateChart) {
20692
+ updateChart(figureId, updateDefinition) {
20693
+ if (figureId !== this.figureId) {
20707
20694
  return;
20708
20695
  }
20709
20696
  const definition = {
@@ -20712,8 +20699,8 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20712
20699
  };
20713
20700
  return this.env.model.dispatch("UPDATE_CHART", {
20714
20701
  definition,
20715
- id: this.figureId,
20716
- sheetId: this.sheetId,
20702
+ id: figureId,
20703
+ sheetId: this.env.model.getters.getFigureSheetId(figureId),
20717
20704
  });
20718
20705
  }
20719
20706
  onTypeChange(type) {
@@ -20725,7 +20712,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20725
20712
  this.env.model.dispatch("UPDATE_CHART", {
20726
20713
  definition,
20727
20714
  id: this.figureId,
20728
- sheetId: this.sheetId,
20715
+ sheetId: this.env.model.getters.getFigureSheetId(this.figureId),
20729
20716
  });
20730
20717
  }
20731
20718
  get chartPanel() {
@@ -44270,9 +44257,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
44270
44257
  Object.defineProperty(exports, '__esModule', { value: true });
44271
44258
 
44272
44259
 
44273
- __info__.version = '16.1.12';
44274
- __info__.date = '2023-05-25T12:56:29.735Z';
44275
- __info__.hash = 'b80dc51';
44260
+ __info__.version = '16.1.13';
44261
+ __info__.date = '2023-06-02T10:12:21.173Z';
44262
+ __info__.hash = '5386a5b';
44276
44263
 
44277
44264
 
44278
44265
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
@@ -585,7 +585,7 @@
585
585
  font-size: calc(100% + 4px);
586
586
  }
587
587
  }
588
- `;class Qg extends t.Component{constructor(){super(...arguments),this.id=Kg.uuidv4(),this.previousRanges=this.props.ranges||[],this.originSheet=this.env.model.getters.getActiveSheetId(),this.state=t.useState({isMissing:!1,mode:"select-range"})}get ranges(){const e=this.env.model.getters.getSelectionInput(this.id);return(e.length?e:this.props.ranges?this.props.ranges.map(((e,t)=>({xc:e,id:t.toString(),isFocused:!1}))):[]).map((e=>({...e,isValidRange:""===e.xc||this.env.model.getters.isRangeValid(e.xc)})))}get hasFocus(){return this.ranges.filter((e=>e.isFocused)).length>0}get canAddRange(){return!this.props.hasSingleRange}get isInvalid(){return this.props.isInvalid||this.state.isMissing}setup(){t.onMounted((()=>this.enableNewSelectionInput())),t.onWillUnmount((async()=>this.disableNewSelectionInput())),t.onPatched((()=>this.checkChange()))}enableNewSelectionInput(){this.env.model.dispatch("ENABLE_NEW_SELECTION_INPUT",{id:this.id,initialRanges:this.props.ranges,hasSingleRange:this.props.hasSingleRange})}disableNewSelectionInput(){this.env.model.dispatch("DISABLE_SELECTION_INPUT",{id:this.id})}checkChange(){const e=this.env.model.getters.getSelectionInputValue(this.id);this.previousRanges.join()!==e.join()&&this.triggerChange()}getColor(e){return"color: "+(e.color||"#000")+";"}triggerChange(){var e,t;const o=this.env.model.getters.getSelectionInputValue(this.id);null===(t=(e=this.props).onSelectionChanged)||void 0===t||t.call(e,o),this.previousRanges=o}onKeydown(e){"F2"===e.key?(e.preventDefault(),e.stopPropagation(),this.state.mode="select-range"===this.state.mode?"text-edit":"select-range"):e.key.startsWith("Arrow")&&(e.stopPropagation(),"select-range"===this.state.mode&&(e.preventDefault(),ju(e,this.env.model.selection)))}extractRanges(e){return this.props.hasSingleRange?e.split(",")[0]:e}focus(e){this.state.isMissing=!1,this.state.mode="select-range",this.env.model.dispatch("FOCUS_RANGE",{id:this.id,rangeId:e})}addEmptyInput(){this.env.model.dispatch("ADD_EMPTY_RANGE",{id:this.id})}removeInput(e){var t,o;this.env.model.dispatch("REMOVE_RANGE",{id:this.id,rangeId:e}),this.triggerChange(),null===(o=(t=this.props).onSelectionConfirmed)||void 0===o||o.call(t)}onInputChanged(e,t){const o=t.target,i=this.extractRanges(o.value);this.env.model.dispatch("CHANGE_RANGE",{id:this.id,rangeId:e,value:i}),o.blur(),this.triggerChange()}confirm(){var e,t;this.env.model.dispatch("UNFOCUS_SELECTION_INPUT");const o=this.env.model.getters.getSelectionInputValue(this.id);this.props.required&&0===o.length&&(this.state.isMissing=!0);const i=this.env.model.getters.getActiveSheetId();this.originSheet!==i&&this.env.model.dispatch("ACTIVATE_SHEET",{sheetIdFrom:i,sheetIdTo:this.originSheet}),null===(t=(e=this.props).onSelectionConfirmed)||void 0===t||t.call(e)}}Qg.template="o-spreadsheet-SelectionInput",Qg.props={ranges:Array,hasSingleRange:{type:Boolean,optional:!0},required:{type:Boolean,optional:!0},isInvalid:{type:Boolean,optional:!0},class:{type:String,optional:!0},onSelectionChanged:{type:Function,optional:!0},onSelectionConfirmed:{type:Function,optional:!0}};class Jg extends t.Component{constructor(){super(...arguments),this.state=t.useState({datasetDispatchResult:void 0,labelsDispatchResult:void 0}),this.dataSeriesRanges=[]}setup(){this.dataSeriesRanges=this.props.definition.dataSets,this.labelRange=this.props.definition.labelRange}get errorMessages(){var e,t;return[...(null===(e=this.state.datasetDispatchResult)||void 0===e?void 0:e.reasons)||[],...(null===(t=this.state.labelsDispatchResult)||void 0===t?void 0:t.reasons)||[]].map((e=>Hi.Errors[e]||Hi.Errors.Unexpected))}get isDatasetInvalid(){var e;return!!(null===(e=this.state.datasetDispatchResult)||void 0===e?void 0:e.isCancelledBecause(32))}get isLabelInvalid(){var e;return!!(null===(e=this.state.labelsDispatchResult)||void 0===e?void 0:e.isCancelledBecause(33))}onUpdateDataSetsHaveTitle(e){this.props.updateChart({dataSetsHaveTitle:e.target.checked})}onDataSeriesRangesChanged(e){this.dataSeriesRanges=e}onDataSeriesConfirmed(){this.state.datasetDispatchResult=this.props.updateChart({dataSets:this.dataSeriesRanges})}onLabelRangeChanged(e){this.labelRange=e[0]}onLabelRangeConfirmed(){this.state.labelsDispatchResult=this.props.updateChart({labelRange:this.labelRange})}onUpdateAggregated(e){this.props.updateChart({aggregated:e.target.checked})}}Jg.template="o-spreadsheet-LineBarPieConfigPanel",Jg.components={SelectionInput:Qg},Jg.props={figureId:String,definition:Object,updateChart:Function};class ep extends Jg{onUpdateStacked(e){this.props.updateChart({stacked:e.target.checked})}onUpdateAggregated(e){this.props.updateChart({aggregated:e.target.checked})}}ep.template="o-spreadsheet-BarConfigPanel";const tp=218,op=182;function ip(e){return vt(Ct({h:360*e.offsetX/tp,s:100,l:100*e.offsetY/op,a:1}))}oi`
588
+ `;class Qg extends t.Component{constructor(){super(...arguments),this.id=Kg.uuidv4(),this.previousRanges=this.props.ranges||[],this.originSheet=this.env.model.getters.getActiveSheetId(),this.state=t.useState({isMissing:!1,mode:"select-range"})}get ranges(){const e=this.env.model.getters.getSelectionInput(this.id);return(e.length?e:this.props.ranges?this.props.ranges.map(((e,t)=>({xc:e,id:t.toString(),isFocused:!1}))):[]).map((e=>({...e,isValidRange:""===e.xc||this.env.model.getters.isRangeValid(e.xc)})))}get hasFocus(){return this.ranges.filter((e=>e.isFocused)).length>0}get canAddRange(){return!this.props.hasSingleRange}get isInvalid(){return this.props.isInvalid||this.state.isMissing}setup(){t.onMounted((()=>this.enableNewSelectionInput())),t.onWillUnmount((async()=>this.disableNewSelectionInput())),t.onPatched((()=>this.checkChange()))}enableNewSelectionInput(){this.env.model.dispatch("ENABLE_NEW_SELECTION_INPUT",{id:this.id,initialRanges:this.props.ranges,hasSingleRange:this.props.hasSingleRange})}disableNewSelectionInput(){this.env.model.dispatch("DISABLE_SELECTION_INPUT",{id:this.id})}checkChange(){const e=this.env.model.getters.getSelectionInputValue(this.id);this.previousRanges.join()!==e.join()&&this.triggerChange()}getColor(e){return"color: "+(e.color||"#000")+";"}triggerChange(){var e,t;const o=this.env.model.getters.getSelectionInputValue(this.id);null===(t=(e=this.props).onSelectionChanged)||void 0===t||t.call(e,o),this.previousRanges=o}onKeydown(e){"F2"===e.key?(e.preventDefault(),e.stopPropagation(),this.state.mode="select-range"===this.state.mode?"text-edit":"select-range"):e.key.startsWith("Arrow")&&(e.stopPropagation(),"select-range"===this.state.mode&&(e.preventDefault(),ju(e,this.env.model.selection)))}extractRanges(e){return this.props.hasSingleRange?e.split(",")[0]:e}focus(e){this.state.isMissing=!1,this.state.mode="select-range",this.env.model.dispatch("FOCUS_RANGE",{id:this.id,rangeId:e})}addEmptyInput(){this.env.model.dispatch("ADD_EMPTY_RANGE",{id:this.id})}removeInput(e){var t,o;this.env.model.dispatch("REMOVE_RANGE",{id:this.id,rangeId:e}),this.triggerChange(),null===(o=(t=this.props).onSelectionConfirmed)||void 0===o||o.call(t)}onInputChanged(e,t){const o=t.target,i=this.extractRanges(o.value);this.env.model.dispatch("CHANGE_RANGE",{id:this.id,rangeId:e,value:i}),o.blur(),this.triggerChange()}confirm(){var e,t;this.env.model.dispatch("UNFOCUS_SELECTION_INPUT");const o=this.env.model.getters.getSelectionInputValue(this.id);this.props.required&&0===o.length&&(this.state.isMissing=!0);const i=this.env.model.getters.getActiveSheetId();this.originSheet!==i&&this.env.model.dispatch("ACTIVATE_SHEET",{sheetIdFrom:i,sheetIdTo:this.originSheet}),null===(t=(e=this.props).onSelectionConfirmed)||void 0===t||t.call(e)}}Qg.template="o-spreadsheet-SelectionInput",Qg.props={ranges:Array,hasSingleRange:{type:Boolean,optional:!0},required:{type:Boolean,optional:!0},isInvalid:{type:Boolean,optional:!0},class:{type:String,optional:!0},onSelectionChanged:{type:Function,optional:!0},onSelectionConfirmed:{type:Function,optional:!0}};class Jg extends t.Component{constructor(){super(...arguments),this.state=t.useState({datasetDispatchResult:void 0,labelsDispatchResult:void 0}),this.dataSeriesRanges=[]}setup(){this.dataSeriesRanges=this.props.definition.dataSets,this.labelRange=this.props.definition.labelRange}get errorMessages(){var e,t;return[...(null===(e=this.state.datasetDispatchResult)||void 0===e?void 0:e.reasons)||[],...(null===(t=this.state.labelsDispatchResult)||void 0===t?void 0:t.reasons)||[]].map((e=>Hi.Errors[e]||Hi.Errors.Unexpected))}get isDatasetInvalid(){var e;return!!(null===(e=this.state.datasetDispatchResult)||void 0===e?void 0:e.isCancelledBecause(32))}get isLabelInvalid(){var e;return!!(null===(e=this.state.labelsDispatchResult)||void 0===e?void 0:e.isCancelledBecause(33))}onUpdateDataSetsHaveTitle(e){this.props.updateChart(this.props.figureId,{dataSetsHaveTitle:e.target.checked})}onDataSeriesRangesChanged(e){this.dataSeriesRanges=e}onDataSeriesConfirmed(){this.state.datasetDispatchResult=this.props.updateChart(this.props.figureId,{dataSets:this.dataSeriesRanges})}onLabelRangeChanged(e){this.labelRange=e[0]}onLabelRangeConfirmed(){this.state.labelsDispatchResult=this.props.updateChart(this.props.figureId,{labelRange:this.labelRange})}onUpdateAggregated(e){this.props.updateChart(this.props.figureId,{aggregated:e.target.checked})}}Jg.template="o-spreadsheet-LineBarPieConfigPanel",Jg.components={SelectionInput:Qg},Jg.props={figureId:String,definition:Object,updateChart:Function};class ep extends Jg{onUpdateStacked(e){this.props.updateChart(this.props.figureId,{stacked:e.target.checked})}onUpdateAggregated(e){this.props.updateChart(this.props.figureId,{aggregated:e.target.checked})}}ep.template="o-spreadsheet-BarConfigPanel";const tp=218,op=182;function ip(e){return vt(Ct({h:360*e.offsetX/tp,s:100,l:100*e.offsetY/op,a:1}))}oi`
589
589
  .o-color-picker {
590
590
  position: absolute;
591
591
  top: calc(100% + 5px);
@@ -733,7 +733,7 @@
733
733
  width: 30px;
734
734
  height: 30px;
735
735
  }
736
- `;class np extends t.Component{constructor(){super(...arguments),this.COLORS=A,this.state=t.useState({showGradient:!1,currentColor:gt(this.props.currentColor)?this.props.currentColor:"",isCurrentColorInvalid:!1,style:{display:"none",background:"#ffffff",left:"0",top:"0"}})}get colorPickerStyle(){return void 0===this.props.maxHeight?"":this.props.maxHeight<=0?si({display:"none"}):si({"max-height":`${this.props.maxHeight}px`})}onColorClick(e){e&&this.props.onColorPicked(ut(e))}getCheckMarkColor(){return ki(this.props.currentColor)}resetColor(){this.props.onColorPicked("")}setCustomColor(e){if(!gt(this.state.currentColor))return e.stopPropagation(),void(this.state.isCurrentColorInvalid=!0);const t=ut(this.state.currentColor);this.state.isCurrentColorInvalid=!1,this.props.onColorPicked(t),this.state.currentColor=t}toggleColorPicker(){this.state.showGradient=!this.state.showGradient}computeCustomColor(e){this.state.isCurrentColorInvalid=!1,this.state.currentColor=ip(e)}hideMagnifier(e){this.state.style.display="none"}showMagnifier(e){this.state.style.display="block"}moveMagnifier(e){this.state.style.background=ip(e);this.state.style.left=`${e.offsetX+10}px`,this.state.style.top=`${e.offsetY+10}px`}get magnifyingGlassStyle(){const{display:e,background:t,left:o,top:i}=this.state.style;return`display:${e};${"block"===e?`background-color:${t};left:${o};top:${i};`:""}`}isSameColor(e,t){return function(e,t){return gt(e)&&gt(t)&&ut(e)===ut(t)}(e,t)}}np.template="o-spreadsheet-ColorPicker",np.defaultProps={currentColor:""},np.props={dropdownDirection:{type:String,optional:!0},onColorPicked:Function,currentColor:{type:String,optional:!0},maxHeight:{type:Number,optional:!0}};class rp extends t.Component{constructor(){super(...arguments),this.state=t.useState({fillColorTool:!1})}onClick(e){this.state.fillColorTool=!1}setup(){t.useExternalListener(window,"click",this.onClick)}toggleColorPicker(){this.state.fillColorTool=!this.state.fillColorTool}updateBackgroundColor(e){this.props.updateChart({background:e})}updateTitle(e){this.props.updateChart({title:e.target.value})}updateSelect(e,t){this.props.updateChart({[e]:t.target.value})}}rp.template="o-spreadsheet-LineBarPieDesignPanel",rp.components={ColorPicker:np},rp.props={figureId:String,definition:Object,updateChart:Function};class sp extends rp{}sp.template="o-spreadsheet-BarChartDesignPanel";class ap extends t.Component{constructor(){super(...arguments),this.state=t.useState({dataRangeDispatchResult:void 0}),this.dataRange=this.props.definition.dataRange}get configurationErrorMessages(){var e;return[...(null===(e=this.state.dataRangeDispatchResult)||void 0===e?void 0:e.reasons)||[]].map((e=>Hi.Errors[e]||Hi.Errors.Unexpected))}get isDataRangeInvalid(){var e;return!!(null===(e=this.state.dataRangeDispatchResult)||void 0===e?void 0:e.isCancelledBecause(36))}onDataRangeChanged(e){this.dataRange=e[0]}updateDataRange(){this.state.dataRangeDispatchResult=this.props.updateChart({dataRange:this.dataRange})}}ap.template="o-spreadsheet-GaugeChartConfigPanel",ap.components={SelectionInput:Qg},ap.props={figureId:String,definition:Object,updateChart:Function},oi`
736
+ `;class np extends t.Component{constructor(){super(...arguments),this.COLORS=A,this.state=t.useState({showGradient:!1,currentColor:gt(this.props.currentColor)?this.props.currentColor:"",isCurrentColorInvalid:!1,style:{display:"none",background:"#ffffff",left:"0",top:"0"}})}get colorPickerStyle(){return void 0===this.props.maxHeight?"":this.props.maxHeight<=0?si({display:"none"}):si({"max-height":`${this.props.maxHeight}px`})}onColorClick(e){e&&this.props.onColorPicked(ut(e))}getCheckMarkColor(){return ki(this.props.currentColor)}resetColor(){this.props.onColorPicked("")}setCustomColor(e){if(!gt(this.state.currentColor))return e.stopPropagation(),void(this.state.isCurrentColorInvalid=!0);const t=ut(this.state.currentColor);this.state.isCurrentColorInvalid=!1,this.props.onColorPicked(t),this.state.currentColor=t}toggleColorPicker(){this.state.showGradient=!this.state.showGradient}computeCustomColor(e){this.state.isCurrentColorInvalid=!1,this.state.currentColor=ip(e)}hideMagnifier(e){this.state.style.display="none"}showMagnifier(e){this.state.style.display="block"}moveMagnifier(e){this.state.style.background=ip(e);this.state.style.left=`${e.offsetX+10}px`,this.state.style.top=`${e.offsetY+10}px`}get magnifyingGlassStyle(){const{display:e,background:t,left:o,top:i}=this.state.style;return`display:${e};${"block"===e?`background-color:${t};left:${o};top:${i};`:""}`}isSameColor(e,t){return function(e,t){return gt(e)&&gt(t)&&ut(e)===ut(t)}(e,t)}}np.template="o-spreadsheet-ColorPicker",np.defaultProps={currentColor:""},np.props={dropdownDirection:{type:String,optional:!0},onColorPicked:Function,currentColor:{type:String,optional:!0},maxHeight:{type:Number,optional:!0}};class rp extends t.Component{constructor(){super(...arguments),this.state=t.useState({fillColorTool:!1})}onClick(e){this.state.fillColorTool=!1}setup(){t.useExternalListener(window,"click",this.onClick)}toggleColorPicker(){this.state.fillColorTool=!this.state.fillColorTool}updateBackgroundColor(e){this.props.updateChart(this.props.figureId,{background:e})}updateTitle(e){this.props.updateChart(this.props.figureId,{title:e.target.value})}updateSelect(e,t){this.props.updateChart(this.props.figureId,{[e]:t.target.value})}}rp.template="o-spreadsheet-LineBarPieDesignPanel",rp.components={ColorPicker:np},rp.props={figureId:String,definition:Object,updateChart:Function};class sp extends rp{}sp.template="o-spreadsheet-BarChartDesignPanel";class ap extends t.Component{constructor(){super(...arguments),this.state=t.useState({dataRangeDispatchResult:void 0}),this.dataRange=this.props.definition.dataRange}get configurationErrorMessages(){var e;return[...(null===(e=this.state.dataRangeDispatchResult)||void 0===e?void 0:e.reasons)||[]].map((e=>Hi.Errors[e]||Hi.Errors.Unexpected))}get isDataRangeInvalid(){var e;return!!(null===(e=this.state.dataRangeDispatchResult)||void 0===e?void 0:e.isCancelledBecause(36))}onDataRangeChanged(e){this.dataRange=e[0]}updateDataRange(){this.state.dataRangeDispatchResult=this.props.updateChart(this.props.figureId,{dataRange:this.dataRange})}}ap.template="o-spreadsheet-GaugeChartConfigPanel",ap.components={SelectionInput:Qg},ap.props={figureId:String,definition:Object,updateChart:Function},oi`
737
737
  .o-gauge-color-set {
738
738
  .o-gauge-color-set-color-button {
739
739
  display: inline-block;
@@ -773,7 +773,7 @@
773
773
  box-sizing: border-box;
774
774
  }
775
775
  }
776
- `;class lp extends t.Component{constructor(){super(...arguments),this.state=t.useState({openedMenu:void 0,sectionRuleDispatchResult:void 0})}get designErrorMessages(){var e;return[...(null===(e=this.state.sectionRuleDispatchResult)||void 0===e?void 0:e.reasons)||[]].map((e=>Hi.Errors[e]||Hi.Errors.Unexpected))}onClick(e){this.state.openedMenu=void 0}setup(){t.useExternalListener(window,"click",this.onClick)}updateBackgroundColor(e){this.state.openedMenu=void 0,this.props.updateChart({background:e})}updateTitle(e){this.props.updateChart({title:e.target.value})}isRangeMinInvalid(){var e,t,o;return!!((null===(e=this.state.sectionRuleDispatchResult)||void 0===e?void 0:e.isCancelledBecause(37))||(null===(t=this.state.sectionRuleDispatchResult)||void 0===t?void 0:t.isCancelledBecause(38))||(null===(o=this.state.sectionRuleDispatchResult)||void 0===o?void 0:o.isCancelledBecause(41)))}isRangeMaxInvalid(){var e,t,o;return!!((null===(e=this.state.sectionRuleDispatchResult)||void 0===e?void 0:e.isCancelledBecause(39))||(null===(t=this.state.sectionRuleDispatchResult)||void 0===t?void 0:t.isCancelledBecause(40))||(null===(o=this.state.sectionRuleDispatchResult)||void 0===o?void 0:o.isCancelledBecause(41)))}get isLowerInflectionPointInvalid(){var e,t;return!(!(null===(e=this.state.sectionRuleDispatchResult)||void 0===e?void 0:e.isCancelledBecause(42))&&!(null===(t=this.state.sectionRuleDispatchResult)||void 0===t?void 0:t.isCancelledBecause(44)))}get isUpperInflectionPointInvalid(){var e,t;return!(!(null===(e=this.state.sectionRuleDispatchResult)||void 0===e?void 0:e.isCancelledBecause(43))&&!(null===(t=this.state.sectionRuleDispatchResult)||void 0===t?void 0:t.isCancelledBecause(44)))}updateInflectionPointValue(e,t){const o=Me(this.props.definition.sectionRule);o[e].value=t.target.value,this.updateSectionRule(o)}updateInflectionPointType(e,t){const o=Me(this.props.definition.sectionRule);o[e].type=t.target.value,this.updateSectionRule(o)}updateSectionColor(e,t){const o=Me(this.props.definition.sectionRule);o.colors[e]=t,this.updateSectionRule(o),this.closeMenus()}updateRangeMin(e){let t=Me(this.props.definition.sectionRule);t={...t,rangeMin:e.target.value},this.updateSectionRule(t)}updateRangeMax(e){let t=Me(this.props.definition.sectionRule);t={...t,rangeMax:e.target.value},this.updateSectionRule(t)}toggleMenu(e){const t=this.state.openedMenu===e;this.closeMenus(),t||(this.state.openedMenu=e)}updateSectionRule(e){this.state.sectionRuleDispatchResult=this.props.updateChart({sectionRule:e})}closeMenus(){this.state.openedMenu=void 0}}lp.template="o-spreadsheet-GaugeChartDesignPanel",lp.components={ColorPicker:np},lp.props={figureId:String,definition:Object,updateChart:Function};class cp extends Jg{get canTreatLabelsAsText(){const e=this.env.model.getters.getChart(this.props.figureId);return!!(e&&e instanceof gn)&&pn(e.labelRange,this.env.model.getters)}onUpdateLabelsAsText(e){this.props.updateChart({labelsAsText:e.target.checked})}onUpdateStacked(e){this.props.updateChart({stacked:e.target.checked})}onUpdateAggregated(e){this.props.updateChart({aggregated:e.target.checked})}}cp.template="o-spreadsheet-LineConfigPanel";class hp extends rp{}hp.template="o-spreadsheet-LineChartDesignPanel";class dp extends t.Component{constructor(){super(...arguments),this.state=t.useState({keyValueDispatchResult:void 0,baselineDispatchResult:void 0}),this.keyValue=this.props.definition.keyValue,this.baseline=this.props.definition.baseline}get errorMessages(){var e,t;return[...(null===(e=this.state.keyValueDispatchResult)||void 0===e?void 0:e.reasons)||[],...(null===(t=this.state.baselineDispatchResult)||void 0===t?void 0:t.reasons)||[]].map((e=>Hi.Errors[e]||Hi.Errors.Unexpected))}get isKeyValueInvalid(){var e;return!!(null===(e=this.state.keyValueDispatchResult)||void 0===e?void 0:e.isCancelledBecause(34))}get isBaselineInvalid(){var e;return!!(null===(e=this.state.keyValueDispatchResult)||void 0===e?void 0:e.isCancelledBecause(35))}onKeyValueRangeChanged(e){this.keyValue=e[0]}updateKeyValueRange(){this.state.keyValueDispatchResult=this.props.updateChart({keyValue:this.keyValue})}onBaselineRangeChanged(e){this.baseline=e[0]}updateBaselineRange(){this.state.baselineDispatchResult=this.props.updateChart({baseline:this.baseline})}updateBaselineMode(e){this.props.updateChart({baselineMode:e.target.value})}}dp.template="o-spreadsheet-ScorecardChartConfigPanel",dp.components={SelectionInput:Qg},dp.props={figureId:String,definition:Object,updateChart:Function};class up extends t.Component{constructor(){super(...arguments),this.state=t.useState({openedColorPicker:void 0})}onClick(e){this.state.openedColorPicker=void 0}setup(){t.useExternalListener(window,"click",this.onClick)}updateTitle(e){this.props.updateChart({title:e.target.value})}updateBaselineDescr(e){this.props.updateChart({baselineDescr:e.target.value})}openColorPicker(e){this.state.openedColorPicker=e}setColor(e,t){switch(t){case"backgroundColor":this.props.updateChart({background:e});break;case"baselineColorDown":this.props.updateChart({baselineColorDown:e});break;case"baselineColorUp":this.props.updateChart({baselineColorUp:e})}this.state.openedColorPicker=void 0}}up.template="o-spreadsheet-ScorecardChartDesignPanel",up.components={ColorPicker:np},up.props={figureId:String,definition:Object,updateChart:Function};const gp=new yn;gp.add("line",{configuration:cp,design:hp}).add("bar",{configuration:ep,design:sp}).add("pie",{configuration:Jg,design:rp}).add("gauge",{configuration:ap,design:lp}).add("scorecard",{configuration:dp,design:up}),oi`
776
+ `;class lp extends t.Component{constructor(){super(...arguments),this.state=t.useState({openedMenu:void 0,sectionRuleDispatchResult:void 0})}get designErrorMessages(){var e;return[...(null===(e=this.state.sectionRuleDispatchResult)||void 0===e?void 0:e.reasons)||[]].map((e=>Hi.Errors[e]||Hi.Errors.Unexpected))}onClick(e){this.state.openedMenu=void 0}setup(){t.useExternalListener(window,"click",this.onClick)}updateBackgroundColor(e){this.state.openedMenu=void 0,this.props.updateChart(this.props.figureId,{background:e})}updateTitle(e){this.props.updateChart(this.props.figureId,{title:e.target.value})}isRangeMinInvalid(){var e,t,o;return!!((null===(e=this.state.sectionRuleDispatchResult)||void 0===e?void 0:e.isCancelledBecause(37))||(null===(t=this.state.sectionRuleDispatchResult)||void 0===t?void 0:t.isCancelledBecause(38))||(null===(o=this.state.sectionRuleDispatchResult)||void 0===o?void 0:o.isCancelledBecause(41)))}isRangeMaxInvalid(){var e,t,o;return!!((null===(e=this.state.sectionRuleDispatchResult)||void 0===e?void 0:e.isCancelledBecause(39))||(null===(t=this.state.sectionRuleDispatchResult)||void 0===t?void 0:t.isCancelledBecause(40))||(null===(o=this.state.sectionRuleDispatchResult)||void 0===o?void 0:o.isCancelledBecause(41)))}get isLowerInflectionPointInvalid(){var e,t;return!(!(null===(e=this.state.sectionRuleDispatchResult)||void 0===e?void 0:e.isCancelledBecause(42))&&!(null===(t=this.state.sectionRuleDispatchResult)||void 0===t?void 0:t.isCancelledBecause(44)))}get isUpperInflectionPointInvalid(){var e,t;return!(!(null===(e=this.state.sectionRuleDispatchResult)||void 0===e?void 0:e.isCancelledBecause(43))&&!(null===(t=this.state.sectionRuleDispatchResult)||void 0===t?void 0:t.isCancelledBecause(44)))}updateInflectionPointValue(e,t){const o=Me(this.props.definition.sectionRule);o[e].value=t.target.value,this.updateSectionRule(o)}updateInflectionPointType(e,t){const o=Me(this.props.definition.sectionRule);o[e].type=t.target.value,this.updateSectionRule(o)}updateSectionColor(e,t){const o=Me(this.props.definition.sectionRule);o.colors[e]=t,this.updateSectionRule(o),this.closeMenus()}updateRangeMin(e){let t=Me(this.props.definition.sectionRule);t={...t,rangeMin:e.target.value},this.updateSectionRule(t)}updateRangeMax(e){let t=Me(this.props.definition.sectionRule);t={...t,rangeMax:e.target.value},this.updateSectionRule(t)}toggleMenu(e){const t=this.state.openedMenu===e;this.closeMenus(),t||(this.state.openedMenu=e)}updateSectionRule(e){this.state.sectionRuleDispatchResult=this.props.updateChart(this.props.figureId,{sectionRule:e})}closeMenus(){this.state.openedMenu=void 0}}lp.template="o-spreadsheet-GaugeChartDesignPanel",lp.components={ColorPicker:np},lp.props={figureId:String,definition:Object,updateChart:Function};class cp extends Jg{get canTreatLabelsAsText(){const e=this.env.model.getters.getChart(this.props.figureId);return!!(e&&e instanceof gn)&&pn(e.labelRange,this.env.model.getters)}onUpdateLabelsAsText(e){this.props.updateChart(this.props.figureId,{labelsAsText:e.target.checked})}onUpdateStacked(e){this.props.updateChart(this.props.figureId,{stacked:e.target.checked})}onUpdateAggregated(e){this.props.updateChart(this.props.figureId,{aggregated:e.target.checked})}}cp.template="o-spreadsheet-LineConfigPanel";class hp extends rp{}hp.template="o-spreadsheet-LineChartDesignPanel";class dp extends t.Component{constructor(){super(...arguments),this.state=t.useState({keyValueDispatchResult:void 0,baselineDispatchResult:void 0}),this.keyValue=this.props.definition.keyValue,this.baseline=this.props.definition.baseline}get errorMessages(){var e,t;return[...(null===(e=this.state.keyValueDispatchResult)||void 0===e?void 0:e.reasons)||[],...(null===(t=this.state.baselineDispatchResult)||void 0===t?void 0:t.reasons)||[]].map((e=>Hi.Errors[e]||Hi.Errors.Unexpected))}get isKeyValueInvalid(){var e;return!!(null===(e=this.state.keyValueDispatchResult)||void 0===e?void 0:e.isCancelledBecause(34))}get isBaselineInvalid(){var e;return!!(null===(e=this.state.keyValueDispatchResult)||void 0===e?void 0:e.isCancelledBecause(35))}onKeyValueRangeChanged(e){this.keyValue=e[0]}updateKeyValueRange(){this.state.keyValueDispatchResult=this.props.updateChart(this.props.figureId,{keyValue:this.keyValue})}onBaselineRangeChanged(e){this.baseline=e[0]}updateBaselineRange(){this.state.baselineDispatchResult=this.props.updateChart(this.props.figureId,{baseline:this.baseline})}updateBaselineMode(e){this.props.updateChart(this.props.figureId,{baselineMode:e.target.value})}}dp.template="o-spreadsheet-ScorecardChartConfigPanel",dp.components={SelectionInput:Qg},dp.props={figureId:String,definition:Object,updateChart:Function};class up extends t.Component{constructor(){super(...arguments),this.state=t.useState({openedColorPicker:void 0})}onClick(e){this.state.openedColorPicker=void 0}setup(){t.useExternalListener(window,"click",this.onClick)}updateTitle(e){this.props.updateChart(this.props.figureId,{title:e.target.value})}updateBaselineDescr(e){this.props.updateChart(this.props.figureId,{baselineDescr:e.target.value})}openColorPicker(e){this.state.openedColorPicker=e}setColor(e,t){switch(t){case"backgroundColor":this.props.updateChart(this.props.figureId,{background:e});break;case"baselineColorDown":this.props.updateChart(this.props.figureId,{baselineColorDown:e});break;case"baselineColorUp":this.props.updateChart(this.props.figureId,{baselineColorUp:e})}this.state.openedColorPicker=void 0}}up.template="o-spreadsheet-ScorecardChartDesignPanel",up.components={ColorPicker:np},up.props={figureId:String,definition:Object,updateChart:Function};const gp=new yn;gp.add("line",{configuration:cp,design:hp}).add("bar",{configuration:ep,design:sp}).add("pie",{configuration:Jg,design:rp}).add("gauge",{configuration:ap,design:lp}).add("scorecard",{configuration:dp,design:up}),oi`
777
777
  .o-chart {
778
778
  .o-panel {
779
779
  display: flex;
@@ -803,7 +803,7 @@
803
803
  border-bottom: 4px solid;
804
804
  }
805
805
  }
806
- `;class pp extends t.Component{constructor(){super(...arguments),this.shouldUpdateChart=!0}get figureId(){return this.state.figureId}get sheetId(){return this.state.sheetId}setup(){const e=this.env.model.getters.getSelectedFigureId();if(!e)throw new Error(r("Cannot open the chart side panel while no chart are selected"));this.state=t.useState({panel:"configuration",figureId:e,sheetId:this.env.model.getters.getActiveSheetId()}),t.onWillUpdateProps((()=>{const e=this.env.model.getters.getSelectedFigureId();e&&e!==this.state.figureId?(this.state.figureId=e,this.state.sheetId=this.env.model.getters.getActiveSheetId(),this.shouldUpdateChart=!1):this.shouldUpdateChart=!0,this.env.model.getters.isChartDefined(this.figureId)||this.props.onCloseSidePanel()}))}updateChart(e){if(!this.shouldUpdateChart)return;const t={...this.getChartDefinition(),...e};return this.env.model.dispatch("UPDATE_CHART",{definition:t,id:this.figureId,sheetId:this.sheetId})}onTypeChange(e){const t=this.env.model.getters.getContextCreationChart(this.figureId);if(!t)throw new Error("Chart not defined.");const o=function(e,t){return xn.get(t).getChartDefinitionFromContextCreation(e)}(t,e);this.env.model.dispatch("UPDATE_CHART",{definition:o,id:this.figureId,sheetId:this.sheetId})}get chartPanel(){const e=this.env.model.getters.getChartType(this.figureId);if(!e)throw new Error("Chart not defined.");const t=gp.get(e);if(!t)throw new Error(`Component is not defined for type ${e}`);return t}getChartDefinition(e=this.figureId){return this.env.model.getters.getChartDefinition(e)}get chartTypes(){return function(){const e={};for(const t of xn.getKeys())e[t]=xn.get(t).name;return e}()}activatePanel(e){this.state.panel=e}}pp.template="o-spreadsheet-ChartPanel",pp.props={onCloseSidePanel:Function};function mp(e){e=`<svg xmlns="http://www.w3.org/2000/svg" ${e.slice(4)}`;const t=new Image;return t.src="data:image/svg+xml; charset=utf8, "+encodeURIComponent(e),t}const fp={arrowGood:{template:"ARROW_UP",img:mp('<svg class="o-cf-icon arrow-up" width="10" height="10" focusable="false" viewBox="0 0 448 512"><path fill="#00A04A" d="M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z"></path></svg>')},arrowNeutral:{template:"ARROW_RIGHT",img:mp('<svg class="o-cf-icon arrow-right" width="10" height="10" focusable="false" viewBox="0 0 448 512"><path fill="#F0AD4E" d="M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"></path></svg>')},arrowBad:{template:"ARROW_DOWN",img:mp('<svg class="o-cf-icon arrow-down" width="10" height="10" focusable="false" viewBox="0 0 448 512"><path fill="#DC6965" d="M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z"></path></svg>')},smileyGood:{template:"SMILE",img:mp('<svg class="o-cf-icon smile" width="10" height="10" focusable="false" viewBox="0 0 496 512"><path fill="#00A04A" d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 448c-110.3 0-200-89.7-200-200S137.7 56 248 56s200 89.7 200 200-89.7 200-200 200zm-80-216c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm4 72.6c-20.8 25-51.5 39.4-84 39.4s-63.2-14.3-84-39.4c-8.5-10.2-23.7-11.5-33.8-3.1-10.2 8.5-11.5 23.6-3.1 33.8 30 36 74.1 56.6 120.9 56.6s90.9-20.6 120.9-56.6c8.5-10.2 7.1-25.3-3.1-33.8-10.1-8.4-25.3-7.1-33.8 3.1z"></path></svg>')},smileyNeutral:{template:"MEH",img:mp('<svg class="o-cf-icon meh" width="10" height="10" focusable="false" viewBox="0 0 496 512"><path fill="#F0AD4E" d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 448c-110.3 0-200-89.7-200-200S137.7 56 248 56s200 89.7 200 200-89.7 200-200 200zm-80-216c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm160-64c-17.7 0-32 14.3-32 32s14.3 32 32 32 32-14.3 32-32-14.3-32-32-32zm8 144H160c-13.2 0-24 10.8-24 24s10.8 24 24 24h176c13.2 0 24-10.8 24-24s-10.8-24-24-24z"></path></svg>')},smileyBad:{template:"FROWN",img:mp('<svg class="o-cf-icon frown" width="10" height="10" focusable="false" viewBox="0 0 496 512"><path fill="#DC6965" d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 448c-110.3 0-200-89.7-200-200S137.7 56 248 56s200 89.7 200 200-89.7 200-200 200zm-80-216c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm160-64c-17.7 0-32 14.3-32 32s14.3 32 32 32 32-14.3 32-32-14.3-32-32-32zm-80 128c-40.2 0-78 17.7-103.8 48.6-8.5 10.2-7.1 25.3 3.1 33.8 10.2 8.4 25.3 7.1 33.8-3.1 16.6-19.9 41-31.4 66.9-31.4s50.3 11.4 66.9 31.4c8.1 9.7 23.1 11.9 33.8 3.1 10.2-8.5 11.5-23.6 3.1-33.8C326 321.7 288.2 304 248 304z"></path></svg>')},dotGood:{template:"GREEN_DOT",img:mp('<svg class="o-cf-icon green-dot" width="10" height="10" focusable="false" viewBox="0 0 512 512"><path fill="#00A04A" d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"></path></svg>')},dotNeutral:{template:"YELLOW_DOT",img:mp('<svg class="o-cf-icon yellow-dot" width="10" height="10" focusable="false" viewBox="0 0 512 512"><path fill="#F0AD4E" d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"></path></svg>')},dotBad:{template:"RED_DOT",img:mp('<svg class="o-cf-icon red-dot" width="10" height="10" focusable="false" viewBox="0 0 512 512"><path fill="#DC6965" d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"></path></svg>')}},vp={arrows:{good:"arrowGood",neutral:"arrowNeutral",bad:"arrowBad"},smiley:{good:"smileyGood",neutral:"smileyNeutral",bad:"smileyBad"},dots:{good:"dotGood",neutral:"dotNeutral",bad:"dotBad"}};oi`
806
+ `;class pp extends t.Component{get figureId(){return this.state.figureId}setup(){const e=this.env.model.getters.getSelectedFigureId();if(!e)throw new Error(r("Cannot open the chart side panel while no chart are selected"));this.state=t.useState({panel:"configuration",figureId:e}),t.onWillUpdateProps((()=>{const e=this.env.model.getters.getSelectedFigureId();e&&e!==this.state.figureId&&(this.state.figureId=e),this.env.model.getters.isChartDefined(this.figureId)||this.props.onCloseSidePanel()}))}updateChart(e,t){if(e!==this.figureId)return;const o={...this.getChartDefinition(),...t};return this.env.model.dispatch("UPDATE_CHART",{definition:o,id:e,sheetId:this.env.model.getters.getFigureSheetId(e)})}onTypeChange(e){const t=this.env.model.getters.getContextCreationChart(this.figureId);if(!t)throw new Error("Chart not defined.");const o=function(e,t){return xn.get(t).getChartDefinitionFromContextCreation(e)}(t,e);this.env.model.dispatch("UPDATE_CHART",{definition:o,id:this.figureId,sheetId:this.env.model.getters.getFigureSheetId(this.figureId)})}get chartPanel(){const e=this.env.model.getters.getChartType(this.figureId);if(!e)throw new Error("Chart not defined.");const t=gp.get(e);if(!t)throw new Error(`Component is not defined for type ${e}`);return t}getChartDefinition(e=this.figureId){return this.env.model.getters.getChartDefinition(e)}get chartTypes(){return function(){const e={};for(const t of xn.getKeys())e[t]=xn.get(t).name;return e}()}activatePanel(e){this.state.panel=e}}pp.template="o-spreadsheet-ChartPanel",pp.props={onCloseSidePanel:Function};function mp(e){e=`<svg xmlns="http://www.w3.org/2000/svg" ${e.slice(4)}`;const t=new Image;return t.src="data:image/svg+xml; charset=utf8, "+encodeURIComponent(e),t}const fp={arrowGood:{template:"ARROW_UP",img:mp('<svg class="o-cf-icon arrow-up" width="10" height="10" focusable="false" viewBox="0 0 448 512"><path fill="#00A04A" d="M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z"></path></svg>')},arrowNeutral:{template:"ARROW_RIGHT",img:mp('<svg class="o-cf-icon arrow-right" width="10" height="10" focusable="false" viewBox="0 0 448 512"><path fill="#F0AD4E" d="M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"></path></svg>')},arrowBad:{template:"ARROW_DOWN",img:mp('<svg class="o-cf-icon arrow-down" width="10" height="10" focusable="false" viewBox="0 0 448 512"><path fill="#DC6965" d="M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z"></path></svg>')},smileyGood:{template:"SMILE",img:mp('<svg class="o-cf-icon smile" width="10" height="10" focusable="false" viewBox="0 0 496 512"><path fill="#00A04A" d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 448c-110.3 0-200-89.7-200-200S137.7 56 248 56s200 89.7 200 200-89.7 200-200 200zm-80-216c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm4 72.6c-20.8 25-51.5 39.4-84 39.4s-63.2-14.3-84-39.4c-8.5-10.2-23.7-11.5-33.8-3.1-10.2 8.5-11.5 23.6-3.1 33.8 30 36 74.1 56.6 120.9 56.6s90.9-20.6 120.9-56.6c8.5-10.2 7.1-25.3-3.1-33.8-10.1-8.4-25.3-7.1-33.8 3.1z"></path></svg>')},smileyNeutral:{template:"MEH",img:mp('<svg class="o-cf-icon meh" width="10" height="10" focusable="false" viewBox="0 0 496 512"><path fill="#F0AD4E" d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 448c-110.3 0-200-89.7-200-200S137.7 56 248 56s200 89.7 200 200-89.7 200-200 200zm-80-216c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm160-64c-17.7 0-32 14.3-32 32s14.3 32 32 32 32-14.3 32-32-14.3-32-32-32zm8 144H160c-13.2 0-24 10.8-24 24s10.8 24 24 24h176c13.2 0 24-10.8 24-24s-10.8-24-24-24z"></path></svg>')},smileyBad:{template:"FROWN",img:mp('<svg class="o-cf-icon frown" width="10" height="10" focusable="false" viewBox="0 0 496 512"><path fill="#DC6965" d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 448c-110.3 0-200-89.7-200-200S137.7 56 248 56s200 89.7 200 200-89.7 200-200 200zm-80-216c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm160-64c-17.7 0-32 14.3-32 32s14.3 32 32 32 32-14.3 32-32-14.3-32-32-32zm-80 128c-40.2 0-78 17.7-103.8 48.6-8.5 10.2-7.1 25.3 3.1 33.8 10.2 8.4 25.3 7.1 33.8-3.1 16.6-19.9 41-31.4 66.9-31.4s50.3 11.4 66.9 31.4c8.1 9.7 23.1 11.9 33.8 3.1 10.2-8.5 11.5-23.6 3.1-33.8C326 321.7 288.2 304 248 304z"></path></svg>')},dotGood:{template:"GREEN_DOT",img:mp('<svg class="o-cf-icon green-dot" width="10" height="10" focusable="false" viewBox="0 0 512 512"><path fill="#00A04A" d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"></path></svg>')},dotNeutral:{template:"YELLOW_DOT",img:mp('<svg class="o-cf-icon yellow-dot" width="10" height="10" focusable="false" viewBox="0 0 512 512"><path fill="#F0AD4E" d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"></path></svg>')},dotBad:{template:"RED_DOT",img:mp('<svg class="o-cf-icon red-dot" width="10" height="10" focusable="false" viewBox="0 0 512 512"><path fill="#DC6965" d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"></path></svg>')}},vp={arrows:{good:"arrowGood",neutral:"arrowNeutral",bad:"arrowBad"},smiley:{good:"smileyGood",neutral:"smileyNeutral",bad:"smileyBad"},dots:{good:"dotGood",neutral:"dotNeutral",bad:"dotBad"}};oi`
807
807
  .o-icon-picker {
808
808
  position: absolute;
809
809
  z-index: ${ae.IconPicker};
@@ -2470,4 +2470,4 @@
2470
2470
  <tableParts count="${e.filterTables.length}">
2471
2471
  ${Ff(a)}
2472
2472
  </tableParts>
2473
- `}var MC;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(MC||(MC={}));const NC={},_C={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:O,HEADER_WIDTH:M,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:N,DEFAULT_CELL_HEIGHT:_,SCROLLBAR_WIDTH:F},FC={autofillModifiersRegistry:Tg,autofillRulesRegistry:Ag,cellMenuRegistry:Mr,colMenuRegistry:Nr,linkMenuRegistry:Pg,functionRegistry:Xd,featurePluginRegistry:fb,statefulUIPluginRegistry:vb,coreViewsPluginRegistry:bb,corePluginRegistry:mb,rowMenuRegistry:_r,sidePanelRegistry:wp,figureRegistry:Hg,sheetMenuRegistry:Zg,chartSidePanelComponentRegistry:gp,chartComponentRegistry:In,chartRegistry:xn,topbarMenuRegistry:Xg,topbarComponentRegistry:yp,clickableCellRegistry:Cb,otRegistry:Yg,inverseCommandRegistry:Wg,urlRegistry:ug,cellPopoverRegistry:Vg},DC={args:Vr,toBoolean:Kr,toJsDate:Qr,toNumber:qr,toString:jr,toXC:kt,toZone:Ao,toCartesian:Dt,numberToLetters:_t,createFullMenuItem:Tn,UuidGenerator:Ro,formatValue:no,computeTextWidth:ke,createEmptyWorkbookData:rv,createEmptySheet:nv,createEmptyExcelSheet:sv,getDefaultChartJsRuntime:Ki,chartFontColor:ki,getMenuChildren:_n,ChartColors:Di,EvaluationError:c,CellErrorLevel:l,getFillingMode:en,rgbaToHex:vt,colorToRGBA:bt,positionToZone:Xo,isDefined:Qe},kC={isMarkdownLink:We,parseMarkdownLink:Ze,markdownLink:qe,openLink:vg,urlRepresentation:fg},$C={ChartPanel:pp,ChartFigure:Bn,ChartJsComponent:Jo,Grid:Hp,GridOverlay:Tp,ScorecardChart:li,LineConfigPanel:cp,LineBarPieDesignPanel:rp,BarConfigPanel:ep,LineBarPieConfigPanel:Jg,GaugeChartConfigPanel:ap,GaugeChartDesignPanel:lp,ScorecardChartConfigPanel:dp,ScorecardChartDesignPanel:up};e.AbstractChart=ui,e.CorePlugin=av,e.DATETIME_FORMAT=j,e.DispatchResult=Ei,e.EvaluationError=c,e.Model=class extends Gv{constructor(e={},o={},i=[],n=new Ro,r=!0){super(),this.corePlugins=[],this.featurePlugins=[],this.statefulUIPlugins=[],this.coreViewsPlugins=[],this.isReplayingCommand=!1,this.renderers=[],this.status=0,this.handlers=[],this.coreHandlers=[],this.dispatch=(e,t)=>{const o={...t,type:e};let i=this.status;if(this.getters.isReadonly()&&(n=o,!bi.has(n.type)))return new Ei(67);var n;if(!this.session.canApplyOptimisticUpdate())return new Ei(64);switch(i){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return t;this.status=1;const{changes:i,commands:n}=this.state.recordChanges((()=>{Si(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize()}));this.session.save(n,i),this.status=0,this.trigger("update");break;case 1:if(Si(o)){const e=this.checkDispatchAllowed(o);if(!e.isSuccessful)return e;this.state.addCommand(o)}this.dispatchToHandlers(this.handlers,o);break;case 3:throw new Error("Cannot dispatch commands in the finalize state");case 2:if(Si(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return Ei.Success},this.dispatchFromCorePlugin=(e,t)=>{const o={...t,type:e},i=this.status;this.status=2;const n=this.isReplayingCommand?[this.range,...this.corePlugins,...this.coreViewsPlugins]:this.handlers;return this.dispatchToHandlers(n,o),this.status=i,Ei.Success},i=ov(e,i);const s=ev(e,r);this.state=new Gb,this.uuidGenerator=n,this.config=this.setupConfig(o),this.session=this.setupSession(s.revisionId),this.history=new Bb(this.dispatchFromCorePlugin,this.session),this.coreGetters={},this.range=new xv(this.coreGetters),this.coreGetters.getRangeString=this.range.getRangeString.bind(this.range),this.coreGetters.getRangeFromSheetXC=this.range.getRangeFromSheetXC.bind(this.range),this.coreGetters.createAdaptedRanges=this.range.createAdaptedRanges.bind(this.range),this.coreGetters.getRangeDataFromXc=this.range.getRangeDataFromXc.bind(this.range),this.coreGetters.getRangeDataFromZone=this.range.getRangeDataFromZone.bind(this.range),this.coreGetters.getRangeFromRangeData=this.range.getRangeFromRangeData.bind(this.range),this.coreGetters.getSelectionRangeString=this.range.getSelectionRangeString.bind(this.range),this.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode,canUndo:this.history.canUndo.bind(this.history),canRedo:this.history.canRedo.bind(this.history),getClient:this.session.getClient.bind(this.session),getConnectedClients:this.session.getConnectedClients.bind(this.session),isFullySynchronized:this.session.isFullySynchronized.bind(this.session)},this.uuidGenerator.setIsFastStrategy(!0),this.selection=new Wb(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of mb.getAll())this.setupCorePlugin(e,s);Object.assign(this.getters,this.coreGetters);for(let e of vb.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t)}for(let e of bb.getAll()){const t=this.setupUiPlugin(e);this.coreViewsPlugins.push(t),this.handlers.push(t),this.coreHandlers.push(t)}for(let e of fb.getAll()){const t=this.setupUiPlugin(e);this.featurePlugins.push(t),this.handlers.push(t)}this.uuidGenerator.setIsFastStrategy(!1),this.handlers.push(this.history),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.session.loadInitialMessages(i),this.joinSession(),o.snapshotRequested&&(this.session.snapshot(this.exportData()),this.garbageCollectExternalResources()),t.markRaw(this)}joinSession(){this.session.join(this.config.client)}leaveSession(){this.session.leave()}setupUiPlugin(e){const t=new e(this.uiPluginConfig);for(let o of e.getters){if(!(o in t))throw new Error(`Invalid getter name: ${o} for plugin ${t.constructor}`);if(o in this.getters)throw new Error(`Getter "${o}" is already defined.`);this.getters[o]=t[o].bind(t)}const o=e.layers.map((e=>[t,e]));return this.renderers.push(...o),this.renderers.sort(((e,t)=>e[1]-t[1])),t}setupCorePlugin(e,t){const o=new e(this.corePluginConfig);for(let t of e.getters){if(!(t in o))throw new Error(`Invalid getter name: ${t} for plugin ${o.constructor}`);if(t in this.coreGetters)throw new Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=o[t].bind(o)}o.import(t),this.corePlugins.push(o),this.coreHandlers.push(o),this.handlers.push(o)}onRemoteRevisionReceived({commands:e}){for(let t of e){const e=this.status;this.status=2,this.dispatchToHandlers(this.statefulUIPlugins,t),this.status=e}this.finalize()}setupSession(e){return new eb(Vb(e,this.state.recordChanges.bind(this.state),(e=>{this.checkDispatchAllowed(e).isSuccessful&&(this.isReplayingCommand=!0,this.dispatchToHandlers([this.range,...this.corePlugins,...this.coreViewsPlugins],e),this.isReplayingCommand=!1)})),this.config.transportService,e)}setupSessionEvents(){this.session.on("remote-revision-received",this,this.onRemoteRevisionReceived),this.session.on("revision-redone",this,this.finalize),this.session.on("revision-undone",this,this.finalize),this.session.on("unexpected-revision-id",this,(()=>this.trigger("unexpected-revision-id"))),this.session.on("collaborative-event-received",this,(()=>{this.trigger("update")}))}setupConfig(e){const t=e.client||{id:this.uuidGenerator.uuidv4(),name:r("Anonymous").toString()},o=e.transportService||new Nb;return{...e,mode:e.mode||"normal",custom:e.custom||{},external:e.external||{},transportService:o,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e),lazyEvaluation:!("lazyEvaluation"in e)||e.lazyEvaluation}}setupCorePluginConfig(){return{getters:this.coreGetters,stateObserver:this.state,range:this.range,dispatch:this.dispatchFromCorePlugin,uuidGenerator:this.uuidGenerator,custom:this.config.custom,external:this.config.external}}setupUiPluginConfig(){return{getters:this.getters,stateObserver:this.state,dispatch:this.dispatch,selection:this.selection,moveClient:this.session.move.bind(this.session),custom:this.config.custom,uiActions:this.config,lazyEvaluation:this.config.lazyEvaluation}}checkDispatchAllowed(e){const t=this.handlers.map((t=>t.allowDispatch(e)));return new Ei(t.flat())}finalize(){this.status=3;for(const e of this.handlers)e.finalize();this.status=0}dispatchToHandlers(e,t){t=Me(t);for(const o of e)o.beforeHandle(t);for(const o of e)o.handle(t)}drawGrid(e){for(let[t,o]of this.renderers)e.ctx.save(),t.drawGrid(e,o),e.ctx.restore()}exportData(){let e=rv();for(let t of this.handlers)t instanceof av&&t.export(e);return e.revisionId=this.session.getRevisionId()||Y,e=Me(e),e}updateMode(e){"normal"!==e&&this.dispatch("STOP_EDITION",{cancel:!0}),this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...rv(),sheets:[sv(Jf,"Sheet1")]};for(let t of this.handlers)t instanceof Hu&&t.exportForExcel(e);return e=Me(e),AC(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.Registry=yn,e.Revision=Qv,e.SPREADSHEET_DIMENSIONS=_C,e.Spreadsheet=Mb,e.UIPlugin=Wu,e.__info__=NC,e.addFunction=function(e,t){Xd.add(e,t)},e.astToFormula=xu,e.compile=Lu,e.components=$C,e.convertAstNodes=yu,e.coreTypes=Ci,e.findCellInNewZone=Zo,e.functionCache=Pu,e.helpers=DC,e.invalidateEvaluationCommands=fi,e.links=kC,e.load=ev,e.parse=Eu,e.readonlyAllowedCommands=bi,e.registries=FC,e.setTranslationMethod=function(e){o=e},e.tokenize=Jd,Object.defineProperty(e,"__esModule",{value:!0}),NC.version="16.1.12",NC.date="2023-05-25T12:56:29.735Z",NC.hash="b80dc51"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
2473
+ `}var MC;!function(e){e[e.Ready=0]="Ready",e[e.Running=1]="Running",e[e.RunningCore=2]="RunningCore",e[e.Finalizing=3]="Finalizing"}(MC||(MC={}));const NC={},_C={MIN_ROW_HEIGHT:10,MIN_COL_WIDTH:5,HEADER_HEIGHT:O,HEADER_WIDTH:M,TOPBAR_HEIGHT:63,BOTTOMBAR_HEIGHT:36,DEFAULT_CELL_WIDTH:N,DEFAULT_CELL_HEIGHT:_,SCROLLBAR_WIDTH:F},FC={autofillModifiersRegistry:Tg,autofillRulesRegistry:Ag,cellMenuRegistry:Mr,colMenuRegistry:Nr,linkMenuRegistry:Pg,functionRegistry:Xd,featurePluginRegistry:fb,statefulUIPluginRegistry:vb,coreViewsPluginRegistry:bb,corePluginRegistry:mb,rowMenuRegistry:_r,sidePanelRegistry:wp,figureRegistry:Hg,sheetMenuRegistry:Zg,chartSidePanelComponentRegistry:gp,chartComponentRegistry:In,chartRegistry:xn,topbarMenuRegistry:Xg,topbarComponentRegistry:yp,clickableCellRegistry:Cb,otRegistry:Yg,inverseCommandRegistry:Wg,urlRegistry:ug,cellPopoverRegistry:Vg},DC={args:Vr,toBoolean:Kr,toJsDate:Qr,toNumber:qr,toString:jr,toXC:kt,toZone:Ao,toCartesian:Dt,numberToLetters:_t,createFullMenuItem:Tn,UuidGenerator:Ro,formatValue:no,computeTextWidth:ke,createEmptyWorkbookData:rv,createEmptySheet:nv,createEmptyExcelSheet:sv,getDefaultChartJsRuntime:Ki,chartFontColor:ki,getMenuChildren:_n,ChartColors:Di,EvaluationError:c,CellErrorLevel:l,getFillingMode:en,rgbaToHex:vt,colorToRGBA:bt,positionToZone:Xo,isDefined:Qe},kC={isMarkdownLink:We,parseMarkdownLink:Ze,markdownLink:qe,openLink:vg,urlRepresentation:fg},$C={ChartPanel:pp,ChartFigure:Bn,ChartJsComponent:Jo,Grid:Hp,GridOverlay:Tp,ScorecardChart:li,LineConfigPanel:cp,LineBarPieDesignPanel:rp,BarConfigPanel:ep,LineBarPieConfigPanel:Jg,GaugeChartConfigPanel:ap,GaugeChartDesignPanel:lp,ScorecardChartConfigPanel:dp,ScorecardChartDesignPanel:up};e.AbstractChart=ui,e.CorePlugin=av,e.DATETIME_FORMAT=j,e.DispatchResult=Ei,e.EvaluationError=c,e.Model=class extends Gv{constructor(e={},o={},i=[],n=new Ro,r=!0){super(),this.corePlugins=[],this.featurePlugins=[],this.statefulUIPlugins=[],this.coreViewsPlugins=[],this.isReplayingCommand=!1,this.renderers=[],this.status=0,this.handlers=[],this.coreHandlers=[],this.dispatch=(e,t)=>{const o={...t,type:e};let i=this.status;if(this.getters.isReadonly()&&(n=o,!bi.has(n.type)))return new Ei(67);var n;if(!this.session.canApplyOptimisticUpdate())return new Ei(64);switch(i){case 0:const t=this.checkDispatchAllowed(o);if(!t.isSuccessful)return t;this.status=1;const{changes:i,commands:n}=this.state.recordChanges((()=>{Si(o)&&this.state.addCommand(o),this.dispatchToHandlers(this.handlers,o),this.finalize()}));this.session.save(n,i),this.status=0,this.trigger("update");break;case 1:if(Si(o)){const e=this.checkDispatchAllowed(o);if(!e.isSuccessful)return e;this.state.addCommand(o)}this.dispatchToHandlers(this.handlers,o);break;case 3:throw new Error("Cannot dispatch commands in the finalize state");case 2:if(Si(o))throw new Error(`A UI plugin cannot dispatch ${e} while handling a core command`);this.dispatchToHandlers(this.handlers,o)}return Ei.Success},this.dispatchFromCorePlugin=(e,t)=>{const o={...t,type:e},i=this.status;this.status=2;const n=this.isReplayingCommand?[this.range,...this.corePlugins,...this.coreViewsPlugins]:this.handlers;return this.dispatchToHandlers(n,o),this.status=i,Ei.Success},i=ov(e,i);const s=ev(e,r);this.state=new Gb,this.uuidGenerator=n,this.config=this.setupConfig(o),this.session=this.setupSession(s.revisionId),this.history=new Bb(this.dispatchFromCorePlugin,this.session),this.coreGetters={},this.range=new xv(this.coreGetters),this.coreGetters.getRangeString=this.range.getRangeString.bind(this.range),this.coreGetters.getRangeFromSheetXC=this.range.getRangeFromSheetXC.bind(this.range),this.coreGetters.createAdaptedRanges=this.range.createAdaptedRanges.bind(this.range),this.coreGetters.getRangeDataFromXc=this.range.getRangeDataFromXc.bind(this.range),this.coreGetters.getRangeDataFromZone=this.range.getRangeDataFromZone.bind(this.range),this.coreGetters.getRangeFromRangeData=this.range.getRangeFromRangeData.bind(this.range),this.coreGetters.getSelectionRangeString=this.range.getSelectionRangeString.bind(this.range),this.getters={isReadonly:()=>"readonly"===this.config.mode||"dashboard"===this.config.mode,isDashboard:()=>"dashboard"===this.config.mode,canUndo:this.history.canUndo.bind(this.history),canRedo:this.history.canRedo.bind(this.history),getClient:this.session.getClient.bind(this.session),getConnectedClients:this.session.getConnectedClients.bind(this.session),isFullySynchronized:this.session.isFullySynchronized.bind(this.session)},this.uuidGenerator.setIsFastStrategy(!0),this.selection=new Wb(this.getters),this.coreHandlers.push(this.range),this.handlers.push(this.range),this.corePluginConfig=this.setupCorePluginConfig(),this.uiPluginConfig=this.setupUiPluginConfig();for(let e of mb.getAll())this.setupCorePlugin(e,s);Object.assign(this.getters,this.coreGetters);for(let e of vb.getAll()){const t=this.setupUiPlugin(e);this.statefulUIPlugins.push(t),this.handlers.push(t)}for(let e of bb.getAll()){const t=this.setupUiPlugin(e);this.coreViewsPlugins.push(t),this.handlers.push(t),this.coreHandlers.push(t)}for(let e of fb.getAll()){const t=this.setupUiPlugin(e);this.featurePlugins.push(t),this.handlers.push(t)}this.uuidGenerator.setIsFastStrategy(!1),this.handlers.push(this.history),this.dispatch("START"),this.selection.observe(this,{handleEvent:()=>this.trigger("update")}),this.setupSessionEvents(),this.session.loadInitialMessages(i),this.joinSession(),o.snapshotRequested&&(this.session.snapshot(this.exportData()),this.garbageCollectExternalResources()),t.markRaw(this)}joinSession(){this.session.join(this.config.client)}leaveSession(){this.session.leave()}setupUiPlugin(e){const t=new e(this.uiPluginConfig);for(let o of e.getters){if(!(o in t))throw new Error(`Invalid getter name: ${o} for plugin ${t.constructor}`);if(o in this.getters)throw new Error(`Getter "${o}" is already defined.`);this.getters[o]=t[o].bind(t)}const o=e.layers.map((e=>[t,e]));return this.renderers.push(...o),this.renderers.sort(((e,t)=>e[1]-t[1])),t}setupCorePlugin(e,t){const o=new e(this.corePluginConfig);for(let t of e.getters){if(!(t in o))throw new Error(`Invalid getter name: ${t} for plugin ${o.constructor}`);if(t in this.coreGetters)throw new Error(`Getter "${t}" is already defined.`);this.coreGetters[t]=o[t].bind(o)}o.import(t),this.corePlugins.push(o),this.coreHandlers.push(o),this.handlers.push(o)}onRemoteRevisionReceived({commands:e}){for(let t of e){const e=this.status;this.status=2,this.dispatchToHandlers(this.statefulUIPlugins,t),this.status=e}this.finalize()}setupSession(e){return new eb(Vb(e,this.state.recordChanges.bind(this.state),(e=>{this.checkDispatchAllowed(e).isSuccessful&&(this.isReplayingCommand=!0,this.dispatchToHandlers([this.range,...this.corePlugins,...this.coreViewsPlugins],e),this.isReplayingCommand=!1)})),this.config.transportService,e)}setupSessionEvents(){this.session.on("remote-revision-received",this,this.onRemoteRevisionReceived),this.session.on("revision-redone",this,this.finalize),this.session.on("revision-undone",this,this.finalize),this.session.on("unexpected-revision-id",this,(()=>this.trigger("unexpected-revision-id"))),this.session.on("collaborative-event-received",this,(()=>{this.trigger("update")}))}setupConfig(e){const t=e.client||{id:this.uuidGenerator.uuidv4(),name:r("Anonymous").toString()},o=e.transportService||new Nb;return{...e,mode:e.mode||"normal",custom:e.custom||{},external:e.external||{},transportService:o,client:t,moveClient:()=>{},snapshotRequested:!1,notifyUI:e=>this.trigger("notify-ui",e),lazyEvaluation:!("lazyEvaluation"in e)||e.lazyEvaluation}}setupCorePluginConfig(){return{getters:this.coreGetters,stateObserver:this.state,range:this.range,dispatch:this.dispatchFromCorePlugin,uuidGenerator:this.uuidGenerator,custom:this.config.custom,external:this.config.external}}setupUiPluginConfig(){return{getters:this.getters,stateObserver:this.state,dispatch:this.dispatch,selection:this.selection,moveClient:this.session.move.bind(this.session),custom:this.config.custom,uiActions:this.config,lazyEvaluation:this.config.lazyEvaluation}}checkDispatchAllowed(e){const t=this.handlers.map((t=>t.allowDispatch(e)));return new Ei(t.flat())}finalize(){this.status=3;for(const e of this.handlers)e.finalize();this.status=0}dispatchToHandlers(e,t){t=Me(t);for(const o of e)o.beforeHandle(t);for(const o of e)o.handle(t)}drawGrid(e){for(let[t,o]of this.renderers)e.ctx.save(),t.drawGrid(e,o),e.ctx.restore()}exportData(){let e=rv();for(let t of this.handlers)t instanceof av&&t.export(e);return e.revisionId=this.session.getRevisionId()||Y,e=Me(e),e}updateMode(e){"normal"!==e&&this.dispatch("STOP_EDITION",{cancel:!0}),this.config.mode=e,this.trigger("update")}exportXLSX(){this.dispatch("EVALUATE_CELLS");let e={...rv(),sheets:[sv(Jf,"Sheet1")]};for(let t of this.handlers)t instanceof Hu&&t.exportForExcel(e);return e=Me(e),AC(e)}garbageCollectExternalResources(){for(const e of this.corePlugins)e.garbageCollectExternalResources()}},e.Registry=yn,e.Revision=Qv,e.SPREADSHEET_DIMENSIONS=_C,e.Spreadsheet=Mb,e.UIPlugin=Wu,e.__info__=NC,e.addFunction=function(e,t){Xd.add(e,t)},e.astToFormula=xu,e.compile=Lu,e.components=$C,e.convertAstNodes=yu,e.coreTypes=Ci,e.findCellInNewZone=Zo,e.functionCache=Pu,e.helpers=DC,e.invalidateEvaluationCommands=fi,e.links=kC,e.load=ev,e.parse=Eu,e.readonlyAllowedCommands=bi,e.registries=FC,e.setTranslationMethod=function(e){o=e},e.tokenize=Jd,Object.defineProperty(e,"__esModule",{value:!0}),NC.version="16.1.13",NC.date="2023-06-02T10:12:21.173Z",NC.hash="5386a5b"}(this.o_spreadsheet=this.o_spreadsheet||{},owl);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odoo/o-spreadsheet",
3
- "version": "16.1.12",
3
+ "version": "16.1.13",
4
4
  "description": "A spreadsheet component",
5
5
  "main": "dist/o-spreadsheet.cjs.js",
6
6
  "browser": "dist/o-spreadsheet.iife.js",