@odoo/o-spreadsheet 19.0.1 → 19.0.4

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.0.1
6
- * @date 2025-09-11T08:45:47.109Z
7
- * @hash bd79eea
5
+ * @version 19.0.4
6
+ * @date 2025-09-23T12:37:28.362Z
7
+ * @hash 87b774d
8
8
  */
9
9
 
10
10
  'use strict';
@@ -890,6 +890,7 @@ const tokenColors = {
890
890
  ARG_SEPARATOR: functionColor,
891
891
  ORPHAN_RIGHT_PAREN: "#ff0000",
892
892
  };
893
+ const DRAG_THRESHOLD = 5; // in pixels, to avoid unwanted drag when clicking
893
894
 
894
895
  //------------------------------------------------------------------------------
895
896
  // Miscellaneous
@@ -1368,8 +1369,19 @@ function memoize(func) {
1368
1369
  },
1369
1370
  }[funcName];
1370
1371
  }
1372
+ /**
1373
+ * Removes the specified indexes from the array.
1374
+ * Sparse (empty) elements are transformed to undefined (unless their index is explicitly removed).
1375
+ */
1371
1376
  function removeIndexesFromArray(array, indexes) {
1372
- return array.filter((_, index) => !indexes.includes(index));
1377
+ const toRemove = new Set(indexes);
1378
+ const newArray = [];
1379
+ for (let i = 0; i < array.length; i++) {
1380
+ if (!toRemove.has(i)) {
1381
+ newArray.push(array[i]);
1382
+ }
1383
+ }
1384
+ return newArray;
1373
1385
  }
1374
1386
  function insertItemsAtIndex(array, items, index) {
1375
1387
  const newArray = [...array];
@@ -16084,8 +16096,9 @@ function interactiveSort(env, sheetId, anchor, zone, sortDirection, sortOptions)
16084
16096
  }
16085
16097
 
16086
16098
  function sortMatrix(matrix, locale, ...criteria) {
16087
- for (const [i, value] of criteria.entries()) {
16088
- assert(value !== undefined, _t("Value for parameter %d is missing, while the function [[FUNCTION_NAME]] expect a number or a range.", i + 1));
16099
+ for (let i = 0; i < criteria.length; i++) {
16100
+ const param = i % 2 === 0 ? "sort_column" : "is_ascending";
16101
+ assert(criteria[i] !== undefined, _t("Value for parameter %s is missing in [[FUNCTION_NAME]].", param));
16089
16102
  }
16090
16103
  const sortingOrders = [];
16091
16104
  const sortColumns = [];
@@ -26760,7 +26773,7 @@ function getRadarChartScales(definition, args) {
26760
26773
  },
26761
26774
  pointLabels: {
26762
26775
  color: chartFontColor(definition.background),
26763
- callback: truncateLabel,
26776
+ callback: (label) => truncateLabel(label),
26764
26777
  },
26765
26778
  suggestedMin: minValue < 0 ? minValue - 1 : 0,
26766
26779
  },
@@ -32380,7 +32393,11 @@ class CarouselFigure extends owl.Component {
32380
32393
  onFigureDeleted: Function,
32381
32394
  editFigureStyle: { type: Function, optional: true },
32382
32395
  };
32383
- static components = { ChartDashboardMenu };
32396
+ static components = { ChartDashboardMenu, MenuPopover };
32397
+ carouselTabsRef = owl.useRef("carouselTabs");
32398
+ carouselTabsDropdownRef = owl.useRef("carouselTabsDropdown");
32399
+ menuState = owl.useState({ isOpen: false, anchorRect: null, menuItems: [] });
32400
+ hiddenItems = [];
32384
32401
  animationStore;
32385
32402
  setup() {
32386
32403
  this.animationStore = useStore(ChartAnimationStore);
@@ -32391,6 +32408,7 @@ class CarouselFigure extends owl.Component {
32391
32408
  else {
32392
32409
  this.props.editFigureStyle?.({ "pointer-events": "auto" });
32393
32410
  }
32411
+ this.updateTabsVisibility();
32394
32412
  });
32395
32413
  }
