@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
  import { App, Component, blockDom, markRaw, onMounted, onPatched, onWillPatch, onWillStart, onWillUnmount, onWillUpdateProps, status, toRaw, useChildSubEnv, useComponent, useEffect, useEnv, useExternalListener, useRef, useState, useSubEnv, whenReady, xml } from "@odoo/owl";
@@ -3239,31 +3239,78 @@ function validateArguments(descr) {
3239
3239
  }
3240
3240
 
3241
3241
  //#endregion
3242
- //#region src/registry.ts
3243
- var Registry$1 = class {
3242
+ //#region src/registries/registry.ts
3243
+ /**
3244
+ * Registry
3245
+ *
3246
+ * The Registry class is basically just a mapping from a string key to an object.
3247
+ * It is really not much more than an object. It is however useful for the
3248
+ * following reasons:
3249
+ *
3250
+ * 1. it let us react and execute code when someone add something to the registry
3251
+ * (for example, the FunctionRegistry subclass this for this purpose)
3252
+ * 2. it throws an error when the get operation fails
3253
+ * 3. it provides a chained API to add items to the registry.
3254
+ */
3255
+ var Registry = class {
3244
3256
  content = {};
3257
+ /**
3258
+ * Add an item to the registry, you can only add if there is no item
3259
+ * already present in the registery with the given key
3260
+ *
3261
+ * Note that this also returns the registry, so another add method call can
3262
+ * be chained
3263
+ */
3245
3264
  add(key, value) {
3246
3265
  if (key in this.content) throw new Error(`${key} is already present in this registry!`);
3247
3266
  return this.replace(key, value);
3248
3267
  }
3268
+ /**
3269
+ * Replace (or add) an item to the registry
3270
+ *
3271
+ * Note that this also returns the registry, so another add method call can
3272
+ * be chained
3273
+ */
3249
3274
  replace(key, value) {
3250
3275
  this.content[key] = value;
3251
3276
  return this;
3252
3277
  }
3278
+ /**
3279
+ * Get an item from the registry
3280
+ */
3253
3281
  get(key) {
3282
+ /**
3283
+ * Note: key in {} is ~12 times slower than {}[key].
3284
+ * So, we check the absence of key only when the direct access returns
3285
+ * a falsy value. It's done to ensure that the registry can contains falsy values
3286
+ */
3254
3287
  const content = this.content[key];
3255
- if (!content && !(key in this.content)) throw new Error(`Cannot find ${key} in this registry!`);
3288
+ if (!content) {
3289
+ if (!(key in this.content)) throw new Error(`Cannot find ${key} in this registry!`);
3290
+ }
3256
3291
  return content;
3257
3292
  }
3293
+ /**
3294
+ * Check if the key is already in the registry
3295
+ */
3258
3296
  contains(key) {
3259
3297
  return key in this.content;
3260
3298
  }
3299
+ /**
3300
+ * Get a list of all elements in the registry
3301
+ */
3261
3302
  getAll() {
3262
3303
  return Object.values(this.content);
3263
3304
  }
3305
+ /**
3306
+ * Get a list of all keys in the registry
3307
+ */
3264
3308
  getKeys() {
3265
3309
  return Object.keys(this.content);
3266
3310
  }
3311
+ /**
3312
+ * Remove an item from the registry
3313
+ */
3267
3314
  remove(key) {
3268
3315
  delete this.content[key];
3269
3316
  }
@@ -4642,7 +4689,7 @@ function hasStringMessage(obj) {
4642
4689
  //#endregion
4643
4690
  //#region src/functions/function_registry.ts
4644
4691
  const functionNameRegex = /^[A-Z0-9\_\.]+$/;
4645
- var FunctionRegistry = class extends Registry$1 {
4692
+ var FunctionRegistry = class extends Registry {
4646
4693
  mapping = {};
4647
4694
  add(name, addDescr) {
4648
4695
  name = name.toUpperCase();
@@ -5456,84 +5503,6 @@ function isFuncallToken(currentToken, nextToken) {
5456
5503
  return nextToken?.type === "LEFT_PAREN" && functionRegex.test(currentToken.value) && currentToken.value === unquote(currentToken.value, "'");
5457
5504
  }
5458
5505
 
5459
- //#endregion
5460
- //#region src/registries/registry.ts
5461
- /**
5462
- * Registry
5463
- *
5464
- * The Registry class is basically just a mapping from a string key to an object.
5465
- * It is really not much more than an object. It is however useful for the
5466
- * following reasons:
5467
- *
5468
- * 1. it let us react and execute code when someone add something to the registry
5469
- * (for example, the FunctionRegistry subclass this for this purpose)
5470
- * 2. it throws an error when the get operation fails
5471
- * 3. it provides a chained API to add items to the registry.
5472
- */
5473
- var Registry = class {
5474
- content = {};
5475
- /**
5476
- * Add an item to the registry, you can only add if there is no item
5477
- * already present in the registery with the given key
5478
- *
5479
- * Note that this also returns the registry, so another add method call can
5480
- * be chained
5481
- */
5482
- add(key, value) {
5483
- if (key in this.content) throw new Error(`${key} is already present in this registry!`);
5484
- return this.replace(key, value);
5485
- }
5486
- /**
5487
- * Replace (or add) an item to the registry
5488
- *
5489
- * Note that this also returns the registry, so another add method call can
5490
- * be chained
5491
- */
5492
- replace(key, value) {
5493
- this.content[key] = value;
5494
- return this;
5495
- }
5496
- /**
5497
- * Get an item from the registry
5498
- */
5499
- get(key) {
5500
- /**
5501
- * Note: key in {} is ~12 times slower than {}[key].
5502
- * So, we check the absence of key only when the direct access returns
5503
- * a falsy value. It's done to ensure that the registry can contains falsy values
5504
- */
5505
- const content = this.content[key];
5506
- if (!content) {
5507
- if (!(key in this.content)) throw new Error(`Cannot find ${key} in this registry!`);
5508
- }
5509
- return content;
5510
- }
5511
- /**
5512
- * Check if the key is already in the registry
5513
- */
5514
- contains(key) {
5515
- return key in this.content;
5516
- }
5517
- /**
5518
- * Get a list of all elements in the registry
5519
- */
5520
- getAll() {
5521
- return Object.values(this.content);
5522
- }
5523
- /**
5524
- * Get a list of all keys in the registry
5525
- */
5526
- getKeys() {
5527
- return Object.keys(this.content);
5528
- }
5529
- /**
5530
- * Remove an item from the registry
5531
- */
5532
- remove(key) {
5533
- delete this.content[key];
5534
- }
5535
- };
5536
-
5537
5506
  //#endregion
5538
5507
  //#region src/helpers/range.ts
5539
5508
  function createRange(args, getSheetSize) {
@@ -6559,6 +6528,7 @@ let CellValueType = /* @__PURE__ */ function(CellValueType) {
6559
6528
  //#endregion
6560
6529
  //#region src/helpers/format/format_tokenizer.ts
6561
6530
  function tokenizeFormat(str) {
6531
+ str = str.replace(/\s/g, " ");
6562
6532
  const chars = new TokenizingChars(str);
6563
6533
  const result = [];
6564
6534
  let currentFormatPart = [];
@@ -7689,7 +7659,12 @@ const lockedSheetAllowedCommands = new Set([
7689
7659
  "SET_ZOOM",
7690
7660
  "UPDATE_CAROUSEL_ACTIVE_ITEM",
7691
7661
  "DUPLICATE_PIVOT_IN_NEW_SHEET",
7692
- "UPDATE_FILTER"
7662
+ "UPDATE_FILTER",
7663
+ "ACTIVATE_NEXT_SHEET",
7664
+ "ACTIVATE_PREVIOUS_SHEET",
7665
+ "SCROLL_TO_CELL",
7666
+ "SHIFT_VIEWPORT_DOWN",
7667
+ "SHIFT_VIEWPORT_UP"
7693
7668
  ]);
7694
7669
  const coreTypes = new Set([
7695
7670
  "UPDATE_CELL",
@@ -8762,7 +8737,7 @@ var UuidGenerator = class {
8762
8737
 
8763
8738
  //#endregion
8764
8739
  //#region src/helpers/figures/charts/chart_js_extension.ts
8765
- const chartJsExtensionRegistry = new Registry$1();
8740
+ const chartJsExtensionRegistry = new Registry();
8766
8741
  function areChartJSExtensionsLoaded() {
8767
8742
  return globalThis.Chart ? !!globalThis.Chart.registry.plugins.get("chartShowValuesPlugin") : true;
8768
8743
  }
@@ -23273,7 +23248,7 @@ const WEEK_START = {
23273
23248
 
23274
23249
  //#endregion
23275
23250
  //#region src/migrations/migration_steps.ts
23276
- const migrationStepRegistry = new Registry$1();
23251
+ const migrationStepRegistry = new Registry();
23277
23252
  migrationStepRegistry.add("0.1", { migrate(data) {
23278
23253
  if (data.sheets && data.sheets[0]) data.activeSheet = data.sheets[0].name;
23279
23254
  return data;
@@ -30285,11 +30260,10 @@ const INSERT_TABLE = (env) => {
30285
30260
  if (interactiveCreateTable(env, env.model.getters.getActiveSheetId()).isSuccessful) env.openSidePanel("TableSidePanel", {});
30286
30261
  };
30287
30262
  const DELETE_SELECTED_TABLE = (env) => {
30288
- const position = env.model.getters.getActivePosition();
30289
- const table = env.model.getters.getTable(position);
30263
+ const table = env.model.getters.getFirstTableInSelection();
30290
30264
  if (!table) return;
30291
30265
  env.model.dispatch("REMOVE_TABLE", {
30292
- sheetId: position.sheetId,
30266
+ sheetId: env.model.getters.getActiveSheetId(),
30293
30267
  target: [table.range.zone]
30294
30268
  });
30295
30269
  };
@@ -39564,7 +39538,7 @@ var SpreadsheetPivot = class {
39564
39538
 
39565
39539
  //#endregion
39566
39540
  //#region src/helpers/pivot/pivot_registry.ts
39567
- const pivotRegistry = new Registry$1();
39541
+ const pivotRegistry = new Registry();
39568
39542
  const dateGranularities = [
39569
39543
  "year",
39570
39544
  "quarter_number",
@@ -56061,7 +56035,7 @@ iconsOnCellRegistry.add("pivot_collapse", (getters, position) => {
56061
56035
  if (!(definition.style?.tabularForm ?? DEFAULT_PIVOT_STYLE.tabularForm) && pivotCell.type === "HEADER" && pivotId && pivotCell.domain.length) {
56062
56036
  const isDashboard = getters.isDashboard();
56063
56037
  const fields = pivotCell.dimension === "COL" ? definition.columns : definition.rows;
56064
- const hasIcon = !isDashboard && pivotCell.domain.length !== fields.length;
56038
+ const hasIcon = !isDashboard && !getters.shouldShowFormulas() && pivotCell.domain.length !== fields.length;
56065
56039
  const isCollapsed = (definition.collapsedDomains?.[pivotCell.dimension] ?? []).some((domain) => deepEquals(domain, pivotCell.domain));
56066
56040
  const indent = pivotCell.dimension === "ROW" ? (pivotCell.domain.length - 1) * 15 : 0;
56067
56041
  return {
@@ -57872,9 +57846,11 @@ var PivotUIPlugin = class extends CoreViewPlugin {
57872
57846
  this.refreshPivot(cmd.id);
57873
57847
  break;
57874
57848
  case "ADD_PIVOT":
57849
+ this.unusedPivotsInFormulas?.push(cmd.pivotId);
57875
57850
  this.setupPivot(cmd.pivotId);
57876
57851
  break;
57877
57852
  case "DUPLICATE_PIVOT":
57853
+ this.unusedPivotsInFormulas?.push(cmd.newPivotId);
57878
57854
  this.setupPivot(cmd.newPivotId);
57879
57855
  break;
57880
57856
  case "UPDATE_PIVOT":
@@ -58066,8 +58042,8 @@ var PivotUIPlugin = class extends CoreViewPlugin {
58066
58042
  }
58067
58043
  }
58068
58044
  for (const pivotId of this.getters.getPivotIds()) {
58069
- const pivot = this.getters.getPivot(pivotId);
58070
- for (const measure of pivot.definition.measures) if (measure.computedBy) {
58045
+ const pivot = this.getters.getPivotCoreDefinition(pivotId);
58046
+ for (const measure of pivot.measures) if (measure.computedBy) {
58071
58047
  const { sheetId } = measure.computedBy;
58072
58048
  const formula = this.getters.getMeasureCompiledFormula(pivotId, measure);
58073
58049
  const relatedPivotIds = this.getPivotIdsFromFormula(sheetId, formula);
@@ -59829,7 +59805,8 @@ const invalidateTableStyleCommandsSet = new Set([
59829
59805
  "REMOVE_TABLE",
59830
59806
  "RESIZE_TABLE",
59831
59807
  "CREATE_TABLE_STYLE",
59832
- "REMOVE_TABLE_STYLE"
59808
+ "REMOVE_TABLE_STYLE",
59809
+ "DELETE_CONTENT"
59833
59810
  ]);
59834
59811
  function doesCommandInvalidatesTableStyle(cmd) {
59835
59812
  return invalidateTableStyleCommandsSet.has(cmd.type);
@@ -65524,10 +65501,10 @@ var SheetViewPlugin = class extends UIPlugin {
65524
65501
 
65525
65502
  //#endregion
65526
65503
  //#region src/plugins/index.ts
65527
- 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);
65528
- 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);
65529
- 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);
65530
- 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);
65504
+ 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);
65505
+ 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);
65506
+ 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);
65507
+ 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);
65531
65508
 
65532
65509
  //#endregion
65533
65510
  //#region src/registries/auto_completes/data_validation_auto_complete.ts
@@ -72325,6 +72302,11 @@ function lineAttributes(params) {
72325
72302
  `;
72326
72303
  }
72327
72304
  function insertText(text, fontColor = "000000", fontsize = 16, style = {}) {
72305
+ const textProperties = [
72306
+ ["b", style.bold ? "1" : "0"],
72307
+ ["i", style.italic ? "1" : "0"],
72308
+ ["sz", fontsize * 100]
72309
+ ];
72328
72310
  return escapeXml`
72329
72311
  <c:tx>
72330
72312
  <c:rich>
@@ -72332,13 +72314,13 @@ function insertText(text, fontColor = "000000", fontsize = 16, style = {}) {
72332
72314
  <a:lstStyle />
72333
72315
  <a:p>
72334
72316
  <a:pPr lvl="0">
72335
- <a:defRPr b="${style?.bold ? 1 : 0}" i="${style?.italic ? 1 : 0}">
72317
+ <a:defRPr ${formatAttributes(textProperties)}>
72336
72318
  ${solidFill(fontColor)}
72337
72319
  <a:latin typeface="+mn-lt"/>
72338
72320
  </a:defRPr>
72339
72321
  </a:pPr>
72340
72322
  <a:r> <!-- Runs -->
72341
- <a:rPr b="${style?.bold ? 1 : 0}" i="${style?.italic ? 1 : 0}" sz="${fontsize * 100}"/>
72323
+ <a:rPr ${formatAttributes(textProperties)}/>
72342
72324
  <a:t>${text}</a:t>
72343
72325
  </a:r>
72344
72326
  </a:p>
@@ -84488,6 +84470,6 @@ const chartHelpers = {
84488
84470
  //#endregion
84489
84471
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, ClientDisconnectedError, CommandResult, CompiledFormula, CorePlugin, CoreViewPlugin, DEFAULT_LOCALE, DEFAULT_LOCALES, DispatchResult, EvaluationError, LocalTransportService, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, canExecuteInReadonly, categories, chartHelpers, components, constants, convertAstNodes, coreTypes, createAutocompleteArgumentsProvider, findCellInNewZone, functionCache, getCaretDownSvg, getCaretUpSvg, helpers, hooks, invalidateCFEvaluationCommands, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, isCoreCommand, isSheetDependent, iterateAstNodes, links, load, lockedSheetAllowedCommands, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
84490
84472
 
84491
- __info__.version = "19.3.5";
84492
- __info__.date = "2026-05-27T06:08:23.138Z";
84493
- __info__.hash = "0cf1540";
84473
+ __info__.version = "19.3.7";
84474
+ __info__.date = "2026-06-17T08:57:42.174Z";
84475
+ __info__.hash = "e061163";