@odoo/o-spreadsheet 18.2.33 → 18.2.35

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.33
6
- * @date 2025-10-16T06:39:40.421Z
7
- * @hash 280596c
5
+ * @version 18.2.35
6
+ * @date 2025-11-24T07:40:00.240Z
7
+ * @hash 2e9a842
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -10900,7 +10900,7 @@ stores.inject(MyMetaStore, storeInstance);
10900
10900
  return {
10901
10901
  background: context.background,
10902
10902
  type: "scorecard",
10903
- keyValue: context.range ? context.range[0].dataRange : undefined,
10903
+ keyValue: context.range?.[0]?.dataRange,
10904
10904
  title: context.title || { text: "" },
10905
10905
  baselineMode: DEFAULT_SCORECARD_BASELINE_MODE,
10906
10906
  baselineColorUp: DEFAULT_SCORECARD_BASELINE_COLOR_UP,
@@ -18585,28 +18585,38 @@ stores.inject(MyMetaStore, storeInstance);
18585
18585
  return xc;
18586
18586
  }
18587
18587
  /**
18588
- * Returns the given XC with the given reference type. The XC string should not contain a sheet name.
18588
+ * Returns the given XC with the given reference type.
18589
18589
  */
18590
18590
  function setXcToFixedReferenceType(xc, referenceType) {
18591
- if (xc.includes("!")) {
18592
- throw new Error("The given XC should not contain a sheet name");
18593
- }
18591
+ let sheetName;
18592
+ ({ sheetName, xc } = splitReference(xc));
18593
+ sheetName = sheetName ? sheetName + "!" : "";
18594
18594
  xc = xc.replace(/\$/g, "");
18595
- let indexOfNumber;
18595
+ const splitIndex = xc.indexOf(":");
18596
+ if (splitIndex >= 0) {
18597
+ return `${sheetName}${_setXcToFixedReferenceType(xc.slice(0, splitIndex), referenceType)}:${_setXcToFixedReferenceType(xc.slice(splitIndex + 1), referenceType)}`;
18598
+ }
18599
+ else {
18600
+ return sheetName + _setXcToFixedReferenceType(xc, referenceType);
18601
+ }
18602
+ }
18603
+ function _setXcToFixedReferenceType(xc, referenceType) {
18604
+ const indexOfNumber = xc.search(/[0-9]/);
18605
+ const hasCol = indexOfNumber !== 0;
18606
+ const hasRow = indexOfNumber >= 0;
18596
18607
  switch (referenceType) {
18597
18608
  case "col":
18609
+ if (!hasCol)
18610
+ return xc;
18598
18611
  return "$" + xc;
18599
18612
  case "row":
18600
- indexOfNumber = xc.search(/[0-9]/);
18613
+ if (!hasRow)
18614
+ return xc;
18601
18615
  return xc.slice(0, indexOfNumber) + "$" + xc.slice(indexOfNumber);
18602
18616
  case "colrow":
18603
- indexOfNumber = xc.search(/[0-9]/);
18604
- if (indexOfNumber === -1 || indexOfNumber === 0) {
18605
- // no row number (eg. A) or no column (eg. 1)
18617
+ if (!hasRow || !hasCol)
18606
18618
  return "$" + xc;
18607
- }
18608
- xc = xc.slice(0, indexOfNumber) + "$" + xc.slice(indexOfNumber);
18609
- return "$" + xc;
18619
+ return "$" + xc.slice(0, indexOfNumber) + "$" + xc.slice(indexOfNumber);
18610
18620
  case "none":
18611
18621
  return xc;
18612
18622
  }
@@ -21121,6 +21131,7 @@ stores.inject(MyMetaStore, storeInstance);
21121
21131
  this.highlightStore.register(this);
21122
21132
  this.onDispose(() => {
21123
21133
  this.highlightStore.unRegister(this);
21134
+ this._cancelEdition();
21124
21135
  });
21125
21136
  }
21126
21137
  handleEvent(event) {
@@ -21154,6 +21165,7 @@ stores.inject(MyMetaStore, storeInstance);
21154
21165
  }
21155
21166
  this.selectionStart = start;
21156
21167
  this.selectionEnd = end;
21168
+ this.editionMode = "editing";
21157
21169
  this.computeFormulaCursorContext();
