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