ngx-angular-query-builder 0.0.4 → 13.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/{esm2015/lib/ngx-angular-query-builder.module.js → esm2020/lib/ngx-angular-query-builder.module.mjs} +4 -4
  2. package/{esm2015/lib/query-builder/query-arrow-icon.directive.js → esm2020/lib/query-builder/query-arrow-icon.directive.mjs} +3 -3
  3. package/esm2020/lib/query-builder/query-builder.component.mjs +748 -0
  4. package/{esm2015/lib/query-builder/query-builder.interfaces.js → esm2020/lib/query-builder/query-builder.interfaces.mjs} +1 -1
  5. package/{esm2015/lib/query-builder/query-button-group.directive.js → esm2020/lib/query-builder/query-button-group.directive.mjs} +3 -3
  6. package/{esm2015/lib/query-builder/query-empty-warning.directive.js → esm2020/lib/query-builder/query-empty-warning.directive.mjs} +3 -3
  7. package/{esm2015/lib/query-builder/query-entity.directive.js → esm2020/lib/query-builder/query-entity.directive.mjs} +3 -3
  8. package/{esm2015/lib/query-builder/query-field.directive.js → esm2020/lib/query-builder/query-field.directive.mjs} +3 -3
  9. package/{esm2015/lib/query-builder/query-input.directive.js → esm2020/lib/query-builder/query-input.directive.mjs} +3 -3
  10. package/{esm2015/lib/query-builder/query-operator.directive.js → esm2020/lib/query-builder/query-operator.directive.mjs} +3 -3
  11. package/{esm2015/lib/query-builder/query-remove-button.directive.js → esm2020/lib/query-builder/query-remove-button.directive.mjs} +3 -3
  12. package/{esm2015/lib/query-builder/query-switch-group.directive.js → esm2020/lib/query-builder/query-switch-group.directive.mjs} +3 -3
  13. package/{esm2015/ngx-angular-query-builder.js → esm2020/ngx-angular-query-builder.mjs} +0 -0
  14. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  15. package/fesm2015/{ngx-angular-query-builder.js → ngx-angular-query-builder.mjs} +37 -43
  16. package/fesm2015/ngx-angular-query-builder.mjs.map +1 -0
  17. package/fesm2020/ngx-angular-query-builder.mjs +932 -0
  18. package/fesm2020/ngx-angular-query-builder.mjs.map +1 -0
  19. package/lib/query-builder/query-builder.component.d.ts +1 -1
  20. package/lib/query-builder/query-builder.interfaces.d.ts +1 -1
  21. package/package.json +21 -8
  22. package/bundles/ngx-angular-query-builder.umd.js +0 -1012
  23. package/bundles/ngx-angular-query-builder.umd.js.map +0 -1
  24. package/esm2015/lib/query-builder/query-builder.component.js +0 -755
  25. package/fesm2015/ngx-angular-query-builder.js.map +0 -1
