mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Improve highlighting of previewed formula
Summary: Also improves highlighting of columns when the "Click to insert" tooltip is shown, and improves highlighting of transforming columns. Test Plan: Manual. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D3962
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import {ColumnRec, DocModel} from 'app/client/models/DocModel';
|
||||
import {Style} from 'app/client/models/Styles';
|
||||
import * as modelUtil from 'app/client/models/modelUtil';
|
||||
import {GristObjCode} from 'app/plugin/GristData';
|
||||
|
||||
export interface RuleOwner {
|
||||
// Field or Section can have a list of conditional styling rules. Each style is a combination of a formula and options
|
||||
@@ -9,6 +10,8 @@ export interface RuleOwner {
|
||||
tableId: ko.Computed<string>;
|
||||
// If this field (or column) has a list of conditional styling rules.
|
||||
hasRules: ko.Computed<boolean>;
|
||||
// List of rules.
|
||||
rulesList: ko.Computed<[GristObjCode.List, ...number[]] | null>;
|
||||
// List of columns that are used as rules for conditional styles.
|
||||
rulesCols: ko.Computed<ColumnRec[]>;
|
||||
// List of columns ids that are used as rules for conditional styles.
|
||||
|
||||
@@ -253,6 +253,7 @@ export function createViewFieldRec(this: ViewFieldRec, docModel: DocModel): void
|
||||
});
|
||||
|
||||
this.tableId = ko.pureComputed(() => this.column().table().tableId());
|
||||
this.rulesList = ko.pureComputed(() => this._fieldOrColumn().rules());
|
||||
this.rulesCols = refListRecords(docModel.columns, ko.pureComputed(() => this._fieldOrColumn().rules()));
|
||||
this.rulesColsIds = ko.pureComputed(() => this.rulesCols().map(c => c.colId()));
|
||||
this.rulesStyles = modelUtil.fieldWithDefault(
|
||||
|
||||
Reference in New Issue
Block a user