@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
|
(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
|
|
@@ -24538,18 +24539,15 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
24538
24539
|
return {
|
|
24539
24540
|
title: {
|
|
24540
24541
|
...chart.title,
|
|
24541
|
-
|
|
24542
|
-
text: chart.title.text ? _t(chart.title.text) : "",
|
|
24542
|
+
text: chart.title.text ? getters.dynamicTranslate(chart.title.text) : "",
|
|
24543
24543
|
},
|
|
24544
24544
|
keyValue: formattedKeyValue,
|
|
24545
|
-
keyDescr: chart.keyDescr?.text
|
|
24546
|
-
? _t(chart.keyDescr.text) // descriptions are extracted from .json files and they are translated at runtime here
|
|
24547
|
-
: "",
|
|
24545
|
+
keyDescr: chart.keyDescr?.text ? getters.dynamicTranslate(chart.keyDescr.text) : "",
|
|
24548
24546
|
baselineDisplay,
|
|
24549
24547
|
baselineArrow: getBaselineArrowDirection(baselineCell, keyValueCell, chart.baselineMode),
|
|
24550
24548
|
baselineColor: getBaselineColor(baselineCell, chart.baselineMode, keyValueCell, chart.baselineColorUp, chart.baselineColorDown),
|
|
24551
24549
|
baselineDescr: chart.baselineMode !== "progress" && chart.baselineDescr?.text
|
|
24552
|
-
?
|
|
24550
|
+
? getters.dynamicTranslate(chart.baselineDescr.text)
|
|
24553
24551
|
: "",
|
|
24554
24552
|
fontColor,
|
|
24555
24553
|
background,
|
|
@@ -24849,9 +24847,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
24849
24847
|
return this.env.model.getters.getChartRuntime(this.props.chartId);
|
|
24850
24848
|
}
|
|
24851
24849
|
get title() {
|
|
24852
|
-
const title = this.env.model.getters.getChartDefinition(this.props.chartId).title.text
|
|
24853
|
-
|
|
24854
|
-
return _t(title);
|
|
24850
|
+
const title = this.env.model.getters.getChartDefinition(this.props.chartId).title.text;
|
|
24851
|
+
return title ? this.env.model.getters.dynamicTranslate(title) : "";
|
|
24855
24852
|
}
|
|
24856
24853
|
setup() {
|
|
24857
24854
|
owl.useEffect(this.createChart.bind(this), () => {
|
|
@@ -27024,12 +27021,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
27024
27021
|
return axisId || "y";
|
|
27025
27022
|
}
|
|
27026
27023
|
|
|
27027
|
-
function getChartTitle(definition) {
|
|
27024
|
+
function getChartTitle(definition, getters) {
|
|
27028
27025
|
const chartTitle = definition.title;
|
|
27029
27026
|
const fontColor = chartMutedFontColor(definition.background);
|
|
27030
27027
|
return {
|
|
27031
27028
|
display: !!chartTitle.text,
|
|
27032
|
-
text:
|
|
27029
|
+
text: chartTitle.text ? getters.dynamicTranslate(chartTitle.text) : "",
|
|
27033
27030
|
color: chartTitle?.color ?? fontColor,
|
|
27034
27031
|
align: chartTitle.align === "center" ? "center" : chartTitle.align === "right" ? "end" : "start",
|
|
27035
27032
|
font: {
|
|
@@ -27597,7 +27594,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
27597
27594
|
layout: getChartLayout(definition, chartData),
|
|
27598
27595
|
scales: getBarChartScales(definition, chartData),
|
|
27599
27596
|
plugins: {
|
|
27600
|
-
title: getChartTitle(definition),
|
|
27597
|
+
title: getChartTitle(definition, getters),
|
|
27601
27598
|
legend: getBarChartLegend(definition),
|
|
27602
27599
|
tooltip: getBarChartTooltip(definition, chartData),
|
|
27603
27600
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -28828,7 +28825,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28828
28825
|
layout: getChartLayout(definition, chartData),
|
|
28829
28826
|
scales: getBarChartScales(definition, chartData),
|
|
28830
28827
|
plugins: {
|
|
28831
|
-
title: getChartTitle(definition),
|
|
28828
|
+
title: getChartTitle(definition, getters),
|
|
28832
28829
|
legend: getComboChartLegend(definition),
|
|
28833
28830
|
tooltip: getBarChartTooltip(definition, chartData),
|
|
28834
28831
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -28974,7 +28971,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28974
28971
|
layout: getChartLayout(definition, chartData),
|
|
28975
28972
|
scales: getFunnelChartScales(definition, chartData),
|
|
28976
28973
|
plugins: {
|
|
28977
|
-
title: getChartTitle(definition),
|
|
28974
|
+
title: getChartTitle(definition, getters),
|
|
28978
28975
|
legend: { display: false },
|
|
28979
28976
|
tooltip: getFunnelChartTooltip(definition, chartData),
|
|
28980
28977
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -29211,8 +29208,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29211
29208
|
background: getters.getStyleOfSingleCellChart(chart.background, dataRange).background,
|
|
29212
29209
|
title: {
|
|
29213
29210
|
...chart.title,
|
|
29214
|
-
|
|
29215
|
-
text: _t(chart.title.text ?? ""),
|
|
29211
|
+
text: chart.title.text ? getters.dynamicTranslate(chart.title.text) : "",
|
|
29216
29212
|
},
|
|
29217
29213
|
minValue: {
|
|
29218
29214
|
value: minValue,
|
|
@@ -29396,7 +29392,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29396
29392
|
layout: getChartLayout(definition, chartData),
|
|
29397
29393
|
scales: getGeoChartScales(definition, chartData),
|
|
29398
29394
|
plugins: {
|
|
29399
|
-
title: getChartTitle(definition),
|
|
29395
|
+
title: getChartTitle(definition, getters),
|
|
29400
29396
|
tooltip: getGeoChartTooltip(definition, chartData),
|
|
29401
29397
|
legend: { display: false },
|
|
29402
29398
|
},
|
|
@@ -29561,7 +29557,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29561
29557
|
layout: getChartLayout(definition, chartData),
|
|
29562
29558
|
scales: getLineChartScales(definition, chartData),
|
|
29563
29559
|
plugins: {
|
|
29564
|
-
title: getChartTitle(definition),
|
|
29560
|
+
title: getChartTitle(definition, getters),
|
|
29565
29561
|
legend: getLineChartLegend(definition),
|
|
29566
29562
|
tooltip: getLineChartTooltip(definition, chartData),
|
|
29567
29563
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -29698,7 +29694,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29698
29694
|
: undefined,
|
|
29699
29695
|
layout: getChartLayout(definition, chartData),
|
|
29700
29696
|
plugins: {
|
|
29701
|
-
title: getChartTitle(definition),
|
|
29697
|
+
title: getChartTitle(definition, getters),
|
|
29702
29698
|
legend: getPieChartLegend(definition, chartData),
|
|
29703
29699
|
tooltip: getPieChartTooltip(definition, chartData),
|
|
29704
29700
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -29852,7 +29848,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29852
29848
|
layout: getChartLayout(definition, chartData),
|
|
29853
29849
|
scales: getPyramidChartScales(definition, chartData),
|
|
29854
29850
|
plugins: {
|
|
29855
|
-
title: getChartTitle(definition),
|
|
29851
|
+
title: getChartTitle(definition, getters),
|
|
29856
29852
|
legend: getBarChartLegend(definition),
|
|
29857
29853
|
tooltip: getPyramidChartTooltip(definition, chartData),
|
|
29858
29854
|
chartShowValuesPlugin: getPyramidChartShowValues(definition, chartData),
|
|
@@ -30001,7 +29997,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
30001
29997
|
layout: getChartLayout(definition, chartData),
|
|
30002
29998
|
scales: getRadarChartScales(definition, chartData),
|
|
30003
29999
|
plugins: {
|
|
30004
|
-
title: getChartTitle(definition),
|
|
30000
|
+
title: getChartTitle(definition, getters),
|
|
30005
30001
|
legend: getRadarChartLegend(definition),
|
|
30006
30002
|
tooltip: getRadarChartTooltip(definition, chartData),
|
|
30007
30003
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -30156,7 +30152,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
30156
30152
|
layout: getChartLayout(definition, chartData),
|
|
30157
30153
|
scales: getScatterChartScales(definition, chartData),
|
|
30158
30154
|
plugins: {
|
|
30159
|
-
title: getChartTitle(definition),
|
|
30155
|
+
title: getChartTitle(definition, getters),
|
|
30160
30156
|
legend: getScatterChartLegend(definition),
|
|
30161
30157
|
tooltip: getLineChartTooltip(definition, chartData),
|
|
30162
30158
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -30295,7 +30291,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
30295
30291
|
...CHART_COMMON_OPTIONS,
|
|
30296
30292
|
layout: getChartLayout(definition, chartData),
|
|
30297
30293
|
plugins: {
|
|
30298
|
-
title: getChartTitle(definition),
|
|
30294
|
+
title: getChartTitle(definition, getters),
|
|
30299
30295
|
legend: getSunburstChartLegend(definition),
|
|
30300
30296
|
tooltip: getSunburstChartTooltip(definition, chartData),
|
|
30301
30297
|
sunburstLabelsPlugin: getSunburstShowValues(definition, chartData),
|
|
@@ -30445,7 +30441,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
30445
30441
|
...CHART_COMMON_OPTIONS,
|
|
30446
30442
|
layout: getChartLayout(definition, chartData),
|
|
30447
30443
|
plugins: {
|
|
30448
|
-
title: getChartTitle(definition),
|
|
30444
|
+
title: getChartTitle(definition, getters),
|
|
30449
30445
|
legend: { display: false },
|
|
30450
30446
|
tooltip: getTreeMapChartTooltip(definition, chartData),
|
|
30451
30447
|
},
|
|
@@ -30608,7 +30604,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
30608
30604
|
layout: getChartLayout(definition, chartData),
|
|
30609
30605
|
scales: getWaterfallChartScales(definition, chartData),
|
|
30610
30606
|
plugins: {
|
|
30611
|
-
title: getChartTitle(definition),
|
|
30607
|
+
title: getChartTitle(definition, getters),
|
|
30612
30608
|
legend: getWaterfallChartLegend(definition),
|
|
30613
30609
|
tooltip: getWaterfallChartTooltip(definition, chartData),
|
|
30614
30610
|
chartShowValuesPlugin: getWaterfallChartShowValues(definition, chartData),
|
|
@@ -32384,7 +32380,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
32384
32380
|
onFigureDeleted: Function,
|
|
32385
32381
|
editFigureStyle: { type: Function, optional: true },
|
|
32386
32382
|
};
|
|
32387
|
-
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 = [];
|
|
32388
32388
|
animationStore;
|
|
32389
32389
|
setup() {
|
|
32390
32390
|
this.animationStore = useStore(ChartAnimationStore);
|
|
@@ -32395,6 +32395,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
32395
32395
|
else {
|
|
32396
32396
|
this.props.editFigureStyle?.({ "pointer-events": "auto" });
|
|
32397
32397
|
}
|
|
32398
|
+
this.updateTabsVisibility();
|
|
32398
32399
|
});
|
|
32399
32400
|
}
|
|
32400
32401
|
get carousel() {
|
|
@@ -32454,6 +32455,49 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
32454
32455
|
const style = { ...DEFAULT_CAROUSEL_TITLE_STYLE, ...this.carousel.title };
|
|
32455
32456
|
return cssPropertiesToCss(cellTextStyleToCss(chartStyleToCellStyle(style)));
|
|
32456
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
|
+
}
|
|
32457
32501
|
}
|
|
32458
32502
|
|
|
32459
32503
|
class ChartFigure extends owl.Component {
|
|
@@ -39327,6 +39371,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
39327
39371
|
paths: [{ fillColor: color.textColor || TEXT_BODY_MUTED, path: "M120 195 h270 l-135 130" }],
|
|
39328
39372
|
};
|
|
39329
39373
|
}
|
|
39374
|
+
function getCaretUpSvg(color) {
|
|
39375
|
+
return {
|
|
39376
|
+
name: "CARET_UP",
|
|
39377
|
+
width: 512,
|
|
39378
|
+
height: 512,
|
|
39379
|
+
paths: [{ fillColor: color.textColor || TEXT_BODY_MUTED, path: "M120 325 h270 l-135 -130" }],
|
|
39380
|
+
};
|
|
39381
|
+
}
|
|
39330
39382
|
function getHoveredCaretDownSvg(color) {
|
|
39331
39383
|
return {
|
|
39332
39384
|
name: "CARET_DOWN",
|
|
@@ -50433,9 +50485,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
50433
50485
|
maxX: this.env.model.getters.getColDimensions(sheetId, this.env.model.getters.getNumberCols(sheetId) - 1).end,
|
|
50434
50486
|
maxY: this.env.model.getters.getRowDimensions(sheetId, this.env.model.getters.getNumberRows(sheetId) - 1).end,
|
|
50435
50487
|
};
|
|
50488
|
+
let hasStartedDnd = false;
|
|
50436
50489
|
const onMouseMove = (ev) => {
|
|
50437
50490
|
const getters = this.env.model.getters;
|
|
50438
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;
|
|
50439
50498
|
const draggedFigure = dragFigureForMove(currentMousePosition, initialMousePosition, initialFigure, maxDimensions, initialScrollPosition, getters.getActiveSheetScrollInfo());
|
|
50440
50499
|
const otherFigures = this.getOtherFigures(initialFigure.id);
|
|
50441
50500
|
const overlappingCarousel = this.getCarouselOverlappingChart(draggedFigure, otherFigures);
|
|
@@ -55635,7 +55694,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55635
55694
|
return SCORECARD_CHART_TITLE_FONT_SIZE;
|
|
55636
55695
|
}
|
|
55637
55696
|
translate(term) {
|
|
55638
|
-
return
|
|
55697
|
+
return this.env.model.getters.dynamicTranslate(term);
|
|
55639
55698
|
}
|
|
55640
55699
|
setColor(color, colorPickerId) {
|
|
55641
55700
|
switch (colorPickerId) {
|
|
@@ -57187,7 +57246,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57187
57246
|
});
|
|
57188
57247
|
}
|
|
57189
57248
|
const emptyCurrency = {
|
|
57190
|
-
name:
|
|
57249
|
+
name: CustomCurrencyTerms.Custom,
|
|
57191
57250
|
code: "",
|
|
57192
57251
|
symbol: "",
|
|
57193
57252
|
decimalPlaces: 2,
|
|
@@ -58847,12 +58906,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
58847
58906
|
addCalculatedMeasure() {
|
|
58848
58907
|
const { measures } = this.props.definition;
|
|
58849
58908
|
const measureName = this.env.model.getters.generateNewCalculatedMeasureName(measures);
|
|
58909
|
+
const aggregator = "sum";
|
|
58850
58910
|
this.props.onDimensionsUpdated({
|
|
58851
58911
|
measures: measures.concat([
|
|
58852
58912
|
{
|
|
58853
|
-
id: this.getMeasureId(measureName),
|
|
58913
|
+
id: this.getMeasureId(measureName, aggregator),
|
|
58854
58914
|
fieldName: measureName,
|
|
58855
|
-
aggregator
|
|
58915
|
+
aggregator,
|
|
58856
58916
|
computedBy: {
|
|
58857
58917
|
sheetId: this.env.model.getters.getActiveSheetId(),
|
|
58858
58918
|
formula: "=0",
|
|
@@ -61444,14 +61504,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
61444
61504
|
"background-color": this.getBackgroundColor(cellStyle),
|
|
61445
61505
|
});
|
|
61446
61506
|
}
|
|
61447
|
-
get
|
|
61448
|
-
|
|
61449
|
-
|
|
61450
|
-
|
|
61451
|
-
|
|
61452
|
-
|
|
61507
|
+
get verticalJustifyClass() {
|
|
61508
|
+
const cellStyle = this.env.model.getters.getCellComputedStyle(this.props.position);
|
|
61509
|
+
switch (cellStyle.verticalAlign) {
|
|
61510
|
+
case "top":
|
|
61511
|
+
return "justify-content-start";
|
|
61512
|
+
case "middle":
|
|
61513
|
+
return "justify-content-center";
|
|
61514
|
+
case "bottom":
|
|
61453
61515
|
default:
|
|
61454
|
-
return "
|
|
61516
|
+
return "justify-content-end";
|
|
61455
61517
|
}
|
|
61456
61518
|
}
|
|
61457
61519
|
getBackgroundColor(cellStyle) {
|
|
@@ -70652,6 +70714,30 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
70652
70714
|
pivot: { ...definition, collapsedDomains: newDomains },
|
|
70653
70715
|
});
|
|
70654
70716
|
}
|
|
70717
|
+
iconsOnCellRegistry.add("pivot_dashboard_sorting", (getters, position) => {
|
|
70718
|
+
if (!getters.isDashboard()) {
|
|
70719
|
+
return undefined;
|
|
70720
|
+
}
|
|
70721
|
+
const pivotCell = getters.getPivotCellFromPosition(position);
|
|
70722
|
+
if (pivotCell.type !== "MEASURE_HEADER") {
|
|
70723
|
+
return undefined;
|
|
70724
|
+
}
|
|
70725
|
+
const sortDirection = getters.getPivotCellSortDirection(position);
|
|
70726
|
+
if (sortDirection !== "asc" && sortDirection !== "desc") {
|
|
70727
|
+
return undefined;
|
|
70728
|
+
}
|
|
70729
|
+
const cellStyle = getters.getCellComputedStyle(position);
|
|
70730
|
+
return {
|
|
70731
|
+
type: `pivot_dashboard_sorting_${sortDirection}`,
|
|
70732
|
+
priority: 5,
|
|
70733
|
+
horizontalAlign: "right",
|
|
70734
|
+
size: GRID_ICON_EDGE_LENGTH,
|
|
70735
|
+
margin: GRID_ICON_MARGIN,
|
|
70736
|
+
svg: sortDirection === "asc" ? getCaretUpSvg(cellStyle) : getCaretDownSvg(cellStyle),
|
|
70737
|
+
position,
|
|
70738
|
+
onClick: undefined, // click is managed by ClickableCellSortIcon
|
|
70739
|
+
};
|
|
70740
|
+
});
|
|
70655
70741
|
|
|
70656
70742
|
class CellIconPlugin extends CoreViewPlugin {
|
|
70657
70743
|
static getters = ["doesCellHaveGridIcon", "getCellIcons", "getCellIconRect"];
|
|
@@ -71131,7 +71217,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
71131
71217
|
return { value: 0 };
|
|
71132
71218
|
}
|
|
71133
71219
|
const { columns, rows } = super.definition;
|
|
71134
|
-
if (columns.length + rows.length !== domain.length) {
|
|
71220
|
+
if (measure.aggregator && columns.length + rows.length !== domain.length) {
|
|
71135
71221
|
const values = this.getValuesToAggregate(measure, domain);
|
|
71136
71222
|
const aggregator = AGGREGATORS_FN[measure.aggregator];
|
|
71137
71223
|
if (!aggregator) {
|
|
@@ -71150,11 +71236,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
71150
71236
|
if (columns.find((col) => col.nameWithGranularity === symbolName)) {
|
|
71151
71237
|
const { colDomain } = domainToColRowDomain(this, domain);
|
|
71152
71238
|
const symbolIndex = colDomain.findIndex((node) => node.field === symbolName);
|
|
71239
|
+
if (symbolIndex === -1) {
|
|
71240
|
+
return new NotAvailableError();
|
|
71241
|
+
}
|
|
71153
71242
|
return this.getPivotHeaderValueAndFormat(colDomain.slice(0, symbolIndex + 1));
|
|
71154
71243
|
}
|
|
71155
71244
|
if (rows.find((row) => row.nameWithGranularity === symbolName)) {
|
|
71156
71245
|
const { rowDomain } = domainToColRowDomain(this, domain);
|
|
71157
71246
|
const symbolIndex = rowDomain.findIndex((row) => row.field === symbolName);
|
|
71247
|
+
if (symbolIndex === -1) {
|
|
71248
|
+
return new NotAvailableError();
|
|
71249
|
+
}
|
|
71158
71250
|
return this.getPivotHeaderValueAndFormat(rowDomain.slice(0, symbolIndex + 1));
|
|
71159
71251
|
}
|
|
71160
71252
|
return this.getPivotCellValueAndFormat(symbolName, domain);
|
|
@@ -75548,6 +75640,21 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
75548
75640
|
}
|
|
75549
75641
|
}
|
|
75550
75642
|
|
|
75643
|
+
/**
|
|
75644
|
+
* This plugin provides dynamic translation getter. In o-spreadsheet, it has
|
|
75645
|
+
* no implementation, but this plugin can be replaced by another one to provide
|
|
75646
|
+
* a real implementation.
|
|
75647
|
+
*
|
|
75648
|
+
* For example, in Odoo, the plugin is replaced by a plugin that used the
|
|
75649
|
+
* module namespace to dynamically translate terms.
|
|
75650
|
+
*/
|
|
75651
|
+
class DynamicTranslate extends UIPlugin {
|
|
75652
|
+
static getters = ["dynamicTranslate"];
|
|
75653
|
+
dynamicTranslate(term) {
|
|
75654
|
+
return term;
|
|
75655
|
+
}
|
|
75656
|
+
}
|
|
75657
|
+
|
|
75551
75658
|
const genericRepeatsTransforms = [
|
|
75552
75659
|
repeatSheetDependantCommand,
|
|
75553
75660
|
repeatTargetDependantCommand,
|
|
@@ -79179,6 +79286,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
79179
79286
|
.add("table_ui_resize", TableResizeUI)
|
|
79180
79287
|
.add("datavalidation_insert", DataValidationInsertionPlugin)
|
|
79181
79288
|
.add("checkbox_toggle", CheckboxTogglePlugin)
|
|
79289
|
+
.add("dynamic_translate", DynamicTranslate)
|
|
79182
79290
|
.add("geo_features", GeoFeaturePlugin);
|
|
79183
79291
|
// Plugins which have a state, but which should not be shared in collaborative
|
|
79184
79292
|
const statefulUIPluginRegistry = new Registry()
|
|
@@ -88389,6 +88497,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
88389
88497
|
exports.coreTypes = coreTypes;
|
|
88390
88498
|
exports.findCellInNewZone = findCellInNewZone;
|
|
88391
88499
|
exports.functionCache = functionCache;
|
|
88500
|
+
exports.getCaretDownSvg = getCaretDownSvg;
|
|
88501
|
+
exports.getCaretUpSvg = getCaretUpSvg;
|
|
88392
88502
|
exports.helpers = helpers;
|
|
88393
88503
|
exports.hooks = hooks;
|
|
88394
88504
|
exports.invalidateCFEvaluationCommands = invalidateCFEvaluationCommands;
|
|
@@ -88409,9 +88519,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
88409
88519
|
exports.tokenize = tokenize;
|
|
88410
88520
|
|
|
88411
88521
|
|
|
88412
|
-
__info__.version = "19.1.0-alpha.
|
|
88413
|
-
__info__.date = "2025-09-
|
|
88414
|
-
__info__.hash = "
|
|
88522
|
+
__info__.version = "19.1.0-alpha.1";
|
|
88523
|
+
__info__.date = "2025-09-12T13:33:41.605Z";
|
|
88524
|
+
__info__.hash = "d3e4e7b";
|
|
88415
88525
|
|
|
88416
88526
|
|
|
88417
88527
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|