@odoo/o-spreadsheet 18.3.57 → 18.3.59

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.3.57
6
- * @date 2026-07-23T07:55:40.361Z
7
- * @hash e80e027
5
+ * @version 18.3.59
6
+ * @date 2026-08-10T12:30:18.612Z
7
+ * @hash c215f06
8
8
  */
9
9
  /* Originates from src/components/top_bar/top_bar.scss */
10
10
  @media (max-width: 900px) {
@@ -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.3.57
6
- * @date 2026-07-23T07:55:39.159Z
7
- * @hash e80e027
5
+ * @version 18.3.59
6
+ * @date 2026-08-10T12:30:17.132Z
7
+ * @hash c215f06
8
8
  */
9
9
 
10
10
  import { App, Component, blockDom, markRaw, onMounted, onPatched, onWillPatch, onWillStart, onWillUnmount, onWillUpdateProps, status, toRaw, useChildSubEnv, useComponent, useEffect, useEnv, useExternalListener, useRef, useState, useSubEnv, xml } from "@odoo/owl";
@@ -3646,19 +3646,58 @@ function applyVectorization(formula, args, acceptToVectorize = void 0) {
3646
3646
  }
3647
3647
  }
3648
3648
  if (countVectorizedCol === 1 && countVectorizedRow === 1) return formula(...args);
3649
- const getArgOffset = (i, j) => args.map((arg, index) => {
3650
- switch (vectorArgsType?.[index]) {
3651
- case "matrix": return arg[i][j];
3652
- case "horizontal": return arg[i][0];
3653
- case "vertical": return arg[0][j];
3654
- case void 0: return arg;
3649
+ const argsBuffer = new Array(args.length);
3650
+ const argGetters = [];
3651
+ const vectorizedIndices = [];
3652
+ for (let k = 0; k < args.length; k++) {
3653
+ const arg = args[k];
3654
+ switch (vectorArgsType?.[k]) {
3655
+ case "matrix":
3656
+ argGetters.push((i, j) => arg[i][j]);
3657
+ vectorizedIndices.push(k);
3658
+ break;
3659
+ case "horizontal":
3660
+ argGetters.push((i) => arg[i][0]);
3661
+ vectorizedIndices.push(k);
3662
+ break;
3663
+ case "vertical":
3664
+ argGetters.push((_i, j) => arg[0][j]);
3665
+ vectorizedIndices.push(k);
3666
+ break;
3667
+ case void 0:
3668
+ argsBuffer[k] = arg;
3669
+ break;
3655
3670
  }
3656
- });
3657
- return generateMatrix(countVectorizedCol, countVectorizedRow, (col, row) => {
3658
- if (col > vectorizedColLimit - 1 || row > vectorizedRowLimit - 1) return new NotAvailableError(_t("Array arguments to [[FUNCTION_NAME]] are of different size."));
3659
- const singleCellComputeResult = formula(...getArgOffset(col, row));
3660
- return isMatrix(singleCellComputeResult) ? singleCellComputeResult[0][0] : singleCellComputeResult;
3661
- });
3671
+ }
3672
+ const nbVectorized = vectorizedIndices.length;
3673
+ let callFormula;
3674
+ switch (argsBuffer.length) {
3675
+ case 1:
3676
+ callFormula = () => formula(argsBuffer[0]);
3677
+ break;
3678
+ case 2:
3679
+ callFormula = () => formula(argsBuffer[0], argsBuffer[1]);
3680
+ break;
3681
+ case 3:
3682
+ callFormula = () => formula(argsBuffer[0], argsBuffer[1], argsBuffer[2]);
3683
+ break;
3684
+ default: callFormula = () => formula(...argsBuffer);
3685
+ }
3686
+ const result = new Array(countVectorizedCol);
3687
+ for (let col = 0; col < countVectorizedCol; col++) {
3688
+ const column = new Array(countVectorizedRow);
3689
+ result[col] = column;
3690
+ for (let row = 0; row < countVectorizedRow; row++) {
3691
+ if (col > vectorizedColLimit - 1 || row > vectorizedRowLimit - 1) {
3692
+ column[row] = new NotAvailableError(_t("Array arguments to [[FUNCTION_NAME]] are of different size."));
3693
+ continue;
3694
+ }
3695
+ for (let k = 0; k < nbVectorized; k++) argsBuffer[vectorizedIndices[k]] = argGetters[k](col, row);
3696
+ const singleCellComputeResult = callFormula();
3697
+ column[row] = isMatrix(singleCellComputeResult) ? singleCellComputeResult[0][0] : singleCellComputeResult;
3698
+ }
3699
+ }
3700
+ return result;
3662
3701
  }
