Fields
Field unions
export type BuilderFieldType =| 'BOOLEAN'| 'TEXT'| 'DATE'| 'NUMBER'| 'STATEMENT'| 'LIST'| 'MULTI_LIST'| 'GROUP';export type IBuilderFieldProps =| IBooleanFieldProps| ITextFieldProps| IDateFieldProps| INumberFieldProps| IStatementFieldProps| IListFieldProps| IMultiListFieldProps| IGroupFieldProps;
Shared field shape
interface IBuilderFieldBase<TType, TValue, TValidation> {field: string;label: string;value?: TValue;type: TType;operators?: BuilderFieldOperator[];usageLimit?: IBuilderFieldUsageLimit;validation?: TValidation;fieldComparison?: IBuilderFieldComparisonConfig;}
Field usage limits
export type BuilderFieldUsageLimitScope = 'global' | 'parent';export interface IBuilderFieldUsageLimit {key?: string;max: number;scope?: BuilderFieldUsageLimitScope;message?: BuilderValidationMessage;}
Field comparison config
export type BuilderFieldComparisonType =| 'string'| 'number'| 'date'| 'boolean';export interface IBuilderFieldComparisonConfig {type?: BuilderFieldComparisonType;comparableFields?: string[];}
Imperative option types
export type BuilderFieldOption = {value: string | number;label: string;};export type BuilderFieldOptionsStatus =| 'idle'| 'loading'| 'success'| 'error';export interface IBuilderFieldOptionState {options: BuilderFieldOption[];status: BuilderFieldOptionsStatus;}export interface IBuilderRuleValueReconciliationConfig {strategy: 'clear-if-missing';}export interface IBuilderRuleDependencyEntry {ruleId: string;dependencies: Record<string, INearestFieldMatch | undefined>;}export type IBuilderFieldDependencyEntry = IBuilderRuleDependencyEntry;export interface INearestFieldMatch {nodeId: string;field: string;valueSource?: QueryRuleValueSource;value: QueryRuleValue | undefined;valueField?: string;operator?: QueryOperator;}export interface IBuilderFieldChange {nodeId: string;field: string;previousValueSource?: QueryRuleValueSource;previousValue: QueryRuleValue | undefined;previousValueField?: string;valueSource?: QueryRuleValueSource;value: QueryRuleValue | undefined;valueField?: string;data: DenormalizedQuery;};
Props
fieldRequired stable identifier used in query data and conversion helpers.labelRequired user-facing caption shown in the field selector.typeRequired field type. This controls which widget and value semantics are used.valueOptional default or backing field value metadata. ForLISTandMULTI_LIST, this is the initial static option set.operatorsOptional operator whitelist. When omitted, the builder falls back to the default operators for the field type.usageLimitOptional structural constraint that limits how many rules may use this field or its shared usage bucket.validationOptional validation config. The shape depends on field type.fieldComparisonOptional semantic config for field-to-field comparisons, including a comparison type override and an allowlist of valid target fields.
usageLimit
maxRequired maximum number of matching rules allowed in the selected scope.scopeOptional. Defaults toglobal. Useparentto limit usage only within the same immediate parent group.keyOptional shared bucket identifier. When omitted, the builder uses the field's ownfieldvalue.messageOptional custom validation message used when persisted or imported data exceeds the allowed limit.
fieldComparison
Semantic field comparison metadata
const fields: IBuilderFieldProps[] = [{field: 'CUSTOMER_COUNTRY',label: 'Customer country',type: 'LIST',operators: ['EQUAL'],value: [{ value: 'CZ', label: 'Czech Republic' },{ value: 'SK', label: 'Slovakia' },],fieldComparison: {type: 'string',comparableFields: ['DELIVERY_COUNTRY_CODE'],},},{field: 'DELIVERY_COUNTRY_CODE',label: 'Delivery country code',type: 'TEXT',operators: ['EQUAL'],},];
typeOptional semantic comparison type. When omitted,TEXT,NUMBER,DATE, andBOOLEANinfer automatically, whileLISTcan infer from uniform option values.comparableFieldsOptional source-owned allowlist that restricts which fields may appear on the right-hand side.- Operator support Field comparisons are only offered for operators that have a direct single-value right-hand side. Range and set-style operators continue to use literal values.
Type notes
BOOLEAN/TEXT/DATE/NUMBERThe standard scalar field families with built-in widget and validation behavior.LIST/MULTI_LISTOption-backed selectors wherevalueholds the initial static option set, field-level runtime options can be shared across all rules of that field, and rule-level runtime options can override them per rule instance.STATEMENTAdvanced field type for free-form statement-like values. Document it carefully in consuming apps because it is less self-explanatory than scalar or list fields.GROUPAdvanced structural field type intended for specialized query models rather than everyday filter fields.
Documentation