@odoo/o-spreadsheet 19.4.0-alpha.11 → 19.4.0-alpha.12

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.4.0-alpha.11
6
- * @date 2026-06-03T11:42:34.595Z
7
- * @hash 6f35bc7
5
+ * @version 19.4.0-alpha.12
6
+ * @date 2026-06-06T06:24:48.209Z
7
+ * @hash a71f829
8
8
  */
9
9
 
10
10
  (function(exports, _odoo_owl) {
@@ -4324,6 +4324,7 @@ set(value) {
4324
4324
  //#endregion
4325
4325
  //#region src/helpers/format/format_tokenizer.ts
4326
4326
  function tokenizeFormat(str) {
4327
+ str = str.replace(/\s/g, " ");
4327
4328
  const chars = new TokenizingChars(str);
4328
4329
  const result = [];
4329
4330
  let currentFormatPart = [];
@@ -10571,7 +10572,7 @@ set(value) {
10571
10572
  font: {
10572
10573
  style: italic ? "italic" : "normal",
10573
10574
  weight: bold ? "bold" : "normal",
10574
- size: design.title.fontSize ?? 12
10575
+ size: fontSizeInPixels(design.title.fontSize ?? 12)
10575
10576
  },
10576
10577
  align: align === "left" ? "start" : align === "right" ? "end" : "center"
10577
10578
  };
@@ -11193,7 +11194,7 @@ set(value) {
11193
11194
  font: {
11194
11195
  weight: design?.bold ?? defaultDesign?.bold ? "bold" : "normal",
11195
11196
  style: design?.italic ?? defaultDesign?.italic ? "italic" : "normal",
11196
- size: design?.fontSize ?? defaultDesign?.fontSize
11197
+ size: fontSizeInPixels(design?.fontSize ?? defaultDesign.fontSize)
11197
11198
  }
11198
11199
  };
11199
11200
  }
@@ -12129,35 +12130,35 @@ set(value) {
12129
12130
  if (this.runtime.progressBar) baselineValueFontSize /= 1.5;
12130
12131
  return {
12131
12132
  title: {
12132
- font: getDefaultContextFont(this.runtime.title.fontSize ?? 14, this.runtime.title.bold, this.runtime.title.italic),
12133
+ font: getDefaultContextFont(fontSizeInPixels(this.runtime.title.fontSize ?? 14), this.runtime.title.bold, this.runtime.title.italic),
12133
12134
  color: this.runtime.title.color ?? this.secondaryFontColor
12134
12135
  },
12135
12136
  keyValue: {
12136
12137
  color: this.runtime.keyValueStyle?.textColor || this.runtime.fontColor,
12137
- font: getDefaultContextFont(keyValueFontSize, this.runtime.keyValueStyle?.bold, this.runtime.keyValueStyle?.italic),
12138
+ font: getDefaultContextFont(fontSizeInPixels(keyValueFontSize), this.runtime.keyValueStyle?.bold, this.runtime.keyValueStyle?.italic),
12138
12139
  strikethrough: this.runtime.keyValueStyle?.strikethrough,
12139
12140
  underline: this.runtime.keyValueStyle?.underline
12140
12141
  },
12141
12142
  keyDescr: {
12142
12143
  color: this.runtime.keyValueDescrStyle?.textColor || this.runtime.fontColor,
12143
- font: getDefaultContextFont(keyValueDescrFontSize, this.runtime.keyValueDescrStyle?.bold, this.runtime.keyValueDescrStyle?.italic),
12144
+ font: getDefaultContextFont(fontSizeInPixels(keyValueDescrFontSize), this.runtime.keyValueDescrStyle?.bold, this.runtime.keyValueDescrStyle?.italic),
12144
12145
  strikethrough: this.runtime.keyValueDescrStyle?.strikethrough,
12145
12146
  underline: this.runtime.keyValueDescrStyle?.underline
12146
12147
  },
12147
12148
  baselineValue: {
12148
- font: getDefaultContextFont(baselineValueFontSize, this.runtime.baselineStyle?.bold, this.runtime.baselineStyle?.italic),
12149
+ font: getDefaultContextFont(fontSizeInPixels(baselineValueFontSize), this.runtime.baselineStyle?.bold, this.runtime.baselineStyle?.italic),
12149
12150
  strikethrough: this.runtime.baselineStyle?.strikethrough,
12150
12151
  underline: this.runtime.baselineStyle?.underline,
12151
12152
  color: this.runtime.baselineColor || this.runtime.baselineStyle?.textColor || this.secondaryFontColor
12152
12153
  },
12153
12154
  baselineDescr: {
12154
- font: getDefaultContextFont(baselineDescrFontSize, this.runtime.baselineDescrStyle?.bold, this.runtime.baselineDescrStyle?.italic),
12155
+ font: getDefaultContextFont(fontSizeInPixels(baselineDescrFontSize), this.runtime.baselineDescrStyle?.bold, this.runtime.baselineDescrStyle?.italic),
12155
12156
  strikethrough: this.runtime.baselineDescrStyle?.strikethrough,
12156
12157
  underline: this.runtime.baselineDescrStyle?.underline,
12157
12158
  color: this.runtime.baselineDescrStyle?.textColor ?? this.secondaryFontColor
12158
12159
  },
12159
12160
  baselineArrow: this.baselineArrow === "neutral" || this.runtime.progressBar ? void 0 : {
12160
- size: this.keyValue ? .8 * baselineValueFontSize : 0,
12161
+ size: this.keyValue ? .8 * fontSizeInPixels(baselineValueFontSize) : 0,
12161
12162
  color: this.runtime.baselineColor || this.runtime.baselineStyle?.textColor || this.secondaryFontColor
12162
12163
  }
12163
12164
  };
@@ -12367,7 +12368,7 @@ set(value) {
12367
12368
  function drawTitle(ctx, config) {
12368
12369
  ctx.save();
12369
12370
  const title = config.title;
12370
- ctx.font = getDefaultContextFont(title.fontSize, title.bold, title.italic);
12371
+ ctx.font = getDefaultContextFont(fontSizeInPixels(title.fontSize), title.bold, title.italic);
12371
12372
  ctx.textBaseline = "middle";
12372
12373
  ctx.fillStyle = title.color;
12373
12374
  ctx.fillText(title.label, title.textPosition.x, title.textPosition.y);
@@ -12401,8 +12402,8 @@ set(value) {
12401
12402
  const inflectionValues = getInflectionValues(runtime, gaugeRect, textColor, ctx);
12402
12403
  let x = 0, titleWidth = 0, titleHeight = 0;
12403
12404
  if (runtime.title.text) ({width: titleWidth, height: titleHeight} = computeTextDimension(ctx, runtime.title.text, {
12404
- fontSize: 16,
12405
- ...runtime.title
12405
+ ...runtime.title,
12406
+ fontSize: fontSizeInPixels(runtime.title.fontSize ?? 16)
12406
12407
  }, "px"));
12407
12408
  switch (runtime.title.align) {
12408
12409
  case "right":
@@ -13925,10 +13926,10 @@ set(value) {
13925
13926
  let animation = null;
13926
13927
  let lastRuntime = void 0;
13927
13928
  useLayoutEffect(() => {
13928
- if (this.env.isDashboard() && lastRuntime === void 0 && this.animationStore?.animationPlayed[this.animationChartId] !== "gauge") {
13929
+ if (this.env.model.getters.isDashboard() && lastRuntime === void 0 && this.animationStore?.animationPlayed[this.animationChartId] !== "gauge") {
13929
13930
  animation = this.drawGaugeWithAnimation();
13930
13931
  this.animationStore?.disableAnimationForChart(this.animationChartId, "gauge");
13931
- } else if (this.env.isDashboard() && lastRuntime !== void 0 && !deepEquals(this.runtime, lastRuntime)) {
13932
+ } else if (this.env.model.getters.isDashboard() && lastRuntime !== void 0 && !deepEquals(this.runtime, lastRuntime)) {
13932
13933
  animation = this.drawGaugeWithAnimation();
13933
13934
  this.animationStore?.disableAnimationForChart(this.animationChartId, "gauge");
13934
13935
  } else {
@@ -15219,10 +15220,12 @@ set(value) {
15219
15220
  return this.carousel.title?.text ?? "";
15220
15221
  }
15221
15222
  get titleStyle() {
15222
- return cssPropertiesToCss(cellTextStyleToCss(chartStyleToCellStyle({
15223
+ const style = {
15223
15224
  ...DEFAULT_CAROUSEL_TITLE_STYLE,
15224
15225
  ...this.carousel.title
15225
- })));
15226
+ };
15227
+ style.fontSize = fontSizeInPixels(style.fontSize ?? 16);
15228
+ return cssPropertiesToCss(cellTextStyleToCss(chartStyleToCellStyle(style)));
15226
15229
  }
15227
15230
  updateTabsVisibility() {
15228
15231
  const tabsContainerEl = this.carouselTabsRef();
@@ -15385,7 +15388,7 @@ set(value) {
15385
15388
  return figureRegistry;
15386
15389
  }
15387
15390
  getBorderWidth() {
15388
- if (this.env.isDashboard()) return 0;
15391
+ if (this.env.model.getters.isDashboard()) return 0;
15389
15392
  return this.isSelected ? ACTIVE_BORDER_WIDTH : this.borderWidth;
15390
15393
  }
15391
15394
  getBorderStyle(position) {
@@ -15527,7 +15530,7 @@ set(value) {
15527
15530
  };
15528
15531
  }
15529
15532
  onContextMenu(ev) {
15530
- if (this.env.isDashboard()) return;
15533
+ if (this.env.model.getters.isDashboard()) return;
15531
15534
  const zoomedMouseEvent = withZoom(this.env, ev);
15532
15535
  this.openContextMenu({
15533
15536
  x: zoomedMouseEvent.clientX,
@@ -15553,7 +15556,7 @@ set(value) {
15553
15556
  if (el) for (const property in properties) el.style.setProperty(property, properties[property] || null);
15554
15557
  }
15555
15558
  get isFigureResizable() {
15556
- return this.isSelected && !this.env.isMobile() && !this.env.isDashboard() && !this.env.model.getters.isCurrentSheetLocked();
15559
+ return this.isSelected && !this.env.isMobile() && !this.env.model.getters.isDashboard() && !this.env.model.getters.isCurrentSheetLocked();
15557
15560
  }
15558
15561
  };
15559
15562
 
@@ -28482,7 +28485,7 @@ set(value) {
28482
28485
  showLabels: definition.showLabels ?? SunburstChartDefaults.showLabels,
28483
28486
  showValues: definition.showValues ?? SunburstChartDefaults.showValues,
28484
28487
  style: {
28485
- fontSize: definition.valuesDesign?.fontSize ?? SunburstChartDefaults.valuesDesign.fontSize,
28488
+ fontSize: fontSizeInPixels(definition.valuesDesign?.fontSize ?? SunburstChartDefaults.valuesDesign.fontSize),
28486
28489
  align: definition.valuesDesign?.align ?? SunburstChartDefaults.valuesDesign.align,
28487
28490
  bold: definition.valuesDesign?.bold ?? SunburstChartDefaults.valuesDesign.bold,
28488
28491
  italic: definition.valuesDesign?.italic ?? SunburstChartDefaults.valuesDesign.italic,
@@ -28537,7 +28540,7 @@ set(value) {
28537
28540
  color: title?.color ?? fontColor,
28538
28541
  align: title.align === "center" ? "center" : title.align === "right" ? "end" : "start",
28539
28542
  font: {
28540
- size: title.fontSize ?? 16,
28543
+ size: fontSizeInPixels(title.fontSize ?? 16),
28541
28544
  weight: title.bold ? "bold" : "normal",
28542
28545
  style: title.italic ? "italic" : "normal"
28543
28546
  },
@@ -38786,7 +38789,8 @@ set(value) {
38786
38789
  static template = "o-spreadsheet-PivotDimensionOrder";
38787
38790
  props = (0, _odoo_owl.props)({
38788
38791
  dimension: types$6.PivotDimension(),
38789
- onUpdated: types$6.function([types$6.PivotDimension(), types$6.instanceOf(InputEvent)])
38792
+ onUpdated: types$6.function([types$6.PivotDimension(), types$6.instanceOf(InputEvent)]),
38793
+ "isMeasureSorted?": types$6.boolean()
38790
38794
  });
38791
38795
  static components = { Select };
38792
38796
  get orderSelectOptions() {
@@ -38797,12 +38801,20 @@ set(value) {
38797
38801
  value: "desc",
38798
38802
  label: _t("Descending")
38799
38803
  }];
38804
+ if (this.props.isMeasureSorted) options.unshift({
38805
+ value: "measures",
38806
+ label: _t("Sorted by measure")
38807
+ });
38800
38808
  if (this.props.dimension.type === "date") return options;
38801
38809
  return [{
38802
38810
  value: "",
38803
38811
  label: _t("Unsorted")
38804
38812
  }, ...options];
38805
38813
  }
38814
+ get selectedValue() {
38815
+ if (this.props.isMeasureSorted) return "measures";
38816
+ return this.props.dimension.order || "";
38817
+ }
38806
38818
  };
38807
38819
 
38808
38820
  //#endregion
@@ -39173,7 +39185,8 @@ set(value) {
39173
39185
  return this.env.model.getters.getPivotCoreDefinition(this.props.pivotId).customFields?.[dimension.nameWithGranularity];
39174
39186
  }
39175
39187
  updateOrder(updateDimension, order) {
39176
- const { rows, columns } = this.props.definition;
39188
+ const { rows, columns, sortedColumn } = this.props.definition;
39189
+ const isRow = rows.some((row) => row.nameWithGranularity === updateDimension.nameWithGranularity);
39177
39190
  this.props.onDimensionsUpdated({
39178
39191
  rows: rows.map((row) => {
39179
39192
  if (row.nameWithGranularity === updateDimension.nameWithGranularity) return {
@@ -39188,7 +39201,8 @@ set(value) {
39188
39201
  order: order || void 0
39189
39202
  };
39190
39203
  return col;
39191
- })
39204
+ }),
39205
+ sortedColumn: isRow ? void 0 : sortedColumn
39192
39206
  });
39193
39207
  }
39194
39208
  updateGranularity(dimension, granularity) {
@@ -39214,6 +39228,9 @@ set(value) {
39214
39228
  const possibleValues = this.env.model.getters.getPivot(this.props.pivotId).getPossibleFieldValues(dimension);
39215
39229
  return possibleValues.length > 100 ? _t("This dimension contains a lot of values (%s), and might slow down the pivot table.", possibleValues.length) : void 0;
39216
39230
  }
39231
+ get hasSortedColumn() {
39232
+ return !!this.props.definition.sortedColumn;
39233
+ }
39217
39234
  };
39218
39235
 
39219
39236
  //#endregion
@@ -58828,9 +58845,11 @@ set(value) {
58828
58845
  this.refreshPivot(cmd.id);
58829
58846
  break;
58830
58847
  case "ADD_PIVOT":
58848
+ this.unusedPivotsInFormulas?.push(cmd.pivotId);
58831
58849
  this.setupPivot(cmd.pivotId);
58832
58850
  break;
58833
58851
  case "DUPLICATE_PIVOT":
58852
+ this.unusedPivotsInFormulas?.push(cmd.newPivotId);
58834
58853
  this.setupPivot(cmd.newPivotId);
58835
58854
  break;
58836
58855
  case "UPDATE_PIVOT":
@@ -59022,8 +59041,8 @@ set(value) {
59022
59041
  }
59023
59042
  }
59024
59043
  for (const pivotId of this.getters.getPivotIds()) {
59025
- const pivot = this.getters.getPivot(pivotId);
59026
- for (const measure of pivot.definition.measures) if (measure.computedBy) {
59044
+ const pivot = this.getters.getPivotCoreDefinition(pivotId);
59045
+ for (const measure of pivot.measures) if (measure.computedBy) {
59027
59046
  const { sheetId } = measure.computedBy;
59028
59047
  const formula = this.getters.getMeasureCompiledFormula(pivotId, measure);
59029
59048
  const relatedPivotIds = this.getPivotIdsFromFormula(sheetId, formula);
@@ -70785,7 +70804,7 @@ set(value) {
70785
70804
  properties["color-scheme"] = this.props.model.getters.isDarkMode() ? "dark" : "light";
70786
70805
  if (this.state.printModeEnabled) properties["display"] = `block`;
70787
70806
  else {
70788
- if (this.env.isDashboard()) properties["grid-template-rows"] = `auto`;
70807
+ if (this.env.model.getters.isDashboard()) properties["grid-template-rows"] = `auto`;
70789
70808
  else properties["grid-template-rows"] = `min-content auto min-content`;
70790
70809
  properties["grid-template-columns"] = `auto ${this.sidePanel.mainPanel ? `${this.sidePanel.totalPanelSize || 350}px` : "auto"}`;
70791
70810
  }
@@ -70813,7 +70832,6 @@ set(value) {
70813
70832
  imageProvider: fileStore ? new ImageProvider(fileStore) : void 0,
70814
70833
  loadCurrencies: this.model.config.external.loadCurrencies,
70815
70834
  loadLocales: this.model.config.external.loadLocales,
70816
- isDashboard: () => this.model.getters.isDashboard(),
70817
70835
  openSidePanel: this.sidePanel.open.bind(this.sidePanel),
70818
70836
  replaceSidePanel: this.sidePanel.replace.bind(this.sidePanel),
70819
70837
  toggleSidePanel: this.sidePanel.toggle.bind(this.sidePanel),
@@ -86062,7 +86080,8 @@ set(value) {
86062
86080
  pivotToFunctionValueRegistry,
86063
86081
  migrationStepRegistry,
86064
86082
  chartJsExtensionRegistry,
86065
- onIterationEndEvaluationRegistry
86083
+ onIterationEndEvaluationRegistry,
86084
+ specificRangeTransformRegistry
86066
86085
  };
86067
86086
  const helpers = {
86068
86087
  arg,
@@ -86362,8 +86381,8 @@ exports.stores = stores;
86362
86381
  exports.tokenColors = tokenColors;
86363
86382
  exports.tokenize = tokenize;
86364
86383
 
86365
- __info__.version = "19.4.0-alpha.11";
86366
- __info__.date = "2026-06-03T11:42:34.595Z";
86367
- __info__.hash = "6f35bc7";
86384
+ __info__.version = "19.4.0-alpha.12";
86385
+ __info__.date = "2026-06-06T06:24:48.209Z";
86386
+ __info__.hash = "a71f829";
86368
86387
 
86369
86388
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);