32396
32414
  get carousel() {
@@ -32434,13 +32452,13 @@ class CarouselFigure extends owl.Component {
32434
32452
  }
32435
32453
  get headerStyle() {
32436
32454
  const cssProperties = {};
32437
- if (this.selectedCarouselItem?.type === "carouselDataView") {
32438
- cssProperties["background-color"] = "#ffffff";
32439
- }
32440
- else if (this.selectedCarouselItem?.type === "chart") {
32455
+ if (this.selectedCarouselItem?.type === "chart") {
32441
32456
  const chart = this.env.model.getters.getChartRuntime(this.selectedCarouselItem.chartId);
32442
32457
  cssProperties["background-color"] = chart.background;
32443
32458
  }
32459
+ else {
32460
+ cssProperties["background-color"] = "#ffffff";
32461
+ }
32444
32462
  return cssPropertiesToCss(cssProperties);
32445
32463
  }
32446
32464
  get title() {
@@ -32450,6 +32468,49 @@ class CarouselFigure extends owl.Component {
32450
32468
  const style = { ...DEFAULT_CAROUSEL_TITLE_STYLE, ...this.carousel.title };
32451
32469
  return cssPropertiesToCss(cellTextStyleToCss(chartStyleToCellStyle(style)));
32452
32470
  }
32471
+ updateTabsVisibility() {
32472
+ const tabsContainerEl = this.carouselTabsRef.el;
32473
+ const dropDownEl = this.carouselTabsDropdownRef.el;
32474
+ if (!tabsContainerEl || !dropDownEl) {
32475
+ return;
32476
+ }
32477
+ this.hiddenItems = [];
32478
+ const containerRect = getBoundingRectAsPOJO(tabsContainerEl);
32479
+ const tabs = Array.from(tabsContainerEl.children);
32480
+ for (const tab of tabs) {
32481
+ tab.style.display = "block";
32482
+ }
32483
+ const tabWidths = tabs.map((tab) => getBoundingRectAsPOJO(tab).width);
32484
+ let currentWidth = 0;
32485
+ for (let i = 0; i < tabs.length; i++) {
32486
+ const shouldBeHidden = currentWidth + tabWidths[i] > containerRect.width;
32487
+ currentWidth += tabWidths[i];
32488
+ if (shouldBeHidden) {
32489
+ tabs[i].style.display = "none";
32490
+ this.hiddenItems.push(this.carousel.items[i]);
32491
+ }
32492
+ }
32493
+ dropDownEl.style.display = this.hiddenItems.length ? "block" : "none";
32494
+ }
32495
+ get menuId() {
32496
+ return "carousel-tabs-menu-";
32497
+ }
32498
+ toggleMenu(ev) {
32499
+ if (ev.closedMenuId === this.menuId) {
32500
+ this.menuState.isOpen = false;
32501
+ return;
32502
+ }
32503
+ const rect = getRefBoundingRect(this.carouselTabsDropdownRef);
32504
+ const menuItems = this.hiddenItems.map((item) => ({
32505
+ name: this.getItemTitle(item),
32506
+ execute: () => this.onCarouselTabClick(item),
32507
+ isActive: () => this.isItemSelected(item),
32508
+ isReadonlyAllowed: true,
32509
+ }));
32510
+ this.menuState.isOpen = true;
32511
+ this.menuState.anchorRect = rect;
32512
+ this.menuState.menuItems = createActions(menuItems);
32513
+ }
32453
32514
  }
32454
32515
 
32455
32516
  class ChartFigure extends owl.Component {
@@ -50437,9 +50498,16 @@ class FiguresContainer extends owl.Component {
50437
50498
  maxX: this.env.model.getters.getColDimensions(sheetId, this.env.model.getters.getNumberCols(sheetId) - 1).end,
50438
50499
  maxY: this.env.model.getters.getRowDimensions(sheetId, this.env.model.getters.getNumberRows(sheetId) - 1).end,
50439
50500
  };
50501
+ let hasStartedDnd = false;
50440
50502
  const onMouseMove = (ev) => {
50441
50503
  const getters = this.env.model.getters;
50442
50504
  const currentMousePosition = { x: ev.clientX, y: ev.clientY };
50505
+ const offsetX = Math.abs(currentMousePosition.x - initialMousePosition.x);
50506
+ const offsetY = Math.abs(currentMousePosition.y - initialMousePosition.y);
50507
+ if (!hasStartedDnd && offsetX < DRAG_THRESHOLD && offsetY < DRAG_THRESHOLD) {
50508
+ return; // add a small threshold to avoid dnd when just clicking
50509
+ }
50510
+ hasStartedDnd = true;
50443
50511
  const draggedFigure = dragFigureForMove(currentMousePosition, initialMousePosition, initialFigure, maxDimensions, initialScrollPosition, getters.getActiveSheetScrollInfo());
50444
50512
  const otherFigures = this.getOtherFigures(initialFigure.id);
50445
50513
  const overlappingCarousel = this.getCarouselOverlappingChart(draggedFigure, otherFigures);
@@ -58851,12 +58919,13 @@ class PivotLayoutConfigurator extends owl.Component {
58851
58919
  addCalculatedMeasure() {
58852
58920
  const { measures } = this.props.definition;
58853
58921
  const measureName = this.env.model.getters.generateNewCalculatedMeasureName(measures);
58922
+ const aggregator = "sum";
58854
58923
  this.props.onDimensionsUpdated({
58855
58924
  measures: measures.concat([
58856
58925
  {
58857
- id: this.getMeasureId(measureName),
58926
+ id: this.getMeasureId(measureName, aggregator),
58858
58927
  fieldName: measureName,
58859
- aggregator: "sum",
58928
+ aggregator,
58860
58929
  computedBy: {
58861
58930
  sheetId: this.env.model.getters.getActiveSheetId(),
58862
58931
  formula: "=0",
@@ -71161,7 +71230,7 @@ function withPivotPresentationLayer (PivotClass) {
71161
71230
  return { value: 0 };
71162
71231
  }
71163
71232
  const { columns, rows } = super.definition;
71164
- if (columns.length + rows.length !== domain.length) {
71233
+ if (measure.aggregator && columns.length + rows.length !== domain.length) {
71165
71234
  const values = this.getValuesToAggregate(measure, domain);
71166
71235
  const aggregator = AGGREGATORS_FN[measure.aggregator];
71167
71236
  if (!aggregator) {
@@ -71180,11 +71249,17 @@ function withPivotPresentationLayer (PivotClass) {
71180
71249
  if (columns.find((col) => col.nameWithGranularity === symbolName)) {
71181
71250
  const { colDomain } = domainToColRowDomain(this, domain);
71182
71251
  const symbolIndex = colDomain.findIndex((node) => node.field === symbolName);
71252
+ if (symbolIndex === -1) {
71253
+ return new NotAvailableError();
71254
+ }
71183
71255
  return this.getPivotHeaderValueAndFormat(colDomain.slice(0, symbolIndex + 1));
71184
71256
  }
71185
71257
  if (rows.find((row) => row.nameWithGranularity === symbolName)) {
71186
71258
  const { rowDomain } = domainToColRowDomain(this, domain);
71187
71259
  const symbolIndex = rowDomain.findIndex((row) => row.field === symbolName);
71260
+ if (symbolIndex === -1) {
71261
+ return new NotAvailableError();
71262
+ }
71188
71263
  return this.getPivotHeaderValueAndFormat(rowDomain.slice(0, symbolIndex + 1));
71189
71264
  }
71190
71265
  return this.getPivotCellValueAndFormat(symbolName, domain);
@@ -74850,7 +74925,10 @@ class SortPlugin extends UIPlugin {
74850
74925
  return "Success" /* CommandResult.Success */;
74851
74926
  }
74852
74927
  checkArrayFormulaInSortZone({ sheetId, zone }) {
74853
- const arrayFormulaInZone = positions(zone).some(({ col, row }) => this.getters.getArrayFormulaSpreadingOn({ sheetId, col, row }));
74928
+ const arrayFormulaInZone = positions(zone).some(({ col, row }) => {
74929
+ const originPosition = this.getters.getArrayFormulaSpreadingOn({ sheetId, col, row });
74930
+ return originPosition && !deepEquals(originPosition, { sheetId, col, row });
74931
+ });
74854
74932
  return arrayFormulaInZone ? "SortZoneWithArrayFormulas" /* CommandResult.SortZoneWithArrayFormulas */ : "Success" /* CommandResult.Success */;
74855
74933
  }
74856
74934
  /**
@@ -77563,13 +77641,10 @@ class GridSelectionPlugin extends UIPlugin {
77563
77641
  const deltaCol = isBasedBefore && isCol ? thickness : 0;
77564
77642
  const deltaRow = isBasedBefore && !isCol ? thickness : 0;
77565
77643
  const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
77566
- const originalSize = Object.fromEntries(toRemove.map((element) => {
77567
- const size = isCol
77568
- ? this.getters.getColSize(cmd.sheetId, element)
77569
- : this.getters.getUserRowSize(cmd.sheetId, element);
77570
- const isDefaultCol = isCol && size === DEFAULT_CELL_WIDTH;
77571
- return [element, isDefaultCol ? undefined : size];
77572
- }));
77644
+ const originalSize = {};
77645
+ for (const element of toRemove) {
77646
+ originalSize[element] = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, element);
77647
+ }
77573
77648
  const target = [
77574
77649
  {
77575
77650
  left: isCol ? start + deltaCol : 0,
@@ -77613,11 +77688,11 @@ class GridSelectionPlugin extends UIPlugin {
77613
77688
  for (const element of toRemove) {
77614
77689
  const size = originalSize[element];
77615
77690
  const currentSize = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, currentIndex);
77616
- if (size && size !== currentSize) {
77691
+ if (size !== currentSize) {
77617
77692
  resizingGroups[size] ??= [];
77618
77693
  resizingGroups[size].push(currentIndex);
77619
- currentIndex += 1;
77620
77694
  }
77695
+ currentIndex += 1;
77621
77696
  }
77622
77697
  for (const size in resizingGroups) {
77623
77698
  this.dispatch("RESIZE_COLUMNS_ROWS", {
@@ -88457,6 +88532,6 @@ exports.tokenColors = tokenColors;
88457
88532
  exports.tokenize = tokenize;
88458
88533
 
88459
88534
 
88460
- __info__.version = "19.0.1";
88461
- __info__.date = "2025-09-11T08:45:47.109Z";
88462
- __info__.hash = "bd79eea";
88535
+ __info__.version = "19.0.4";
88536
+ __info__.date = "2025-09-23T12:37:28.362Z";
88537
+ __info__.hash = "87b774d";
@@ -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.0.1
6
- * @date 2025-09-11T08:45:47.109Z
7
- * @hash bd79eea
5
+ * @version 19.0.4
6
+ * @date 2025-09-23T12:37:28.362Z
7
+ * @hash 87b774d
8
8
  */
9
9
 
10
10
  import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, App, blockDom, useState, onPatched, useExternalListener, onWillUpdateProps, onWillStart, onWillPatch, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
@@ -888,6 +888,7 @@ const tokenColors = {
888
888
  ARG_SEPARATOR: functionColor,
889
889
  ORPHAN_RIGHT_PAREN: "#ff0000",
890
890
  };
891
+ const DRAG_THRESHOLD = 5; // in pixels, to avoid unwanted drag when clicking
891
892
 
892
893
  //------------------------------------------------------------------------------
893
894
  // Miscellaneous
@@ -1366,8 +1367,19 @@ function memoize(func) {
1366
1367
  },
1367
1368
  }[funcName];
1368
1369
  }
1370
+ /**
1371
+ * Removes the specified indexes from the array.
1372
+ * Sparse (empty) elements are transformed to undefined (unless their index is explicitly removed).
1373
+ */
1369
1374
  function removeIndexesFromArray(array, indexes) {
1370
- return array.filter((_, index) => !indexes.includes(index));
1375
+ const toRemove = new Set(indexes);
1376
+ const newArray = [];
1377
+ for (let i = 0; i < array.length; i++) {
1378
+ if (!toRemove.has(i)) {
1379
+ newArray.push(array[i]);
1380
+ }
1381
+ }
1382
+ return newArray;
1371
1383
  }
1372
1384
  function insertItemsAtIndex(array, items, index) {
1373
1385
  const newArray = [...array];
@@ -16082,8 +16094,9 @@ function interactiveSort(env, sheetId, anchor, zone, sortDirection, sortOptions)
16082
16094
  }
16083
16095
 
16084
16096
  function sortMatrix(matrix, locale, ...criteria) {
16085
- for (const [i, value] of criteria.entries()) {
16086
- assert(value !== undefined, _t("Value for parameter %d is missing, while the function [[FUNCTION_NAME]] expect a number or a range.", i + 1));
16097
+ for (let i = 0; i < criteria.length; i++) {
16098
+ const param = i % 2 === 0 ? "sort_column" : "is_ascending";
16099
+ assert(criteria[i] !== undefined, _t("Value for parameter %s is missing in [[FUNCTION_NAME]].", param));
16087
16100
  }
16088
16101
  const sortingOrders = [];
16089
16102
  const sortColumns = [];
@@ -26758,7 +26771,7 @@ function getRadarChartScales(definition, args) {
26758
26771
  },
26759
26772
  pointLabels: {
26760
26773
  color: chartFontColor(definition.background),
26761
- callback: truncateLabel,
26774
+ callback: (label) => truncateLabel(label),
26762
26775
  },
26763
26776
  suggestedMin: minValue < 0 ? minValue - 1 : 0,
26764
26777
  },
@@ -32378,7 +32391,11 @@ class CarouselFigure extends Component {
32378
32391
  onFigureDeleted: Function,
32379
32392
  editFigureStyle: { type: Function, optional: true },
32380
32393
  };
32381
- static components = { ChartDashboardMenu };
32394
+ static components = { ChartDashboardMenu, MenuPopover };
32395
+ carouselTabsRef = useRef("carouselTabs");
32396
+ carouselTabsDropdownRef = useRef("carouselTabsDropdown");
32397
+ menuState = useState({ isOpen: false, anchorRect: null, menuItems: [] });
32398
+ hiddenItems = [];
32382
32399
  animationStore;
32383
32400
  setup() {
32384
32401
  this.animationStore = useStore(ChartAnimationStore);
@@ -32389,6 +32406,7 @@ class CarouselFigure extends Component {
32389
32406
  else {
32390
32407
  this.props.editFigureStyle?.({ "pointer-events": "auto" });
32391
32408
  }
32409
+ this.updateTabsVisibility();
32392
32410
  });
32393
32411
  }
32394
32412
  get carousel() {
@@ -32432,13 +32450,13 @@ class CarouselFigure extends Component {
32432
32450
  }
32433
32451
  get headerStyle() {
32434
32452
  const cssProperties = {};
32435
- if (this.selectedCarouselItem?.type === "carouselDataView") {
32436
- cssProperties["background-color"] = "#ffffff";
32437
- }
32438
- else if (this.selectedCarouselItem?.type === "chart") {
32453
+ if (this.selectedCarouselItem?.type === "chart") {
32439
32454
  const chart = this.env.model.getters.getChartRuntime(this.selectedCarouselItem.chartId);
32440
32455
  cssProperties["background-color"] = chart.background;
32441
32456
  }
32457
+ else {
32458
+ cssProperties["background-color"] = "#ffffff";
32459
+ }
32442
32460
  return cssPropertiesToCss(cssProperties);
32443
32461
  }
32444
32462
  get title() {
@@ -32448,6 +32466,49 @@ class CarouselFigure extends Component {
32448
32466
  const style = { ...DEFAULT_CAROUSEL_TITLE_STYLE, ...this.carousel.title };
32449
32467
  return cssPropertiesToCss(cellTextStyleToCss(chartStyleToCellStyle(style)));
32450
32468
  }
32469
+ updateTabsVisibility() {
32470
+ const tabsContainerEl = this.carouselTabsRef.el;
32471
+ const dropDownEl = this.carouselTabsDropdownRef.el;
32472
+ if (!tabsContainerEl || !dropDownEl) {
32473
+ return;
32474
+ }
32475
+ this.hiddenItems = [];
32476
+ const containerRect = getBoundingRectAsPOJO(tabsContainerEl);
32477
+ const tabs = Array.from(tabsContainerEl.children);
32478
+ for (const tab of tabs) {
32479
+ tab.style.display = "block";
32480
+ }
32481
+ const tabWidths = tabs.map((tab) => getBoundingRectAsPOJO(tab).width);
32482
+ let currentWidth = 0;
32483
+ for (let i = 0; i < tabs.length; i++) {
32484
+ const shouldBeHidden = currentWidth + tabWidths[i] > containerRect.width;
32485
+ currentWidth += tabWidths[i];
32486
+ if (shouldBeHidden) {
32487
+ tabs[i].style.display = "none";
32488
+ this.hiddenItems.push(this.carousel.items[i]);
32489
+ }
32490
+ }
32491
+ dropDownEl.style.display = this.hiddenItems.length ? "block" : "none";
32492
+ }
32493
+ get menuId() {
32494
+ return "carousel-tabs-menu-";
32495
+ }
32496
+ toggleMenu(ev) {
32497
+ if (ev.closedMenuId === this.menuId) {
32498
+ this.menuState.isOpen = false;
32499
+ return;
32500
+ }
32501
+ const rect = getRefBoundingRect(this.carouselTabsDropdownRef);
32502
+ const menuItems = this.hiddenItems.map((item) => ({
32503
+ name: this.getItemTitle(item),
32504
+ execute: () => this.onCarouselTabClick(item),
32505
+ isActive: () => this.isItemSelected(item),
32506
+ isReadonlyAllowed: true,
32507
+ }));
32508
+ this.menuState.isOpen = true;
32509
+ this.menuState.anchorRect = rect;
32510
+ this.menuState.menuItems = createActions(menuItems);
32511
+ }
32451
32512
  }
32452
32513
 
32453
32514
  class ChartFigure extends Component {
@@ -50435,9 +50496,16 @@ class FiguresContainer extends Component {
50435
50496
  maxX: this.env.model.getters.getColDimensions(sheetId, this.env.model.getters.getNumberCols(sheetId) - 1).end,
50436
50497
  maxY: this.env.model.getters.getRowDimensions(sheetId, this.env.model.getters.getNumberRows(sheetId) - 1).end,
50437
50498
  };
50499
+ let hasStartedDnd = false;
50438
50500
  const onMouseMove = (ev) => {
50439
50501
  const getters = this.env.model.getters;
50440
50502
  const currentMousePosition = { x: ev.clientX, y: ev.clientY };
50503
+ const offsetX = Math.abs(currentMousePosition.x - initialMousePosition.x);
50504
+ const offsetY = Math.abs(currentMousePosition.y - initialMousePosition.y);
50505
+ if (!hasStartedDnd && offsetX < DRAG_THRESHOLD && offsetY < DRAG_THRESHOLD) {
50506
+ return; // add a small threshold to avoid dnd when just clicking
50507
+ }
50508
+ hasStartedDnd = true;
50441
50509
  const draggedFigure = dragFigureForMove(currentMousePosition, initialMousePosition, initialFigure, maxDimensions, initialScrollPosition, getters.getActiveSheetScrollInfo());
50442
50510
  const otherFigures = this.getOtherFigures(initialFigure.id);
50443
50511
  const overlappingCarousel = this.getCarouselOverlappingChart(draggedFigure, otherFigures);
@@ -58849,12 +58917,13 @@ class PivotLayoutConfigurator extends Component {
58849
58917
  addCalculatedMeasure() {
58850
58918
  const { measures } = this.props.definition;
58851
58919
  const measureName = this.env.model.getters.generateNewCalculatedMeasureName(measures);
58920
+ const aggregator = "sum";
58852
58921
  this.props.onDimensionsUpdated({
58853
58922
  measures: measures.concat([
58854
58923
  {
58855
- id: this.getMeasureId(measureName),
58924
+ id: this.getMeasureId(measureName, aggregator),
58856
58925
  fieldName: measureName,
58857
- aggregator: "sum",
58926
+ aggregator,
58858
58927
  computedBy: {
58859
58928
  sheetId: this.env.model.getters.getActiveSheetId(),
58860
58929
  formula: "=0",
@@ -71159,7 +71228,7 @@ function withPivotPresentationLayer (PivotClass) {
71159
71228
  return { value: 0 };
71160
71229
  }
71161
71230
  const { columns, rows } = super.definition;
71162
- if (columns.length + rows.length !== domain.length) {
71231
+ if (measure.aggregator && columns.length + rows.length !== domain.length) {
71163
71232
  const values = this.getValuesToAggregate(measure, domain);
71164
71233
  const aggregator = AGGREGATORS_FN[measure.aggregator];
71165
71234
  if (!aggregator) {
@@ -71178,11 +71247,17 @@ function withPivotPresentationLayer (PivotClass) {
71178
71247
  if (columns.find((col) => col.nameWithGranularity === symbolName)) {
71179
71248
  const { colDomain } = domainToColRowDomain(this, domain);
71180
71249
  const symbolIndex = colDomain.findIndex((node) => node.field === symbolName);
71250
+ if (symbolIndex === -1) {
71251
+ return new NotAvailableError();
71252
+ }
71181
71253
  return this.getPivotHeaderValueAndFormat(colDomain.slice(0, symbolIndex + 1));
71182
71254
  }
71183
71255
  if (rows.find((row) => row.nameWithGranularity === symbolName)) {
71184
71256
  const { rowDomain } = domainToColRowDomain(this, domain);
71185
71257
  const symbolIndex = rowDomain.findIndex((row) => row.field === symbolName);
71258
+ if (symbolIndex === -1) {
71259
+ return new NotAvailableError();
71260
+ }
71186
71261
  return this.getPivotHeaderValueAndFormat(rowDomain.slice(0, symbolIndex + 1));
71187
71262
  }
71188
71263
  return this.getPivotCellValueAndFormat(symbolName, domain);
@@ -74848,7 +74923,10 @@ class SortPlugin extends UIPlugin {
74848
74923
  return "Success" /* CommandResult.Success */;
74849
74924
  }
74850
74925
  checkArrayFormulaInSortZone({ sheetId, zone }) {
74851
- const arrayFormulaInZone = positions(zone).some(({ col, row }) => this.getters.getArrayFormulaSpreadingOn({ sheetId, col, row }));
74926
+ const arrayFormulaInZone = positions(zone).some(({ col, row }) => {
74927
+ const originPosition = this.getters.getArrayFormulaSpreadingOn({ sheetId, col, row });
74928
+ return originPosition && !deepEquals(originPosition, { sheetId, col, row });
74929
+ });
74852
74930
  return arrayFormulaInZone ? "SortZoneWithArrayFormulas" /* CommandResult.SortZoneWithArrayFormulas */ : "Success" /* CommandResult.Success */;
74853
74931
  }
74854
74932
  /**
@@ -77561,13 +77639,10 @@ class GridSelectionPlugin extends UIPlugin {
77561
77639
  const deltaCol = isBasedBefore && isCol ? thickness : 0;
77562
77640
  const deltaRow = isBasedBefore && !isCol ? thickness : 0;
77563
77641
  const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
77564
- const originalSize = Object.fromEntries(toRemove.map((element) => {
77565
- const size = isCol
77566
- ? this.getters.getColSize(cmd.sheetId, element)
77567
- : this.getters.getUserRowSize(cmd.sheetId, element);
77568
- const isDefaultCol = isCol && size === DEFAULT_CELL_WIDTH;
77569
- return [element, isDefaultCol ? undefined : size];
77570
- }));
77642
+ const originalSize = {};
77643
+ for (const element of toRemove) {
77644
+ originalSize[element] = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, element);
77645
+ }
77571
77646
  const target = [
77572
77647
  {
77573
77648
  left: isCol ? start + deltaCol : 0,
@@ -77611,11 +77686,11 @@ class GridSelectionPlugin extends UIPlugin {
77611
77686
  for (const element of toRemove) {
77612
77687
  const size = originalSize[element];
77613
77688
  const currentSize = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, currentIndex);
77614
- if (size && size !== currentSize) {
77689
+ if (size !== currentSize) {
77615
77690
  resizingGroups[size] ??= [];
77616
77691
  resizingGroups[size].push(currentIndex);
77617
- currentIndex += 1;
77618
77692
  }
77693
+ currentIndex += 1;
77619
77694
  }
77620
77695
  for (const size in resizingGroups) {
77621
77696
  this.dispatch("RESIZE_COLUMNS_ROWS", {
@@ -88405,6 +88480,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
88405
88480
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, ClientDisconnectedError, CommandResult, CorePlugin, CoreViewPlugin, DispatchResult, EvaluationError, LocalTransportService, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, chartHelpers, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, getCaretDownSvg, getCaretUpSvg, helpers, hooks, invalidateCFEvaluationCommands, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
88406
88481
 
88407
88482
 
88408
- __info__.version = "19.0.1";
88409
- __info__.date = "2025-09-11T08:45:47.109Z";
88410
- __info__.hash = "bd79eea";
88483
+ __info__.version = "19.0.4";
88484
+ __info__.date = "2025-09-23T12:37:28.362Z";
88485
+ __info__.hash = "87b774d";