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