@odoo/o-spreadsheet 18.3.27 → 18.3.28

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.3.27
6
- * @date 2025-11-24T07:40:29.469Z
7
- * @hash 57b11b8
5
+ * @version 18.3.28
6
+ * @date 2025-12-02T05:34:06.602Z
7
+ * @hash a205f91
8
8
  */
9
9
 
10
10
  'use strict';
@@ -3469,7 +3469,6 @@ const invalidateEvaluationCommands = new Set([
3469
3469
  "REDO",
3470
3470
  "ADD_MERGE",
3471
3471
  "REMOVE_MERGE",
3472
- "DUPLICATE_SHEET",
3473
3472
  "UPDATE_LOCALE",
3474
3473
  "ADD_PIVOT",
3475
3474
  "UPDATE_PIVOT",
@@ -22991,7 +22990,7 @@ class AbstractComposerStore extends SpreadsheetStore {
22991
22990
  }
22992
22991
  this.selectionStart = start;
22993
22992
  this.selectionEnd = end;
22994
- this.editionMode = "editing";
22993
+ this.stopComposerRangeSelection();
22995
22994
  this.computeFormulaCursorContext();
22996
22995
  this.computeParenthesisRelatedToCursor();
22997
22996
  }
@@ -24873,11 +24872,18 @@ function chartToImageUrl(runtime, figure, type) {
24873
24872
  // we have to add the canvas to the DOM otherwise it won't be rendered
24874
24873
  document.body.append(div);
24875
24874
  if ("chartJsConfig" in runtime) {
24875
+ const extensionsLoaded = areChartJSExtensionsLoaded();
24876
+ if (!extensionsLoaded) {
24877
+ registerChartJSExtensions();
24878
+ }
24876
24879
  const config = deepCopy(runtime.chartJsConfig);
24877
24880
  config.plugins = [backgroundColorChartJSPlugin];
24878
24881
  const chart = new window.Chart(canvas, config);
24879
24882
  imageContent = chart.toBase64Image();
24880
24883
  chart.destroy();
24884
+ if (!extensionsLoaded) {
24885
+ unregisterChartJsExtensions();
24886
+ }
24881
24887
  }
24882
24888
  else if (type === "scorecard") {
24883
24889
  const design = getScorecardConfiguration(figure, runtime);
@@ -24907,11 +24913,18 @@ async function chartToImageFile(runtime, figure, type) {
24907
24913
  document.body.append(div);
24908
24914
  let chartBlob = null;
24909
24915
  if ("chartJsConfig" in runtime) {
24916
+ const extensionsLoaded = areChartJSExtensionsLoaded();
24917
+ if (!extensionsLoaded) {
24918
+ registerChartJSExtensions();
24919
+ }
24910
24920
  const config = deepCopy(runtime.chartJsConfig);
24911
24921
  config.plugins = [backgroundColorChartJSPlugin];
24912
24922
  const chart = new window.Chart(canvas, config);
24913
24923
  chartBlob = await new Promise((resolve) => canvas.toBlob(resolve, "image/png"));
24914
24924
  chart.destroy();
24925
+ if (!extensionsLoaded) {
24926
+ unregisterChartJsExtensions();
24927
+ }
24915
24928
  }
24916
24929
  else if (type === "scorecard") {
24917
24930
  const design = getScorecardConfiguration(figure, runtime);
@@ -50261,7 +50274,6 @@ const dateGranularities = [
50261
50274
  pivotRegistry.add("SPREADSHEET", {
50262
50275
  ui: SpreadsheetPivot,
50263
50276
  definition: SpreadsheetPivotRuntimeDefinition,
50264
- externalData: false,
50265
50277
  dateGranularities: [...dateGranularities],
50266
50278
  datetimeGranularities: [...dateGranularities, "hour_number", "minute_number", "second_number"],
50267
50279
  isMeasureCandidate: (field) => field.type !== "boolean",
@@ -62926,10 +62938,17 @@ class PivotCorePlugin extends CorePlugin {
62926
62938
  if (!pivot) {
62927
62939
  continue;
62928
62940
  }
62929
- for (const measure of pivot.definition.measures) {
62941
+ const def = deepCopy(pivot.definition);
62942
+ for (const measure of def.measures) {
62930
62943
  if (measure.computedBy?.formula === formulaString) {
62931
- const measureIndex = pivot.definition.measures.indexOf(measure);
62932
- this.history.update("pivots", pivotId, "definition", "measures", measureIndex, "computedBy", { formula: newFormulaString, sheetId });
62944
+ const measureIndex = def.measures.indexOf(measure);
62945
+ if (measureIndex !== -1) {
62946
+ def.measures[measureIndex].computedBy = {
62947
+ formula: newFormulaString,
62948
+ sheetId,
62949
+ };
62950
+ }
62951
+ this.dispatch("UPDATE_PIVOT", { pivotId, pivot: def });
62933
62952
  }
62934
62953
  }
62935
62954
  }
@@ -63090,6 +63109,9 @@ class SpreadsheetPivotCorePlugin extends CorePlugin {
63090
63109
  const { sheetId, zone } = definition.dataSet;
63091
63110
  const range = this.getters.getRangeFromZone(sheetId, zone);
63092
63111
  const adaptedRange = adaptPivotRange(range, applyChange);
63112
+ if (adaptedRange === range) {
63113
+ return;
63114
+ }
63093
63115
  const dataSet = adaptedRange && {
63094
63116
  sheetId: adaptedRange.sheetId,
63095
63117
  zone: adaptedRange.zone,
@@ -66829,9 +66851,7 @@ class PivotUIPlugin extends CoreViewPlugin {
66829
66851
  handle(cmd) {
66830
66852
  if (invalidateEvaluationCommands.has(cmd.type)) {
66831
66853
  for (const pivotId of this.getters.getPivotIds()) {
66832
- if (!pivotRegistry.get(this.getters.getPivotCoreDefinition(pivotId).type).externalData) {
66833
- this.setupPivot(pivotId, { recreate: true });
66834
- }
66854
+ this.setupPivot(pivotId, { recreate: true });
66835
66855
  }
66836
66856
  }
66837
66857
  switch (cmd.type) {
@@ -67032,7 +67052,7 @@ class PivotUIPlugin extends CoreViewPlugin {
67032
67052
  pivot.init({ reload: true });
67033
67053
  }
67034
67054
  setupPivot(pivotId, { recreate } = { recreate: false }) {
67035
- const definition = this.getters.getPivotCoreDefinition(pivotId);
67055
+ const definition = deepCopy(this.getters.getPivotCoreDefinition(pivotId));
67036
67056
  if (!(pivotId in this.pivots)) {
67037
67057
  const Pivot = withPivotPresentationLayer(pivotRegistry.get(definition.type).ui);
67038
67058
  this.pivots[pivotId] = new Pivot(this.custom, { definition, getters: this.getters });
@@ -81078,6 +81098,6 @@ exports.tokenColors = tokenColors;
81078
81098
  exports.tokenize = tokenize;
81079
81099
 
81080
81100
 
81081
- __info__.version = "18.3.27";
81082
- __info__.date = "2025-11-24T07:40:29.469Z";
81083
- __info__.hash = "57b11b8";
81101
+ __info__.version = "18.3.28";
81102
+ __info__.date = "2025-12-02T05:34:06.602Z";
81103
+ __info__.hash = "a205f91";
@@ -6612,7 +6612,6 @@ type PivotDefinitionConstructor = new (definition: PivotCoreDefinition, fields:
6612
6612
  interface PivotRegistryItem {
6613
6613
  ui: PivotUIConstructor;
6614
6614
  definition: PivotDefinitionConstructor;
6615
- externalData: boolean;
6616
6615
  dateGranularities: string[];
6617
6616
  datetimeGranularities: string[];
6618
6617
  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.3.27
6
- * @date 2025-11-24T07:40:29.469Z
7
- * @hash 57b11b8
5
+ * @version 18.3.28
6
+ * @date 2025-12-02T05:34:06.602Z
7
+ * @hash a205f91
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';
@@ -3467,7 +3467,6 @@ const invalidateEvaluationCommands = new Set([
3467
3467
  "REDO",
3468
3468
  "ADD_MERGE",
3469
3469
  "REMOVE_MERGE",
3470
- "DUPLICATE_SHEET",
3471
3470
  "UPDATE_LOCALE",
3472
3471
  "ADD_PIVOT",
3473
3472
  "UPDATE_PIVOT",
@@ -22989,7 +22988,7 @@ class AbstractComposerStore extends SpreadsheetStore {
22989
22988
  }
22990
22989
  this.selectionStart = start;
22991
22990
  this.selectionEnd = end;
22992
- this.editionMode = "editing";
22991
+ this.stopComposerRangeSelection();
22993
22992
  this.computeFormulaCursorContext();
22994
22993
  this.computeParenthesisRelatedToCursor();
22995
22994
  }
@@ -24871,11 +24870,18 @@ function chartToImageUrl(runtime, figure, type) {
24871
24870
  // we have to add the canvas to the DOM otherwise it won't be rendered
24872
24871
  document.body.append(div);
24873
24872
  if ("chartJsConfig" in runtime) {
24873
+ const extensionsLoaded = areChartJSExtensionsLoaded();
24874
+ if (!extensionsLoaded) {
24875
+ registerChartJSExtensions();
24876
+ }
24874
24877
  const config = deepCopy(runtime.chartJsConfig);
24875
24878
  config.plugins = [backgroundColorChartJSPlugin];
24876
24879
  const chart = new window.Chart(canvas, config);
24877
24880
  imageContent = chart.toBase64Image();
24878
24881
  chart.destroy();
24882
+ if (!extensionsLoaded) {
24883
+ unregisterChartJsExtensions();
24884
+ }
24879
24885
  }
24880
24886
  else if (type === "scorecard") {
24881
24887
  const design = getScorecardConfiguration(figure, runtime);
@@ -24905,11 +24911,18 @@ async function chartToImageFile(runtime, figure, type) {
24905
24911
  document.body.append(div);
24906
24912
  let chartBlob = null;
24907
24913
  if ("chartJsConfig" in runtime) {
24914
+ const extensionsLoaded = areChartJSExtensionsLoaded();
24915
+ if (!extensionsLoaded) {
24916
+ registerChartJSExtensions();
24917
+ }
24908
24918
  const config = deepCopy(runtime.chartJsConfig);
24909
24919
  config.plugins = [backgroundColorChartJSPlugin];
24910
24920
  const chart = new window.Chart(canvas, config);
24911
24921
  chartBlob = await new Promise((resolve) => canvas.toBlob(resolve, "image/png"));
24912
24922
  chart.destroy();
24923
+ if (!extensionsLoaded) {
24924
+ unregisterChartJsExtensions();
24925
+ }
24913
24926
  }
24914
24927
  else if (type === "scorecard") {
24915
24928
  const design = getScorecardConfiguration(figure, runtime);
@@ -50259,7 +50272,6 @@ const dateGranularities = [
50259
50272
  pivotRegistry.add("SPREADSHEET", {
50260
50273
  ui: SpreadsheetPivot,
50261
50274
  definition: SpreadsheetPivotRuntimeDefinition,
50262
- externalData: false,
50263
50275
  dateGranularities: [...dateGranularities],
50264
50276
  datetimeGranularities: [...dateGranularities, "hour_number", "minute_number", "second_number"],
50265
50277
  isMeasureCandidate: (field) => field.type !== "boolean",
@@ -62924,10 +62936,17 @@ class PivotCorePlugin extends CorePlugin {
62924
62936
  if (!pivot) {
62925
62937
  continue;
62926
62938
  }
62927
- for (const measure of pivot.definition.measures) {
62939
+ const def = deepCopy(pivot.definition);
62940
+ for (const measure of def.measures) {
62928
62941
  if (measure.computedBy?.formula === formulaString) {
62929
- const measureIndex = pivot.definition.measures.indexOf(measure);
62930
- this.history.update("pivots", pivotId, "definition", "measures", measureIndex, "computedBy", { formula: newFormulaString, sheetId });
62942
+ const measureIndex = def.measures.indexOf(measure);
62943
+ if (measureIndex !== -1) {
62944
+ def.measures[measureIndex].computedBy = {
62945
+ formula: newFormulaString,
62946
+ sheetId,
62947
+ };
62948
+ }
62949
+ this.dispatch("UPDATE_PIVOT", { pivotId, pivot: def });
62931
62950
  }
62932
62951
  }
62933
62952
  }
@@ -63088,6 +63107,9 @@ class SpreadsheetPivotCorePlugin extends CorePlugin {
63088
63107
  const { sheetId, zone } = definition.dataSet;
63089
63108
  const range = this.getters.getRangeFromZone(sheetId, zone);
63090
63109
  const adaptedRange = adaptPivotRange(range, applyChange);
63110
+ if (adaptedRange === range) {
63111
+ return;
63112
+ }
63091
63113
  const dataSet = adaptedRange && {
63092
63114
  sheetId: adaptedRange.sheetId,
63093
63115
  zone: adaptedRange.zone,
@@ -66827,9 +66849,7 @@ class PivotUIPlugin extends CoreViewPlugin {
66827
66849
  handle(cmd) {
66828
66850
  if (invalidateEvaluationCommands.has(cmd.type)) {
66829
66851
  for (const pivotId of this.getters.getPivotIds()) {
66830
- if (!pivotRegistry.get(this.getters.getPivotCoreDefinition(pivotId).type).externalData) {
66831
- this.setupPivot(pivotId, { recreate: true });
66832
- }
66852
+ this.setupPivot(pivotId, { recreate: true });
66833
66853
  }
66834
66854
  }
66835
66855
  switch (cmd.type) {
@@ -67030,7 +67050,7 @@ class PivotUIPlugin extends CoreViewPlugin {
67030
67050
  pivot.init({ reload: true });
67031
67051
  }
67032
67052
  setupPivot(pivotId, { recreate } = { recreate: false }) {
67033
- const definition = this.getters.getPivotCoreDefinition(pivotId);
67053
+ const definition = deepCopy(this.getters.getPivotCoreDefinition(pivotId));
67034
67054
  if (!(pivotId in this.pivots)) {
67035
67055
  const Pivot = withPivotPresentationLayer(pivotRegistry.get(definition.type).ui);
67036
67056
  this.pivots[pivotId] = new Pivot(this.custom, { definition, getters: this.getters });
@@ -81030,6 +81050,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
81030
81050
  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, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
81031
81051
 
81032
81052
 
81033
- __info__.version = "18.3.27";
81034
- __info__.date = "2025-11-24T07:40:29.469Z";
81035
- __info__.hash = "57b11b8";
81053
+ __info__.version = "18.3.28";
81054
+ __info__.date = "2025-12-02T05:34:06.602Z";
81055
+ __info__.hash = "a205f91";
@@ -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.3.27
6
- * @date 2025-11-24T07:40:29.469Z
7
- * @hash 57b11b8
5
+ * @version 18.3.28
6
+ * @date 2025-12-02T05:34:06.602Z
7
+ * @hash a205f91
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -3468,7 +3468,6 @@
3468
3468
  "REDO",
3469
3469
  "ADD_MERGE",
3470
3470
  "REMOVE_MERGE",
3471
- "DUPLICATE_SHEET",
3472
3471
  "UPDATE_LOCALE",
3473
3472
  "ADD_PIVOT",
3474
3473
  "UPDATE_PIVOT",
@@ -22990,7 +22989,7 @@ stores.inject(MyMetaStore, storeInstance);
22990
22989
  }
22991
22990
  this.selectionStart = start;
22992
22991
  this.selectionEnd = end;
22993
- this.editionMode = "editing";
22992
+ this.stopComposerRangeSelection();
22994
22993
  this.computeFormulaCursorContext();
22995
22994
  this.computeParenthesisRelatedToCursor();
22996
22995
  }
@@ -24872,11 +24871,18 @@ stores.inject(MyMetaStore, storeInstance);
24872
24871
  // we have to add the canvas to the DOM otherwise it won't be rendered
24873
24872
  document.body.append(div);
24874
24873
  if ("chartJsConfig" in runtime) {
24874
+ const extensionsLoaded = areChartJSExtensionsLoaded();
24875
+ if (!extensionsLoaded) {
24876
+ registerChartJSExtensions();
24877
+ }
24875
24878
  const config = deepCopy(runtime.chartJsConfig);
24876
24879
  config.plugins = [backgroundColorChartJSPlugin];
24877
24880
  const chart = new window.Chart(canvas, config);
24878
24881
  imageContent = chart.toBase64Image();
24879
24882
  chart.destroy();
24883
+ if (!extensionsLoaded) {
24884
+ unregisterChartJsExtensions();
24885
+ }
24880
24886
  }
24881
24887
  else if (type === "scorecard") {
24882
24888
  const design = getScorecardConfiguration(figure, runtime);
@@ -24906,11 +24912,18 @@ stores.inject(MyMetaStore, storeInstance);
24906
24912
  document.body.append(div);
24907
24913
  let chartBlob = null;
24908
24914
  if ("chartJsConfig" in runtime) {
24915
+ const extensionsLoaded = areChartJSExtensionsLoaded();
24916
+ if (!extensionsLoaded) {
24917
+ registerChartJSExtensions();
24918
+ }
24909
24919
  const config = deepCopy(runtime.chartJsConfig);
24910
24920
  config.plugins = [backgroundColorChartJSPlugin];
24911
24921
  const chart = new window.Chart(canvas, config);
24912
24922
  chartBlob = await new Promise((resolve) => canvas.toBlob(resolve, "image/png"));
24913
24923
  chart.destroy();
24924
+ if (!extensionsLoaded) {
24925
+ unregisterChartJsExtensions();
24926
+ }
24914
24927
  }
24915
24928
  else if (type === "scorecard") {
24916
24929
  const design = getScorecardConfiguration(figure, runtime);
@@ -50260,7 +50273,6 @@ stores.inject(MyMetaStore, storeInstance);
50260
50273
  pivotRegistry.add("SPREADSHEET", {
50261
50274
  ui: SpreadsheetPivot,
50262
50275
  definition: SpreadsheetPivotRuntimeDefinition,
50263
- externalData: false,
50264
50276
  dateGranularities: [...dateGranularities],
50265
50277
  datetimeGranularities: [...dateGranularities, "hour_number", "minute_number", "second_number"],
50266
50278
  isMeasureCandidate: (field) => field.type !== "boolean",
@@ -62925,10 +62937,17 @@ stores.inject(MyMetaStore, storeInstance);
62925
62937
  if (!pivot) {
62926
62938
  continue;
62927
62939
  }
62928
- for (const measure of pivot.definition.measures) {
62940
+ const def = deepCopy(pivot.definition);
62941
+ for (const measure of def.measures) {
62929
62942
  if (measure.computedBy?.formula === formulaString) {
62930
- const measureIndex = pivot.definition.measures.indexOf(measure);
62931
- this.history.update("pivots", pivotId, "definition", "measures", measureIndex, "computedBy", { formula: newFormulaString, sheetId });
62943
+ const measureIndex = def.measures.indexOf(measure);
62944
+ if (measureIndex !== -1) {
62945
+ def.measures[measureIndex].computedBy = {
62946
+ formula: newFormulaString,
62947
+ sheetId,
62948
+ };
62949
+ }
62950
+ this.dispatch("UPDATE_PIVOT", { pivotId, pivot: def });
62932
62951
  }
62933
62952
  }
62934
62953
  }
@@ -63089,6 +63108,9 @@ stores.inject(MyMetaStore, storeInstance);
63089
63108
  const { sheetId, zone } = definition.dataSet;
63090
63109
  const range = this.getters.getRangeFromZone(sheetId, zone);
63091
63110
  const adaptedRange = adaptPivotRange(range, applyChange);
63111
+ if (adaptedRange === range) {
63112
+ return;
63113
+ }
63092
63114
  const dataSet = adaptedRange && {
63093
63115
  sheetId: adaptedRange.sheetId,
63094
63116
  zone: adaptedRange.zone,
@@ -66828,9 +66850,7 @@ stores.inject(MyMetaStore, storeInstance);
66828
66850
  handle(cmd) {
66829
66851
  if (invalidateEvaluationCommands.has(cmd.type)) {
66830
66852
  for (const pivotId of this.getters.getPivotIds()) {
66831
- if (!pivotRegistry.get(this.getters.getPivotCoreDefinition(pivotId).type).externalData) {
66832
- this.setupPivot(pivotId, { recreate: true });
66833
- }
66853
+ this.setupPivot(pivotId, { recreate: true });
66834
66854
  }
66835
66855
  }
66836
66856
  switch (cmd.type) {
@@ -67031,7 +67051,7 @@ stores.inject(MyMetaStore, storeInstance);
67031
67051
  pivot.init({ reload: true });
67032
67052
  }
67033
67053
  setupPivot(pivotId, { recreate } = { recreate: false }) {
67034
- const definition = this.getters.getPivotCoreDefinition(pivotId);
67054
+ const definition = deepCopy(this.getters.getPivotCoreDefinition(pivotId));
67035
67055
  if (!(pivotId in this.pivots)) {
67036
67056
  const Pivot = withPivotPresentationLayer(pivotRegistry.get(definition.type).ui);
67037
67057
  this.pivots[pivotId] = new Pivot(this.custom, { definition, getters: this.getters });
@@ -81077,9 +81097,9 @@ stores.inject(MyMetaStore, storeInstance);
81077
81097
  exports.tokenize = tokenize;
81078
81098
 
81079
81099
 
81080
- __info__.version = "18.3.27";
81081
- __info__.date = "2025-11-24T07:40:29.469Z";
81082
- __info__.hash = "57b11b8";
81100
+ __info__.version = "18.3.28";
81101
+ __info__.date = "2025-12-02T05:34:06.602Z";
81102
+ __info__.hash = "a205f91";
81083
81103
 
81084
81104
 
81085
81105
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);