3663
3702
  /**
3664
3703
  * This function allows to visit arguments and stop the visit if necessary.
@@ -16846,12 +16885,15 @@ for (const category of categories) {
16846
16885
  }
16847
16886
  }
16848
16887
  function createComputeFunction(descr) {
16888
+ let currentArgDefinitions = [];
16849
16889
  function vectorizedCompute(...args) {
16850
16890
  const acceptToVectorize = [];
16891
+ currentArgDefinitions = new Array(args.length);
16851
16892
  const getArgToFocus = argTargeting(descr, args.length);
16852
16893
  for (let i = 0; i < args.length; i++) {
16853
16894
  const argIndex = getArgToFocus(i) ?? -1;
16854
16895
  const argDefinition = descr.args[argIndex];
16896
+ currentArgDefinitions[i] = argDefinition;
16855
16897
  const arg = args[i];
16856
16898
  if (!isMatrix(arg) && argDefinition.acceptMatrixOnly) throw new BadExpressionError(_t("Function %s expects the parameter '%s' to be reference to a cell or range.", descr.name, (i + 1).toString()));
16857
16899
  acceptToVectorize.push(!argDefinition.acceptMatrix);
@@ -16866,8 +16908,7 @@ function createComputeFunction(descr) {
16866
16908
  function errorHandlingCompute(...args) {
16867
16909
  for (let i = 0; i < args.length; i++) {
16868
16910
  const arg = args[i];
16869
- const getArgToFocus = argTargeting(descr, args.length);
16870
- if (!descr.args[getArgToFocus(i) || i].acceptErrors && !isMatrix(arg) && isEvaluationError(arg?.value)) return arg;
16911
+ if (!currentArgDefinitions[i].acceptErrors && !isMatrix(arg) && isEvaluationError(arg?.value)) return arg;
16871
16912
  }
16872
16913
  try {
16873
16914
  return computeFunctionToObject.apply(this, args);
@@ -61710,7 +61751,7 @@ var SheetUIPlugin = class extends UIPlugin {
61710
61751
  if (contentWidth === 0) return 0;
61711
61752
  contentWidth += 2 * 4;
61712
61753
  if (style.wrapping === "wrap") {
61713
- const colWidth = this.getters.getColSize(this.getters.getActiveSheetId(), position.col);
61754
+ const colWidth = this.getters.getColSize(position.sheetId, position.col);
61714
61755
  return Math.min(colWidth, contentWidth);
61715
61756
  }
61716
61757
  return contentWidth;
@@ -66224,6 +66265,7 @@ var SpreadsheetDashboard = class extends Component {
66224
66265
  return toRaw(this.clickableCellsStore.clickableCells);
66225
66266
  }
66226
66267
  selectClickableCell(ev, clickableCell) {
66268
+ if (![0, 1].includes(ev.button)) return;
66227
66269
  const { position, action } = clickableCell;
66228
66270
  action(position, this.env, isMiddleClickOrCtrlClick(ev));
66229
66271
  }
@@ -72237,6 +72279,6 @@ const chartHelpers = {
72237
72279
  //#endregion
72238
72280
  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, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
72239
72281
 
72240
- __info__.version = "18.3.57";
72241
- __info__.date = "2026-07-23T07:55:39.159Z";
72242
- __info__.hash = "e80e027";
72282
+ __info__.version = "18.3.59";
72283
+ __info__.date = "2026-08-10T12:30:17.132Z";
72284
+ __info__.hash = "c215f06";
@@ -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.3.57
6
- * @date 2026-07-23T07:55:39.159Z
7
- * @hash e80e027
5
+ * @version 18.3.59
6
+ * @date 2026-08-10T12:30:17.132Z
7
+ * @hash c215f06
8
8
  */
