@odoo/o-spreadsheet 18.5.0-alpha.4 → 18.5.0-alpha.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 +195 -65
- package/dist/o-spreadsheet.esm.js +195 -65
- package/dist/o-spreadsheet.iife.js +195 -65
- package/dist/o-spreadsheet.iife.min.js +419 -450
- package/dist/o_spreadsheet.xml +11 -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 18.5.0-alpha.
|
|
6
|
-
* @date 2025-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.5.0-alpha.5
|
|
6
|
+
* @date 2025-08-04T06:53:29.412Z
|
|
7
|
+
* @hash 71c9a36
|
|
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) {
|
|
@@ -20477,6 +20492,54 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
20477
20492
|
},
|
|
20478
20493
|
isExported: true,
|
|
20479
20494
|
};
|
|
20495
|
+
const REGEXEXTRACT_DEFAULT_MODE = 0;
|
|
20496
|
+
const REGEXEXTRACT_DEFAULT_CASE_SENSITIVITY = 0;
|
|
20497
|
+
// -----------------------------------------------------------------------------
|
|
20498
|
+
// REGEXEXTRACT
|
|
20499
|
+
// -----------------------------------------------------------------------------
|
|
20500
|
+
const REGEXEXTRACT = {
|
|
20501
|
+
description: _t("Extract text from a string based on the supplied regular expression."),
|
|
20502
|
+
args: [
|
|
20503
|
+
arg("text (string)", _t("The string on which you want to extract text.")),
|
|
20504
|
+
arg("pattern (string)", _t("The regular expression pattern to match against the text.")),
|
|
20505
|
+
arg(`return_mode (number, default=${REGEXEXTRACT_DEFAULT_MODE})`, _t("0 = first match, 1 = all matches as an array, 2 = capturing groups from the first match as an array.")),
|
|
20506
|
+
arg(`case_sensitivity (number, default=${REGEXEXTRACT_DEFAULT_CASE_SENSITIVITY})`, _t("0 = case-sensitive, 1 = case-insensitive.")),
|
|
20507
|
+
],
|
|
20508
|
+
compute: function (text, pattern, return_mode = { value: REGEXEXTRACT_DEFAULT_MODE }, newText = { value: REGEXEXTRACT_DEFAULT_CASE_SENSITIVITY }) {
|
|
20509
|
+
const _text = toString(text);
|
|
20510
|
+
const _pattern = toString(pattern);
|
|
20511
|
+
const _returnMode = toNumber(return_mode, this.locale);
|
|
20512
|
+
const _caseSensitivity = toNumber(newText, this.locale);
|
|
20513
|
+
if (_text === "" || _pattern === "") {
|
|
20514
|
+
return { value: "" };
|
|
20515
|
+
}
|
|
20516
|
+
if (_returnMode < 0 || _returnMode > 2) {
|
|
20517
|
+
return new EvaluationError(_t("The return_mode (%s) must be 0, 1 or 2.", _returnMode));
|
|
20518
|
+
}
|
|
20519
|
+
if (_caseSensitivity !== 0 && _caseSensitivity !== 1) {
|
|
20520
|
+
return new EvaluationError(_t("The case_sensitivity (%s) must be 0 or 1.", _caseSensitivity));
|
|
20521
|
+
}
|
|
20522
|
+
const flags = _caseSensitivity === 1 ? "gi" : "g";
|
|
20523
|
+
const regex = new RegExp(_pattern, flags);
|
|
20524
|
+
const matches = [..._text.matchAll(regex)];
|
|
20525
|
+
if (matches.length === 0) {
|
|
20526
|
+
return { value: CellErrorType.NotAvailable, message: _t("No matches found.") };
|
|
20527
|
+
}
|
|
20528
|
+
if (_returnMode === 0) {
|
|
20529
|
+
return matches[0][0];
|
|
20530
|
+
}
|
|
20531
|
+
else if (_returnMode === 1) {
|
|
20532
|
+
return matches.map((match) => [match[0]]);
|
|
20533
|
+
}
|
|
20534
|
+
else {
|
|
20535
|
+
if (matches[0].length < 2) {
|
|
20536
|
+
return new EvaluationError(_t("No capturing groups found."));
|
|
20537
|
+
}
|
|
20538
|
+
return matches[0].slice(1).map((s) => [s]);
|
|
20539
|
+
}
|
|
20540
|
+
},
|
|
20541
|
+
isExported: true,
|
|
20542
|
+
};
|
|
20480
20543
|
// -----------------------------------------------------------------------------
|
|
20481
20544
|
// REPLACE
|
|
20482
20545
|
// -----------------------------------------------------------------------------
|
|
@@ -20753,6 +20816,105 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
20753
20816
|
},
|
|
20754
20817
|
isExported: true,
|
|
20755
20818
|
};
|
|
20819
|
+
// -----------------------------------------------------------------------------
|
|
20820
|
+
// TEXTAFTER
|
|
20821
|
+
// -----------------------------------------------------------------------------
|
|
20822
|
+
const TEXT_FN_DEFAULT_INSTANCE = 1;
|
|
20823
|
+
const TEXT_FN_DEFAULT_MATCH_MODE = 0;
|
|
20824
|
+
const TEXT_FN_DEFAULT_MATCH_END = 0;
|
|
20825
|
+
const TEXTAFTER = {
|
|
20826
|
+
description: _t("Returns text that occurs after a given substring or delimiter."),
|
|
20827
|
+
args: [
|
|
20828
|
+
arg("text (string)", _t("The source text.")),
|
|
20829
|
+
arg("delimiter (string)", _t("The substring after which text will be returned.")),
|
|
20830
|
+
arg(`instance_num (number, default=${TEXT_FN_DEFAULT_INSTANCE})`, _t("The desired instance of the delimiter after which we extract the text. A negative number searches from the end.")),
|
|
20831
|
+
arg(`match_mode (number, default=${TEXT_FN_DEFAULT_MATCH_MODE})`, _t("0 = case-sensitive, 1 = case-insensitive.")),
|
|
20832
|
+
arg(`match_end (number, default=${TEXT_FN_DEFAULT_MATCH_END}))`, _t("Whether to treat the end of text as a delimiter.")),
|
|
20833
|
+
arg(`if_not_found (string, default="${CellErrorType.NotAvailable}")`, _t("Value to return if the delimiter is not found.")),
|
|
20834
|
+
],
|
|
20835
|
+
compute: function (text, delimiter, matchIndex = { value: TEXT_FN_DEFAULT_INSTANCE }, matchMode = { value: TEXT_FN_DEFAULT_MATCH_MODE }, matchEnd = { value: TEXT_FN_DEFAULT_MATCH_END }, ifNotFound = new NotAvailableError()) {
|
|
20836
|
+
const _text = toString(text);
|
|
20837
|
+
const _matchIndex = toNumber(matchIndex, this.locale);
|
|
20838
|
+
const _matchMode = toNumber(matchMode, this.locale);
|
|
20839
|
+
const _matchEnd = toNumber(matchEnd, this.locale);
|
|
20840
|
+
if (_matchIndex === 0) {
|
|
20841
|
+
return new EvaluationError(_t("The instance_num (%s) must not be zero.", _matchIndex));
|
|
20842
|
+
}
|
|
20843
|
+
if (_matchMode !== 0 && _matchMode !== 1) {
|
|
20844
|
+
return new EvaluationError(_t("match_mode should have a value of 0 or 1."));
|
|
20845
|
+
}
|
|
20846
|
+
if (_matchEnd !== 0 && _matchEnd !== 1) {
|
|
20847
|
+
return new EvaluationError(_t("match_end should have a value of 0 or 1."));
|
|
20848
|
+
}
|
|
20849
|
+
const _delimiter = toString(delimiter);
|
|
20850
|
+
if (_delimiter === "") {
|
|
20851
|
+
return Math.sign(_matchIndex) > 0 ? { value: _text } : { value: "" };
|
|
20852
|
+
}
|
|
20853
|
+
const flags = _matchMode === 1 ? "gi" : "g";
|
|
20854
|
+
const pattern = escapeRegExp(_delimiter);
|
|
20855
|
+
const regexp = new RegExp(pattern, flags);
|
|
20856
|
+
let matchIndices = [..._text.matchAll(regexp)].map((match) => match.index + pattern.length);
|
|
20857
|
+
if (_matchIndex < 0) {
|
|
20858
|
+
matchIndices = matchIndices.reverse();
|
|
20859
|
+
}
|
|
20860
|
+
// If _matchEnd, we act like the text is appended by the delimiter (or prepended if negative index)
|
|
20861
|
+
if (_matchEnd && Math.abs(_matchIndex) === matchIndices.length + 1) {
|
|
20862
|
+
return Math.sign(_matchIndex) > 0 ? { value: "" } : { value: _text };
|
|
20863
|
+
}
|
|
20864
|
+
const targetIndex = matchIndices[Math.abs(_matchIndex) - 1];
|
|
20865
|
+
return targetIndex === undefined ? ifNotFound : { value: _text.substring(targetIndex) };
|
|
20866
|
+
},
|
|
20867
|
+
isExported: true,
|
|
20868
|
+
};
|
|
20869
|
+
// -----------------------------------------------------------------------------
|
|
20870
|
+
// TEXTBEFORE
|
|
20871
|
+
// -----------------------------------------------------------------------------
|
|
20872
|
+
const TEXTBEFORE = {
|
|
20873
|
+
description: _t("Returns text that occurs before a given substring or delimiter."),
|
|
20874
|
+
args: [
|
|
20875
|
+
arg("text (string)", _t("The source text.")),
|
|
20876
|
+
arg("delimiter (string)", _t("The substring after which text will be returned.")),
|
|
20877
|
+
arg(`instance_num (number, default=${TEXT_FN_DEFAULT_INSTANCE})`, _t("The desired instance of the delimiter before which we extract the text. A negative number searches from the end.")),
|
|
20878
|
+
arg(`match_mode (number, default=${TEXT_FN_DEFAULT_MATCH_MODE})`, _t("0 = case-sensitive, 1 = case-insensitive.")),
|
|
20879
|
+
arg(`match_end (number, default=${TEXT_FN_DEFAULT_MATCH_END}))`, _t("Whether to match a delimiter against the end of the text.")),
|
|
20880
|
+
arg(`if_not_found (string, default="${CellErrorType.NotAvailable}")`, _t("Value to return if the delimiter is not found.")),
|
|
20881
|
+
],
|
|
20882
|
+
compute: function (text, delimiter, matchIndex = { value: TEXT_FN_DEFAULT_INSTANCE }, matchMode = { value: TEXT_FN_DEFAULT_MATCH_MODE }, matchEnd = { value: TEXT_FN_DEFAULT_MATCH_END }, ifNotFound = new NotAvailableError()) {
|
|
20883
|
+
const _text = toString(text);
|
|
20884
|
+
const _matchIndex = toNumber(matchIndex, this.locale);
|
|
20885
|
+
const _matchMode = toNumber(matchMode, this.locale);
|
|
20886
|
+
const _matchEnd = toNumber(matchEnd, this.locale);
|
|
20887
|
+
if (_matchIndex === 0) {
|
|
20888
|
+
return new EvaluationError(_t("The instance_num (%s) must not be zero.", _matchIndex));
|
|
20889
|
+
}
|
|
20890
|
+
if (_matchMode !== 0 && _matchMode !== 1) {
|
|
20891
|
+
return new EvaluationError(_t("match_mode should have a value of 0 or 1."));
|
|
20892
|
+
}
|
|
20893
|
+
if (_matchEnd !== 0 && _matchEnd !== 1) {
|
|
20894
|
+
return new EvaluationError(_t("match_end should have a value of 0 or 1."));
|
|
20895
|
+
}
|
|
20896
|
+
const _delimiter = toString(delimiter);
|
|
20897
|
+
if (_delimiter === "") {
|
|
20898
|
+
return Math.sign(_matchIndex) > 0 ? { value: "" } : { value: _text };
|
|
20899
|
+
}
|
|
20900
|
+
const flags = _matchMode === 1 ? "gi" : "g";
|
|
20901
|
+
const pattern = escapeRegExp(_delimiter);
|
|
20902
|
+
const regexp = new RegExp(pattern, flags);
|
|
20903
|
+
let matchIndices = [..._text.matchAll(regexp)].map((match) => match.index + pattern.length);
|
|
20904
|
+
if (_matchIndex < 0) {
|
|
20905
|
+
matchIndices = matchIndices.reverse();
|
|
20906
|
+
}
|
|
20907
|
+
// If _matchEnd, we act like the text is appended by the delimiter (or prepended if negative index)
|
|
20908
|
+
if (_matchEnd && Math.abs(_matchIndex) === matchIndices.length + 1) {
|
|
20909
|
+
return Math.sign(_matchIndex) > 0 ? { value: _text } : { value: "" };
|
|
20910
|
+
}
|
|
20911
|
+
const targetIndex = matchIndices[Math.abs(_matchIndex) - 1];
|
|
20912
|
+
return targetIndex === undefined
|
|
20913
|
+
? ifNotFound
|
|
20914
|
+
: { value: _text.substring(0, targetIndex - _delimiter.length) };
|
|
20915
|
+
},
|
|
20916
|
+
isExported: true,
|
|
20917
|
+
};
|
|
20756
20918
|
|
|
20757
20919
|
var text = /*#__PURE__*/Object.freeze({
|
|
20758
20920
|
__proto__: null,
|
|
@@ -20767,12 +20929,15 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
20767
20929
|
LOWER: LOWER,
|
|
20768
20930
|
MID: MID,
|
|
20769
20931
|
PROPER: PROPER,
|
|
20932
|
+
REGEXEXTRACT: REGEXEXTRACT,
|
|
20770
20933
|
REPLACE: REPLACE,
|
|
20771
20934
|
RIGHT: RIGHT,
|
|
20772
20935
|
SEARCH: SEARCH,
|
|
20773
20936
|
SPLIT: SPLIT,
|
|
20774
20937
|
SUBSTITUTE: SUBSTITUTE,
|
|
20775
20938
|
TEXT: TEXT,
|
|
20939
|
+
TEXTAFTER: TEXTAFTER,
|
|
20940
|
+
TEXTBEFORE: TEXTBEFORE,
|
|
20776
20941
|
TEXTJOIN: TEXTJOIN,
|
|
20777
20942
|
TEXTSPLIT: TEXTSPLIT,
|
|
20778
20943
|
TRIM: TRIM,
|
|
@@ -22776,6 +22941,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
22776
22941
|
this.animationStore = useStore(ChartAnimationStore);
|
|
22777
22942
|
}
|
|
22778
22943
|
owl.onMounted(() => {
|
|
22944
|
+
registerChartJSExtensions();
|
|
22779
22945
|
const runtime = this.chartRuntime;
|
|
22780
22946
|
this.currentRuntime = runtime;
|
|
22781
22947
|
// Note: chartJS modify the runtime in place, so it's important to give it a copy
|
|
@@ -32178,40 +32344,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
32178
32344
|
return sameColor && sameClass && sameContent;
|
|
32179
32345
|
}
|
|
32180
32346
|
|
|
32181
|
-
// -----------------------------------------------------------------------------
|
|
32182
|
-
// Formula Assistant component
|
|
32183
|
-
// -----------------------------------------------------------------------------
|
|
32184
|
-
css /* scss */ `
|
|
32185
|
-
.o-formula-assistant {
|
|
32186
|
-
background: #ffffff;
|
|
32187
|
-
.o-formula-assistant-head {
|
|
32188
|
-
background-color: #f2f2f2;
|
|
32189
|
-
padding: 10px;
|
|
32190
|
-
}
|
|
32191
|
-
.collapsed {
|
|
32192
|
-
transform: rotate(180deg);
|
|
32193
|
-
}
|
|
32194
|
-
.o-formula-assistant-core {
|
|
32195
|
-
border-bottom: 1px solid gray;
|
|
32196
|
-
}
|
|
32197
|
-
.o-formula-assistant-arg-description {
|
|
32198
|
-
font-size: 85%;
|
|
32199
|
-
}
|
|
32200
|
-
.o-formula-assistant-focus {
|
|
32201
|
-
div:first-child,
|
|
32202
|
-
span {
|
|
32203
|
-
color: ${COMPOSER_ASSISTANT_COLOR};
|
|
32204
|
-
text-shadow: 0px 0px 1px ${COMPOSER_ASSISTANT_COLOR};
|
|
32205
|
-
}
|
|
32206
|
-
div:last-child {
|
|
32207
|
-
color: black;
|
|
32208
|
-
}
|
|
32209
|
-
}
|
|
32210
|
-
.o-formula-assistant-gray {
|
|
32211
|
-
color: gray;
|
|
32212
|
-
}
|
|
32213
|
-
}
|
|
32214
|
-
`;
|
|
32215
32347
|
class FunctionDescriptionProvider extends owl.Component {
|
|
32216
32348
|
static template = "o-spreadsheet-FunctionDescriptionProvider";
|
|
32217
32349
|
static props = {
|
|
@@ -51924,16 +52056,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
51924
52056
|
return cssPropertiesToCss(cellStyleToCss(rule.style));
|
|
51925
52057
|
}
|
|
51926
52058
|
else if (rule.type === "ColorScaleRule") {
|
|
51927
|
-
const minColor =
|
|
51928
|
-
const midColor = rule.midpoint ?
|
|
51929
|
-
const maxColor =
|
|
52059
|
+
const minColor = colorNumberToHex(rule.minimum.color);
|
|
52060
|
+
const midColor = rule.midpoint ? colorNumberToHex(rule.midpoint.color) : null;
|
|
52061
|
+
const maxColor = colorNumberToHex(rule.maximum.color);
|
|
51930
52062
|
const baseString = "background-image: linear-gradient(to right, ";
|
|
51931
52063
|
return midColor
|
|
51932
52064
|
? baseString + minColor + ", " + midColor + ", " + maxColor + ")"
|
|
51933
52065
|
: baseString + minColor + ", " + maxColor + ")";
|
|
51934
52066
|
}
|
|
51935
52067
|
else if (rule.type === "DataBarRule") {
|
|
51936
|
-
const color =
|
|
52068
|
+
const color = colorNumberToHex(rule.color);
|
|
51937
52069
|
return `background-image: linear-gradient(to right, ${color} 50%, white 50%)`;
|
|
51938
52070
|
}
|
|
51939
52071
|
return "";
|
|
@@ -52141,7 +52273,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
52141
52273
|
icons = ICONS;
|
|
52142
52274
|
iconSets = ICON_SETS;
|
|
52143
52275
|
getTextDecoration = getTextDecoration;
|
|
52144
|
-
|
|
52276
|
+
colorNumberToHex = colorNumberToHex;
|
|
52145
52277
|
state;
|
|
52146
52278
|
setup() {
|
|
52147
52279
|
this.state = owl.useState({
|
|
@@ -52392,9 +52524,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
52392
52524
|
}
|
|
52393
52525
|
getPreviewGradient() {
|
|
52394
52526
|
const rule = this.state.rules.colorScale;
|
|
52395
|
-
const minColor =
|
|
52396
|
-
const midColor =
|
|
52397
|
-
const maxColor =
|
|
52527
|
+
const minColor = colorNumberToHex(rule.minimum.color);
|
|
52528
|
+
const midColor = colorNumberToHex(rule.midpoint?.color || DEFAULT_COLOR_SCALE_MIDPOINT_COLOR);
|
|
52529
|
+
const maxColor = colorNumberToHex(rule.maximum.color);
|
|
52398
52530
|
const baseString = "background-image: linear-gradient(to right, ";
|
|
52399
52531
|
return rule.midpoint === undefined
|
|
52400
52532
|
? baseString + minColor + ", " + maxColor + ")"
|
|
@@ -52402,8 +52534,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
52402
52534
|
}
|
|
52403
52535
|
getThresholdColor(threshold) {
|
|
52404
52536
|
return threshold
|
|
52405
|
-
?
|
|
52406
|
-
:
|
|
52537
|
+
? colorNumberToHex(threshold.color)
|
|
52538
|
+
: colorNumberToHex(DEFAULT_COLOR_SCALE_MIDPOINT_COLOR);
|
|
52407
52539
|
}
|
|
52408
52540
|
onMidpointChange(ev) {
|
|
52409
52541
|
const type = ev.target.value;
|
|
@@ -66627,9 +66759,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66627
66759
|
formatColors.push(rule.style.fillColor);
|
|
66628
66760
|
}
|
|
66629
66761
|
else if (rule.type === "ColorScaleRule") {
|
|
66630
|
-
formatColors.push(
|
|
66631
|
-
formatColors.push(rule.midpoint ?
|
|
66632
|
-
formatColors.push(
|
|
66762
|
+
formatColors.push(colorNumberToHex(rule.minimum.color));
|
|
66763
|
+
formatColors.push(rule.midpoint ? colorNumberToHex(rule.midpoint.color) : undefined);
|
|
66764
|
+
formatColors.push(colorNumberToHex(rule.maximum.color));
|
|
66633
66765
|
}
|
|
66634
66766
|
}
|
|
66635
66767
|
return formatColors.filter(isDefined);
|
|
@@ -67000,7 +67132,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
67000
67132
|
if (!computedDataBars[col])
|
|
67001
67133
|
computedDataBars[col] = [];
|
|
67002
67134
|
computedDataBars[col][row] = {
|
|
67003
|
-
color:
|
|
67135
|
+
color: colorNumberToHex(color),
|
|
67004
67136
|
percentage: (cell.value * 100) / max,
|
|
67005
67137
|
};
|
|
67006
67138
|
}
|
|
@@ -80024,7 +80156,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
80024
80156
|
}
|
|
80025
80157
|
}
|
|
80026
80158
|
|
|
80027
|
-
.o-spreadsheet-topbar-wrapper,
|
|
80028
80159
|
.o-spreadsheet-bottombar-wrapper {
|
|
80029
80160
|
z-index: ${ComponentsImportance.ScrollBar + 1};
|
|
80030
80161
|
}
|
|
@@ -80139,7 +80270,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
80139
80270
|
this.checkViewportSize();
|
|
80140
80271
|
stores.on("store-updated", this, render);
|
|
80141
80272
|
resizeObserver.observe(this.spreadsheetRef.el);
|
|
80142
|
-
registerChartJSExtensions();
|
|
80143
80273
|
});
|
|
80144
80274
|
owl.onWillUnmount(() => {
|
|
80145
80275
|
this.unbindModelEvents();
|
|
@@ -82785,7 +82915,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
82785
82915
|
<dataBar>
|
|
82786
82916
|
<cfvo type="min" val="0"/>
|
|
82787
82917
|
<cfvo type="max" val="100"/>
|
|
82788
|
-
<color rgb="${toXlsxHexColor(
|
|
82918
|
+
<color rgb="${toXlsxHexColor(colorNumberToHex(rule.color))}"/>
|
|
82789
82919
|
</dataBar>
|
|
82790
82920
|
</cfRule>
|
|
82791
82921
|
</conditionalFormatting>
|
|
@@ -82813,7 +82943,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
82813
82943
|
continue;
|
|
82814
82944
|
}
|
|
82815
82945
|
cfValueObject.push(thresholdAttributes(threshold, position));
|
|
82816
|
-
colors.push([["rgb", toXlsxHexColor(
|
|
82946
|
+
colors.push([["rgb", toXlsxHexColor(colorNumberToHex(threshold.color))]]);
|
|
82817
82947
|
}
|
|
82818
82948
|
if (!canExport) {
|
|
82819
82949
|
console.warn("Conditional formats with formula rules are not supported at the moment. The rule is therefore skipped.");
|
|
@@ -84875,9 +85005,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
84875
85005
|
exports.tokenize = tokenize;
|
|
84876
85006
|
|
|
84877
85007
|
|
|
84878
|
-
__info__.version = "18.5.0-alpha.
|
|
84879
|
-
__info__.date = "2025-
|
|
84880
|
-
__info__.hash = "
|
|
85008
|
+
__info__.version = "18.5.0-alpha.5";
|
|
85009
|
+
__info__.date = "2025-08-04T06:53:29.412Z";
|
|
85010
|
+
__info__.hash = "71c9a36";
|
|
84881
85011
|
|
|
84882
85012
|
|
|
84883
85013
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|