@odoo/o-spreadsheet 18.2.0 → 18.2.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 +120 -68
- package/dist/o-spreadsheet.d.ts +20 -11
- package/dist/o-spreadsheet.esm.js +120 -68
- package/dist/o-spreadsheet.iife.js +120 -68
- package/dist/o-spreadsheet.iife.min.js +7 -7
- package/dist/o_spreadsheet.xml +3 -3
- package/package.json +2 -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 18.2.
|
|
6
|
-
* @date 2025-02-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.2.1
|
|
6
|
+
* @date 2025-02-25T06:03:13.262Z
|
|
7
|
+
* @hash 3b4b5c9
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, App, blockDom, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
|
@@ -4458,7 +4458,7 @@ function dichotomicSearch(data, target, mode, sortOrder, rangeLength, getValueIn
|
|
|
4458
4458
|
* @param reverseSearch if true, search in the array starting from the end.
|
|
4459
4459
|
|
|
4460
4460
|
*/
|
|
4461
|
-
function linearSearch(data, target, mode, numberOfValues, getValueInData, reverseSearch = false) {
|
|
4461
|
+
function linearSearch(data, target, mode, numberOfValues, getValueInData, lookupCaches, reverseSearch = false) {
|
|
4462
4462
|
if (target === undefined || target.value === null) {
|
|
4463
4463
|
return -1;
|
|
4464
4464
|
}
|
|
@@ -4467,17 +4467,48 @@ function linearSearch(data, target, mode, numberOfValues, getValueInData, revers
|
|
|
4467
4467
|
}
|
|
4468
4468
|
const _target = normalizeValue(target.value);
|
|
4469
4469
|
const getValue = reverseSearch
|
|
4470
|
-
? (data, i) => getValueInData(data, numberOfValues - i - 1)
|
|
4471
|
-
: getValueInData;
|
|
4470
|
+
? (data, i) => normalizeValue(getValueInData(data, numberOfValues - i - 1))
|
|
4471
|
+
: (data, i) => normalizeValue(getValueInData(data, i));
|
|
4472
|
+
// first check if the target is in the cache
|
|
4473
|
+
const isNotWildcardTarget = mode !== "wildcard" ||
|
|
4474
|
+
typeof _target !== "string" ||
|
|
4475
|
+
!(_target.includes("*") || _target.includes("?"));
|
|
4476
|
+
if (lookupCaches && isNotWildcardTarget) {
|
|
4477
|
+
const searchMode = reverseSearch ? "reverseSearch" : "forwardSearch";
|
|
4478
|
+
let cache = lookupCaches[searchMode].get(data);
|
|
4479
|
+
if (cache === undefined) {
|
|
4480
|
+
// build the cache for all the values
|
|
4481
|
+
cache = new Map();
|
|
4482
|
+
for (let i = 0; i < numberOfValues; i++) {
|
|
4483
|
+
const value = getValue(data, i) ?? null;
|
|
4484
|
+
if (!cache.has(value)) {
|
|
4485
|
+
cache.set(value, i);
|
|
4486
|
+
}
|
|
4487
|
+
}
|
|
4488
|
+
lookupCaches[searchMode].set(data, cache);
|
|
4489
|
+
}
|
|
4490
|
+
if (cache.has(_target)) {
|
|
4491
|
+
const resultIndex = cache.get(_target);
|
|
4492
|
+
return reverseSearch ? numberOfValues - resultIndex - 1 : resultIndex;
|
|
4493
|
+
}
|
|
4494
|
+
if (mode === "strict") {
|
|
4495
|
+
return -1;
|
|
4496
|
+
}
|
|
4497
|
+
}
|
|
4498
|
+
// else perform the linear search
|
|
4499
|
+
const resultIndex = _linearSearch(data, _target, mode, numberOfValues, getValue);
|
|
4500
|
+
return reverseSearch && resultIndex !== -1 ? numberOfValues - resultIndex - 1 : resultIndex;
|
|
4501
|
+
}
|
|
4502
|
+
function _linearSearch(data, _target, mode, numberOfValues, getNormalizeValue) {
|
|
4472
4503
|
let indexMatchTarget = (i) => {
|
|
4473
|
-
return
|
|
4504
|
+
return getNormalizeValue(data, i) === _target;
|
|
4474
4505
|
};
|
|
4475
4506
|
if (mode === "wildcard" &&
|
|
4476
4507
|
typeof _target === "string" &&
|
|
4477
4508
|
(_target.includes("*") || _target.includes("?"))) {
|
|
4478
4509
|
const regExp = wildcardToRegExp(_target);
|
|
4479
4510
|
indexMatchTarget = (i) => {
|
|
4480
|
-
const value =
|
|
4511
|
+
const value = getNormalizeValue(data, i);
|
|
4481
4512
|
if (typeof value === "string") {
|
|
4482
4513
|
return regExp.test(value);
|
|
4483
4514
|
}
|
|
@@ -4488,7 +4519,7 @@ function linearSearch(data, target, mode, numberOfValues, getValueInData, revers
|
|
|
4488
4519
|
let closestMatchIndex = -1;
|
|
4489
4520
|
if (mode === "nextSmaller") {
|
|
4490
4521
|
indexMatchTarget = (i) => {
|
|
4491
|
-
const value =
|
|
4522
|
+
const value = getNormalizeValue(data, i);
|
|
4492
4523
|
if ((!closestMatch && compareCellValues(_target, value) >= 0) ||
|
|
4493
4524
|
(compareCellValues(_target, value) >= 0 && compareCellValues(value, closestMatch) > 0)) {
|
|
4494
4525
|
closestMatch = value;
|
|
@@ -4499,7 +4530,7 @@ function linearSearch(data, target, mode, numberOfValues, getValueInData, revers
|
|
|
4499
4530
|
}
|
|
4500
4531
|
if (mode === "nextGreater") {
|
|
4501
4532
|
indexMatchTarget = (i) => {
|
|
4502
|
-
const value =
|
|
4533
|
+
const value = getNormalizeValue(data, i);
|
|
4503
4534
|
if ((!closestMatch && compareCellValues(_target, value) <= 0) ||
|
|
4504
4535
|
(compareCellValues(_target, value) <= 0 && compareCellValues(value, closestMatch) < 0)) {
|
|
4505
4536
|
closestMatch = value;
|
|
@@ -4510,12 +4541,10 @@ function linearSearch(data, target, mode, numberOfValues, getValueInData, revers
|
|
|
4510
4541
|
}
|
|
4511
4542
|
for (let i = 0; i < numberOfValues; i++) {
|
|
4512
4543
|
if (indexMatchTarget(i)) {
|
|
4513
|
-
return
|
|
4544
|
+
return i;
|
|
4514
4545
|
}
|
|
4515
4546
|
}
|
|
4516
|
-
return
|
|
4517
|
-
? numberOfValues - closestMatchIndex - 1
|
|
4518
|
-
: closestMatchIndex;
|
|
4547
|
+
return closestMatchIndex;
|
|
4519
4548
|
}
|
|
4520
4549
|
/**
|
|
4521
4550
|
* Normalize a value.
|
|
@@ -6489,10 +6518,11 @@ class UuidGenerator {
|
|
|
6489
6518
|
*
|
|
6490
6519
|
*/
|
|
6491
6520
|
smallUuid() {
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6521
|
+
if (window.crypto) {
|
|
6522
|
+
return "10000000-1000".replace(/[01]/g, (c) => {
|
|
6523
|
+
const n = Number(c);
|
|
6524
|
+
return (n ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (n / 4)))).toString(16);
|
|
6525
|
+
});
|
|
6496
6526
|
}
|
|
6497
6527
|
else {
|
|
6498
6528
|
// mainly for jest and other browsers that do not have the crypto functionality
|
|
@@ -6507,10 +6537,11 @@ class UuidGenerator {
|
|
|
6507
6537
|
* This method should be used when you need to avoid collisions at all costs, like the id of a revision.
|
|
6508
6538
|
*/
|
|
6509
6539
|
uuidv4() {
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6540
|
+
if (window.crypto) {
|
|
6541
|
+
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => {
|
|
6542
|
+
const n = Number(c);
|
|
6543
|
+
return (n ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (n / 4)))).toString(16);
|
|
6544
|
+
});
|
|
6514
6545
|
}
|
|
6515
6546
|
else {
|
|
6516
6547
|
// mainly for jest and other browsers that do not have the crypto functionality
|
|
@@ -18684,7 +18715,7 @@ const HLOOKUP = {
|
|
|
18684
18715
|
const _isSorted = toBoolean(isSorted.value);
|
|
18685
18716
|
const colIndex = _isSorted
|
|
18686
18717
|
? dichotomicSearch(_range, searchKey, "nextSmaller", "asc", _range.length, getValueFromRange)
|
|
18687
|
-
: linearSearch(_range, searchKey, "wildcard", _range.length, getValueFromRange);
|
|
18718
|
+
: linearSearch(_range, searchKey, "wildcard", _range.length, getValueFromRange, this.lookupCaches);
|
|
18688
18719
|
const col = _range[colIndex];
|
|
18689
18720
|
if (col === undefined) {
|
|
18690
18721
|
return valueNotAvailable(searchKey);
|
|
@@ -18839,7 +18870,7 @@ const MATCH = {
|
|
|
18839
18870
|
index = dichotomicSearch(_range, searchKey, "nextSmaller", "asc", rangeLen, getElement);
|
|
18840
18871
|
break;
|
|
18841
18872
|
case 0:
|
|
18842
|
-
index = linearSearch(_range, searchKey, "wildcard", rangeLen, getElement);
|
|
18873
|
+
index = linearSearch(_range, searchKey, "wildcard", rangeLen, getElement, this.lookupCaches);
|
|
18843
18874
|
break;
|
|
18844
18875
|
case -1:
|
|
18845
18876
|
index = dichotomicSearch(_range, searchKey, "nextGreater", "desc", rangeLen, getElement);
|
|
@@ -18907,7 +18938,7 @@ const VLOOKUP = {
|
|
|
18907
18938
|
const _isSorted = toBoolean(isSorted.value);
|
|
18908
18939
|
const rowIndex = _isSorted
|
|
18909
18940
|
? dichotomicSearch(_range, searchKey, "nextSmaller", "asc", _range[0].length, getValueFromRange)
|
|
18910
|
-
: linearSearch(_range, searchKey, "wildcard", _range[0].length, getValueFromRange);
|
|
18941
|
+
: linearSearch(_range, searchKey, "wildcard", _range[0].length, getValueFromRange, this.lookupCaches);
|
|
18911
18942
|
const value = _range[_index - 1][rowIndex];
|
|
18912
18943
|
if (value === undefined) {
|
|
18913
18944
|
return valueNotAvailable(searchKey);
|
|
@@ -18963,7 +18994,7 @@ const XLOOKUP = {
|
|
|
18963
18994
|
const reverseSearch = _searchMode === -1;
|
|
18964
18995
|
const index = _searchMode === 2 || _searchMode === -2
|
|
18965
18996
|
? dichotomicSearch(_lookupRange, searchKey, mode, _searchMode === 2 ? "asc" : "desc", rangeLen, getElement)
|
|
18966
|
-
: linearSearch(_lookupRange, searchKey, mode, rangeLen, getElement, reverseSearch);
|
|
18997
|
+
: linearSearch(_lookupRange, searchKey, mode, rangeLen, getElement, this.lookupCaches, reverseSearch);
|
|
18967
18998
|
if (index !== -1) {
|
|
18968
18999
|
return lookupDirection === "col"
|
|
18969
19000
|
? _returnRange.map((col) => [col[index]])
|
|
@@ -28302,7 +28333,7 @@ function getBarChartData(definition, dataSets, labelRange, getters) {
|
|
|
28302
28333
|
}
|
|
28303
28334
|
function getPyramidChartData(definition, dataSets, labelRange, getters) {
|
|
28304
28335
|
const barChartData = getBarChartData(definition, dataSets, labelRange, getters);
|
|
28305
|
-
const barDataset = barChartData.dataSetsValues;
|
|
28336
|
+
const barDataset = barChartData.dataSetsValues.filter((ds) => !ds.hidden);
|
|
28306
28337
|
const pyramidDatasetValues = [];
|
|
28307
28338
|
if (barDataset[0]) {
|
|
28308
28339
|
const pyramidData = barDataset[0].data.map((value) => (value > 0 ? value : 0));
|
|
@@ -28779,10 +28810,8 @@ function getChartDatasetFormat(getters, allDataSets, axis) {
|
|
|
28779
28810
|
function getChartDatasetValues(getters, dataSets) {
|
|
28780
28811
|
const datasetValues = [];
|
|
28781
28812
|
for (const [dsIndex, ds] of Object.entries(dataSets)) {
|
|
28782
|
-
if (getters.isColHidden(ds.dataRange.sheetId, ds.dataRange.zone.left)) {
|
|
28783
|
-
continue;
|
|
28784
|
-
}
|
|
28785
28813
|
let label;
|
|
28814
|
+
let hidden = getters.isColHidden(ds.dataRange.sheetId, ds.dataRange.zone.left);
|
|
28786
28815
|
if (ds.labelCell) {
|
|
28787
28816
|
const labelRange = ds.labelCell;
|
|
28788
28817
|
const cell = labelRange
|
|
@@ -28809,9 +28838,9 @@ function getChartDatasetValues(getters, dataSets) {
|
|
|
28809
28838
|
data.fill(1);
|
|
28810
28839
|
}
|
|
28811
28840
|
else if (data.every((cell) => cell === undefined || cell === null || !isNumber(cell.toString(), DEFAULT_LOCALE))) {
|
|
28812
|
-
|
|
28841
|
+
hidden = true;
|
|
28813
28842
|
}
|
|
28814
|
-
datasetValues.push({ data, label });
|
|
28843
|
+
datasetValues.push({ data, label, hidden });
|
|
28815
28844
|
}
|
|
28816
28845
|
return datasetValues;
|
|
28817
28846
|
}
|
|
@@ -28822,12 +28851,13 @@ function getBarChartDatasets(definition, args) {
|
|
|
28822
28851
|
const colors = getChartColorsGenerator(definition, dataSetsValues.length);
|
|
28823
28852
|
const trendDatasets = [];
|
|
28824
28853
|
for (const index in dataSetsValues) {
|
|
28825
|
-
let { label, data } = dataSetsValues[index];
|
|
28854
|
+
let { label, data, hidden } = dataSetsValues[index];
|
|
28826
28855
|
label = definition.dataSets?.[index].label || label;
|
|
28827
28856
|
const backgroundColor = colors.next();
|
|
28828
28857
|
const dataset = {
|
|
28829
28858
|
label,
|
|
28830
28859
|
data,
|
|
28860
|
+
hidden,
|
|
28831
28861
|
borderColor: definition.background || BACKGROUND_CHART_COLOR,
|
|
28832
28862
|
borderWidth: definition.stacked ? 1 : 0,
|
|
28833
28863
|
backgroundColor,
|
|
@@ -28860,6 +28890,9 @@ function getWaterfallDatasetAndLabels(definition, args) {
|
|
|
28860
28890
|
const labelsWithSubTotals = [];
|
|
28861
28891
|
let lastValue = 0;
|
|
28862
28892
|
for (const dataSetsValue of dataSetsValues) {
|
|
28893
|
+
if (dataSetsValue.hidden) {
|
|
28894
|
+
continue;
|
|
28895
|
+
}
|
|
28863
28896
|
for (let i = 0; i < dataSetsValue.data.length; i++) {
|
|
28864
28897
|
const data = dataSetsValue.data[i];
|
|
28865
28898
|
labelsWithSubTotals.push(labels[i]);
|
|
@@ -28895,7 +28928,7 @@ function getLineChartDatasets(definition, args) {
|
|
|
28895
28928
|
const trendDatasets = [];
|
|
28896
28929
|
const colors = getChartColorsGenerator(definition, dataSetsValues.length);
|
|
28897
28930
|
for (let index = 0; index < dataSetsValues.length; index++) {
|
|
28898
|
-
let { label, data } = dataSetsValues[index];
|
|
28931
|
+
let { label, data, hidden } = dataSetsValues[index];
|
|
28899
28932
|
label = definition.dataSets?.[index].label || label;
|
|
28900
28933
|
const color = colors.next();
|
|
28901
28934
|
if (axisType && ["linear", "time"].includes(axisType)) {
|
|
@@ -28905,6 +28938,7 @@ function getLineChartDatasets(definition, args) {
|
|
|
28905
28938
|
const dataset = {
|
|
28906
28939
|
label,
|
|
28907
28940
|
data,
|
|
28941
|
+
hidden,
|
|
28908
28942
|
tension: 0, // 0 -> render straight lines, which is much faster
|
|
28909
28943
|
borderColor: color,
|
|
28910
28944
|
backgroundColor: areaChart ? setColorAlpha(color, LINE_FILL_TRANSPARENCY) : color,
|
|
@@ -28937,7 +28971,9 @@ function getPieChartDatasets(definition, args) {
|
|
|
28937
28971
|
const dataSets = [];
|
|
28938
28972
|
const dataSetsLength = Math.max(0, ...dataSetsValues.map((ds) => ds?.data?.length ?? 0));
|
|
28939
28973
|
const backgroundColor = getPieColors(new ColorGenerator(dataSetsLength), dataSetsValues);
|
|
28940
|
-
for (const { label, data } of dataSetsValues) {
|
|
28974
|
+
for (const { label, data, hidden } of dataSetsValues) {
|
|
28975
|
+
if (hidden)
|
|
28976
|
+
continue;
|
|
28941
28977
|
const dataset = {
|
|
28942
28978
|
label,
|
|
28943
28979
|
data,
|
|
@@ -28955,7 +28991,7 @@ function getComboChartDatasets(definition, args) {
|
|
|
28955
28991
|
const colors = getChartColorsGenerator(definition, dataSetsValues.length);
|
|
28956
28992
|
const trendDatasets = [];
|
|
28957
28993
|
for (let index = 0; index < dataSetsValues.length; index++) {
|
|
28958
|
-
let { label, data } = dataSetsValues[index];
|
|
28994
|
+
let { label, data, hidden } = dataSetsValues[index];
|
|
28959
28995
|
label = definition.dataSets?.[index].label || label;
|
|
28960
28996
|
const design = definition.dataSets?.[index];
|
|
28961
28997
|
const color = colors.next();
|
|
@@ -28963,6 +28999,7 @@ function getComboChartDatasets(definition, args) {
|
|
|
28963
28999
|
const dataset = {
|
|
28964
29000
|
label: label,
|
|
28965
29001
|
data,
|
|
29002
|
+
hidden,
|
|
28966
29003
|
borderColor: color,
|
|
28967
29004
|
backgroundColor: color,
|
|
28968
29005
|
yAxisID: definition.dataSets?.[index].yAxisId || "y",
|
|
@@ -28987,7 +29024,7 @@ function getRadarChartDatasets(definition, args) {
|
|
|
28987
29024
|
const fill = definition.fillArea ?? false;
|
|
28988
29025
|
const colors = getChartColorsGenerator(definition, dataSetsValues.length);
|
|
28989
29026
|
for (let i = 0; i < dataSetsValues.length; i++) {
|
|
28990
|
-
let { label, data } = dataSetsValues[i];
|
|
29027
|
+
let { label, data, hidden } = dataSetsValues[i];
|
|
28991
29028
|
if (definition.dataSets?.[i]?.label) {
|
|
28992
29029
|
label = definition.dataSets[i].label;
|
|
28993
29030
|
}
|
|
@@ -28995,6 +29032,7 @@ function getRadarChartDatasets(definition, args) {
|
|
|
28995
29032
|
const dataset = {
|
|
28996
29033
|
label,
|
|
28997
29034
|
data,
|
|
29035
|
+
hidden,
|
|
28998
29036
|
borderColor,
|
|
28999
29037
|
backgroundColor: borderColor,
|
|
29000
29038
|
};
|
|
@@ -29140,6 +29178,11 @@ function getPieChartLegend(definition, args) {
|
|
|
29140
29178
|
hidden: false,
|
|
29141
29179
|
lineWidth: 2,
|
|
29142
29180
|
})),
|
|
29181
|
+
filter: (legendItem, data) => {
|
|
29182
|
+
return "datasetIndex" in legendItem
|
|
29183
|
+
? !data.datasets[legendItem.datasetIndex].hidden
|
|
29184
|
+
: true;
|
|
29185
|
+
},
|
|
29143
29186
|
},
|
|
29144
29187
|
};
|
|
29145
29188
|
}
|
|
@@ -29201,6 +29244,11 @@ function getWaterfallChartLegend(definition, args) {
|
|
|
29201
29244
|
}
|
|
29202
29245
|
return legendValues;
|
|
29203
29246
|
},
|
|
29247
|
+
filter: (legendItem, data) => {
|
|
29248
|
+
return "datasetIndex" in legendItem
|
|
29249
|
+
? !data.datasets[legendItem.datasetIndex].hidden
|
|
29250
|
+
: true;
|
|
29251
|
+
},
|
|
29204
29252
|
},
|
|
29205
29253
|
onClick: () => { }, // Disables click interaction with the waterfall chart legend items
|
|
29206
29254
|
};
|
|
@@ -29284,6 +29332,11 @@ function getCustomLegendLabels(fontColor, legendLabelConfig) {
|
|
|
29284
29332
|
...legendLabelConfig,
|
|
29285
29333
|
};
|
|
29286
29334
|
}),
|
|
29335
|
+
filter: (legendItem, data) => {
|
|
29336
|
+
return "datasetIndex" in legendItem
|
|
29337
|
+
? !data.datasets[legendItem.datasetIndex].hidden
|
|
29338
|
+
: true;
|
|
29339
|
+
},
|
|
29287
29340
|
},
|
|
29288
29341
|
};
|
|
29289
29342
|
}
|
|
@@ -29617,7 +29670,7 @@ const templates = /* xml */ `
|
|
|
29617
29670
|
<div
|
|
29618
29671
|
class="o-chart-custom-tooltip border rounded px-2 py-1 pe-none mw-100 position-absolute text-nowrap shadow opacity-100">
|
|
29619
29672
|
<table class="overflow-hidden m-0">
|
|
29620
|
-
<thead>
|
|
29673
|
+
<thead t-if="title">
|
|
29621
29674
|
<tr>
|
|
29622
29675
|
<th class="o-tooltip-title align-baseline border-0 text-truncate" t-esc="title" t-attf-style="max-width: {{ labelsMaxWidth }}"/>
|
|
29623
29676
|
</tr>
|
|
@@ -29678,8 +29731,8 @@ function getBarChartTooltip(definition, args) {
|
|
|
29678
29731
|
? undefined
|
|
29679
29732
|
: "";
|
|
29680
29733
|
},
|
|
29734
|
+
beforeLabel: (tooltipItem) => tooltipItem.dataset?.label || tooltipItem.label,
|
|
29681
29735
|
label: function (tooltipItem) {
|
|
29682
|
-
const xLabel = tooltipItem.dataset?.label || tooltipItem.label;
|
|
29683
29736
|
const horizontalChart = definition.horizontal;
|
|
29684
29737
|
let yLabel = horizontalChart ? tooltipItem.parsed.x : tooltipItem.parsed.y;
|
|
29685
29738
|
if (yLabel === undefined || yLabel === null) {
|
|
@@ -29687,7 +29740,7 @@ function getBarChartTooltip(definition, args) {
|
|
|
29687
29740
|
}
|
|
29688
29741
|
const axisId = horizontalChart ? tooltipItem.dataset.xAxisID : tooltipItem.dataset.yAxisID;
|
|
29689
29742
|
const yLabelStr = formatChartDatasetValue(args.axisFormats, args.locale)(yLabel, axisId);
|
|
29690
|
-
return
|
|
29743
|
+
return yLabelStr;
|
|
29691
29744
|
},
|
|
29692
29745
|
},
|
|
29693
29746
|
};
|
|
@@ -29712,21 +29765,18 @@ function getLineChartTooltip(definition, args) {
|
|
|
29712
29765
|
const formattedX = formatValue(label, { locale, format: labelFormat });
|
|
29713
29766
|
const axisId = tooltipItem.dataset.yAxisID || "y";
|
|
29714
29767
|
const formattedY = formatValue(dataSetPoint, { locale, format: axisFormats?.[axisId] });
|
|
29715
|
-
|
|
29716
|
-
return formattedX
|
|
29717
|
-
? `${dataSetTitle}: (${formattedX}, ${formattedY})`
|
|
29718
|
-
: `${dataSetTitle}: ${formattedY}`;
|
|
29768
|
+
return formattedX ? `(${formattedX}, ${formattedY})` : `${formattedY}`;
|
|
29719
29769
|
};
|
|
29720
29770
|
}
|
|
29721
29771
|
else {
|
|
29722
29772
|
tooltip.callbacks.label = function (tooltipItem) {
|
|
29723
|
-
const xLabel = tooltipItem.dataset?.label || tooltipItem.label;
|
|
29724
29773
|
const yLabel = tooltipItem.parsed.y;
|
|
29725
29774
|
const axisId = tooltipItem.dataset.yAxisID;
|
|
29726
29775
|
const yLabelStr = formatChartDatasetValue(axisFormats, locale)(yLabel, axisId);
|
|
29727
|
-
return
|
|
29776
|
+
return yLabelStr;
|
|
29728
29777
|
};
|
|
29729
29778
|
}
|
|
29779
|
+
tooltip.callbacks.beforeLabel = (tooltipItem) => tooltipItem.dataset?.label || tooltipItem.label;
|
|
29730
29780
|
tooltip.callbacks.title = function (tooltipItems) {
|
|
29731
29781
|
const displayTooltipTitle = axisType !== "linear" &&
|
|
29732
29782
|
tooltipItems.some((item) => item.dataset.xAxisID !== TREND_LINE_XAXIS_ID);
|
|
@@ -29744,17 +29794,15 @@ function getPieChartTooltip(definition, args) {
|
|
|
29744
29794
|
title: function (tooltipItems) {
|
|
29745
29795
|
return tooltipItems[0].dataset.label;
|
|
29746
29796
|
},
|
|
29797
|
+
beforeLabel: (tooltipItem) => tooltipItem.label || tooltipItem.dataset.label,
|
|
29747
29798
|
label: function (tooltipItem) {
|
|
29748
29799
|
const data = tooltipItem.dataset.data;
|
|
29749
29800
|
const dataIndex = tooltipItem.dataIndex;
|
|
29750
29801
|
const percentage = calculatePercentage(data, dataIndex);
|
|
29751
|
-
const xLabel = tooltipItem.label || tooltipItem.dataset.label;
|
|
29752
29802
|
const yLabel = tooltipItem.parsed.y ?? tooltipItem.parsed;
|
|
29753
29803
|
const toolTipFormat = !format && yLabel >= 1000 ? "#,##" : format;
|
|
29754
29804
|
const yLabelStr = formatValue(yLabel, { format: toolTipFormat, locale });
|
|
29755
|
-
return
|
|
29756
|
-
? `${xLabel}: ${yLabelStr} (${percentage}%)`
|
|
29757
|
-
: `${yLabelStr} (${percentage}%)`;
|
|
29805
|
+
return `${yLabelStr} (${percentage}%)`;
|
|
29758
29806
|
},
|
|
29759
29807
|
},
|
|
29760
29808
|
};
|
|
@@ -29767,16 +29815,17 @@ function getWaterfallChartTooltip(definition, args) {
|
|
|
29767
29815
|
enabled: false,
|
|
29768
29816
|
external: customTooltipHandler,
|
|
29769
29817
|
callbacks: {
|
|
29770
|
-
|
|
29771
|
-
const [lastValue, currentValue] = tooltipItem.raw;
|
|
29772
|
-
const yLabel = currentValue - lastValue;
|
|
29818
|
+
beforeLabel: function (tooltipItem) {
|
|
29773
29819
|
const dataSeriesIndex = labels.length
|
|
29774
29820
|
? Math.floor(tooltipItem.dataIndex / labels.length)
|
|
29775
29821
|
: 0;
|
|
29776
|
-
|
|
29822
|
+
return dataSeriesLabels[dataSeriesIndex];
|
|
29823
|
+
},
|
|
29824
|
+
label: function (tooltipItem) {
|
|
29825
|
+
const [lastValue, currentValue] = tooltipItem.raw;
|
|
29826
|
+
const yLabel = currentValue - lastValue;
|
|
29777
29827
|
const toolTipFormat = !format && Math.abs(yLabel) > 1000 ? "#,##" : format;
|
|
29778
|
-
|
|
29779
|
-
return dataSeriesLabel ? `${dataSeriesLabel}: ${yLabelStr}` : yLabelStr;
|
|
29828
|
+
return formatValue(yLabel, { format: toolTipFormat, locale });
|
|
29780
29829
|
},
|
|
29781
29830
|
},
|
|
29782
29831
|
};
|
|
@@ -29800,11 +29849,10 @@ function getRadarChartTooltip(definition, args) {
|
|
|
29800
29849
|
enabled: false,
|
|
29801
29850
|
external: customTooltipHandler,
|
|
29802
29851
|
callbacks: {
|
|
29852
|
+
beforeLabel: (tooltipItem) => tooltipItem.dataset?.label || tooltipItem.label,
|
|
29803
29853
|
label: function (tooltipItem) {
|
|
29804
|
-
const xLabel = tooltipItem.dataset?.label || tooltipItem.label;
|
|
29805
29854
|
const yLabel = tooltipItem.parsed.r;
|
|
29806
|
-
|
|
29807
|
-
return xLabel ? `${xLabel}: ${formattedY}` : formattedY;
|
|
29855
|
+
return formatValue(yLabel, { format: axisFormats?.r, locale });
|
|
29808
29856
|
},
|
|
29809
29857
|
},
|
|
29810
29858
|
};
|
|
@@ -29819,13 +29867,12 @@ function getGeoChartTooltip(definition, args) {
|
|
|
29819
29867
|
return tooltipItem.raw.value !== undefined;
|
|
29820
29868
|
},
|
|
29821
29869
|
callbacks: {
|
|
29870
|
+
beforeLabel: (tooltipItem) => tooltipItem.raw.feature.properties.name,
|
|
29822
29871
|
label: function (tooltipItem) {
|
|
29823
29872
|
const rawItem = tooltipItem.raw;
|
|
29824
|
-
const xLabel = rawItem.feature.properties.name;
|
|
29825
29873
|
const yLabel = rawItem.value;
|
|
29826
29874
|
const toolTipFormat = !format && Math.abs(yLabel) >= 1000 ? "#,##" : format;
|
|
29827
|
-
|
|
29828
|
-
return xLabel ? `${xLabel}: ${yLabelStr}` : yLabelStr;
|
|
29875
|
+
return formatValue(yLabel, { format: toolTipFormat, locale });
|
|
29829
29876
|
},
|
|
29830
29877
|
},
|
|
29831
29878
|
};
|
|
@@ -29845,7 +29892,8 @@ function customTooltipHandler({ chart, tooltip }) {
|
|
|
29845
29892
|
return;
|
|
29846
29893
|
}
|
|
29847
29894
|
const tooltipItems = tooltip.body.map((body, index) => {
|
|
29848
|
-
let
|
|
29895
|
+
let label = body.before[0];
|
|
29896
|
+
let value = body.lines[0];
|
|
29849
29897
|
if (!value) {
|
|
29850
29898
|
value = label;
|
|
29851
29899
|
label = "";
|
|
@@ -51637,8 +51685,8 @@ class Border extends Component {
|
|
|
51637
51685
|
css /* scss */ `
|
|
51638
51686
|
.o-corner {
|
|
51639
51687
|
position: absolute;
|
|
51640
|
-
height:
|
|
51641
|
-
width:
|
|
51688
|
+
height: 8px;
|
|
51689
|
+
width: 8px;
|
|
51642
51690
|
border: 1px solid white;
|
|
51643
51691
|
}
|
|
51644
51692
|
.o-corner-nw,
|
|
@@ -59999,6 +60047,10 @@ class Evaluator {
|
|
|
59999
60047
|
this.compilationParams = buildCompilationParameters(this.context, this.getters, this.computeAndSave.bind(this));
|
|
60000
60048
|
this.compilationParams.evalContext.updateDependencies = this.updateDependencies.bind(this);
|
|
60001
60049
|
this.compilationParams.evalContext.addDependencies = this.addDependencies.bind(this);
|
|
60050
|
+
this.compilationParams.evalContext.lookupCaches = {
|
|
60051
|
+
forwardSearch: new Map(),
|
|
60052
|
+
reverseSearch: new Map(),
|
|
60053
|
+
};
|
|
60002
60054
|
}
|
|
60003
60055
|
createEmptyPositionSet() {
|
|
60004
60056
|
const sheetSizes = {};
|
|
@@ -75564,6 +75616,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
|
75564
75616
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, CoreViewPlugin, DispatchResult, EvaluationError, 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, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
75565
75617
|
|
|
75566
75618
|
|
|
75567
|
-
__info__.version = "18.2.
|
|
75568
|
-
__info__.date = "2025-02-
|
|
75569
|
-
__info__.hash = "
|
|
75619
|
+
__info__.version = "18.2.1";
|
|
75620
|
+
__info__.date = "2025-02-25T06:03:13.262Z";
|
|
75621
|
+
__info__.hash = "3b4b5c9";
|