mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Conditional formatting rules
Summary: Adding conditional formatting rules feature. Each column can have multiple styling rules which are applied in order when evaluated to a truthy value. - The creator panel has a new section: Cell Style - New user action AddEmptyRule for adding an empty rule - New columns in _grist_Table_columns and fields A new color picker will be introduced in a follow-up diff (as it is also used in choice/choice list/filters). Design document: https://grist.quip.com/FVzfAgoO5xOF/Conditional-Formatting-Implementation-Design Test Plan: new tests Reviewers: georgegevoian Reviewed By: georgegevoian Subscribers: alexmojaki Differential Revision: https://phab.getgrist.com/D3282
This commit is contained in:
@@ -63,6 +63,14 @@ ko.subscribable.fn.onlyNotifyUnequal = function() {
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Notifies only about distinct defined values. If the first value is undefined it will still be
|
||||
* returned.
|
||||
*/
|
||||
ko.subscribable.fn.previousOnUndefined = function() {
|
||||
this.equalityComparer = function(a, b) { return a === b || b === undefined; };
|
||||
return this;
|
||||
};
|
||||
|
||||
let _handlerFunc = (err) => {};
|
||||
let _origKoComputed = ko.computed;
|
||||
@@ -73,8 +81,8 @@ let _origKoComputed = ko.computed;
|
||||
* evaluates successfully to its previous value (or _handlerFunc may rethrow the error).
|
||||
*/
|
||||
function _wrapComputedRead(readFunc) {
|
||||
let lastValue;
|
||||
return function() {
|
||||
let lastValue;
|
||||
try {
|
||||
return (lastValue = readFunc.call(this));
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user