File
addRule
|
addRule: (parent: RuleSet) => void
|
Type : (parent: RuleSet) => void
|
addRuleSet
|
addRuleSet: (parent: RuleSet) => void
|
Type : (parent: RuleSet) => void
|
allowEmptyRulesets
|
allowEmptyRulesets: boolean
|
Type : boolean
|
calculateFieldChangeValue
|
calculateFieldChangeValue: (currentField: Field, nextField: Field, currentValue: any) => any
|
Type : (currentField: Field, nextField: Field, currentValue: any) => any
|
coerceValueForOperator
|
coerceValueForOperator: (operator: string, value: any, rule: Rule) => any
|
Type : (operator: string, value: any, rule: Rule) => any
|
entities
|
entities: EntityMap
|
Type : EntityMap
|
fields
|
fields: FieldMap
|
Type : FieldMap
|
getInputType
|
getInputType: (field: string, operator: string) => string
|
Type : (field: string, operator: string) => string
|
getOperators
|
getOperators: (fieldName: string, field: Field) => string[]
|
Type : (fieldName: string, field: Field) => string[]
|
getOptions
|
getOptions: (field: string) => Option[]
|
Type : (field: string) => Option[]
|
removeRule
|
removeRule: (rule: Rule, parent: RuleSet) => void
|
Type : (rule: Rule, parent: RuleSet) => void
|
removeRuleSet
|
removeRuleSet: (ruleset: RuleSet, parent: RuleSet) => void
|
Type : (ruleset: RuleSet, parent: RuleSet) => void
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
import { ValidationErrors } from '@angular/forms';
export interface RuleSet {
condition: string;
rules: Array<RuleSet | Rule>;
collapsed?: boolean;
isChild?: boolean;
}
export interface Rule {
field: string;
value?: any;
operator?: string;
entity?: string;
}
export interface Option {
name: string;
value: any;
}
export interface FieldMap {
[key: string]: Field;
}
export interface Field {
name: string;
value?: string;
type: string;
nullable?: boolean;
options?: Option[];
operators?: string[];
defaultValue?: any;
defaultOperator?: any;
entity?: string;
validator?: (rule: Rule, parent: RuleSet) => any | null;
}
export interface LocalRuleMeta {
ruleset: boolean;
invalid: boolean;
}
export interface EntityMap {
[key: string]: Entity;
}
export interface Entity {
name: string;
value?: string;
defaultField?: any;
}
export interface QueryBuilderClassNames {
arrowIconButton?: string;
arrowIcon?: string;
removeIcon?: string;
addIcon?: string;
button?: string;
buttonGroup?: string;
removeButton?: string;
removeButtonSize?: string;
switchRow?: string;
switchGroup?: string;
switchLabel?: string;
switchRadio?: string;
switchControl?: string;
rightAlign?: string;
transition?: string;
collapsed?: string;
treeContainer?: string;
tree?: string;
row?: string;
connector?: string;
rule?: string;
ruleSet?: string;
invalidRuleSet?: string;
emptyWarning?: string;
fieldControl?: string;
fieldControlSize?: string;
entityControl?: string;
entityControlSize?: string;
operatorControl?: string;
operatorControlSize?: string;
inputControl?: string;
inputControlSize?: string;
}
export interface QueryBuilderConfig {
fields: FieldMap;
entities?: EntityMap;
allowEmptyRulesets?: boolean;
getOperators?: (fieldName: string, field: Field) => string[];
getInputType?: (field: string, operator: string) => string;
getOptions?: (field: string) => Option[];
addRuleSet?: (parent: RuleSet) => void;
addRule?: (parent: RuleSet) => void;
removeRuleSet?: (ruleset: RuleSet, parent: RuleSet) => void;
removeRule?: (rule: Rule, parent: RuleSet) => void;
coerceValueForOperator?: (operator: string, value: any, rule: Rule) => any;
calculateFieldChangeValue?: (currentField: Field,
nextField: Field,
currentValue: any) => any;
}
export interface SwitchGroupContext {
onChange: (conditionValue: string) => void;
getDisabledState: () => boolean;
$implicit: RuleSet;
}
export interface EmptyWarningContext {
getDisabledState: () => boolean;
message: string;
$implicit: RuleSet;
}
export interface ArrowIconContext {
getDisabledState: () => boolean;
$implicit: RuleSet;
}
export interface EntityContext {
onChange: (entityValue: string, rule: Rule) => void;
getDisabledState: () => boolean;
entities: Entity[];
$implicit: Rule;
}
export interface FieldContext {
onChange: (fieldValue: string, rule: Rule) => void;
getFields: (entityName: string) => void;
getDisabledState: () => boolean;
fields: Field[];
$implicit: Rule;
}
export interface OperatorContext {
onChange: () => void;
getDisabledState: () => boolean;
operators: string[];
$implicit: Rule;
}
export interface InputContext {
onChange: () => void;
getDisabledState: () => boolean;
options: Option[];
field: Field;
$implicit: Rule;
}
export interface ButtonGroupContext {
addRule: () => void;
addRuleSet: () => void;
removeRuleSet: () => void;
getDisabledState: () => boolean;
$implicit: RuleSet;
}
export interface RemoveButtonContext {
removeRule: (rule: Rule) => void;
getDisabledState: () => boolean;
$implicit: Rule;
}