9
9
 
10
10
  (function(exports, _odoo_owl) {
@@ -3648,19 +3648,58 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3648
3648
  }
3649
3649
  }
3650
3650
  if (countVectorizedCol === 1 && countVectorizedRow === 1) return formula(...args);
3651
- const getArgOffset = (i, j) => args.map((arg, index) => {
3652
- switch (vectorArgsType?.[index]) {
3653
- case "matrix": return arg[i][j];
3654
- case "horizontal": return arg[i][0];
3655
- case "vertical": return arg[0][j];
3656
- case void 0: return arg;
3651
+ const argsBuffer = new Array(args.length);
3652
+ const argGetters = [];
3653
+ const vectorizedIndices = [];
3654
+ for (let k = 0; k < args.length; k++) {
3655
+ const arg = args[k];
3656
+ switch (vectorArgsType?.[k]) {
3657
+ case "matrix":
3658
+ argGetters.push((i, j) => arg[i][j]);
3659
+ vectorizedIndices.push(k);
3660
+ break;
3661
+ case "horizontal":
3662
+ argGetters.push((i) => arg[i][0]);
3663
+ vectorizedIndices.push(k);
3664
+ break;
3665
+ case "vertical":
3666
+ argGetters.push((_i, j) => arg[0][j]);
3667
+ vectorizedIndices.push(k);
3668
+ break;
3669
+ case void 0:
3670
+ argsBuffer[k] = arg;
3671
+ break;
3657
3672
  }
3658
- });
3659
- return generateMatrix(countVectorizedCol, countVectorizedRow, (col, row) => {
3660
- if (col > vectorizedColLimit - 1 || row > vectorizedRowLimit - 1) return new NotAvailableError(_t("Array arguments to [[FUNCTION_NAME]] are of different size."));
3661
- const singleCellComputeResult = formula(...getArgOffset(col, row));
3662
- return isMatrix(singleCellComputeResult) ? singleCellComputeResult[0][0] : singleCellComputeResult;
3663
- });
3673
+ }
3674
+ const nbVectorized = vectorizedIndices.length;
3675
+ let callFormula;
3676
+ switch (argsBuffer.length) {
3677
+ case 1:
3678
+ callFormula = () => formula(argsBuffer[0]);
3679
+ break;
3680
+ case 2:
3681
+ callFormula = () => formula(argsBuffer[0], argsBuffer[1]);
3682
+ break;
3683
+ case 3:
3684
+ callFormula = () => formula(argsBuffer[0], argsBuffer[1], argsBuffer[2]);
3685
+ break;
3686
+ default: callFormula = () => formula(...argsBuffer);
3687
+ }
3688
+ const result = new Array(countVectorizedCol);
3689
+ for (let col = 0; col < countVectorizedCol; col++) {
3690
+ const column = new Array(countVectorizedRow);
3691
+ result[col] = column;
3692
+ for (let row = 0; row < countVectorizedRow; row++) {
3693
+ if (col > vectorizedColLimit - 1 || row > vectorizedRowLimit - 1) {
3694
+ column[row] = new NotAvailableError(_t("Array arguments to [[FUNCTION_NAME]] are of different size."));
3695
+ continue;
3696
+ }
3697
+ for (let k = 0; k < nbVectorized; k++) argsBuffer[vectorizedIndices[k]] = argGetters[k](col, row);
3698
+ const singleCellComputeResult = callFormula();
3699
+ column[row] = isMatrix(singleCellComputeResult) ? singleCellComputeResult[0][0] : singleCellComputeResult;
3700
+ }
3701
+ }
3702
+ return result;
3664
3703
  }
