@odoo/o-spreadsheet 16.0.69 → 16.0.71

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.
@@ -2128,7 +2128,7 @@ function convertInternalFormatToFormat(internalFormat) {
2128
2128
  * formula, commas are used to separate arguments
2129
2129
  * - it does not support % symbol, in formulas % is an operator
2130
2130
  */
2131
- const formulaNumberRegexp = /(^-?\d+(\.?\d*(e\d+)?)?|^-?\.\d+)(?!\w|!)/;
2131
+ const formulaNumberRegexp = /(^-?\d+(\.?\d*(e(\+|-)?\d+)?)?|^-?\.\d+)(?!\w|!)/;
2132
2132
  const pIntegerAndDecimals = "(\\d+(,\\d{3,})*(\\.\\d*)?)"; // pattern that match integer number with or without decimal digits
2133
2133
  const pOnlyDecimals = "(\\.\\d+)"; // pattern that match only expression with decimal digits
2134
2134
  const pScientificFormat = "(e(\\+|-)?\\d+)?"; // pattern that match scientific format between zero and one time (should be placed before pPercentFormat)
@@ -17686,6 +17686,9 @@ function isEmpty(value) {
17686
17686
  return value === null || value === undefined;
17687
17687
  }
17688
17688
  const getNeutral = { number: 0, string: "", boolean: false };
17689
+ function areAlmostEqual(value1, value2, epsilon = 2e-16) {
17690
+ return Math.abs(value1 - value2) < epsilon;
17691
+ }
17689
17692
  const EQ = {
17690
17693
  description: _lt(`Equal.`),
17691
17694
  args: args(`
@@ -17702,6 +17705,9 @@ const EQ = {
17702
17705
  if (typeof value2 === "string") {
17703
17706
  value2 = value2.toUpperCase();
17704
17707
  }
17708
+ if (typeof value1 === "number" && typeof value2 === "number") {
17709
+ return areAlmostEqual(value1, value2);
17710
+ }
17705
17711
  return value1 === value2;
17706
17712
  },
17707
17713
  };
@@ -17736,6 +17742,9 @@ const GT = {
17736
17742
  returns: ["BOOLEAN"],
17737
17743
  compute: function (value1, value2) {
17738
17744
  return applyRelationalOperator(value1, value2, (v1, v2) => {
17745
+ if (typeof v1 === "number" && typeof v2 === "number") {
17746
+ return !areAlmostEqual(v1, v2) && v1 > v2;
17747
+ }
17739
17748
  return v1 > v2;
17740
17749
  });
17741
17750
  },
@@ -17752,6 +17761,9 @@ const GTE = {
17752
17761
  returns: ["BOOLEAN"],
17753
17762
  compute: function (value1, value2) {
17754
17763
  return applyRelationalOperator(value1, value2, (v1, v2) => {
17764
+ if (typeof v1 === "number" && typeof v2 === "number") {
17765
+ return areAlmostEqual(v1, v2) || v1 > v2;
17766
+ }
17755
17767
  return v1 >= v2;
17756
17768
  });
17757
17769
  },
@@ -28848,9 +28860,7 @@ class ChartPlugin extends CorePlugin {
28848
28860
  : 0 /* CommandResult.Success */;
28849
28861
  }
28850
28862
  checkChartExists(cmd) {
28851
- return this.getters.getFigureSheetId(cmd.id)
28852
- ? 0 /* CommandResult.Success */
28853
- : 86 /* CommandResult.ChartDoesNotExist */;
28863
+ return this.isChartDefined(cmd.id) ? 0 /* CommandResult.Success */ : 86 /* CommandResult.ChartDoesNotExist */;
28854
28864
  }
28855
28865
  }
28856
28866
  ChartPlugin.getters = [
@@ -43848,6 +43858,6 @@ exports.setTranslationMethod = setTranslationMethod;
43848
43858
  exports.tokenize = tokenize;
43849
43859
 
43850
43860
 
43851
- __info__.version = '16.0.69';
43852
- __info__.date = '2025-05-02T12:27:49.757Z';
43853
- __info__.hash = '51188e8';
43861
+ __info__.version = '16.0.71';
43862
+ __info__.date = '2025-05-13T17:48:09.400Z';
43863
+ __info__.hash = '2ff9f1a';
@@ -2124,7 +2124,7 @@ function convertInternalFormatToFormat(internalFormat) {
2124
2124
  * formula, commas are used to separate arguments
2125
2125
  * - it does not support % symbol, in formulas % is an operator
2126
2126
  */
2127
- const formulaNumberRegexp = /(^-?\d+(\.?\d*(e\d+)?)?|^-?\.\d+)(?!\w|!)/;
2127
+ const formulaNumberRegexp = /(^-?\d+(\.?\d*(e(\+|-)?\d+)?)?|^-?\.\d+)(?!\w|!)/;
2128
2128
  const pIntegerAndDecimals = "(\\d+(,\\d{3,})*(\\.\\d*)?)"; // pattern that match integer number with or without decimal digits
2129
2129
  const pOnlyDecimals = "(\\.\\d+)"; // pattern that match only expression with decimal digits
2130
2130
  const pScientificFormat = "(e(\\+|-)?\\d+)?"; // pattern that match scientific format between zero and one time (should be placed before pPercentFormat)
@@ -17682,6 +17682,9 @@ function isEmpty(value) {
17682
17682
  return value === null || value === undefined;
17683
17683
  }
17684
17684
  const getNeutral = { number: 0, string: "", boolean: false };
17685
+ function areAlmostEqual(value1, value2, epsilon = 2e-16) {
17686
+ return Math.abs(value1 - value2) < epsilon;
17687
+ }
17685
17688
  const EQ = {
17686
17689
  description: _lt(`Equal.`),
17687
17690
  args: args(`
@@ -17698,6 +17701,9 @@ const EQ = {
17698
17701
  if (typeof value2 === "string") {
17699
17702
  value2 = value2.toUpperCase();
17700
17703
  }
17704
+ if (typeof value1 === "number" && typeof value2 === "number") {
17705
+ return areAlmostEqual(value1, value2);
17706
+ }
17701
17707
  return value1 === value2;
17702
17708
  },
17703
17709
  };
@@ -17732,6 +17738,9 @@ const GT = {
17732
17738
  returns: ["BOOLEAN"],
17733
17739
  compute: function (value1, value2) {
17734
17740
  return applyRelationalOperator(value1, value2, (v1, v2) => {
17741
+ if (typeof v1 === "number" && typeof v2 === "number") {
17742
+ return !areAlmostEqual(v1, v2) && v1 > v2;
17743
+ }
17735
17744
  return v1 > v2;
17736
17745
  });
17737
17746
  },
@@ -17748,6 +17757,9 @@ const GTE = {
17748
17757
  returns: ["BOOLEAN"],
17749
17758
  compute: function (value1, value2) {
17750
17759
  return applyRelationalOperator(value1, value2, (v1, v2) => {
17760
+ if (typeof v1 === "number" && typeof v2 === "number") {
17761
+ return areAlmostEqual(v1, v2) || v1 > v2;
17762
+ }
17751
17763
  return v1 >= v2;
17752
17764
  });
17753
17765
  },
@@ -28844,9 +28856,7 @@ class ChartPlugin extends CorePlugin {
28844
28856
  : 0 /* CommandResult.Success */;
28845
28857
  }
28846
28858
  checkChartExists(cmd) {
28847
- return this.getters.getFigureSheetId(cmd.id)
28848
- ? 0 /* CommandResult.Success */
28849
- : 86 /* CommandResult.ChartDoesNotExist */;
28859
+ return this.isChartDefined(cmd.id) ? 0 /* CommandResult.Success */ : 86 /* CommandResult.ChartDoesNotExist */;
28850
28860
  }
28851
28861
  }
28852
28862
  ChartPlugin.getters = [
@@ -43816,6 +43826,6 @@ function addFunction(functionName, functionDescription) {
43816
43826
  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 };
43817
43827
 
43818
43828
 
43819
- __info__.version = '16.0.69';
43820
- __info__.date = '2025-05-02T12:27:49.757Z';
43821
- __info__.hash = '51188e8';
43829
+ __info__.version = '16.0.71';
43830
+ __info__.date = '2025-05-13T17:48:09.400Z';
43831
+ __info__.hash = '2ff9f1a';
@@ -2125,7 +2125,7 @@
2125
2125
  * formula, commas are used to separate arguments
2126
2126
  * - it does not support % symbol, in formulas % is an operator
2127
2127
  */
2128
- const formulaNumberRegexp = /(^-?\d+(\.?\d*(e\d+)?)?|^-?\.\d+)(?!\w|!)/;
2128
+ const formulaNumberRegexp = /(^-?\d+(\.?\d*(e(\+|-)?\d+)?)?|^-?\.\d+)(?!\w|!)/;
2129
2129
  const pIntegerAndDecimals = "(\\d+(,\\d{3,})*(\\.\\d*)?)"; // pattern that match integer number with or without decimal digits
2130
2130
  const pOnlyDecimals = "(\\.\\d+)"; // pattern that match only expression with decimal digits
2131
2131
  const pScientificFormat = "(e(\\+|-)?\\d+)?"; // pattern that match scientific format between zero and one time (should be placed before pPercentFormat)
@@ -17683,6 +17683,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
17683
17683
  return value === null || value === undefined;
17684
17684
  }
17685
17685
  const getNeutral = { number: 0, string: "", boolean: false };
17686
+ function areAlmostEqual(value1, value2, epsilon = 2e-16) {
17687
+ return Math.abs(value1 - value2) < epsilon;
17688
+ }
17686
17689
  const EQ = {
17687
17690
  description: _lt(`Equal.`),
17688
17691
  args: args(`
@@ -17699,6 +17702,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
17699
17702
  if (typeof value2 === "string") {
17700
17703
  value2 = value2.toUpperCase();
17701
17704
  }
17705
+ if (typeof value1 === "number" && typeof value2 === "number") {
17706
+ return areAlmostEqual(value1, value2);
17707
+ }
17702
17708
  return value1 === value2;
17703
17709
  },
17704
17710
  };
@@ -17733,6 +17739,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
17733
17739
  returns: ["BOOLEAN"],
17734
17740
  compute: function (value1, value2) {
17735
17741
  return applyRelationalOperator(value1, value2, (v1, v2) => {
17742
+ if (typeof v1 === "number" && typeof v2 === "number") {
17743
+ return !areAlmostEqual(v1, v2) && v1 > v2;
17744
+ }
17736
17745
  return v1 > v2;
17737
17746
  });
17738
17747
  },
@@ -17749,6 +17758,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
17749
17758
  returns: ["BOOLEAN"],
17750
17759
  compute: function (value1, value2) {
17751
17760
  return applyRelationalOperator(value1, value2, (v1, v2) => {
17761
+ if (typeof v1 === "number" && typeof v2 === "number") {
17762
+ return areAlmostEqual(v1, v2) || v1 > v2;
17763
+ }
17752
17764
  return v1 >= v2;
17753
17765
  });
17754
17766
  },
@@ -28845,9 +28857,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28845
28857
  : 0 /* CommandResult.Success */;
28846
28858
  }
28847
28859
  checkChartExists(cmd) {
28848
- return this.getters.getFigureSheetId(cmd.id)
28849
- ? 0 /* CommandResult.Success */
28850
- : 86 /* CommandResult.ChartDoesNotExist */;
28860
+ return this.isChartDefined(cmd.id) ? 0 /* CommandResult.Success */ : 86 /* CommandResult.ChartDoesNotExist */;
28851
28861
  }
28852
28862
  }
28853
28863
  ChartPlugin.getters = [
@@ -43847,9 +43857,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
43847
43857
  Object.defineProperty(exports, '__esModule', { value: true });
43848
43858
 
43849
43859
 
43850
- __info__.version = '16.0.69';
43851
- __info__.date = '2025-05-02T12:27:49.757Z';
43852
- __info__.hash = '51188e8';
43860
+ __info__.version = '16.0.71';
43861
+ __info__.date = '2025-05-13T17:48:09.400Z';
43862
+ __info__.hash = '2ff9f1a';
43853
43863
 
43854
43864
 
43855
43865
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);