@odoo/o-spreadsheet 18.0.76 → 18.0.78

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.0.76
6
- * @date 2026-07-23T07:39:22.527Z
7
- * @hash 6a6cc73
5
+ * @version 18.0.78
6
+ * @date 2026-08-10T12:30:26.634Z
7
+ * @hash 3fdaa53
8
8
  */
9
9
 
10
10
  import { Component, markRaw, onMounted, onPatched, onWillPatch, onWillStart, onWillUnmount, onWillUpdateProps, status, toRaw, useChildSubEnv, useComponent, useEffect, useEnv, useExternalListener, useRef, useState, useSubEnv, xml } from "@odoo/owl";
@@ -3461,19 +3461,58 @@ function applyVectorization(formula, args, acceptToVectorize = void 0) {
3461
3461
  }
3462
3462
  }
3463
3463
  if (countVectorizedCol === 1 && countVectorizedRow === 1) return formula(...args);
3464
- const getArgOffset = (i, j) => args.map((arg, index) => {
3465
- switch (vectorArgsType?.[index]) {
3466
- case "matrix": return arg[i][j];
3467
- case "horizontal": return arg[i][0];
3468
- case "vertical": return arg[0][j];
3469
- case void 0: return arg;
3464
+ const argsBuffer = new Array(args.length);
3465
+ const argGetters = [];
3466
+ const vectorizedIndices = [];
3467
+ for (let k = 0; k < args.length; k++) {
3468
+ const arg = args[k];
3469
+ switch (vectorArgsType?.[k]) {
3470
+ case "matrix":
3471
+ argGetters.push((i, j) => arg[i][j]);
3472
+ vectorizedIndices.push(k);
3473
+ break;
3474
+ case "horizontal":
3475
+ argGetters.push((i) => arg[i][0]);
3476
+ vectorizedIndices.push(k);
3477
+ break;
3478
+ case "vertical":
3479
+ argGetters.push((_i, j) => arg[0][j]);
3480
+ vectorizedIndices.push(k);
3481
+ break;
3482
+ case void 0:
3483
+ argsBuffer[k] = arg;
3484
+ break;
3470
3485
  }
3471
- });
3472
- return generateMatrix(countVectorizedCol, countVectorizedRow, (col, row) => {
3473
- if (col > vectorizedColLimit - 1 || row > vectorizedRowLimit - 1) return new NotAvailableError(_t("Array arguments to [[FUNCTION_NAME]] are of different size."));
3474
- const singleCellComputeResult = formula(...getArgOffset(col, row));
3475
- return isMatrix(singleCellComputeResult) ? singleCellComputeResult[0][0] : singleCellComputeResult;
3476
- });
3486
+ }
3487
+ const nbVectorized = vectorizedIndices.length;
3488
+ let callFormula;
3489
+ switch (argsBuffer.length) {
3490
+ case 1:
3491
+ callFormula = () => formula(argsBuffer[0]);
3492
+ break;
3493
+ case 2:
3494
+ callFormula = () => formula(argsBuffer[0], argsBuffer[1]);
3495
+ break;
3496
+ case 3:
3497
+ callFormula = () => formula(argsBuffer[0], argsBuffer[1], argsBuffer[2]);
3498
+ break;
3499
+ default: callFormula = () => formula(...argsBuffer);
3500
+ }
3501
+ const result = new Array(countVectorizedCol);
3502
+ for (let col = 0; col < countVectorizedCol; col++) {
3503
+ const column = new Array(countVectorizedRow);
3504
+ result[col] = column;
3505
+ for (let row = 0; row < countVectorizedRow; row++) {
3506
+ if (col > vectorizedColLimit - 1 || row > vectorizedRowLimit - 1) {
3507
+ column[row] = new NotAvailableError(_t("Array arguments to [[FUNCTION_NAME]] are of different size."));
3508
+ continue;
3509
+ }
3510
+ for (let k = 0; k < nbVectorized; k++) argsBuffer[vectorizedIndices[k]] = argGetters[k](col, row);
3511
+ const singleCellComputeResult = callFormula();
3512
+ column[row] = isMatrix(singleCellComputeResult) ? singleCellComputeResult[0][0] : singleCellComputeResult;
3513
+ }
3514
+ }
3515
+ return result;
3477
3516
  }
