@odoo/o-spreadsheet 18.3.26 → 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.26
6
- * @date 2025-11-12T14:15:33.133Z
7
- * @hash f31a752
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,6 +22989,7 @@ stores.inject(MyMetaStore, storeInstance);
22990
22989
  }
22991
22990
  this.selectionStart = start;
22992
22991
  this.selectionEnd = end;
22992
+ this.stopComposerRangeSelection();
22993
22993
  this.computeFormulaCursorContext();
22994
22994
  this.computeParenthesisRelatedToCursor();
22995
22995
  }
@@ -23727,7 +23727,6 @@ stores.inject(MyMetaStore, storeInstance);
23727
23727
  // replace the whole token
23728
23728
  start = tokenAtCursor.start;
23729
23729
  }
23730
- this.composer.stopComposerRangeSelection();
23731
23730
  this.composer.changeComposerCursorSelection(start, end);
23732
23731
  this.composer.replaceComposerCursorSelection(value);
23733
23732
  }
@@ -23745,7 +23744,6 @@ stores.inject(MyMetaStore, storeInstance);
23745
23744
  // replace the whole token
23746
23745
  start = tokenAtCursor.start;
23747
23746
  }
23748
- this.composer.stopComposerRangeSelection();
23749
23747
  this.composer.changeComposerCursorSelection(start, end);
23750
23748
  this.composer.replaceComposerCursorSelection(value);
23751
23749
  }
@@ -24873,11 +24871,18 @@ stores.inject(MyMetaStore, storeInstance);
24873
24871
  // we have to add the canvas to the DOM otherwise it won't be rendered
24874
24872
  document.body.append(div);
24875
24873
  if ("chartJsConfig" in runtime) {
24874
+ const extensionsLoaded = areChartJSExtensionsLoaded();
24875
+ if (!extensionsLoaded) {
24876
+ registerChartJSExtensions();
24877
+ }
24876
24878
  const config = deepCopy(runtime.chartJsConfig);
24877
24879
  config.plugins = [backgroundColorChartJSPlugin];
24878
24880
  const chart = new window.Chart(canvas, config);
24879
24881
  imageContent = chart.toBase64Image();
24880
24882
  chart.destroy();
24883
+ if (!extensionsLoaded) {
24884
+ unregisterChartJsExtensions();
24885
+ }
24881
24886
  }
