@odoo/o-spreadsheet 18.1.16 → 18.1.17

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.
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 18.1.16
6
- * @date 2025-04-18T16:24:16.854Z
7
- * @hash 19f6de2
5
+ * @version 18.1.17
6
+ * @date 2025-04-25T08:08:46.599Z
7
+ * @hash a63687f
8
8
  */
9
9
 
10
10
  'use strict';
@@ -3834,11 +3834,13 @@ const CellErrorType = {
3834
3834
  NullError: "#NULL!",
3835
3835
  };
3836
3836
  const errorTypes = new Set(Object.values(CellErrorType));
3837
- class EvaluationError extends Error {
3837
+ class EvaluationError {
3838
+ message;
3838
3839
  value;
3839
3840
  constructor(message = _t("Error"), value = CellErrorType.GenericError) {
3840
- super(message);
3841
+ this.message = message;
3841
3842
  this.value = value;
3843
+ this.message = message.toString();
3842
3844
  }
3843
3845
  }
3844
3846
  class BadExpressionError extends EvaluationError {
@@ -13579,7 +13581,7 @@ const RANK = {
13579
13581
  }
13580
13582
  }
13581
13583
  if (!found) {
13582
- throw new NotAvailableError(_t("Value not found in the given data."));
13584
+ return new NotAvailableError(_t("Value not found in the given data."));
13583
13585
  }
13584
13586
  return rank;
13585
13587
  },
@@ -15319,7 +15321,7 @@ const UNIQUE = {
15319
15321
  result.push(row.data);
15320
15322
  }
15321
15323
  if (!result.length)
15322
- throw new EvaluationError(_t("No unique values found"));
15324
+ return new EvaluationError(_t("No unique values found"));
15323
15325
  return _byColumn ? result : transposeMatrix(result);
15324
15326
  },
15325
15327
  isExported: true,
@@ -19098,7 +19100,7 @@ const OFFSET = {
19098
19100
  }
19099
19101
  const _cellReference = cellReference?.value;
19100
19102
  if (!_cellReference) {
19101
- throw new Error("In this context, the function OFFSET needs to have a cell or range in parameter.");
19103
+ return new EvaluationError("In this context, the function OFFSET needs to have a cell or range in parameter.");
19102
19104
  }
19103
19105
  const zone = toZone(_cellReference);
19104
19106
  let offsetHeight = zone.bottom - zone.top + 1;
@@ -38561,7 +38563,7 @@ class ColorPicker extends owl.Component {
38561
38563
  }
