Data
Query tree types
export type QueryGroupValue = 'AND' | 'OR';export type QueryGroupType = 'with-modifiers' | 'without-modifiers';export type GroupReadOnlyTarget = 'negation' | 'combinator';export type RuleReadOnlyTarget = 'field' | 'operator' | 'value';export type QueryRuleValueSource = 'value' | 'field';export interface IGroupReadOnlyConfig {enabled: boolean;targets?: GroupReadOnlyTarget[];inheritToChildren?: boolean;}export interface IRuleReadOnlyConfig {enabled: boolean;targets?: RuleReadOnlyTarget[];}export type QueryRuleValue =| string| number| string[]| number[]| boolean;export interface ILiteralRuleNode {id?: string;parent?: string;field: string;valueSource?: 'value';value?: QueryRuleValue;valueField?: undefined;operator?: QueryOperator;operators?: QueryOperator[];readOnly?: boolean | IRuleReadOnlyConfig;}export interface IFieldReferenceRuleNode {id?: string;parent?: string;field: string;valueSource: 'field';value?: undefined;valueField: string;operator?: QueryOperator;operators?: QueryOperator[];readOnly?: boolean | IRuleReadOnlyConfig;}export type IDenormalizedRuleNode = ILiteralRuleNode | IFieldReferenceRuleNode;export interface IDenormalizedGroupNodeBase {id?: string;parent?: string;type: 'GROUP';children: DenormalizedNode[];readOnly?: boolean | IGroupReadOnlyConfig;}export type DenormalizedQuery = DenormalizedNode[];
Field-reference rule data
const rule: IDenormalizedRuleNode = {field: 'ORDER_TOTAL',operator: 'LARGER_EQUAL',valueSource: 'field',valueField: 'ORDER_APPROVAL_LIMIT',};
Rule props
fieldRequired field identifier matching one of the configured fields.operatorOptional operator for the rule. Some field and operator combinations imply different value shapes.valueSourceOptional discriminant. Omit it or set'value'for literal comparisons, or set'field'for right-hand-side field references.valueOptional literal rule value used whenvalueSourceis omitted or set to'value'. Supported scalar and array forms are defined byQueryRuleValue.valueFieldRequired whenvalueSourceis'field'. Stores the compared field identifier instead of a literal value.operatorsOptional rule-level operator override list.readOnlyOptional per-rule lock definition. Supported shapes arefalseor omitted,true, or{ enabled: boolean; targets?: ('field' | 'operator' | 'value')[] }.readOnly.targetsPart of thereadOnlyobject config. Rule targets are'field','operator', and'value'. Targeted controls stay visible but become non-editable.readOnly.enabledPart of thereadOnlyobject config. Whentrue, the listed targets are protected. WhenreadOnly.targetsis omitted, the whole rule is read-only.- Delete behavior A rule with any effective read-only target is also non-deletable, and cloned rules preserve the same read-only configuration.
- GUI cycle When
lockableis enabled, rules cycle between unlocked and locked. Object-basedreadOnly.targetsare preserved when the user unlocks and re-locks the same rule. idandparentOptional in denormalized input. The builder can ingest data without them.
Group props
typeAlways'GROUP'.childrenRequired nested nodes.valuePresent only for groups with modifiers and must be'AND'or'OR'.isNegatedPresent only for groups with modifiers.readOnlyCan befalseor omitted,true, or{ enabled: boolean; targets?: ('negation' | 'combinator')[]; inheritToChildren?: boolean }.readOnly: trueLocks only the group's own controls by default. Descendant rules and groups remain editable unless inheritance is enabled.readOnly.targetsPart of thereadOnlyobject config. Group targets are'negation'and'combinator'. Targeted controls stay visible but become non-editable.readOnly.enabledPart of thereadOnlyobject config. Whentrue, the listed targets are protected. WhenreadOnly.targetsis omitted, the whole group is read-only.readOnly.inheritToChildrenPart of thereadOnlyobject config. Applies the group lock to descendant groups and their children when the group is enabled.- Delete behavior A group cannot be deleted when it has effective read-only targets. By default, it also cannot be deleted when that would remove protected descendants indirectly. This subtree behavior can be disabled with
Builder.readOnlyProtectsDelete=. - GUI cycle When
lockableis enabled, groups cycle through unlocked, locked group only, and locked group with descendants while preserving object-basedreadOnly.targets. - Inheritance behavior Descendants cannot override an inherited lock from an ancestor.
Documentation