21158
21170
  this.computeParenthesisRelatedToCursor();
21159
21171
  }
@@ -22198,7 +22210,6 @@ stores.inject(MyMetaStore, storeInstance);
22198
22210
  // replace the whole token
22199
22211
  start = tokenAtCursor.start;
22200
22212
  }
22201
- this.composer.stopComposerRangeSelection();
22202
22213
  this.composer.changeComposerCursorSelection(start, end);
22203
22214
  this.composer.replaceComposerCursorSelection(value);
22204
22215
  }
@@ -22216,7 +22227,6 @@ stores.inject(MyMetaStore, storeInstance);
22216
22227
  // replace the whole token
22217
22228
  start = tokenAtCursor.start;
22218
22229
  }
22219
- this.composer.stopComposerRangeSelection();
22220
22230
  this.composer.changeComposerCursorSelection(start, end);
22221
22231
  this.composer.replaceComposerCursorSelection(value);
22222
22232
  }
@@ -31143,7 +31153,7 @@ stores.inject(MyMetaStore, storeInstance);
31143
31153
  background: context.background,
31144
31154
  title: context.title || { text: "" },
31145
31155
  type: "gauge",
31146
- dataRange: context.range ? context.range[0].dataRange : undefined,
31156
+ dataRange: context.range?.[0]?.dataRange,
31147
31157
  sectionRule: {
31148
31158
  colors: {
31149
31159
  lowerColor: DEFAULT_GAUGE_LOWER_COLOR,
@@ -41373,7 +41383,6 @@ stores.inject(MyMetaStore, storeInstance);
41373
41383
  return;
41374
41384
  }
41375
41385
  const newSelection = this.contentHelper.getCurrentSelection();
41376
- this.props.composerStore.stopComposerRangeSelection();
41377
41386
  this.props.onComposerContentFocused();
41378
41387
  this.props.composerStore.changeComposerCursorSelection(newSelection.start, newSelection.end);
41379
41388
  this.processTokenAtCursor();
@@ -44226,6 +44235,7 @@ stores.inject(MyMetaStore, storeInstance);
44226
44235
  placeholder: this.placeholder,
44227
44236
  class: "o-sidePanel-composer",
44228
44237
  defaultRangeSheetId: this.env.model.getters.getActiveSheetId(),
44238
+ defaultStatic: true,
44229
44239
  };
44230
44240
  }
44231
44241
  get errorMessage() {
@@ -51361,7 +51371,10 @@ stores.inject(MyMetaStore, storeInstance);
51361
51371
  this.state.waitingForMove = false;
51362
51372
  }
