@odoo/o-spreadsheet 16.0.10 → 16.0.11

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.
@@ -6575,7 +6575,7 @@
6575
6575
  return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(32 /* CommandResult.InvalidLabelRange */));
6576
6576
  }
6577
6577
  onUpdateDataSetsHaveTitle(ev) {
6578
- this.props.updateChart({
6578
+ this.props.updateChart(this.props.figureId, {
6579
6579
  dataSetsHaveTitle: ev.target.checked,
6580
6580
  });
6581
6581
  }
@@ -6587,7 +6587,7 @@
6587
6587
  this.dataSeriesRanges = ranges;
6588
6588
  }
6589
6589
  onDataSeriesConfirmed() {
6590
- this.state.datasetDispatchResult = this.props.updateChart({
6590
+ this.state.datasetDispatchResult = this.props.updateChart(this.props.figureId, {
6591
6591
  dataSets: this.dataSeriesRanges,
6592
6592
  });
6593
6593
  }
@@ -6599,7 +6599,7 @@
6599
6599
  this.labelRange = ranges[0];
6600
6600
  }
6601
6601
  onLabelRangeConfirmed() {
6602
- this.state.labelsDispatchResult = this.props.updateChart({
6602
+ this.state.labelsDispatchResult = this.props.updateChart(this.props.figureId, {
6603
6603
  labelRange: this.labelRange,
6604
6604
  });
6605
6605
  }
@@ -6609,7 +6609,7 @@
6609
6609
 
6610
6610
  class BarConfigPanel extends LineBarPieConfigPanel {
6611
6611
  onUpdateStacked(ev) {
6612
- this.props.updateChart({
6612
+ this.props.updateChart(this.props.figureId, {
6613
6613
  stacked: ev.target.checked,
6614
6614
  });
6615
6615
  }
@@ -8357,6 +8357,18 @@
8357
8357
  grid-template-columns: repeat(${ITEMS_PER_LINE}, 1fr);
8358
8358
  grid-gap: ${ITEM_HORIZONTAL_MARGIN * 2}px;
8359
8359
  }
8360
+ .o-color-picker-toggler {
8361
+ display: flex;
8362
+ .o-color-picker-toggler-sign {
8363
+ margin: auto auto;
8364
+ width: 55%;
8365
+ height: 55%;
8366
+ .o-icon {
8367
+ width: 100%;
8368
+ height: 100%;
8369
+ }
8370
+ }
8371
+ }
8360
8372
  .o-color-picker-line-item {
8361
8373
  width: ${ITEM_EDGE_LENGTH}px;
8362
8374
  height: ${ITEM_EDGE_LENGTH}px;
@@ -8573,17 +8585,17 @@
8573
8585
  this.state.fillColorTool = !this.state.fillColorTool;
8574
8586
  }
8575
8587
  updateBackgroundColor(color) {
8576
- this.props.updateChart({
8588
+ this.props.updateChart(this.props.figureId, {
8577
8589
  background: color,
8578
8590
  });
8579
8591
  }
8580
8592
  updateTitle(ev) {
8581
- this.props.updateChart({
8593
+ this.props.updateChart(this.props.figureId, {
8582
8594
  title: ev.target.value,
8583
8595
  });
8584
8596
  }
8585
8597
  updateSelect(attr, ev) {
8586
- this.props.updateChart({
8598
+ this.props.updateChart(this.props.figureId, {
8587
8599
  [attr]: ev.target.value,
8588
8600
  });
8589
8601
  }
@@ -8616,7 +8628,7 @@
8616
8628
  this.dataRange = ranges[0];
8617
8629
  }
8618
8630
  updateDataRange() {
8619
- this.state.dataRangeDispatchResult = this.props.updateChart({
8631
+ this.state.dataRangeDispatchResult = this.props.updateChart(this.props.figureId, {
8620
8632
  dataRange: this.dataRange,
8621
8633
  });
8622
8634
  }
@@ -8686,12 +8698,12 @@
8686
8698
  }
8687
8699
  updateBackgroundColor(color) {
8688
8700
  this.state.openedMenu = undefined;
8689
- this.props.updateChart({
8701
+ this.props.updateChart(this.props.figureId, {
8690
8702
  background: color,
8691
8703
  });
8692
8704
  }
8693
8705
  updateTitle(ev) {
8694
- this.props.updateChart({
8706
+ this.props.updateChart(this.props.figureId, {
8695
8707
  title: ev.target.value,
8696
8708
  });
8697
8709
  }
@@ -8760,7 +8772,7 @@
8760
8772
  }
8761
8773
  }
8762
8774
  updateSectionRule(sectionRule) {
8763
- this.state.sectionRuleDispatchResult = this.props.updateChart({
8775
+ this.state.sectionRuleDispatchResult = this.props.updateChart(this.props.figureId, {
8764
8776
  sectionRule,
8765
8777
  });
8766
8778
  }
@@ -8780,12 +8792,12 @@
8780
8792
  return false;
8781
8793
  }
8782
8794
  onUpdateLabelsAsText(ev) {
8783
- this.props.updateChart({
8795
+ this.props.updateChart(this.props.figureId, {
8784
8796
  labelsAsText: ev.target.checked,
8785
8797
  });
8786
8798
  }
8787
8799
  onUpdateStacked(ev) {
8788
- this.props.updateChart({
8800
+ this.props.updateChart(this.props.figureId, {
8789
8801
  stacked: ev.target.checked,
8790
8802
  });
8791
8803
  }
@@ -8826,7 +8838,7 @@
8826
8838
  this.keyValue = ranges[0];
8827
8839
  }
8828
8840
  updateKeyValueRange() {
8829
- this.state.keyValueDispatchResult = this.props.updateChart({
8841
+ this.state.keyValueDispatchResult = this.props.updateChart(this.props.figureId, {
8830
8842
  keyValue: this.keyValue,
8831
8843
  });
8832
8844
  }
@@ -8834,12 +8846,12 @@
8834
8846
  this.baseline = ranges[0];
8835
8847
  }
8836
8848
  updateBaselineRange() {
8837
- this.state.baselineDispatchResult = this.props.updateChart({
8849
+ this.state.baselineDispatchResult = this.props.updateChart(this.props.figureId, {
8838
8850
  baseline: this.baseline,
8839
8851
  });
8840
8852
  }
8841
8853
  updateBaselineMode(ev) {
8842
- this.props.updateChart({ baselineMode: ev.target.value });
8854
+ this.props.updateChart(this.props.figureId, { baselineMode: ev.target.value });
8843
8855
  }
8844
8856
  }
8845
8857
  ScorecardChartConfigPanel.template = "o-spreadsheet-ScorecardChartConfigPanel";
@@ -8859,12 +8871,12 @@
8859
8871
  owl.useExternalListener(window, "click", this.onClick);
8860
8872
  }
8861
8873
  updateTitle(ev) {
8862
- this.props.updateChart({
8874
+ this.props.updateChart(this.props.figureId, {
8863
8875
  title: ev.target.value,
8864
8876
  });
8865
8877
  }
8866
8878
  updateBaselineDescr(ev) {
8867
- this.props.updateChart({ baselineDescr: ev.target.value });
8879
+ this.props.updateChart(this.props.figureId, { baselineDescr: ev.target.value });
8868
8880
  }
8869
8881
  openColorPicker(colorPickerId) {
8870
8882
  this.state.openedColorPicker = colorPickerId;
@@ -8872,13 +8884,13 @@
8872
8884
  setColor(color, colorPickerId) {
8873
8885
  switch (colorPickerId) {
8874
8886
  case "backgroundColor":
8875
- this.props.updateChart({ background: color });
8887
+ this.props.updateChart(this.props.figureId, { background: color });
8876
8888
  break;
8877
8889
  case "baselineColorDown":
8878
- this.props.updateChart({ baselineColorDown: color });
8890
+ this.props.updateChart(this.props.figureId, { baselineColorDown: color });
8879
8891
  break;
8880
8892
  case "baselineColorUp":
8881
- this.props.updateChart({ baselineColorUp: color });
8893
+ this.props.updateChart(this.props.figureId, { baselineColorUp: color });
8882
8894
  break;
8883
8895
  }
8884
8896
  this.state.openedColorPicker = undefined;
@@ -8942,16 +8954,9 @@
8942
8954
  }
8943
8955
  `;
8944
8956
  class ChartPanel extends owl.Component {
8945
- constructor() {
8946
- super(...arguments);
8947
- this.shouldUpdateChart = true;
8948
- }
8949
8957
  get figureId() {
8950
8958
  return this.state.figureId;
8951
8959
  }
8952
- get sheetId() {
8953
- return this.state.sheetId;
8954
- }
8955
8960
  setup() {
8956
8961
  const selectedFigureId = this.env.model.getters.getSelectedFigureId();
8957
8962
  if (!selectedFigureId) {
@@ -8960,17 +8965,11 @@
8960
8965
  this.state = owl.useState({
8961
8966
  panel: "configuration",
8962
8967
  figureId: selectedFigureId,
8963
- sheetId: this.env.model.getters.getActiveSheetId(),
8964
8968
  });
8965
8969
  owl.onWillUpdateProps(() => {
8966
8970
  const selectedFigureId = this.env.model.getters.getSelectedFigureId();
8967
8971
  if (selectedFigureId && selectedFigureId !== this.state.figureId) {
8968
8972
  this.state.figureId = selectedFigureId;
8969
- this.state.sheetId = this.env.model.getters.getActiveSheetId();
8970
- this.shouldUpdateChart = false;
8971
- }
8972
- else {
8973
- this.shouldUpdateChart = true;
8974
8973
  }
8975
8974
  if (!this.env.model.getters.isChartDefined(this.figureId)) {
8976
8975
  this.props.onCloseSidePanel();
@@ -8978,8 +8977,8 @@
8978
8977
  }
8979
8978
  });
8980
8979
  }
8981
- updateChart(updateDefinition) {
8982
- if (!this.shouldUpdateChart) {
8980
+ updateChart(figureId, updateDefinition) {
8981
+ if (figureId !== this.figureId) {
8983
8982
  return;
8984
8983
  }
8985
8984
  const definition = {
@@ -8988,8 +8987,8 @@
8988
8987
  };
8989
8988
  return this.env.model.dispatch("UPDATE_CHART", {
8990
8989
  definition,
8991
- id: this.figureId,
8992
- sheetId: this.sheetId,
8990
+ id: figureId,
8991
+ sheetId: this.env.model.getters.getFigureSheetId(figureId),
8993
8992
  });
8994
8993
  }
8995
8994
  onTypeChange(type) {
@@ -9001,7 +9000,7 @@
9001
9000
  this.env.model.dispatch("UPDATE_CHART", {
9002
9001
  definition,
9003
9002
  id: this.figureId,
9004
- sheetId: this.sheetId,
9003
+ sheetId: this.env.model.getters.getFigureSheetId(this.figureId),
9005
9004
  });
9006
9005
  }
9007
9006
  get chartPanel() {
@@ -42802,9 +42801,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
42802
42801
  Object.defineProperty(exports, '__esModule', { value: true });
42803
42802
 
42804
42803
 
42805
- __info__.version = '16.0.10';
42806
- __info__.date = '2023-05-12T10:59:27.820Z';
42807
- __info__.hash = '115eda7';
42804
+ __info__.version = '16.0.11';
42805
+ __info__.date = '2023-05-25T12:57:28.152Z';
42806
+ __info__.hash = 'd27e998';
42808
42807
 
42809
42808
 
42810
42809
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);