38562
38564
  setHexColor(ev) {
38563
38565
  // only support HEX code input
38564
- const val = ev.target.value.slice(0, 7);
38566
+ const val = ev.target.value.replace("##", "#").slice(0, 7);
38565
38567
  this.state.customHexColor = val;
38566
38568
  if (!isColorValid(val)) ;
38567
38569
  else {
@@ -61873,6 +61875,16 @@ function withPivotPresentationLayer (PivotClass) {
61873
61875
  }
61874
61876
  return values;
61875
61877
  }
61878
+ else if (rowDomain.length === this.definition.rows.length &&
61879
+ colDomain.length &&
61880
+ colDomain.length < this.definition.columns.length) {
61881
+ const colSubTree = this.getSubTreeMatchingDomain(table.getColTree(), colDomain);
61882
+ const domains = this.treeToLeafDomains(colSubTree, colDomain);
61883
+ for (const domain of domains) {
61884
+ values.push(this._getPivotCellValueAndFormat(measure.id, rowDomain.concat(domain)));
61885
+ }
61886
+ return values;
61887
+ }
61876
61888
  else {
61877
61889
  const tree = table.getRowTree();
61878
61890
  const subTree = this.getSubTreeMatchingDomain(tree, rowDomain);
@@ -75769,6 +75781,6 @@ exports.tokenColors = tokenColors;
75769
75781
  exports.tokenize = tokenize;
75770
75782
 
75771
75783
 
75772
- __info__.version = "18.1.16";
75773
- __info__.date = "2025-04-18T16:24:16.854Z";
75774
- __info__.hash = "19f6de2";
75784
+ __info__.version = "18.1.17";
75785
+ __info__.date = "2025-04-25T08:08:46.599Z";
75786
+ __info__.hash = "a63687f";
@@ -11522,7 +11522,8 @@ declare const CellErrorType: {
11522
11522
  readonly GenericError: "#ERROR";
11523
11523
  readonly NullError: "#NULL!";
11524
11524
  };
11525
- declare class EvaluationError extends Error {
11525
+ declare class EvaluationError {
11526
+ readonly message: string;
11526
11527
  readonly value: string;
11527
11528
  constructor(message?: string, value?: string);
11528
11529
  }
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 18.1.16
6
- * @date 2025-04-18T16:24:16.854Z
7
- * @hash 19f6de2
5
+ * @version 18.1.17
6
+ * @date 2025-04-25T08:08:46.599Z
7
+ * @hash a63687f
8
8
  */
9
9
 
10
10
  import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
@@ -3832,11 +3832,13 @@ const CellErrorType = {
3832
3832
  NullError: "#NULL!",
3833
3833
  };
3834
3834
  const errorTypes = new Set(Object.values(CellErrorType));
3835
- class EvaluationError extends Error {
3835
+ class EvaluationError {
3836
+ message;
3836
3837
  value;
3837
3838
  constructor(message = _t("Error"), value = CellErrorType.GenericError) {
3838
- super(message);
3839
+ this.message = message;
3839
3840
  this.value = value;
3841
+ this.message = message.toString();
3840
3842
  }
3841
3843
  }
3842
3844
  class BadExpressionError extends EvaluationError {
@@ -13577,7 +13579,7 @@ const RANK = {
13577
13579
  }
13578
13580
  }
13579
13581
  if (!found) {
13580
- throw new NotAvailableError(_t("Value not found in the given data."));
13582
+ return new NotAvailableError(_t("Value not found in the given data."));
13581
13583
  }
13582
13584
  return rank;
13583
13585
  },
@@ -15317,7 +15319,7 @@ const UNIQUE = {
15317
15319
  result.push(row.data);
15318
15320
  }
15319
15321
  if (!result.length)
15320
- throw new EvaluationError(_t("No unique values found"));
15322
+ return new EvaluationError(_t("No unique values found"));
15321
15323
  return _byColumn ? result : transposeMatrix(result);
15322
15324
  },
15323
15325
  isExported: true,
@@ -19096,7 +19098,7 @@ const OFFSET = {
19096
19098
  }
19097
19099
  const _cellReference = cellReference?.value;
19098
19100
  if (!_cellReference) {
19099
- throw new Error("In this context, the function OFFSET needs to have a cell or range in parameter.");
19101
+ return new EvaluationError("In this context, the function OFFSET needs to have a cell or range in parameter.");
19100
19102
  }
19101
19103
  const zone = toZone(_cellReference);
19102
19104
  let offsetHeight = zone.bottom - zone.top + 1;
@@ -38559,7 +38561,7 @@ class ColorPicker extends Component {
38559
38561
  }
38560
38562
  setHexColor(ev) {
38561
38563
  // only support HEX code input
38562
- const val = ev.target.value.slice(0, 7);
38564
+ const val = ev.target.value.replace("##", "#").slice(0, 7);
38563
38565
  this.state.customHexColor = val;
38564
38566
  if (!isColorValid(val)) ;
38565
38567
  else {
@@ -61871,6 +61873,16 @@ function withPivotPresentationLayer (PivotClass) {
61871
61873
  }
61872
61874
  return values;
61873
61875
  }
61876
+ else if (rowDomain.length === this.definition.rows.length &&
61877
+ colDomain.length &&
61878
+ colDomain.length < this.definition.columns.length) {
61879
+ const colSubTree = this.getSubTreeMatchingDomain(table.getColTree(), colDomain);
61880
+ const domains = this.treeToLeafDomains(colSubTree, colDomain);
61881
+ for (const domain of domains) {
61882
+ values.push(this._getPivotCellValueAndFormat(measure.id, rowDomain.concat(domain)));
61883
+ }
61884
+ return values;
61885
+ }
61874
61886
  else {
61875
61887
  const tree = table.getRowTree();
61876
61888
  const subTree = this.getSubTreeMatchingDomain(tree, rowDomain);
@@ -75723,6 +75735,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
75723
75735
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, chartHelpers, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
75724
75736
 
75725
75737
 
75726
- __info__.version = "18.1.16";
75727
- __info__.date = "2025-04-18T16:24:16.854Z";
75728
- __info__.hash = "19f6de2";
75738
+ __info__.version = "18.1.17";
75739
+ __info__.date = "2025-04-25T08:08:46.599Z";
75740
+ __info__.hash = "a63687f";
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 18.1.16
6
- * @date 2025-04-18T16:24:16.854Z
7
- * @hash 19f6de2
5
+ * @version 18.1.17
6
+ * @date 2025-04-25T08:08:46.599Z
7
+ * @hash a63687f
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -3833,11 +3833,13 @@
3833
3833
  NullError: "#NULL!",
3834
3834
  };
3835
3835
  const errorTypes = new Set(Object.values(CellErrorType));
3836
- class EvaluationError extends Error {
3836
+ class EvaluationError {
3837
+ message;
3837
3838
  value;
3838
3839
  constructor(message = _t("Error"), value = CellErrorType.GenericError) {
3839
- super(message);
3840
+ this.message = message;
3840
3841
  this.value = value;
3842
+ this.message = message.toString();
3841
3843
  }
3842
3844
  }
3843
3845
  class BadExpressionError extends EvaluationError {
@@ -13578,7 +13580,7 @@ stores.inject(MyMetaStore, storeInstance);
13578
13580
  }
13579
13581
  }
13580
13582
  if (!found) {
13581
- throw new NotAvailableError(_t("Value not found in the given data."));
13583
+ return new NotAvailableError(_t("Value not found in the given data."));
13582
13584
  }
13583
13585
  return rank;
13584
13586
  },
@@ -15318,7 +15320,7 @@ stores.inject(MyMetaStore, storeInstance);
15318
15320
  result.push(row.data);
15319
15321
  }
15320
15322
  if (!result.length)
15321
- throw new EvaluationError(_t("No unique values found"));
15323
+ return new EvaluationError(_t("No unique values found"));
15322
15324
  return _byColumn ? result : transposeMatrix(result);
15323
15325
  },
