@odoo/o-spreadsheet 18.2.35 → 18.2.36

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 18.2.35
6
- * @date 2025-11-24T07:40:00.240Z
7
- * @hash 2e9a842
5
+ * @version 18.2.36
6
+ * @date 2025-12-02T05:31:10.558Z
7
+ * @hash d385099
8
8
  */
9
9
 
10
10
  'use strict';
@@ -3448,7 +3448,6 @@ const invalidateEvaluationCommands = new Set([
3448
3448
  "REDO",
3449
3449
  "ADD_MERGE",
3450
3450
  "REMOVE_MERGE",
3451
- "DUPLICATE_SHEET",
3452
3451
  "UPDATE_LOCALE",
3453
3452
  "ADD_PIVOT",
3454
3453
  "UPDATE_PIVOT",
@@ -21166,7 +21165,7 @@ class AbstractComposerStore extends SpreadsheetStore {
21166
21165
  }
21167
21166
  this.selectionStart = start;
21168
21167
  this.selectionEnd = end;
21169
- this.editionMode = "editing";
21168
+ this.stopComposerRangeSelection();
21170
21169
  this.computeFormulaCursorContext();
21171
21170
  this.computeParenthesisRelatedToCursor();
21172
21171
  }
@@ -23353,29 +23352,34 @@ function chartToImage(runtime, figure, type) {
23353
23352
  canvas.setAttribute("height", figure.height.toString());
23354
23353
  // we have to add the canvas to the DOM otherwise it won't be rendered
23355
23354
  document.body.append(div);
23355
+ let imgContent = undefined;
23356
23356
  if ("chartJsConfig" in runtime) {
23357
+ const extensionsLoaded = areChartJSExtensionsLoaded();
23358
+ if (!extensionsLoaded) {
23359
+ registerChartJSExtensions();
23360
+ }
23357
23361
  const config = deepCopy(runtime.chartJsConfig);
23358
23362
  config.plugins = [backgroundColorChartJSPlugin];
23359
23363
  const chart = new window.Chart(canvas, config);
23360
- const imgContent = chart.toBase64Image();
23364
+ imgContent = chart.toBase64Image();
23361
23365
  chart.destroy();
23362
23366
  div.remove();
23363
- return imgContent;
23367
+ if (!extensionsLoaded) {
23368
+ unregisterChartJsExtensions();
23369
+ }
23364
23370
  }
23365
23371
  else if (type === "scorecard") {
23366
23372
  const design = getScorecardConfiguration(figure, runtime);
23367
23373
  drawScoreChart(design, canvas);
23368
- const imgContent = canvas.toDataURL();
23374
+ imgContent = canvas.toDataURL();
23369
23375
  div.remove();
23370
- return imgContent;
23371
23376
  }
23372
23377
  else if (type === "gauge") {
23373
23378
  drawGaugeChart(canvas, runtime);
23374
- const imgContent = canvas.toDataURL();
23379
+ imgContent = canvas.toDataURL();
23375
23380
  div.remove();
23376
- return imgContent;
23377
23381
  }
23378
- return undefined;
23382
+ return imgContent;
23379
23383
  }
23380
23384
  /**
23381
23385
  * Custom chart.js plugin to set the background color of the canvas
@@ -47512,7 +47516,6 @@ const dateGranularities = [
47512
47516
  pivotRegistry.add("SPREADSHEET", {
47513
47517
  ui: SpreadsheetPivot,
47514
47518
  definition: SpreadsheetPivotRuntimeDefinition,
47515
- externalData: false,
47516
47519
  dateGranularities: [...dateGranularities],
47517
47520
  datetimeGranularities: [...dateGranularities, "hour_number", "minute_number", "second_number"],
47518
47521
  isMeasureCandidate: (field) => field.type !== "boolean",
@@ -60010,10 +60013,17 @@ class PivotCorePlugin extends CorePlugin {
60010
60013
  if (!pivot) {
60011
60014
  continue;
60012
60015
  }
60013
- for (const measure of pivot.definition.measures) {
60016
+ const def = deepCopy(pivot.definition);
60017
+ for (const measure of def.measures) {
60014
60018
  if (measure.computedBy?.formula === formulaString) {
60015
- const measureIndex = pivot.definition.measures.indexOf(measure);
60016
- this.history.update("pivots", pivotId, "definition", "measures", measureIndex, "computedBy", { formula: newFormulaString, sheetId });
60019
+ const measureIndex = def.measures.indexOf(measure);
60020
+ if (measureIndex !== -1) {
60021
+ def.measures[measureIndex].computedBy = {
60022
+ formula: newFormulaString,
60023
+ sheetId,
60024
+ };
60025
+ }
60026
+ this.dispatch("UPDATE_PIVOT", { pivotId, pivot: def });
60017
60027
  }
60018
60028
  }
60019
60029
  }
@@ -60166,6 +60176,9 @@ class SpreadsheetPivotCorePlugin extends CorePlugin {
60166
60176
  const { sheetId, zone } = definition.dataSet;
60167
60177
  const range = this.getters.getRangeFromZone(sheetId, zone);
60168
60178
  const adaptedRange = adaptPivotRange(range, applyChange);
60179
+ if (adaptedRange === range) {
60180
+ return;
60181
+ }
60169
60182
  const dataSet = adaptedRange && {
60170
60183
  sheetId: adaptedRange.sheetId,
60171
60184
  zone: adaptedRange.zone,
@@ -63888,9 +63901,7 @@ class PivotUIPlugin extends CoreViewPlugin {
63888
63901
  handle(cmd) {
63889
63902
  if (invalidateEvaluationCommands.has(cmd.type)) {
63890
63903
  for (const pivotId of this.getters.getPivotIds()) {
63891
- if (!pivotRegistry.get(this.getters.getPivotCoreDefinition(pivotId).type).externalData) {
63892
- this.setupPivot(pivotId, { recreate: true });
63893
- }
63904
+ this.setupPivot(pivotId, { recreate: true });
63894
63905
  }
63895
63906
  }
63896
63907
  switch (cmd.type) {
@@ -64091,7 +64102,7 @@ class PivotUIPlugin extends CoreViewPlugin {
64091
64102
  pivot.init({ reload: true });
64092
64103
  }
64093
64104
  setupPivot(pivotId, { recreate } = { recreate: false }) {
64094
- const definition = this.getters.getPivotCoreDefinition(pivotId);
64105
+ const definition = deepCopy(this.getters.getPivotCoreDefinition(pivotId));
64095
64106
  if (!(pivotId in this.pivots)) {
64096
64107
  const Pivot = withPivotPresentationLayer(pivotRegistry.get(definition.type).ui);
64097
64108
  this.pivots[pivotId] = new Pivot(this.custom, { definition, getters: this.getters });
@@ -77394,6 +77405,6 @@ exports.tokenColors = tokenColors;
77394
77405
  exports.tokenize = tokenize;
77395
77406
 
77396
77407
 
77397
- __info__.version = "18.2.35";
77398
- __info__.date = "2025-11-24T07:40:00.240Z";
77399
- __info__.hash = "2e9a842";
77408
+ __info__.version = "18.2.36";
77409
+ __info__.date = "2025-12-02T05:31:10.558Z";
77410
+ __info__.hash = "d385099";
@@ -6363,7 +6363,6 @@ type PivotDefinitionConstructor = new (definition: PivotCoreDefinition, fields:
6363
6363
  interface PivotRegistryItem {
6364
6364
  ui: PivotUIConstructor;
6365
6365
  definition: PivotDefinitionConstructor;
6366
- externalData: boolean;
6367
6366
  dateGranularities: string[];
6368
6367
  datetimeGranularities: string[];
6369
6368
  isMeasureCandidate: (field: PivotField) => boolean;
@@ -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 18.2.35
6
- * @date 2025-11-24T07:40:00.240Z
7
- * @hash 2e9a842
5
+ * @version 18.2.36
6
+ * @date 2025-12-02T05:31:10.558Z
7
+ * @hash d385099
8
8
  */
9
9
 
10
10
  import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, App, blockDom, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
@@ -3446,7 +3446,6 @@ const invalidateEvaluationCommands = new Set([
3446
3446
  "REDO",
3447
3447
  "ADD_MERGE",
3448
3448
  "REMOVE_MERGE",
3449
- "DUPLICATE_SHEET",
3450
3449
  "UPDATE_LOCALE",
3451
3450
  "ADD_PIVOT",
3452
3451
  "UPDATE_PIVOT",
@@ -21164,7 +21163,7 @@ class AbstractComposerStore extends SpreadsheetStore {
21164
21163
  }
21165
21164
  this.selectionStart = start;
21166
21165
  this.selectionEnd = end;
21167
- this.editionMode = "editing";
21166
+ this.stopComposerRangeSelection();
21168
21167
  this.computeFormulaCursorContext();
21169
21168
  this.computeParenthesisRelatedToCursor();
21170
21169
  }
@@ -23351,29 +23350,34 @@ function chartToImage(runtime, figure, type) {
23351
23350
  canvas.setAttribute("height", figure.height.toString());
23352
23351
  // we have to add the canvas to the DOM otherwise it won't be rendered
23353
23352
  document.body.append(div);
23353
+ let imgContent = undefined;
23354
23354
  if ("chartJsConfig" in runtime) {
23355
+ const extensionsLoaded = areChartJSExtensionsLoaded();
23356
+ if (!extensionsLoaded) {
23357
+ registerChartJSExtensions();
23358
+ }
23355
23359
  const config = deepCopy(runtime.chartJsConfig);
23356
23360
  config.plugins = [backgroundColorChartJSPlugin];
23357
23361
  const chart = new window.Chart(canvas, config);
23358
- const imgContent = chart.toBase64Image();
23362
+ imgContent = chart.toBase64Image();
23359
23363
  chart.destroy();
23360
23364
  div.remove();
23361
- return imgContent;
23365
+ if (!extensionsLoaded) {
23366
+ unregisterChartJsExtensions();
23367
+ }
23362
23368
  }
23363
23369
  else if (type === "scorecard") {
23364
23370
  const design = getScorecardConfiguration(figure, runtime);
23365
23371
  drawScoreChart(design, canvas);
23366
- const imgContent = canvas.toDataURL();
23372
+ imgContent = canvas.toDataURL();
23367
23373
  div.remove();
23368
- return imgContent;
23369
23374
  }
23370
23375
  else if (type === "gauge") {
23371
23376
  drawGaugeChart(canvas, runtime);
23372
- const imgContent = canvas.toDataURL();
23377
+ imgContent = canvas.toDataURL();
23373
23378
  div.remove();
23374
- return imgContent;
23375
23379
  }
23376
- return undefined;
23380
+ return imgContent;
23377
23381
  }
23378
23382
  /**
23379
23383
  * Custom chart.js plugin to set the background color of the canvas
@@ -47510,7 +47514,6 @@ const dateGranularities = [
47510
47514
  pivotRegistry.add("SPREADSHEET", {
47511
47515
  ui: SpreadsheetPivot,
47512
47516
  definition: SpreadsheetPivotRuntimeDefinition,
47513
- externalData: false,
47514
47517
  dateGranularities: [...dateGranularities],
47515
47518
  datetimeGranularities: [...dateGranularities, "hour_number", "minute_number", "second_number"],
47516
47519
  isMeasureCandidate: (field) => field.type !== "boolean",
@@ -60008,10 +60011,17 @@ class PivotCorePlugin extends CorePlugin {
60008
60011
  if (!pivot) {
60009
60012
  continue;
60010
60013
  }
60011
- for (const measure of pivot.definition.measures) {
60014
+ const def = deepCopy(pivot.definition);
60015
+ for (const measure of def.measures) {
60012
60016
  if (measure.computedBy?.formula === formulaString) {
60013
- const measureIndex = pivot.definition.measures.indexOf(measure);
60014
- this.history.update("pivots", pivotId, "definition", "measures", measureIndex, "computedBy", { formula: newFormulaString, sheetId });
60017
+ const measureIndex = def.measures.indexOf(measure);
60018
+ if (measureIndex !== -1) {
60019
+ def.measures[measureIndex].computedBy = {
60020
+ formula: newFormulaString,
60021
+ sheetId,
60022
+ };
60023
+ }
60024
+ this.dispatch("UPDATE_PIVOT", { pivotId, pivot: def });
60015
60025
  }
60016
60026
  }
60017
60027
  }
@@ -60164,6 +60174,9 @@ class SpreadsheetPivotCorePlugin extends CorePlugin {
60164
60174
  const { sheetId, zone } = definition.dataSet;
60165
60175
  const range = this.getters.getRangeFromZone(sheetId, zone);
60166
60176
  const adaptedRange = adaptPivotRange(range, applyChange);
60177
+ if (adaptedRange === range) {
60178
+ return;
60179
+ }
60167
60180
  const dataSet = adaptedRange && {
60168
60181
  sheetId: adaptedRange.sheetId,
60169
60182
  zone: adaptedRange.zone,
@@ -63886,9 +63899,7 @@ class PivotUIPlugin extends CoreViewPlugin {
63886
63899
  handle(cmd) {
63887
63900
  if (invalidateEvaluationCommands.has(cmd.type)) {
63888
63901
  for (const pivotId of this.getters.getPivotIds()) {
63889
- if (!pivotRegistry.get(this.getters.getPivotCoreDefinition(pivotId).type).externalData) {
63890
- this.setupPivot(pivotId, { recreate: true });
63891
- }
63902
+ this.setupPivot(pivotId, { recreate: true });
63892
63903
  }
63893
63904
  }
63894
63905
  switch (cmd.type) {
@@ -64089,7 +64100,7 @@ class PivotUIPlugin extends CoreViewPlugin {
64089
64100
  pivot.init({ reload: true });
64090
64101
  }
64091
64102
  setupPivot(pivotId, { recreate } = { recreate: false }) {
64092
- const definition = this.getters.getPivotCoreDefinition(pivotId);
64103
+ const definition = deepCopy(this.getters.getPivotCoreDefinition(pivotId));
64093
64104
  if (!(pivotId in this.pivots)) {
64094
64105
  const Pivot = withPivotPresentationLayer(pivotRegistry.get(definition.type).ui);
64095
64106
  this.pivots[pivotId] = new Pivot(this.custom, { definition, getters: this.getters });
@@ -77347,6 +77358,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
77347
77358
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, CoreViewPlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, chartHelpers, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
77348
77359
 
77349
77360
 
77350
- __info__.version = "18.2.35";
77351
- __info__.date = "2025-11-24T07:40:00.240Z";
77352
- __info__.hash = "2e9a842";
77361
+ __info__.version = "18.2.36";
77362
+ __info__.date = "2025-12-02T05:31:10.558Z";
77363
+ __info__.hash = "d385099";
@@ -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 18.2.35
6
- * @date 2025-11-24T07:40:00.240Z
7
- * @hash 2e9a842
5
+ * @version 18.2.36
6
+ * @date 2025-12-02T05:31:10.558Z
7
+ * @hash d385099
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -3447,7 +3447,6 @@
3447
3447
  "REDO",
3448
3448
  "ADD_MERGE",
3449
3449
  "REMOVE_MERGE",
3450
- "DUPLICATE_SHEET",
3451
3450
  "UPDATE_LOCALE",
3452
3451
  "ADD_PIVOT",
3453
3452
  "UPDATE_PIVOT",
@@ -21165,7 +21164,7 @@ stores.inject(MyMetaStore, storeInstance);
21165
21164
  }
21166
21165
  this.selectionStart = start;
21167
21166
  this.selectionEnd = end;
21168
- this.editionMode = "editing";
21167
+ this.stopComposerRangeSelection();
21169
21168
  this.computeFormulaCursorContext();
21170
21169
  this.computeParenthesisRelatedToCursor();
21171
21170
  }
@@ -23352,29 +23351,34 @@ stores.inject(MyMetaStore, storeInstance);
23352
23351
  canvas.setAttribute("height", figure.height.toString());
23353
23352
  // we have to add the canvas to the DOM otherwise it won't be rendered
23354
23353
  document.body.append(div);
23354
+ let imgContent = undefined;
23355
23355
  if ("chartJsConfig" in runtime) {
23356
+ const extensionsLoaded = areChartJSExtensionsLoaded();
23357
+ if (!extensionsLoaded) {
23358
+ registerChartJSExtensions();
23359
+ }
23356
23360
  const config = deepCopy(runtime.chartJsConfig);
23357
23361
  config.plugins = [backgroundColorChartJSPlugin];
23358
23362
  const chart = new window.Chart(canvas, config);
23359
- const imgContent = chart.toBase64Image();
23363
+ imgContent = chart.toBase64Image();
23360
23364
  chart.destroy();
23361
23365
  div.remove();
23362
- return imgContent;
23366
+ if (!extensionsLoaded) {
23367
+ unregisterChartJsExtensions();
23368
+ }
23363
23369
  }
23364
23370
  else if (type === "scorecard") {
23365
23371
  const design = getScorecardConfiguration(figure, runtime);
23366
23372
  drawScoreChart(design, canvas);
23367
- const imgContent = canvas.toDataURL();
23373
+ imgContent = canvas.toDataURL();
23368
23374
  div.remove();
23369
- return imgContent;
23370
23375
  }
23371
23376
  else if (type === "gauge") {
23372
23377
  drawGaugeChart(canvas, runtime);
23373
- const imgContent = canvas.toDataURL();
23378
+ imgContent = canvas.toDataURL();
23374
23379
  div.remove();
23375
- return imgContent;
23376
23380
  }
23377
- return undefined;
23381
+ return imgContent;
23378
23382
  }
23379
23383
  /**
23380
23384
  * Custom chart.js plugin to set the background color of the canvas
@@ -47511,7 +47515,6 @@ stores.inject(MyMetaStore, storeInstance);
47511
47515
  pivotRegistry.add("SPREADSHEET", {
47512
47516
  ui: SpreadsheetPivot,
47513
47517
  definition: SpreadsheetPivotRuntimeDefinition,
47514
- externalData: false,
47515
47518
  dateGranularities: [...dateGranularities],
47516
47519
  datetimeGranularities: [...dateGranularities, "hour_number", "minute_number", "second_number"],
47517
47520
  isMeasureCandidate: (field) => field.type !== "boolean",
@@ -60009,10 +60012,17 @@ stores.inject(MyMetaStore, storeInstance);
60009
60012
  if (!pivot) {
60010
60013
  continue;
60011
60014
  }
60012
- for (const measure of pivot.definition.measures) {
60015
+ const def = deepCopy(pivot.definition);
60016
+ for (const measure of def.measures) {
60013
60017
  if (measure.computedBy?.formula === formulaString) {
60014
- const measureIndex = pivot.definition.measures.indexOf(measure);
60015
- this.history.update("pivots", pivotId, "definition", "measures", measureIndex, "computedBy", { formula: newFormulaString, sheetId });
60018
+ const measureIndex = def.measures.indexOf(measure);
60019
+ if (measureIndex !== -1) {
60020
+ def.measures[measureIndex].computedBy = {
60021
+ formula: newFormulaString,
60022
+ sheetId,
60023
+ };
60024
+ }
60025
+ this.dispatch("UPDATE_PIVOT", { pivotId, pivot: def });
60016
60026
  }
60017
60027
  }
60018
60028
  }
@@ -60165,6 +60175,9 @@ stores.inject(MyMetaStore, storeInstance);
60165
60175
  const { sheetId, zone } = definition.dataSet;
60166
60176
  const range = this.getters.getRangeFromZone(sheetId, zone);
60167
60177
  const adaptedRange = adaptPivotRange(range, applyChange);
60178
+ if (adaptedRange === range) {
60179
+ return;
60180
+ }
60168
60181
  const dataSet = adaptedRange && {
60169
60182
  sheetId: adaptedRange.sheetId,
60170
60183
  zone: adaptedRange.zone,
@@ -63887,9 +63900,7 @@ stores.inject(MyMetaStore, storeInstance);
63887
63900
  handle(cmd) {
63888
63901
  if (invalidateEvaluationCommands.has(cmd.type)) {
63889
63902
  for (const pivotId of this.getters.getPivotIds()) {
63890
- if (!pivotRegistry.get(this.getters.getPivotCoreDefinition(pivotId).type).externalData) {
63891
- this.setupPivot(pivotId, { recreate: true });
63892
- }
63903
+ this.setupPivot(pivotId, { recreate: true });
63893
63904
  }
63894
63905
  }
63895
63906
  switch (cmd.type) {
@@ -64090,7 +64101,7 @@ stores.inject(MyMetaStore, storeInstance);
64090
64101
  pivot.init({ reload: true });
64091
64102
  }
64092
64103
  setupPivot(pivotId, { recreate } = { recreate: false }) {
64093
- const definition = this.getters.getPivotCoreDefinition(pivotId);
64104
+ const definition = deepCopy(this.getters.getPivotCoreDefinition(pivotId));
64094
64105
  if (!(pivotId in this.pivots)) {
64095
64106
  const Pivot = withPivotPresentationLayer(pivotRegistry.get(definition.type).ui);
64096
64107
  this.pivots[pivotId] = new Pivot(this.custom, { definition, getters: this.getters });
@@ -77393,9 +77404,9 @@ stores.inject(MyMetaStore, storeInstance);
77393
77404
  exports.tokenize = tokenize;
77394
77405
 
77395
77406
 
77396
- __info__.version = "18.2.35";
77397
- __info__.date = "2025-11-24T07:40:00.240Z";
77398
- __info__.hash = "2e9a842";
77407
+ __info__.version = "18.2.36";
77408
+ __info__.date = "2025-12-02T05:31:10.558Z";
77409
+ __info__.hash = "d385099";
77399
77410
 
77400
77411
 
77401
77412
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);