@odoo/o-spreadsheet 19.3.5 → 19.3.6

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.6
6
+ * @date 2026-06-06T06:24:22.727Z
7
+ * @hash 0fe939b
8
8
  */
9
9
 
10
10
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
@@ -3240,31 +3240,78 @@ function validateArguments(descr) {
3240
3240
  }
3241
3241
 
3242
3242
  //#endregion
3243
- //#region src/registry.ts
3244
- var Registry$1 = class {
3243
+ //#region src/registries/registry.ts
3244
+ /**
3245
+ * Registry
3246
+ *
3247
+ * The Registry class is basically just a mapping from a string key to an object.
3248
+ * It is really not much more than an object. It is however useful for the
3249
+ * following reasons:
3250
+ *
3251
+ * 1. it let us react and execute code when someone add something to the registry
3252
+ * (for example, the FunctionRegistry subclass this for this purpose)
3253
+ * 2. it throws an error when the get operation fails
3254
+ * 3. it provides a chained API to add items to the registry.
3255
+ */
3256
+ var Registry = class {
3245
3257
  content = {};
3258
+ /**
3259
+ * Add an item to the registry, you can only add if there is no item
3260
+ * already present in the registery with the given key
3261
+ *
3262
+ * Note that this also returns the registry, so another add method call can
3263
+ * be chained
3264
+ */
3246
3265
  add(key, value) {
3247
3266
  if (key in this.content) throw new Error(`${key} is already present in this registry!`);
3248
3267
  return this.replace(key, value);
3249
3268
  }
3269
+ /**
3270
+ * Replace (or add) an item to the registry
3271
+ *
3272
+ * Note that this also returns the registry, so another add method call can
3273
+ * be chained
3274
+ */
3250
3275
  replace(key, value) {
3251
3276
  this.content[key] = value;
3252
3277
  return this;
3253
3278
  }
3279
+ /**
3280
+ * Get an item from the registry
3281
+ */
3254
3282
  get(key) {
3283
+ /**
3284
+ * Note: key in {} is ~12 times slower than {}[key].
3285
+ * So, we check the absence of key only when the direct access returns
3286
+ * a falsy value. It's done to ensure that the registry can contains falsy values
3287
+ */
3255
3288
  const content = this.content[key];
3256
- if (!content && !(key in this.content)) throw new Error(`Cannot find ${key} in this registry!`);
3289
+ if (!content) {
3290
+ if (!(key in this.content)) throw new Error(`Cannot find ${key} in this registry!`);
3291
+ }
3257
3292
  return content;
3258
3293
  }
3294
+ /**
3295
+ * Check if the key is already in the registry
3296
+ */
3259
3297
  contains(key) {
3260
3298
  return key in this.content;
3261
3299
  }
3300
+ /**
3301
+ * Get a list of all elements in the registry
3302
+ */
3262
3303
  getAll() {
3263
3304
  return Object.values(this.content);
3264
3305
  }
3306
+ /**
3307
+ * Get a list of all keys in the registry
3308
+ */
3265
3309
  getKeys() {
3266
3310
  return Object.keys(this.content);
3267
3311
  }
3312
+ /**
3313
+ * Remove an item from the registry
3314
+ */
3268
3315
  remove(key) {
3269
3316
  delete this.content[key];
3270
3317
  }
@@ -4643,7 +4690,7 @@ function hasStringMessage(obj) {
4643
4690
  //#endregion
4644
4691
  //#region src/functions/function_registry.ts
4645
4692
  const functionNameRegex = /^[A-Z0-9\_\.]+$/;
4646
- var FunctionRegistry = class extends Registry$1 {
4693
+ var FunctionRegistry = class extends Registry {
4647
4694
  mapping = {};
4648
4695
  add(name, addDescr) {
4649
4696
  name = name.toUpperCase();
@@ -5457,84 +5504,6 @@ function isFuncallToken(currentToken, nextToken) {
5457
5504
  return nextToken?.type === "LEFT_PAREN" && functionRegex.test(currentToken.value) && currentToken.value === unquote(currentToken.value, "'");
5458
5505
  }
5459
5506
 
5460
- //#endregion
5461
- //#region src/registries/registry.ts
5462
- /**
5463
- * Registry
5464
- *
5465
- * The Registry class is basically just a mapping from a string key to an object.
5466
- * It is really not much more than an object. It is however useful for the
5467
- * following reasons:
5468
- *
5469
- * 1. it let us react and execute code when someone add something to the registry
5470
- * (for example, the FunctionRegistry subclass this for this purpose)
5471
- * 2. it throws an error when the get operation fails
5472
- * 3. it provides a chained API to add items to the registry.
5473
- */
5474
- var Registry = class {
5475
- content = {};
5476
- /**
5477
- * Add an item to the registry, you can only add if there is no item
5478
- * already present in the registery with the given key
5479
- *
5480
- * Note that this also returns the registry, so another add method call can
5481
- * be chained
5482
- */
5483
- add(key, value) {
5484
- if (key in this.content) throw new Error(`${key} is already present in this registry!`);
5485
- return this.replace(key, value);
5486
- }
5487
- /**
5488
- * Replace (or add) an item to the registry
5489
- *
5490
- * Note that this also returns the registry, so another add method call can
5491
- * be chained
5492
- */
5493
- replace(key, value) {
5494
- this.content[key] = value;
5495
- return this;
5496
- }
5497
- /**
5498
- * Get an item from the registry
5499
- */
5500
- get(key) {
5501
- /**
5502
- * Note: key in {} is ~12 times slower than {}[key].
5503
- * So, we check the absence of key only when the direct access returns
5504
- * a falsy value. It's done to ensure that the registry can contains falsy values
5505
- */
5506
- const content = this.content[key];
5507
- if (!content) {
5508
- if (!(key in this.content)) throw new Error(`Cannot find ${key} in this registry!`);
5509
- }
5510
- return content;
5511
- }
5512
- /**
5513
- * Check if the key is already in the registry
5514
- */
5515
- contains(key) {
5516
- return key in this.content;
5517
- }
5518
- /**
5519
- * Get a list of all elements in the registry
5520
- */
5521
- getAll() {
5522
- return Object.values(this.content);
5523
- }
5524
- /**
5525
- * Get a list of all keys in the registry
5526
- */
5527
- getKeys() {
5528
- return Object.keys(this.content);
5529
- }
5530
- /**
5531
- * Remove an item from the registry
5532
- */
5533
- remove(key) {
5534
- delete this.content[key];
5535
- }
5536
- };
5537
-
5538
5507
  //#endregion
5539
5508
  //#region src/helpers/range.ts
5540
5509
  function createRange(args, getSheetSize) {
@@ -6560,6 +6529,7 @@ let CellValueType = /* @__PURE__ */ function(CellValueType) {
6560
6529
  //#endregion
6561
6530
  //#region src/helpers/format/format_tokenizer.ts
6562
6531
  function tokenizeFormat(str) {
6532
+ str = str.replace(/\s/g, " ");
6563
6533
  const chars = new TokenizingChars(str);
6564
6534
  const result = [];
6565
6535
  let currentFormatPart = [];
@@ -7690,7 +7660,12 @@ const lockedSheetAllowedCommands = new Set([
7690
7660
  "SET_ZOOM",
7691
7661
  "UPDATE_CAROUSEL_ACTIVE_ITEM",
7692
7662
  "DUPLICATE_PIVOT_IN_NEW_SHEET",
7693
- "UPDATE_FILTER"
7663
+ "UPDATE_FILTER",
7664
+ "ACTIVATE_NEXT_SHEET",
7665
+ "ACTIVATE_PREVIOUS_SHEET",
7666
+ "SCROLL_TO_CELL",
7667
+ "SHIFT_VIEWPORT_DOWN",
7668
+ "SHIFT_VIEWPORT_UP"
7694
7669
  ]);
7695
7670
  const coreTypes = new Set([
7696
7671
  "UPDATE_CELL",
@@ -8763,7 +8738,7 @@ var UuidGenerator = class {
8763
8738
 
8764
8739
  //#endregion
8765
8740
  //#region src/helpers/figures/charts/chart_js_extension.ts
8766
- const chartJsExtensionRegistry = new Registry$1();
8741
+ const chartJsExtensionRegistry = new Registry();
8767
8742
  function areChartJSExtensionsLoaded() {
8768
8743
  return globalThis.Chart ? !!globalThis.Chart.registry.plugins.get("chartShowValuesPlugin") : true;
8769
8744
  }
@@ -23274,7 +23249,7 @@ const WEEK_START = {
23274
23249
 
23275
23250
  //#endregion
23276
23251
  //#region src/migrations/migration_steps.ts
23277
- const migrationStepRegistry = new Registry$1();
23252
+ const migrationStepRegistry = new Registry();
23278
23253
  migrationStepRegistry.add("0.1", { migrate(data) {
23279
23254
  if (data.sheets && data.sheets[0]) data.activeSheet = data.sheets[0].name;
23280
23255
  return data;
@@ -30286,11 +30261,10 @@ const INSERT_TABLE = (env) => {
30286
30261
  if (interactiveCreateTable(env, env.model.getters.getActiveSheetId()).isSuccessful) env.openSidePanel("TableSidePanel", {});
30287
30262
  };
30288
30263
  const DELETE_SELECTED_TABLE = (env) => {
30289
- const position = env.model.getters.getActivePosition();
30290
- const table = env.model.getters.getTable(position);
30264
+ const table = env.model.getters.getFirstTableInSelection();
30291
30265
  if (!table) return;
30292
30266
  env.model.dispatch("REMOVE_TABLE", {
30293
- sheetId: position.sheetId,
30267
+ sheetId: env.model.getters.getActiveSheetId(),
30294
30268
  target: [table.range.zone]
30295
30269
  });
30296
30270
  };
@@ -39565,7 +39539,7 @@ var SpreadsheetPivot = class {
39565
39539
 
39566
39540
  //#endregion
39567
39541
  //#region src/helpers/pivot/pivot_registry.ts
39568
- const pivotRegistry = new Registry$1();
39542
+ const pivotRegistry = new Registry();
39569
39543
  const dateGranularities = [
39570
39544
  "year",
39571
39545
  "quarter_number",
@@ -58057,9 +58031,11 @@ var PivotUIPlugin = class extends CoreViewPlugin {
58057
58031
  this.refreshPivot(cmd.id);
58058
58032
  break;
58059
58033
  case "ADD_PIVOT":
58034
+ this.unusedPivotsInFormulas?.push(cmd.pivotId);
58060
58035
  this.setupPivot(cmd.pivotId);
58061
58036
  break;
58062
58037
  case "DUPLICATE_PIVOT":
58038
+ this.unusedPivotsInFormulas?.push(cmd.newPivotId);
58063
58039
  this.setupPivot(cmd.newPivotId);
58064
58040
  break;
58065
58041
  case "UPDATE_PIVOT":
@@ -58251,8 +58227,8 @@ var PivotUIPlugin = class extends CoreViewPlugin {
58251
58227
  }
58252
58228
  }
58253
58229
  for (const pivotId of this.getters.getPivotIds()) {
58254
- const pivot = this.getters.getPivot(pivotId);
58255
- for (const measure of pivot.definition.measures) if (measure.computedBy) {
58230
+ const pivot = this.getters.getPivotCoreDefinition(pivotId);
58231
+ for (const measure of pivot.measures) if (measure.computedBy) {
58256
58232
  const { sheetId } = measure.computedBy;
58257
58233
  const formula = this.getters.getMeasureCompiledFormula(pivotId, measure);
58258
58234
  const relatedPivotIds = this.getPivotIdsFromFormula(sheetId, formula);
@@ -60014,7 +59990,8 @@ const invalidateTableStyleCommandsSet = new Set([
60014
59990
  "REMOVE_TABLE",
60015
59991
  "RESIZE_TABLE",
60016
59992
  "CREATE_TABLE_STYLE",
60017
- "REMOVE_TABLE_STYLE"
59993
+ "REMOVE_TABLE_STYLE",
59994
+ "DELETE_CONTENT"
60018
59995
  ]);
60019
59996
  function doesCommandInvalidatesTableStyle(cmd) {
60020
59997
  return invalidateTableStyleCommandsSet.has(cmd.type);
@@ -65709,10 +65686,10 @@ var SheetViewPlugin = class extends UIPlugin {
65709
65686
 
65710
65687
  //#endregion
65711
65688
  //#region src/plugins/index.ts
65712
- 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);
65713
- 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);
65714
- 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);
65715
- 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);
65689
+ 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);
65690
+ 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);
65691
+ 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);
65692
+ 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);
65716
65693
 
65717
65694
  //#endregion
65718
65695
  //#region src/registries/auto_completes/data_validation_auto_complete.ts
@@ -72510,6 +72487,11 @@ function lineAttributes(params) {
72510
72487
  `;
72511
72488
  }
72512
72489
  function insertText(text, fontColor = "000000", fontsize = 16, style = {}) {
72490
+ const textProperties = [
72491
+ ["b", style.bold ? "1" : "0"],
72492
+ ["i", style.italic ? "1" : "0"],
72493
+ ["sz", fontsize * 100]
72494
+ ];
72513
72495
  return escapeXml`
72514
72496
  <c:tx>
72515
72497
  <c:rich>
@@ -72517,13 +72499,13 @@ function insertText(text, fontColor = "000000", fontsize = 16, style = {}) {
72517
72499
  <a:lstStyle />
72518
72500
  <a:p>
72519
72501
  <a:pPr lvl="0">
72520
- <a:defRPr b="${style?.bold ? 1 : 0}" i="${style?.italic ? 1 : 0}">
72502
+ <a:defRPr ${formatAttributes(textProperties)}>
72521
72503
  ${solidFill(fontColor)}
72522
72504
  <a:latin typeface="+mn-lt"/>
72523
72505
  </a:defRPr>
72524
72506
  </a:pPr>
72525
72507
  <a:r> <!-- Runs -->
72526
- <a:rPr b="${style?.bold ? 1 : 0}" i="${style?.italic ? 1 : 0}" sz="${fontsize * 100}"/>
72508
+ <a:rPr ${formatAttributes(textProperties)}/>
72527
72509
  <a:t>${text}</a:t>
72528
72510
  </a:r>
72529
72511
  </a:p>
@@ -84731,6 +84713,6 @@ exports.stores = stores;
84731
84713
  exports.tokenColors = tokenColors;
84732
84714
  exports.tokenize = tokenize;
84733
84715
 
84734
- __info__.version = "19.3.5";
84735
- __info__.date = "2026-05-27T06:08:23.138Z";
84736
- __info__.hash = "0cf1540";
84716
+ __info__.version = "19.3.6";
84717
+ __info__.date = "2026-06-06T06:24:22.727Z";
84718
+ __info__.hash = "0fe939b";
@@ -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:24.964Z
7
- * @hash 0cf1540
5
+ * @version 19.3.6
6
+ * @date 2026-06-06T06:24:24.503Z
7
+ * @hash 0fe939b
8
8
  */
9
9
  :root {
10
10
  --os-gray-100: light-dark(#f9fafb, #1b1d26);