@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
  (function(exports, _odoo_owl) {
@@ -4329,6 +4329,7 @@ stores.inject(MyMetaStore, storeInstance);
4329
4329
  //#endregion
4330
4330
  //#region src/helpers/format/format_tokenizer.ts
4331
4331
  function tokenizeFormat(str) {
4332
+ str = str.replace(/\s/g, " ");
4332
4333
  const chars = new TokenizingChars(str);
4333
4334
  const result = [];
4334
4335
  let currentFormatPart = [];
@@ -5505,7 +5506,12 @@ stores.inject(MyMetaStore, storeInstance);
5505
5506
  "SET_ZOOM",
5506
5507
  "UPDATE_CAROUSEL_ACTIVE_ITEM",
5507
5508
  "DUPLICATE_PIVOT_IN_NEW_SHEET",
5508
- "UPDATE_FILTER"
5509
+ "UPDATE_FILTER",
5510
+ "ACTIVATE_NEXT_SHEET",
5511
+ "ACTIVATE_PREVIOUS_SHEET",
5512
+ "SCROLL_TO_CELL",
5513
+ "SHIFT_VIEWPORT_DOWN",
5514
+ "SHIFT_VIEWPORT_UP"
5509
5515
  ]);
5510
5516
  const coreTypes = new Set([
5511
5517
  "UPDATE_CELL",
@@ -6485,8 +6491,13 @@ stores.inject(MyMetaStore, storeInstance);
6485
6491
  changeType: "NONE",
6486
6492
  range
6487
6493
  };
6494
+ const isUnboundedAtEnd = range.unboundedZone[end] === void 0;
6495
+ if (isUnboundedAtEnd && !range.unboundedZone.hasHeader) return {
6496
+ changeType: "RESIZE",
6497
+ range: createAdaptedRange(range, dimension, "RESIZE", cmd.quantity)
6498
+ };
6488
6499
  if (cmd.position === "after") {
6489
- if (range.zone[start] <= cmd.base && cmd.base < range.zone[end]) return {
6500
+ if (range.zone[start] <= cmd.base && (cmd.base < range.zone[end] || isUnboundedAtEnd)) return {
6490
6501
  changeType: "RESIZE",
6491
6502
  range: createAdaptedRange(range, dimension, "RESIZE", cmd.quantity)
6492
6503
  };
@@ -7079,40 +7090,9 @@ stores.inject(MyMetaStore, storeInstance);
7079
7090
  }
7080
7091
  };
7081
7092
 
7082
- //#endregion
7083
- //#region src/registry.ts
7084
- var Registry$1 = class {
7085
- content = {};
7086
- add(key, value) {
7087
- if (key in this.content) throw new Error(`${key} is already present in this registry!`);
7088
- return this.replace(key, value);
7089
- }
7090
- replace(key, value) {
7091
- this.content[key] = value;
7092
- return this;
7093
- }
7094
- get(key) {
7095
- const content = this.content[key];
7096
- if (!content && !(key in this.content)) throw new Error(`Cannot find ${key} in this registry!`);
7097
- return content;
7098
- }
7099
- contains(key) {
7100
- return key in this.content;
7101
- }
7102
- getAll() {
7103
- return Object.values(this.content);
7104
- }
7105
- getKeys() {
7106
- return Object.keys(this.content);
7107
- }
7108
- remove(key) {
7109
- delete this.content[key];
7110
- }
7111
- };
7112
-
7113
7093
  //#endregion
7114
7094
  //#region src/helpers/figures/charts/chart_js_extension.ts
7115
- const chartJsExtensionRegistry = new Registry$1();
7095
+ const chartJsExtensionRegistry = new Registry();
7116
7096
  function areChartJSExtensionsLoaded() {
7117
7097
  return globalThis.Chart ? !!globalThis.Chart.registry.plugins.get("chartShowValuesPlugin") : true;
7118
7098
  }
@@ -7430,6 +7410,10 @@ stores.inject(MyMetaStore, storeInstance);
7430
7410
  ROUNDDOWN: [{
7431
7411
  type: "NUMBER",
7432
7412
  value: 0
7413
+ }],
7414
+ IFERROR: [{
7415
+ type: "NUMBER",
7416
+ value: 0
7433
7417
  }]
7434
7418
  };
7435
7419
  /**
@@ -25703,7 +25687,7 @@ stores.inject(MyMetaStore, storeInstance);
25703
25687
  //#endregion
25704
25688
  //#region src/functions/function_registry.ts
25705
25689
  const functionNameRegex = /^[A-Z0-9\_\.]+$/;
25706
- var FunctionRegistry = class extends Registry$1 {
25690
+ var FunctionRegistry = class extends Registry {
25707
25691
  mapping = {};
25708
25692
  add(name, addDescr) {
25709
25693
  name = name.toUpperCase();
@@ -30197,7 +30181,7 @@ stores.inject(MyMetaStore, storeInstance);
30197
30181
 
30198
30182
  //#endregion
30199
30183
  //#region src/migrations/migration_steps.ts
30200
- const migrationStepRegistry = new Registry$1();
30184
+ const migrationStepRegistry = new Registry();
30201
30185
  migrationStepRegistry.add("0.1", { migrate(data) {
30202
30186
  if (data.sheets && data.sheets[0]) data.activeSheet = data.sheets[0].name;
30203
30187
  return data;
@@ -37520,11 +37504,10 @@ stores.inject(MyMetaStore, storeInstance);
37520
37504
  if (interactiveCreateTable(env, env.model.getters.getActiveSheetId()).isSuccessful) env.openSidePanel("TableSidePanel", {});
37521
37505
  };
37522
37506
  const DELETE_SELECTED_TABLE = (env) => {
37523
- const position = env.model.getters.getActivePosition();
37524
- const table = env.model.getters.getTable(position);
37507
+ const table = env.model.getters.getFirstTableInSelection();
37525
37508
  if (!table) return;
37526
37509
  env.model.dispatch("REMOVE_TABLE", {
37527
- sheetId: position.sheetId,
37510
+ sheetId: env.model.getters.getActiveSheetId(),
37528
37511
  target: [table.range.zone]
37529
37512
  });
37530
37513
  };
@@ -43307,7 +43290,7 @@ stores.inject(MyMetaStore, storeInstance);
43307
43290
  col,
43308
43291
  row
43309
43292
  };
43310
- if (pivotId === getters.getPivotIdFromPosition(position)) positions.push(position);
43293
+ if (getters.getPivotIdsFromPosition(position).includes(pivotId)) positions.push(position);
43311
43294
  }
43312
43295
  return positions;
43313
43296
  }
@@ -45731,7 +45714,7 @@ stores.inject(MyMetaStore, storeInstance);
45731
45714
 
45732
45715
  //#endregion
45733
45716
  //#region src/helpers/pivot/pivot_registry.ts
45734
- const pivotRegistry = new Registry$1();
45717
+ const pivotRegistry = new Registry();
45735
45718
  const dateGranularities = [
45736
45719
  "year",
45737
45720
  "quarter_number",
@@ -45795,6 +45778,9 @@ stores.inject(MyMetaStore, storeInstance);
45795
45778
  function getFirstPivotFunction(compiledFormula, getters) {
45796
45779
  return compiledFormula.getFunctionsFromTokens(PIVOT_FUNCTIONS, getters)[0];
45797
45780
  }
45781
+ function getPivotFunctions(compiledFormula, getters) {
45782
+ return compiledFormula.getFunctionsFromTokens(PIVOT_FUNCTIONS, getters);
45783
+ }
45798
45784
  /**
45799
45785
  * Parse a spreadsheet formula and detect the number of PIVOT functions that are
45800
45786
  * present in the given formula.
@@ -63523,6 +63509,7 @@ stores.inject(MyMetaStore, storeInstance);
63523
63509
  "getFirstPivotFunction",
63524
63510
  "getPivotCellSortDirection",
63525
63511
  "getPivotIdFromPosition",
63512
+ "getPivotIdsFromPosition",
63526
63513
  "getPivotCellFromPosition",
63527
63514
  "generateNewCalculatedMeasureName",
63528
63515
  "isPivotUnused",
@@ -63549,9 +63536,11 @@ stores.inject(MyMetaStore, storeInstance);
63549
63536
  this.refreshPivot(cmd.id);
63550
63537
  break;
63551
63538
  case "ADD_PIVOT":
63539
+ this.unusedPivotsInFormulas?.push(cmd.pivotId);
63552
63540
  this.setupPivot(cmd.pivotId);
63553
63541
  break;
63554
63542
  case "DUPLICATE_PIVOT":
63543
+ this.unusedPivotsInFormulas?.push(cmd.newPivotId);
63555
63544
  this.setupPivot(cmd.newPivotId);
63556
63545
  break;
63557
63546
  case "UPDATE_PIVOT":
@@ -63582,37 +63571,52 @@ stores.inject(MyMetaStore, storeInstance);
63582
63571
  }
63583
63572
  }
63584
63573
  /**
63585
- * Get the id of the pivot at the given position. Returns undefined if there
63574
+ * Get the id of the first pivot in the formula at the given position. Returns undefined if there
63586
63575
  * is no pivot at this position
63587
63576
  */
63588
63577
  getPivotIdFromPosition(position) {
63578
+ return this.getPivotIdsFromPosition(position)[0];
63579
+ }
63580
+ /**
63581
+ * Get all of the ids of the pivot present in the formula at the given position.
63582
+ */
63583
+ getPivotIdsFromPosition(position) {
63589
63584
  const cell = this.getters.getCorrespondingFormulaCell(position);
63590
- if (cell && cell.isFormula) {
63591
- const pivotFunction = this.getFirstPivotFunction(position.sheetId, cell.compiledFormula);
63592
- if (pivotFunction) {
63593
- const pivotId = pivotFunction.args[0]?.toString();
63594
- return pivotId && this.getters.getPivotId(pivotId);
63595
- }
63596
- }
63585
+ if (cell && cell.isFormula) return this.getPivotIdsFromFormula(position.sheetId, cell.compiledFormula);
63586
+ return [];
63587
+ }
63588
+ getPivotIdsFromFormula(sheetId, formula) {
63589
+ return this.getPivotFunctions(sheetId, formula).map((pivotFunction) => {
63590
+ const pivotId = pivotFunction.args[0]?.toString();
63591
+ return pivotId && this.getters.getPivotId(pivotId);
63592
+ }).filter(isDefined);
63597
63593
  }
63598
63594
  isSpillPivotFormula(position) {
63599
63595
  const cell = this.getters.getCorrespondingFormulaCell(position);
63600
63596
  if (cell && cell.isFormula) return this.getFirstPivotFunction(position.sheetId, cell.compiledFormula)?.functionName === "PIVOT";
63601
63597
  return false;
63602
63598
  }
63603
- getFirstPivotFunction(sheetId, compiledFormula) {
63604
- const pivotFunction = getFirstPivotFunction(compiledFormula, this.getters);
63605
- if (!pivotFunction) return;
63606
- const { functionName, args } = pivotFunction;
63607
- return {
63608
- functionName,
63609
- args: args.map((argAst) => {
63599
+ getPivotFunctions(sheetId, formula) {
63600
+ const pivotFunctions = getPivotFunctions(formula, this.getters);
63601
+ if (!pivotFunctions.length) return [];
63602
+ const evaluatedPivotFunctions = [];
63603
+ for (const pivotFunction of pivotFunctions) {
63604
+ const { functionName, args } = pivotFunction;
63605
+ const evaluatedArgs = args.map((argAst) => {
63610
63606
  if (argAst.type === "EMPTY") return;
63611
63607
  else if (argAst.type === "STRING" || argAst.type === "BOOLEAN" || argAst.type === "NUMBER") return argAst.value;
63612
63608
  const argsString = astToFormula(argAst);
63613
63609
  return this.getters.evaluateFormula(sheetId, argsString);
63614
- })
63615
- };
63610
+ });
63611
+ evaluatedPivotFunctions.push({
63612
+ functionName,
63613
+ args: evaluatedArgs
63614
+ });
63615
+ }
63616
+ return evaluatedPivotFunctions;
63617
+ }
63618
+ getFirstPivotFunction(sheetId, formula) {
63619
+ return this.getPivotFunctions(sheetId, formula)[0];
63616
63620
  }
63617
63621
  /**
63618
63622
  * Returns the domain args of a pivot formula from a position.
@@ -63718,8 +63722,8 @@ stores.inject(MyMetaStore, storeInstance);
63718
63722
  const unusedPivots = new Set(this.getters.getPivotIds());
63719
63723
  for (const sheetId of this.getters.getSheetIds()) for (const cell of this.getters.getCells(sheetId)) {
63720
63724
  const position = this.getters.getCellPosition(cell.id);
63721
- const pivotId = this.getPivotIdFromPosition(position);
63722
- if (pivotId) {
63725
+ const pivotIds = this.getPivotIdsFromPosition(position);
63726
+ for (const pivotId of pivotIds) {
63723
63727
  unusedPivots.delete(pivotId);
63724
63728
  if (!unusedPivots.size) {
63725
63729
  this.unusedPivotsInFormulas = [];
@@ -63727,6 +63731,21 @@ stores.inject(MyMetaStore, storeInstance);
63727
63731
  }
63728
63732
  }
63729
63733
  }
63734
+ for (const pivotId of this.getters.getPivotIds()) {
63735
+ const pivot = this.getters.getPivotCoreDefinition(pivotId);
63736
+ for (const measure of pivot.measures) if (measure.computedBy) {
63737
+ const { sheetId } = measure.computedBy;
63738
+ const formula = this.getters.getMeasureCompiledFormula(pivotId, measure);
63739
+ const relatedPivotIds = this.getPivotIdsFromFormula(sheetId, formula);
63740
+ for (const relatedPivotId of relatedPivotIds) {
63741
+ unusedPivots.delete(relatedPivotId);
63742
+ if (!unusedPivots.size) {
63743
+ this.unusedPivotsInFormulas = [];
63744
+ return [];
63745
+ }
63746
+ }
63747
+ }
63748
+ }
63730
63749
  this.unusedPivotsInFormulas = [...unusedPivots];
63731
63750
  return this.unusedPivotsInFormulas;
63732
63751
  }
@@ -65454,7 +65473,8 @@ stores.inject(MyMetaStore, storeInstance);
65454
65473
  "REMOVE_TABLE",
65455
65474
  "RESIZE_TABLE",
65456
65475
  "CREATE_TABLE_STYLE",
65457
- "REMOVE_TABLE_STYLE"
65476
+ "REMOVE_TABLE_STYLE",
65477
+ "DELETE_CONTENT"
65458
65478
  ]);
65459
65479
  function doesCommandInvalidatesTableStyle(cmd) {
65460
65480
  return invalidateTableStyleCommandsSet.has(cmd.type);
@@ -70739,10 +70759,10 @@ stores.inject(MyMetaStore, storeInstance);
70739
70759
 
70740
70760
  //#endregion
70741
70761
  //#region src/plugins/index.ts
70742
- 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);
70743
- 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);
70744
- 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);
70745
- 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);
70762
+ 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);
70763
+ 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);
70764
+ 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);
70765
+ 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);
70746
70766
 
70747
70767
  //#endregion
70748
70768
  //#region src/registries/auto_completes/data_validation_auto_complete.ts
@@ -76626,6 +76646,11 @@ stores.inject(MyMetaStore, storeInstance);
76626
76646
  `;
76627
76647
  }
76628
76648
  function insertText(text, fontColor = "000000", fontsize = 16, style = {}) {
76649
+ const textProperties = [
76650
+ ["b", style.bold ? "1" : "0"],
76651
+ ["i", style.italic ? "1" : "0"],
76652
+ ["sz", fontsize * 100]
76653
+ ];
76629
76654
  return escapeXml`
76630
76655
  <c:tx>
76631
76656
  <c:rich>
@@ -76633,13 +76658,13 @@ stores.inject(MyMetaStore, storeInstance);
76633
76658
  <a:lstStyle />
76634
76659
  <a:p>
76635
76660
  <a:pPr lvl="0">
76636
- <a:defRPr b="${style?.bold ? 1 : 0}" i="${style?.italic ? 1 : 0}">
76661
+ <a:defRPr ${formatAttributes(textProperties)}>
76637
76662
  ${solidFill(fontColor)}
76638
76663
  <a:latin typeface="+mn-lt"/>
76639
76664
  </a:defRPr>
76640
76665
  </a:pPr>
76641
76666
  <a:r> <!-- Runs -->
76642
- <a:rPr b="${style?.bold ? 1 : 0}" i="${style?.italic ? 1 : 0}" sz="${fontsize * 100}"/>
76667
+ <a:rPr ${formatAttributes(textProperties)}/>
76643
76668
  <a:t>${text}</a:t>
76644
76669
  </a:r>
76645
76670
  </a:p>
@@ -81663,8 +81688,8 @@ exports.stores = stores;
81663
81688
  exports.tokenColors = tokenColors;
81664
81689
  exports.tokenize = tokenize;
81665
81690
 
81666
- __info__.version = "19.2.13";
81667
- __info__.date = "2026-05-15T07:07:37.391Z";
81668
- __info__.hash = "fece642";
81691
+ __info__.version = "19.2.15";
81692
+ __info__.date = "2026-06-06T06:23:14.723Z";
81693
+ __info__.hash = "d29528e";
81669
81694
 
81670
81695
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);