3665
3704
  /**
3666
3705
  * This function allows to visit arguments and stop the visit if necessary.
@@ -16848,12 +16887,15 @@ stores.inject(MyMetaStore, storeInstance);
16848
16887
  }
16849
16888
  }
16850
16889
  function createComputeFunction(descr) {
16890
+ let currentArgDefinitions = [];
16851
16891
  function vectorizedCompute(...args) {
16852
16892
  const acceptToVectorize = [];
16893
+ currentArgDefinitions = new Array(args.length);
16853
16894
  const getArgToFocus = argTargeting(descr, args.length);
16854
16895
  for (let i = 0; i < args.length; i++) {
16855
16896
  const argIndex = getArgToFocus(i) ?? -1;
16856
16897
  const argDefinition = descr.args[argIndex];
16898
+ currentArgDefinitions[i] = argDefinition;
16857
16899
  const arg = args[i];
16858
16900
  if (!isMatrix(arg) && argDefinition.acceptMatrixOnly) throw new BadExpressionError(_t("Function %s expects the parameter '%s' to be reference to a cell or range.", descr.name, (i + 1).toString()));
16859
16901
  acceptToVectorize.push(!argDefinition.acceptMatrix);
@@ -16868,8 +16910,7 @@ stores.inject(MyMetaStore, storeInstance);
16868
16910
  function errorHandlingCompute(...args) {
16869
16911
  for (let i = 0; i < args.length; i++) {
16870
16912
  const arg = args[i];
16871
- const getArgToFocus = argTargeting(descr, args.length);
16872
- if (!descr.args[getArgToFocus(i) || i].acceptErrors && !isMatrix(arg) && isEvaluationError(arg?.value)) return arg;
16913
+ if (!currentArgDefinitions[i].acceptErrors && !isMatrix(arg) && isEvaluationError(arg?.value)) return arg;
16873
16914
  }
16874
16915
  try {
16875
16916
  return computeFunctionToObject.apply(this, args);
@@ -61712,7 +61753,7 @@ stores.inject(MyMetaStore, storeInstance);
61712
61753
  if (contentWidth === 0) return 0;
61713
61754
  contentWidth += 2 * 4;
61714
61755
  if (style.wrapping === "wrap") {
61715
- const colWidth = this.getters.getColSize(this.getters.getActiveSheetId(), position.col);
61756
+ const colWidth = this.getters.getColSize(position.sheetId, position.col);
61716
61757
  return Math.min(colWidth, contentWidth);
61717
61758
  }
61718
61759
  return contentWidth;
@@ -66226,6 +66267,7 @@ stores.inject(MyMetaStore, storeInstance);
66226
66267
  return (0, _odoo_owl.toRaw)(this.clickableCellsStore.clickableCells);
66227
66268
  }
66228
66269
  selectClickableCell(ev, clickableCell) {
66270
+ if (![0, 1].includes(ev.button)) return;
66229
66271
  const { position, action } = clickableCell;
66230
66272
  action(position, this.env, isMiddleClickOrCtrlClick(ev));
66231
66273
  }
@@ -72286,8 +72328,8 @@ exports.stores = stores;
72286
72328
  exports.tokenColors = tokenColors;
72287
72329
  exports.tokenize = tokenize;
72288
72330
 
72289
- __info__.version = "18.3.57";
72290
- __info__.date = "2026-07-23T07:55:39.159Z";
72291
- __info__.hash = "e80e027";
72331
+ __info__.version = "18.3.59";
72332
+ __info__.date = "2026-08-10T12:30:17.132Z";
72333
+ __info__.hash = "c215f06";
72292
72334
 
72293
72335
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);