@odoo/o-spreadsheet 15.0.15 → 15.0.17
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 +62 -67
- package/dist/o-spreadsheet.esm.js +62 -67
- package/dist/o-spreadsheet.iife.js +62 -67
- package/dist/o-spreadsheet.iife.min.js +2 -2
- package/package.json +1 -1
|
@@ -18730,15 +18730,20 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
18730
18730
|
// Getters
|
|
18731
18731
|
// ---------------------------------------------------------------------------
|
|
18732
18732
|
evaluateFormula(formulaString, sheetId = this.getters.getActiveSheetId()) {
|
|
18733
|
-
|
|
18734
|
-
|
|
18735
|
-
|
|
18736
|
-
|
|
18737
|
-
|
|
18738
|
-
|
|
18733
|
+
try {
|
|
18734
|
+
let formula = normalize(formulaString);
|
|
18735
|
+
const compiledFormula = compile(formula);
|
|
18736
|
+
const params = this.getFormulaParameters(() => { });
|
|
18737
|
+
const ranges = [];
|
|
18738
|
+
for (let xc of formula.dependencies.references) {
|
|
18739
|
+
ranges.push(this.getters.getRangeFromSheetXC(sheetId, xc));
|
|
18740
|
+
}
|
|
18741
|
+
const dependencies = { ...formula.dependencies, references: ranges };
|
|
18742
|
+
return compiledFormula(dependencies, sheetId, ...params);
|
|
18743
|
+
}
|
|
18744
|
+
catch (error) {
|
|
18745
|
+
return "#ERROR";
|
|
18739
18746
|
}
|
|
18740
|
-
const dependencies = { ...formula.dependencies, references: ranges };
|
|
18741
|
-
return compiledFormula(dependencies, sheetId, ...params);
|
|
18742
18747
|
}
|
|
18743
18748
|
/**
|
|
18744
18749
|
* Return the value of each cell in the range as they are displayed in the grid.
|
|
@@ -18819,17 +18824,10 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
18819
18824
|
const evalContext = Object.assign(Object.create(functionMap), this.evalContext, {
|
|
18820
18825
|
getters: this.getters,
|
|
18821
18826
|
});
|
|
18822
|
-
const sheets = this.getters.getEvaluationSheets();
|
|
18823
18827
|
function readCell(range) {
|
|
18824
18828
|
var _a;
|
|
18825
|
-
|
|
18826
|
-
const
|
|
18827
|
-
if (s) {
|
|
18828
|
-
cell = (_a = s.rows[range.zone.top]) === null || _a === void 0 ? void 0 : _a.cells[range.zone.left];
|
|
18829
|
-
}
|
|
18830
|
-
else {
|
|
18831
|
-
throw new Error(_lt("Invalid sheet name"));
|
|
18832
|
-
}
|
|
18829
|
+
const sheet = evalContext.getters.getSheet(range.sheetId);
|
|
18830
|
+
const cell = (_a = sheet.rows[range.zone.top]) === null || _a === void 0 ? void 0 : _a.cells[range.zone.left];
|
|
18833
18831
|
if (!cell || cell.isEmpty()) {
|
|
18834
18832
|
// magic "empty" value
|
|
18835
18833
|
// Returning null instead of undefined will ensure that we don't
|
|
@@ -18852,10 +18850,8 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
18852
18850
|
* that are actually present in the grid.
|
|
18853
18851
|
*/
|
|
18854
18852
|
function _range(range) {
|
|
18855
|
-
|
|
18856
|
-
|
|
18857
|
-
throw new Error(_lt("Invalid reference"));
|
|
18858
|
-
}
|
|
18853
|
+
assertRangeValid(range);
|
|
18854
|
+
const sheet = evalContext.getters.getSheet(range.sheetId);
|
|
18859
18855
|
// Performance issue: Avoid fetching data on positions that are out of the spreadsheet
|
|
18860
18856
|
// e.g. A1:ZZZ9999 in a sheet with 10 cols and 10 rows should ignore everything past J10 and return a 10x10 array
|
|
18861
18857
|
const sheetZone = {
|
|
@@ -18894,21 +18890,16 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
18894
18890
|
*/
|
|
18895
18891
|
function refFn(position, references, sheetId, isMeta, functionName, paramNumber) {
|
|
18896
18892
|
const range = references[position];
|
|
18893
|
+
assertRangeValid(range);
|
|
18897
18894
|
if (isMeta) {
|
|
18898
18895
|
return evalContext.getters.getRangeString(range, sheetId);
|
|
18899
18896
|
}
|
|
18900
|
-
if (!isZoneValid(range.zone)) {
|
|
18901
|
-
throw new Error(_lt("Invalid reference"));
|
|
18902
|
-
}
|
|
18903
18897
|
// if the formula definition could have accepted a range, we would pass through the _range function and not here
|
|
18904
18898
|
if (range.zone.bottom !== range.zone.top || range.zone.left !== range.zone.right) {
|
|
18905
18899
|
throw new Error(paramNumber
|
|
18906
18900
|
? _lt("Function %s expects the parameter %s to be a single value or a single cell reference, not a range.", functionName.toString(), paramNumber.toString())
|
|
18907
18901
|
: _lt("Function %s expects its parameters to be single values or single cell references, not ranges.", functionName.toString()));
|
|
18908
18902
|
}
|
|
18909
|
-
if (range.invalidSheetName) {
|
|
18910
|
-
throw new Error(_lt("Invalid sheet name: %s", range.invalidSheetName));
|
|
18911
|
-
}
|
|
18912
18903
|
return readCell(range);
|
|
18913
18904
|
}
|
|
18914
18905
|
/**
|
|
@@ -18921,6 +18912,14 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
18921
18912
|
function range(position, references, sheetId) {
|
|
18922
18913
|
return _range(references[position]);
|
|
18923
18914
|
}
|
|
18915
|
+
function assertRangeValid(range) {
|
|
18916
|
+
if (!isZoneValid(range.zone)) {
|
|
18917
|
+
throw new Error(_lt("Invalid reference"));
|
|
18918
|
+
}
|
|
18919
|
+
if (range.invalidSheetName) {
|
|
18920
|
+
throw new Error(_lt("Invalid sheet name: %s", range.invalidSheetName));
|
|
18921
|
+
}
|
|
18922
|
+
}
|
|
18924
18923
|
return [refFn, range, evalContext];
|
|
18925
18924
|
}
|
|
18926
18925
|
/**
|
|
@@ -19233,25 +19232,26 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
19233
19232
|
*/
|
|
19234
19233
|
this.rulePredicate = {
|
|
19235
19234
|
CellIsRule: (cell, rule) => {
|
|
19235
|
+
var _a, _b, _c, _d, _e, _f;
|
|
19236
19236
|
if (cell && cell.evaluated.type === CellValueType.error) {
|
|
19237
19237
|
return false;
|
|
19238
19238
|
}
|
|
19239
19239
|
const values = rule.values.map(parsePrimitiveContent);
|
|
19240
19240
|
switch (rule.operator) {
|
|
19241
19241
|
case "IsEmpty":
|
|
19242
|
-
return !isDefined(cell) || cell.evaluated.value.toString().trim() === "";
|
|
19242
|
+
return !isDefined(cell) || ((_a = cell.evaluated.value) === null || _a === void 0 ? void 0 : _a.toString().trim()) === "";
|
|
19243
19243
|
case "IsNotEmpty":
|
|
19244
|
-
return isDefined(cell) && cell.evaluated.value.toString().trim() !== "";
|
|
19244
|
+
return isDefined(cell) && ((_b = cell.evaluated.value) === null || _b === void 0 ? void 0 : _b.toString().trim()) !== "";
|
|
19245
19245
|
case "BeginsWith":
|
|
19246
19246
|
if (!cell && values[0] === "") {
|
|
19247
19247
|
return false;
|
|
19248
19248
|
}
|
|
19249
|
-
return (isDefined(cell) && (cell === null ||
|
|
19249
|
+
return (isDefined(cell) && ((_c = cell.evaluated.value) === null || _c === void 0 ? void 0 : _c.toString().startsWith(values[0].toString())));
|
|
19250
19250
|
case "EndsWith":
|
|
19251
19251
|
if (!cell && values[0] === "") {
|
|
19252
19252
|
return false;
|
|
19253
19253
|
}
|
|
19254
|
-
return isDefined(cell) && cell.evaluated.value.toString().endsWith(values[0].toString());
|
|
19254
|
+
return isDefined(cell) && ((_d = cell.evaluated.value) === null || _d === void 0 ? void 0 : _d.toString().endsWith(values[0].toString()));
|
|
19255
19255
|
case "Between":
|
|
19256
19256
|
return (isDefined(cell) &&
|
|
19257
19257
|
cell.evaluated.value >= values[0] &&
|
|
@@ -19261,11 +19261,11 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
19261
19261
|
cell.evaluated.value >= values[0] &&
|
|
19262
19262
|
cell.evaluated.value <= values[1]);
|
|
19263
19263
|
case "ContainsText":
|
|
19264
|
-
return (isDefined(cell) && cell.evaluated.value.toString().indexOf(values[0].toString()) > -1);
|
|
19264
|
+
return (isDefined(cell) && ((_e = cell.evaluated.value) === null || _e === void 0 ? void 0 : _e.toString().indexOf(values[0].toString())) > -1);
|
|
19265
19265
|
case "NotContains":
|
|
19266
19266
|
return (!isDefined(cell) ||
|
|
19267
19267
|
!cell.evaluated.value ||
|
|
19268
|
-
cell.evaluated.value.toString().indexOf(values[0].toString()) == -1);
|
|
19268
|
+
((_f = cell.evaluated.value) === null || _f === void 0 ? void 0 : _f.toString().indexOf(values[0].toString())) == -1);
|
|
19269
19269
|
case "GreaterThan":
|
|
19270
19270
|
return isDefined(cell) && cell.evaluated.value > values[0];
|
|
19271
19271
|
case "GreaterThanOrEqual":
|
|
@@ -19374,39 +19374,34 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
19374
19374
|
this.computedIcons[activeSheetId] = {};
|
|
19375
19375
|
const computedStyle = this.computedStyles[activeSheetId];
|
|
19376
19376
|
for (let cf of this.getters.getConditionalFormats(activeSheetId)) {
|
|
19377
|
-
|
|
19378
|
-
|
|
19379
|
-
|
|
19380
|
-
|
|
19381
|
-
|
|
19382
|
-
|
|
19383
|
-
|
|
19384
|
-
|
|
19385
|
-
|
|
19386
|
-
|
|
19387
|
-
|
|
19388
|
-
|
|
19389
|
-
|
|
19390
|
-
|
|
19391
|
-
|
|
19392
|
-
for (let
|
|
19393
|
-
|
|
19394
|
-
|
|
19395
|
-
|
|
19396
|
-
if (
|
|
19397
|
-
|
|
19398
|
-
|
|
19399
|
-
|
|
19400
|
-
computedStyle[col][row] = Object.assign(((_a = computedStyle[col]) === null || _a === void 0 ? void 0 : _a[row]) || {}, cf.rule.style);
|
|
19401
|
-
}
|
|
19377
|
+
switch (cf.rule.type) {
|
|
19378
|
+
case "ColorScaleRule":
|
|
19379
|
+
for (let range of cf.ranges) {
|
|
19380
|
+
this.applyColorScale(range, cf.rule);
|
|
19381
|
+
}
|
|
19382
|
+
break;
|
|
19383
|
+
case "IconSetRule":
|
|
19384
|
+
for (let range of cf.ranges) {
|
|
19385
|
+
this.applyIcon(range, cf.rule);
|
|
19386
|
+
}
|
|
19387
|
+
break;
|
|
19388
|
+
default:
|
|
19389
|
+
for (let ref of cf.ranges) {
|
|
19390
|
+
const zone = toZone(ref);
|
|
19391
|
+
for (let row = zone.top; row <= zone.bottom; row++) {
|
|
19392
|
+
for (let col = zone.left; col <= zone.right; col++) {
|
|
19393
|
+
const pr = this.rulePredicate[cf.rule.type];
|
|
19394
|
+
let cell = this.getters.getCell(activeSheetId, col, row);
|
|
19395
|
+
if (pr && pr(cell, cf.rule)) {
|
|
19396
|
+
if (!computedStyle[col])
|
|
19397
|
+
computedStyle[col] = [];
|
|
19398
|
+
// we must combine all the properties of all the CF rules applied to the given cell
|
|
19399
|
+
computedStyle[col][row] = Object.assign(((_a = computedStyle[col]) === null || _a === void 0 ? void 0 : _a[row]) || {}, cf.rule.style);
|
|
19402
19400
|
}
|
|
19403
19401
|
}
|
|
19404
19402
|
}
|
|
19405
|
-
|
|
19406
|
-
|
|
19407
|
-
}
|
|
19408
|
-
catch (_) {
|
|
19409
|
-
// we don't care about the errors within the evaluation of a rule
|
|
19403
|
+
}
|
|
19404
|
+
break;
|
|
19410
19405
|
}
|
|
19411
19406
|
}
|
|
19412
19407
|
}
|
|
@@ -19425,7 +19420,7 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
19425
19420
|
return this.getters.evaluateFormula(`=PERCENTILE(${range},${Number(threshold.value) / 100})`);
|
|
19426
19421
|
case "formula":
|
|
19427
19422
|
const value = threshold.value && this.getters.evaluateFormula(threshold.value);
|
|
19428
|
-
return
|
|
19423
|
+
return typeof value === "number" ? value : null;
|
|
19429
19424
|
default:
|
|
19430
19425
|
return null;
|
|
19431
19426
|
}
|
|
@@ -31507,6 +31502,6 @@ exports.registries = registries;
|
|
|
31507
31502
|
exports.setTranslationMethod = setTranslationMethod;
|
|
31508
31503
|
|
|
31509
31504
|
|
|
31510
|
-
__info__.version = '15.0.
|
|
31511
|
-
__info__.date = '2024-01-
|
|
31512
|
-
__info__.hash = '
|
|
31505
|
+
__info__.version = '15.0.17';
|
|
31506
|
+
__info__.date = '2024-01-29T13:46:44.293Z';
|
|
31507
|
+
__info__.hash = '6944f99';
|
|
@@ -18707,15 +18707,20 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
18707
18707
|
// Getters
|
|
18708
18708
|
// ---------------------------------------------------------------------------
|
|
18709
18709
|
evaluateFormula(formulaString, sheetId = this.getters.getActiveSheetId()) {
|
|
18710
|
-
|
|
18711
|
-
|
|
18712
|
-
|
|
18713
|
-
|
|
18714
|
-
|
|
18715
|
-
|
|
18710
|
+
try {
|
|
18711
|
+
let formula = normalize(formulaString);
|
|
18712
|
+
const compiledFormula = compile(formula);
|
|
18713
|
+
const params = this.getFormulaParameters(() => { });
|
|
18714
|
+
const ranges = [];
|
|
18715
|
+
for (let xc of formula.dependencies.references) {
|
|
18716
|
+
ranges.push(this.getters.getRangeFromSheetXC(sheetId, xc));
|
|
18717
|
+
}
|
|
18718
|
+
const dependencies = { ...formula.dependencies, references: ranges };
|
|
18719
|
+
return compiledFormula(dependencies, sheetId, ...params);
|
|
18720
|
+
}
|
|
18721
|
+
catch (error) {
|
|
18722
|
+
return "#ERROR";
|
|
18716
18723
|
}
|
|
18717
|
-
const dependencies = { ...formula.dependencies, references: ranges };
|
|
18718
|
-
return compiledFormula(dependencies, sheetId, ...params);
|
|
18719
18724
|
}
|
|
18720
18725
|
/**
|
|
18721
18726
|
* Return the value of each cell in the range as they are displayed in the grid.
|
|
@@ -18796,17 +18801,10 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
18796
18801
|
const evalContext = Object.assign(Object.create(functionMap), this.evalContext, {
|
|
18797
18802
|
getters: this.getters,
|
|
18798
18803
|
});
|
|
18799
|
-
const sheets = this.getters.getEvaluationSheets();
|
|
18800
18804
|
function readCell(range) {
|
|
18801
18805
|
var _a;
|
|
18802
|
-
|
|
18803
|
-
const
|
|
18804
|
-
if (s) {
|
|
18805
|
-
cell = (_a = s.rows[range.zone.top]) === null || _a === void 0 ? void 0 : _a.cells[range.zone.left];
|
|
18806
|
-
}
|
|
18807
|
-
else {
|
|
18808
|
-
throw new Error(_lt("Invalid sheet name"));
|
|
18809
|
-
}
|
|
18806
|
+
const sheet = evalContext.getters.getSheet(range.sheetId);
|
|
18807
|
+
const cell = (_a = sheet.rows[range.zone.top]) === null || _a === void 0 ? void 0 : _a.cells[range.zone.left];
|
|
18810
18808
|
if (!cell || cell.isEmpty()) {
|
|
18811
18809
|
// magic "empty" value
|
|
18812
18810
|
// Returning null instead of undefined will ensure that we don't
|
|
@@ -18829,10 +18827,8 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
18829
18827
|
* that are actually present in the grid.
|
|
18830
18828
|
*/
|
|
18831
18829
|
function _range(range) {
|
|
18832
|
-
|
|
18833
|
-
|
|
18834
|
-
throw new Error(_lt("Invalid reference"));
|
|
18835
|
-
}
|
|
18830
|
+
assertRangeValid(range);
|
|
18831
|
+
const sheet = evalContext.getters.getSheet(range.sheetId);
|
|
18836
18832
|
// Performance issue: Avoid fetching data on positions that are out of the spreadsheet
|
|
18837
18833
|
// e.g. A1:ZZZ9999 in a sheet with 10 cols and 10 rows should ignore everything past J10 and return a 10x10 array
|
|
18838
18834
|
const sheetZone = {
|
|
@@ -18871,21 +18867,16 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
18871
18867
|
*/
|
|
18872
18868
|
function refFn(position, references, sheetId, isMeta, functionName, paramNumber) {
|
|
18873
18869
|
const range = references[position];
|
|
18870
|
+
assertRangeValid(range);
|
|
18874
18871
|
if (isMeta) {
|
|
18875
18872
|
return evalContext.getters.getRangeString(range, sheetId);
|
|
18876
18873
|
}
|
|
18877
|
-
if (!isZoneValid(range.zone)) {
|
|
18878
|
-
throw new Error(_lt("Invalid reference"));
|
|
18879
|
-
}
|
|
18880
18874
|
// if the formula definition could have accepted a range, we would pass through the _range function and not here
|
|
18881
18875
|
if (range.zone.bottom !== range.zone.top || range.zone.left !== range.zone.right) {
|
|
18882
18876
|
throw new Error(paramNumber
|
|
18883
18877
|
? _lt("Function %s expects the parameter %s to be a single value or a single cell reference, not a range.", functionName.toString(), paramNumber.toString())
|
|
18884
18878
|
: _lt("Function %s expects its parameters to be single values or single cell references, not ranges.", functionName.toString()));
|
|
18885
18879
|
}
|
|
18886
|
-
if (range.invalidSheetName) {
|
|
18887
|
-
throw new Error(_lt("Invalid sheet name: %s", range.invalidSheetName));
|
|
18888
|
-
}
|
|
18889
18880
|
return readCell(range);
|
|
18890
18881
|
}
|
|
18891
18882
|
/**
|
|
@@ -18898,6 +18889,14 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
18898
18889
|
function range(position, references, sheetId) {
|
|
18899
18890
|
return _range(references[position]);
|
|
18900
18891
|
}
|
|
18892
|
+
function assertRangeValid(range) {
|
|
18893
|
+
if (!isZoneValid(range.zone)) {
|
|
18894
|
+
throw new Error(_lt("Invalid reference"));
|
|
18895
|
+
}
|
|
18896
|
+
if (range.invalidSheetName) {
|
|
18897
|
+
throw new Error(_lt("Invalid sheet name: %s", range.invalidSheetName));
|
|
18898
|
+
}
|
|
18899
|
+
}
|
|
18901
18900
|
return [refFn, range, evalContext];
|
|
18902
18901
|
}
|
|
18903
18902
|
/**
|
|
@@ -19210,25 +19209,26 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
19210
19209
|
*/
|
|
19211
19210
|
this.rulePredicate = {
|
|
19212
19211
|
CellIsRule: (cell, rule) => {
|
|
19212
|
+
var _a, _b, _c, _d, _e, _f;
|
|
19213
19213
|
if (cell && cell.evaluated.type === CellValueType.error) {
|
|
19214
19214
|
return false;
|
|
19215
19215
|
}
|
|
19216
19216
|
const values = rule.values.map(parsePrimitiveContent);
|
|
19217
19217
|
switch (rule.operator) {
|
|
19218
19218
|
case "IsEmpty":
|
|
19219
|
-
return !isDefined(cell) || cell.evaluated.value.toString().trim() === "";
|
|
19219
|
+
return !isDefined(cell) || ((_a = cell.evaluated.value) === null || _a === void 0 ? void 0 : _a.toString().trim()) === "";
|
|
19220
19220
|
case "IsNotEmpty":
|
|
19221
|
-
return isDefined(cell) && cell.evaluated.value.toString().trim() !== "";
|
|
19221
|
+
return isDefined(cell) && ((_b = cell.evaluated.value) === null || _b === void 0 ? void 0 : _b.toString().trim()) !== "";
|
|
19222
19222
|
case "BeginsWith":
|
|
19223
19223
|
if (!cell && values[0] === "") {
|
|
19224
19224
|
return false;
|
|
19225
19225
|
}
|
|
19226
|
-
return (isDefined(cell) && (cell === null ||
|
|
19226
|
+
return (isDefined(cell) && ((_c = cell.evaluated.value) === null || _c === void 0 ? void 0 : _c.toString().startsWith(values[0].toString())));
|
|
19227
19227
|
case "EndsWith":
|
|
19228
19228
|
if (!cell && values[0] === "") {
|
|
19229
19229
|
return false;
|
|
19230
19230
|
}
|
|
19231
|
-
return isDefined(cell) && cell.evaluated.value.toString().endsWith(values[0].toString());
|
|
19231
|
+
return isDefined(cell) && ((_d = cell.evaluated.value) === null || _d === void 0 ? void 0 : _d.toString().endsWith(values[0].toString()));
|
|
19232
19232
|
case "Between":
|
|
19233
19233
|
return (isDefined(cell) &&
|
|
19234
19234
|
cell.evaluated.value >= values[0] &&
|
|
@@ -19238,11 +19238,11 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
19238
19238
|
cell.evaluated.value >= values[0] &&
|
|
19239
19239
|
cell.evaluated.value <= values[1]);
|
|
19240
19240
|
case "ContainsText":
|
|
19241
|
-
return (isDefined(cell) && cell.evaluated.value.toString().indexOf(values[0].toString()) > -1);
|
|
19241
|
+
return (isDefined(cell) && ((_e = cell.evaluated.value) === null || _e === void 0 ? void 0 : _e.toString().indexOf(values[0].toString())) > -1);
|
|
19242
19242
|
case "NotContains":
|
|
19243
19243
|
return (!isDefined(cell) ||
|
|
19244
19244
|
!cell.evaluated.value ||
|
|
19245
|
-
cell.evaluated.value.toString().indexOf(values[0].toString()) == -1);
|
|
19245
|
+
((_f = cell.evaluated.value) === null || _f === void 0 ? void 0 : _f.toString().indexOf(values[0].toString())) == -1);
|
|
19246
19246
|
case "GreaterThan":
|
|
19247
19247
|
return isDefined(cell) && cell.evaluated.value > values[0];
|
|
19248
19248
|
case "GreaterThanOrEqual":
|
|
@@ -19351,39 +19351,34 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
19351
19351
|
this.computedIcons[activeSheetId] = {};
|
|
19352
19352
|
const computedStyle = this.computedStyles[activeSheetId];
|
|
19353
19353
|
for (let cf of this.getters.getConditionalFormats(activeSheetId)) {
|
|
19354
|
-
|
|
19355
|
-
|
|
19356
|
-
|
|
19357
|
-
|
|
19358
|
-
|
|
19359
|
-
|
|
19360
|
-
|
|
19361
|
-
|
|
19362
|
-
|
|
19363
|
-
|
|
19364
|
-
|
|
19365
|
-
|
|
19366
|
-
|
|
19367
|
-
|
|
19368
|
-
|
|
19369
|
-
for (let
|
|
19370
|
-
|
|
19371
|
-
|
|
19372
|
-
|
|
19373
|
-
if (
|
|
19374
|
-
|
|
19375
|
-
|
|
19376
|
-
|
|
19377
|
-
computedStyle[col][row] = Object.assign(((_a = computedStyle[col]) === null || _a === void 0 ? void 0 : _a[row]) || {}, cf.rule.style);
|
|
19378
|
-
}
|
|
19354
|
+
switch (cf.rule.type) {
|
|
19355
|
+
case "ColorScaleRule":
|
|
19356
|
+
for (let range of cf.ranges) {
|
|
19357
|
+
this.applyColorScale(range, cf.rule);
|
|
19358
|
+
}
|
|
19359
|
+
break;
|
|
19360
|
+
case "IconSetRule":
|
|
19361
|
+
for (let range of cf.ranges) {
|
|
19362
|
+
this.applyIcon(range, cf.rule);
|
|
19363
|
+
}
|
|
19364
|
+
break;
|
|
19365
|
+
default:
|
|
19366
|
+
for (let ref of cf.ranges) {
|
|
19367
|
+
const zone = toZone(ref);
|
|
19368
|
+
for (let row = zone.top; row <= zone.bottom; row++) {
|
|
19369
|
+
for (let col = zone.left; col <= zone.right; col++) {
|
|
19370
|
+
const pr = this.rulePredicate[cf.rule.type];
|
|
19371
|
+
let cell = this.getters.getCell(activeSheetId, col, row);
|
|
19372
|
+
if (pr && pr(cell, cf.rule)) {
|
|
19373
|
+
if (!computedStyle[col])
|
|
19374
|
+
computedStyle[col] = [];
|
|
19375
|
+
// we must combine all the properties of all the CF rules applied to the given cell
|
|
19376
|
+
computedStyle[col][row] = Object.assign(((_a = computedStyle[col]) === null || _a === void 0 ? void 0 : _a[row]) || {}, cf.rule.style);
|
|
19379
19377
|
}
|
|
19380
19378
|
}
|
|
19381
19379
|
}
|
|
19382
|
-
|
|
19383
|
-
|
|
19384
|
-
}
|
|
19385
|
-
catch (_) {
|
|
19386
|
-
// we don't care about the errors within the evaluation of a rule
|
|
19380
|
+
}
|
|
19381
|
+
break;
|
|
19387
19382
|
}
|
|
19388
19383
|
}
|
|
19389
19384
|
}
|
|
@@ -19402,7 +19397,7 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
19402
19397
|
return this.getters.evaluateFormula(`=PERCENTILE(${range},${Number(threshold.value) / 100})`);
|
|
19403
19398
|
case "formula":
|
|
19404
19399
|
const value = threshold.value && this.getters.evaluateFormula(threshold.value);
|
|
19405
|
-
return
|
|
19400
|
+
return typeof value === "number" ? value : null;
|
|
19406
19401
|
default:
|
|
19407
19402
|
return null;
|
|
19408
19403
|
}
|
|
@@ -31462,6 +31457,6 @@ const helpers = {
|
|
|
31462
31457
|
export { CommandResult, CorePlugin, DATETIME_FORMAT, DataSource, DispatchResult, Model, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, DEBUG as __DEBUG__, __info__, astToFormula, cellTypes, convertAstNodes, coreTypes, functionCache, helpers, invalidateEvaluationCommands, normalize, parse, readonlyAllowedCommands, registries, setTranslationMethod };
|
|
31463
31458
|
|
|
31464
31459
|
|
|
31465
|
-
__info__.version = '15.0.
|
|
31466
|
-
__info__.date = '2024-01-
|
|
31467
|
-
__info__.hash = '
|
|
31460
|
+
__info__.version = '15.0.17';
|
|
31461
|
+
__info__.date = '2024-01-29T13:46:44.293Z';
|
|
31462
|
+
__info__.hash = '6944f99';
|