@odoo/o-spreadsheet 19.0.1 → 19.1.0-alpha.1

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.1.0-alpha.1
6
+ * @date 2025-09-12T13:33:41.605Z
7
+ * @hash d3e4e7b
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
@@ -32380,7 +32381,11 @@ class CarouselFigure extends owl.Component {
32380
32381
  onFigureDeleted: Function,
32381
32382
  editFigureStyle: { type: Function, optional: true },
32382
32383
  };
32383
- static components = { ChartDashboardMenu };
32384
+ static components = { ChartDashboardMenu, MenuPopover };
32385
+ carouselTabsRef = owl.useRef("carouselTabs");
32386
+ carouselTabsDropdownRef = owl.useRef("carouselTabsDropdown");
32387
+ menuState = owl.useState({ isOpen: false, anchorRect: null, menuItems: [] });
32388
+ hiddenItems = [];
32384
32389
  animationStore;
32385
32390
  setup() {
32386
32391
  this.animationStore = useStore(ChartAnimationStore);
@@ -32391,6 +32396,7 @@ class CarouselFigure extends owl.Component {
32391
32396
  else {
32392
32397
  this.props.editFigureStyle?.({ "pointer-events": "auto" });
32393
32398
  }
32399
+ this.updateTabsVisibility();
32394
32400
  });
32395
32401
  }
32396
32402
  get carousel() {
@@ -32450,6 +32456,49 @@ class CarouselFigure extends owl.Component {
32450
32456
  const style = { ...DEFAULT_CAROUSEL_TITLE_STYLE, ...this.carousel.title };
32451
32457
  return cssPropertiesToCss(cellTextStyleToCss(chartStyleToCellStyle(style)));
32452
32458
  }
32459
+ updateTabsVisibility() {
32460
+ const tabsContainerEl = this.carouselTabsRef.el;
32461
+ const dropDownEl = this.carouselTabsDropdownRef.el;
32462
+ if (!tabsContainerEl || !dropDownEl) {
32463
+ return;
32464
+ }
32465
+ this.hiddenItems = [];
32466
+ const containerRect = getBoundingRectAsPOJO(tabsContainerEl);
32467
+ const tabs = Array.from(tabsContainerEl.children);
32468
+ for (const tab of tabs) {
32469
+ tab.style.display = "block";
32470
+ }
32471
+ const tabWidths = tabs.map((tab) => getBoundingRectAsPOJO(tab).width);
32472
+ let currentWidth = 0;
32473
+ for (let i = 0; i < tabs.length; i++) {
32474
+ const shouldBeHidden = currentWidth + tabWidths[i] > containerRect.width;
32475
+ currentWidth += tabWidths[i];
32476
+ if (shouldBeHidden) {
32477
+ tabs[i].style.display = "none";
32478
+ this.hiddenItems.push(this.carousel.items[i]);
32479
+ }
32480
+ }
32481
+ dropDownEl.style.display = this.hiddenItems.length ? "block" : "none";
32482
+ }
32483
+ get menuId() {
32484
+ return "carousel-tabs-menu-";
32485
+ }
32486
+ toggleMenu(ev) {
32487
+ if (ev.closedMenuId === this.menuId) {
32488
+ this.menuState.isOpen = false;
32489
+ return;
32490
+ }
32491
+ const rect = getRefBoundingRect(this.carouselTabsDropdownRef);
32492
+ const menuItems = this.hiddenItems.map((item) => ({
32493
+ name: this.getItemTitle(item),
32494
+ execute: () => this.onCarouselTabClick(item),
32495
+ isActive: () => this.isItemSelected(item),
32496
+ isReadonlyAllowed: true,
32497
+ }));
32498
+ this.menuState.isOpen = true;
32499
+ this.menuState.anchorRect = rect;
32500
+ this.menuState.menuItems = createActions(menuItems);
32501
+ }
32453
32502
  }
32454
32503
 
