@odoo/o-spreadsheet 18.2.8 → 18.2.9

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.2.8
6
- * @date 2025-04-18T16:26:20.673Z
7
- * @hash 5da9ddc
5
+ * @version 18.2.9
6
+ * @date 2025-04-25T08:06:52.677Z
7
+ * @hash 3e88645
8
8
  */
9
9
 
10
10
  'use strict';
@@ -3843,11 +3843,13 @@ const CellErrorType = {
3843
3843
  NullError: "#NULL!",
3844
3844
  };
3845
3845
  const errorTypes = new Set(Object.values(CellErrorType));
3846
- class EvaluationError extends Error {
3846
+ class EvaluationError {
3847
+ message;
3847
3848
  value;
3848
3849
  constructor(message = _t("Error"), value = CellErrorType.GenericError) {
3849
- super(message);
3850
+ this.message = message;
3850
3851
  this.value = value;
3852
+ this.message = message.toString();
3851
3853
  }
3852
3854
  }
3853
3855
  class BadExpressionError extends EvaluationError {
@@ -13752,7 +13754,7 @@ const RANK = {
13752
13754
  }
13753
13755
  }
13754
13756
  if (!found) {
13755
- throw new NotAvailableError(_t("Value not found in the given data."));
13757
+ return new NotAvailableError(_t("Value not found in the given data."));
13756
13758
  }
13757
13759
  return rank;
13758
13760
  },
@@ -15492,7 +15494,7 @@ const UNIQUE = {
15492
15494
  result.push(row.data);
15493
15495
  }
15494
15496
  if (!result.length)
15495
- throw new EvaluationError(_t("No unique values found"));
15497
+ return new EvaluationError(_t("No unique values found"));
15496
15498
  return _byColumn ? result : transposeMatrix(result);
15497
15499
  },
15498
15500
  isExported: true,
@@ -19271,7 +19273,7 @@ const OFFSET = {
19271
19273
  }
19272
19274
  const _cellReference = cellReference?.value;
19273
19275
  if (!_cellReference) {
19274
- throw new Error("In this context, the function OFFSET needs to have a cell or range in parameter.");
19276
+ return new EvaluationError("In this context, the function OFFSET needs to have a cell or range in parameter.");
19275
19277
  }
19276
19278
  const zone = toZone(_cellReference);
19277
19279
  let offsetHeight = zone.bottom - zone.top + 1;
@@ -39117,7 +39119,7 @@ class ColorPicker extends owl.Component {
39117
39119
  }
