@odoo/o-spreadsheet 18.4.4 → 18.4.5
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 +45 -31
- package/dist/o-spreadsheet.esm.js +45 -31
- package/dist/o-spreadsheet.iife.js +45 -31
- package/dist/o-spreadsheet.iife.min.js +390 -391
- package/dist/o_spreadsheet.xml +4 -4
- 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 18.4.
|
|
6
|
-
* @date 2025-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.4.5
|
|
6
|
+
* @date 2025-08-04T06:54:49.107Z
|
|
7
|
+
* @hash 358931f
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -1058,16 +1058,21 @@ const colors = [
|
|
|
1058
1058
|
"#001f3f",
|
|
1059
1059
|
];
|
|
1060
1060
|
/*
|
|
1061
|
-
* transform a color number (R * 256^2 + G * 256 + B) into classic
|
|
1061
|
+
* transform a color number (R * 256^2 + G * 256 + B) into classic hex (+alpha) value
|
|
1062
1062
|
* */
|
|
1063
|
-
function
|
|
1064
|
-
|
|
1063
|
+
function colorNumberToHex(color, alpha = 1) {
|
|
1064
|
+
const alphaHex = alpha !== 1
|
|
1065
|
+
? Math.round(alpha * 255)
|
|
1066
|
+
.toString(16)
|
|
1067
|
+
.padStart(2, "0")
|
|
1068
|
+
: "";
|
|
1069
|
+
return toHex(color.toString(16).padStart(6, "0")) + alphaHex;
|
|
1065
1070
|
}
|
|
1066
1071
|
function colorToNumber(color) {
|
|
1067
1072
|
if (typeof color === "number") {
|
|
1068
1073
|
return color;
|
|
1069
1074
|
}
|
|
1070
|
-
return Number.parseInt(toHex(color).slice(1), 16);
|
|
1075
|
+
return Number.parseInt(toHex(color).slice(1, 7), 16);
|
|
1071
1076
|
}
|
|
1072
1077
|
/**
|
|
1073
1078
|
* Converts any CSS color value to a standardized hex6 value.
|
|
@@ -1326,6 +1331,12 @@ function hslaToHex(hsla) {
|
|
|
1326
1331
|
function hexToHSLA(hex) {
|
|
1327
1332
|
return rgbaToHSLA(colorToRGBA(hex));
|
|
1328
1333
|
}
|
|
1334
|
+
function colorOrNumberToRGBA(color) {
|
|
1335
|
+
if (typeof color === "number") {
|
|
1336
|
+
return colorToRGBA(colorNumberToHex(color));
|
|
1337
|
+
}
|
|
1338
|
+
return colorToRGBA(color);
|
|
1339
|
+
}
|
|
1329
1340
|
/**
|
|
1330
1341
|
* Will compare two color strings
|
|
1331
1342
|
* A tolerance can be provided to account for small differences that could
|
|
@@ -1607,6 +1618,8 @@ function getColorScale(colorScalePoints) {
|
|
|
1607
1618
|
const sortedColorScalePoints = [...colorScalePoints.sort((a, b) => a.value - b.value)];
|
|
1608
1619
|
const thresholds = [];
|
|
1609
1620
|
for (let i = 1; i < sortedColorScalePoints.length; i++) {
|
|
1621
|
+
const minColorAlpha = colorOrNumberToRGBA(sortedColorScalePoints[i - 1].color).a;
|
|
1622
|
+
const maxColorAlpha = colorOrNumberToRGBA(sortedColorScalePoints[i].color).a;
|
|
1610
1623
|
const minColor = colorToNumber(sortedColorScalePoints[i - 1].color);
|
|
1611
1624
|
const maxColor = colorToNumber(sortedColorScalePoints[i].color);
|
|
1612
1625
|
thresholds.push({
|
|
@@ -1614,19 +1627,21 @@ function getColorScale(colorScalePoints) {
|
|
|
1614
1627
|
max: sortedColorScalePoints[i].value,
|
|
1615
1628
|
minColor,
|
|
1616
1629
|
maxColor,
|
|
1630
|
+
minColorAlpha: minColorAlpha,
|
|
1631
|
+
maxColorAlpha: maxColorAlpha,
|
|
1617
1632
|
colorDiff: computeColorDiffUnits(sortedColorScalePoints[i - 1].value, sortedColorScalePoints[i].value, minColor, maxColor),
|
|
1618
1633
|
});
|
|
1619
1634
|
}
|
|
1620
1635
|
return (value) => {
|
|
1621
1636
|
if (value < thresholds[0].min) {
|
|
1622
|
-
return
|
|
1637
|
+
return colorNumberToHex(thresholds[0].minColor, thresholds[0].minColorAlpha);
|
|
1623
1638
|
}
|
|
1624
1639
|
for (const threshold of thresholds) {
|
|
1625
1640
|
if (value >= threshold.min && value <= threshold.max) {
|
|
1626
|
-
return
|
|
1641
|
+
return colorNumberToHex(colorCell(value, threshold.min, threshold.minColor, threshold.colorDiff), threshold.maxColorAlpha);
|
|
1627
1642
|
}
|
|
1628
1643
|
}
|
|
1629
|
-
return
|
|
1644
|
+
return colorNumberToHex(thresholds[thresholds.length - 1].maxColor, thresholds[thresholds.length - 1].maxColorAlpha);
|
|
1630
1645
|
};
|
|
1631
1646
|
}
|
|
1632
1647
|
function computeColorDiffUnits(minValue, maxValue, minColor, maxColor) {
|
|
@@ -22762,6 +22777,7 @@ class ChartJsComponent extends owl.Component {
|
|
|
22762
22777
|
this.animationStore = useStore(ChartAnimationStore);
|
|
22763
22778
|
}
|
|
22764
22779
|
owl.onMounted(() => {
|
|
22780
|
+
registerChartJSExtensions();
|
|
22765
22781
|
const runtime = this.chartRuntime;
|
|
22766
22782
|
this.currentRuntime = runtime;
|
|
22767
22783
|
// Note: chartJS modify the runtime in place, so it's important to give it a copy
|
|
@@ -51845,16 +51861,16 @@ class ConditionalFormatPreview extends owl.Component {
|
|
|
51845
51861
|
return cssPropertiesToCss(cellStyleToCss(rule.style));
|
|
51846
51862
|
}
|
|
51847
51863
|
else if (rule.type === "ColorScaleRule") {
|
|
51848
|
-
const minColor =
|
|
51849
|
-
const midColor = rule.midpoint ?
|
|
51850
|
-
const maxColor =
|
|
51864
|
+
const minColor = colorNumberToHex(rule.minimum.color);
|
|
51865
|
+
const midColor = rule.midpoint ? colorNumberToHex(rule.midpoint.color) : null;
|
|
51866
|
+
const maxColor = colorNumberToHex(rule.maximum.color);
|
|
51851
51867
|
const baseString = "background-image: linear-gradient(to right, ";
|
|
51852
51868
|
return midColor
|
|
51853
51869
|
? baseString + minColor + ", " + midColor + ", " + maxColor + ")"
|
|
51854
51870
|
: baseString + minColor + ", " + maxColor + ")";
|
|
51855
51871
|
}
|
|
51856
51872
|
else if (rule.type === "DataBarRule") {
|
|
51857
|
-
const color =
|
|
51873
|
+
const color = colorNumberToHex(rule.color);
|
|
51858
51874
|
return `background-image: linear-gradient(to right, ${color} 50%, white 50%)`;
|
|
51859
51875
|
}
|
|
51860
51876
|
return "";
|
|
@@ -52062,7 +52078,7 @@ class ConditionalFormattingEditor extends owl.Component {
|
|
|
52062
52078
|
icons = ICONS;
|
|
52063
52079
|
iconSets = ICON_SETS;
|
|
52064
52080
|
getTextDecoration = getTextDecoration;
|
|
52065
|
-
|
|
52081
|
+
colorNumberToHex = colorNumberToHex;
|
|
52066
52082
|
state;
|
|
52067
52083
|
setup() {
|
|
52068
52084
|
this.state = owl.useState({
|
|
@@ -52313,9 +52329,9 @@ class ConditionalFormattingEditor extends owl.Component {
|
|
|
52313
52329
|
}
|
|
52314
52330
|
getPreviewGradient() {
|
|
52315
52331
|
const rule = this.state.rules.colorScale;
|
|
52316
|
-
const minColor =
|
|
52317
|
-
const midColor =
|
|
52318
|
-
const maxColor =
|
|
52332
|
+
const minColor = colorNumberToHex(rule.minimum.color);
|
|
52333
|
+
const midColor = colorNumberToHex(rule.midpoint?.color || DEFAULT_COLOR_SCALE_MIDPOINT_COLOR);
|
|
52334
|
+
const maxColor = colorNumberToHex(rule.maximum.color);
|
|
52319
52335
|
const baseString = "background-image: linear-gradient(to right, ";
|
|
52320
52336
|
return rule.midpoint === undefined
|
|
52321
52337
|
? baseString + minColor + ", " + maxColor + ")"
|
|
@@ -52323,8 +52339,8 @@ class ConditionalFormattingEditor extends owl.Component {
|
|
|
52323
52339
|
}
|
|
52324
52340
|
getThresholdColor(threshold) {
|
|
52325
52341
|
return threshold
|
|
52326
|
-
?
|
|
52327
|
-
:
|
|
52342
|
+
? colorNumberToHex(threshold.color)
|
|
52343
|
+
: colorNumberToHex(DEFAULT_COLOR_SCALE_MIDPOINT_COLOR);
|
|
52328
52344
|
}
|
|
52329
52345
|
onMidpointChange(ev) {
|
|
52330
52346
|
const type = ev.target.value;
|
|
@@ -66547,9 +66563,9 @@ class CustomColorsPlugin extends CoreViewPlugin {
|
|
|
66547
66563
|
formatColors.push(rule.style.fillColor);
|
|
66548
66564
|
}
|
|
66549
66565
|
else if (rule.type === "ColorScaleRule") {
|
|
66550
|
-
formatColors.push(
|
|
66551
|
-
formatColors.push(rule.midpoint ?
|
|
66552
|
-
formatColors.push(
|
|
66566
|
+
formatColors.push(colorNumberToHex(rule.minimum.color));
|
|
66567
|
+
formatColors.push(rule.midpoint ? colorNumberToHex(rule.midpoint.color) : undefined);
|
|
66568
|
+
formatColors.push(colorNumberToHex(rule.maximum.color));
|
|
66553
66569
|
}
|
|
66554
66570
|
}
|
|
66555
66571
|
return formatColors.filter(isDefined);
|
|
@@ -66920,7 +66936,7 @@ class EvaluationConditionalFormatPlugin extends CoreViewPlugin {
|
|
|
66920
66936
|
if (!computedDataBars[col])
|
|
66921
66937
|
computedDataBars[col] = [];
|
|
66922
66938
|
computedDataBars[col][row] = {
|
|
66923
|
-
color:
|
|
66939
|
+
color: colorNumberToHex(color),
|
|
66924
66940
|
percentage: (cell.value * 100) / max,
|
|
66925
66941
|
};
|
|
66926
66942
|
}
|
|
@@ -79937,7 +79953,6 @@ css /* scss */ `
|
|
|
79937
79953
|
}
|
|
79938
79954
|
}
|
|
79939
79955
|
|
|
79940
|
-
.o-spreadsheet-topbar-wrapper,
|
|
79941
79956
|
.o-spreadsheet-bottombar-wrapper {
|
|
79942
79957
|
z-index: ${ComponentsImportance.ScrollBar + 1};
|
|
79943
79958
|
}
|
|
@@ -80052,7 +80067,6 @@ class Spreadsheet extends owl.Component {
|
|
|
80052
80067
|
this.checkViewportSize();
|
|
80053
80068
|
stores.on("store-updated", this, render);
|
|
80054
80069
|
resizeObserver.observe(this.spreadsheetRef.el);
|
|
80055
|
-
registerChartJSExtensions();
|
|
80056
80070
|
});
|
|
80057
80071
|
owl.onWillUnmount(() => {
|
|
80058
80072
|
this.unbindModelEvents();
|
|
@@ -82585,7 +82599,7 @@ function addDataBarRule(cf, rule) {
|
|
|
82585
82599
|
<dataBar>
|
|
82586
82600
|
<cfvo type="min" val="0"/>
|
|
82587
82601
|
<cfvo type="max" val="100"/>
|
|
82588
|
-
<color rgb="${toXlsxHexColor(
|
|
82602
|
+
<color rgb="${toXlsxHexColor(colorNumberToHex(rule.color))}"/>
|
|
82589
82603
|
</dataBar>
|
|
82590
82604
|
</cfRule>
|
|
82591
82605
|
</conditionalFormatting>
|
|
@@ -82613,7 +82627,7 @@ function addColorScaleRule(cf, rule) {
|
|
|
82613
82627
|
continue;
|
|
82614
82628
|
}
|
|
82615
82629
|
cfValueObject.push(thresholdAttributes(threshold, position));
|
|
82616
|
-
colors.push([["rgb", toXlsxHexColor(
|
|
82630
|
+
colors.push([["rgb", toXlsxHexColor(colorNumberToHex(threshold.color))]]);
|
|
82617
82631
|
}
|
|
82618
82632
|
if (!canExport) {
|
|
82619
82633
|
console.warn("Conditional formats with formula rules are not supported at the moment. The rule is therefore skipped.");
|
|
@@ -84672,6 +84686,6 @@ exports.tokenColors = tokenColors;
|
|
|
84672
84686
|
exports.tokenize = tokenize;
|
|
84673
84687
|
|
|
84674
84688
|
|
|
84675
|
-
__info__.version = "18.4.
|
|
84676
|
-
__info__.date = "2025-
|
|
84677
|
-
__info__.hash = "
|
|
84689
|
+
__info__.version = "18.4.5";
|
|
84690
|
+
__info__.date = "2025-08-04T06:54:49.107Z";
|
|
84691
|
+
__info__.hash = "358931f";
|
|
@@ -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.4.
|
|
6
|
-
* @date 2025-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.4.5
|
|
6
|
+
* @date 2025-08-04T06:54:49.107Z
|
|
7
|
+
* @hash 358931f
|
|
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';
|
|
@@ -1056,16 +1056,21 @@ const colors = [
|
|
|
1056
1056
|
"#001f3f",
|
|
1057
1057
|
];
|
|
1058
1058
|
/*
|
|
1059
|
-
* transform a color number (R * 256^2 + G * 256 + B) into classic
|
|
1059
|
+
* transform a color number (R * 256^2 + G * 256 + B) into classic hex (+alpha) value
|
|
1060
1060
|
* */
|
|
1061
|
-
function
|
|
1062
|
-
|
|
1061
|
+
function colorNumberToHex(color, alpha = 1) {
|
|
1062
|
+
const alphaHex = alpha !== 1
|
|
1063
|
+
? Math.round(alpha * 255)
|
|
1064
|
+
.toString(16)
|
|
1065
|
+
.padStart(2, "0")
|
|
1066
|
+
: "";
|
|
1067
|
+
return toHex(color.toString(16).padStart(6, "0")) + alphaHex;
|
|
1063
1068
|
}
|
|
1064
1069
|
function colorToNumber(color) {
|
|
1065
1070
|
if (typeof color === "number") {
|
|
1066
1071
|
return color;
|
|
1067
1072
|
}
|
|
1068
|
-
return Number.parseInt(toHex(color).slice(1), 16);
|
|
1073
|
+
return Number.parseInt(toHex(color).slice(1, 7), 16);
|
|
1069
1074
|
}
|
|
1070
1075
|
/**
|
|
1071
1076
|
* Converts any CSS color value to a standardized hex6 value.
|
|
@@ -1324,6 +1329,12 @@ function hslaToHex(hsla) {
|
|
|
1324
1329
|
function hexToHSLA(hex) {
|
|
1325
1330
|
return rgbaToHSLA(colorToRGBA(hex));
|
|
1326
1331
|
}
|
|
1332
|
+
function colorOrNumberToRGBA(color) {
|
|
1333
|
+
if (typeof color === "number") {
|
|
1334
|
+
return colorToRGBA(colorNumberToHex(color));
|
|
1335
|
+
}
|
|
1336
|
+
return colorToRGBA(color);
|
|
1337
|
+
}
|
|
1327
1338
|
/**
|
|
1328
1339
|
* Will compare two color strings
|
|
1329
1340
|
* A tolerance can be provided to account for small differences that could
|
|
@@ -1605,6 +1616,8 @@ function getColorScale(colorScalePoints) {
|
|
|
1605
1616
|
const sortedColorScalePoints = [...colorScalePoints.sort((a, b) => a.value - b.value)];
|
|
1606
1617
|
const thresholds = [];
|
|
1607
1618
|
for (let i = 1; i < sortedColorScalePoints.length; i++) {
|
|
1619
|
+
const minColorAlpha = colorOrNumberToRGBA(sortedColorScalePoints[i - 1].color).a;
|
|
1620
|
+
const maxColorAlpha = colorOrNumberToRGBA(sortedColorScalePoints[i].color).a;
|
|
1608
1621
|
const minColor = colorToNumber(sortedColorScalePoints[i - 1].color);
|
|
1609
1622
|
const maxColor = colorToNumber(sortedColorScalePoints[i].color);
|
|
1610
1623
|
thresholds.push({
|
|
@@ -1612,19 +1625,21 @@ function getColorScale(colorScalePoints) {
|
|
|
1612
1625
|
max: sortedColorScalePoints[i].value,
|
|
1613
1626
|
minColor,
|
|
1614
1627
|
maxColor,
|
|
1628
|
+
minColorAlpha: minColorAlpha,
|
|
1629
|
+
maxColorAlpha: maxColorAlpha,
|
|
1615
1630
|
colorDiff: computeColorDiffUnits(sortedColorScalePoints[i - 1].value, sortedColorScalePoints[i].value, minColor, maxColor),
|
|
1616
1631
|
});
|
|
1617
1632
|
}
|
|
1618
1633
|
return (value) => {
|
|
1619
1634
|
if (value < thresholds[0].min) {
|
|
1620
|
-
return
|
|
1635
|
+
return colorNumberToHex(thresholds[0].minColor, thresholds[0].minColorAlpha);
|
|
1621
1636
|
}
|
|
1622
1637
|
for (const threshold of thresholds) {
|
|
1623
1638
|
if (value >= threshold.min && value <= threshold.max) {
|
|
1624
|
-
return
|
|
1639
|
+
return colorNumberToHex(colorCell(value, threshold.min, threshold.minColor, threshold.colorDiff), threshold.maxColorAlpha);
|
|
1625
1640
|
}
|
|
1626
1641
|
}
|
|
1627
|
-
return
|
|
1642
|
+
return colorNumberToHex(thresholds[thresholds.length - 1].maxColor, thresholds[thresholds.length - 1].maxColorAlpha);
|
|
1628
1643
|
};
|
|
1629
1644
|
}
|
|
1630
1645
|
function computeColorDiffUnits(minValue, maxValue, minColor, maxColor) {
|
|
@@ -22760,6 +22775,7 @@ class ChartJsComponent extends Component {
|
|
|
22760
22775
|
this.animationStore = useStore(ChartAnimationStore);
|
|
22761
22776
|
}
|
|
22762
22777
|
onMounted(() => {
|
|
22778
|
+
registerChartJSExtensions();
|
|
22763
22779
|
const runtime = this.chartRuntime;
|
|
22764
22780
|
this.currentRuntime = runtime;
|
|
22765
22781
|
// Note: chartJS modify the runtime in place, so it's important to give it a copy
|
|
@@ -51843,16 +51859,16 @@ class ConditionalFormatPreview extends Component {
|
|
|
51843
51859
|
return cssPropertiesToCss(cellStyleToCss(rule.style));
|
|
51844
51860
|
}
|
|
51845
51861
|
else if (rule.type === "ColorScaleRule") {
|
|
51846
|
-
const minColor =
|
|
51847
|
-
const midColor = rule.midpoint ?
|
|
51848
|
-
const maxColor =
|
|
51862
|
+
const minColor = colorNumberToHex(rule.minimum.color);
|
|
51863
|
+
const midColor = rule.midpoint ? colorNumberToHex(rule.midpoint.color) : null;
|
|
51864
|
+
const maxColor = colorNumberToHex(rule.maximum.color);
|
|
51849
51865
|
const baseString = "background-image: linear-gradient(to right, ";
|
|
51850
51866
|
return midColor
|
|
51851
51867
|
? baseString + minColor + ", " + midColor + ", " + maxColor + ")"
|
|
51852
51868
|
: baseString + minColor + ", " + maxColor + ")";
|
|
51853
51869
|
}
|
|
51854
51870
|
else if (rule.type === "DataBarRule") {
|
|
51855
|
-
const color =
|
|
51871
|
+
const color = colorNumberToHex(rule.color);
|
|
51856
51872
|
return `background-image: linear-gradient(to right, ${color} 50%, white 50%)`;
|
|
51857
51873
|
}
|
|
51858
51874
|
return "";
|
|
@@ -52060,7 +52076,7 @@ class ConditionalFormattingEditor extends Component {
|
|
|
52060
52076
|
icons = ICONS;
|
|
52061
52077
|
iconSets = ICON_SETS;
|
|
52062
52078
|
getTextDecoration = getTextDecoration;
|
|
52063
|
-
|
|
52079
|
+
colorNumberToHex = colorNumberToHex;
|
|
52064
52080
|
state;
|
|
52065
52081
|
setup() {
|
|
52066
52082
|
this.state = useState({
|
|
@@ -52311,9 +52327,9 @@ class ConditionalFormattingEditor extends Component {
|
|
|
52311
52327
|
}
|
|
52312
52328
|
getPreviewGradient() {
|
|
52313
52329
|
const rule = this.state.rules.colorScale;
|
|
52314
|
-
const minColor =
|
|
52315
|
-
const midColor =
|
|
52316
|
-
const maxColor =
|
|
52330
|
+
const minColor = colorNumberToHex(rule.minimum.color);
|
|
52331
|
+
const midColor = colorNumberToHex(rule.midpoint?.color || DEFAULT_COLOR_SCALE_MIDPOINT_COLOR);
|
|
52332
|
+
const maxColor = colorNumberToHex(rule.maximum.color);
|
|
52317
52333
|
const baseString = "background-image: linear-gradient(to right, ";
|
|
52318
52334
|
return rule.midpoint === undefined
|
|
52319
52335
|
? baseString + minColor + ", " + maxColor + ")"
|
|
@@ -52321,8 +52337,8 @@ class ConditionalFormattingEditor extends Component {
|
|
|
52321
52337
|
}
|
|
52322
52338
|
getThresholdColor(threshold) {
|
|
52323
52339
|
return threshold
|
|
52324
|
-
?
|
|
52325
|
-
:
|
|
52340
|
+
? colorNumberToHex(threshold.color)
|
|
52341
|
+
: colorNumberToHex(DEFAULT_COLOR_SCALE_MIDPOINT_COLOR);
|
|
52326
52342
|
}
|
|
52327
52343
|
onMidpointChange(ev) {
|
|
52328
52344
|
const type = ev.target.value;
|
|
@@ -66545,9 +66561,9 @@ class CustomColorsPlugin extends CoreViewPlugin {
|
|
|
66545
66561
|
formatColors.push(rule.style.fillColor);
|
|
66546
66562
|
}
|
|
66547
66563
|
else if (rule.type === "ColorScaleRule") {
|
|
66548
|
-
formatColors.push(
|
|
66549
|
-
formatColors.push(rule.midpoint ?
|
|
66550
|
-
formatColors.push(
|
|
66564
|
+
formatColors.push(colorNumberToHex(rule.minimum.color));
|
|
66565
|
+
formatColors.push(rule.midpoint ? colorNumberToHex(rule.midpoint.color) : undefined);
|
|
66566
|
+
formatColors.push(colorNumberToHex(rule.maximum.color));
|
|
66551
66567
|
}
|
|
66552
66568
|
}
|
|
66553
66569
|
return formatColors.filter(isDefined);
|
|
@@ -66918,7 +66934,7 @@ class EvaluationConditionalFormatPlugin extends CoreViewPlugin {
|
|
|
66918
66934
|
if (!computedDataBars[col])
|
|
66919
66935
|
computedDataBars[col] = [];
|
|
66920
66936
|
computedDataBars[col][row] = {
|
|
66921
|
-
color:
|
|
66937
|
+
color: colorNumberToHex(color),
|
|
66922
66938
|
percentage: (cell.value * 100) / max,
|
|
66923
66939
|
};
|
|
66924
66940
|
}
|
|
@@ -79935,7 +79951,6 @@ css /* scss */ `
|
|
|
79935
79951
|
}
|
|
79936
79952
|
}
|
|
79937
79953
|
|
|
79938
|
-
.o-spreadsheet-topbar-wrapper,
|
|
79939
79954
|
.o-spreadsheet-bottombar-wrapper {
|
|
79940
79955
|
z-index: ${ComponentsImportance.ScrollBar + 1};
|
|
79941
79956
|
}
|
|
@@ -80050,7 +80065,6 @@ class Spreadsheet extends Component {
|
|
|
80050
80065
|
this.checkViewportSize();
|
|
80051
80066
|
stores.on("store-updated", this, render);
|
|
80052
80067
|
resizeObserver.observe(this.spreadsheetRef.el);
|
|
80053
|
-
registerChartJSExtensions();
|
|
80054
80068
|
});
|
|
80055
80069
|
onWillUnmount(() => {
|
|
80056
80070
|
this.unbindModelEvents();
|
|
@@ -82583,7 +82597,7 @@ function addDataBarRule(cf, rule) {
|
|
|
82583
82597
|
<dataBar>
|
|
82584
82598
|
<cfvo type="min" val="0"/>
|
|
82585
82599
|
<cfvo type="max" val="100"/>
|
|
82586
|
-
<color rgb="${toXlsxHexColor(
|
|
82600
|
+
<color rgb="${toXlsxHexColor(colorNumberToHex(rule.color))}"/>
|
|
82587
82601
|
</dataBar>
|
|
82588
82602
|
</cfRule>
|
|
82589
82603
|
</conditionalFormatting>
|
|
@@ -82611,7 +82625,7 @@ function addColorScaleRule(cf, rule) {
|
|
|
82611
82625
|
continue;
|
|
82612
82626
|
}
|
|
82613
82627
|
cfValueObject.push(thresholdAttributes(threshold, position));
|
|
82614
|
-
colors.push([["rgb", toXlsxHexColor(
|
|
82628
|
+
colors.push([["rgb", toXlsxHexColor(colorNumberToHex(threshold.color))]]);
|
|
82615
82629
|
}
|
|
82616
82630
|
if (!canExport) {
|
|
82617
82631
|
console.warn("Conditional formats with formula rules are not supported at the moment. The rule is therefore skipped.");
|
|
@@ -84622,6 +84636,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
|
84622
84636
|
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 };
|
|
84623
84637
|
|
|
84624
84638
|
|
|
84625
|
-
__info__.version = "18.4.
|
|
84626
|
-
__info__.date = "2025-
|
|
84627
|
-
__info__.hash = "
|
|
84639
|
+
__info__.version = "18.4.5";
|
|
84640
|
+
__info__.date = "2025-08-04T06:54:49.107Z";
|
|
84641
|
+
__info__.hash = "358931f";
|
|
@@ -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.4.
|
|
6
|
-
* @date 2025-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.4.5
|
|
6
|
+
* @date 2025-08-04T06:54:49.107Z
|
|
7
|
+
* @hash 358931f
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -1057,16 +1057,21 @@
|
|
|
1057
1057
|
"#001f3f",
|
|
1058
1058
|
];
|
|
1059
1059
|
/*
|
|
1060
|
-
* transform a color number (R * 256^2 + G * 256 + B) into classic
|
|
1060
|
+
* transform a color number (R * 256^2 + G * 256 + B) into classic hex (+alpha) value
|
|
1061
1061
|
* */
|
|
1062
|
-
function
|
|
1063
|
-
|
|
1062
|
+
function colorNumberToHex(color, alpha = 1) {
|
|
1063
|
+
const alphaHex = alpha !== 1
|
|
1064
|
+
? Math.round(alpha * 255)
|
|
1065
|
+
.toString(16)
|
|
1066
|
+
.padStart(2, "0")
|
|
1067
|
+
: "";
|
|
1068
|
+
return toHex(color.toString(16).padStart(6, "0")) + alphaHex;
|
|
1064
1069
|
}
|
|
1065
1070
|
function colorToNumber(color) {
|
|
1066
1071
|
if (typeof color === "number") {
|
|
1067
1072
|
return color;
|
|
1068
1073
|
}
|
|
1069
|
-
return Number.parseInt(toHex(color).slice(1), 16);
|
|
1074
|
+
return Number.parseInt(toHex(color).slice(1, 7), 16);
|
|
1070
1075
|
}
|
|
1071
1076
|
/**
|
|
1072
1077
|
* Converts any CSS color value to a standardized hex6 value.
|
|
@@ -1325,6 +1330,12 @@
|
|
|
1325
1330
|
function hexToHSLA(hex) {
|
|
1326
1331
|
return rgbaToHSLA(colorToRGBA(hex));
|
|
1327
1332
|
}
|
|
1333
|
+
function colorOrNumberToRGBA(color) {
|
|
1334
|
+
if (typeof color === "number") {
|
|
1335
|
+
return colorToRGBA(colorNumberToHex(color));
|
|
1336
|
+
}
|
|
1337
|
+
return colorToRGBA(color);
|
|
1338
|
+
}
|
|
1328
1339
|
/**
|
|
1329
1340
|
* Will compare two color strings
|
|
1330
1341
|
* A tolerance can be provided to account for small differences that could
|
|
@@ -1606,6 +1617,8 @@
|
|
|
1606
1617
|
const sortedColorScalePoints = [...colorScalePoints.sort((a, b) => a.value - b.value)];
|
|
1607
1618
|
const thresholds = [];
|
|
1608
1619
|
for (let i = 1; i < sortedColorScalePoints.length; i++) {
|
|
1620
|
+
const minColorAlpha = colorOrNumberToRGBA(sortedColorScalePoints[i - 1].color).a;
|
|
1621
|
+
const maxColorAlpha = colorOrNumberToRGBA(sortedColorScalePoints[i].color).a;
|
|
1609
1622
|
const minColor = colorToNumber(sortedColorScalePoints[i - 1].color);
|
|
1610
1623
|
const maxColor = colorToNumber(sortedColorScalePoints[i].color);
|
|
1611
1624
|
thresholds.push({
|
|
@@ -1613,19 +1626,21 @@
|
|
|
1613
1626
|
max: sortedColorScalePoints[i].value,
|
|
1614
1627
|
minColor,
|
|
1615
1628
|
maxColor,
|
|
1629
|
+
minColorAlpha: minColorAlpha,
|
|
1630
|
+
maxColorAlpha: maxColorAlpha,
|
|
1616
1631
|
colorDiff: computeColorDiffUnits(sortedColorScalePoints[i - 1].value, sortedColorScalePoints[i].value, minColor, maxColor),
|
|
1617
1632
|
});
|
|
1618
1633
|
}
|
|
1619
1634
|
return (value) => {
|
|
1620
1635
|
if (value < thresholds[0].min) {
|
|
1621
|
-
return
|
|
1636
|
+
return colorNumberToHex(thresholds[0].minColor, thresholds[0].minColorAlpha);
|
|
1622
1637
|
}
|
|
1623
1638
|
for (const threshold of thresholds) {
|
|
1624
1639
|
if (value >= threshold.min && value <= threshold.max) {
|
|
1625
|
-
return
|
|
1640
|
+
return colorNumberToHex(colorCell(value, threshold.min, threshold.minColor, threshold.colorDiff), threshold.maxColorAlpha);
|
|
1626
1641
|
}
|
|
1627
1642
|
}
|
|
1628
|
-
return
|
|
1643
|
+
return colorNumberToHex(thresholds[thresholds.length - 1].maxColor, thresholds[thresholds.length - 1].maxColorAlpha);
|
|
1629
1644
|
};
|
|
1630
1645
|
}
|
|
1631
1646
|
function computeColorDiffUnits(minValue, maxValue, minColor, maxColor) {
|
|
@@ -22761,6 +22776,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
22761
22776
|
this.animationStore = useStore(ChartAnimationStore);
|
|
22762
22777
|
}
|
|
22763
22778
|
owl.onMounted(() => {
|
|
22779
|
+
registerChartJSExtensions();
|
|
22764
22780
|
const runtime = this.chartRuntime;
|
|
22765
22781
|
this.currentRuntime = runtime;
|
|
22766
22782
|
// Note: chartJS modify the runtime in place, so it's important to give it a copy
|
|
@@ -51844,16 +51860,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
51844
51860
|
return cssPropertiesToCss(cellStyleToCss(rule.style));
|
|
51845
51861
|
}
|
|
51846
51862
|
else if (rule.type === "ColorScaleRule") {
|
|
51847
|
-
const minColor =
|
|
51848
|
-
const midColor = rule.midpoint ?
|
|
51849
|
-
const maxColor =
|
|
51863
|
+
const minColor = colorNumberToHex(rule.minimum.color);
|
|
51864
|
+
const midColor = rule.midpoint ? colorNumberToHex(rule.midpoint.color) : null;
|
|
51865
|
+
const maxColor = colorNumberToHex(rule.maximum.color);
|
|
51850
51866
|
const baseString = "background-image: linear-gradient(to right, ";
|
|
51851
51867
|
return midColor
|
|
51852
51868
|
? baseString + minColor + ", " + midColor + ", " + maxColor + ")"
|
|
51853
51869
|
: baseString + minColor + ", " + maxColor + ")";
|
|
51854
51870
|
}
|
|
51855
51871
|
else if (rule.type === "DataBarRule") {
|
|
51856
|
-
const color =
|
|
51872
|
+
const color = colorNumberToHex(rule.color);
|
|
51857
51873
|
return `background-image: linear-gradient(to right, ${color} 50%, white 50%)`;
|
|
51858
51874
|
}
|
|
51859
51875
|
return "";
|
|
@@ -52061,7 +52077,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
52061
52077
|
icons = ICONS;
|
|
52062
52078
|
iconSets = ICON_SETS;
|
|
52063
52079
|
getTextDecoration = getTextDecoration;
|
|
52064
|
-
|
|
52080
|
+
colorNumberToHex = colorNumberToHex;
|
|
52065
52081
|
state;
|
|
52066
52082
|
setup() {
|
|
52067
52083
|
this.state = owl.useState({
|
|
@@ -52312,9 +52328,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
52312
52328
|
}
|
|
52313
52329
|
getPreviewGradient() {
|
|
52314
52330
|
const rule = this.state.rules.colorScale;
|
|
52315
|
-
const minColor =
|
|
52316
|
-
const midColor =
|
|
52317
|
-
const maxColor =
|
|
52331
|
+
const minColor = colorNumberToHex(rule.minimum.color);
|
|
52332
|
+
const midColor = colorNumberToHex(rule.midpoint?.color || DEFAULT_COLOR_SCALE_MIDPOINT_COLOR);
|
|
52333
|
+
const maxColor = colorNumberToHex(rule.maximum.color);
|
|
52318
52334
|
const baseString = "background-image: linear-gradient(to right, ";
|
|
52319
52335
|
return rule.midpoint === undefined
|
|
52320
52336
|
? baseString + minColor + ", " + maxColor + ")"
|
|
@@ -52322,8 +52338,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
52322
52338
|
}
|
|
52323
52339
|
getThresholdColor(threshold) {
|
|
52324
52340
|
return threshold
|
|
52325
|
-
?
|
|
52326
|
-
:
|
|
52341
|
+
? colorNumberToHex(threshold.color)
|
|
52342
|
+
: colorNumberToHex(DEFAULT_COLOR_SCALE_MIDPOINT_COLOR);
|
|
52327
52343
|
}
|
|
52328
52344
|
onMidpointChange(ev) {
|
|
52329
52345
|
const type = ev.target.value;
|
|
@@ -66546,9 +66562,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66546
66562
|
formatColors.push(rule.style.fillColor);
|
|
66547
66563
|
}
|
|
66548
66564
|
else if (rule.type === "ColorScaleRule") {
|
|
66549
|
-
formatColors.push(
|
|
66550
|
-
formatColors.push(rule.midpoint ?
|
|
66551
|
-
formatColors.push(
|
|
66565
|
+
formatColors.push(colorNumberToHex(rule.minimum.color));
|
|
66566
|
+
formatColors.push(rule.midpoint ? colorNumberToHex(rule.midpoint.color) : undefined);
|
|
66567
|
+
formatColors.push(colorNumberToHex(rule.maximum.color));
|
|
66552
66568
|
}
|
|
66553
66569
|
}
|
|
66554
66570
|
return formatColors.filter(isDefined);
|
|
@@ -66919,7 +66935,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66919
66935
|
if (!computedDataBars[col])
|
|
66920
66936
|
computedDataBars[col] = [];
|
|
66921
66937
|
computedDataBars[col][row] = {
|
|
66922
|
-
color:
|
|
66938
|
+
color: colorNumberToHex(color),
|
|
66923
66939
|
percentage: (cell.value * 100) / max,
|
|
66924
66940
|
};
|
|
66925
66941
|
}
|
|
@@ -79936,7 +79952,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
79936
79952
|
}
|
|
79937
79953
|
}
|
|
79938
79954
|
|
|
79939
|
-
.o-spreadsheet-topbar-wrapper,
|
|
79940
79955
|
.o-spreadsheet-bottombar-wrapper {
|
|
79941
79956
|
z-index: ${ComponentsImportance.ScrollBar + 1};
|
|
79942
79957
|
}
|
|
@@ -80051,7 +80066,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
80051
80066
|
this.checkViewportSize();
|
|
80052
80067
|
stores.on("store-updated", this, render);
|
|
80053
80068
|
resizeObserver.observe(this.spreadsheetRef.el);
|
|
80054
|
-
registerChartJSExtensions();
|
|
80055
80069
|
});
|
|
80056
80070
|
owl.onWillUnmount(() => {
|
|
80057
80071
|
this.unbindModelEvents();
|
|
@@ -82584,7 +82598,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
82584
82598
|
<dataBar>
|
|
82585
82599
|
<cfvo type="min" val="0"/>
|
|
82586
82600
|
<cfvo type="max" val="100"/>
|
|
82587
|
-
<color rgb="${toXlsxHexColor(
|
|
82601
|
+
<color rgb="${toXlsxHexColor(colorNumberToHex(rule.color))}"/>
|
|
82588
82602
|
</dataBar>
|
|
82589
82603
|
</cfRule>
|
|
82590
82604
|
</conditionalFormatting>
|
|
@@ -82612,7 +82626,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
82612
82626
|
continue;
|
|
82613
82627
|
}
|
|
82614
82628
|
cfValueObject.push(thresholdAttributes(threshold, position));
|
|
82615
|
-
colors.push([["rgb", toXlsxHexColor(
|
|
82629
|
+
colors.push([["rgb", toXlsxHexColor(colorNumberToHex(threshold.color))]]);
|
|
82616
82630
|
}
|
|
82617
82631
|
if (!canExport) {
|
|
82618
82632
|
console.warn("Conditional formats with formula rules are not supported at the moment. The rule is therefore skipped.");
|
|
@@ -84671,9 +84685,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
84671
84685
|
exports.tokenize = tokenize;
|
|
84672
84686
|
|
|
84673
84687
|
|
|
84674
|
-
__info__.version = "18.4.
|
|
84675
|
-
__info__.date = "2025-
|
|
84676
|
-
__info__.hash = "
|
|
84688
|
+
__info__.version = "18.4.5";
|
|
84689
|
+
__info__.date = "2025-08-04T06:54:49.107Z";
|
|
84690
|
+
__info__.hash = "358931f";
|
|
84677
84691
|
|
|
84678
84692
|
|
|
84679
84693
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|