@odoo/o-spreadsheet 19.2.13 → 19.2.15

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 19.2.13
6
- * @date 2026-05-15T07:07:37.391Z
7
- * @hash fece642
5
+ * @version 19.2.15
6
+ * @date 2026-06-06T06:23:14.723Z
7
+ * @hash d29528e
8
8
  */
9
9
 
10
10
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
@@ -4328,6 +4328,7 @@ const DEFAULT_LOCALE = DEFAULT_LOCALES[0];
4328
4328
  //#endregion
4329
4329
  //#region src/helpers/format/format_tokenizer.ts
4330
4330
  function tokenizeFormat(str) {
4331
+ str = str.replace(/\s/g, " ");
4331
4332
  const chars = new TokenizingChars(str);
4332
4333
  const result = [];
4333
4334
  let currentFormatPart = [];
@@ -5504,7 +5505,12 @@ const lockedSheetAllowedCommands = new Set([
5504
5505
  "SET_ZOOM",
5505
5506
  "UPDATE_CAROUSEL_ACTIVE_ITEM",
5506
5507
  "DUPLICATE_PIVOT_IN_NEW_SHEET",
5507
- "UPDATE_FILTER"
5508
+ "UPDATE_FILTER",
5509
+ "ACTIVATE_NEXT_SHEET",
5510
+ "ACTIVATE_PREVIOUS_SHEET",
5511
+ "SCROLL_TO_CELL",
5512
+ "SHIFT_VIEWPORT_DOWN",
5513
+ "SHIFT_VIEWPORT_UP"
5508
5514
  ]);
5509
5515
  const coreTypes = new Set([
5510
5516
  "UPDATE_CELL",
@@ -6484,8 +6490,13 @@ function getApplyRangeChangeAddColRow(cmd) {
6484
6490
  changeType: "NONE",
6485
6491
  range
6486
6492
  };
6493
+ const isUnboundedAtEnd = range.unboundedZone[end] === void 0;
6494
+ if (isUnboundedAtEnd && !range.unboundedZone.hasHeader) return {
6495
+ changeType: "RESIZE",
6496
+ range: createAdaptedRange(range, dimension, "RESIZE", cmd.quantity)
6497
+ };
6487
6498
  if (cmd.position === "after") {
6488
- if (range.zone[start] <= cmd.base && cmd.base < range.zone[end]) return {
6499
+ if (range.zone[start] <= cmd.base && (cmd.base < range.zone[end] || isUnboundedAtEnd)) return {
6489
6500
  changeType: "RESIZE",
6490
6501
  range: createAdaptedRange(range, dimension, "RESIZE", cmd.quantity)
6491
6502
  };
@@ -7078,40 +7089,9 @@ var UuidGenerator = class {
7078
7089
  }
7079
7090
  };
7080
7091
 
7081
- //#endregion
7082
- //#region src/registry.ts
7083
- var Registry$1 = class {
7084
- content = {};
7085
- add(key, value) {
7086
- if (key in this.content) throw new Error(`${key} is already present in this registry!`);
7087
- return this.replace(key, value);
7088
- }
7089
- replace(key, value) {
7090
- this.content[key] = value;
7091
- return this;
7092
- }
7093
- get(key) {
7094
- const content = this.content[key];
7095
- if (!content && !(key in this.content)) throw new Error(`Cannot find ${key} in this registry!`);
7096
- return content;
7097
- }
7098
- contains(key) {
7099
- return key in this.content;
7100
- }
7101
- getAll() {
7102
- return Object.values(this.content);
7103
- }
7104
- getKeys() {
7105
- return Object.keys(this.content);
7106
- }
7107
- remove(key) {
7108
- delete this.content[key];
7109
- }
7110
- };
7111
-
7112
7092
  //#endregion
7113
7093
  //#region src/helpers/figures/charts/chart_js_extension.ts
7114
- const chartJsExtensionRegistry = new Registry$1();
7094
+ const chartJsExtensionRegistry = new Registry();
7115
7095
  function areChartJSExtensionsLoaded() {
7116
7096
  return globalThis.Chart ? !!globalThis.Chart.registry.plugins.get("chartShowValuesPlugin") : true;
7117
7097
  }
@@ -7429,6 +7409,10 @@ const FORCE_DEFAULT_ARGS_FUNCTIONS = {
7429
7409
  ROUNDDOWN: [{
7430
7410
  type: "NUMBER",
7431
7411
  value: 0
7412
+ }],
7413
+ IFERROR: [{
7414
+ type: "NUMBER",
7415
+ value: 0
7432
7416
  }]
7433
7417
  };
7434
7418
  /**
@@ -25702,7 +25686,7 @@ const HYPERLINK = {
25702
25686
  //#endregion
25703
25687
  //#region src/functions/function_registry.ts
25704
25688
  const functionNameRegex = /^[A-Z0-9\_\.]+$/;
25705
- var FunctionRegistry = class extends Registry$1 {
25689
+ var FunctionRegistry = class extends Registry {
25706
25690
  mapping = {};
25707
25691
  add(name, addDescr) {
25708
25692
  name = name.toUpperCase();
@@ -30196,7 +30180,7 @@ const WEEK_START = {
30196
30180
 
30197
30181
  //#endregion
30198
30182
  //#region src/migrations/migration_steps.ts
30199
- const migrationStepRegistry = new Registry$1();
30183
+ const migrationStepRegistry = new Registry();
30200
30184
  migrationStepRegistry.add("0.1", { migrate(data) {
30201
30185
  if (data.sheets && data.sheets[0]) data.activeSheet = data.sheets[0].name;
30202
30186
  return data;
@@ -37519,11 +37503,10 @@ const INSERT_TABLE = (env) => {
37519
37503
  if (interactiveCreateTable(env, env.model.getters.getActiveSheetId()).isSuccessful) env.openSidePanel("TableSidePanel", {});
37520
37504
  };
37521
37505
  const DELETE_SELECTED_TABLE = (env) => {
37522
- const position = env.model.getters.getActivePosition();
37523
- const table = env.model.getters.getTable(position);
37506
+ const table = env.model.getters.getFirstTableInSelection();
37524
37507
  if (!table) return;
37525
37508
  env.model.dispatch("REMOVE_TABLE", {
37526
- sheetId: position.sheetId,
37509
+ sheetId: env.model.getters.getActiveSheetId(),
37527
37510
  target: [table.range.zone]
37528
37511
  });
37529
37512
  };
@@ -43306,7 +43289,7 @@ function getVisiblePivotCellPositions(getters, pivotId) {
43306
43289
  col,
43307
43290
  row
43308
43291
  };
43309
- if (pivotId === getters.getPivotIdFromPosition(position)) positions.push(position);
43292
+ if (getters.getPivotIdsFromPosition(position).includes(pivotId)) positions.push(position);
43310
43293
  }
43311
43294
  return positions;
43312
43295
  }
@@ -45730,7 +45713,7 @@ var SpreadsheetPivot = class {
45730
45713
 
45731
45714
  //#endregion
45732
45715
  //#region src/helpers/pivot/pivot_registry.ts
45733
- const pivotRegistry = new Registry$1();
45716
+ const pivotRegistry = new Registry();
45734
45717
  const dateGranularities = [
45735
45718
  "year",
45736
45719
  "quarter_number",
@@ -45794,6 +45777,9 @@ const PIVOT_FUNCTIONS = [
45794
45777
  function getFirstPivotFunction(compiledFormula, getters) {
45795
45778
  return compiledFormula.getFunctionsFromTokens(PIVOT_FUNCTIONS, getters)[0];
45796
45779
  }
45780
+ function getPivotFunctions(compiledFormula, getters) {
45781
+ return compiledFormula.getFunctionsFromTokens(PIVOT_FUNCTIONS, getters);
45782
+ }
45797
45783
  /**
45798
45784
  * Parse a spreadsheet formula and detect the number of PIVOT functions that are
45799
45785
  * present in the given formula.
@@ -63706,6 +63692,7 @@ var PivotUIPlugin = class extends CoreViewPlugin {
63706
63692
  "getFirstPivotFunction",
63707
63693
  "getPivotCellSortDirection",
63708
63694
  "getPivotIdFromPosition",
63695
+ "getPivotIdsFromPosition",
63709
63696
  "getPivotCellFromPosition",
63710
63697
  "generateNewCalculatedMeasureName",
63711
63698
  "isPivotUnused",
@@ -63732,9 +63719,11 @@ var PivotUIPlugin = class extends CoreViewPlugin {
63732
63719
  this.refreshPivot(cmd.id);
63733
63720
  break;
63734
63721
  case "ADD_PIVOT":
63722
+ this.unusedPivotsInFormulas?.push(cmd.pivotId);
63735
63723
  this.setupPivot(cmd.pivotId);
63736
63724
  break;
63737
63725
  case "DUPLICATE_PIVOT":
63726
+ this.unusedPivotsInFormulas?.push(cmd.newPivotId);
63738
63727
  this.setupPivot(cmd.newPivotId);
63739
63728
  break;
63740
63729
  case "UPDATE_PIVOT":
@@ -63765,37 +63754,52 @@ var PivotUIPlugin = class extends CoreViewPlugin {
63765
63754
  }
63766
63755
  }
63767
63756
  /**
63768
- * Get the id of the pivot at the given position. Returns undefined if there
63757
+ * Get the id of the first pivot in the formula at the given position. Returns undefined if there
63769
63758
  * is no pivot at this position
63770
63759
  */
63771
63760
  getPivotIdFromPosition(position) {
63761
+ return this.getPivotIdsFromPosition(position)[0];
63762
+ }
63763
+ /**
63764
+ * Get all of the ids of the pivot present in the formula at the given position.
63765
+ */
63766
+ getPivotIdsFromPosition(position) {
63772
63767
  const cell = this.getters.getCorrespondingFormulaCell(position);
63773
- if (cell && cell.isFormula) {
63774
- const pivotFunction = this.getFirstPivotFunction(position.sheetId, cell.compiledFormula);
63775
- if (pivotFunction) {
63776
- const pivotId = pivotFunction.args[0]?.toString();
63777
- return pivotId && this.getters.getPivotId(pivotId);
63778
- }
63779
- }
63768
+ if (cell && cell.isFormula) return this.getPivotIdsFromFormula(position.sheetId, cell.compiledFormula);
63769
+ return [];
63770
+ }
63771
+ getPivotIdsFromFormula(sheetId, formula) {
63772
+ return this.getPivotFunctions(sheetId, formula).map((pivotFunction) => {
63773
+ const pivotId = pivotFunction.args[0]?.toString();
63774
+ return pivotId && this.getters.getPivotId(pivotId);
63775
+ }).filter(isDefined);
63780
63776
  }
63781
63777
  isSpillPivotFormula(position) {
63782
63778
  const cell = this.getters.getCorrespondingFormulaCell(position);
63783
63779
  if (cell && cell.isFormula) return this.getFirstPivotFunction(position.sheetId, cell.compiledFormula)?.functionName === "PIVOT";
63784
63780
  return false;
63785
63781
  }
63786
- getFirstPivotFunction(sheetId, compiledFormula) {
63787
- const pivotFunction = getFirstPivotFunction(compiledFormula, this.getters);
63788
- if (!pivotFunction) return;
63789
- const { functionName, args } = pivotFunction;
63790
- return {
63791
- functionName,
63792
- args: args.map((argAst) => {
63782
+ getPivotFunctions(sheetId, formula) {
63783
+ const pivotFunctions = getPivotFunctions(formula, this.getters);
63784
+ if (!pivotFunctions.length) return [];
63785
+ const evaluatedPivotFunctions = [];
63786
+ for (const pivotFunction of pivotFunctions) {
63787
+ const { functionName, args } = pivotFunction;
63788
+ const evaluatedArgs = args.map((argAst) => {
63793
63789
  if (argAst.type === "EMPTY") return;
63794
63790
  else if (argAst.type === "STRING" || argAst.type === "BOOLEAN" || argAst.type === "NUMBER") return argAst.value;
63795
63791
  const argsString = astToFormula(argAst);
63796
63792
  return this.getters.evaluateFormula(sheetId, argsString);
63797
- })
63798
- };
63793
+ });
63794
+ evaluatedPivotFunctions.push({
63795
+ functionName,
63796
+ args: evaluatedArgs
63797
+ });
63798
+ }
63799
+ return evaluatedPivotFunctions;
63800
+ }
63801
+ getFirstPivotFunction(sheetId, formula) {
63802
+ return this.getPivotFunctions(sheetId, formula)[0];
63799
63803
  }
63800
63804
  /**
63801
63805
  * Returns the domain args of a pivot formula from a position.
@@ -63901,8 +63905,8 @@ var PivotUIPlugin = class extends CoreViewPlugin {
63901
63905
  const unusedPivots = new Set(this.getters.getPivotIds());
63902
63906
  for (const sheetId of this.getters.getSheetIds()) for (const cell of this.getters.getCells(sheetId)) {
63903
63907
  const position = this.getters.getCellPosition(cell.id);
63904
- const pivotId = this.getPivotIdFromPosition(position);
63905
- if (pivotId) {
63908
+ const pivotIds = this.getPivotIdsFromPosition(position);
63909
+ for (const pivotId of pivotIds) {
63906
63910
  unusedPivots.delete(pivotId);
63907
63911
  if (!unusedPivots.size) {
63908
63912
  this.unusedPivotsInFormulas = [];
@@ -63910,6 +63914,21 @@ var PivotUIPlugin = class extends CoreViewPlugin {
63910
63914
  }
63911
63915
  }
63912
63916
  }
63917
+ for (const pivotId of this.getters.getPivotIds()) {
63918
+ const pivot = this.getters.getPivotCoreDefinition(pivotId);
63919
+ for (const measure of pivot.measures) if (measure.computedBy) {
63920
+ const { sheetId } = measure.computedBy;
63921
+ const formula = this.getters.getMeasureCompiledFormula(pivotId, measure);
63922
+ const relatedPivotIds = this.getPivotIdsFromFormula(sheetId, formula);
63923
+ for (const relatedPivotId of relatedPivotIds) {
63924
+ unusedPivots.delete(relatedPivotId);
63925
+ if (!unusedPivots.size) {
63926
+ this.unusedPivotsInFormulas = [];
63927
+ return [];
63928
+ }
63929
+ }
63930
+ }
63931
+ }
63913
63932
  this.unusedPivotsInFormulas = [...unusedPivots];
63914
63933
  return this.unusedPivotsInFormulas;
63915
63934
  }
@@ -65637,7 +65656,8 @@ const invalidateTableStyleCommandsSet = new Set([
65637
65656
  "REMOVE_TABLE",
65638
65657
  "RESIZE_TABLE",
65639
65658
  "CREATE_TABLE_STYLE",
65640
- "REMOVE_TABLE_STYLE"
65659
+ "REMOVE_TABLE_STYLE",
65660
+ "DELETE_CONTENT"
65641
65661
  ]);
65642
65662
  function doesCommandInvalidatesTableStyle(cmd) {
65643
65663
  return invalidateTableStyleCommandsSet.has(cmd.type);
@@ -70922,10 +70942,10 @@ var SheetViewPlugin = class extends UIPlugin {
70922
70942
 
70923
70943
  //#endregion
70924
70944
  //#region src/plugins/index.ts
70925
- const corePluginRegistry = new Registry$1().add("settings", SettingsPlugin).add("sheet", SheetPlugin).add("header grouping", HeaderGroupingPlugin).add("header visibility", HeaderVisibilityPlugin).add("tables", TablePlugin).add("dataValidation", DataValidationPlugin).add("cell", CellPlugin).add("merge", MergePlugin).add("headerSize", HeaderSizePlugin).add("borders", BordersPlugin).add("conditional formatting", ConditionalFormatPlugin).add("figures", FigurePlugin).add("chart", ChartPlugin).add("carousel", CarouselPlugin).add("image", ImagePlugin).add("pivot_core", PivotCorePlugin).add("spreadsheet_pivot_core", SpreadsheetPivotCorePlugin).add("tableStyle", TableStylePlugin);
70926
- const featurePluginRegistry = new Registry$1().add("ui_sheet", SheetUIPlugin).add("ui_options", UIOptionsPlugin).add("autofill", AutofillPlugin).add("sort", SortPlugin).add("automatic_sum", AutomaticSumPlugin).add("format", FormatPlugin).add("insert_pivot", InsertPivotPlugin).add("pivot_presence", PivotPresencePlugin).add("split_to_columns", SplitToColumnsPlugin).add("subtotal_evaluation", SubtotalEvaluationPlugin).add("collaborative", CollaborativePlugin).add("history", HistoryPlugin).add("table_autofill", TableAutofillPlugin).add("table_ui_resize", TableResizeUI).add("datavalidation_insert", DataValidationInsertionPlugin).add("checkbox_toggle", CheckboxTogglePlugin).add("dynamic_translate", DynamicTranslate).add("geo_features", GeoFeaturePlugin).add("data_cleanup", DataCleanupPlugin);
70927
- const statefulUIPluginRegistry = new Registry$1().add("selection", GridSelectionPlugin).add("evaluation_filter", FilterEvaluationPlugin).add("header_visibility_ui", HeaderVisibilityUIPlugin).add("cell_computed_style", CellComputedStylePlugin).add("table_computed_style", TableComputedStylePlugin).add("header_positions", HeaderPositionsUIPlugin).add("viewport", SheetViewPlugin).add("clipboard", ClipboardPlugin).add("carousel_ui", CarouselUIPlugin).add("lock_sheet", LockSheetPlugin);
70928
- const coreViewsPluginRegistry = new Registry$1().add("evaluation", EvaluationPlugin).add("evaluation_chart", EvaluationChartPlugin).add("evaluation_cf", EvaluationConditionalFormatPlugin).add("row_size", HeaderSizeUIPlugin).add("data_validation_ui", EvaluationDataValidationPlugin).add("dynamic_tables", DynamicTablesPlugin).add("custom_colors", CustomColorsPlugin).add("pivot_ui", PivotUIPlugin).add("cell_icon", CellIconPlugin).add("formula_tracker", FormulaTrackerPlugin);
70945
+ const corePluginRegistry = new Registry().add("settings", SettingsPlugin).add("sheet", SheetPlugin).add("header grouping", HeaderGroupingPlugin).add("header visibility", HeaderVisibilityPlugin).add("tables", TablePlugin).add("dataValidation", DataValidationPlugin).add("cell", CellPlugin).add("merge", MergePlugin).add("headerSize", HeaderSizePlugin).add("borders", BordersPlugin).add("conditional formatting", ConditionalFormatPlugin).add("figures", FigurePlugin).add("chart", ChartPlugin).add("carousel", CarouselPlugin).add("image", ImagePlugin).add("pivot_core", PivotCorePlugin).add("spreadsheet_pivot_core", SpreadsheetPivotCorePlugin).add("tableStyle", TableStylePlugin);
70946
+ const featurePluginRegistry = new Registry().add("ui_sheet", SheetUIPlugin).add("ui_options", UIOptionsPlugin).add("autofill", AutofillPlugin).add("sort", SortPlugin).add("automatic_sum", AutomaticSumPlugin).add("format", FormatPlugin).add("insert_pivot", InsertPivotPlugin).add("pivot_presence", PivotPresencePlugin).add("split_to_columns", SplitToColumnsPlugin).add("subtotal_evaluation", SubtotalEvaluationPlugin).add("collaborative", CollaborativePlugin).add("history", HistoryPlugin).add("table_autofill", TableAutofillPlugin).add("table_ui_resize", TableResizeUI).add("datavalidation_insert", DataValidationInsertionPlugin).add("checkbox_toggle", CheckboxTogglePlugin).add("dynamic_translate", DynamicTranslate).add("geo_features", GeoFeaturePlugin).add("data_cleanup", DataCleanupPlugin);
70947
+ const statefulUIPluginRegistry = new Registry().add("selection", GridSelectionPlugin).add("evaluation_filter", FilterEvaluationPlugin).add("header_visibility_ui", HeaderVisibilityUIPlugin).add("cell_computed_style", CellComputedStylePlugin).add("table_computed_style", TableComputedStylePlugin).add("header_positions", HeaderPositionsUIPlugin).add("viewport", SheetViewPlugin).add("clipboard", ClipboardPlugin).add("carousel_ui", CarouselUIPlugin).add("lock_sheet", LockSheetPlugin);
70948
+ const coreViewsPluginRegistry = new Registry().add("evaluation", EvaluationPlugin).add("evaluation_chart", EvaluationChartPlugin).add("evaluation_cf", EvaluationConditionalFormatPlugin).add("row_size", HeaderSizeUIPlugin).add("data_validation_ui", EvaluationDataValidationPlugin).add("dynamic_tables", DynamicTablesPlugin).add("custom_colors", CustomColorsPlugin).add("pivot_ui", PivotUIPlugin).add("cell_icon", CellIconPlugin).add("formula_tracker", FormulaTrackerPlugin);
70929
70949
 
70930
70950
  //#endregion
70931
70951
  //#region src/registries/auto_completes/data_validation_auto_complete.ts
@@ -76809,6 +76829,11 @@ function lineAttributes(params) {
76809
76829
  `;
76810
76830
  }
76811
76831
  function insertText(text, fontColor = "000000", fontsize = 16, style = {}) {
76832
+ const textProperties = [
76833
+ ["b", style.bold ? "1" : "0"],
76834
+ ["i", style.italic ? "1" : "0"],
76835
+ ["sz", fontsize * 100]
76836
+ ];
76812
76837
  return escapeXml`
76813
76838
  <c:tx>
76814
76839
  <c:rich>
@@ -76816,13 +76841,13 @@ function insertText(text, fontColor = "000000", fontsize = 16, style = {}) {
76816
76841
  <a:lstStyle />
76817
76842
  <a:p>
76818
76843
  <a:pPr lvl="0">
76819
- <a:defRPr b="${style?.bold ? 1 : 0}" i="${style?.italic ? 1 : 0}">
76844
+ <a:defRPr ${formatAttributes(textProperties)}>
76820
76845
  ${solidFill(fontColor)}
76821
76846
  <a:latin typeface="+mn-lt"/>
76822
76847
  </a:defRPr>
76823
76848
  </a:pPr>
76824
76849
  <a:r> <!-- Runs -->
76825
- <a:rPr b="${style?.bold ? 1 : 0}" i="${style?.italic ? 1 : 0}" sz="${fontsize * 100}"/>
76850
+ <a:rPr ${formatAttributes(textProperties)}/>
76826
76851
  <a:t>${text}</a:t>
76827
76852
  </a:r>
76828
76853
  </a:p>
@@ -81846,6 +81871,6 @@ exports.stores = stores;
81846
81871
  exports.tokenColors = tokenColors;
81847
81872
  exports.tokenize = tokenize;
81848
81873
 
81849
- __info__.version = "19.2.13";
81850
- __info__.date = "2026-05-15T07:07:37.391Z";
81851
- __info__.hash = "fece642";
81874
+ __info__.version = "19.2.15";
81875
+ __info__.date = "2026-06-06T06:23:14.723Z";
81876
+ __info__.hash = "d29528e";
@@ -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 19.2.13
6
- * @date 2026-05-15T07:07:39.096Z
7
- * @hash fece642
5
+ * @version 19.2.15
6
+ * @date 2026-06-06T06:23:16.378Z
7
+ * @hash d29528e
8
8
  */
9
9
  :root {
10
10
  --os-gray-100: light-dark(#f9fafb, #1b1d26);