39118
39120
  setHexColor(ev) {
39119
39121
  // only support HEX code input
39120
- const val = ev.target.value.slice(0, 7);
39122
+ const val = ev.target.value.replace("##", "#").slice(0, 7);
39121
39123
  this.state.customHexColor = val;
39122
39124
  if (!isColorValid(val)) ;
39123
39125
  else {
@@ -62335,6 +62337,16 @@ function withPivotPresentationLayer (PivotClass) {
62335
62337
  }
62336
62338
  return values;
62337
62339
  }
62340
+ else if (rowDomain.length === this.definition.rows.length &&
62341
+ colDomain.length &&
62342
+ colDomain.length < this.definition.columns.length) {
62343
+ const colSubTree = this.getSubTreeMatchingDomain(table.getColTree(), colDomain);
62344
+ const domains = this.treeToLeafDomains(colSubTree, colDomain);
62345
+ for (const domain of domains) {
62346
+ values.push(this._getPivotCellValueAndFormat(measure.id, rowDomain.concat(domain)));
62347
+ }
62348
+ return values;
62349
+ }
62338
62350
  else {
62339
62351
  const tree = table.getRowTree();
62340
62352
  const subTree = this.getSubTreeMatchingDomain(tree, rowDomain);
@@ -76230,6 +76242,6 @@ exports.tokenColors = tokenColors;
76230
76242
  exports.tokenize = tokenize;
76231
76243
 
76232
76244
 
76233
- __info__.version = "18.2.8";
76234
- __info__.date = "2025-04-18T16:26:20.673Z";
76235
- __info__.hash = "5da9ddc";
76245
+ __info__.version = "18.2.9";
76246
+ __info__.date = "2025-04-25T08:06:52.677Z";
76247
+ __info__.hash = "3e88645";
@@ -11676,7 +11676,8 @@ declare const CellErrorType: {
11676
11676
  readonly GenericError: "#ERROR";
11677
11677
  readonly NullError: "#NULL!";
11678
11678
  };
11679
- declare class EvaluationError extends Error {
11679
+ declare class EvaluationError {
11680
+ readonly message: string;
11680
11681
  readonly value: string;
11681
11682
  constructor(message?: string, value?: string);
11682
11683
  }
@@ -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.2.8
6
- * @date 2025-04-18T16:26:20.673Z
7
- * @hash 5da9ddc
5
+ * @version 18.2.9
6
+ * @date 2025-04-25T08:06:52.677Z
7
+ * @hash 3e88645
8
8
  */
9
9
 
10
10
  import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, App, blockDom, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
@@ -3841,11 +3841,13 @@ const CellErrorType = {
3841
3841
  NullError: "#NULL!",
3842
3842
  };
3843
3843
  const errorTypes = new Set(Object.values(CellErrorType));
3844
- class EvaluationError extends Error {
3844
+ class EvaluationError {
3845
+ message;
3845
3846
  value;
3846
3847
  constructor(message = _t("Error"), value = CellErrorType.GenericError) {
3847
- super(message);
3848
+ this.message = message;
3848
3849
  this.value = value;
3850
+ this.message = message.toString();
3849
3851
  }
3850
3852
  }
3851
3853
  class BadExpressionError extends EvaluationError {
@@ -13750,7 +13752,7 @@ const RANK = {
13750
13752
  }
13751
13753
  }
13752
13754
  if (!found) {
13753
- throw new NotAvailableError(_t("Value not found in the given data."));
13755
+ return new NotAvailableError(_t("Value not found in the given data."));
13754
13756
  }
13755
13757
  return rank;
13756
13758
  },
@@ -15490,7 +15492,7 @@ const UNIQUE = {
15490
15492
  result.push(row.data);
15491
15493
  }
15492
15494
  if (!result.length)
15493
- throw new EvaluationError(_t("No unique values found"));
15495
+ return new EvaluationError(_t("No unique values found"));
15494
15496
  return _byColumn ? result : transposeMatrix(result);
15495
15497
  },
15496
15498
  isExported: true,
@@ -19269,7 +19271,7 @@ const OFFSET = {
19269
19271
  }
19270
19272
  const _cellReference = cellReference?.value;
19271
19273
  if (!_cellReference) {
19272
- throw new Error("In this context, the function OFFSET needs to have a cell or range in parameter.");
19274
+ return new EvaluationError("In this context, the function OFFSET needs to have a cell or range in parameter.");
19273
19275
  }
19274
19276
  const zone = toZone(_cellReference);
19275
19277
  let offsetHeight = zone.bottom - zone.top + 1;
@@ -39115,7 +39117,7 @@ class ColorPicker extends Component {
39115
39117
  }
39116
39118
  setHexColor(ev) {
39117
39119
  // only support HEX code input
39118
- const val = ev.target.value.slice(0, 7);
39120
+ const val = ev.target.value.replace("##", "#").slice(0, 7);
39119
39121
  this.state.customHexColor = val;
39120
39122
  if (!isColorValid(val)) ;
39121
39123
  else {
@@ -62333,6 +62335,16 @@ function withPivotPresentationLayer (PivotClass) {
62333
62335
  }
62334
62336
  return values;
62335
62337
  }
62338
+ else if (rowDomain.length === this.definition.rows.length &&
62339
+ colDomain.length &&
62340
+ colDomain.length < this.definition.columns.length) {
62341
+ const colSubTree = this.getSubTreeMatchingDomain(table.getColTree(), colDomain);
62342
+ const domains = this.treeToLeafDomains(colSubTree, colDomain);
62343
+ for (const domain of domains) {
62344
+ values.push(this._getPivotCellValueAndFormat(measure.id, rowDomain.concat(domain)));
62345
+ }
62346
+ return values;
62347
+ }
62336
62348
  else {
62337
62349
  const tree = table.getRowTree();
62338
62350
  const subTree = this.getSubTreeMatchingDomain(tree, rowDomain);
@@ -76183,6 +76195,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
76183
76195
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, CoreViewPlugin, 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 };
76184
76196
 
76185
76197
 
76186
- __info__.version = "18.2.8";
76187
- __info__.date = "2025-04-18T16:26:20.673Z";
76188
- __info__.hash = "5da9ddc";
76198
+ __info__.version = "18.2.9";
76199
+ __info__.date = "2025-04-25T08:06:52.677Z";
76200
+ __info__.hash = "3e88645";
@@ -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.2.8
6
- * @date 2025-04-18T16:26:20.673Z
7
- * @hash 5da9ddc
5
+ * @version 18.2.9
6
+ * @date 2025-04-25T08:06:52.677Z
7
+ * @hash 3e88645
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -3842,11 +3842,13 @@
3842
3842
  NullError: "#NULL!",
3843
3843
  };
3844
3844
  const errorTypes = new Set(Object.values(CellErrorType));
3845
- class EvaluationError extends Error {
3845
+ class EvaluationError {
3846
+ message;
3846
3847
  value;
3847
3848
  constructor(message = _t("Error"), value = CellErrorType.GenericError) {
3848
- super(message);
3849
+ this.message = message;
3849
3850
  this.value = value;
3851
+ this.message = message.toString();
3850
3852
  }
3851
3853
  }
3852
3854
  class BadExpressionError extends EvaluationError {
@@ -13751,7 +13753,7 @@ stores.inject(MyMetaStore, storeInstance);
13751
13753
  }
13752
13754
  }
13753
13755
  if (!found) {
13754
- throw new NotAvailableError(_t("Value not found in the given data."));
13756
+ return new NotAvailableError(_t("Value not found in the given data."));
13755
13757
  }
13756
13758
  return rank;
13757
13759
  },
@@ -15491,7 +15493,7 @@ stores.inject(MyMetaStore, storeInstance);
15491
15493
  result.push(row.data);
15492
15494
  }