15324
15326
  isExported: true,
@@ -19097,7 +19099,7 @@ stores.inject(MyMetaStore, storeInstance);
19097
19099
  }
19098
19100
  const _cellReference = cellReference?.value;
19099
19101
  if (!_cellReference) {
19100
- throw new Error("In this context, the function OFFSET needs to have a cell or range in parameter.");
19102
+ return new EvaluationError("In this context, the function OFFSET needs to have a cell or range in parameter.");
19101
19103
  }
19102
19104
  const zone = toZone(_cellReference);
19103
19105
  let offsetHeight = zone.bottom - zone.top + 1;
@@ -38560,7 +38562,7 @@ stores.inject(MyMetaStore, storeInstance);
38560
38562
  }
38561
38563
  setHexColor(ev) {
38562
38564
  // only support HEX code input
38563
- const val = ev.target.value.slice(0, 7);
38565
+ const val = ev.target.value.replace("##", "#").slice(0, 7);
38564
38566
  this.state.customHexColor = val;
38565
38567
  if (!isColorValid(val)) ;
38566
38568
  else {
@@ -61872,6 +61874,16 @@ stores.inject(MyMetaStore, storeInstance);
61872
61874
  }
61873
61875
  return values;
61874
61876
  }
61877
+ else if (rowDomain.length === this.definition.rows.length &&
61878
+ colDomain.length &&
61879
+ colDomain.length < this.definition.columns.length) {
61880
+ const colSubTree = this.getSubTreeMatchingDomain(table.getColTree(), colDomain);
61881
+ const domains = this.treeToLeafDomains(colSubTree, colDomain);
61882
+ for (const domain of domains) {
61883
+ values.push(this._getPivotCellValueAndFormat(measure.id, rowDomain.concat(domain)));
61884
+ }
61885
+ return values;
61886
+ }
61875
61887
  else {
61876
61888
  const tree = table.getRowTree();
61877
61889
  const subTree = this.getSubTreeMatchingDomain(tree, rowDomain);
@@ -75768,9 +75780,9 @@ stores.inject(MyMetaStore, storeInstance);
75768
75780
  exports.tokenize = tokenize;
75769
75781
 
75770
75782
 
75771
- __info__.version = "18.1.16";
75772
- __info__.date = "2025-04-18T16:24:16.854Z";
75773
- __info__.hash = "19f6de2";
75783
+ __info__.version = "18.1.17";
75784
+ __info__.date = "2025-04-25T08:08:46.599Z";
75785
+ __info__.hash = "a63687f";
75774
75786
 
75775
75787
 
75776
75788
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);