import type { RuleGroupTypeAny, RuleOrGroupArray } from './ruleGroupsIC'; import type { Field, NameLabelPair, OptionGroup, ValueEditorType, ValueSource } from './basic'; import type { RuleGroupType, RuleType } from './ruleGroups'; import type { ValidationResult } from './validation'; export interface CommonSubComponentProps { /** * CSS classNames to be applied */ className?: string; /** * Path to this sub-component's Rule or RuleGroup */ path: number[]; /** * The level of the current group */ level: number; /** * The title for this control */ title?: string; /** * Disables the control */ disabled?: boolean; /** * Container for custom props that are passed to all components */ context?: any; /** * Validation result of the parent component */ validation?: boolean | ValidationResult; /** * Test ID for this component */ testID?: string; debugMode?: boolean; onLog?(...obj: any): void; } export interface SelectorEditorProps extends CommonSubComponentProps { value?: string; handleOnChange(value: any): void; } export interface BaseSelectorProps extends SelectorEditorProps { options: NameLabelPair[] | OptionGroup[]; debugMode?: boolean; onLog?(...obj: any): void; } export interface ValueSelectorProps extends BaseSelectorProps { multiple?: boolean; } export interface NotToggleProps extends CommonSubComponentProps { checked?: boolean; handleOnChange(checked: boolean): void; label?: string; } export interface CombinatorSelectorProps extends BaseSelectorProps { rules?: RuleOrGroupArray; } export interface FieldSelectorProps extends BaseSelectorProps { options: Field[] | OptionGroup[]; operator?: string; } export interface OperatorSelectorProps extends BaseSelectorProps { field: string; fieldData: Field; } interface ValueSourceOption extends NameLabelPair { name: ValueSource; } export interface ValueSourceSelectorProps extends BaseSelectorProps { field: string; fieldData: Field; options: ValueSourceOption[] | OptionGroup[]; } export type VersatileSelectorProps = ValueSelectorProps & Partial & Partial & Partial; export interface ValueEditorProps extends SelectorEditorProps { debugMode?: boolean; field: string; fieldData: Field; fieldType: string; inputType?: string | null; operator: string; type?: ValueEditorType; userTimezone?: string; value?: any; values?: any[]; valueSource: ValueSource; onLog?(...obj: any): void; handleTypeChange(value: any): void; } export interface ValSelectProps extends SelectorEditorProps { field: string; value?: any; valueSource: ValueSource; fieldData: Field; type?: string; values?: any[]; operator: string; debugMode?: boolean; onLog?(...obj: any): void; } export interface DragHandleProps extends CommonSubComponentProps { label?: string; } export interface Classnames { /** * Root `
` element */ queryBuilder: string; /** * `
` containing the RuleGroup */ ruleGroup: string; /** * `
` containing the RuleGroup header controls */ header: string; /** * `
` containing the RuleGroup child rules/groups */ body: string; /** * `` control for fields */ fields: string; /** * `` for the field value */ value: string; /** * `