@odoo/o-spreadsheet 19.0.0 → 19.0.3
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 +175 -56
- package/dist/o-spreadsheet.d.ts +22 -6
- package/dist/o-spreadsheet.esm.js +174 -57
- package/dist/o-spreadsheet.iife.js +175 -56
- package/dist/o-spreadsheet.iife.min.js +234 -234
- package/dist/o_spreadsheet.xml +37 -8
- package/package.json +15 -2
|
@@ -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.
|
|
6
|
-
* @date 2025-09-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 19.0.3
|
|
6
|
+
* @date 2025-09-19T07:26:41.356Z
|
|
7
|
+
* @hash 84f3b74
|
|
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
|
|
@@ -1367,8 +1368,19 @@
|
|
|
1367
1368
|
},
|
|
1368
1369
|
}[funcName];
|
|
1369
1370
|
}
|
|
1371
|
+
/**
|
|
1372
|
+
* Removes the specified indexes from the array.
|
|
1373
|
+
* Sparse (empty) elements are transformed to undefined (unless their index is explicitly removed).
|
|
1374
|
+
*/
|
|
1370
1375
|
function removeIndexesFromArray(array, indexes) {
|
|
1371
|
-
|
|
1376
|
+
const toRemove = new Set(indexes);
|
|
1377
|
+
const newArray = [];
|
|
1378
|
+
for (let i = 0; i < array.length; i++) {
|
|
1379
|
+
if (!toRemove.has(i)) {
|
|
1380
|
+
newArray.push(array[i]);
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
return newArray;
|
|
1372
1384
|
}
|
|
1373
1385
|
function insertItemsAtIndex(array, items, index) {
|
|
1374
1386
|
const newArray = [...array];
|
|
@@ -16083,8 +16095,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
16083
16095
|
}
|
|
16084
16096
|
|
|
16085
16097
|
function sortMatrix(matrix, locale, ...criteria) {
|
|
16086
|
-
for (
|
|
16087
|
-
|
|
16098
|
+
for (let i = 0; i < criteria.length; i++) {
|
|
16099
|
+
const param = i % 2 === 0 ? "sort_column" : "is_ascending";
|
|
16100
|
+
assert(criteria[i] !== undefined, _t("Value for parameter %s is missing in [[FUNCTION_NAME]].", param));
|
|
16088
16101
|
}
|
|
16089
16102
|
const sortingOrders = [];
|
|
16090
16103
|
const sortColumns = [];
|
|
@@ -24538,18 +24551,15 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
24538
24551
|
return {
|
|
24539
24552
|
title: {
|
|
24540
24553
|
...chart.title,
|
|
24541
|
-
|
|
24542
|
-
text: chart.title.text ? _t(chart.title.text) : "",
|
|
24554
|
+
text: chart.title.text ? getters.dynamicTranslate(chart.title.text) : "",
|
|
24543
24555
|
},
|
|
24544
24556
|
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
|
-
: "",
|
|
24557
|
+
keyDescr: chart.keyDescr?.text ? getters.dynamicTranslate(chart.keyDescr.text) : "",
|
|
24548
24558
|
baselineDisplay,
|
|
24549
24559
|
baselineArrow: getBaselineArrowDirection(baselineCell, keyValueCell, chart.baselineMode),
|
|
24550
24560
|
baselineColor: getBaselineColor(baselineCell, chart.baselineMode, keyValueCell, chart.baselineColorUp, chart.baselineColorDown),
|
|
24551
24561
|
baselineDescr: chart.baselineMode !== "progress" && chart.baselineDescr?.text
|
|
24552
|
-
?
|
|
24562
|
+
? getters.dynamicTranslate(chart.baselineDescr.text)
|
|
24553
24563
|
: "",
|
|
24554
24564
|
fontColor,
|
|
24555
24565
|
background,
|
|
@@ -24849,9 +24859,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
24849
24859
|
return this.env.model.getters.getChartRuntime(this.props.chartId);
|
|
24850
24860
|
}
|
|
24851
24861
|
get title() {
|
|
24852
|
-
const title = this.env.model.getters.getChartDefinition(this.props.chartId).title.text
|
|
24853
|
-
|
|
24854
|
-
return _t(title);
|
|
24862
|
+
const title = this.env.model.getters.getChartDefinition(this.props.chartId).title.text;
|
|
24863
|
+
return title ? this.env.model.getters.dynamicTranslate(title) : "";
|
|
24855
24864
|
}
|
|
24856
24865
|
setup() {
|
|
24857
24866
|
owl.useEffect(this.createChart.bind(this), () => {
|
|
@@ -27024,12 +27033,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
27024
27033
|
return axisId || "y";
|
|
27025
27034
|
}
|
|
27026
27035
|
|
|
27027
|
-
function getChartTitle(definition) {
|
|
27036
|
+
function getChartTitle(definition, getters) {
|
|
27028
27037
|
const chartTitle = definition.title;
|
|
27029
27038
|
const fontColor = chartMutedFontColor(definition.background);
|
|
27030
27039
|
return {
|
|
27031
27040
|
display: !!chartTitle.text,
|
|
27032
|
-
text:
|
|
27041
|
+
text: chartTitle.text ? getters.dynamicTranslate(chartTitle.text) : "",
|
|
27033
27042
|
color: chartTitle?.color ?? fontColor,
|
|
27034
27043
|
align: chartTitle.align === "center" ? "center" : chartTitle.align === "right" ? "end" : "start",
|
|
27035
27044
|
font: {
|
|
@@ -27597,7 +27606,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
27597
27606
|
layout: getChartLayout(definition, chartData),
|
|
27598
27607
|
scales: getBarChartScales(definition, chartData),
|
|
27599
27608
|
plugins: {
|
|
27600
|
-
title: getChartTitle(definition),
|
|
27609
|
+
title: getChartTitle(definition, getters),
|
|
27601
27610
|
legend: getBarChartLegend(definition),
|
|
27602
27611
|
tooltip: getBarChartTooltip(definition, chartData),
|
|
27603
27612
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -28828,7 +28837,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28828
28837
|
layout: getChartLayout(definition, chartData),
|
|
28829
28838
|
scales: getBarChartScales(definition, chartData),
|
|
28830
28839
|
plugins: {
|
|
28831
|
-
title: getChartTitle(definition),
|
|
28840
|
+
title: getChartTitle(definition, getters),
|
|
28832
28841
|
legend: getComboChartLegend(definition),
|
|
28833
28842
|
tooltip: getBarChartTooltip(definition, chartData),
|
|
28834
28843
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -28974,7 +28983,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28974
28983
|
layout: getChartLayout(definition, chartData),
|
|
28975
28984
|
scales: getFunnelChartScales(definition, chartData),
|
|
28976
28985
|
plugins: {
|
|
28977
|
-
title: getChartTitle(definition),
|
|
28986
|
+
title: getChartTitle(definition, getters),
|
|
28978
28987
|
legend: { display: false },
|
|
28979
28988
|
tooltip: getFunnelChartTooltip(definition, chartData),
|
|
28980
28989
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -29211,8 +29220,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29211
29220
|
background: getters.getStyleOfSingleCellChart(chart.background, dataRange).background,
|
|
29212
29221
|
title: {
|
|
29213
29222
|
...chart.title,
|
|
29214
|
-
|
|
29215
|
-
text: _t(chart.title.text ?? ""),
|
|
29223
|
+
text: chart.title.text ? getters.dynamicTranslate(chart.title.text) : "",
|
|
29216
29224
|
},
|
|
29217
29225
|
minValue: {
|
|
29218
29226
|
value: minValue,
|
|
@@ -29396,7 +29404,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29396
29404
|
layout: getChartLayout(definition, chartData),
|
|
29397
29405
|
scales: getGeoChartScales(definition, chartData),
|
|
29398
29406
|
plugins: {
|
|
29399
|
-
title: getChartTitle(definition),
|
|
29407
|
+
title: getChartTitle(definition, getters),
|
|
29400
29408
|
tooltip: getGeoChartTooltip(definition, chartData),
|
|
29401
29409
|
legend: { display: false },
|
|
29402
29410
|
},
|
|
@@ -29561,7 +29569,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29561
29569
|
layout: getChartLayout(definition, chartData),
|
|
29562
29570
|
scales: getLineChartScales(definition, chartData),
|
|
29563
29571
|
plugins: {
|
|
29564
|
-
title: getChartTitle(definition),
|
|
29572
|
+
title: getChartTitle(definition, getters),
|
|
29565
29573
|
legend: getLineChartLegend(definition),
|
|
29566
29574
|
tooltip: getLineChartTooltip(definition, chartData),
|
|
29567
29575
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -29698,7 +29706,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29698
29706
|
: undefined,
|
|
29699
29707
|
layout: getChartLayout(definition, chartData),
|
|
29700
29708
|
plugins: {
|
|
29701
|
-
title: getChartTitle(definition),
|
|
29709
|
+
title: getChartTitle(definition, getters),
|
|
29702
29710
|
legend: getPieChartLegend(definition, chartData),
|
|
29703
29711
|
tooltip: getPieChartTooltip(definition, chartData),
|
|
29704
29712
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -29852,7 +29860,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29852
29860
|
layout: getChartLayout(definition, chartData),
|
|
29853
29861
|
scales: getPyramidChartScales(definition, chartData),
|
|
29854
29862
|
plugins: {
|
|
29855
|
-
title: getChartTitle(definition),
|
|
29863
|
+
title: getChartTitle(definition, getters),
|
|
29856
29864
|
legend: getBarChartLegend(definition),
|
|
29857
29865
|
tooltip: getPyramidChartTooltip(definition, chartData),
|
|
29858
29866
|
chartShowValuesPlugin: getPyramidChartShowValues(definition, chartData),
|
|
@@ -30001,7 +30009,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
30001
30009
|
layout: getChartLayout(definition, chartData),
|
|
30002
30010
|
scales: getRadarChartScales(definition, chartData),
|
|
30003
30011
|
plugins: {
|
|
30004
|
-
title: getChartTitle(definition),
|
|
30012
|
+
title: getChartTitle(definition, getters),
|
|
30005
30013
|
legend: getRadarChartLegend(definition),
|
|
30006
30014
|
tooltip: getRadarChartTooltip(definition, chartData),
|
|
30007
30015
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -30156,7 +30164,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
30156
30164
|
layout: getChartLayout(definition, chartData),
|
|
30157
30165
|
scales: getScatterChartScales(definition, chartData),
|
|
30158
30166
|
plugins: {
|
|
30159
|
-
title: getChartTitle(definition),
|
|
30167
|
+
title: getChartTitle(definition, getters),
|
|
30160
30168
|
legend: getScatterChartLegend(definition),
|
|
30161
30169
|
tooltip: getLineChartTooltip(definition, chartData),
|
|
30162
30170
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
@@ -30295,7 +30303,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
30295
30303
|
...CHART_COMMON_OPTIONS,
|
|
30296
30304
|
layout: getChartLayout(definition, chartData),
|
|
30297
30305
|
plugins: {
|
|
30298
|
-
title: getChartTitle(definition),
|
|
30306
|
+
title: getChartTitle(definition, getters),
|
|
30299
30307
|
legend: getSunburstChartLegend(definition),
|
|
30300
30308
|
tooltip: getSunburstChartTooltip(definition, chartData),
|
|
30301
30309
|
sunburstLabelsPlugin: getSunburstShowValues(definition, chartData),
|
|
@@ -30445,7 +30453,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
30445
30453
|
...CHART_COMMON_OPTIONS,
|
|
30446
30454
|
layout: getChartLayout(definition, chartData),
|
|
30447
30455
|
plugins: {
|
|
30448
|
-
title: getChartTitle(definition),
|
|
30456
|
+
title: getChartTitle(definition, getters),
|
|
30449
30457
|
legend: { display: false },
|
|
30450
30458
|
tooltip: getTreeMapChartTooltip(definition, chartData),
|
|
30451
30459
|
},
|
|
@@ -30608,7 +30616,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
30608
30616
|
layout: getChartLayout(definition, chartData),
|
|
30609
30617
|
scales: getWaterfallChartScales(definition, chartData),
|
|
30610
30618
|
plugins: {
|
|
30611
|
-
title: getChartTitle(definition),
|
|
30619
|
+
title: getChartTitle(definition, getters),
|
|
30612
30620
|
legend: getWaterfallChartLegend(definition),
|
|
30613
30621
|
tooltip: getWaterfallChartTooltip(definition, chartData),
|
|
30614
30622
|
chartShowValuesPlugin: getWaterfallChartShowValues(definition, chartData),
|
|
@@ -32384,7 +32392,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
32384
32392
|
onFigureDeleted: Function,
|
|
32385
32393
|
editFigureStyle: { type: Function, optional: true },
|
|
32386
32394
|
};
|
|
32387
|
-
static components = { ChartDashboardMenu };
|
|
32395
|
+
static components = { ChartDashboardMenu, MenuPopover };
|
|
32396
|
+
carouselTabsRef = owl.useRef("carouselTabs");
|
|
32397
|
+
carouselTabsDropdownRef = owl.useRef("carouselTabsDropdown");
|
|
32398
|
+
menuState = owl.useState({ isOpen: false, anchorRect: null, menuItems: [] });
|
|
32399
|
+
hiddenItems = [];
|
|
32388
32400
|
animationStore;
|
|
32389
32401
|
setup() {
|
|
32390
32402
|
this.animationStore = useStore(ChartAnimationStore);
|
|
@@ -32395,6 +32407,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
32395
32407
|
else {
|
|
32396
32408
|
this.props.editFigureStyle?.({ "pointer-events": "auto" });
|
|
32397
32409
|
}
|
|
32410
|
+
this.updateTabsVisibility();
|
|
32398
32411
|
});
|
|
32399
32412
|
}
|
|
32400
32413
|
get carousel() {
|
|
@@ -32454,6 +32467,49 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
32454
32467
|
const style = { ...DEFAULT_CAROUSEL_TITLE_STYLE, ...this.carousel.title };
|
|
32455
32468
|
return cssPropertiesToCss(cellTextStyleToCss(chartStyleToCellStyle(style)));
|
|
32456
32469
|
}
|
|
32470
|
+
updateTabsVisibility() {
|
|
32471
|
+
const tabsContainerEl = this.carouselTabsRef.el;
|
|
32472
|
+
const dropDownEl = this.carouselTabsDropdownRef.el;
|
|
32473
|
+
if (!tabsContainerEl || !dropDownEl) {
|
|
32474
|
+
return;
|
|
32475
|
+
}
|
|
32476
|
+
this.hiddenItems = [];
|
|
32477
|
+
const containerRect = getBoundingRectAsPOJO(tabsContainerEl);
|
|
32478
|
+
const tabs = Array.from(tabsContainerEl.children);
|
|
32479
|
+
for (const tab of tabs) {
|
|
32480
|
+
tab.style.display = "block";
|
|
32481
|
+
}
|
|
32482
|
+
const tabWidths = tabs.map((tab) => getBoundingRectAsPOJO(tab).width);
|
|
32483
|
+
let currentWidth = 0;
|
|
32484
|
+
for (let i = 0; i < tabs.length; i++) {
|
|
32485
|
+
const shouldBeHidden = currentWidth + tabWidths[i] > containerRect.width;
|
|
32486
|
+
currentWidth += tabWidths[i];
|
|
32487
|
+
if (shouldBeHidden) {
|
|
32488
|
+
tabs[i].style.display = "none";
|
|
32489
|
+
this.hiddenItems.push(this.carousel.items[i]);
|
|
32490
|
+
}
|
|
32491
|
+
}
|
|
32492
|
+
dropDownEl.style.display = this.hiddenItems.length ? "block" : "none";
|
|
32493
|
+
}
|
|
32494
|
+
get menuId() {
|
|
32495
|
+
return "carousel-tabs-menu-";
|
|
32496
|
+
}
|
|
32497
|
+
toggleMenu(ev) {
|
|
32498
|
+
if (ev.closedMenuId === this.menuId) {
|
|
32499
|
+
this.menuState.isOpen = false;
|
|
32500
|
+
return;
|
|
32501
|
+
}
|
|
32502
|
+
const rect = getRefBoundingRect(this.carouselTabsDropdownRef);
|
|
32503
|
+
const menuItems = this.hiddenItems.map((item) => ({
|
|
32504
|
+
name: this.getItemTitle(item),
|
|
32505
|
+
execute: () => this.onCarouselTabClick(item),
|
|
32506
|
+
isActive: () => this.isItemSelected(item),
|
|
32507
|
+
isReadonlyAllowed: true,
|
|
32508
|
+
}));
|
|
32509
|
+
this.menuState.isOpen = true;
|
|
32510
|
+
this.menuState.anchorRect = rect;
|
|
32511
|
+
this.menuState.menuItems = createActions(menuItems);
|
|
32512
|
+
}
|
|
32457
32513
|
}
|
|
32458
32514
|
|
|
32459
32515
|
class ChartFigure extends owl.Component {
|
|
@@ -39327,6 +39383,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
39327
39383
|
paths: [{ fillColor: color.textColor || TEXT_BODY_MUTED, path: "M120 195 h270 l-135 130" }],
|
|
39328
39384
|
};
|
|
39329
39385
|
}
|
|
39386
|
+
function getCaretUpSvg(color) {
|
|
39387
|
+
return {
|
|
39388
|
+
name: "CARET_UP",
|
|
39389
|
+
width: 512,
|
|
39390
|
+
height: 512,
|
|
39391
|
+
paths: [{ fillColor: color.textColor || TEXT_BODY_MUTED, path: "M120 325 h270 l-135 -130" }],
|
|
39392
|
+
};
|
|
39393
|
+
}
|
|
39330
39394
|
function getHoveredCaretDownSvg(color) {
|
|
39331
39395
|
return {
|
|
39332
39396
|
name: "CARET_DOWN",
|
|
@@ -50433,9 +50497,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
50433
50497
|
maxX: this.env.model.getters.getColDimensions(sheetId, this.env.model.getters.getNumberCols(sheetId) - 1).end,
|
|
50434
50498
|
maxY: this.env.model.getters.getRowDimensions(sheetId, this.env.model.getters.getNumberRows(sheetId) - 1).end,
|
|
50435
50499
|
};
|
|
50500
|
+
let hasStartedDnd = false;
|
|
50436
50501
|
const onMouseMove = (ev) => {
|
|
50437
50502
|
const getters = this.env.model.getters;
|
|
50438
50503
|
const currentMousePosition = { x: ev.clientX, y: ev.clientY };
|
|
50504
|
+
const offsetX = Math.abs(currentMousePosition.x - initialMousePosition.x);
|
|
50505
|
+
const offsetY = Math.abs(currentMousePosition.y - initialMousePosition.y);
|
|
50506
|
+
if (!hasStartedDnd && offsetX < DRAG_THRESHOLD && offsetY < DRAG_THRESHOLD) {
|
|
50507
|
+
return; // add a small threshold to avoid dnd when just clicking
|
|
50508
|
+
}
|
|
50509
|
+
hasStartedDnd = true;
|
|
50439
50510
|
const draggedFigure = dragFigureForMove(currentMousePosition, initialMousePosition, initialFigure, maxDimensions, initialScrollPosition, getters.getActiveSheetScrollInfo());
|
|
50440
50511
|
const otherFigures = this.getOtherFigures(initialFigure.id);
|
|
50441
50512
|
const overlappingCarousel = this.getCarouselOverlappingChart(draggedFigure, otherFigures);
|
|
@@ -55635,7 +55706,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55635
55706
|
return SCORECARD_CHART_TITLE_FONT_SIZE;
|
|
55636
55707
|
}
|
|
55637
55708
|
translate(term) {
|
|
55638
|
-
return
|
|
55709
|
+
return this.env.model.getters.dynamicTranslate(term);
|
|
55639
55710
|
}
|
|
55640
55711
|
setColor(color, colorPickerId) {
|
|
55641
55712
|
switch (colorPickerId) {
|
|
@@ -57187,7 +57258,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57187
57258
|
});
|
|
57188
57259
|
}
|
|
57189
57260
|
const emptyCurrency = {
|
|
57190
|
-
name:
|
|
57261
|
+
name: CustomCurrencyTerms.Custom,
|
|
57191
57262
|
code: "",
|
|
57192
57263
|
symbol: "",
|
|
57193
57264
|
decimalPlaces: 2,
|
|
@@ -58847,12 +58918,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
58847
58918
|
addCalculatedMeasure() {
|
|
58848
58919
|
const { measures } = this.props.definition;
|
|
58849
58920
|
const measureName = this.env.model.getters.generateNewCalculatedMeasureName(measures);
|
|
58921
|
+
const aggregator = "sum";
|
|
58850
58922
|
this.props.onDimensionsUpdated({
|
|
58851
58923
|
measures: measures.concat([
|
|
58852
58924
|
{
|
|
58853
|
-
id: this.getMeasureId(measureName),
|
|
58925
|
+
id: this.getMeasureId(measureName, aggregator),
|
|
58854
58926
|
fieldName: measureName,
|
|
58855
|
-
aggregator
|
|
58927
|
+
aggregator,
|
|
58856
58928
|
computedBy: {
|
|
58857
58929
|
sheetId: this.env.model.getters.getActiveSheetId(),
|
|
58858
58930
|
formula: "=0",
|
|
@@ -61444,14 +61516,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
61444
61516
|
"background-color": this.getBackgroundColor(cellStyle),
|
|
61445
61517
|
});
|
|
61446
61518
|
}
|
|
61447
|
-
get
|
|
61448
|
-
|
|
61449
|
-
|
|
61450
|
-
|
|
61451
|
-
|
|
61452
|
-
|
|
61519
|
+
get verticalJustifyClass() {
|
|
61520
|
+
const cellStyle = this.env.model.getters.getCellComputedStyle(this.props.position);
|
|
61521
|
+
switch (cellStyle.verticalAlign) {
|
|
61522
|
+
case "top":
|
|
61523
|
+
return "justify-content-start";
|
|
61524
|
+
case "middle":
|
|
61525
|
+
return "justify-content-center";
|
|
61526
|
+
case "bottom":
|
|
61453
61527
|
default:
|
|
61454
|
-
return "
|
|
61528
|
+
return "justify-content-end";
|
|
61455
61529
|
}
|
|
61456
61530
|
}
|
|
61457
61531
|
getBackgroundColor(cellStyle) {
|
|
@@ -70652,6 +70726,30 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
70652
70726
|
pivot: { ...definition, collapsedDomains: newDomains },
|
|
70653
70727
|
});
|
|
70654
70728
|
}
|
|
70729
|
+
iconsOnCellRegistry.add("pivot_dashboard_sorting", (getters, position) => {
|
|
70730
|
+
if (!getters.isDashboard()) {
|
|
70731
|
+
return undefined;
|
|
70732
|
+
}
|
|
70733
|
+
const pivotCell = getters.getPivotCellFromPosition(position);
|
|
70734
|
+
if (pivotCell.type !== "MEASURE_HEADER") {
|
|
70735
|
+
return undefined;
|
|
70736
|
+
}
|
|
70737
|
+
const sortDirection = getters.getPivotCellSortDirection(position);
|
|
70738
|
+
if (sortDirection !== "asc" && sortDirection !== "desc") {
|
|
70739
|
+
return undefined;
|
|
70740
|
+
}
|
|
70741
|
+
const cellStyle = getters.getCellComputedStyle(position);
|
|
70742
|
+
return {
|
|
70743
|
+
type: `pivot_dashboard_sorting_${sortDirection}`,
|
|
70744
|
+
priority: 5,
|
|
70745
|
+
horizontalAlign: "right",
|
|
70746
|
+
size: GRID_ICON_EDGE_LENGTH,
|
|
70747
|
+
margin: GRID_ICON_MARGIN,
|
|
70748
|
+
svg: sortDirection === "asc" ? getCaretUpSvg(cellStyle) : getCaretDownSvg(cellStyle),
|
|
70749
|
+
position,
|
|
70750
|
+
onClick: undefined, // click is managed by ClickableCellSortIcon
|
|
70751
|
+
};
|
|
70752
|
+
});
|
|
70655
70753
|
|
|
70656
70754
|
class CellIconPlugin extends CoreViewPlugin {
|
|
70657
70755
|
static getters = ["doesCellHaveGridIcon", "getCellIcons", "getCellIconRect"];
|
|
@@ -71131,7 +71229,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
71131
71229
|
return { value: 0 };
|
|
71132
71230
|
}
|
|
71133
71231
|
const { columns, rows } = super.definition;
|
|
71134
|
-
if (columns.length + rows.length !== domain.length) {
|
|
71232
|
+
if (measure.aggregator && columns.length + rows.length !== domain.length) {
|
|
71135
71233
|
const values = this.getValuesToAggregate(measure, domain);
|
|
71136
71234
|
const aggregator = AGGREGATORS_FN[measure.aggregator];
|
|
71137
71235
|
if (!aggregator) {
|
|
@@ -71150,11 +71248,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
71150
71248
|
if (columns.find((col) => col.nameWithGranularity === symbolName)) {
|
|
71151
71249
|
const { colDomain } = domainToColRowDomain(this, domain);
|
|
71152
71250
|
const symbolIndex = colDomain.findIndex((node) => node.field === symbolName);
|
|
71251
|
+
if (symbolIndex === -1) {
|
|
71252
|
+
return new NotAvailableError();
|
|
71253
|
+
}
|
|
71153
71254
|
return this.getPivotHeaderValueAndFormat(colDomain.slice(0, symbolIndex + 1));
|
|
71154
71255
|
}
|
|
71155
71256
|
if (rows.find((row) => row.nameWithGranularity === symbolName)) {
|
|
71156
71257
|
const { rowDomain } = domainToColRowDomain(this, domain);
|
|
71157
71258
|
const symbolIndex = rowDomain.findIndex((row) => row.field === symbolName);
|
|
71259
|
+
if (symbolIndex === -1) {
|
|
71260
|
+
return new NotAvailableError();
|
|
71261
|
+
}
|
|
71158
71262
|
return this.getPivotHeaderValueAndFormat(rowDomain.slice(0, symbolIndex + 1));
|
|
71159
71263
|
}
|
|
71160
71264
|
return this.getPivotCellValueAndFormat(symbolName, domain);
|
|
@@ -75548,6 +75652,21 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
75548
75652
|
}
|
|
75549
75653
|
}
|
|
75550
75654
|
|
|
75655
|
+
/**
|
|
75656
|
+
* This plugin provides dynamic translation getter. In o-spreadsheet, it has
|
|
75657
|
+
* no implementation, but this plugin can be replaced by another one to provide
|
|
75658
|
+
* a real implementation.
|
|
75659
|
+
*
|
|
75660
|
+
* For example, in Odoo, the plugin is replaced by a plugin that used the
|
|
75661
|
+
* module namespace to dynamically translate terms.
|
|
75662
|
+
*/
|
|
75663
|
+
class DynamicTranslate extends UIPlugin {
|
|
75664
|
+
static getters = ["dynamicTranslate"];
|
|
75665
|
+
dynamicTranslate(term) {
|
|
75666
|
+
return term;
|
|
75667
|
+
}
|
|
75668
|
+
}
|
|
75669
|
+
|
|
75551
75670
|
const genericRepeatsTransforms = [
|
|
75552
75671
|
repeatSheetDependantCommand,
|
|
75553
75672
|
repeatTargetDependantCommand,
|
|
@@ -77518,13 +77637,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
77518
77637
|
const deltaCol = isBasedBefore && isCol ? thickness : 0;
|
|
77519
77638
|
const deltaRow = isBasedBefore && !isCol ? thickness : 0;
|
|
77520
77639
|
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
77521
|
-
const originalSize =
|
|
77522
|
-
|
|
77523
|
-
|
|
77524
|
-
|
|
77525
|
-
const isDefaultCol = isCol && size === DEFAULT_CELL_WIDTH;
|
|
77526
|
-
return [element, isDefaultCol ? undefined : size];
|
|
77527
|
-
}));
|
|
77640
|
+
const originalSize = {};
|
|
77641
|
+
for (const element of toRemove) {
|
|
77642
|
+
originalSize[element] = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, element);
|
|
77643
|
+
}
|
|
77528
77644
|
const target = [
|
|
77529
77645
|
{
|
|
77530
77646
|
left: isCol ? start + deltaCol : 0,
|
|
@@ -77568,11 +77684,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
77568
77684
|
for (const element of toRemove) {
|
|
77569
77685
|
const size = originalSize[element];
|
|
77570
77686
|
const currentSize = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, currentIndex);
|
|
77571
|
-
if (size
|
|
77687
|
+
if (size !== currentSize) {
|
|
77572
77688
|
resizingGroups[size] ??= [];
|
|
77573
77689
|
resizingGroups[size].push(currentIndex);
|
|
77574
|
-
currentIndex += 1;
|
|
77575
77690
|
}
|
|
77691
|
+
currentIndex += 1;
|
|
77576
77692
|
}
|
|
77577
77693
|
for (const size in resizingGroups) {
|
|
77578
77694
|
this.dispatch("RESIZE_COLUMNS_ROWS", {
|
|
@@ -79179,6 +79295,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
79179
79295
|
.add("table_ui_resize", TableResizeUI)
|
|
79180
79296
|
.add("datavalidation_insert", DataValidationInsertionPlugin)
|
|
79181
79297
|
.add("checkbox_toggle", CheckboxTogglePlugin)
|
|
79298
|
+
.add("dynamic_translate", DynamicTranslate)
|
|
79182
79299
|
.add("geo_features", GeoFeaturePlugin);
|
|
79183
79300
|
// Plugins which have a state, but which should not be shared in collaborative
|
|
79184
79301
|
const statefulUIPluginRegistry = new Registry()
|
|
@@ -88389,6 +88506,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
88389
88506
|
exports.coreTypes = coreTypes;
|
|
88390
88507
|
exports.findCellInNewZone = findCellInNewZone;
|
|
88391
88508
|
exports.functionCache = functionCache;
|
|
88509
|
+
exports.getCaretDownSvg = getCaretDownSvg;
|
|
88510
|
+
exports.getCaretUpSvg = getCaretUpSvg;
|
|
88392
88511
|
exports.helpers = helpers;
|
|
88393
88512
|
exports.hooks = hooks;
|
|
88394
88513
|
exports.invalidateCFEvaluationCommands = invalidateCFEvaluationCommands;
|
|
@@ -88409,9 +88528,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
88409
88528
|
exports.tokenize = tokenize;
|
|
88410
88529
|
|
|
88411
88530
|
|
|
88412
|
-
__info__.version = "19.0.
|
|
88413
|
-
__info__.date = "2025-09-
|
|
88414
|
-
__info__.hash = "
|
|
88531
|
+
__info__.version = "19.0.3";
|
|
88532
|
+
__info__.date = "2025-09-19T07:26:41.356Z";
|
|
88533
|
+
__info__.hash = "84f3b74";
|
|
88415
88534
|
|
|
88416
88535
|
|
|
88417
88536
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|