3478
3517
  /**
3479
3518
  * This function allows to visit arguments and stop the visit if necessary.
@@ -22848,10 +22887,13 @@ for (const category of categories) {
22848
22887
  }
22849
22888
  }
22850
22889
  function createComputeFunction(descr, functionName) {
22890
+ let currentArgDefinitions = [];
22851
22891
  function vectorizedCompute(...args) {
22852
22892
  const acceptToVectorize = [];
22893
+ currentArgDefinitions = new Array(args.length);
22853
22894
  for (let i = 0; i < args.length; i++) {
22854
22895
  const argDefinition = descr.args[descr.getArgToFocus(i + 1) - 1];
22896
+ currentArgDefinitions[i] = argDefinition;
22855
22897
  const arg = args[i];
22856
22898
  if (!isMatrix(arg) && argDefinition.acceptMatrixOnly) throw new BadExpressionError(_t("Function %s expects the parameter '%s' to be reference to a cell or range.", functionName, (i + 1).toString()));
22857
22899
  acceptToVectorize.push(!argDefinition.acceptMatrix);
@@ -22866,7 +22908,7 @@ function createComputeFunction(descr, functionName) {
22866
22908
  function errorHandlingCompute(...args) {
22867
22909
  for (let i = 0; i < args.length; i++) {
22868
22910
  const arg = args[i];
22869
- if (!descr.args[descr.getArgToFocus(i + 1) - 1].acceptErrors && !isMatrix(arg) && isEvaluationError(arg?.value)) return arg;
22911
+ if (!currentArgDefinitions[i].acceptErrors && !isMatrix(arg) && isEvaluationError(arg?.value)) return arg;
22870
22912
  }
22871
22913
  try {
22872
22914
  return computeFunctionToObject.apply(this, args);
@@ -56344,7 +56386,7 @@ var SheetUIPlugin = class extends UIPlugin {
56344
56386
  if (contentWidth === 0) return 0;
56345
56387
  contentWidth += 2 * 4;
56346
56388
  if (style.wrapping === "wrap") {
56347
- const colWidth = this.getters.getColSize(this.getters.getActiveSheetId(), position.col);
56389
+ const colWidth = this.getters.getColSize(position.sheetId, position.col);
56348
56390
  return Math.min(colWidth, contentWidth);
56349
56391
  }
56350
56392
  return contentWidth;
@@ -66346,6 +66388,6 @@ const constants = {
66346
66388
  //#endregion
66347
66389
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, 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 };
66348
66390
 
66349
- __info__.version = "18.0.76";
66350
- __info__.date = "2026-07-23T07:39:22.527Z";
66351
- __info__.hash = "6a6cc73";
66391
+ __info__.version = "18.0.78";
66392
+ __info__.date = "2026-08-10T12:30:26.634Z";
66393
+ __info__.hash = "3fdaa53";
@@ -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.0.76
6
- * @date 2026-07-23T07:39:22.527Z
7
- * @hash 6a6cc73
5
+ * @version 18.0.78
6
+ * @date 2026-08-10T12:30:26.634Z
7
+ * @hash 3fdaa53
8
8
  */
9
9
 
10
10
  (function(exports, _odoo_owl) {
@@ -3463,19 +3463,58 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3463
3463
  }
3464
3464
  }
3465
3465
  if (countVectorizedCol === 1 && countVectorizedRow === 1) return formula(...args);