32455
32504
  class ChartFigure extends owl.Component {
@@ -50437,9 +50486,16 @@ class FiguresContainer extends owl.Component {
50437
50486
  maxX: this.env.model.getters.getColDimensions(sheetId, this.env.model.getters.getNumberCols(sheetId) - 1).end,
50438
50487
  maxY: this.env.model.getters.getRowDimensions(sheetId, this.env.model.getters.getNumberRows(sheetId) - 1).end,
50439
50488
  };
50489
+ let hasStartedDnd = false;
50440
50490
  const onMouseMove = (ev) => {
50441
50491
  const getters = this.env.model.getters;
50442
50492
  const currentMousePosition = { x: ev.clientX, y: ev.clientY };
50493
+ const offsetX = Math.abs(currentMousePosition.x - initialMousePosition.x);
50494
+ const offsetY = Math.abs(currentMousePosition.y - initialMousePosition.y);
50495
+ if (!hasStartedDnd && offsetX < DRAG_THRESHOLD && offsetY < DRAG_THRESHOLD) {
50496
+ return; // add a small threshold to avoid dnd when just clicking
50497
+ }
50498
+ hasStartedDnd = true;
50443
50499
  const draggedFigure = dragFigureForMove(currentMousePosition, initialMousePosition, initialFigure, maxDimensions, initialScrollPosition, getters.getActiveSheetScrollInfo());
50444
50500
  const otherFigures = this.getOtherFigures(initialFigure.id);
50445
50501
  const overlappingCarousel = this.getCarouselOverlappingChart(draggedFigure, otherFigures);
@@ -58851,12 +58907,13 @@ class PivotLayoutConfigurator extends owl.Component {
58851
58907
  addCalculatedMeasure() {
58852
58908
  const { measures } = this.props.definition;
58853
58909
  const measureName = this.env.model.getters.generateNewCalculatedMeasureName(measures);
58910
+ const aggregator = "sum";
58854
58911
  this.props.onDimensionsUpdated({
58855
58912
  measures: measures.concat([
58856
58913
  {
58857
- id: this.getMeasureId(measureName),
58914
+ id: this.getMeasureId(measureName, aggregator),
58858
58915
  fieldName: measureName,
58859
- aggregator: "sum",
58916
+ aggregator,
58860
58917
  computedBy: {
58861
58918
  sheetId: this.env.model.getters.getActiveSheetId(),
58862
58919
  formula: "=0",
@@ -71161,7 +71218,7 @@ function withPivotPresentationLayer (PivotClass) {
71161
71218
  return { value: 0 };
71162
71219
  }
71163
71220
  const { columns, rows } = super.definition;
71164
- if (columns.length + rows.length !== domain.length) {
71221
+ if (measure.aggregator && columns.length + rows.length !== domain.length) {
71165
71222
  const values = this.getValuesToAggregate(measure, domain);
71166
71223
  const aggregator = AGGREGATORS_FN[measure.aggregator];
71167
71224
  if (!aggregator) {
@@ -71180,11 +71237,17 @@ function withPivotPresentationLayer (PivotClass) {
71180
71237
  if (columns.find((col) => col.nameWithGranularity === symbolName)) {
71181
71238
  const { colDomain } = domainToColRowDomain(this, domain);
71182
71239
  const symbolIndex = colDomain.findIndex((node) => node.field === symbolName);
71240
+ if (symbolIndex === -1) {
71241
+ return new NotAvailableError();
71242
+ }
71183
71243
  return this.getPivotHeaderValueAndFormat(colDomain.slice(0, symbolIndex + 1));
71184
71244
  }
71185
71245
  if (rows.find((row) => row.nameWithGranularity === symbolName)) {
71186
71246
  const { rowDomain } = domainToColRowDomain(this, domain);
71187
71247
  const symbolIndex = rowDomain.findIndex((row) => row.field === symbolName);
71248
+ if (symbolIndex === -1) {
71249
+ return new NotAvailableError();
71250
+ }
71188
71251
  return this.getPivotHeaderValueAndFormat(rowDomain.slice(0, symbolIndex + 1));
71189
71252
  }
71190
71253
  return this.getPivotCellValueAndFormat(symbolName, domain);
@@ -88457,6 +88520,6 @@ exports.tokenColors = tokenColors;
88457
88520
  exports.tokenize = tokenize;
88458
88521
 
88459
88522
 
88460
- __info__.version = "19.0.1";
88461
- __info__.date = "2025-09-11T08:45:47.109Z";
88462
- __info__.hash = "bd79eea";
88523
+ __info__.version = "19.1.0-alpha.1";
88524
+ __info__.date = "2025-09-12T13:33:41.605Z";
88525
+ __info__.hash = "d3e4e7b";
@@ -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.1.0-alpha.1
6
+ * @date 2025-09-12T13:33:41.605Z
7
+ * @hash d3e4e7b
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
@@ -32378,7 +32379,11 @@ class CarouselFigure extends Component {
32378
32379
  onFigureDeleted: Function,
32379
32380
  editFigureStyle: { type: Function, optional: true },
32380
32381
  };
32381
- static components = { ChartDashboardMenu };
32382
+ static components = { ChartDashboardMenu, MenuPopover };
32383
+ carouselTabsRef = useRef("carouselTabs");
32384
+ carouselTabsDropdownRef = useRef("carouselTabsDropdown");
32385
+ menuState = useState({ isOpen: false, anchorRect: null, menuItems: [] });
32386
+ hiddenItems = [];
32382
32387
  animationStore;
32383
32388
  setup() {
32384
32389
  this.animationStore = useStore(ChartAnimationStore);
@@ -32389,6 +32394,7 @@ class CarouselFigure extends Component {
32389
32394
  else {
32390
32395
  this.props.editFigureStyle?.({ "pointer-events": "auto" });
32391
32396
  }
32397
+ this.updateTabsVisibility();
32392
32398
  });
32393
32399
  }
32394
32400
  get carousel() {
@@ -32448,6 +32454,49 @@ class CarouselFigure extends Component {
32448
32454
  const style = { ...DEFAULT_CAROUSEL_TITLE_STYLE, ...this.carousel.title };
32449
32455
  return cssPropertiesToCss(cellTextStyleToCss(chartStyleToCellStyle(style)));
32450
32456
  }
32457
+ updateTabsVisibility() {
32458
+ const tabsContainerEl = this.carouselTabsRef.el;
32459
+ const dropDownEl = this.carouselTabsDropdownRef.el;
32460
+ if (!tabsContainerEl || !dropDownEl) {
32461
+ return;
32462
+ }
32463
+ this.hiddenItems = [];
32464
+ const containerRect = getBoundingRectAsPOJO(tabsContainerEl);
32465
+ const tabs = Array.from(tabsContainerEl.children);
32466
+ for (const tab of tabs) {
32467
+ tab.style.display = "block";
32468
+ }
32469
+ const tabWidths = tabs.map((tab) => getBoundingRectAsPOJO(tab).width);
32470
+ let currentWidth = 0;
32471
+ for (let i = 0; i < tabs.length; i++) {
32472
+ const shouldBeHidden = currentWidth + tabWidths[i] > containerRect.width;
32473
+ currentWidth += tabWidths[i];
32474
+ if (shouldBeHidden) {
32475
+ tabs[i].style.display = "none";
32476
+ this.hiddenItems.push(this.carousel.items[i]);
32477
+ }
32478
+ }
32479
+ dropDownEl.style.display = this.hiddenItems.length ? "block" : "none";
32480
+ }
32481
+ get menuId() {
32482
+ return "carousel-tabs-menu-";
32483
+ }
32484
+ toggleMenu(ev) {
32485
+ if (ev.closedMenuId === this.menuId) {
32486
+ this.menuState.isOpen = false;
32487
+ return;
32488
+ }
32489
+ const rect = getRefBoundingRect(this.carouselTabsDropdownRef);
32490
+ const menuItems = this.hiddenItems.map((item) => ({
32491
+ name: this.getItemTitle(item),
32492
+ execute: () => this.onCarouselTabClick(item),
32493
+ isActive: () => this.isItemSelected(item),
32494
+ isReadonlyAllowed: true,
32495
+ }));
32496
+ this.menuState.isOpen = true;
32497
+ this.menuState.anchorRect = rect;
32498
+ this.menuState.menuItems = createActions(menuItems);
32499
+ }
32451
32500
  }
32452
32501
 
32453
32502
  class ChartFigure extends Component {
@@ -50435,9 +50484,16 @@ class FiguresContainer extends Component {
50435
50484
  maxX: this.env.model.getters.getColDimensions(sheetId, this.env.model.getters.getNumberCols(sheetId) - 1).end,
50436
50485
  maxY: this.env.model.getters.getRowDimensions(sheetId, this.env.model.getters.getNumberRows(sheetId) - 1).end,
50437
50486
  };
50487
+ let hasStartedDnd = false;
50438
50488
  const onMouseMove = (ev) => {
50439
50489
  const getters = this.env.model.getters;
50440
50490
  const currentMousePosition = { x: ev.clientX, y: ev.clientY };
50491
+ const offsetX = Math.abs(currentMousePosition.x - initialMousePosition.x);
50492
+ const offsetY = Math.abs(currentMousePosition.y - initialMousePosition.y);
50493
+ if (!hasStartedDnd && offsetX < DRAG_THRESHOLD && offsetY < DRAG_THRESHOLD) {
50494
+ return; // add a small threshold to avoid dnd when just clicking
50495
+ }
50496
+ hasStartedDnd = true;
50441
50497
  const draggedFigure = dragFigureForMove(currentMousePosition, initialMousePosition, initialFigure, maxDimensions, initialScrollPosition, getters.getActiveSheetScrollInfo());
50442
50498
  const otherFigures = this.getOtherFigures(initialFigure.id);
50443
50499
  const overlappingCarousel = this.getCarouselOverlappingChart(draggedFigure, otherFigures);
@@ -58849,12 +58905,13 @@ class PivotLayoutConfigurator extends Component {
58849
58905
  addCalculatedMeasure() {
58850
58906
  const { measures } = this.props.definition;
58851
58907
  const measureName = this.env.model.getters.generateNewCalculatedMeasureName(measures);
58908
+ const aggregator = "sum";
58852
58909
  this.props.onDimensionsUpdated({
58853
58910
  measures: measures.concat([
58854
58911
  {
58855
- id: this.getMeasureId(measureName),
58912
+ id: this.getMeasureId(measureName, aggregator),
58856
58913
  fieldName: measureName,
58857
- aggregator: "sum",
58914
+ aggregator,
58858
58915
  computedBy: {
58859
58916
  sheetId: this.env.model.getters.getActiveSheetId(),
58860
58917
  formula: "=0",
@@ -71159,7 +71216,7 @@ function withPivotPresentationLayer (PivotClass) {
71159
71216
  return { value: 0 };
71160
71217
  }
71161
71218
  const { columns, rows } = super.definition;
71162
- if (columns.length + rows.length !== domain.length) {
71219
+ if (measure.aggregator && columns.length + rows.length !== domain.length) {
71163
71220
  const values = this.getValuesToAggregate(measure, domain);
71164
71221
  const aggregator = AGGREGATORS_FN[measure.aggregator];
71165
71222
  if (!aggregator) {
@@ -71178,11 +71235,17 @@ function withPivotPresentationLayer (PivotClass) {
71178
71235
  if (columns.find((col) => col.nameWithGranularity === symbolName)) {
71179
71236
  const { colDomain } = domainToColRowDomain(this, domain);
71180
71237
  const symbolIndex = colDomain.findIndex((node) => node.field === symbolName);
71238
+ if (symbolIndex === -1) {
71239
+ return new NotAvailableError();
71240
+ }
71181
71241
  return this.getPivotHeaderValueAndFormat(colDomain.slice(0, symbolIndex + 1));
71182
71242
  }
71183
71243
  if (rows.find((row) => row.nameWithGranularity === symbolName)) {
71184
71244
  const { rowDomain } = domainToColRowDomain(this, domain);
71185
71245
  const symbolIndex = rowDomain.findIndex((row) => row.field === symbolName);
71246
+ if (symbolIndex === -1) {
71247
+ return new NotAvailableError();
71248
+ }
71186
71249
  return this.getPivotHeaderValueAndFormat(rowDomain.slice(0, symbolIndex + 1));
71187
71250
  }
71188
71251
  return this.getPivotCellValueAndFormat(symbolName, domain);
@@ -88405,6 +88468,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
88405
88468
  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
88469
 
88407
88470
 
88408
- __info__.version = "19.0.1";
88409
- __info__.date = "2025-09-11T08:45:47.109Z";
88410
- __info__.hash = "bd79eea";
88471
+ __info__.version = "19.1.0-alpha.1";
88472
+ __info__.date = "2025-09-12T13:33:41.605Z";
88473
+ __info__.hash = "d3e4e7b";
@@ -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.1.0-alpha.1
6
+ * @date 2025-09-12T13:33:41.605Z
7
+ * @hash d3e4e7b
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -889,6 +889,7 @@
889
889
  ARG_SEPARATOR: functionColor,
890
890
  ORPHAN_RIGHT_PAREN: "#ff0000",
891
891
  };
892
+ const DRAG_THRESHOLD = 5; // in pixels, to avoid unwanted drag when clicking
892
893
 
893
894
  //------------------------------------------------------------------------------
894
895
  // Miscellaneous
@@ -32379,7 +32380,11 @@ stores.inject(MyMetaStore, storeInstance);
32379
32380
  onFigureDeleted: Function,
32380
32381
  editFigureStyle: { type: Function, optional: true },
32381
32382
  };
32382
- static components = { ChartDashboardMenu };
32383
+ static components = { ChartDashboardMenu, MenuPopover };
32384
+ carouselTabsRef = owl.useRef("carouselTabs");
32385
+ carouselTabsDropdownRef = owl.useRef("carouselTabsDropdown");
32386
+ menuState = owl.useState({ isOpen: false, anchorRect: null, menuItems: [] });
32387
+ hiddenItems = [];
32383
32388
  animationStore;
32384
32389
  setup() {
32385
32390
  this.animationStore = useStore(ChartAnimationStore);
@@ -32390,6 +32395,7 @@ stores.inject(MyMetaStore, storeInstance);
32390
32395
  else {
32391
32396
  this.props.editFigureStyle?.({ "pointer-events": "auto" });
32392
32397
  }
32398
+ this.updateTabsVisibility();
32393
32399
  });
32394
32400
  }
32395
32401
  get carousel() {
@@ -32449,6 +32455,49 @@ stores.inject(MyMetaStore, storeInstance);
32449
32455
  const style = { ...DEFAULT_CAROUSEL_TITLE_STYLE, ...this.carousel.title };
32450
32456
  return cssPropertiesToCss(cellTextStyleToCss(chartStyleToCellStyle(style)));
32451
32457
  }
32458
+ updateTabsVisibility() {
32459
+ const tabsContainerEl = this.carouselTabsRef.el;
32460
+ const dropDownEl = this.carouselTabsDropdownRef.el;
32461
+ if (!tabsContainerEl || !dropDownEl) {
32462
+ return;
32463
+ }
32464
+ this.hiddenItems = [];
32465
+ const containerRect = getBoundingRectAsPOJO(tabsContainerEl);
32466
+ const tabs = Array.from(tabsContainerEl.children);
32467
+ for (const tab of tabs) {
32468
+ tab.style.display = "block";
32469
+ }
32470
+ const tabWidths = tabs.map((tab) => getBoundingRectAsPOJO(tab).width);
32471
+ let currentWidth = 0;
32472
+ for (let i = 0; i < tabs.length; i++) {
32473
+ const shouldBeHidden = currentWidth + tabWidths[i] > containerRect.width;
32474
+ currentWidth += tabWidths[i];
32475
+ if (shouldBeHidden) {
32476
+ tabs[i].style.display = "none";
32477
+ this.hiddenItems.push(this.carousel.items[i]);
32478
+ }
32479
+ }
32480
+ dropDownEl.style.display = this.hiddenItems.length ? "block" : "none";
32481
+ }
32482
+ get menuId() {
32483
+ return "carousel-tabs-menu-";
32484
+ }
32485
+ toggleMenu(ev) {
32486
+ if (ev.closedMenuId === this.menuId) {
32487
+ this.menuState.isOpen = false;
32488
+ return;
32489
+ }
32490
+ const rect = getRefBoundingRect(this.carouselTabsDropdownRef);
32491
+ const menuItems = this.hiddenItems.map((item) => ({
32492
+ name: this.getItemTitle(item),
32493
+ execute: () => this.onCarouselTabClick(item),
32494
+ isActive: () => this.isItemSelected(item),
32495
+ isReadonlyAllowed: true,
32496
+ }));
32497
+ this.menuState.isOpen = true;
32498
+ this.menuState.anchorRect = rect;
32499
+ this.menuState.menuItems = createActions(menuItems);
32500
+ }
32452
32501
  }
32453
32502
 
32454
32503
  class ChartFigure extends owl.Component {
@@ -50436,9 +50485,16 @@ stores.inject(MyMetaStore, storeInstance);
50436
50485
  maxX: this.env.model.getters.getColDimensions(sheetId, this.env.model.getters.getNumberCols(sheetId) - 1).end,
50437
50486
  maxY: this.env.model.getters.getRowDimensions(sheetId, this.env.model.getters.getNumberRows(sheetId) - 1).end,
50438
50487
  };
50488
+ let hasStartedDnd = false;
50439
50489
  const onMouseMove = (ev) => {
50440
50490
  const getters = this.env.model.getters;
50441
50491
  const currentMousePosition = { x: ev.clientX, y: ev.clientY };
50492
+ const offsetX = Math.abs(currentMousePosition.x - initialMousePosition.x);
50493
+ const offsetY = Math.abs(currentMousePosition.y - initialMousePosition.y);
50494
+ if (!hasStartedDnd && offsetX < DRAG_THRESHOLD && offsetY < DRAG_THRESHOLD) {
50495
+ return; // add a small threshold to avoid dnd when just clicking
50496
+ }
50497
+ hasStartedDnd = true;
50442
50498
  const draggedFigure = dragFigureForMove(currentMousePosition, initialMousePosition, initialFigure, maxDimensions, initialScrollPosition, getters.getActiveSheetScrollInfo());
50443
50499
  const otherFigures = this.getOtherFigures(initialFigure.id);
50444
50500
  const overlappingCarousel = this.getCarouselOverlappingChart(draggedFigure, otherFigures);
@@ -58850,12 +58906,13 @@ stores.inject(MyMetaStore, storeInstance);
58850
58906
  addCalculatedMeasure() {
58851
58907
  const { measures } = this.props.definition;
58852
58908
  const measureName = this.env.model.getters.generateNewCalculatedMeasureName(measures);
58909
+ const aggregator = "sum";
58853
58910
  this.props.onDimensionsUpdated({
58854
58911
  measures: measures.concat([
58855
58912
  {
58856
- id: this.getMeasureId(measureName),
58913
+ id: this.getMeasureId(measureName, aggregator),
58857
58914
  fieldName: measureName,
58858
- aggregator: "sum",
58915
+ aggregator,
58859
58916
  computedBy: {
58860
58917
  sheetId: this.env.model.getters.getActiveSheetId(),
58861
58918
  formula: "=0",
@@ -71160,7 +71217,7 @@ stores.inject(MyMetaStore, storeInstance);
71160
71217
  return { value: 0 };
71161
71218
  }
71162
71219
  const { columns, rows } = super.definition;
71163
- if (columns.length + rows.length !== domain.length) {
71220
+ if (measure.aggregator && columns.length + rows.length !== domain.length) {
71164
71221
  const values = this.getValuesToAggregate(measure, domain);
71165
71222
  const aggregator = AGGREGATORS_FN[measure.aggregator];
71166
71223
  if (!aggregator) {
@@ -71179,11 +71236,17 @@ stores.inject(MyMetaStore, storeInstance);
71179
71236
  if (columns.find((col) => col.nameWithGranularity === symbolName)) {
71180
71237
  const { colDomain } = domainToColRowDomain(this, domain);
71181
71238
  const symbolIndex = colDomain.findIndex((node) => node.field === symbolName);
71239
+ if (symbolIndex === -1) {
71240
+ return new NotAvailableError();
71241
+ }
71182
71242
  return this.getPivotHeaderValueAndFormat(colDomain.slice(0, symbolIndex + 1));
71183
71243
  }
71184
71244
  if (rows.find((row) => row.nameWithGranularity === symbolName)) {
71185
71245
  const { rowDomain } = domainToColRowDomain(this, domain);
71186
71246
  const symbolIndex = rowDomain.findIndex((row) => row.field === symbolName);
71247
+ if (symbolIndex === -1) {
71248
+ return new NotAvailableError();
71249
+ }
71187
71250
  return this.getPivotHeaderValueAndFormat(rowDomain.slice(0, symbolIndex + 1));
71188
71251
  }
71189
71252
  return this.getPivotCellValueAndFormat(symbolName, domain);
@@ -88456,9 +88519,9 @@ stores.inject(MyMetaStore, storeInstance);
88456
88519
  exports.tokenize = tokenize;
88457
88520
 
88458
88521
 
88459
- __info__.version = "19.0.1";
88460
- __info__.date = "2025-09-11T08:45:47.109Z";
88461
- __info__.hash = "bd79eea";
88522
+ __info__.version = "19.1.0-alpha.1";
88523
+ __info__.date = "2025-09-12T13:33:41.605Z";
88524
+ __info__.hash = "d3e4e7b";
88462
88525
 
88463
88526
 
88464
88527
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);