51363
51373
  onMouseMove(ev) {
51364
- if (this.state.isResizing || this.state.isMoving || this.state.isSelecting) {
51374
+ if (this.env.model.getters.isReadonly() ||
51375
+ this.state.isResizing ||
51376
+ this.state.isMoving ||
51377
+ this.state.isSelecting) {
51365
51378
  return;
51366
51379
  }
51367
51380
  this._computeHandleDisplay(ev);
@@ -51414,6 +51427,10 @@ stores.inject(MyMetaStore, storeInstance);
51414
51427
  if (index < 0) {
51415
51428
  return;
51416
51429
  }
51430
+ if (this.env.model.getters.isReadonly()) {
51431
+ this._selectElement(index, false);
51432
+ return;
51433
+ }
51417
51434
  if (this.state.waitingForMove) {
51418
51435
  if (!this.env.model.getters.isGridSelectionActive()) {
51419
51436
  this._selectElement(index, false);
@@ -53115,24 +53132,24 @@ stores.inject(MyMetaStore, storeInstance);
53115
53132
  const MIN_SHEET_VIEW_WIDTH = 150;
53116
53133
  class SidePanelStore extends SpreadsheetStore {
53117
53134
  mutators = ["open", "toggle", "close", "changePanelSize", "resetPanelSize"];
53118
- initialPanelProps = {};
53135
+ currentPanelProps = {};
53119
53136
  componentTag = "";
53120
53137
  panelSize = DEFAULT_SIDE_PANEL_SIZE;
53121
53138
  get isOpen() {
53122
53139
  if (!this.componentTag) {
53123
53140
  return false;
53124
53141
  }
53125
- return this.computeState(this.componentTag, this.initialPanelProps).isOpen;
53142
+ return this.computeState(this.componentTag, this.currentPanelProps).isOpen;
53126
53143
  }
53127
53144
  get panelProps() {
53128
- const state = this.computeState(this.componentTag, this.initialPanelProps);
53145
+ const state = this.computeState(this.componentTag, this.currentPanelProps);
53129
53146
  if (state.isOpen) {
53130
53147
  return state.props ?? {};
53131
53148
  }
53132
53149
  return {};
53133
53150
  }
53134
53151
  get panelKey() {
53135
- const state = this.computeState(this.componentTag, this.initialPanelProps);
53152
+ const state = this.computeState(this.componentTag, this.currentPanelProps);
53136
53153
  if (state.isOpen) {
53137
53154
  return state.key;
53138
53155
  }
@@ -53144,10 +53161,10 @@ stores.inject(MyMetaStore, storeInstance);
53144
53161
  return;
53145
53162
  }
53146
53163
  if (this.isOpen && componentTag !== this.componentTag) {
53147
- this.initialPanelProps?.onCloseSidePanel?.();
53164
+ this.currentPanelProps?.onCloseSidePanel?.();
53148
53165
  }
53149
53166
  this.componentTag = componentTag;
53150
- this.initialPanelProps = state.props ?? {};
53167
+ this.currentPanelProps = state.props ?? {};
53151
53168
  }
53152
53169
  toggle(componentTag, panelProps) {
53153
53170
  if (this.isOpen && componentTag === this.componentTag) {
@@ -53158,8 +53175,8 @@ stores.inject(MyMetaStore, storeInstance);
53158
53175
  }
53159
53176
  }
53160
53177
  close() {
53161
- this.initialPanelProps.onCloseSidePanel?.();
53162
- this.initialPanelProps = {};
53178
+ this.currentPanelProps.onCloseSidePanel?.();
53179
+ this.currentPanelProps = {};
53163
53180
  this.componentTag = "";
53164
53181
  }
53165
53182
  changePanelSize(size, spreadsheetElWidth) {
@@ -53185,7 +53202,11 @@ stores.inject(MyMetaStore, storeInstance);
53185
53202
  };
53186
53203
  }
53187
53204
  else {
53188
- return customComputeState(this.getters, panelProps);
53205
+ const state = customComputeState(this.getters, panelProps);
53206
+ if (state.isOpen) {
53207
+ this.currentPanelProps = state.props ?? this.currentPanelProps;
53208
+ }
53209
+ return state;
53189
53210
  }
53190
53211
  }
53191
53212
  }
@@ -57853,7 +57874,7 @@ stores.inject(MyMetaStore, storeInstance);
57853
57874
  let sheetName = "";
57854
57875
  if (prefixSheet) {
57855
57876
  if (rangeImpl.invalidSheetName) {
57856
- sheetName = rangeImpl.invalidSheetName;
57877
+ sheetName = getCanonicalSymbolName(rangeImpl.invalidSheetName);
57857
57878
  }
57858
57879
  else {
57859
57880
  sheetName = getCanonicalSymbolName(this.getters.getSheetName(rangeImpl.sheetId));
@@ -72667,7 +72688,7 @@ stores.inject(MyMetaStore, storeInstance);
72667
72688
  border-radius: 4px;
72668
72689
  font-weight: 500;
72669
72690
  font-size: 14px;
72670
- height: 32px;
72691
+ min-height: 32px;
72671
72692
  line-height: 16px;
72672
72693
  flex-grow: 1;
72673
72694
  background-color: ${BUTTON_BG};
@@ -77372,9 +77393,9 @@ stores.inject(MyMetaStore, storeInstance);
77372
77393
  exports.tokenize = tokenize;
77373
77394
 
77374
77395
 
77375
- __info__.version = "18.2.33";
77376
- __info__.date = "2025-10-16T06:39:40.421Z";
77377
- __info__.hash = "280596c";
77396
+ __info__.version = "18.2.35";
77397
+ __info__.date = "2025-11-24T07:40:00.240Z";
77398
+ __info__.hash = "2e9a842";
77378
77399
 
77379
77400
 
77380
77401
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);