3466
- const getArgOffset = (i, j) => args.map((arg, index) => {
3467
- switch (vectorArgsType?.[index]) {
3468
- case "matrix": return arg[i][j];
3469
- case "horizontal": return arg[i][0];
3470
- case "vertical": return arg[0][j];
3471
- case void 0: return arg;
3466
+ const argsBuffer = new Array(args.length);
3467
+ const argGetters = [];
3468
+ const vectorizedIndices = [];
3469
+ for (let k = 0; k < args.length; k++) {
3470
+ const arg = args[k];
3471
+ switch (vectorArgsType?.[k]) {
3472
+ case "matrix":
3473
+ argGetters.push((i, j) => arg[i][j]);
3474
+ vectorizedIndices.push(k);
3475
+ break;
3476
+ case "horizontal":
3477
+ argGetters.push((i) => arg[i][0]);
3478
+ vectorizedIndices.push(k);
3479
+ break;
3480
+ case "vertical":
3481
+ argGetters.push((_i, j) => arg[0][j]);
3482
+ vectorizedIndices.push(k);
3483
+ break;
3484
+ case void 0:
3485
+ argsBuffer[k] = arg;
3486
+ break;
3472
3487
  }
3473
- });
3474
- return generateMatrix(countVectorizedCol, countVectorizedRow, (col, row) => {
3475
- if (col > vectorizedColLimit - 1 || row > vectorizedRowLimit - 1) return new NotAvailableError(_t("Array arguments to [[FUNCTION_NAME]] are of different size."));
3476
- const singleCellComputeResult = formula(...getArgOffset(col, row));
3477
- return isMatrix(singleCellComputeResult) ? singleCellComputeResult[0][0] : singleCellComputeResult;
3478
- });
3488
+ }
3489
+ const nbVectorized = vectorizedIndices.length;
3490
+ let callFormula;
3491
+ switch (argsBuffer.length) {
3492
+ case 1:
3493
+ callFormula = () => formula(argsBuffer[0]);
3494
+ break;
3495
+ case 2:
3496
+ callFormula = () => formula(argsBuffer[0], argsBuffer[1]);
3497
+ break;
3498
+ case 3:
3499
+ callFormula = () => formula(argsBuffer[0], argsBuffer[1], argsBuffer[2]);
3500
+ break;
3501
+ default: callFormula = () => formula(...argsBuffer);
3502
+ }
3503
+ const result = new Array(countVectorizedCol);
3504
+ for (let col = 0; col < countVectorizedCol; col++) {
3505
+ const column = new Array(countVectorizedRow);
3506
+ result[col] = column;
3507
+ for (let row = 0; row < countVectorizedRow; row++) {
3508
+ if (col > vectorizedColLimit - 1 || row > vectorizedRowLimit - 1) {
3509
+ column[row] = new NotAvailableError(_t("Array arguments to [[FUNCTION_NAME]] are of different size."));
3510
+ continue;
3511
+ }
3512
+ for (let k = 0; k < nbVectorized; k++) argsBuffer[vectorizedIndices[k]] = argGetters[k](col, row);
3513
+ const singleCellComputeResult = callFormula();
3514
+ column[row] = isMatrix(singleCellComputeResult) ? singleCellComputeResult[0][0] : singleCellComputeResult;
3515
+ }
3516
+ }
3517
+ return result;
3479
3518
  }
3480
3519
  /**
3481
3520
  * This function allows to visit arguments and stop the visit if necessary.
@@ -22850,10 +22889,13 @@ stores.inject(MyMetaStore, storeInstance);
22850
22889
  }
22851
22890
  }
22852
22891
  function createComputeFunction(descr, functionName) {
22892
+ let currentArgDefinitions = [];
22853
22893
  function vectorizedCompute(...args) {
22854
22894
  const acceptToVectorize = [];
22895
+ currentArgDefinitions = new Array(args.length);
22855
22896
  for (let i = 0; i < args.length; i++) {
22856
22897
  const argDefinition = descr.args[descr.getArgToFocus(i + 1) - 1];
22898
+ currentArgDefinitions[i] = argDefinition;
22857
22899
  const arg = args[i];
22858
22900
  if (!isMatrix(arg) && argDefinition.acceptMatrixOnly) throw new BadExpressionError(_t("Function %s expects the parameter '%s' to be reference to a cell or range.", functionName, (i + 1).toString()));
22859
22901
  acceptToVectorize.push(!argDefinition.acceptMatrix);
@@ -22868,7 +22910,7 @@ stores.inject(MyMetaStore, storeInstance);
22868
22910
  function errorHandlingCompute(...args) {
22869
22911
  for (let i = 0; i < args.length; i++) {
22870
22912
  const arg = args[i];
22871
- if (!descr.args[descr.getArgToFocus(i + 1) - 1].acceptErrors && !isMatrix(arg) && isEvaluationError(arg?.value)) return arg;
22913
+ if (!currentArgDefinitions[i].acceptErrors && !isMatrix(arg) && isEvaluationError(arg?.value)) return arg;
22872
22914
  }
22873
22915
  try {
22874
22916
  return computeFunctionToObject.apply(this, args);
@@ -56346,7 +56388,7 @@ stores.inject(MyMetaStore, storeInstance);
56346
56388
  if (contentWidth === 0) return 0;
56347
56389
  contentWidth += 2 * 4;
56348
56390
  if (style.wrapping === "wrap") {
56349
- const colWidth = this.getters.getColSize(this.getters.getActiveSheetId(), position.col);
56391
+ const colWidth = this.getters.getColSize(position.sheetId, position.col);
56350
56392
  return Math.min(colWidth, contentWidth);
56351
56393
  }
56352
56394
  return contentWidth;
@@ -66392,8 +66434,8 @@ exports.stores = stores;
66392
66434
  exports.tokenColors = tokenColors;
66393
66435
  exports.tokenize = tokenize;
66394
66436
 
66395
- __info__.version = "18.0.76";
66396
- __info__.date = "2026-07-23T07:39:22.527Z";
66397
- __info__.hash = "6a6cc73";
66437
+ __info__.version = "18.0.78";
66438
+ __info__.date = "2026-08-10T12:30:26.634Z";
66439
+ __info__.hash = "3fdaa53";
66398
66440
 
66399
66441
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);