@odoo/o-spreadsheet 19.3.5 → 19.3.7

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.3.5
6
- * @date 2026-05-27T06:08:23.138Z
7
- * @hash 0cf1540
5
+ * @version 19.3.7
6
+ * @date 2026-06-17T08:57:42.174Z
7
+ * @hash e061163
8
8
  */
9
9
 
10
10
  (function(exports, _odoo_owl) {
@@ -3241,31 +3241,78 @@ stores.inject(MyMetaStore, storeInstance);
3241
3241
  }
3242
3242
 
3243
3243
  //#endregion
3244
- //#region src/registry.ts
3245
- var Registry$1 = class {
3244
+ //#region src/registries/registry.ts
3245
+ /**
3246
+ * Registry
3247
+ *
3248
+ * The Registry class is basically just a mapping from a string key to an object.
3249
+ * It is really not much more than an object. It is however useful for the
3250
+ * following reasons:
3251
+ *
3252
+ * 1. it let us react and execute code when someone add something to the registry
3253
+ * (for example, the FunctionRegistry subclass this for this purpose)
3254
+ * 2. it throws an error when the get operation fails
3255
+ * 3. it provides a chained API to add items to the registry.
3256
+ */
3257
+ var Registry = class {
3246
3258
  content = {};
3259
+ /**
3260
+ * Add an item to the registry, you can only add if there is no item
3261
+ * already present in the registery with the given key
3262
+ *
3263
+ * Note that this also returns the registry, so another add method call can
3264
+ * be chained
3265
+ */
3247
3266
  add(key, value) {
3248
3267
  if (key in this.content) throw new Error(`${key} is already present in this registry!`);
3249
3268
  return this.replace(key, value);
3250
3269
  }
3270
+ /**
3271
+ * Replace (or add) an item to the registry
3272
+ *
3273
+ * Note that this also returns the registry, so another add method call can
3274
+ * be chained
3275
+ */
3251
3276
  replace(key, value) {
3252
3277
  this.content[key] = value;
3253
3278
  return this;
3254
3279
  }
3280
+ /**
3281
+ * Get an item from the registry
3282
+ */
3255
3283
  get(key) {
3284
+ /**
3285
+ * Note: key in {} is ~12 times slower than {}[key].
3286
+ * So, we check the absence of key only when the direct access returns
3287
+ * a falsy value. It's done to ensure that the registry can contains falsy values
3288
+ */
3256
3289
  const content = this.content[key];
3257
- if (!content && !(key in this.content)) throw new Error(`Cannot find ${key} in this registry!`);
3290
+ if (!content) {
3291
+ if (!(key in this.content)) throw new Error(`Cannot find ${key} in this registry!`);
3292
+ }
3258
3293
  return content;
3259
3294
  }
3295
+ /**
3296
+ * Check if the key is already in the registry
3297
+ */
3260
3298
  contains(key) {
3261
3299
  return key in this.content;
3262
3300
  }
3301
+ /**
3302
+ * Get a list of all elements in the registry
3303
+ */
3263
3304
  getAll() {
3264
3305
  return Object.values(this.content);
3265
3306
  }
3307
+ /**
3308
+ * Get a list of all keys in the registry
3309
+ */
3266
3310
  getKeys() {
3267
3311
  return Object.keys(this.content);
3268
3312
  }
3313
+ /**
3314
+ * Remove an item from the registry
3315
+ */
3269
3316
  remove(key) {
3270
3317
  delete this.content[key];
3271
3318
  }
@@ -4644,7 +4691,7 @@ stores.inject(MyMetaStore, storeInstance);
4644
4691
  //#endregion
4645
4692
  //#region src/functions/function_registry.ts
4646
4693
  const functionNameRegex = /^[A-Z0-9\_\.]+$/;
4647
- var FunctionRegistry = class extends Registry$1 {
4694
+ var FunctionRegistry = class extends Registry {
4648
4695
  mapping = {};
4649
4696
  add(name, addDescr) {
4650
4697
  name = name.toUpperCase();
@@ -5458,84 +5505,6 @@ stores.inject(MyMetaStore, storeInstance);
5458
5505
  return nextToken?.type === "LEFT_PAREN" && functionRegex.test(currentToken.value) && currentToken.value === unquote(currentToken.value, "'");
5459
5506
  }
5460
5507
 
5461
- //#endregion
5462
- //#region src/registries/registry.ts
5463
- /**
5464
- * Registry
5465
- *
5466
- * The Registry class is basically just a mapping from a string key to an object.
5467
- * It is really not much more than an object. It is however useful for the
5468
- * following reasons:
5469
- *
5470
- * 1. it let us react and execute code when someone add something to the registry
5471
- * (for example, the FunctionRegistry subclass this for this purpose)
5472
- * 2. it throws an error when the get operation fails
5473
- * 3. it provides a chained API to add items to the registry.
5474
- */
5475
- var Registry = class {
5476
- content = {};
5477
- /**
5478
- * Add an item to the registry, you can only add if there is no item
5479
- * already present in the registery with the given key
5480
- *
5481
- * Note that this also returns the registry, so another add method call can
5482
- * be chained
5483
- */
5484
- add(key, value) {
5485
- if (key in this.content) throw new Error(`${key} is already present in this registry!`);
5486
- return this.replace(key, value);
5487
- }
5488
- /**
5489
- * Replace (or add) an item to the registry
5490
- *
5491
- * Note that this also returns the registry, so another add method call can
5492
- * be chained
5493
- */
5494
- replace(key, value) {
5495
- this.content[key] = value;
5496
- return this;
5497
- }
5498
- /**
5499
- * Get an item from the registry
5500
- */
5501
- get(key) {
5502
- /**
5503
- * Note: key in {} is ~12 times slower than {}[key].
5504
- * So, we check the absence of key only when the direct access returns
5505
- * a falsy value. It's done to ensure that the registry can contains falsy values
5506
- */
5507
- const content = this.content[key];
5508
- if (!content) {
5509
- if (!(key in this.content)) throw new Error(`Cannot find ${key} in this registry!`);
5510
- }
5511
- return content;
5512
- }
5513
- /**
5514
- * Check if the key is already in the registry
5515
- */
5516
- contains(key) {
5517
- return key in this.content;
5518
- }
5519
- /**
5520
- * Get a list of all elements in the registry
5521
- */
5522
- getAll() {
5523
- return Object.values(this.content);
5524
- }
5525
- /**
5526
- * Get a list of all keys in the registry
5527
- */
5528
- getKeys() {
5529
- return Object.keys(this.content);
5530
- }
5531
- /**
5532
- * Remove an item from the registry
5533
- */
5534
- remove(key) {
5535
- delete this.content[key];
5536
- }
5537
- };
5538
-
5539
5508
  //#endregion
5540
5509
  //#region src/helpers/range.ts
5541
5510
  function createRange(args, getSheetSize) {
@@ -6561,6 +6530,7 @@ stores.inject(MyMetaStore, storeInstance);
6561
6530
  //#endregion
6562
6531
  //#region src/helpers/format/format_tokenizer.ts
6563
6532
  function tokenizeFormat(str) {
6533
+ str = str.replace(/\s/g, " ");
6564
6534
  const chars = new TokenizingChars(str);
6565
6535
  const result = [];
6566
6536
  let currentFormatPart = [];
@@ -7691,7 +7661,12 @@ stores.inject(MyMetaStore, storeInstance);
7691
7661
  "SET_ZOOM",
7692
7662
  "UPDATE_CAROUSEL_ACTIVE_ITEM",
7693
7663
  "DUPLICATE_PIVOT_IN_NEW_SHEET",
7694
- "UPDATE_FILTER"
7664
+ "UPDATE_FILTER",
7665
+ "ACTIVATE_NEXT_SHEET",
7666
+ "ACTIVATE_PREVIOUS_SHEET",
7667
+ "SCROLL_TO_CELL",
7668
+ "SHIFT_VIEWPORT_DOWN",
7669
+ "SHIFT_VIEWPORT_UP"
7695
7670
  ]);
7696
7671
  const coreTypes = new Set([
7697
7672
  "UPDATE_CELL",
@@ -8764,7 +8739,7 @@ stores.inject(MyMetaStore, storeInstance);
8764
8739
 
8765
8740
  //#endregion
8766
8741
  //#region src/helpers/figures/charts/chart_js_extension.ts
8767
- const chartJsExtensionRegistry = new Registry$1();
8742
+ const chartJsExtensionRegistry = new Registry();
8768
8743
  function areChartJSExtensionsLoaded() {
8769
8744
  return globalThis.Chart ? !!globalThis.Chart.registry.plugins.get("chartShowValuesPlugin") : true;
8770
8745
  }
@@ -23275,7 +23250,7 @@ stores.inject(MyMetaStore, storeInstance);
23275
23250
 
23276
23251
  //#endregion
23277
23252
  //#region src/migrations/migration_steps.ts
23278
- const migrationStepRegistry = new Registry$1();
23253
+ const migrationStepRegistry = new Registry();
23279
23254
  migrationStepRegistry.add("0.1", { migrate(data) {
23280
23255
  if (data.sheets && data.sheets[0]) data.activeSheet = data.sheets[0].name;
23281
23256
  return data;
@@ -30287,11 +30262,10 @@ stores.inject(MyMetaStore, storeInstance);
30287
30262
  if (interactiveCreateTable(env, env.model.getters.getActiveSheetId()).isSuccessful) env.openSidePanel("TableSidePanel", {});
30288
30263
  };
30289
30264
  const DELETE_SELECTED_TABLE = (env) => {
30290
- const position = env.model.getters.getActivePosition();
30291
- const table = env.model.getters.getTable(position);
30265
+ const table = env.model.getters.getFirstTableInSelection();
30292
30266
  if (!table) return;
30293
30267
  env.model.dispatch("REMOVE_TABLE", {
30294
- sheetId: position.sheetId,
30268
+ sheetId: env.model.getters.getActiveSheetId(),
30295
30269
  target: [table.range.zone]
30296
30270
  });
30297
30271
  };
@@ -39566,7 +39540,7 @@ stores.inject(MyMetaStore, storeInstance);
39566
39540
 
39567
39541
  //#endregion
39568
39542
  //#region src/helpers/pivot/pivot_registry.ts
39569
- const pivotRegistry = new Registry$1();
39543
+ const pivotRegistry = new Registry();
39570
39544
  const dateGranularities = [
39571
39545
  "year",
39572
39546
  "quarter_number",
@@ -56063,7 +56037,7 @@ stores.inject(MyMetaStore, storeInstance);
56063
56037
  if (!(definition.style?.tabularForm ?? DEFAULT_PIVOT_STYLE.tabularForm) && pivotCell.type === "HEADER" && pivotId && pivotCell.domain.length) {
56064
56038
  const isDashboard = getters.isDashboard();
56065
56039
  const fields = pivotCell.dimension === "COL" ? definition.columns : definition.rows;
56066
- const hasIcon = !isDashboard && pivotCell.domain.length !== fields.length;
56040
+ const hasIcon = !isDashboard && !getters.shouldShowFormulas() && pivotCell.domain.length !== fields.length;
56067
56041
  const isCollapsed = (definition.collapsedDomains?.[pivotCell.dimension] ?? []).some((domain) => deepEquals(domain, pivotCell.domain));
56068
56042
  const indent = pivotCell.dimension === "ROW" ? (pivotCell.domain.length - 1) * 15 : 0;
56069
56043
  return {
@@ -57874,9 +57848,11 @@ stores.inject(MyMetaStore, storeInstance);
57874
57848
  this.refreshPivot(cmd.id);
57875
57849
  break;
57876
57850
  case "ADD_PIVOT":
57851
+ this.unusedPivotsInFormulas?.push(cmd.pivotId);
57877
57852
  this.setupPivot(cmd.pivotId);
57878
57853
  break;
57879
57854
  case "DUPLICATE_PIVOT":
57855
+ this.unusedPivotsInFormulas?.push(cmd.newPivotId);
57880
57856
  this.setupPivot(cmd.newPivotId);
57881
57857
  break;
57882
57858
  case "UPDATE_PIVOT":
@@ -58068,8 +58044,8 @@ stores.inject(MyMetaStore, storeInstance);
58068
58044
  }
58069
58045
  }
58070
58046
  for (const pivotId of this.getters.getPivotIds()) {
58071
- const pivot = this.getters.getPivot(pivotId);
58072
- for (const measure of pivot.definition.measures) if (measure.computedBy) {
58047
+ const pivot = this.getters.getPivotCoreDefinition(pivotId);
58048
+ for (const measure of pivot.measures) if (measure.computedBy) {
58073
58049
  const { sheetId } = measure.computedBy;
58074
58050
  const formula = this.getters.getMeasureCompiledFormula(pivotId, measure);
58075
58051
  const relatedPivotIds = this.getPivotIdsFromFormula(sheetId, formula);
@@ -59831,7 +59807,8 @@ stores.inject(MyMetaStore, storeInstance);
59831
59807
  "REMOVE_TABLE",
59832
59808
  "RESIZE_TABLE",
59833
59809
  "CREATE_TABLE_STYLE",
59834
- "REMOVE_TABLE_STYLE"
59810
+ "REMOVE_TABLE_STYLE",
59811
+ "DELETE_CONTENT"
59835
59812
  ]);
59836
59813
  function doesCommandInvalidatesTableStyle(cmd) {
59837
59814
  return invalidateTableStyleCommandsSet.has(cmd.type);
@@ -65526,10 +65503,10 @@ stores.inject(MyMetaStore, storeInstance);
65526
65503
 
65527
65504
  //#endregion
65528
65505
  //#region src/plugins/index.ts
65529
- 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("named_ranges", NamedRangesPlugin).add("pivot_core", PivotCorePlugin).add("spreadsheet_pivot_core", SpreadsheetPivotCorePlugin).add("tableStyle", TableStylePlugin);
65530
- 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);
65531
- 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);
65532
- 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);
65506
+ 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("named_ranges", NamedRangesPlugin).add("pivot_core", PivotCorePlugin).add("spreadsheet_pivot_core", SpreadsheetPivotCorePlugin).add("tableStyle", TableStylePlugin);
65507
+ 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);
65508
+ 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);
65509
+ 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);
65533
65510
 
65534
65511
  //#endregion
65535
65512
  //#region src/registries/auto_completes/data_validation_auto_complete.ts
@@ -72327,6 +72304,11 @@ stores.inject(MyMetaStore, storeInstance);
72327
72304
  `;
72328
72305
  }
72329
72306
  function insertText(text, fontColor = "000000", fontsize = 16, style = {}) {
72307
+ const textProperties = [
72308
+ ["b", style.bold ? "1" : "0"],
72309
+ ["i", style.italic ? "1" : "0"],
72310
+ ["sz", fontsize * 100]
72311
+ ];
72330
72312
  return escapeXml`
72331
72313
  <c:tx>
72332
72314
  <c:rich>
@@ -72334,13 +72316,13 @@ stores.inject(MyMetaStore, storeInstance);
72334
72316
  <a:lstStyle />
72335
72317
  <a:p>
72336
72318
  <a:pPr lvl="0">
72337
- <a:defRPr b="${style?.bold ? 1 : 0}" i="${style?.italic ? 1 : 0}">
72319
+ <a:defRPr ${formatAttributes(textProperties)}>
72338
72320
  ${solidFill(fontColor)}
72339
72321
  <a:latin typeface="+mn-lt"/>
72340
72322
  </a:defRPr>
72341
72323
  </a:pPr>
72342
72324
  <a:r> <!-- Runs -->
72343
- <a:rPr b="${style?.bold ? 1 : 0}" i="${style?.italic ? 1 : 0}" sz="${fontsize * 100}"/>
72325
+ <a:rPr ${formatAttributes(textProperties)}/>
72344
72326
  <a:t>${text}</a:t>
72345
72327
  </a:r>
72346
72328
  </a:p>
@@ -84548,8 +84530,8 @@ exports.stores = stores;
84548
84530
  exports.tokenColors = tokenColors;
84549
84531
  exports.tokenize = tokenize;
84550
84532
 
84551
- __info__.version = "19.3.5";
84552
- __info__.date = "2026-05-27T06:08:23.138Z";
84553
- __info__.hash = "0cf1540";
84533
+ __info__.version = "19.3.7";
84534
+ __info__.date = "2026-06-17T08:57:42.174Z";
84535
+ __info__.hash = "e061163";
84554
84536
 
84555
84537
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);