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