@odoo/o-spreadsheet 16.0.2 → 16.0.3

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.
@@ -8386,7 +8386,7 @@ class ColorPicker extends owl.Component {
8386
8386
  }
8387
8387
  onColorClick(color) {
8388
8388
  if (color) {
8389
- this.props.onColorPicked(color);
8389
+ this.props.onColorPicked(toHex(color));
8390
8390
  }
8391
8391
  }
8392
8392
  getCheckMarkColor() {
@@ -8401,8 +8401,10 @@ class ColorPicker extends owl.Component {
8401
8401
  this.state.isCurrentColorInvalid = true;
8402
8402
  return;
8403
8403
  }
8404
+ const color = toHex(this.state.currentColor);
8404
8405
  this.state.isCurrentColorInvalid = false;
8405
- this.props.onColorPicked(this.state.currentColor);
8406
+ this.props.onColorPicked(color);
8407
+ this.state.currentColor = color;
8406
8408
  }
8407
8409
  toggleColorPicker() {
8408
8410
  this.state.showGradient = !this.state.showGradient;
@@ -10039,7 +10041,7 @@ class ScorecardChart extends owl.Component {
10039
10041
  return this.runtime.fontColor;
10040
10042
  }
10041
10043
  get secondaryFontColor() {
10042
- return relativeLuminance(this.primaryFontColor) <= 0.3 ? "#757575" : "#bbbbbb";
10044
+ return relativeLuminance(this.backgroundColor) > 0.3 ? "#525252" : "#C8C8C8";
10043
10045
  }
10044
10046
  get figure() {
10045
10047
  return this.props.figure;
@@ -32770,6 +32772,9 @@ class FilterEvaluationPlugin extends UIPlugin {
32770
32772
  case "CREATE_SHEET":
32771
32773
  this.filterValues[cmd.sheetId] = {};
32772
32774
  break;
32775
+ case "HIDE_COLUMNS_ROWS":
32776
+ this.updateHiddenRows();
32777
+ break;
32773
32778
  case "UPDATE_FILTER":
32774
32779
  this.updateFilter(cmd);
32775
32780
  this.updateHiddenRows();
@@ -32871,9 +32876,16 @@ class FilterEvaluationPlugin extends UIPlugin {
32871
32876
  updateHiddenRows() {
32872
32877
  var _a, _b;
32873
32878
  const sheetId = this.getters.getActiveSheetId();
32874
- const filters = this.getters.getFilters(sheetId);
32879
+ const filters = this.getters
32880
+ .getFilters(sheetId)
32881
+ .sort((filter1, filter2) => filter1.zoneWithHeaders.top - filter2.zoneWithHeaders.top);
32875
32882
  const hiddenRows = new Set();
32876
32883
  for (let filter of filters) {
32884
+ // Disable filters whose header are hidden
32885
+ if (this.getters.isRowHiddenByUser(sheetId, filter.zoneWithHeaders.top))
32886
+ continue;
32887
+ if (hiddenRows.has(filter.zoneWithHeaders.top))
32888
+ continue;
32877
32889
  const filteredValues = (_b = (_a = this.filterValues[sheetId]) === null || _a === void 0 ? void 0 : _a[filter.id]) === null || _b === void 0 ? void 0 : _b.map(toLowerCase);
32878
32890
  if (!filteredValues || !filter.filteredZone)
32879
32891
  continue;
@@ -42455,6 +42467,6 @@ exports.setTranslationMethod = setTranslationMethod;
42455
42467
  exports.tokenize = tokenize;
42456
42468
 
42457
42469
 
42458
- __info__.version = '16.0.2';
42459
- __info__.date = '2023-03-06T07:17:51.313Z';
42460
- __info__.hash = '6b4d816';
42470
+ __info__.version = '16.0.3';
42471
+ __info__.date = '2023-03-14T09:22:56.932Z';
42472
+ __info__.hash = '4deeca9';
@@ -5148,7 +5148,7 @@ declare class ScorecardChart extends Component<Props$q, SpreadsheetChildEnv> {
5148
5148
  get baselineArrowDirection(): BaselineArrowDirection;
5149
5149
  get backgroundColor(): string;
5150
5150
  get primaryFontColor(): string;
5151
- get secondaryFontColor(): "#757575" | "#bbbbbb";
5151
+ get secondaryFontColor(): "#525252" | "#C8C8C8";
5152
5152
  get figure(): Figure;
5153
5153
  get chartStyle(): string;
5154
5154
  get chartContentStyle(): string;
@@ -8382,7 +8382,7 @@ class ColorPicker extends Component {
8382
8382
  }
8383
8383
  onColorClick(color) {
8384
8384
  if (color) {
8385
- this.props.onColorPicked(color);
8385
+ this.props.onColorPicked(toHex(color));
8386
8386
  }
8387
8387
  }
8388
8388
  getCheckMarkColor() {
@@ -8397,8 +8397,10 @@ class ColorPicker extends Component {
8397
8397
  this.state.isCurrentColorInvalid = true;
8398
8398
  return;
8399
8399
  }
8400
+ const color = toHex(this.state.currentColor);
8400
8401
  this.state.isCurrentColorInvalid = false;
8401
- this.props.onColorPicked(this.state.currentColor);
8402
+ this.props.onColorPicked(color);
8403
+ this.state.currentColor = color;
8402
8404
  }
8403
8405
  toggleColorPicker() {
8404
8406
  this.state.showGradient = !this.state.showGradient;
@@ -10035,7 +10037,7 @@ class ScorecardChart extends Component {
10035
10037
  return this.runtime.fontColor;
10036
10038
  }
10037
10039
  get secondaryFontColor() {
10038
- return relativeLuminance(this.primaryFontColor) <= 0.3 ? "#757575" : "#bbbbbb";
10040
+ return relativeLuminance(this.backgroundColor) > 0.3 ? "#525252" : "#C8C8C8";
10039
10041
  }
10040
10042
  get figure() {
10041
10043
  return this.props.figure;
@@ -32766,6 +32768,9 @@ class FilterEvaluationPlugin extends UIPlugin {
32766
32768
  case "CREATE_SHEET":
32767
32769
  this.filterValues[cmd.sheetId] = {};
32768
32770
  break;
32771
+ case "HIDE_COLUMNS_ROWS":
32772
+ this.updateHiddenRows();
32773
+ break;
32769
32774
  case "UPDATE_FILTER":
32770
32775
  this.updateFilter(cmd);
32771
32776
  this.updateHiddenRows();
@@ -32867,9 +32872,16 @@ class FilterEvaluationPlugin extends UIPlugin {
32867
32872
  updateHiddenRows() {
32868
32873
  var _a, _b;
32869
32874
  const sheetId = this.getters.getActiveSheetId();
32870
- const filters = this.getters.getFilters(sheetId);
32875
+ const filters = this.getters
32876
+ .getFilters(sheetId)
32877
+ .sort((filter1, filter2) => filter1.zoneWithHeaders.top - filter2.zoneWithHeaders.top);
32871
32878
  const hiddenRows = new Set();
32872
32879
  for (let filter of filters) {
32880
+ // Disable filters whose header are hidden
32881
+ if (this.getters.isRowHiddenByUser(sheetId, filter.zoneWithHeaders.top))
32882
+ continue;
32883
+ if (hiddenRows.has(filter.zoneWithHeaders.top))
32884
+ continue;
32873
32885
  const filteredValues = (_b = (_a = this.filterValues[sheetId]) === null || _a === void 0 ? void 0 : _a[filter.id]) === null || _b === void 0 ? void 0 : _b.map(toLowerCase);
32874
32886
  if (!filteredValues || !filter.filteredZone)
32875
32887
  continue;
@@ -42423,6 +42435,6 @@ function addFunction(functionName, functionDescription) {
42423
42435
  export { AbstractChart, CommandResult, CorePlugin, DATETIME_FORMAT, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, cellTypes, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, load, parse, readonlyAllowedCommands, registries, setTranslationMethod, tokenize };
42424
42436
 
42425
42437
 
42426
- __info__.version = '16.0.2';
42427
- __info__.date = '2023-03-06T07:17:51.313Z';
42428
- __info__.hash = '6b4d816';
42438
+ __info__.version = '16.0.3';
42439
+ __info__.date = '2023-03-14T09:22:56.932Z';
42440
+ __info__.hash = '4deeca9';
@@ -8383,7 +8383,7 @@
8383
8383
  }
8384
8384
  onColorClick(color) {
8385
8385
  if (color) {
8386
- this.props.onColorPicked(color);
8386
+ this.props.onColorPicked(toHex(color));
8387
8387
  }
8388
8388
  }
8389
8389
  getCheckMarkColor() {
@@ -8398,8 +8398,10 @@
8398
8398
  this.state.isCurrentColorInvalid = true;
8399
8399
  return;
8400
8400
  }
8401
+ const color = toHex(this.state.currentColor);
8401
8402
  this.state.isCurrentColorInvalid = false;
8402
- this.props.onColorPicked(this.state.currentColor);
8403
+ this.props.onColorPicked(color);
8404
+ this.state.currentColor = color;
8403
8405
  }
8404
8406
  toggleColorPicker() {
8405
8407
  this.state.showGradient = !this.state.showGradient;
@@ -10036,7 +10038,7 @@
10036
10038
  return this.runtime.fontColor;
10037
10039
  }
10038
10040
  get secondaryFontColor() {
10039
- return relativeLuminance(this.primaryFontColor) <= 0.3 ? "#757575" : "#bbbbbb";
10041
+ return relativeLuminance(this.backgroundColor) > 0.3 ? "#525252" : "#C8C8C8";
10040
10042
  }
10041
10043
  get figure() {
10042
10044
  return this.props.figure;
@@ -32767,6 +32769,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
32767
32769
  case "CREATE_SHEET":
32768
32770
  this.filterValues[cmd.sheetId] = {};
32769
32771
  break;
32772
+ case "HIDE_COLUMNS_ROWS":
32773
+ this.updateHiddenRows();
32774
+ break;
32770
32775
  case "UPDATE_FILTER":
32771
32776
  this.updateFilter(cmd);
32772
32777
  this.updateHiddenRows();
@@ -32868,9 +32873,16 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
32868
32873
  updateHiddenRows() {
32869
32874
  var _a, _b;
32870
32875
  const sheetId = this.getters.getActiveSheetId();
32871
- const filters = this.getters.getFilters(sheetId);
32876
+ const filters = this.getters
32877
+ .getFilters(sheetId)
32878
+ .sort((filter1, filter2) => filter1.zoneWithHeaders.top - filter2.zoneWithHeaders.top);
32872
32879
  const hiddenRows = new Set();
32873
32880
  for (let filter of filters) {
32881
+ // Disable filters whose header are hidden
32882
+ if (this.getters.isRowHiddenByUser(sheetId, filter.zoneWithHeaders.top))
32883
+ continue;
32884
+ if (hiddenRows.has(filter.zoneWithHeaders.top))
32885
+ continue;
32874
32886
  const filteredValues = (_b = (_a = this.filterValues[sheetId]) === null || _a === void 0 ? void 0 : _a[filter.id]) === null || _b === void 0 ? void 0 : _b.map(toLowerCase);
32875
32887
  if (!filteredValues || !filter.filteredZone)
32876
32888
  continue;
@@ -42454,9 +42466,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
42454
42466
  Object.defineProperty(exports, '__esModule', { value: true });
42455
42467
 
42456
42468
 
42457
- __info__.version = '16.0.2';
42458
- __info__.date = '2023-03-06T07:17:51.313Z';
42459
- __info__.hash = '6b4d816';
42469
+ __info__.version = '16.0.3';
42470
+ __info__.date = '2023-03-14T09:22:56.932Z';
42471
+ __info__.hash = '4deeca9';
42460
42472
 
42461
42473
 
42462
42474
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);