24882
24887
  else if (type === "scorecard") {
24883
24888
  const design = getScorecardConfiguration(figure, runtime);
@@ -24907,11 +24912,18 @@ stores.inject(MyMetaStore, storeInstance);
24907
24912
  document.body.append(div);
24908
24913
  let chartBlob = null;
24909
24914
  if ("chartJsConfig" in runtime) {
24915
+ const extensionsLoaded = areChartJSExtensionsLoaded();
24916
+ if (!extensionsLoaded) {
24917
+ registerChartJSExtensions();
24918
+ }
24910
24919
  const config = deepCopy(runtime.chartJsConfig);
24911
24920
  config.plugins = [backgroundColorChartJSPlugin];
24912
24921
  const chart = new window.Chart(canvas, config);
24913
24922
  chartBlob = await new Promise((resolve) => canvas.toBlob(resolve, "image/png"));
24914
24923
  chart.destroy();
24924
+ if (!extensionsLoaded) {
24925
+ unregisterChartJsExtensions();
24926
+ }
24915
24927
  }
24916
24928
  else if (type === "scorecard") {
24917
24929
  const design = getScorecardConfiguration(figure, runtime);
@@ -43886,7 +43898,6 @@ stores.inject(MyMetaStore, storeInstance);
43886
43898
  return;
43887
43899
  }
43888
43900
  const newSelection = this.contentHelper.getCurrentSelection();
43889
- this.props.composerStore.stopComposerRangeSelection();
43890
43901
  this.props.onComposerContentFocused();
43891
43902
  this.props.composerStore.changeComposerCursorSelection(newSelection.start, newSelection.end);
43892
43903
  this.processTokenAtCursor();
@@ -50262,7 +50273,6 @@ stores.inject(MyMetaStore, storeInstance);
50262
50273
  pivotRegistry.add("SPREADSHEET", {
50263
50274
  ui: SpreadsheetPivot,
50264
50275
  definition: SpreadsheetPivotRuntimeDefinition,
50265
- externalData: false,
50266
50276
  dateGranularities: [...dateGranularities],
50267
50277
  datetimeGranularities: [...dateGranularities, "hour_number", "minute_number", "second_number"],
50268
50278
  isMeasureCandidate: (field) => field.type !== "boolean",
@@ -54346,7 +54356,10 @@ stores.inject(MyMetaStore, storeInstance);
54346
54356
  this.state.waitingForMove = false;
54347
54357
  }
54348
54358
  onMouseMove(ev) {
54349
- if (this.state.isResizing || this.state.isMoving || this.state.isSelecting) {
54359
+ if (this.env.model.getters.isReadonly() ||
54360
+ this.state.isResizing ||
54361
+ this.state.isMoving ||
54362
+ this.state.isSelecting) {
54350
54363
  return;
54351
54364
  }
54352
54365
  this._computeHandleDisplay(ev);
@@ -54399,6 +54412,10 @@ stores.inject(MyMetaStore, storeInstance);
54399
54412
  if (index < 0) {
54400
54413
  return;
54401
54414
  }
54415
+ if (this.env.model.getters.isReadonly()) {
54416
+ this._selectElement(index, false);
54417
+ return;
54418
+ }
54402
54419
  if (this.state.waitingForMove) {
54403
54420
  if (!this.env.model.getters.isGridSelectionActive()) {
54404
54421
  this._selectElement(index, false);
@@ -56105,24 +56122,24 @@ stores.inject(MyMetaStore, storeInstance);
56105
56122
  const MIN_SHEET_VIEW_WIDTH = 150;
56106
56123
  class SidePanelStore extends SpreadsheetStore {
56107
56124
  mutators = ["open", "toggle", "close", "changePanelSize", "resetPanelSize"];
56108
- initialPanelProps = {};
56125
+ currentPanelProps = {};
56109
56126
  componentTag = "";
56110
56127
  panelSize = DEFAULT_SIDE_PANEL_SIZE;
56111
56128
  get isOpen() {
56112
56129
  if (!this.componentTag) {
56113
56130
  return false;
56114
56131
  }
56115
- return this.computeState(this.componentTag, this.initialPanelProps).isOpen;
56132
+ return this.computeState(this.componentTag, this.currentPanelProps).isOpen;
56116
56133
  }
56117
56134
  get panelProps() {
56118
- const state = this.computeState(this.componentTag, this.initialPanelProps);
56135
+ const state = this.computeState(this.componentTag, this.currentPanelProps);
56119
56136
  if (state.isOpen) {
56120
56137
  return state.props ?? {};
56121
56138
  }
56122
56139
  return {};
56123
56140
  }
56124
56141
  get panelKey() {
56125
- const state = this.computeState(this.componentTag, this.initialPanelProps);
56142
+ const state = this.computeState(this.componentTag, this.currentPanelProps);
56126
56143
  if (state.isOpen) {
56127
56144
  return state.key;
56128
56145
  }
@@ -56134,10 +56151,10 @@ stores.inject(MyMetaStore, storeInstance);
56134
56151
  return;
56135
56152
  }
56136
56153
  if (this.isOpen && componentTag !== this.componentTag) {
56137
- this.initialPanelProps?.onCloseSidePanel?.();
56154
+ this.currentPanelProps?.onCloseSidePanel?.();
56138
56155
  }
56139
56156
  this.componentTag = componentTag;
56140
- this.initialPanelProps = state.props ?? {};
56157
+ this.currentPanelProps = state.props ?? {};
56141
56158
  }
56142
56159
  toggle(componentTag, panelProps) {
56143
56160
  if (this.isOpen && componentTag === this.componentTag) {
@@ -56148,8 +56165,8 @@ stores.inject(MyMetaStore, storeInstance);
56148
56165
  }
56149
56166
  }
56150
56167
  close() {
56151
- this.initialPanelProps.onCloseSidePanel?.();
56152
- this.initialPanelProps = {};
56168
+ this.currentPanelProps.onCloseSidePanel?.();
56169
+ this.currentPanelProps = {};
56153
56170
  this.componentTag = "";
56154
56171
  }
56155
56172
  changePanelSize(size, spreadsheetElWidth) {
@@ -56175,7 +56192,11 @@ stores.inject(MyMetaStore, storeInstance);
56175
56192
  };
56176
56193
  }
56177
56194
  else {
56178
- return customComputeState(this.getters, panelProps);
56195
+ const state = customComputeState(this.getters, panelProps);
56196
+ if (state.isOpen) {
56197
+ this.currentPanelProps = state.props ?? this.currentPanelProps;
56198
+ }
56199
+ return state;
56179
56200
  }
56180
56201
  }
56181
56202
  }
@@ -62916,10 +62937,17 @@ stores.inject(MyMetaStore, storeInstance);
62916
62937
  if (!pivot) {
62917
62938
  continue;
62918
62939
  }
62919
- for (const measure of pivot.definition.measures) {
62940
+ const def = deepCopy(pivot.definition);
62941
+ for (const measure of def.measures) {
62920
62942
  if (measure.computedBy?.formula === formulaString) {
62921
- const measureIndex = pivot.definition.measures.indexOf(measure);
62922
- 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 });
62923
62951
  }
62924
62952
  }
62925
62953
  }
@@ -63080,6 +63108,9 @@ stores.inject(MyMetaStore, storeInstance);
63080
63108
  const { sheetId, zone } = definition.dataSet;
63081
63109
  const range = this.getters.getRangeFromZone(sheetId, zone);
63082
63110
  const adaptedRange = adaptPivotRange(range, applyChange);
63111
+ if (adaptedRange === range) {
63112
+ return;
63113
+ }
63083
63114
  const dataSet = adaptedRange && {
63084
63115
  sheetId: adaptedRange.sheetId,
63085
63116
  zone: adaptedRange.zone,
@@ -66819,9 +66850,7 @@ stores.inject(MyMetaStore, storeInstance);
66819
66850
  handle(cmd) {
66820
66851
  if (invalidateEvaluationCommands.has(cmd.type)) {
66821
66852
  for (const pivotId of this.getters.getPivotIds()) {
66822
- if (!pivotRegistry.get(this.getters.getPivotCoreDefinition(pivotId).type).externalData) {
66823
- this.setupPivot(pivotId, { recreate: true });
66824
- }
66853
+ this.setupPivot(pivotId, { recreate: true });
66825
66854
  }
66826
66855
  }
66827
66856
  switch (cmd.type) {
@@ -67022,7 +67051,7 @@ stores.inject(MyMetaStore, storeInstance);
67022
67051
  pivot.init({ reload: true });
67023
67052
  }
67024
67053
  setupPivot(pivotId, { recreate } = { recreate: false }) {
67025
- const definition = this.getters.getPivotCoreDefinition(pivotId);
67054
+ const definition = deepCopy(this.getters.getPivotCoreDefinition(pivotId));
67026
67055
  if (!(pivotId in this.pivots)) {
67027
67056
  const Pivot = withPivotPresentationLayer(pivotRegistry.get(definition.type).ui);
67028
67057
  this.pivots[pivotId] = new Pivot(this.custom, { definition, getters: this.getters });
@@ -76343,7 +76372,7 @@ stores.inject(MyMetaStore, storeInstance);
76343
76372
  border-radius: 4px;
76344
76373
  font-weight: 500;
76345
76374
  font-size: 14px;
76346
- height: 32px;
76375
+ min-height: 32px;
76347
76376
  line-height: 16px;
76348
76377
  flex-grow: 1;
76349
76378
  background-color: ${BUTTON_BG};
@@ -81068,9 +81097,9 @@ stores.inject(MyMetaStore, storeInstance);
81068
81097
  exports.tokenize = tokenize;
81069
81098
 
81070
81099
 
81071
- __info__.version = "18.3.26";
81072
- __info__.date = "2025-11-12T14:15:33.133Z";
81073
- __info__.hash = "f31a752";
81100
+ __info__.version = "18.3.28";
81101
+ __info__.date = "2025-12-02T05:34:06.602Z";
81102
+ __info__.hash = "a205f91";
81074
81103
 
81075
81104
 
81076
81105
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);