@odoo/o-spreadsheet 19.1.0-alpha.0 → 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.
- package/dist/o-spreadsheet.cjs.js +154 -44
- package/dist/o-spreadsheet.d.ts +22 -6
- package/dist/o-spreadsheet.esm.js +153 -45
- package/dist/o-spreadsheet.iife.js +154 -44
- package/dist/o-spreadsheet.iife.min.js +233 -233
- package/dist/o_spreadsheet.xml +37 -8
- package/package.json +1 -1
|
@@ -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.1.0-alpha.
|
|
6
|
-
* @date 2025-09-
|
|
7
|
-
* @hash
|
|
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
|
|
@@ -24537,18 +24538,15 @@ function createScorecardChartRuntime(chart, getters) {
|
|
|
24537
24538
|
return {
|
|
24538
24539
|
title: {
|
|
24539
24540
|
...chart.title,
|
|
24540
|
-
|
|
24541
|
-
text: chart.title.text ? _t(chart.title.text) : "",
|
|
24541
|
+
text: chart.title.text ? getters.dynamicTranslate(chart.title.text) : "",
|
|
24542
24542
|
},
|
|
24543
24543
|
keyValue: formattedKeyValue,
|
|
24544
|
-
keyDescr: chart.keyDescr?.text
|
|
24545
|
-
? _t(chart.keyDescr.text) // descriptions are extracted from .json files and they are translated at runtime here
|
|
24546
|
-
: "",
|
|
24544
|
+
keyDescr: chart.keyDescr?.text ? getters.dynamicTranslate(chart.keyDescr.text) : "",
|
|
24547
24545
|
baselineDisplay,
|
|
24548
24546
|
baselineArrow: getBaselineArrowDirection(baselineCell, keyValueCell, chart.baselineMode),
|
|
24549
24547
|
baselineColor: getBaselineColor(baselineCell, chart.baselineMode, keyValueCell, chart.baselineColorUp, chart.baselineColorDown),
|
|
24550
24548
|
baselineDescr: chart.baselineMode !== "progress" && chart.baselineDescr?.text
|
|
24551
|
-
?
|
|
24549
|
+
? getters.dynamicTranslate(chart.baselineDescr.text)
|
|
24552
24550
|
: "",
|
|
24553
24551
|
fontColor,
|
|
24554
24552
|
background,
|
|
@@ -24848,9 +24846,8 @@ class ScorecardChart extends Component {
|
|
|
24848
24846
|
return this.env.model.getters.getChartRuntime(this.props.chartId);
|
|
24849
24847
|
}
|
|
24850
24848
|
get title() {
|
|
24851
|
-
const title = this.env.model.getters.getChartDefinition(this.props.chartId).title.text
|
|
24852
|
-
|
|
24853
|
-
return _t(title);
|
|
24849
|
+
const title = this.env.model.getters.getChartDefinition(this.props.chartId).title.text;
|
|
24850
|
+
return title ? this.env.model.getters.dynamicTranslate(title) : "";
|
|
24854
24851
|
}
|
|
24855
24852
|
setup() {
|
|
24856
24853
|
useEffect(this.createChart.bind(this), () => {
|
|
@@ -27023,12 +27020,12 @@ function getDatasetAxisId(definition, dataset) {
|
|
|
27023
27020
|
return axisId || "y";
|
|
27024
27021
|
}
|
|
27025
27022
|
|
|
27026
|
-
function getChartTitle(definition) {
|
|
27023
|
+
function getChartTitle(definition, getters) {
|
|
27027
27024
|
const chartTitle = definition.title;
|
|
27028
27025
|
const fontColor = chartMutedFontColor(definition.background);
|
|
27029
27026
|
return {
|
|
27030
27027
|
display: !!chartTitle.text,
|
|
27031
|
-
text:
|
|
27028
|
+
text: chartTitle.text ? getters.dynamicTranslate(chartTitle.text) : "",
|
|
27032
27029
|
color: chartTitle?.color ?? fontColor,
|
|
27033
27030
|
align: chartTitle.align === "center" ? "center" : chartTitle.align === "right" ? "end" : "start",
|
|
27034
27031
|
font: {
|
|
@@ -27596,7 +27593,7 @@ function createBarChartRuntime(chart, getters) {
|
|
|
27596
27593
|
layout: getChartLayout(definition, chartData),
|
|
27597
27594
|
scales: getBarChartScales(definition, chartData),
|
|
27598
27595
|
plugins: {
|
|
27599
|
-
title: getChartTitle(definition),
|
|
27596
|
+
title: getChartTitle(definition, getters),
|
|
27600
27597
|
legend: getBarChartLegend(definition),
|
|
27601
27598
|
tooltip: getBarChartTooltip(definition, chartData),
|
|
27602
27599
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -28827,7 +28824,7 @@ function createComboChartRuntime(chart, getters) {
|
|
|
28827
28824
|
layout: getChartLayout(definition, chartData),
|
|
28828
28825
|
scales: getBarChartScales(definition, chartData),
|
|
28829
28826
|
plugins: {
|
|
28830
|
-
title: getChartTitle(definition),
|
|
28827
|
+
title: getChartTitle(definition, getters),
|
|
28831
28828
|
legend: getComboChartLegend(definition),
|
|
28832
28829
|
tooltip: getBarChartTooltip(definition, chartData),
|
|
28833
28830
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -28973,7 +28970,7 @@ function createFunnelChartRuntime(chart, getters) {
|
|
|
28973
28970
|
layout: getChartLayout(definition, chartData),
|
|
28974
28971
|
scales: getFunnelChartScales(definition, chartData),
|
|
28975
28972
|
plugins: {
|
|
28976
|
-
title: getChartTitle(definition),
|
|
28973
|
+
title: getChartTitle(definition, getters),
|
|
28977
28974
|
legend: { display: false },
|
|
28978
28975
|
tooltip: getFunnelChartTooltip(definition, chartData),
|
|
28979
28976
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -29210,8 +29207,7 @@ function createGaugeChartRuntime(chart, getters) {
|
|
|
29210
29207
|
background: getters.getStyleOfSingleCellChart(chart.background, dataRange).background,
|
|
29211
29208
|
title: {
|
|
29212
29209
|
...chart.title,
|
|
29213
|
-
|
|
29214
|
-
text: _t(chart.title.text ?? ""),
|
|
29210
|
+
text: chart.title.text ? getters.dynamicTranslate(chart.title.text) : "",
|
|
29215
29211
|
},
|
|
29216
29212
|
minValue: {
|
|
29217
29213
|
value: minValue,
|
|
@@ -29395,7 +29391,7 @@ function createGeoChartRuntime(chart, getters) {
|
|
|
29395
29391
|
layout: getChartLayout(definition, chartData),
|
|
29396
29392
|
scales: getGeoChartScales(definition, chartData),
|
|
29397
29393
|
plugins: {
|
|
29398
|
-
title: getChartTitle(definition),
|
|
29394
|
+
title: getChartTitle(definition, getters),
|
|
29399
29395
|
tooltip: getGeoChartTooltip(definition, chartData),
|
|
29400
29396
|
legend: { display: false },
|
|
29401
29397
|
},
|
|
@@ -29560,7 +29556,7 @@ function createLineChartRuntime(chart, getters) {
|
|
|
29560
29556
|
layout: getChartLayout(definition, chartData),
|
|
29561
29557
|
scales: getLineChartScales(definition, chartData),
|
|
29562
29558
|
plugins: {
|
|
29563
|
-
title: getChartTitle(definition),
|
|
29559
|
+
title: getChartTitle(definition, getters),
|
|
29564
29560
|
legend: getLineChartLegend(definition),
|
|
29565
29561
|
tooltip: getLineChartTooltip(definition, chartData),
|
|
29566
29562
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -29697,7 +29693,7 @@ function createPieChartRuntime(chart, getters) {
|
|
|
29697
29693
|
: undefined,
|
|
29698
29694
|
layout: getChartLayout(definition, chartData),
|
|
29699
29695
|
plugins: {
|
|
29700
|
-
title: getChartTitle(definition),
|
|
29696
|
+
title: getChartTitle(definition, getters),
|
|
29701
29697
|
legend: getPieChartLegend(definition, chartData),
|
|
29702
29698
|
tooltip: getPieChartTooltip(definition, chartData),
|
|
29703
29699
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -29851,7 +29847,7 @@ function createPyramidChartRuntime(chart, getters) {
|
|
|
29851
29847
|
layout: getChartLayout(definition, chartData),
|
|
29852
29848
|
scales: getPyramidChartScales(definition, chartData),
|
|
29853
29849
|
plugins: {
|
|
29854
|
-
title: getChartTitle(definition),
|
|
29850
|
+
title: getChartTitle(definition, getters),
|
|
29855
29851
|
legend: getBarChartLegend(definition),
|
|
29856
29852
|
tooltip: getPyramidChartTooltip(definition, chartData),
|
|
29857
29853
|
chartShowValuesPlugin: getPyramidChartShowValues(definition, chartData),
|
|
@@ -30000,7 +29996,7 @@ function createRadarChartRuntime(chart, getters) {
|
|
|
30000
29996
|
layout: getChartLayout(definition, chartData),
|
|
30001
29997
|
scales: getRadarChartScales(definition, chartData),
|
|
30002
29998
|
plugins: {
|
|
30003
|
-
title: getChartTitle(definition),
|
|
29999
|
+
title: getChartTitle(definition, getters),
|
|
30004
30000
|
legend: getRadarChartLegend(definition),
|
|
30005
30001
|
tooltip: getRadarChartTooltip(definition, chartData),
|
|
30006
30002
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -30155,7 +30151,7 @@ function createScatterChartRuntime(chart, getters) {
|
|
|
30155
30151
|
layout: getChartLayout(definition, chartData),
|
|
30156
30152
|
scales: getScatterChartScales(definition, chartData),
|
|
30157
30153
|
plugins: {
|
|
30158
|
-
title: getChartTitle(definition),
|
|
30154
|
+
title: getChartTitle(definition, getters),
|
|
30159
30155
|
legend: getScatterChartLegend(definition),
|
|
30160
30156
|
tooltip: getLineChartTooltip(definition, chartData),
|
|
30161
30157
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -30294,7 +30290,7 @@ function createSunburstChartRuntime(chart, getters) {
|
|
|
30294
30290
|
...CHART_COMMON_OPTIONS,
|
|
30295
30291
|
layout: getChartLayout(definition, chartData),
|
|
30296
30292
|
plugins: {
|
|
30297
|
-
title: getChartTitle(definition),
|
|
30293
|
+
title: getChartTitle(definition, getters),
|
|
30298
30294
|
legend: getSunburstChartLegend(definition),
|
|
30299
30295
|
tooltip: getSunburstChartTooltip(definition, chartData),
|
|
30300
30296
|
sunburstLabelsPlugin: getSunburstShowValues(definition, chartData),
|
|
@@ -30444,7 +30440,7 @@ function createTreeMapChartRuntime(chart, getters) {
|
|
|
30444
30440
|
...CHART_COMMON_OPTIONS,
|
|
30445
30441
|
layout: getChartLayout(definition, chartData),
|
|
30446
30442
|
plugins: {
|
|
30447
|
-
title: getChartTitle(definition),
|
|
30443
|
+
title: getChartTitle(definition, getters),
|
|
30448
30444
|
legend: { display: false },
|
|
30449
30445
|
tooltip: getTreeMapChartTooltip(definition, chartData),
|
|
30450
30446
|
},
|
|
@@ -30607,7 +30603,7 @@ function createWaterfallChartRuntime(chart, getters) {
|
|
|
30607
30603
|
layout: getChartLayout(definition, chartData),
|
|
30608
30604
|
scales: getWaterfallChartScales(definition, chartData),
|
|
30609
30605
|
plugins: {
|
|
30610
|
-
title: getChartTitle(definition),
|
|
30606
|
+
title: getChartTitle(definition, getters),
|
|
30611
30607
|
legend: getWaterfallChartLegend(definition),
|
|
30612
30608
|
tooltip: getWaterfallChartTooltip(definition, chartData),
|
|
30613
30609
|
chartShowValuesPlugin: getWaterfallChartShowValues(definition, chartData),
|
|
@@ -32383,7 +32379,11 @@ class CarouselFigure extends Component {
|
|
|
32383
32379
|
onFigureDeleted: Function,
|
|
32384
32380
|
editFigureStyle: { type: Function, optional: true },
|
|
32385
32381
|
};
|
|
32386
|
-
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 = [];
|
|
32387
32387
|
animationStore;
|
|
32388
32388
|
setup() {
|
|
32389
32389
|
this.animationStore = useStore(ChartAnimationStore);
|
|
@@ -32394,6 +32394,7 @@ class CarouselFigure extends Component {
|
|
|
32394
32394
|
else {
|
|
32395
32395
|
this.props.editFigureStyle?.({ "pointer-events": "auto" });
|
|
32396
32396
|
}
|
|
32397
|
+
this.updateTabsVisibility();
|
|
32397
32398
|
});
|
|
32398
32399
|
}
|
|
32399
32400
|
get carousel() {
|
|
@@ -32453,6 +32454,49 @@ class CarouselFigure extends Component {
|
|
|
32453
32454
|
const style = { ...DEFAULT_CAROUSEL_TITLE_STYLE, ...this.carousel.title };
|
|
32454
32455
|
return cssPropertiesToCss(cellTextStyleToCss(chartStyleToCellStyle(style)));
|
|
32455
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
|
+
}
|
|
32456
32500
|
}
|
|
32457
32501
|
|
|
32458
32502
|
class ChartFigure extends Component {
|
|
@@ -39326,6 +39370,14 @@ function getCaretDownSvg(color) {
|
|
|
39326
39370
|
paths: [{ fillColor: color.textColor || TEXT_BODY_MUTED, path: "M120 195 h270 l-135 130" }],
|
|
39327
39371
|
};
|
|
39328
39372
|
}
|
|
39373
|
+
function getCaretUpSvg(color) {
|
|
39374
|
+
return {
|
|
39375
|
+
name: "CARET_UP",
|
|
39376
|
+
width: 512,
|
|
39377
|
+
height: 512,
|
|
39378
|
+
paths: [{ fillColor: color.textColor || TEXT_BODY_MUTED, path: "M120 325 h270 l-135 -130" }],
|
|
39379
|
+
};
|
|
39380
|
+
}
|
|
39329
39381
|
function getHoveredCaretDownSvg(color) {
|
|
39330
39382
|
return {
|
|
39331
39383
|
name: "CARET_DOWN",
|
|
@@ -50432,9 +50484,16 @@ class FiguresContainer extends Component {
|
|
|
50432
50484
|
maxX: this.env.model.getters.getColDimensions(sheetId, this.env.model.getters.getNumberCols(sheetId) - 1).end,
|
|
50433
50485
|
maxY: this.env.model.getters.getRowDimensions(sheetId, this.env.model.getters.getNumberRows(sheetId) - 1).end,
|
|
50434
50486
|
};
|
|
50487
|
+
let hasStartedDnd = false;
|
|
50435
50488
|
const onMouseMove = (ev) => {
|
|
50436
50489
|
const getters = this.env.model.getters;
|
|
50437
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;
|
|
50438
50497
|
const draggedFigure = dragFigureForMove(currentMousePosition, initialMousePosition, initialFigure, maxDimensions, initialScrollPosition, getters.getActiveSheetScrollInfo());
|
|
50439
50498
|
const otherFigures = this.getOtherFigures(initialFigure.id);
|
|
50440
50499
|
const overlappingCarousel = this.getCarouselOverlappingChart(draggedFigure, otherFigures);
|
|
@@ -55634,7 +55693,7 @@ class ScorecardChartDesignPanel extends Component {
|
|
|
55634
55693
|
return SCORECARD_CHART_TITLE_FONT_SIZE;
|
|
55635
55694
|
}
|
|
55636
55695
|
translate(term) {
|
|
55637
|
-
return
|
|
55696
|
+
return this.env.model.getters.dynamicTranslate(term);
|
|
55638
55697
|
}
|
|
55639
55698
|
setColor(color, colorPickerId) {
|
|
55640
55699
|
switch (colorPickerId) {
|
|
@@ -57186,7 +57245,7 @@ class CustomCurrencyPanel extends Component {
|
|
|
57186
57245
|
});
|
|
57187
57246
|
}
|
|
57188
57247
|
const emptyCurrency = {
|
|
57189
|
-
name:
|
|
57248
|
+
name: CustomCurrencyTerms.Custom,
|
|
57190
57249
|
code: "",
|
|
57191
57250
|
symbol: "",
|
|
57192
57251
|
decimalPlaces: 2,
|
|
@@ -58846,12 +58905,13 @@ class PivotLayoutConfigurator extends Component {
|
|
|
58846
58905
|
addCalculatedMeasure() {
|
|
58847
58906
|
const { measures } = this.props.definition;
|
|
58848
58907
|
const measureName = this.env.model.getters.generateNewCalculatedMeasureName(measures);
|
|
58908
|
+
const aggregator = "sum";
|
|
58849
58909
|
this.props.onDimensionsUpdated({
|
|
58850
58910
|
measures: measures.concat([
|
|
58851
58911
|
{
|
|
58852
|
-
id: this.getMeasureId(measureName),
|
|
58912
|
+
id: this.getMeasureId(measureName, aggregator),
|
|
58853
58913
|
fieldName: measureName,
|
|
58854
|
-
aggregator
|
|
58914
|
+
aggregator,
|
|
58855
58915
|
computedBy: {
|
|
58856
58916
|
sheetId: this.env.model.getters.getActiveSheetId(),
|
|
58857
58917
|
formula: "=0",
|
|
@@ -61443,14 +61503,16 @@ class ClickableCellSortIcon extends Component {
|
|
|
61443
61503
|
"background-color": this.getBackgroundColor(cellStyle),
|
|
61444
61504
|
});
|
|
61445
61505
|
}
|
|
61446
|
-
get
|
|
61447
|
-
|
|
61448
|
-
|
|
61449
|
-
|
|
61450
|
-
|
|
61451
|
-
|
|
61506
|
+
get verticalJustifyClass() {
|
|
61507
|
+
const cellStyle = this.env.model.getters.getCellComputedStyle(this.props.position);
|
|
61508
|
+
switch (cellStyle.verticalAlign) {
|
|
61509
|
+
case "top":
|
|
61510
|
+
return "justify-content-start";
|
|
61511
|
+
case "middle":
|
|
61512
|
+
return "justify-content-center";
|
|
61513
|
+
case "bottom":
|
|
61452
61514
|
default:
|
|
61453
|
-
return "
|
|
61515
|
+
return "justify-content-end";
|
|
61454
61516
|
}
|
|
61455
61517
|
}
|
|
61456
61518
|
getBackgroundColor(cellStyle) {
|
|
@@ -70651,6 +70713,30 @@ function togglePivotCollapse(position, env) {
|
|
|
70651
70713
|
pivot: { ...definition, collapsedDomains: newDomains },
|
|
70652
70714
|
});
|
|
70653
70715
|
}
|
|
70716
|
+
iconsOnCellRegistry.add("pivot_dashboard_sorting", (getters, position) => {
|
|
70717
|
+
if (!getters.isDashboard()) {
|
|
70718
|
+
return undefined;
|
|
70719
|
+
}
|
|
70720
|
+
const pivotCell = getters.getPivotCellFromPosition(position);
|
|
70721
|
+
if (pivotCell.type !== "MEASURE_HEADER") {
|
|
70722
|
+
return undefined;
|
|
70723
|
+
}
|
|
70724
|
+
const sortDirection = getters.getPivotCellSortDirection(position);
|
|
70725
|
+
if (sortDirection !== "asc" && sortDirection !== "desc") {
|
|
70726
|
+
return undefined;
|
|
70727
|
+
}
|
|
70728
|
+
const cellStyle = getters.getCellComputedStyle(position);
|
|
70729
|
+
return {
|
|
70730
|
+
type: `pivot_dashboard_sorting_${sortDirection}`,
|
|
70731
|
+
priority: 5,
|
|
70732
|
+
horizontalAlign: "right",
|
|
70733
|
+
size: GRID_ICON_EDGE_LENGTH,
|
|
70734
|
+
margin: GRID_ICON_MARGIN,
|
|
70735
|
+
svg: sortDirection === "asc" ? getCaretUpSvg(cellStyle) : getCaretDownSvg(cellStyle),
|
|
70736
|
+
position,
|
|
70737
|
+
onClick: undefined, // click is managed by ClickableCellSortIcon
|
|
70738
|
+
};
|
|
70739
|
+
});
|
|
70654
70740
|
|
|
70655
70741
|
class CellIconPlugin extends CoreViewPlugin {
|
|
70656
70742
|
static getters = ["doesCellHaveGridIcon", "getCellIcons", "getCellIconRect"];
|
|
@@ -71130,7 +71216,7 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
71130
71216
|
return { value: 0 };
|
|
71131
71217
|
}
|
|
71132
71218
|
const { columns, rows } = super.definition;
|
|
71133
|
-
if (columns.length + rows.length !== domain.length) {
|
|
71219
|
+
if (measure.aggregator && columns.length + rows.length !== domain.length) {
|
|
71134
71220
|
const values = this.getValuesToAggregate(measure, domain);
|
|
71135
71221
|
const aggregator = AGGREGATORS_FN[measure.aggregator];
|
|
71136
71222
|
if (!aggregator) {
|
|
@@ -71149,11 +71235,17 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
71149
71235
|
if (columns.find((col) => col.nameWithGranularity === symbolName)) {
|
|
71150
71236
|
const { colDomain } = domainToColRowDomain(this, domain);
|
|
71151
71237
|
const symbolIndex = colDomain.findIndex((node) => node.field === symbolName);
|
|
71238
|
+
if (symbolIndex === -1) {
|
|
71239
|
+
return new NotAvailableError();
|
|
71240
|
+
}
|
|
71152
71241
|
return this.getPivotHeaderValueAndFormat(colDomain.slice(0, symbolIndex + 1));
|
|
71153
71242
|
}
|
|
71154
71243
|
if (rows.find((row) => row.nameWithGranularity === symbolName)) {
|
|
71155
71244
|
const { rowDomain } = domainToColRowDomain(this, domain);
|
|
71156
71245
|
const symbolIndex = rowDomain.findIndex((row) => row.field === symbolName);
|
|
71246
|
+
if (symbolIndex === -1) {
|
|
71247
|
+
return new NotAvailableError();
|
|
71248
|
+
}
|
|
71157
71249
|
return this.getPivotHeaderValueAndFormat(rowDomain.slice(0, symbolIndex + 1));
|
|
71158
71250
|
}
|
|
71159
71251
|
return this.getPivotCellValueAndFormat(symbolName, domain);
|
|
@@ -75547,6 +75639,21 @@ class DataValidationInsertionPlugin extends UIPlugin {
|
|
|
75547
75639
|
}
|
|
75548
75640
|
}
|
|
75549
75641
|
|
|
75642
|
+
/**
|
|
75643
|
+
* This plugin provides dynamic translation getter. In o-spreadsheet, it has
|
|
75644
|
+
* no implementation, but this plugin can be replaced by another one to provide
|
|
75645
|
+
* a real implementation.
|
|
75646
|
+
*
|
|
75647
|
+
* For example, in Odoo, the plugin is replaced by a plugin that used the
|
|
75648
|
+
* module namespace to dynamically translate terms.
|
|
75649
|
+
*/
|
|
75650
|
+
class DynamicTranslate extends UIPlugin {
|
|
75651
|
+
static getters = ["dynamicTranslate"];
|
|
75652
|
+
dynamicTranslate(term) {
|
|
75653
|
+
return term;
|
|
75654
|
+
}
|
|
75655
|
+
}
|
|
75656
|
+
|
|
75550
75657
|
const genericRepeatsTransforms = [
|
|
75551
75658
|
repeatSheetDependantCommand,
|
|
75552
75659
|
repeatTargetDependantCommand,
|
|
@@ -79178,6 +79285,7 @@ const featurePluginRegistry = new Registry()
|
|
|
79178
79285
|
.add("table_ui_resize", TableResizeUI)
|
|
79179
79286
|
.add("datavalidation_insert", DataValidationInsertionPlugin)
|
|
79180
79287
|
.add("checkbox_toggle", CheckboxTogglePlugin)
|
|
79288
|
+
.add("dynamic_translate", DynamicTranslate)
|
|
79181
79289
|
.add("geo_features", GeoFeaturePlugin);
|
|
79182
79290
|
// Plugins which have a state, but which should not be shared in collaborative
|
|
79183
79291
|
const statefulUIPluginRegistry = new Registry()
|
|
@@ -88357,9 +88465,9 @@ const constants = {
|
|
|
88357
88465
|
};
|
|
88358
88466
|
const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
88359
88467
|
|
|
88360
|
-
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, helpers, hooks, invalidateCFEvaluationCommands, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
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 };
|
|
88361
88469
|
|
|
88362
88470
|
|
|
88363
|
-
__info__.version = "19.1.0-alpha.
|
|
88364
|
-
__info__.date = "2025-09-
|
|
88365
|
-
__info__.hash = "
|
|
88471
|
+
__info__.version = "19.1.0-alpha.1";
|
|
88472
|
+
__info__.date = "2025-09-12T13:33:41.605Z";
|
|
88473
|
+
__info__.hash = "d3e4e7b";
|