15493
15495
  if (!result.length)
15494
- throw new EvaluationError(_t("No unique values found"));
15496
+ return new EvaluationError(_t("No unique values found"));
15495
15497
  return _byColumn ? result : transposeMatrix(result);
15496
15498
  },
15497
15499
  isExported: true,
@@ -19270,7 +19272,7 @@ stores.inject(MyMetaStore, storeInstance);
19270
19272
  }
19271
19273
  const _cellReference = cellReference?.value;
19272
19274
  if (!_cellReference) {
19273
- throw new Error("In this context, the function OFFSET needs to have a cell or range in parameter.");
19275
+ return new EvaluationError("In this context, the function OFFSET needs to have a cell or range in parameter.");
19274
19276
  }
19275
19277
  const zone = toZone(_cellReference);
19276
19278
  let offsetHeight = zone.bottom - zone.top + 1;
@@ -39116,7 +39118,7 @@ stores.inject(MyMetaStore, storeInstance);
39116
39118
  }
39117
39119
  setHexColor(ev) {
39118
39120
  // only support HEX code input
39119
- const val = ev.target.value.slice(0, 7);
39121
+ const val = ev.target.value.replace("##", "#").slice(0, 7);
39120
39122
  this.state.customHexColor = val;
39121
39123
  if (!isColorValid(val)) ;
39122
39124
  else {
@@ -62334,6 +62336,16 @@ stores.inject(MyMetaStore, storeInstance);
62334
62336
  }
62335
62337
  return values;
62336
62338
  }
62339
+ else if (rowDomain.length === this.definition.rows.length &&
62340
+ colDomain.length &&
62341
+ colDomain.length < this.definition.columns.length) {
62342
+ const colSubTree = this.getSubTreeMatchingDomain(table.getColTree(), colDomain);
62343
+ const domains = this.treeToLeafDomains(colSubTree, colDomain);
62344
+ for (const domain of domains) {
62345
+ values.push(this._getPivotCellValueAndFormat(measure.id, rowDomain.concat(domain)));
62346
+ }
62347
+ return values;
62348
+ }
62337
62349
  else {
62338
62350
  const tree = table.getRowTree();
62339
62351
  const subTree = this.getSubTreeMatchingDomain(tree, rowDomain);
@@ -76229,9 +76241,9 @@ stores.inject(MyMetaStore, storeInstance);
76229
76241
  exports.tokenize = tokenize;
76230
76242
 
76231
76243
 
76232
- __info__.version = "18.2.8";
76233
- __info__.date = "2025-04-18T16:26:20.673Z";
76234
- __info__.hash = "5da9ddc";
76244
+ __info__.version = "18.2.9";
76245
+ __info__.date = "2025-04-25T08:06:52.677Z";
76246
+ __info__.hash = "3e88645";
76235
76247
 
76236
76248
 
76237
76249
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);