@@ -0,0 +1,932 @@
1
+ import * as i2 from '@angular/forms';
2
+ import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormsModule } from '@angular/forms';
3
+ import * as i0 from '@angular/core';
4
+ import { Directive, Input, forwardRef, Component, HostBinding, ViewChild, ContentChild, ContentChildren, NgModule } from '@angular/core';
5
+ import * as i1 from '@angular/common';
6
+ import { CommonModule } from '@angular/common';
7
+
8
+ class QueryOperatorDirective {
9
+ constructor(template) {
10
+ this.template = template;
11
+ }
12
+ }
13
+ QueryOperatorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: QueryOperatorDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
14
+ QueryOperatorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: QueryOperatorDirective, selector: "[queryOperator]", ngImport: i0 });
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: QueryOperatorDirective, decorators: [{
16
+ type: Directive,
17
+ args: [{ selector: '[queryOperator]' }]
18
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
19
+
20
+ class QueryFieldDirective {
21
+ constructor(template) {
22
+ this.template = template;
23
+ }
24
+ }
25
+ QueryFieldDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: QueryFieldDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
26
+ QueryFieldDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: QueryFieldDirective, selector: "[queryField]", ngImport: i0 });
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: QueryFieldDirective, decorators: [{
28
+ type: Directive,
29
+ args: [{ selector: '[queryField]' }]
30
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
31
+
32
+ class QueryEntityDirective {
33
+ constructor(template) {
34
+ this.template = template;
35
+ }
36
+ }
37
+ QueryEntityDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: QueryEntityDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
38
+ QueryEntityDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: QueryEntityDirective, selector: "[queryEntity]", ngImport: i0 });
39
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: QueryEntityDirective, decorators: [{
40
+ type: Directive,
41
+ args: [{ selector: '[queryEntity]' }]
42
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
43
+
44
+ class QuerySwitchGroupDirective {
45
+ constructor(template) {
46
+ this.template = template;
47
+ }
48
+ }
49
+ QuerySwitchGroupDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: QuerySwitchGroupDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
50
+ QuerySwitchGroupDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: QuerySwitchGroupDirective, selector: "[querySwitchGroup]", ngImport: i0 });
51
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: QuerySwitchGroupDirective, decorators: [{
52
+ type: Directive,
53
+ args: [{ selector: '[querySwitchGroup]' }]
54
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
55
+
56
+ class QueryButtonGroupDirective {
57
+ constructor(template) {
58
+ this.template = template;
59
+ }
60
+ }
61
+ QueryButtonGroupDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: QueryButtonGroupDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
62
+ QueryButtonGroupDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: QueryButtonGroupDirective, selector: "[queryButtonGroup]", ngImport: i0 });
63
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: QueryButtonGroupDirective, decorators: [{
64
+ type: Directive,
65
+ args: [{ selector: '[queryButtonGroup]' }]
66
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
67
+
68
+ class QueryInputDirective {
69
+ constructor(template) {
70
+ this.template = template;
71
+ }
72
+ /** Unique name for query input type. */
73
+ get queryInputType() { return this._type; }
74
+ set queryInputType(value) {
75
+ // If the directive is set without a type (updated programatically), then this setter will
76
+ // trigger with an empty string and should not overwrite the programatically set value.
77
+ if (!value) {
78
+ return;
79
+ }
80
+ this._type = value;
81
+ }
82
+ }
83
+ QueryInputDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: QueryInputDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
84
+ QueryInputDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: QueryInputDirective, selector: "[queryInput]", inputs: { queryInputType: "queryInputType" }, ngImport: i0 });
85
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: QueryInputDirective, decorators: [{
86
+ type: Directive,
87
+ args: [{ selector: '[queryInput]' }]
88
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { queryInputType: [{
89
+ type: Input
90
+ }] } });
91
+
92
+ class QueryRemoveButtonDirective {
93
+ constructor(template) {
94
+ this.template = template;
95
+ }
96
+ }
97
+ QueryRemoveButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: QueryRemoveButtonDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
98
+ QueryRemoveButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: QueryRemoveButtonDirective, selector: "[queryRemoveButton]", ngImport: i0 });
99
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: QueryRemoveButtonDirective, decorators: [{
100
+ type: Directive,
101
+ args: [{ selector: '[queryRemoveButton]' }]
102
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
103
+
104
+ class QueryEmptyWarningDirective {
105
+ constructor(template) {
106
+ this.template = template;
107
+ }
108
+ }
109
+ QueryEmptyWarningDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: QueryEmptyWarningDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
110
+ QueryEmptyWarningDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: QueryEmptyWarningDirective, selector: "[queryEmptyWarning]", ngImport: i0 });
111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: QueryEmptyWarningDirective, decorators: [{
112
+ type: Directive,
113
+ args: [{ selector: '[queryEmptyWarning]' }]
114
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
115
+
116
+ class QueryArrowIconDirective {
117
+ constructor(template) {
118
+ this.template = template;
119
+ }
120
+ }
121
+ QueryArrowIconDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: QueryArrowIconDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
122
+ QueryArrowIconDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: QueryArrowIconDirective, selector: "[queryArrowIcon]", ngImport: i0 });
123
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: QueryArrowIconDirective, decorators: [{
124
+ type: Directive,
125
+ args: [{ selector: '[queryArrowIcon]' }]
126
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
127
+
128
+ const CONTROL_VALUE_ACCESSOR = {
129
+ provide: NG_VALUE_ACCESSOR,
130
+ useExisting: forwardRef(() => QueryBuilderComponent),
131
+ multi: true
132
+ };
133
+ const VALIDATOR = {
134
+ provide: NG_VALIDATORS,
135
+ useExisting: forwardRef(() => QueryBuilderComponent),
136
+ multi: true
137
+ };
138
+ class QueryBuilderComponent {
139
+ constructor(changeDetectorRef) {
140
+ this.changeDetectorRef = changeDetectorRef;
141
+ this.defaultClassNames = {
142
+ arrowIconButton: 'q-arrow-icon-button',
143
+ arrowIcon: 'q-icon q-arrow-icon',
144
+ removeIcon: 'q-icon q-remove-icon',
145
+ addIcon: 'q-icon q-add-icon',
146
+ button: 'q-button',
147
+ buttonGroup: 'q-button-group',
148
+ removeButton: 'q-remove-button',
149
+ switchGroup: 'q-switch-group',
150
+ switchLabel: 'q-switch-label',
151
+ switchRadio: 'q-switch-radio',
152
+ rightAlign: 'q-right-align',
153
+ transition: 'q-transition',
154
+ collapsed: 'q-collapsed',
155
+ treeContainer: 'q-tree-container',
156
+ tree: 'q-tree',
157
+ row: 'q-row',
158
+ connector: 'q-connector',
159
+ rule: 'q-rule',
160
+ ruleSet: 'q-ruleset',
161
+ invalidRuleSet: 'q-invalid-ruleset',
162
+ emptyWarning: 'q-empty-warning',
163
+ fieldControl: 'q-field-control',
164
+ fieldControlSize: 'q-control-size',
165
+ entityControl: 'q-entity-control',
166
+ entityControlSize: 'q-control-size',
167
+ operatorControl: 'q-operator-control',
168
+ operatorControlSize: 'q-control-size',
169
+ inputControl: 'q-input-control',
170
+ inputControlSize: 'q-control-size'
171
+ };
172
+ this.defaultOperatorMap = {
173
+ string: ['=', '!=', 'contains', 'like'],
174
+ number: ['=', '!=', '>', '>=', '<', '<='],
175
+ time: ['=', '!=', '>', '>=', '<', '<='],
176
+ date: ['=', '!=', '>', '>=', '<', '<='],
177
+ category: ['=', '!=', 'in', 'not in'],
178
+ boolean: ['=']
179
+ };
180
+ this.disabled = false;
181
+ this.data = { condition: 'and', rules: [] };
182
+ this.allowRuleset = true;
183
+ this.allowCollapse = false;
184
+ this.emptyMessage = 'A ruleset cannot be empty. Please add a rule or remove it all together.';
185
+ this.classNames = {};
186
+ this.operatorMap = {};
187
+ this.config = { fields: {} };
188
+ this.persistValueOnFieldChange = false;
189
+ this.defaultTemplateTypes = [
190
+ 'string', 'number', 'time', 'date', 'category', 'boolean', 'multiselect'
191
+ ];
192
+ this.defaultPersistValueTypes = [
193
+ 'string', 'number', 'time', 'date', 'boolean'
194
+ ];
195
+ this.defaultEmptyList = [];
196
+ this.operatorsCache = {};
197
+ this.inputContextCache = new Map();
198
+ this.operatorContextCache = new Map();
199
+ this.fieldContextCache = new Map();
200
+ this.entityContextCache = new Map();
201
+ this.removeButtonContextCache = new Map();
202
+ // ----------END----------
203
+ this.getDisabledState = () => {
204
+ return this.disabled;
205
+ };
206
+ this.fields = [];
207
+ this.filterFields = [];
208
+ this.entities = [];
209
+ }
210
+ get condintion() {
211
+ return this.data?.condition;
212
+ }
213
+ // ----------OnInit Implementation----------
214
+ // ----------OnChanges Implementation----------
215
+ ngOnChanges(changes) {
216
+ const config = this.config;
217
+ const type = typeof config;
218
+ if (type === 'object') {
219
+ this.fields = Object.keys(config.fields).map((value) => {
220
+ const field = config.fields[value];
221
+ field.value = field.value || value;
222
+ return field;
223
+ });
224
+ if (config.entities) {
225
+ this.entities = Object.keys(config.entities).map((value) => {
226
+ const entity = config.entities ? config.entities[value] : [];
227
+ entity.value = entity.value || value;
228
+ return entity;
229
+ });
230
+ }
231
+ else {
232
+ this.entities = [];
233
+ }
234
+ this.operatorsCache = {};
235
+ }
236
+ else {
237
+ throw new Error(`Expected 'config' must be a valid object, got ${type} instead.`);
238
+ }
239
+ }
240
+ // ----------Validator Implementation----------
241
+ validate(control) {
242
+ const errors = {};
243
+ const ruleErrorStore = [];
244
+ let hasErrors = false;
245
+ if (!this.config.allowEmptyRulesets && this.checkEmptyRuleInRuleset(this.data)) {
246
+ errors.empty = 'Empty rulesets are not allowed.';
247
+ hasErrors = true;
248
+ }
249
+ this.validateRulesInRuleset(this.data, ruleErrorStore);
250
+ if (ruleErrorStore.length) {
251
+ errors.rules = ruleErrorStore;
252
+ hasErrors = true;
253
+ }
254
+ return hasErrors ? errors : null;
255
+ }
256
+ // ----------ControlValueAccessor Implementation----------
257
+ get value() {
258
+ return this.data;
259
+ }
260
+ set value(value) {
261
+ // When component is initialized without a formControl, null is passed to value
262
+ this.data = value || { condition: 'and', rules: [] };
263
+ this.handleDataChange();
264
+ }
265
+ writeValue(obj) {
266
+ this.value = obj;
267
+ }
268
+ registerOnChange(fn) {
269
+ this.onChangeCallback = () => fn(this.data);
270
+ }
271
+ registerOnTouched(fn) {
272
+ this.onTouchedCallback = () => fn(this.data);
273
+ }
274
+ setDisabledState(isDisabled) {
275
+ this.disabled = isDisabled;
276
+ this.changeDetectorRef.detectChanges();
277
+ }
278
+ findTemplateForRule(rule) {
279
+ const type = this.getInputType(rule.field, rule.operator);
280
+ if (type) {
281
+ const queryInput = this.findQueryInput(type);
282
+ if (queryInput) {
283
+ return queryInput.template;
284
+ }
285
+ else {
286
+ if (this.defaultTemplateTypes.indexOf(type) === -1) {
287
+ console.warn(`Could not find template for field with type: ${type}`);
288
+ }
289
+ return null;
290
+ }
291
+ }
292
+ }
293
+ findQueryInput(type) {
294
+ const templates = this.parentInputTemplates || this.inputTemplates;
295
+ return templates.find((item) => item.queryInputType === type);
296
+ }
297
+ getOperators(field) {
298
+ if (this.operatorsCache[field]) {
299
+ return this.operatorsCache[field];
300
+ }
301
+ let operators = this.defaultEmptyList;
302
+ const fieldObject = this.config.fields[field];
303
+ if (this.config.getOperators) {
304
+ return this.config.getOperators(field, fieldObject);
305
+ }
306
+ const type = fieldObject.type;
307
+ if (fieldObject && fieldObject.operators) {
308
+ operators = fieldObject.operators;
309
+ }
310
+ else if (type) {
311
+ operators = (this.operatorMap && this.operatorMap[type]) || this.defaultOperatorMap[type] || this.defaultEmptyList;
312
+ if (operators.length === 0) {
313
+ console.warn(`No operators found for field '${field}' with type ${fieldObject.type}. ` +
314
+ `Please define an 'operators' property on the field or use the 'operatorMap' binding to fix this.`);
315
+ }
316
+ if (fieldObject.nullable) {
317
+ operators = operators.concat(['is null', 'is not null']);
318
+ }
319
+ }
320
+ else {
321
+ console.warn(`No 'type' property found on field: '${field}'`);
322
+ }
323
+ // Cache reference to array object, so it won't be computed next time and trigger a rerender.
324
+ this.operatorsCache[field] = operators;
325
+ return operators;
326
+ }
327
+ getFields(entity) {
328
+ if (this.entities.length && entity) {
329
+ return this.fields.filter((field) => {
330
+ return field && field.entity === entity;
331
+ });
332
+ }
333
+ else {
334
+ return this.fields;
335
+ }
336
+ }
337
+ getInputType(field, operator) {
338
+ if (this.config.getInputType) {
339
+ return this.config.getInputType(field, operator);
340
+ }
341
+ if (!this.config.fields[field]) {
342
+ throw new Error(`No configuration for field '${field}' could be found! Please add it to config.fields.`);
343
+ }
344
+ const type = this.config.fields[field].type;
345
+ switch (operator) {
346
+ case 'is null':
347
+ case 'is not null':
348
+ return null; // No displayed component
349
+ case 'in':
350
+ case 'not in':
351
+ return type === 'category' || type === 'boolean' ? 'multiselect' : type;
352
+ default:
353
+ return type;
354
+ }
355
+ }
356
+ getOptions(field) {
357
+ if (this.config.getOptions) {
358
+ return this.config.getOptions(field);
359
+ }
360
+ return this.config.fields[field].options || this.defaultEmptyList;
361
+ }
362
+ getClassNames(...args) {
363
+ const clsLookup = this.classNames ? this.classNames : this.defaultClassNames;
364
+ const defaultClassNames = this.defaultClassNames;
365
+ const classNames = args.map((id) => clsLookup[id] || defaultClassNames[id]).filter((c) => !!c);
366
+ return classNames.length ? classNames.join(' ') : [];
367
+ }
368
+ getDefaultField(entity) {
369
+ if (!entity) {
370
+ return null;
371
+ }
372
+ else if (entity.defaultField !== undefined) {
373
+ return this.getDefaultValue(entity.defaultField);
374
+ }
375
+ else {
376
+ const entityFields = this.fields.filter((field) => {
377
+ return field && field.entity === entity.value;
378
+ });
379
+ if (entityFields && entityFields.length) {
380
+ return entityFields[0];
381
+ }
382
+ else {
383
+ console.warn(`No fields found for entity '${entity.name}'. ` +
384
+ `A 'defaultOperator' is also not specified on the field config. Operator value will default to null.`);
385
+ return null;
386
+ }
387
+ }
388
+ }
389
+ getDefaultOperator(field) {
390
+ if (field && field.defaultOperator !== undefined) {
391
+ return this.getDefaultValue(field.defaultOperator);
392
+ }
393
+ else {
394
+ const operators = this.getOperators(field.value);
395
+ if (operators && operators.length) {
396
+ return operators[0];
397
+ }
398
+ else {
399
+ console.warn(`No operators found for field '${field.value}'. ` +
400
+ `A 'defaultOperator' is also not specified on the field config. Operator value will default to null.`);
401
+ return null;
402
+ }
403
+ }
404
+ }
405
+ addRule(parent) {
406
+ if (this.disabled) {
407
+ return;
408
+ }
409
+ parent = parent || this.data;
410
+ if (this.config.addRule) {
411
+ this.config.addRule(parent);
412
+ }
413
+ else {
414
+ const field = this.fields[0];
415
+ parent.rules = parent.rules.concat([{
416
+ field: field.value,
417
+ operator: this.getDefaultOperator(field),
418
+ value: this.getDefaultValue(field.defaultValue),
419
+ entity: field.entity
420
+ }]);
421
+ }
422
+ this.handleTouched();
423
+ this.handleDataChange();
424
+ }
425
+ removeRule(rule, parent) {
426
+ if (this.disabled) {
427
+ return;
428
+ }
429
+ parent = parent || this.data;
430
+ if (this.config.removeRule) {
431
+ this.config.removeRule(rule, parent);
432
+ }
433
+ else {
434
+ parent.rules = parent.rules.filter((r) => r !== rule);
435
+ }
436
+ this.inputContextCache.delete(rule);
437
+ this.operatorContextCache.delete(rule);
438
+ this.fieldContextCache.delete(rule);
439
+ this.entityContextCache.delete(rule);
440
+ this.removeButtonContextCache.delete(rule);
441
+ this.handleTouched();
442
+ this.handleDataChange();
443
+ }
444
+ addRuleSet(parent) {
445
+ if (this.disabled) {
446
+ return;
447
+ }
448
+ parent = parent || this.data;
449
+ if (this.config.addRuleSet) {
450
+ this.config.addRuleSet(parent);
451
+ }
452
+ else {
453
+ parent.rules = parent.rules.concat([{ condition: 'and', rules: [] }]);
454
+ }
455
+ this.handleTouched();
456
+ this.handleDataChange();
457
+ }
458
+ removeRuleSet(ruleset, parent) {
459
+ if (this.disabled) {
460
+ return;
461
+ }
462
+ ruleset = ruleset || this.data;
463
+ parent = parent || this.parentValue;
464
+ if (this.config.removeRuleSet) {
465
+ this.config.removeRuleSet(ruleset, parent);
466
+ }
467
+ else if (parent) {
468
+ parent.rules = parent.rules.filter((r) => r !== ruleset);
469
+ }
470
+ this.handleTouched();
471
+ this.handleDataChange();
472
+ }
473
+ transitionEnd(e) {
474
+ this.treeContainer.nativeElement.style.maxHeight = null;
475
+ }
476
+ toggleCollapse() {
477
+ this.computedTreeContainerHeight();
478
+ setTimeout(() => {
479
+ this.data.collapsed = !this.data.collapsed;
480
+ }, 100);
481
+ }
482
+ computedTreeContainerHeight() {
483
+ const nativeElement = this.treeContainer.nativeElement;
484
+ if (nativeElement && nativeElement.firstElementChild) {
485
+ nativeElement.style.maxHeight = (nativeElement.firstElementChild.clientHeight + 8) + 'px';
486
+ }
487
+ }
488
+ changeCondition(value) {
489
+ if (this.disabled) {
490
+ return;
491
+ }
492
+ this.data.condition = value;
493
+ this.handleTouched();
494
+ this.handleDataChange();
495
+ }
496
+ changeOperator(rule) {
497
+ if (this.disabled) {
498
+ return;
499
+ }
500
+ if (this.config.coerceValueForOperator) {
501
+ rule.value = this.config.coerceValueForOperator(rule.operator, rule.value, rule);
502
+ }
503
+ else {
504
+ rule.value = this.coerceValueForOperator(rule.operator, rule.value, rule);
505
+ }
506
+ this.handleTouched();
507
+ this.handleDataChange();
508
+ }
509
+ coerceValueForOperator(operator, value, rule) {
510
+ const inputType = this.getInputType(rule.field, operator);
511
+ if (inputType === 'multiselect' && !Array.isArray(value)) {
512
+ return [value];
513
+ }
514
+ return value;
515
+ }
516
+ changeInput() {
517
+ if (this.disabled) {
518
+ return;
519
+ }
520
+ this.handleTouched();
521
+ this.handleDataChange();
522
+ }
523
+ changeField(fieldValue, rule) {
524
+ if (this.disabled) {
525
+ return;
526
+ }
527
+ const inputContext = this.inputContextCache.get(rule);
528
+ const currentField = inputContext && inputContext.field;
529
+ const nextField = this.config.fields[fieldValue];
530
+ const nextValue = this.calculateFieldChangeValue(currentField, nextField, rule.value);
531
+ if (nextValue !== undefined) {
532
+ rule.value = nextValue;
533
+ }
534
+ else {
535
+ delete rule.value;
536
+ }
537
+ rule.operator = this.getDefaultOperator(nextField);
538
+ // Create new context objects so templates will automatically update
539
+ this.inputContextCache.delete(rule);
540
+ this.operatorContextCache.delete(rule);
541
+ this.fieldContextCache.delete(rule);
542
+ this.entityContextCache.delete(rule);
543
+ this.getInputContext(rule);
544
+ this.getFieldContext(rule);
545
+ this.getOperatorContext(rule);
546
+ this.getEntityContext(rule);
547
+ this.handleTouched();
548
+ this.handleDataChange();
549
+ }
550
+ changeEntity(entityValue, rule, index, data) {
551
+ if (this.disabled) {
552
+ return;
553
+ }
554
+ let i = index;
555
+ let rs = data;
556
+ const entity = this.entities.find((e) => e.value === entityValue);
557
+ const defaultField = this.getDefaultField(entity);
558
+ if (!rs) {
559
+ rs = this.data;
560
+ i = rs.rules.findIndex((x) => x === rule);
561
+ }
562
+ rule.field = defaultField.value;
563
+ rs.rules[i] = rule;
564
+ if (defaultField) {
565
+ this.changeField(defaultField.value, rule);
566
+ }
567
+ else {
568
+ this.handleTouched();
569
+ this.handleDataChange();
570
+ }
571
+ }
572
+ getDefaultValue(defaultValue) {
573
+ switch (typeof defaultValue) {
574
+ case 'function':
575
+ return defaultValue();
576
+ default:
577
+ return defaultValue;
578
+ }
579
+ }
580
+ getOperatorTemplate() {
581
+ const t = this.parentOperatorTemplate || this.operatorTemplate;
582
+ return t ? t.template : null;
583
+ }
584
+ getFieldTemplate() {
585
+ const t = this.parentFieldTemplate || this.fieldTemplate;
586
+ return t ? t.template : null;
587
+ }
588
+ getEntityTemplate() {
589
+ const t = this.parentEntityTemplate || this.entityTemplate;
590
+ return t ? t.template : null;
591
+ }
592
+ getArrowIconTemplate() {
593
+ const t = this.parentArrowIconTemplate || this.arrowIconTemplate;
594
+ return t ? t.template : null;
595
+ }
596
+ getButtonGroupTemplate() {
597
+ const t = this.parentButtonGroupTemplate || this.buttonGroupTemplate;
598
+ return t ? t.template : null;
599
+ }
600
+ getSwitchGroupTemplate() {
601
+ const t = this.parentSwitchGroupTemplate || this.switchGroupTemplate;
602
+ return t ? t.template : null;
603
+ }
604
+ getRemoveButtonTemplate() {
605
+ const t = this.parentRemoveButtonTemplate || this.removeButtonTemplate;
606
+ return t ? t.template : null;
607
+ }
608
+ getEmptyWarningTemplate() {
609
+ const t = this.parentEmptyWarningTemplate || this.emptyWarningTemplate;
610
+ return t ? t.template : null;
611
+ }
612
+ getQueryItemClassName(local) {
613
+ let cls = this.getClassNames('row', 'connector', 'transition');
614
+ cls += ' ' + this.getClassNames(local.ruleset ? 'ruleSet' : 'rule');
615
+ if (local.invalid) {
616
+ cls += ' ' + this.getClassNames('invalidRuleSet');
617
+ }
618
+ return cls;
619
+ }
620
+ getButtonGroupContext() {
621
+ if (!this.buttonGroupContext) {
622
+ this.buttonGroupContext = {
623
+ addRule: this.addRule.bind(this),
624
+ addRuleSet: this.allowRuleset && this.addRuleSet.bind(this),
625
+ removeRuleSet: this.allowRuleset && this.parentValue && this.removeRuleSet.bind(this),
626
+ getDisabledState: this.getDisabledState,
627
+ $implicit: this.data
628
+ };
629
+ }
630
+ return this.buttonGroupContext;
631
+ }
632
+ getRemoveButtonContext(rule) {
633
+ if (!this.removeButtonContextCache.has(rule)) {
634
+ this.removeButtonContextCache.set(rule, {
635
+ removeRule: this.removeRule.bind(this),
636
+ getDisabledState: this.getDisabledState,
637
+ $implicit: rule
638
+ });
639
+ }
640
+ return this.removeButtonContextCache.get(rule);
641
+ }
642
+ getFieldContext(rule) {
643
+ if (!this.fieldContextCache.has(rule)) {
644
+ this.fieldContextCache.set(rule, {
645
+ onChange: this.changeField.bind(this),
646
+ getFields: this.getFields.bind(this),
647
+ getDisabledState: this.getDisabledState,
648
+ fields: this.fields,
649
+ $implicit: rule
650
+ });
651
+ }
652
+ return this.fieldContextCache.get(rule);
653
+ }
654
+ getEntityContext(rule) {
655
+ if (!this.entityContextCache.has(rule)) {
656
+ this.entityContextCache.set(rule, {
657
+ onChange: this.changeEntity.bind(this),
658
+ getDisabledState: this.getDisabledState,
659
+ entities: this.entities,
660
+ $implicit: rule
661
+ });
662
+ }
663
+ return this.entityContextCache.get(rule);
664
+ }
665
+ getSwitchGroupContext() {
666
+ return {
667
+ onChange: this.changeCondition.bind(this),
668
+ getDisabledState: this.getDisabledState,
669
+ $implicit: this.data
670
+ };
671
+ }
672
+ getArrowIconContext() {
673
+ return {
674
+ getDisabledState: this.getDisabledState,
675
+ $implicit: this.data
676
+ };
677
+ }
678
+ getEmptyWarningContext() {
679
+ return {
680
+ getDisabledState: this.getDisabledState,
681
+ message: this.emptyMessage,
682
+ $implicit: this.data
683
+ };
684
+ }
685
+ getOperatorContext(rule) {
686
+ if (!this.operatorContextCache.has(rule)) {
687
+ this.operatorContextCache.set(rule, {
688
+ onChange: this.changeOperator.bind(this),
689
+ getDisabledState: this.getDisabledState,
690
+ operators: this.getOperators(rule.field),
691
+ $implicit: rule
692
+ });
693
+ }
694
+ return this.operatorContextCache.get(rule);
695
+ }
696
+ getInputContext(rule) {
697
+ if (!this.inputContextCache.has(rule)) {
698
+ this.inputContextCache.set(rule, {
699
+ onChange: this.changeInput.bind(this),
700
+ getDisabledState: this.getDisabledState,
701
+ options: this.getOptions(rule.field),
702
+ field: this.config.fields[rule.field],
703
+ $implicit: rule
704
+ });
705
+ }
706
+ return this.inputContextCache.get(rule);
707
+ }
708
+ calculateFieldChangeValue(currentField, nextField, currentValue) {
709
+ if (this.config.calculateFieldChangeValue != null) {
710
+ return this.config.calculateFieldChangeValue(currentField, nextField, currentValue);
711
+ }
712
+ const canKeepValue = () => {
713
+ if (currentField == null || nextField == null) {
714
+ return false;
715
+ }
716
+ return currentField.type === nextField.type
717
+ && this.defaultPersistValueTypes.indexOf(currentField.type) !== -1;
718
+ };
719
+ if (this.persistValueOnFieldChange && canKeepValue()) {
720
+ return currentValue;
721
+ }
722
+ if (nextField && nextField.defaultValue !== undefined) {
723
+ return this.getDefaultValue(nextField.defaultValue);
724
+ }
725
+ return undefined;
726
+ }
727
+ checkEmptyRuleInRuleset(ruleset) {
728
+ if (!ruleset || !ruleset.rules || ruleset.rules.length === 0) {
729
+ return true;
730
+ }
731
+ else {
732
+ return ruleset.rules.some((item) => {
733
+ if (item.rules) {
734
+ return this.checkEmptyRuleInRuleset(item);
735
+ }
736
+ else {
737
+ return false;
738
+ }
739
+ });
740
+ }
741
+ }
742
+ validateRulesInRuleset(ruleset, errorStore) {
743
+ if (ruleset && ruleset.rules && ruleset.rules.length > 0) {
744
+ ruleset.rules.forEach((item) => {
745
+ if (item.rules) {
746
+ return this.validateRulesInRuleset(item, errorStore);
747
+ }
748
+ else if (item.field) {
749
+ const field = this.config.fields[item.field];
750
+ if (field && field.validator && field.validator.apply) {
751
+ const error = field.validator(item, ruleset);
752
+ if (error != null) {
753
+ errorStore.push(error);
754
+ }
755
+ }
756
+ }
757
+ });
758
+ }
759
+ }
760
+ handleDataChange() {
761
+ this.changeDetectorRef.markForCheck();
762
+ if (this.onChangeCallback) {
763
+ this.onChangeCallback();
764
+ }
765
+ if (this.parentChangeCallback) {
766
+ this.parentChangeCallback();
767
+ }
768
+ }
769
+ handleTouched() {
770
+ if (this.onTouchedCallback) {
771
+ this.onTouchedCallback();
772
+ }
773
+ if (this.parentTouchedCallback) {
774
+ this.parentTouchedCallback();
775
+ }
776
+ }
777
+ }
778
+ QueryBuilderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: QueryBuilderComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
779
+ QueryBuilderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: QueryBuilderComponent, selector: "query-builder", inputs: { disabled: "disabled", data: "data", allowRuleset: "allowRuleset", allowCollapse: "allowCollapse", emptyMessage: "emptyMessage", classNames: "classNames", operatorMap: "operatorMap", parentValue: "parentValue", config: "config", parentArrowIconTemplate: "parentArrowIconTemplate", parentInputTemplates: "parentInputTemplates", parentOperatorTemplate: "parentOperatorTemplate", parentFieldTemplate: "parentFieldTemplate", parentEntityTemplate: "parentEntityTemplate", parentSwitchGroupTemplate: "parentSwitchGroupTemplate", parentButtonGroupTemplate: "parentButtonGroupTemplate", parentRemoveButtonTemplate: "parentRemoveButtonTemplate", parentEmptyWarningTemplate: "parentEmptyWarningTemplate", parentChangeCallback: "parentChangeCallback", parentTouchedCallback: "parentTouchedCallback", persistValueOnFieldChange: "persistValueOnFieldChange", value: "value" }, host: { properties: { "attr.query-builder-condition": "this.condintion" } }, providers: [CONTROL_VALUE_ACCESSOR, VALIDATOR], queries: [{ propertyName: "buttonGroupTemplate", first: true, predicate: QueryButtonGroupDirective, descendants: true }, { propertyName: "switchGroupTemplate", first: true, predicate: QuerySwitchGroupDirective, descendants: true }, { propertyName: "fieldTemplate", first: true, predicate: QueryFieldDirective, descendants: true }, { propertyName: "entityTemplate", first: true, predicate: QueryEntityDirective, descendants: true }, { propertyName: "operatorTemplate", first: true, predicate: QueryOperatorDirective, descendants: true }, { propertyName: "removeButtonTemplate", first: true, predicate: QueryRemoveButtonDirective, descendants: true }, { propertyName: "emptyWarningTemplate", first: true, predicate: QueryEmptyWarningDirective, descendants: true }, { propertyName: "arrowIconTemplate", first: true, predicate: QueryArrowIconDirective, descendants: true }, { propertyName: "inputTemplates", predicate: QueryInputDirective, descendants: true }], viewQueries: [{ propertyName: "treeContainer", first: true, predicate: ["treeContainer"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div [ngClass]=\"getClassNames('switchRow')\">\n <ng-template #defaultArrowIcon>\n <i [ngClass]=\"getClassNames('arrowIcon')\"></i>\n </ng-template>\n\n <a *ngIf=\"allowCollapse\" (click)=\"toggleCollapse()\" [ngClass]=\"getClassNames('arrowIconButton', data.collapsed ? 'collapsed' : '')\">\n <ng-container *ngIf=\"getArrowIconTemplate() as template; else defaultArrowIcon\">\n <ng-container *ngTemplateOutlet=\"template; context: getArrowIconContext()\"></ng-container>\n </ng-container>\n </a>\n\n <ng-container *ngIf=\"getButtonGroupTemplate() as template; else defaultButtonGroup\">\n <div [ngClass]=\"getClassNames('buttonGroup', 'rightAlign')\">\n <ng-container *ngTemplateOutlet=\"template; context: getButtonGroupContext()\"></ng-container>\n </div>\n </ng-container>\n\n <ng-template #defaultButtonGroup>\n <div [ngClass]=\"getClassNames('buttonGroup', 'rightAlign')\">\n <button type=\"button\" (click)=\"addRule()\" [ngClass]=\"getClassNames('button')\" [disabled]=disabled>\n <i [ngClass]=\"getClassNames('addIcon')\"></i> Rule\n </button>\n <button type=\"button\" (click)=\"addRuleSet()\" [ngClass]=\"getClassNames('button')\" *ngIf=\"allowRuleset\" [disabled]=disabled>\n <i [ngClass]=\"getClassNames('addIcon')\"></i> Ruleset\n </button>\n <ng-container *ngIf=\"!!parentValue && allowRuleset\">\n <button type=\"button\" (click)=\"removeRuleSet()\" [ngClass]=\"getClassNames('button', 'removeButton')\" [disabled]=disabled>\n <i [ngClass]=\"getClassNames('removeIcon')\"></i>\n </button>\n </ng-container>\n </div>\n </ng-template>\n\n <ng-container *ngIf=\"getSwitchGroupTemplate() as template; else defaultSwitchGroup\">\n <ng-container *ngTemplateOutlet=\"template; context: getSwitchGroupContext()\"></ng-container>\n </ng-container>\n\n <ng-template #defaultSwitchGroup>\n <div [ngClass]=\"getClassNames('switchGroup', 'transition')\" *ngIf=\"data\">\n <div [ngClass]=\"getClassNames('switchControl')\">\n <input type=\"radio\" [ngClass]=\"getClassNames('switchRadio')\" [(ngModel)]=\"data.condition\" [disabled]=disabled\n value=\"and\" #andOption />\n <label (click)=\"changeCondition(andOption.value)\" [ngClass]=\"getClassNames('switchLabel')\">AND</label>\n </div>\n <div [ngClass]=\"getClassNames('switchControl')\">\n <input type=\"radio\" [ngClass]=\"getClassNames('switchRadio')\" [(ngModel)]=\"data.condition\" [disabled]=disabled\n value=\"or\" #orOption />\n <label (click)=\"changeCondition(orOption.value)\" [ngClass]=\"getClassNames('switchLabel')\">OR</label>\n </div>\n </div>\n </ng-template>\n</div>\n\n<div #treeContainer (transitionend)=\"transitionEnd($event)\" [ngClass]=\"getClassNames('treeContainer', data.collapsed ? 'collapsed' : '')\">\n <ul [ngClass]=\"getClassNames('tree')\" *ngIf=\"data && data.rules\">\n <ng-container *ngFor=\"let rule of data.rules;let i=index\">\n\n <ng-container *ngIf=\"{ruleset: !!rule.rules, invalid: !config.allowEmptyRulesets && rule.rules && rule.rules.length === 0} as local\">\n <li [ngClass]=\"getQueryItemClassName(local)\">\n <ng-container *ngIf=\"!local.ruleset\">\n\n <ng-container *ngIf=\"getRemoveButtonTemplate() as template; else defaultRemoveButton\">\n <div [ngClass]=\"getClassNames('buttonGroup', 'rightAlign')\">\n <ng-container *ngTemplateOutlet=\"template; context: getRemoveButtonContext(rule)\"></ng-container>\n </div>\n </ng-container>\n\n <ng-template #defaultRemoveButton>\n <div [ngClass]=\"getClassNames('removeButtonSize', 'rightAlign')\">\n <button type=\"button\" [ngClass]=\"getClassNames('button', 'removeButton')\" (click)=\"removeRule(rule, data)\" [disabled]=disabled>\n <i [ngClass]=\"getClassNames('removeIcon')\"></i>\n </button>\n </div>\n </ng-template>\n\n <div *ngIf=\"entities?.length\" class=\"q-inline-block-display\">\n <ng-container *ngIf=\"getEntityTemplate() as template; else defaultEntity\">\n <ng-container *ngTemplateOutlet=\"template; context: getEntityContext(rule)\"></ng-container>\n </ng-container>\n </div>\n\n <ng-template #defaultEntity>\n <div [ngClass]=\"getClassNames('entityControlSize')\">\n <select [ngClass]=\"getClassNames('entityControl')\" [(ngModel)]=\"rule.entity\" (ngModelChange)=\"changeEntity($event, rule,i,data)\"\n [disabled]=\"disabled\">\n <option *ngFor=\"let entity of entities\" [ngValue]=\"entity.value\">\n {{entity.name}}\n </option>\n </select>\n </div>\n </ng-template>\n\n <ng-container *ngIf=\"getFieldTemplate() as template; else defaultField\">\n <ng-container *ngTemplateOutlet=\"template; context: getFieldContext(rule)\"></ng-container>\n </ng-container>\n\n <ng-template #defaultField>\n <div [ngClass]=\"getClassNames('fieldControlSize')\">\n <select [ngClass]=\"getClassNames('fieldControl')\" [(ngModel)]=\"rule.field\" (ngModelChange)=\"changeField($event, rule)\"\n [disabled]=\"disabled\">\n <option *ngFor=\"let field of getFields(rule.entity)\" [ngValue]=\"field.value\">\n {{field.name}}\n </option>\n </select>\n </div>\n </ng-template>\n\n <ng-container *ngIf=\"getOperatorTemplate() as template; else defaultOperator\">\n <ng-container *ngTemplateOutlet=\"template; context: getOperatorContext(rule)\"></ng-container>\n </ng-container>\n\n <ng-template #defaultOperator>\n <div [ngClass]=\"getClassNames('operatorControlSize')\">\n <select [ngClass]=\"getClassNames('operatorControl')\" [(ngModel)]=\"rule.operator\" (ngModelChange)=\"changeOperator(rule)\"\n [disabled]=\"disabled\">\n <option *ngFor=\"let operator of getOperators(rule.field)\" [ngValue]=\"operator\">\n {{operator}}\n </option>\n </select>\n </div>\n </ng-template>\n\n <ng-container *ngIf=\"findTemplateForRule(rule) as template; else defaultInput\">\n <ng-container *ngTemplateOutlet=\"template; context: getInputContext(rule)\"></ng-container>\n </ng-container>\n\n <ng-template #defaultInput>\n <div [ngClass]=\"getClassNames('inputControlSize')\" [ngSwitch]=\"getInputType(rule.field, rule.operator)\">\n <input [ngClass]=\"getClassNames('inputControl')\" [(ngModel)]=\"rule.value\" (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\" *ngSwitchCase=\"'string'\" type=\"text\">\n <input [ngClass]=\"getClassNames('inputControl')\" [(ngModel)]=\"rule.value\" (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\" *ngSwitchCase=\"'number'\" type=\"number\">\n <input [ngClass]=\"getClassNames('inputControl')\" [(ngModel)]=\"rule.value\" (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\" *ngSwitchCase=\"'date'\" type=\"date\">\n <input [ngClass]=\"getClassNames('inputControl')\" [(ngModel)]=\"rule.value\" (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\" *ngSwitchCase=\"'time'\" type=\"time\">\n <select [ngClass]=\"getClassNames('inputControl')\" [(ngModel)]=\"rule.value\" (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\" *ngSwitchCase=\"'category'\">\n <option *ngFor=\"let opt of getOptions(rule.field)\" [ngValue]=\"opt.value\">\n {{opt.name}}\n </option>\n </select>\n <ng-container *ngSwitchCase=\"'multiselect'\">\n <select [ngClass]=\"getClassNames('inputControl')\" [(ngModel)]=\"rule.value\" (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\" multiple>\n <option *ngFor=\"let opt of getOptions(rule.field)\" [ngValue]=\"opt.value\">\n {{opt.name}}\n </option>\n </select>\n </ng-container>\n <input [ngClass]=\"getClassNames('inputControl')\" [(ngModel)]=\"rule.value\" (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\" *ngSwitchCase=\"'boolean'\" type=\"checkbox\">\n </div>\n </ng-template>\n\n </ng-container>\n <query-builder *ngIf=\"local.ruleset\" [data]=\"rule\" [disabled]=\"disabled\" [parentTouchedCallback]=\"parentTouchedCallback || onTouchedCallback\"\n [parentChangeCallback]=\"parentChangeCallback || onChangeCallback\" [parentInputTemplates]=\"parentInputTemplates || inputTemplates\"\n [parentOperatorTemplate]=\"parentOperatorTemplate || operatorTemplate\" [parentFieldTemplate]=\"parentFieldTemplate || fieldTemplate\"\n [parentEntityTemplate]=\"parentEntityTemplate || entityTemplate\" [parentSwitchGroupTemplate]=\"parentSwitchGroupTemplate || switchGroupTemplate\"\n [parentButtonGroupTemplate]=\"parentButtonGroupTemplate || buttonGroupTemplate\" [parentRemoveButtonTemplate]=\"parentRemoveButtonTemplate || removeButtonTemplate\"\n [parentEmptyWarningTemplate]=\"parentEmptyWarningTemplate || emptyWarningTemplate\" [parentArrowIconTemplate]=\"parentArrowIconTemplate || arrowIconTemplate\"\n [parentValue]=\"data\" [classNames]=\"classNames\" [config]=\"config\" [allowRuleset]=\"allowRuleset\"\n [allowCollapse]=\"allowCollapse\" [emptyMessage]=\"emptyMessage\" [operatorMap]=\"operatorMap\">\n </query-builder>\n\n <ng-container *ngIf=\"getEmptyWarningTemplate() as template; else defaultEmptyWarning\">\n <ng-container *ngIf=\"local.invalid\">\n <ng-container *ngTemplateOutlet=\"template; context: getEmptyWarningContext()\"></ng-container>\n </ng-container>\n </ng-container>\n\n <ng-template #defaultEmptyWarning>\n <p [ngClass]=\"getClassNames('emptyWarning')\" *ngIf=\"local.invalid\">\n {{emptyMessage}}\n </p>\n </ng-template>\n </li>\n </ng-container>\n </ng-container>\n </ul>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block;width:100%}:host .q-icon{font-style:normal;font-size:12px}:host .q-remove-icon:before{content:\"\\274c\"}:host .q-arrow-icon-button{float:left;margin:4px 6px 4px 0;transform:rotate(90deg);transition:linear .25s transform;cursor:pointer}:host .q-arrow-icon-button.q-collapsed{transform:rotate(0)}:host .q-arrow-icon:before{content:\"\\25b6\"}:host .q-add-icon{color:#555}:host .q-add-icon:before{content:\"\\2795\"}:host .q-remove-button{color:#b3415d;width:31px}:host .q-switch-group,:host .q-button-group{font-family:Lucida Grande,Tahoma,Verdana,sans-serif;overflow:hidden}:host .q-right-align{float:right}:host .q-button{margin-left:8px;padding:0 8px;background-color:#fff}:host .q-button:disabled{display:none}:host .q-control-size{display:inline-block;vertical-align:top;padding-right:10px}:host .q-input-control,:host .q-operator-control,:host .q-field-control,:host .q-entity-control{display:inline-block;padding:5px 8px;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;box-sizing:border-box;width:auto;min-width:180px}:host .q-input-control:disabled,:host .q-operator-control:disabled,:host .q-field-control:disabled,:host .q-entity-control:disabled{border-color:transparent}:host .q-operator-control,:host .q-field-control,:host .q-entity-control,:host .q-input-control:not([type=checkbox]){min-height:32px;-webkit-appearance:none}:host .q-switch-label,:host .q-button{float:left;margin-bottom:0;font-size:14px;line-height:30px;font-weight:400;text-align:center;text-shadow:none;border:1px solid rgba(0,0,0,.2);box-sizing:border-box}:host .q-switch-label:hover,:host .q-button:hover{cursor:pointer;background-color:#f0f0f0}:host .q-switch-label{background-color:#e4e4e4;padding:0 8px}:host .q-switch-radio{position:absolute;clip:rect(0,0,0,0);height:1px;width:1px;border:0;overflow:hidden}:host .q-switch-radio:checked+.q-switch-label{border:1px solid #619ed7;background:white;color:#3176b3}:host .q-switch-radio:disabled+.q-switch-label{display:none}:host .q-switch-radio:checked:disabled+.q-switch-label{display:initial;color:initial;cursor:default;border-color:transparent}:host .q-invalid-ruleset{border:1px solid rgba(179,65,93,.5)!important;background:rgba(179,65,93,.1)!important}:host .q-empty-warning{color:#8d252e;text-align:center}:host .q-ruleset{border:1px solid #CCC}:host .q-rule{border:1px solid #CCC;background:white}:host .q-transition{transition:all .1s ease-in-out}:host .q-tree-container{width:100%;overflow:hidden;transition:ease-in .25s max-height}:host .q-tree-container.q-collapsed{max-height:0!important}:host .q-tree{list-style:none;margin:4px 0 2px}:host .q-row{padding:6px 8px;margin-top:6px}:host .q-connector{position:relative}:host .q-connector:before{top:-5px;border-width:0 0 2px 2px}:host .q-connector:after{border-width:0 0 0 2px;top:50%}:host .q-connector:before,:host .q-connector:after{content:\"\";left:-12px;border-color:#ccc;border-style:solid;width:9px;height:calc(50% + 6px);position:absolute}:host .q-connector:last-child:after{content:none}:host .q-inline-block-display{display:inline-block;vertical-align:top}\n"], components: [{ type: QueryBuilderComponent, selector: "query-builder", inputs: ["disabled", "data", "allowRuleset", "allowCollapse", "emptyMessage", "classNames", "operatorMap", "parentValue", "config", "parentArrowIconTemplate", "parentInputTemplates", "parentOperatorTemplate", "parentFieldTemplate", "parentEntityTemplate", "parentSwitchGroupTemplate", "parentButtonGroupTemplate", "parentRemoveButtonTemplate", "parentEmptyWarningTemplate", "parentChangeCallback", "parentTouchedCallback", "persistValueOnFieldChange", "value"] }], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i2.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { type: i2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }] });
780
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: QueryBuilderComponent, decorators: [{
781
+ type: Component,
782
+ args: [{ selector: 'query-builder', providers: [CONTROL_VALUE_ACCESSOR, VALIDATOR], template: "<div [ngClass]=\"getClassNames('switchRow')\">\n <ng-template #defaultArrowIcon>\n <i [ngClass]=\"getClassNames('arrowIcon')\"></i>\n </ng-template>\n\n <a *ngIf=\"allowCollapse\" (click)=\"toggleCollapse()\" [ngClass]=\"getClassNames('arrowIconButton', data.collapsed ? 'collapsed' : '')\">\n <ng-container *ngIf=\"getArrowIconTemplate() as template; else defaultArrowIcon\">\n <ng-container *ngTemplateOutlet=\"template; context: getArrowIconContext()\"></ng-container>\n </ng-container>\n </a>\n\n <ng-container *ngIf=\"getButtonGroupTemplate() as template; else defaultButtonGroup\">\n <div [ngClass]=\"getClassNames('buttonGroup', 'rightAlign')\">\n <ng-container *ngTemplateOutlet=\"template; context: getButtonGroupContext()\"></ng-container>\n </div>\n </ng-container>\n\n <ng-template #defaultButtonGroup>\n <div [ngClass]=\"getClassNames('buttonGroup', 'rightAlign')\">\n <button type=\"button\" (click)=\"addRule()\" [ngClass]=\"getClassNames('button')\" [disabled]=disabled>\n <i [ngClass]=\"getClassNames('addIcon')\"></i> Rule\n </button>\n <button type=\"button\" (click)=\"addRuleSet()\" [ngClass]=\"getClassNames('button')\" *ngIf=\"allowRuleset\" [disabled]=disabled>\n <i [ngClass]=\"getClassNames('addIcon')\"></i> Ruleset\n </button>\n <ng-container *ngIf=\"!!parentValue && allowRuleset\">\n <button type=\"button\" (click)=\"removeRuleSet()\" [ngClass]=\"getClassNames('button', 'removeButton')\" [disabled]=disabled>\n <i [ngClass]=\"getClassNames('removeIcon')\"></i>\n </button>\n </ng-container>\n </div>\n </ng-template>\n\n <ng-container *ngIf=\"getSwitchGroupTemplate() as template; else defaultSwitchGroup\">\n <ng-container *ngTemplateOutlet=\"template; context: getSwitchGroupContext()\"></ng-container>\n </ng-container>\n\n <ng-template #defaultSwitchGroup>\n <div [ngClass]=\"getClassNames('switchGroup', 'transition')\" *ngIf=\"data\">\n <div [ngClass]=\"getClassNames('switchControl')\">\n <input type=\"radio\" [ngClass]=\"getClassNames('switchRadio')\" [(ngModel)]=\"data.condition\" [disabled]=disabled\n value=\"and\" #andOption />\n <label (click)=\"changeCondition(andOption.value)\" [ngClass]=\"getClassNames('switchLabel')\">AND</label>\n </div>\n <div [ngClass]=\"getClassNames('switchControl')\">\n <input type=\"radio\" [ngClass]=\"getClassNames('switchRadio')\" [(ngModel)]=\"data.condition\" [disabled]=disabled\n value=\"or\" #orOption />\n <label (click)=\"changeCondition(orOption.value)\" [ngClass]=\"getClassNames('switchLabel')\">OR</label>\n </div>\n </div>\n </ng-template>\n</div>\n\n<div #treeContainer (transitionend)=\"transitionEnd($event)\" [ngClass]=\"getClassNames('treeContainer', data.collapsed ? 'collapsed' : '')\">\n <ul [ngClass]=\"getClassNames('tree')\" *ngIf=\"data && data.rules\">\n <ng-container *ngFor=\"let rule of data.rules;let i=index\">\n\n <ng-container *ngIf=\"{ruleset: !!rule.rules, invalid: !config.allowEmptyRulesets && rule.rules && rule.rules.length === 0} as local\">\n <li [ngClass]=\"getQueryItemClassName(local)\">\n <ng-container *ngIf=\"!local.ruleset\">\n\n <ng-container *ngIf=\"getRemoveButtonTemplate() as template; else defaultRemoveButton\">\n <div [ngClass]=\"getClassNames('buttonGroup', 'rightAlign')\">\n <ng-container *ngTemplateOutlet=\"template; context: getRemoveButtonContext(rule)\"></ng-container>\n </div>\n </ng-container>\n\n <ng-template #defaultRemoveButton>\n <div [ngClass]=\"getClassNames('removeButtonSize', 'rightAlign')\">\n <button type=\"button\" [ngClass]=\"getClassNames('button', 'removeButton')\" (click)=\"removeRule(rule, data)\" [disabled]=disabled>\n <i [ngClass]=\"getClassNames('removeIcon')\"></i>\n </button>\n </div>\n </ng-template>\n\n <div *ngIf=\"entities?.length\" class=\"q-inline-block-display\">\n <ng-container *ngIf=\"getEntityTemplate() as template; else defaultEntity\">\n <ng-container *ngTemplateOutlet=\"template; context: getEntityContext(rule)\"></ng-container>\n </ng-container>\n </div>\n\n <ng-template #defaultEntity>\n <div [ngClass]=\"getClassNames('entityControlSize')\">\n <select [ngClass]=\"getClassNames('entityControl')\" [(ngModel)]=\"rule.entity\" (ngModelChange)=\"changeEntity($event, rule,i,data)\"\n [disabled]=\"disabled\">\n <option *ngFor=\"let entity of entities\" [ngValue]=\"entity.value\">\n {{entity.name}}\n </option>\n </select>\n </div>\n </ng-template>\n\n <ng-container *ngIf=\"getFieldTemplate() as template; else defaultField\">\n <ng-container *ngTemplateOutlet=\"template; context: getFieldContext(rule)\"></ng-container>\n </ng-container>\n\n <ng-template #defaultField>\n <div [ngClass]=\"getClassNames('fieldControlSize')\">\n <select [ngClass]=\"getClassNames('fieldControl')\" [(ngModel)]=\"rule.field\" (ngModelChange)=\"changeField($event, rule)\"\n [disabled]=\"disabled\">\n <option *ngFor=\"let field of getFields(rule.entity)\" [ngValue]=\"field.value\">\n {{field.name}}\n </option>\n </select>\n </div>\n </ng-template>\n\n <ng-container *ngIf=\"getOperatorTemplate() as template; else defaultOperator\">\n <ng-container *ngTemplateOutlet=\"template; context: getOperatorContext(rule)\"></ng-container>\n </ng-container>\n\n <ng-template #defaultOperator>\n <div [ngClass]=\"getClassNames('operatorControlSize')\">\n <select [ngClass]=\"getClassNames('operatorControl')\" [(ngModel)]=\"rule.operator\" (ngModelChange)=\"changeOperator(rule)\"\n [disabled]=\"disabled\">\n <option *ngFor=\"let operator of getOperators(rule.field)\" [ngValue]=\"operator\">\n {{operator}}\n </option>\n </select>\n </div>\n </ng-template>\n\n <ng-container *ngIf=\"findTemplateForRule(rule) as template; else defaultInput\">\n <ng-container *ngTemplateOutlet=\"template; context: getInputContext(rule)\"></ng-container>\n </ng-container>\n\n <ng-template #defaultInput>\n <div [ngClass]=\"getClassNames('inputControlSize')\" [ngSwitch]=\"getInputType(rule.field, rule.operator)\">\n <input [ngClass]=\"getClassNames('inputControl')\" [(ngModel)]=\"rule.value\" (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\" *ngSwitchCase=\"'string'\" type=\"text\">\n <input [ngClass]=\"getClassNames('inputControl')\" [(ngModel)]=\"rule.value\" (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\" *ngSwitchCase=\"'number'\" type=\"number\">\n <input [ngClass]=\"getClassNames('inputControl')\" [(ngModel)]=\"rule.value\" (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\" *ngSwitchCase=\"'date'\" type=\"date\">\n <input [ngClass]=\"getClassNames('inputControl')\" [(ngModel)]=\"rule.value\" (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\" *ngSwitchCase=\"'time'\" type=\"time\">\n <select [ngClass]=\"getClassNames('inputControl')\" [(ngModel)]=\"rule.value\" (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\" *ngSwitchCase=\"'category'\">\n <option *ngFor=\"let opt of getOptions(rule.field)\" [ngValue]=\"opt.value\">\n {{opt.name}}\n </option>\n </select>\n <ng-container *ngSwitchCase=\"'multiselect'\">\n <select [ngClass]=\"getClassNames('inputControl')\" [(ngModel)]=\"rule.value\" (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\" multiple>\n <option *ngFor=\"let opt of getOptions(rule.field)\" [ngValue]=\"opt.value\">\n {{opt.name}}\n </option>\n </select>\n </ng-container>\n <input [ngClass]=\"getClassNames('inputControl')\" [(ngModel)]=\"rule.value\" (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\" *ngSwitchCase=\"'boolean'\" type=\"checkbox\">\n </div>\n </ng-template>\n\n </ng-container>\n <query-builder *ngIf=\"local.ruleset\" [data]=\"rule\" [disabled]=\"disabled\" [parentTouchedCallback]=\"parentTouchedCallback || onTouchedCallback\"\n [parentChangeCallback]=\"parentChangeCallback || onChangeCallback\" [parentInputTemplates]=\"parentInputTemplates || inputTemplates\"\n [parentOperatorTemplate]=\"parentOperatorTemplate || operatorTemplate\" [parentFieldTemplate]=\"parentFieldTemplate || fieldTemplate\"\n [parentEntityTemplate]=\"parentEntityTemplate || entityTemplate\" [parentSwitchGroupTemplate]=\"parentSwitchGroupTemplate || switchGroupTemplate\"\n [parentButtonGroupTemplate]=\"parentButtonGroupTemplate || buttonGroupTemplate\" [parentRemoveButtonTemplate]=\"parentRemoveButtonTemplate || removeButtonTemplate\"\n [parentEmptyWarningTemplate]=\"parentEmptyWarningTemplate || emptyWarningTemplate\" [parentArrowIconTemplate]=\"parentArrowIconTemplate || arrowIconTemplate\"\n [parentValue]=\"data\" [classNames]=\"classNames\" [config]=\"config\" [allowRuleset]=\"allowRuleset\"\n [allowCollapse]=\"allowCollapse\" [emptyMessage]=\"emptyMessage\" [operatorMap]=\"operatorMap\">\n </query-builder>\n\n <ng-container *ngIf=\"getEmptyWarningTemplate() as template; else defaultEmptyWarning\">\n <ng-container *ngIf=\"local.invalid\">\n <ng-container *ngTemplateOutlet=\"template; context: getEmptyWarningContext()\"></ng-container>\n </ng-container>\n </ng-container>\n\n <ng-template #defaultEmptyWarning>\n <p [ngClass]=\"getClassNames('emptyWarning')\" *ngIf=\"local.invalid\">\n {{emptyMessage}}\n </p>\n </ng-template>\n </li>\n </ng-container>\n </ng-container>\n </ul>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block;width:100%}:host .q-icon{font-style:normal;font-size:12px}:host .q-remove-icon:before{content:\"\\274c\"}:host .q-arrow-icon-button{float:left;margin:4px 6px 4px 0;transform:rotate(90deg);transition:linear .25s transform;cursor:pointer}:host .q-arrow-icon-button.q-collapsed{transform:rotate(0)}:host .q-arrow-icon:before{content:\"\\25b6\"}:host .q-add-icon{color:#555}:host .q-add-icon:before{content:\"\\2795\"}:host .q-remove-button{color:#b3415d;width:31px}:host .q-switch-group,:host .q-button-group{font-family:Lucida Grande,Tahoma,Verdana,sans-serif;overflow:hidden}:host .q-right-align{float:right}:host .q-button{margin-left:8px;padding:0 8px;background-color:#fff}:host .q-button:disabled{display:none}:host .q-control-size{display:inline-block;vertical-align:top;padding-right:10px}:host .q-input-control,:host .q-operator-control,:host .q-field-control,:host .q-entity-control{display:inline-block;padding:5px 8px;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;box-sizing:border-box;width:auto;min-width:180px}:host .q-input-control:disabled,:host .q-operator-control:disabled,:host .q-field-control:disabled,:host .q-entity-control:disabled{border-color:transparent}:host .q-operator-control,:host .q-field-control,:host .q-entity-control,:host .q-input-control:not([type=checkbox]){min-height:32px;-webkit-appearance:none}:host .q-switch-label,:host .q-button{float:left;margin-bottom:0;font-size:14px;line-height:30px;font-weight:400;text-align:center;text-shadow:none;border:1px solid rgba(0,0,0,.2);box-sizing:border-box}:host .q-switch-label:hover,:host .q-button:hover{cursor:pointer;background-color:#f0f0f0}:host .q-switch-label{background-color:#e4e4e4;padding:0 8px}:host .q-switch-radio{position:absolute;clip:rect(0,0,0,0);height:1px;width:1px;border:0;overflow:hidden}:host .q-switch-radio:checked+.q-switch-label{border:1px solid #619ed7;background:white;color:#3176b3}:host .q-switch-radio:disabled+.q-switch-label{display:none}:host .q-switch-radio:checked:disabled+.q-switch-label{display:initial;color:initial;cursor:default;border-color:transparent}:host .q-invalid-ruleset{border:1px solid rgba(179,65,93,.5)!important;background:rgba(179,65,93,.1)!important}:host .q-empty-warning{color:#8d252e;text-align:center}:host .q-ruleset{border:1px solid #CCC}:host .q-rule{border:1px solid #CCC;background:white}:host .q-transition{transition:all .1s ease-in-out}:host .q-tree-container{width:100%;overflow:hidden;transition:ease-in .25s max-height}:host .q-tree-container.q-collapsed{max-height:0!important}:host .q-tree{list-style:none;margin:4px 0 2px}:host .q-row{padding:6px 8px;margin-top:6px}:host .q-connector{position:relative}:host .q-connector:before{top:-5px;border-width:0 0 2px 2px}:host .q-connector:after{border-width:0 0 0 2px;top:50%}:host .q-connector:before,:host .q-connector:after{content:\"\";left:-12px;border-color:#ccc;border-style:solid;width:9px;height:calc(50% + 6px);position:absolute}:host .q-connector:last-child:after{content:none}:host .q-inline-block-display{display:inline-block;vertical-align:top}\n"] }]
783
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { disabled: [{
784
+ type: Input
785
+ }], data: [{
786
+ type: Input
787
+ }], condintion: [{
788
+ type: HostBinding,
789
+ args: ['attr.query-builder-condition']
790
+ }], allowRuleset: [{
791
+ type: Input
792
+ }], allowCollapse: [{
793
+ type: Input
794
+ }], emptyMessage: [{
795
+ type: Input
796
+ }], classNames: [{
797
+ type: Input
798
+ }], operatorMap: [{
799
+ type: Input
800
+ }], parentValue: [{
801
+ type: Input
802
+ }], config: [{
803
+ type: Input
804
+ }], parentArrowIconTemplate: [{
805
+ type: Input
806
+ }], parentInputTemplates: [{
807
+ type: Input
808
+ }], parentOperatorTemplate: [{
809
+ type: Input
810
+ }], parentFieldTemplate: [{
811
+ type: Input
812
+ }], parentEntityTemplate: [{
813
+ type: Input
814
+ }], parentSwitchGroupTemplate: [{
815
+ type: Input
816
+ }], parentButtonGroupTemplate: [{
817
+ type: Input
818
+ }], parentRemoveButtonTemplate: [{
819
+ type: Input
820
+ }], parentEmptyWarningTemplate: [{
821
+ type: Input
822
+ }], parentChangeCallback: [{
823
+ type: Input
824
+ }], parentTouchedCallback: [{
825
+ type: Input
826
+ }], persistValueOnFieldChange: [{
827
+ type: Input
828
+ }], treeContainer: [{
829
+ type: ViewChild,
830
+ args: ['treeContainer', { static: true }]
831
+ }], buttonGroupTemplate: [{
832
+ type: ContentChild,
833
+ args: [QueryButtonGroupDirective]
834
+ }], switchGroupTemplate: [{
835
+ type: ContentChild,
836
+ args: [QuerySwitchGroupDirective]
837
+ }], fieldTemplate: [{
838
+ type: ContentChild,
839
+ args: [QueryFieldDirective]
840
+ }], entityTemplate: [{
841
+ type: ContentChild,
842
+ args: [QueryEntityDirective]
843
+ }], operatorTemplate: [{
844
+ type: ContentChild,
845
+ args: [QueryOperatorDirective]
846
+ }], removeButtonTemplate: [{
847
+ type: ContentChild,
848
+ args: [QueryRemoveButtonDirective]
849
+ }], emptyWarningTemplate: [{
850
+ type: ContentChild,
851
+ args: [QueryEmptyWarningDirective]
852
+ }], inputTemplates: [{
853
+ type: ContentChildren,
854
+ args: [QueryInputDirective, { descendants: true }]
855
+ }], arrowIconTemplate: [{
856
+ type: ContentChild,
857
+ args: [QueryArrowIconDirective]
858
+ }], value: [{
859
+ type: Input
860
+ }] } });
861
+
862
+ class NgxAngularQueryBuilderModule {
863
+ }
864
+ NgxAngularQueryBuilderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxAngularQueryBuilderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
865
+ NgxAngularQueryBuilderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxAngularQueryBuilderModule, declarations: [QueryBuilderComponent,
866
+ QueryInputDirective,
867
+ QueryOperatorDirective,
868
+ QueryFieldDirective,
869
+ QueryEntityDirective,
870
+ QueryButtonGroupDirective,
871
+ QuerySwitchGroupDirective,
872
+ QueryRemoveButtonDirective,
873
+ QueryEmptyWarningDirective,
874
+ QueryArrowIconDirective], imports: [CommonModule,
875
+ FormsModule], exports: [QueryBuilderComponent,
876
+ QueryInputDirective,
877
+ QueryOperatorDirective,
878
+ QueryFieldDirective,
879
+ QueryEntityDirective,
880
+ QueryButtonGroupDirective,
881
+ QuerySwitchGroupDirective,
882
+ QueryRemoveButtonDirective,
883
+ QueryEmptyWarningDirective,
884
+ QueryArrowIconDirective] });
885
+ NgxAngularQueryBuilderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxAngularQueryBuilderModule, imports: [[
886
+ CommonModule,
887
+ FormsModule
888
+ ]] });
889
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NgxAngularQueryBuilderModule, decorators: [{
890
+ type: NgModule,
891
+ args: [{
892
+ imports: [
893
+ CommonModule,
894
+ FormsModule
895
+ ],
896
+ declarations: [
897
+ QueryBuilderComponent,
898
+ QueryInputDirective,
899
+ QueryOperatorDirective,
900
+ QueryFieldDirective,
901
+ QueryEntityDirective,
902
+ QueryButtonGroupDirective,
903
+ QuerySwitchGroupDirective,
904
+ QueryRemoveButtonDirective,
905
+ QueryEmptyWarningDirective,
906
+ QueryArrowIconDirective
907
+ ],
908
+ exports: [
909
+ QueryBuilderComponent,
910
+ QueryInputDirective,
911
+ QueryOperatorDirective,
912
+ QueryFieldDirective,
913
+ QueryEntityDirective,
914
+ QueryButtonGroupDirective,
915
+ QuerySwitchGroupDirective,
916
+ QueryRemoveButtonDirective,
917
+ QueryEmptyWarningDirective,
918
+ QueryArrowIconDirective
919
+ ]
920
+ }]
921
+ }] });
922
+
923
+ /*
924
+ * Public API Surface of ngx-angular-query-builder
925
+ */
926
+
927
+ /**
928
+ * Generated bundle index. Do not edit.
929
+ */
930
+
931
+ export { CONTROL_VALUE_ACCESSOR, NgxAngularQueryBuilderModule, QueryArrowIconDirective, QueryBuilderComponent, QueryButtonGroupDirective, QueryEmptyWarningDirective, QueryEntityDirective, QueryFieldDirective, QueryInputDirective, QueryOperatorDirective, QueryRemoveButtonDirective, QuerySwitchGroupDirective, VALIDATOR };
932
+ //# sourceMappingURL=ngx-angular-query-builder.mjs.map