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