ngx-angular-query-builder 20.0.0 → 22.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.
- package/README.md +348 -9
- package/fesm2022/ngx-angular-query-builder.mjs +1312 -959
- package/fesm2022/ngx-angular-query-builder.mjs.map +1 -1
- package/package.json +8 -7
- package/types/ngx-angular-query-builder.d.ts +424 -0
- package/index.d.ts +0 -342
|
@@ -1,964 +1,1317 @@
|
|
|
1
|
-
import * as i2 from
|
|
2
|
-
import {
|
|
3
|
-
import * as i0 from
|
|
4
|
-
import {
|
|
5
|
-
import * as i1 from
|
|
6
|
-
import { CommonModule } from
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
1
|
+
import * as i2 from "@angular/forms";
|
|
2
|
+
import { FormsModule, NG_VALIDATORS, NG_VALUE_ACCESSOR } from "@angular/forms";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import { ChangeDetectionStrategy, Component, ContentChild, ContentChildren, Directive, HostBinding, Input, NgModule, ViewChild, forwardRef } from "@angular/core";
|
|
5
|
+
import * as i1 from "@angular/common";
|
|
6
|
+
import { CommonModule } from "@angular/common";
|
|
7
|
+
var QueryOperatorDirective = class QueryOperatorDirective {
|
|
8
|
+
constructor(template) {
|
|
9
|
+
this.template = template;
|
|
10
|
+
}
|
|
11
|
+
static {
|
|
12
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
13
|
+
minVersion: "12.0.0",
|
|
14
|
+
version: "22.3.0",
|
|
15
|
+
ngImport: i0,
|
|
16
|
+
type: QueryOperatorDirective,
|
|
17
|
+
deps: [{ token: i0.TemplateRef }],
|
|
18
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
static {
|
|
22
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
23
|
+
minVersion: "14.0.0",
|
|
24
|
+
version: "22.3.0",
|
|
25
|
+
type: QueryOperatorDirective,
|
|
26
|
+
isStandalone: false,
|
|
27
|
+
selector: "[queryOperator]",
|
|
28
|
+
ngImport: i0
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
33
|
+
minVersion: "12.0.0",
|
|
34
|
+
version: "22.3.0",
|
|
35
|
+
ngImport: i0,
|
|
36
|
+
type: QueryOperatorDirective,
|
|
37
|
+
decorators: [{
|
|
38
|
+
type: Directive,
|
|
39
|
+
args: [{
|
|
40
|
+
selector: "[queryOperator]",
|
|
41
|
+
standalone: false
|
|
42
|
+
}]
|
|
43
|
+
}],
|
|
44
|
+
ctorParameters: () => [{ type: i0.TemplateRef }]
|
|
45
|
+
});
|
|
46
|
+
var QueryFieldDirective = class QueryFieldDirective {
|
|
47
|
+
constructor(template) {
|
|
48
|
+
this.template = template;
|
|
49
|
+
}
|
|
50
|
+
static {
|
|
51
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
52
|
+
minVersion: "12.0.0",
|
|
53
|
+
version: "22.3.0",
|
|
54
|
+
ngImport: i0,
|
|
55
|
+
type: QueryFieldDirective,
|
|
56
|
+
deps: [{ token: i0.TemplateRef }],
|
|
57
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
static {
|
|
61
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
62
|
+
minVersion: "14.0.0",
|
|
63
|
+
version: "22.3.0",
|
|
64
|
+
type: QueryFieldDirective,
|
|
65
|
+
isStandalone: false,
|
|
66
|
+
selector: "[queryField]",
|
|
67
|
+
ngImport: i0
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
72
|
+
minVersion: "12.0.0",
|
|
73
|
+
version: "22.3.0",
|
|
74
|
+
ngImport: i0,
|
|
75
|
+
type: QueryFieldDirective,
|
|
76
|
+
decorators: [{
|
|
77
|
+
type: Directive,
|
|
78
|
+
args: [{
|
|
79
|
+
selector: "[queryField]",
|
|
80
|
+
standalone: false
|
|
81
|
+
}]
|
|
82
|
+
}],
|
|
83
|
+
ctorParameters: () => [{ type: i0.TemplateRef }]
|
|
84
|
+
});
|
|
85
|
+
var QueryEntityDirective = class QueryEntityDirective {
|
|
86
|
+
constructor(template) {
|
|
87
|
+
this.template = template;
|
|
88
|
+
}
|
|
89
|
+
static {
|
|
90
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
91
|
+
minVersion: "12.0.0",
|
|
92
|
+
version: "22.3.0",
|
|
93
|
+
ngImport: i0,
|
|
94
|
+
type: QueryEntityDirective,
|
|
95
|
+
deps: [{ token: i0.TemplateRef }],
|
|
96
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
static {
|
|
100
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
101
|
+
minVersion: "14.0.0",
|
|
102
|
+
version: "22.3.0",
|
|
103
|
+
type: QueryEntityDirective,
|
|
104
|
+
isStandalone: false,
|
|
105
|
+
selector: "[queryEntity]",
|
|
106
|
+
ngImport: i0
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
111
|
+
minVersion: "12.0.0",
|
|
112
|
+
version: "22.3.0",
|
|
113
|
+
ngImport: i0,
|
|
114
|
+
type: QueryEntityDirective,
|
|
115
|
+
decorators: [{
|
|
116
|
+
type: Directive,
|
|
117
|
+
args: [{
|
|
118
|
+
selector: "[queryEntity]",
|
|
119
|
+
standalone: false
|
|
120
|
+
}]
|
|
121
|
+
}],
|
|
122
|
+
ctorParameters: () => [{ type: i0.TemplateRef }]
|
|
123
|
+
});
|
|
124
|
+
var QuerySwitchGroupDirective = class QuerySwitchGroupDirective {
|
|
125
|
+
constructor(template) {
|
|
126
|
+
this.template = template;
|
|
127
|
+
}
|
|
128
|
+
static {
|
|
129
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
130
|
+
minVersion: "12.0.0",
|
|
131
|
+
version: "22.3.0",
|
|
132
|
+
ngImport: i0,
|
|
133
|
+
type: QuerySwitchGroupDirective,
|
|
134
|
+
deps: [{ token: i0.TemplateRef }],
|
|
135
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
static {
|
|
139
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
140
|
+
minVersion: "14.0.0",
|
|
141
|
+
version: "22.3.0",
|
|
142
|
+
type: QuerySwitchGroupDirective,
|
|
143
|
+
isStandalone: false,
|
|
144
|
+
selector: "[querySwitchGroup]",
|
|
145
|
+
ngImport: i0
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
150
|
+
minVersion: "12.0.0",
|
|
151
|
+
version: "22.3.0",
|
|
152
|
+
ngImport: i0,
|
|
153
|
+
type: QuerySwitchGroupDirective,
|
|
154
|
+
decorators: [{
|
|
155
|
+
type: Directive,
|
|
156
|
+
args: [{
|
|
157
|
+
selector: "[querySwitchGroup]",
|
|
158
|
+
standalone: false
|
|
159
|
+
}]
|
|
160
|
+
}],
|
|
161
|
+
ctorParameters: () => [{ type: i0.TemplateRef }]
|
|
162
|
+
});
|
|
163
|
+
var QueryButtonGroupDirective = class QueryButtonGroupDirective {
|
|
164
|
+
constructor(template) {
|
|
165
|
+
this.template = template;
|
|
166
|
+
}
|
|
167
|
+
static {
|
|
168
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
169
|
+
minVersion: "12.0.0",
|
|
170
|
+
version: "22.3.0",
|
|
171
|
+
ngImport: i0,
|
|
172
|
+
type: QueryButtonGroupDirective,
|
|
173
|
+
deps: [{ token: i0.TemplateRef }],
|
|
174
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
static {
|
|
178
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
179
|
+
minVersion: "14.0.0",
|
|
180
|
+
version: "22.3.0",
|
|
181
|
+
type: QueryButtonGroupDirective,
|
|
182
|
+
isStandalone: false,
|
|
183
|
+
selector: "[queryButtonGroup]",
|
|
184
|
+
ngImport: i0
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
189
|
+
minVersion: "12.0.0",
|
|
190
|
+
version: "22.3.0",
|
|
191
|
+
ngImport: i0,
|
|
192
|
+
type: QueryButtonGroupDirective,
|
|
193
|
+
decorators: [{
|
|
194
|
+
type: Directive,
|
|
195
|
+
args: [{
|
|
196
|
+
selector: "[queryButtonGroup]",
|
|
197
|
+
standalone: false
|
|
198
|
+
}]
|
|
199
|
+
}],
|
|
200
|
+
ctorParameters: () => [{ type: i0.TemplateRef }]
|
|
201
|
+
});
|
|
202
|
+
var QueryInputDirective = class QueryInputDirective {
|
|
203
|
+
get queryInputType() {
|
|
204
|
+
return this._type;
|
|
205
|
+
}
|
|
206
|
+
set queryInputType(value) {
|
|
207
|
+
if (!value) return;
|
|
208
|
+
this._type = value;
|
|
209
|
+
}
|
|
210
|
+
constructor(template) {
|
|
211
|
+
this.template = template;
|
|
212
|
+
}
|
|
213
|
+
static {
|
|
214
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
215
|
+
minVersion: "12.0.0",
|
|
216
|
+
version: "22.3.0",
|
|
217
|
+
ngImport: i0,
|
|
218
|
+
type: QueryInputDirective,
|
|
219
|
+
deps: [{ token: i0.TemplateRef }],
|
|
220
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
static {
|
|
224
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
225
|
+
minVersion: "14.0.0",
|
|
226
|
+
version: "22.3.0",
|
|
227
|
+
type: QueryInputDirective,
|
|
228
|
+
isStandalone: false,
|
|
229
|
+
selector: "[queryInput]",
|
|
230
|
+
inputs: { queryInputType: "queryInputType" },
|
|
231
|
+
ngImport: i0
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
236
|
+
minVersion: "12.0.0",
|
|
237
|
+
version: "22.3.0",
|
|
238
|
+
ngImport: i0,
|
|
239
|
+
type: QueryInputDirective,
|
|
240
|
+
decorators: [{
|
|
241
|
+
type: Directive,
|
|
242
|
+
args: [{
|
|
243
|
+
selector: "[queryInput]",
|
|
244
|
+
standalone: false
|
|
245
|
+
}]
|
|
246
|
+
}],
|
|
247
|
+
ctorParameters: () => [{ type: i0.TemplateRef }],
|
|
248
|
+
propDecorators: { queryInputType: [{ type: Input }] }
|
|
249
|
+
});
|
|
250
|
+
var QueryRemoveButtonDirective = class QueryRemoveButtonDirective {
|
|
251
|
+
constructor(template) {
|
|
252
|
+
this.template = template;
|
|
253
|
+
}
|
|
254
|
+
static {
|
|
255
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
256
|
+
minVersion: "12.0.0",
|
|
257
|
+
version: "22.3.0",
|
|
258
|
+
ngImport: i0,
|
|
259
|
+
type: QueryRemoveButtonDirective,
|
|
260
|
+
deps: [{ token: i0.TemplateRef }],
|
|
261
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
static {
|
|
265
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
266
|
+
minVersion: "14.0.0",
|
|
267
|
+
version: "22.3.0",
|
|
268
|
+
type: QueryRemoveButtonDirective,
|
|
269
|
+
isStandalone: false,
|
|
270
|
+
selector: "[queryRemoveButton]",
|
|
271
|
+
ngImport: i0
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
276
|
+
minVersion: "12.0.0",
|
|
277
|
+
version: "22.3.0",
|
|
278
|
+
ngImport: i0,
|
|
279
|
+
type: QueryRemoveButtonDirective,
|
|
280
|
+
decorators: [{
|
|
281
|
+
type: Directive,
|
|
282
|
+
args: [{
|
|
283
|
+
selector: "[queryRemoveButton]",
|
|
284
|
+
standalone: false
|
|
285
|
+
}]
|
|
286
|
+
}],
|
|
287
|
+
ctorParameters: () => [{ type: i0.TemplateRef }]
|
|
288
|
+
});
|
|
289
|
+
var QueryEmptyWarningDirective = class QueryEmptyWarningDirective {
|
|
290
|
+
constructor(template) {
|
|
291
|
+
this.template = template;
|
|
292
|
+
}
|
|
293
|
+
static {
|
|
294
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
295
|
+
minVersion: "12.0.0",
|
|
296
|
+
version: "22.3.0",
|
|
297
|
+
ngImport: i0,
|
|
298
|
+
type: QueryEmptyWarningDirective,
|
|
299
|
+
deps: [{ token: i0.TemplateRef }],
|
|
300
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
static {
|
|
304
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
305
|
+
minVersion: "14.0.0",
|
|
306
|
+
version: "22.3.0",
|
|
307
|
+
type: QueryEmptyWarningDirective,
|
|
308
|
+
isStandalone: false,
|
|
309
|
+
selector: "[queryEmptyWarning]",
|
|
310
|
+
ngImport: i0
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
315
|
+
minVersion: "12.0.0",
|
|
316
|
+
version: "22.3.0",
|
|
317
|
+
ngImport: i0,
|
|
318
|
+
type: QueryEmptyWarningDirective,
|
|
319
|
+
decorators: [{
|
|
320
|
+
type: Directive,
|
|
321
|
+
args: [{
|
|
322
|
+
selector: "[queryEmptyWarning]",
|
|
323
|
+
standalone: false
|
|
324
|
+
}]
|
|
325
|
+
}],
|
|
326
|
+
ctorParameters: () => [{ type: i0.TemplateRef }]
|
|
327
|
+
});
|
|
328
|
+
var QueryArrowIconDirective = class QueryArrowIconDirective {
|
|
329
|
+
constructor(template) {
|
|
330
|
+
this.template = template;
|
|
331
|
+
}
|
|
332
|
+
static {
|
|
333
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
334
|
+
minVersion: "12.0.0",
|
|
335
|
+
version: "22.3.0",
|
|
336
|
+
ngImport: i0,
|
|
337
|
+
type: QueryArrowIconDirective,
|
|
338
|
+
deps: [{ token: i0.TemplateRef }],
|
|
339
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
static {
|
|
343
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
344
|
+
minVersion: "14.0.0",
|
|
345
|
+
version: "22.3.0",
|
|
346
|
+
type: QueryArrowIconDirective,
|
|
347
|
+
isStandalone: false,
|
|
348
|
+
selector: "[queryArrowIcon]",
|
|
349
|
+
ngImport: i0
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
354
|
+
minVersion: "12.0.0",
|
|
355
|
+
version: "22.3.0",
|
|
356
|
+
ngImport: i0,
|
|
357
|
+
type: QueryArrowIconDirective,
|
|
358
|
+
decorators: [{
|
|
359
|
+
type: Directive,
|
|
360
|
+
args: [{
|
|
361
|
+
selector: "[queryArrowIcon]",
|
|
362
|
+
standalone: false
|
|
363
|
+
}]
|
|
364
|
+
}],
|
|
365
|
+
ctorParameters: () => [{ type: i0.TemplateRef }]
|
|
366
|
+
});
|
|
157
367
|
const CONTROL_VALUE_ACCESSOR = {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
368
|
+
provide: NG_VALUE_ACCESSOR,
|
|
369
|
+
useExisting: forwardRef(() => QueryBuilderComponent),
|
|
370
|
+
multi: true
|
|
161
371
|
};
|
|
162
372
|
const VALIDATOR = {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
373
|
+
provide: NG_VALIDATORS,
|
|
374
|
+
useExisting: forwardRef(() => QueryBuilderComponent),
|
|
375
|
+
multi: true
|
|
166
376
|
};
|
|
167
|
-
class QueryBuilderComponent {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
if (this.onTouchedCallback) {
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.35", type: QueryBuilderComponent, isStandalone: false, selector: "query-builder", inputs: { disabled: "disabled", data: "data", allowRuleset: "allowRuleset", allowCollapse: "allowCollapse", emptyMessage: "emptyMessage", classNames: "classNames", operatorMap: "operatorMap", parentValue: "parentValue", config: "config", parentArrowIconTemplate: "parentArrowIconTemplate", parentInputTemplates: "parentInputTemplates", parentOperatorTemplate: "parentOperatorTemplate", parentFieldTemplate: "parentFieldTemplate", parentEntityTemplate: "parentEntityTemplate", parentSwitchGroupTemplate: "parentSwitchGroupTemplate", parentButtonGroupTemplate: "parentButtonGroupTemplate", parentRemoveButtonTemplate: "parentRemoveButtonTemplate", parentEmptyWarningTemplate: "parentEmptyWarningTemplate", parentChangeCallback: "parentChangeCallback", parentTouchedCallback: "parentTouchedCallback", persistValueOnFieldChange: "persistValueOnFieldChange", value: "value" }, host: { properties: { "attr.query-builder-condition": "this.condition" } }, providers: [CONTROL_VALUE_ACCESSOR, VALIDATOR], queries: [{ propertyName: "buttonGroupTemplate", first: true, predicate: QueryButtonGroupDirective, descendants: true }, { propertyName: "switchGroupTemplate", first: true, predicate: QuerySwitchGroupDirective, descendants: true }, { propertyName: "fieldTemplate", first: true, predicate: QueryFieldDirective, descendants: true }, { propertyName: "entityTemplate", first: true, predicate: QueryEntityDirective, descendants: true }, { propertyName: "operatorTemplate", first: true, predicate: QueryOperatorDirective, descendants: true }, { propertyName: "removeButtonTemplate", first: true, predicate: QueryRemoveButtonDirective, descendants: true }, { propertyName: "emptyWarningTemplate", first: true, predicate: QueryEmptyWarningDirective, descendants: true }, { propertyName: "arrowIconTemplate", first: true, predicate: QueryArrowIconDirective, descendants: true }, { propertyName: "inputTemplates", predicate: QueryInputDirective, descendants: true }], viewQueries: [{ propertyName: "treeContainer", first: true, predicate: ["treeContainer"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div [ngClass]=\"getClassNames('switchRow')\">\n <ng-template #defaultArrowIcon>\n <i [ngClass]=\"getClassNames('arrowIcon')\"></i>\n </ng-template>\n\n <a\n *ngIf=\"allowCollapse\"\n (click)=\"toggleCollapse()\"\n [ngClass]=\"getClassNames('arrowIconButton', data.collapsed ? 'collapsed' : '')\"\n >\n <ng-container *ngIf=\"getArrowIconTemplate() as template; else defaultArrowIcon\">\n <ng-container *ngTemplateOutlet=\"template; context: getArrowIconContext()\"></ng-container>\n </ng-container>\n </a>\n\n <ng-container *ngIf=\"getButtonGroupTemplate() as template; else defaultButtonGroup\">\n <div [ngClass]=\"getClassNames('buttonGroup', 'rightAlign')\">\n <ng-container *ngTemplateOutlet=\"template; context: getButtonGroupContext()\"></ng-container>\n </div>\n </ng-container>\n\n <ng-template #defaultButtonGroup>\n <div [ngClass]=\"getClassNames('buttonGroup', 'rightAlign')\">\n <button\n type=\"button\"\n (click)=\"addRule()\"\n [ngClass]=\"getClassNames('button')\"\n [disabled]=\"disabled\"\n >\n <i [ngClass]=\"getClassNames('addIcon')\"></i> Rule\n </button>\n <button\n type=\"button\"\n (click)=\"addRuleSet()\"\n [ngClass]=\"getClassNames('button')\"\n *ngIf=\"allowRuleset\"\n [disabled]=\"disabled\"\n >\n <i [ngClass]=\"getClassNames('addIcon')\"></i> Ruleset\n </button>\n <ng-container *ngIf=\"!!parentValue && allowRuleset\">\n <button\n type=\"button\"\n (click)=\"removeRuleSet()\"\n [ngClass]=\"getClassNames('button', 'removeButton')\"\n [disabled]=\"disabled\"\n >\n <i [ngClass]=\"getClassNames('removeIcon')\"></i>\n </button>\n </ng-container>\n </div>\n </ng-template>\n\n <ng-container *ngIf=\"getSwitchGroupTemplate() as template; else defaultSwitchGroup\">\n <ng-container *ngTemplateOutlet=\"template; context: getSwitchGroupContext()\"></ng-container>\n </ng-container>\n\n <ng-template #defaultSwitchGroup>\n <div [ngClass]=\"getClassNames('switchGroup', 'transition')\" *ngIf=\"data\">\n <div [ngClass]=\"getClassNames('switchControl')\">\n <input\n type=\"radio\"\n [ngClass]=\"getClassNames('switchRadio')\"\n [(ngModel)]=\"data.condition\"\n [disabled]=\"disabled\"\n value=\"and\"\n #andOption\n />\n <label (click)=\"changeCondition(andOption.value)\" [ngClass]=\"getClassNames('switchLabel')\"\n >AND</label\n >\n </div>\n <div [ngClass]=\"getClassNames('switchControl')\">\n <input\n type=\"radio\"\n [ngClass]=\"getClassNames('switchRadio')\"\n [(ngModel)]=\"data.condition\"\n [disabled]=\"disabled\"\n value=\"or\"\n #orOption\n />\n <label (click)=\"changeCondition(orOption.value)\" [ngClass]=\"getClassNames('switchLabel')\"\n >OR</label\n >\n </div>\n </div>\n </ng-template>\n</div>\n\n<div\n #treeContainer\n (transitionend)=\"transitionEnd($event)\"\n [ngClass]=\"getClassNames('treeContainer', data.collapsed ? 'collapsed' : '')\"\n>\n <ul [ngClass]=\"getClassNames('tree')\" *ngIf=\"data && data.rules\">\n <ng-container *ngFor=\"let rule of data.rules; let i = index\">\n <ng-container\n *ngIf=\"{\n ruleset: !!rule.rules,\n invalid: !config.allowEmptyRulesets && rule.rules && rule.rules.length === 0\n } as local\"\n >\n <li [ngClass]=\"getQueryItemClassName(local)\">\n <ng-container *ngIf=\"!local.ruleset\">\n <ng-container *ngIf=\"getRemoveButtonTemplate() as template; else defaultRemoveButton\">\n <div [ngClass]=\"getClassNames('buttonGroup', 'rightAlign')\">\n <ng-container\n *ngTemplateOutlet=\"template; context: getRemoveButtonContext(rule)\"\n ></ng-container>\n </div>\n </ng-container>\n\n <ng-template #defaultRemoveButton>\n <div [ngClass]=\"getClassNames('removeButtonSize', 'rightAlign')\">\n <button\n type=\"button\"\n [ngClass]=\"getClassNames('button', 'removeButton')\"\n (click)=\"removeRule(rule, data)\"\n [disabled]=\"disabled\"\n >\n <i [ngClass]=\"getClassNames('removeIcon')\"></i>\n </button>\n </div>\n </ng-template>\n\n <div *ngIf=\"entities?.length\" class=\"q-inline-block-display\">\n <ng-container *ngIf=\"getEntityTemplate() as template; else defaultEntity\">\n <ng-container\n *ngTemplateOutlet=\"template; context: getEntityContext(rule)\"\n ></ng-container>\n </ng-container>\n </div>\n\n <ng-template #defaultEntity>\n <div [ngClass]=\"getClassNames('entityControlSize')\">\n <select\n [ngClass]=\"getClassNames('entityControl')\"\n [(ngModel)]=\"rule.entity\"\n (ngModelChange)=\"changeEntity($event, rule, i, data)\"\n [disabled]=\"disabled\"\n >\n <option *ngFor=\"let entity of entities\" [ngValue]=\"entity.value\">\n {{ entity.name }}\n </option>\n </select>\n </div>\n </ng-template>\n\n <ng-container *ngIf=\"getFieldTemplate() as template; else defaultField\">\n <ng-container\n *ngTemplateOutlet=\"template; context: getFieldContext(rule)\"\n ></ng-container>\n </ng-container>\n\n <ng-template #defaultField>\n <div [ngClass]=\"getClassNames('fieldControlSize')\">\n <select\n [ngClass]=\"getClassNames('fieldControl')\"\n [(ngModel)]=\"rule.field\"\n (ngModelChange)=\"changeField($event, rule)\"\n [disabled]=\"disabled\"\n >\n <option *ngFor=\"let field of getFields(rule.entity)\" [ngValue]=\"field.value\">\n {{ field.name }}\n </option>\n </select>\n </div>\n </ng-template>\n\n <ng-container *ngIf=\"getOperatorTemplate() as template; else defaultOperator\">\n <ng-container\n *ngTemplateOutlet=\"template; context: getOperatorContext(rule)\"\n ></ng-container>\n </ng-container>\n\n <ng-template #defaultOperator>\n <div [ngClass]=\"getClassNames('operatorControlSize')\">\n <select\n [ngClass]=\"getClassNames('operatorControl')\"\n [(ngModel)]=\"rule.operator\"\n (ngModelChange)=\"changeOperator(rule)\"\n [disabled]=\"disabled\"\n >\n <option *ngFor=\"let operator of getOperators(rule.field)\" [ngValue]=\"operator\">\n {{ operator }}\n </option>\n </select>\n </div>\n </ng-template>\n\n <ng-container *ngIf=\"findTemplateForRule(rule) as template; else defaultInput\">\n <ng-container\n *ngTemplateOutlet=\"template; context: getInputContext(rule)\"\n ></ng-container>\n </ng-container>\n\n <ng-template #defaultInput>\n <div\n [ngClass]=\"getClassNames('inputControlSize')\"\n [ngSwitch]=\"getInputType(rule.field, rule.operator)\"\n >\n <input\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n *ngSwitchCase=\"'string'\"\n type=\"text\"\n />\n <input\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n *ngSwitchCase=\"'number'\"\n type=\"number\"\n />\n <input\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n *ngSwitchCase=\"'date'\"\n type=\"date\"\n />\n <input\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n *ngSwitchCase=\"'time'\"\n type=\"time\"\n />\n <select\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n *ngSwitchCase=\"'category'\"\n >\n <option *ngFor=\"let opt of getOptions(rule.field)\" [ngValue]=\"opt.value\">\n {{ opt.name }}\n </option>\n </select>\n <ng-container *ngSwitchCase=\"'multiselect'\">\n <select\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n multiple\n >\n <option *ngFor=\"let opt of getOptions(rule.field)\" [ngValue]=\"opt.value\">\n {{ opt.name }}\n </option>\n </select>\n </ng-container>\n <input\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n *ngSwitchCase=\"'boolean'\"\n type=\"checkbox\"\n />\n </div>\n </ng-template>\n </ng-container>\n <query-builder\n *ngIf=\"local.ruleset\"\n [data]=\"rule\"\n [disabled]=\"disabled\"\n [parentTouchedCallback]=\"parentTouchedCallback || onTouchedCallback\"\n [parentChangeCallback]=\"parentChangeCallback || onChangeCallback\"\n [parentInputTemplates]=\"parentInputTemplates || inputTemplates\"\n [parentOperatorTemplate]=\"parentOperatorTemplate || operatorTemplate\"\n [parentFieldTemplate]=\"parentFieldTemplate || fieldTemplate\"\n [parentEntityTemplate]=\"parentEntityTemplate || entityTemplate\"\n [parentSwitchGroupTemplate]=\"parentSwitchGroupTemplate || switchGroupTemplate\"\n [parentButtonGroupTemplate]=\"parentButtonGroupTemplate || buttonGroupTemplate\"\n [parentRemoveButtonTemplate]=\"parentRemoveButtonTemplate || removeButtonTemplate\"\n [parentEmptyWarningTemplate]=\"parentEmptyWarningTemplate || emptyWarningTemplate\"\n [parentArrowIconTemplate]=\"parentArrowIconTemplate || arrowIconTemplate\"\n [parentValue]=\"data\"\n [classNames]=\"classNames\"\n [config]=\"config\"\n [allowRuleset]=\"allowRuleset\"\n [allowCollapse]=\"allowCollapse\"\n [emptyMessage]=\"emptyMessage\"\n [operatorMap]=\"operatorMap\"\n >\n </query-builder>\n\n <ng-container *ngIf=\"getEmptyWarningTemplate() as template; else defaultEmptyWarning\">\n <ng-container *ngIf=\"local.invalid\">\n <ng-container\n *ngTemplateOutlet=\"template; context: getEmptyWarningContext()\"\n ></ng-container>\n </ng-container>\n </ng-container>\n\n <ng-template #defaultEmptyWarning>\n <p [ngClass]=\"getClassNames('emptyWarning')\" *ngIf=\"local.invalid\">\n {{ emptyMessage }}\n </p>\n </ng-template>\n </li>\n </ng-container>\n </ng-container>\n </ul>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block;width:100%}:host .q-icon{font-style:normal;font-size:12px}:host .q-remove-icon:before{content:\"\\274c\"}:host .q-arrow-icon-button{float:left;margin:4px 6px 4px 0;transform:rotate(90deg);transition:linear .25s transform;cursor:pointer}:host .q-arrow-icon-button.q-collapsed{transform:rotate(0)}:host .q-arrow-icon:before{content:\"\\25b6\"}:host .q-add-icon{color:#555}:host .q-add-icon:before{content:\"\\2795\"}:host .q-remove-button{color:#b3415d;width:31px}:host .q-switch-group,:host .q-button-group{font-family:Lucida Grande,Tahoma,Verdana,sans-serif;overflow:hidden}:host .q-right-align{float:right}:host .q-button{margin-left:8px;padding:0 8px;background-color:#fff}:host .q-button:disabled{display:none}:host .q-control-size{display:inline-block;vertical-align:top;padding-right:10px}:host .q-input-control,:host .q-operator-control,:host .q-field-control,:host .q-entity-control{display:inline-block;padding:5px 8px;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;box-sizing:border-box;width:auto;min-width:180px}:host .q-input-control:disabled,:host .q-operator-control:disabled,:host .q-field-control:disabled,:host .q-entity-control:disabled{border-color:transparent}:host .q-operator-control,:host .q-field-control,:host .q-entity-control,:host .q-input-control:not([type=checkbox]){min-height:32px;-webkit-appearance:none}:host .q-switch-label,:host .q-button{float:left;margin-bottom:0;font-size:14px;line-height:30px;font-weight:400;text-align:center;text-shadow:none;border:1px solid rgba(0,0,0,.2);box-sizing:border-box}:host .q-switch-label:hover,:host .q-button:hover{cursor:pointer;background-color:#f0f0f0}:host .q-switch-label{background-color:#e4e4e4;padding:0 8px}:host .q-switch-radio{position:absolute;clip:rect(0,0,0,0);height:1px;width:1px;border:0;overflow:hidden}:host .q-switch-radio:checked+.q-switch-label{border:1px solid rgb(97,158,215);background:#fff;color:#3176b3}:host .q-switch-radio:disabled+.q-switch-label{display:none}:host .q-switch-radio:checked:disabled+.q-switch-label{display:initial;color:initial;cursor:default;border-color:transparent}:host .q-invalid-ruleset{border:1px solid rgba(179,65,93,.5)!important;background:#b3415d1a!important}:host .q-empty-warning{color:#8d252e;text-align:center}:host .q-ruleset{border:1px solid #ccc}:host .q-rule{border:1px solid #ccc;background:#fff}:host .q-transition{-webkit-transition:all .1s ease-in-out;-moz-transition:all .1s ease-in-out;-ms-transition:all .1s ease-in-out;-o-transition:all .1s ease-in-out;transition:all .1s ease-in-out}:host .q-tree-container{width:100%;overflow:hidden;transition:ease-in .25s max-height}:host .q-tree-container.q-collapsed{max-height:0!important}:host .q-tree{list-style:none;margin:4px 0 2px}:host .q-row{padding:6px 8px;margin-top:6px}:host .q-connector{position:relative}:host .q-connector:before{top:-5px;border-width:0 0 2px 2px}:host .q-connector:after{border-width:0 0 0 2px;top:50%}:host .q-connector:before,:host .q-connector:after{content:\"\";left:-12px;border-color:#ccc;border-style:solid;width:9px;height:calc(50% + 6px);position:absolute}:host .q-connector:last-child:after{content:none}:host .q-inline-block-display{display:inline-block;vertical-align:top}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: QueryBuilderComponent, selector: "query-builder", inputs: ["disabled", "data", "allowRuleset", "allowCollapse", "emptyMessage", "classNames", "operatorMap", "parentValue", "config", "parentArrowIconTemplate", "parentInputTemplates", "parentOperatorTemplate", "parentFieldTemplate", "parentEntityTemplate", "parentSwitchGroupTemplate", "parentButtonGroupTemplate", "parentRemoveButtonTemplate", "parentEmptyWarningTemplate", "parentChangeCallback", "parentTouchedCallback", "persistValueOnFieldChange", "value"] }] }); }
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
args: [{ selector: "query-builder", providers: [CONTROL_VALUE_ACCESSOR, VALIDATOR], standalone: false, template: "<div [ngClass]=\"getClassNames('switchRow')\">\n <ng-template #defaultArrowIcon>\n <i [ngClass]=\"getClassNames('arrowIcon')\"></i>\n </ng-template>\n\n <a\n *ngIf=\"allowCollapse\"\n (click)=\"toggleCollapse()\"\n [ngClass]=\"getClassNames('arrowIconButton', data.collapsed ? 'collapsed' : '')\"\n >\n <ng-container *ngIf=\"getArrowIconTemplate() as template; else defaultArrowIcon\">\n <ng-container *ngTemplateOutlet=\"template; context: getArrowIconContext()\"></ng-container>\n </ng-container>\n </a>\n\n <ng-container *ngIf=\"getButtonGroupTemplate() as template; else defaultButtonGroup\">\n <div [ngClass]=\"getClassNames('buttonGroup', 'rightAlign')\">\n <ng-container *ngTemplateOutlet=\"template; context: getButtonGroupContext()\"></ng-container>\n </div>\n </ng-container>\n\n <ng-template #defaultButtonGroup>\n <div [ngClass]=\"getClassNames('buttonGroup', 'rightAlign')\">\n <button\n type=\"button\"\n (click)=\"addRule()\"\n [ngClass]=\"getClassNames('button')\"\n [disabled]=\"disabled\"\n >\n <i [ngClass]=\"getClassNames('addIcon')\"></i> Rule\n </button>\n <button\n type=\"button\"\n (click)=\"addRuleSet()\"\n [ngClass]=\"getClassNames('button')\"\n *ngIf=\"allowRuleset\"\n [disabled]=\"disabled\"\n >\n <i [ngClass]=\"getClassNames('addIcon')\"></i> Ruleset\n </button>\n <ng-container *ngIf=\"!!parentValue && allowRuleset\">\n <button\n type=\"button\"\n (click)=\"removeRuleSet()\"\n [ngClass]=\"getClassNames('button', 'removeButton')\"\n [disabled]=\"disabled\"\n >\n <i [ngClass]=\"getClassNames('removeIcon')\"></i>\n </button>\n </ng-container>\n </div>\n </ng-template>\n\n <ng-container *ngIf=\"getSwitchGroupTemplate() as template; else defaultSwitchGroup\">\n <ng-container *ngTemplateOutlet=\"template; context: getSwitchGroupContext()\"></ng-container>\n </ng-container>\n\n <ng-template #defaultSwitchGroup>\n <div [ngClass]=\"getClassNames('switchGroup', 'transition')\" *ngIf=\"data\">\n <div [ngClass]=\"getClassNames('switchControl')\">\n <input\n type=\"radio\"\n [ngClass]=\"getClassNames('switchRadio')\"\n [(ngModel)]=\"data.condition\"\n [disabled]=\"disabled\"\n value=\"and\"\n #andOption\n />\n <label (click)=\"changeCondition(andOption.value)\" [ngClass]=\"getClassNames('switchLabel')\"\n >AND</label\n >\n </div>\n <div [ngClass]=\"getClassNames('switchControl')\">\n <input\n type=\"radio\"\n [ngClass]=\"getClassNames('switchRadio')\"\n [(ngModel)]=\"data.condition\"\n [disabled]=\"disabled\"\n value=\"or\"\n #orOption\n />\n <label (click)=\"changeCondition(orOption.value)\" [ngClass]=\"getClassNames('switchLabel')\"\n >OR</label\n >\n </div>\n </div>\n </ng-template>\n</div>\n\n<div\n #treeContainer\n (transitionend)=\"transitionEnd($event)\"\n [ngClass]=\"getClassNames('treeContainer', data.collapsed ? 'collapsed' : '')\"\n>\n <ul [ngClass]=\"getClassNames('tree')\" *ngIf=\"data && data.rules\">\n <ng-container *ngFor=\"let rule of data.rules; let i = index\">\n <ng-container\n *ngIf=\"{\n ruleset: !!rule.rules,\n invalid: !config.allowEmptyRulesets && rule.rules && rule.rules.length === 0\n } as local\"\n >\n <li [ngClass]=\"getQueryItemClassName(local)\">\n <ng-container *ngIf=\"!local.ruleset\">\n <ng-container *ngIf=\"getRemoveButtonTemplate() as template; else defaultRemoveButton\">\n <div [ngClass]=\"getClassNames('buttonGroup', 'rightAlign')\">\n <ng-container\n *ngTemplateOutlet=\"template; context: getRemoveButtonContext(rule)\"\n ></ng-container>\n </div>\n </ng-container>\n\n <ng-template #defaultRemoveButton>\n <div [ngClass]=\"getClassNames('removeButtonSize', 'rightAlign')\">\n <button\n type=\"button\"\n [ngClass]=\"getClassNames('button', 'removeButton')\"\n (click)=\"removeRule(rule, data)\"\n [disabled]=\"disabled\"\n >\n <i [ngClass]=\"getClassNames('removeIcon')\"></i>\n </button>\n </div>\n </ng-template>\n\n <div *ngIf=\"entities?.length\" class=\"q-inline-block-display\">\n <ng-container *ngIf=\"getEntityTemplate() as template; else defaultEntity\">\n <ng-container\n *ngTemplateOutlet=\"template; context: getEntityContext(rule)\"\n ></ng-container>\n </ng-container>\n </div>\n\n <ng-template #defaultEntity>\n <div [ngClass]=\"getClassNames('entityControlSize')\">\n <select\n [ngClass]=\"getClassNames('entityControl')\"\n [(ngModel)]=\"rule.entity\"\n (ngModelChange)=\"changeEntity($event, rule, i, data)\"\n [disabled]=\"disabled\"\n >\n <option *ngFor=\"let entity of entities\" [ngValue]=\"entity.value\">\n {{ entity.name }}\n </option>\n </select>\n </div>\n </ng-template>\n\n <ng-container *ngIf=\"getFieldTemplate() as template; else defaultField\">\n <ng-container\n *ngTemplateOutlet=\"template; context: getFieldContext(rule)\"\n ></ng-container>\n </ng-container>\n\n <ng-template #defaultField>\n <div [ngClass]=\"getClassNames('fieldControlSize')\">\n <select\n [ngClass]=\"getClassNames('fieldControl')\"\n [(ngModel)]=\"rule.field\"\n (ngModelChange)=\"changeField($event, rule)\"\n [disabled]=\"disabled\"\n >\n <option *ngFor=\"let field of getFields(rule.entity)\" [ngValue]=\"field.value\">\n {{ field.name }}\n </option>\n </select>\n </div>\n </ng-template>\n\n <ng-container *ngIf=\"getOperatorTemplate() as template; else defaultOperator\">\n <ng-container\n *ngTemplateOutlet=\"template; context: getOperatorContext(rule)\"\n ></ng-container>\n </ng-container>\n\n <ng-template #defaultOperator>\n <div [ngClass]=\"getClassNames('operatorControlSize')\">\n <select\n [ngClass]=\"getClassNames('operatorControl')\"\n [(ngModel)]=\"rule.operator\"\n (ngModelChange)=\"changeOperator(rule)\"\n [disabled]=\"disabled\"\n >\n <option *ngFor=\"let operator of getOperators(rule.field)\" [ngValue]=\"operator\">\n {{ operator }}\n </option>\n </select>\n </div>\n </ng-template>\n\n <ng-container *ngIf=\"findTemplateForRule(rule) as template; else defaultInput\">\n <ng-container\n *ngTemplateOutlet=\"template; context: getInputContext(rule)\"\n ></ng-container>\n </ng-container>\n\n <ng-template #defaultInput>\n <div\n [ngClass]=\"getClassNames('inputControlSize')\"\n [ngSwitch]=\"getInputType(rule.field, rule.operator)\"\n >\n <input\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n *ngSwitchCase=\"'string'\"\n type=\"text\"\n />\n <input\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n *ngSwitchCase=\"'number'\"\n type=\"number\"\n />\n <input\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n *ngSwitchCase=\"'date'\"\n type=\"date\"\n />\n <input\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n *ngSwitchCase=\"'time'\"\n type=\"time\"\n />\n <select\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n *ngSwitchCase=\"'category'\"\n >\n <option *ngFor=\"let opt of getOptions(rule.field)\" [ngValue]=\"opt.value\">\n {{ opt.name }}\n </option>\n </select>\n <ng-container *ngSwitchCase=\"'multiselect'\">\n <select\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n multiple\n >\n <option *ngFor=\"let opt of getOptions(rule.field)\" [ngValue]=\"opt.value\">\n {{ opt.name }}\n </option>\n </select>\n </ng-container>\n <input\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n *ngSwitchCase=\"'boolean'\"\n type=\"checkbox\"\n />\n </div>\n </ng-template>\n </ng-container>\n <query-builder\n *ngIf=\"local.ruleset\"\n [data]=\"rule\"\n [disabled]=\"disabled\"\n [parentTouchedCallback]=\"parentTouchedCallback || onTouchedCallback\"\n [parentChangeCallback]=\"parentChangeCallback || onChangeCallback\"\n [parentInputTemplates]=\"parentInputTemplates || inputTemplates\"\n [parentOperatorTemplate]=\"parentOperatorTemplate || operatorTemplate\"\n [parentFieldTemplate]=\"parentFieldTemplate || fieldTemplate\"\n [parentEntityTemplate]=\"parentEntityTemplate || entityTemplate\"\n [parentSwitchGroupTemplate]=\"parentSwitchGroupTemplate || switchGroupTemplate\"\n [parentButtonGroupTemplate]=\"parentButtonGroupTemplate || buttonGroupTemplate\"\n [parentRemoveButtonTemplate]=\"parentRemoveButtonTemplate || removeButtonTemplate\"\n [parentEmptyWarningTemplate]=\"parentEmptyWarningTemplate || emptyWarningTemplate\"\n [parentArrowIconTemplate]=\"parentArrowIconTemplate || arrowIconTemplate\"\n [parentValue]=\"data\"\n [classNames]=\"classNames\"\n [config]=\"config\"\n [allowRuleset]=\"allowRuleset\"\n [allowCollapse]=\"allowCollapse\"\n [emptyMessage]=\"emptyMessage\"\n [operatorMap]=\"operatorMap\"\n >\n </query-builder>\n\n <ng-container *ngIf=\"getEmptyWarningTemplate() as template; else defaultEmptyWarning\">\n <ng-container *ngIf=\"local.invalid\">\n <ng-container\n *ngTemplateOutlet=\"template; context: getEmptyWarningContext()\"\n ></ng-container>\n </ng-container>\n </ng-container>\n\n <ng-template #defaultEmptyWarning>\n <p [ngClass]=\"getClassNames('emptyWarning')\" *ngIf=\"local.invalid\">\n {{ emptyMessage }}\n </p>\n </ng-template>\n </li>\n </ng-container>\n </ng-container>\n </ul>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block;width:100%}:host .q-icon{font-style:normal;font-size:12px}:host .q-remove-icon:before{content:\"\\274c\"}:host .q-arrow-icon-button{float:left;margin:4px 6px 4px 0;transform:rotate(90deg);transition:linear .25s transform;cursor:pointer}:host .q-arrow-icon-button.q-collapsed{transform:rotate(0)}:host .q-arrow-icon:before{content:\"\\25b6\"}:host .q-add-icon{color:#555}:host .q-add-icon:before{content:\"\\2795\"}:host .q-remove-button{color:#b3415d;width:31px}:host .q-switch-group,:host .q-button-group{font-family:Lucida Grande,Tahoma,Verdana,sans-serif;overflow:hidden}:host .q-right-align{float:right}:host .q-button{margin-left:8px;padding:0 8px;background-color:#fff}:host .q-button:disabled{display:none}:host .q-control-size{display:inline-block;vertical-align:top;padding-right:10px}:host .q-input-control,:host .q-operator-control,:host .q-field-control,:host .q-entity-control{display:inline-block;padding:5px 8px;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;box-sizing:border-box;width:auto;min-width:180px}:host .q-input-control:disabled,:host .q-operator-control:disabled,:host .q-field-control:disabled,:host .q-entity-control:disabled{border-color:transparent}:host .q-operator-control,:host .q-field-control,:host .q-entity-control,:host .q-input-control:not([type=checkbox]){min-height:32px;-webkit-appearance:none}:host .q-switch-label,:host .q-button{float:left;margin-bottom:0;font-size:14px;line-height:30px;font-weight:400;text-align:center;text-shadow:none;border:1px solid rgba(0,0,0,.2);box-sizing:border-box}:host .q-switch-label:hover,:host .q-button:hover{cursor:pointer;background-color:#f0f0f0}:host .q-switch-label{background-color:#e4e4e4;padding:0 8px}:host .q-switch-radio{position:absolute;clip:rect(0,0,0,0);height:1px;width:1px;border:0;overflow:hidden}:host .q-switch-radio:checked+.q-switch-label{border:1px solid rgb(97,158,215);background:#fff;color:#3176b3}:host .q-switch-radio:disabled+.q-switch-label{display:none}:host .q-switch-radio:checked:disabled+.q-switch-label{display:initial;color:initial;cursor:default;border-color:transparent}:host .q-invalid-ruleset{border:1px solid rgba(179,65,93,.5)!important;background:#b3415d1a!important}:host .q-empty-warning{color:#8d252e;text-align:center}:host .q-ruleset{border:1px solid #ccc}:host .q-rule{border:1px solid #ccc;background:#fff}:host .q-transition{-webkit-transition:all .1s ease-in-out;-moz-transition:all .1s ease-in-out;-ms-transition:all .1s ease-in-out;-o-transition:all .1s ease-in-out;transition:all .1s ease-in-out}:host .q-tree-container{width:100%;overflow:hidden;transition:ease-in .25s max-height}:host .q-tree-container.q-collapsed{max-height:0!important}:host .q-tree{list-style:none;margin:4px 0 2px}:host .q-row{padding:6px 8px;margin-top:6px}:host .q-connector{position:relative}:host .q-connector:before{top:-5px;border-width:0 0 2px 2px}:host .q-connector:after{border-width:0 0 0 2px;top:50%}:host .q-connector:before,:host .q-connector:after{content:\"\";left:-12px;border-color:#ccc;border-style:solid;width:9px;height:calc(50% + 6px);position:absolute}:host .q-connector:last-child:after{content:none}:host .q-inline-block-display{display:inline-block;vertical-align:top}\n"] }]
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
}
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
QueryBuilderComponent,
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
377
|
+
var QueryBuilderComponent = class QueryBuilderComponent {
|
|
378
|
+
get condition() {
|
|
379
|
+
return this.data?.condition;
|
|
380
|
+
}
|
|
381
|
+
constructor(changeDetectorRef) {
|
|
382
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
383
|
+
this.defaultClassNames = {
|
|
384
|
+
arrowIconButton: "q-arrow-icon-button",
|
|
385
|
+
arrowIcon: "q-icon q-arrow-icon",
|
|
386
|
+
removeIcon: "q-icon q-remove-icon",
|
|
387
|
+
addIcon: "q-icon q-add-icon",
|
|
388
|
+
button: "q-button",
|
|
389
|
+
buttonGroup: "q-button-group",
|
|
390
|
+
removeButton: "q-remove-button",
|
|
391
|
+
switchGroup: "q-switch-group",
|
|
392
|
+
switchLabel: "q-switch-label",
|
|
393
|
+
switchRadio: "q-switch-radio",
|
|
394
|
+
rightAlign: "q-right-align",
|
|
395
|
+
transition: "q-transition",
|
|
396
|
+
collapsed: "q-collapsed",
|
|
397
|
+
treeContainer: "q-tree-container",
|
|
398
|
+
tree: "q-tree",
|
|
399
|
+
row: "q-row",
|
|
400
|
+
connector: "q-connector",
|
|
401
|
+
rule: "q-rule",
|
|
402
|
+
ruleSet: "q-ruleset",
|
|
403
|
+
invalidRuleSet: "q-invalid-ruleset",
|
|
404
|
+
emptyWarning: "q-empty-warning",
|
|
405
|
+
fieldControl: "q-field-control",
|
|
406
|
+
fieldControlSize: "q-control-size",
|
|
407
|
+
entityControl: "q-entity-control",
|
|
408
|
+
entityControlSize: "q-control-size",
|
|
409
|
+
operatorControl: "q-operator-control",
|
|
410
|
+
operatorControlSize: "q-control-size",
|
|
411
|
+
inputControl: "q-input-control",
|
|
412
|
+
inputControlSize: "q-control-size"
|
|
413
|
+
};
|
|
414
|
+
this.defaultOperatorMap = {
|
|
415
|
+
string: [
|
|
416
|
+
"=",
|
|
417
|
+
"!=",
|
|
418
|
+
"contains",
|
|
419
|
+
"like"
|
|
420
|
+
],
|
|
421
|
+
number: [
|
|
422
|
+
"=",
|
|
423
|
+
"!=",
|
|
424
|
+
">",
|
|
425
|
+
">=",
|
|
426
|
+
"<",
|
|
427
|
+
"<="
|
|
428
|
+
],
|
|
429
|
+
time: [
|
|
430
|
+
"=",
|
|
431
|
+
"!=",
|
|
432
|
+
">",
|
|
433
|
+
">=",
|
|
434
|
+
"<",
|
|
435
|
+
"<="
|
|
436
|
+
],
|
|
437
|
+
date: [
|
|
438
|
+
"=",
|
|
439
|
+
"!=",
|
|
440
|
+
">",
|
|
441
|
+
">=",
|
|
442
|
+
"<",
|
|
443
|
+
"<="
|
|
444
|
+
],
|
|
445
|
+
category: [
|
|
446
|
+
"=",
|
|
447
|
+
"!=",
|
|
448
|
+
"in",
|
|
449
|
+
"not in"
|
|
450
|
+
],
|
|
451
|
+
boolean: ["="]
|
|
452
|
+
};
|
|
453
|
+
this.disabled = false;
|
|
454
|
+
this.data = {
|
|
455
|
+
condition: "and",
|
|
456
|
+
rules: []
|
|
457
|
+
};
|
|
458
|
+
this.allowRuleset = true;
|
|
459
|
+
this.allowCollapse = false;
|
|
460
|
+
this.emptyMessage = "A ruleset cannot be empty. Please add a rule or remove it all together.";
|
|
461
|
+
this.classNames = {};
|
|
462
|
+
this.operatorMap = {};
|
|
463
|
+
this.config = { fields: {} };
|
|
464
|
+
this.persistValueOnFieldChange = false;
|
|
465
|
+
this.defaultTemplateTypes = [
|
|
466
|
+
"string",
|
|
467
|
+
"number",
|
|
468
|
+
"time",
|
|
469
|
+
"date",
|
|
470
|
+
"category",
|
|
471
|
+
"boolean",
|
|
472
|
+
"multiselect"
|
|
473
|
+
];
|
|
474
|
+
this.defaultPersistValueTypes = [
|
|
475
|
+
"string",
|
|
476
|
+
"number",
|
|
477
|
+
"time",
|
|
478
|
+
"date",
|
|
479
|
+
"boolean"
|
|
480
|
+
];
|
|
481
|
+
this.defaultEmptyList = [];
|
|
482
|
+
this.operatorsCache = {};
|
|
483
|
+
this.inputContextCache = /* @__PURE__ */ new Map();
|
|
484
|
+
this.operatorContextCache = /* @__PURE__ */ new Map();
|
|
485
|
+
this.fieldContextCache = /* @__PURE__ */ new Map();
|
|
486
|
+
this.entityContextCache = /* @__PURE__ */ new Map();
|
|
487
|
+
this.removeButtonContextCache = /* @__PURE__ */ new Map();
|
|
488
|
+
this.getDisabledState = () => {
|
|
489
|
+
return this.disabled;
|
|
490
|
+
};
|
|
491
|
+
this.fields = [];
|
|
492
|
+
this.filterFields = [];
|
|
493
|
+
this.entities = [];
|
|
494
|
+
}
|
|
495
|
+
ngOnChanges(changes) {
|
|
496
|
+
const config = this.config;
|
|
497
|
+
const type = typeof config;
|
|
498
|
+
if (type === "object") {
|
|
499
|
+
this.fields = Object.keys(config.fields).map((value) => {
|
|
500
|
+
const field = config.fields[value];
|
|
501
|
+
field.value = field.value || value;
|
|
502
|
+
return field;
|
|
503
|
+
});
|
|
504
|
+
if (config.entities) this.entities = Object.keys(config.entities).map((value) => {
|
|
505
|
+
const entity = config.entities ? config.entities[value] : [];
|
|
506
|
+
entity.value = entity.value || value;
|
|
507
|
+
return entity;
|
|
508
|
+
});
|
|
509
|
+
else this.entities = [];
|
|
510
|
+
this.operatorsCache = {};
|
|
511
|
+
} else throw new Error(`Expected 'config' must be a valid object, got ${type} instead.`);
|
|
512
|
+
}
|
|
513
|
+
validate(control) {
|
|
514
|
+
const errors = {};
|
|
515
|
+
const ruleErrorStore = [];
|
|
516
|
+
let hasErrors = false;
|
|
517
|
+
if (!this.config.allowEmptyRulesets && this.checkEmptyRuleInRuleset(this.data)) {
|
|
518
|
+
errors.empty = "Empty rulesets are not allowed.";
|
|
519
|
+
hasErrors = true;
|
|
520
|
+
}
|
|
521
|
+
this.validateRulesInRuleset(this.data, ruleErrorStore);
|
|
522
|
+
if (ruleErrorStore.length) {
|
|
523
|
+
errors.rules = ruleErrorStore;
|
|
524
|
+
hasErrors = true;
|
|
525
|
+
}
|
|
526
|
+
return hasErrors ? errors : null;
|
|
527
|
+
}
|
|
528
|
+
get value() {
|
|
529
|
+
return this.data;
|
|
530
|
+
}
|
|
531
|
+
set value(value) {
|
|
532
|
+
this.data = value || {
|
|
533
|
+
condition: "and",
|
|
534
|
+
rules: []
|
|
535
|
+
};
|
|
536
|
+
this.handleDataChange();
|
|
537
|
+
}
|
|
538
|
+
writeValue(obj) {
|
|
539
|
+
this.value = obj;
|
|
540
|
+
}
|
|
541
|
+
registerOnChange(fn) {
|
|
542
|
+
this.onChangeCallback = () => fn(this.data);
|
|
543
|
+
}
|
|
544
|
+
registerOnTouched(fn) {
|
|
545
|
+
this.onTouchedCallback = () => fn(this.data);
|
|
546
|
+
}
|
|
547
|
+
setDisabledState(isDisabled) {
|
|
548
|
+
this.disabled = isDisabled;
|
|
549
|
+
this.changeDetectorRef.detectChanges();
|
|
550
|
+
}
|
|
551
|
+
findTemplateForRule(rule) {
|
|
552
|
+
const type = this.getInputType(rule.field, rule.operator);
|
|
553
|
+
if (type) {
|
|
554
|
+
const queryInput = this.findQueryInput(type);
|
|
555
|
+
if (queryInput) return queryInput.template;
|
|
556
|
+
else {
|
|
557
|
+
if (this.defaultTemplateTypes.indexOf(type) === -1) console.warn(`Could not find template for field with type: ${type}`);
|
|
558
|
+
return null;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
findQueryInput(type) {
|
|
563
|
+
return (this.parentInputTemplates || this.inputTemplates || []).find((item) => item.queryInputType === type);
|
|
564
|
+
}
|
|
565
|
+
getOperators(field) {
|
|
566
|
+
if (this.operatorsCache[field]) return this.operatorsCache[field];
|
|
567
|
+
let operators = this.defaultEmptyList;
|
|
568
|
+
const fieldObject = this.config.fields[field];
|
|
569
|
+
if (this.config.getOperators) return this.config.getOperators(field, fieldObject);
|
|
570
|
+
const type = fieldObject.type;
|
|
571
|
+
if (fieldObject && fieldObject.operators) operators = fieldObject.operators;
|
|
572
|
+
else if (type) {
|
|
573
|
+
operators = this.operatorMap && this.operatorMap[type] || this.defaultOperatorMap[type] || this.defaultEmptyList;
|
|
574
|
+
if (operators.length === 0) console.warn(`No operators found for field '${field}' with type ${fieldObject.type}. Please define an 'operators' property on the field or use the 'operatorMap' binding to fix this.`);
|
|
575
|
+
if (fieldObject.nullable) operators = operators.concat(["is null", "is not null"]);
|
|
576
|
+
} else console.warn(`No 'type' property found on field: '${field}'`);
|
|
577
|
+
this.operatorsCache[field] = operators;
|
|
578
|
+
return operators;
|
|
579
|
+
}
|
|
580
|
+
getFields(entity) {
|
|
581
|
+
if (this.entities?.length && entity) return this.fields.filter((field) => {
|
|
582
|
+
return field && field.entity === entity;
|
|
583
|
+
});
|
|
584
|
+
else return this.fields;
|
|
585
|
+
}
|
|
586
|
+
getInputType(field, operator) {
|
|
587
|
+
if (this.config.getInputType) return this.config.getInputType(field, operator);
|
|
588
|
+
if (!this.config.fields[field]) throw new Error(`No configuration for field '${field}' could be found! Please add it to config.fields.`);
|
|
589
|
+
const type = this.config.fields[field].type;
|
|
590
|
+
switch (operator) {
|
|
591
|
+
case "is null":
|
|
592
|
+
case "is not null": return null;
|
|
593
|
+
case "in":
|
|
594
|
+
case "not in": return type === "category" || type === "boolean" ? "multiselect" : type;
|
|
595
|
+
default: return type;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
getOptions(field) {
|
|
599
|
+
if (this.config.getOptions) return this.config.getOptions(field);
|
|
600
|
+
return this.config.fields[field].options || this.defaultEmptyList;
|
|
601
|
+
}
|
|
602
|
+
getClassNames(...args) {
|
|
603
|
+
const clsLookup = this.classNames ? this.classNames : this.defaultClassNames;
|
|
604
|
+
const defaultClassNames = this.defaultClassNames;
|
|
605
|
+
const classNames = args.map((id) => clsLookup[id] || defaultClassNames[id]).filter((c) => !!c);
|
|
606
|
+
return classNames.length ? classNames.join(" ") : [];
|
|
607
|
+
}
|
|
608
|
+
getDefaultField(entity) {
|
|
609
|
+
if (!entity) return null;
|
|
610
|
+
else if (entity.defaultField !== void 0) return this.getDefaultValue(entity.defaultField);
|
|
611
|
+
else {
|
|
612
|
+
const entityFields = this.fields.filter((field) => {
|
|
613
|
+
return field && field.entity === entity.value;
|
|
614
|
+
});
|
|
615
|
+
if (entityFields && entityFields.length) return entityFields[0];
|
|
616
|
+
else {
|
|
617
|
+
console.warn(`No fields found for entity '${entity.name}'. A 'defaultOperator' is also not specified on the field config. Operator value will default to null.`);
|
|
618
|
+
return null;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
getDefaultOperator(field) {
|
|
623
|
+
if (field && field.defaultOperator !== void 0) return this.getDefaultValue(field.defaultOperator);
|
|
624
|
+
else {
|
|
625
|
+
const operators = this.getOperators(field.value);
|
|
626
|
+
if (operators && operators.length) return operators[0];
|
|
627
|
+
else {
|
|
628
|
+
console.warn(`No operators found for field '${field.value}'. A 'defaultOperator' is also not specified on the field config. Operator value will default to null.`);
|
|
629
|
+
return null;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
addRule(parent) {
|
|
634
|
+
if (this.disabled) return;
|
|
635
|
+
parent = parent || this.data;
|
|
636
|
+
if (this.config.addRule) this.config.addRule(parent);
|
|
637
|
+
else {
|
|
638
|
+
const field = this.fields[0];
|
|
639
|
+
parent.rules = parent.rules.concat([{
|
|
640
|
+
field: field.value,
|
|
641
|
+
operator: this.getDefaultOperator(field),
|
|
642
|
+
value: this.getDefaultValue(field.defaultValue),
|
|
643
|
+
entity: field.entity
|
|
644
|
+
}]);
|
|
645
|
+
}
|
|
646
|
+
this.handleTouched();
|
|
647
|
+
this.handleDataChange();
|
|
648
|
+
}
|
|
649
|
+
removeRule(rule, parent) {
|
|
650
|
+
if (this.disabled) return;
|
|
651
|
+
parent = parent || this.data;
|
|
652
|
+
if (this.config.removeRule) this.config.removeRule(rule, parent);
|
|
653
|
+
else parent.rules = parent.rules.filter((r) => r !== rule);
|
|
654
|
+
this.inputContextCache.delete(rule);
|
|
655
|
+
this.operatorContextCache.delete(rule);
|
|
656
|
+
this.fieldContextCache.delete(rule);
|
|
657
|
+
this.entityContextCache.delete(rule);
|
|
658
|
+
this.removeButtonContextCache.delete(rule);
|
|
659
|
+
this.handleTouched();
|
|
660
|
+
this.handleDataChange();
|
|
661
|
+
}
|
|
662
|
+
addRuleSet(parent) {
|
|
663
|
+
if (this.disabled) return;
|
|
664
|
+
parent = parent || this.data;
|
|
665
|
+
if (this.config.addRuleSet) this.config.addRuleSet(parent);
|
|
666
|
+
else parent.rules = parent.rules.concat([{
|
|
667
|
+
condition: "and",
|
|
668
|
+
rules: []
|
|
669
|
+
}]);
|
|
670
|
+
this.handleTouched();
|
|
671
|
+
this.handleDataChange();
|
|
672
|
+
}
|
|
673
|
+
removeRuleSet(ruleset, parent) {
|
|
674
|
+
if (this.disabled) return;
|
|
675
|
+
ruleset = ruleset || this.data;
|
|
676
|
+
parent = parent || this.parentValue;
|
|
677
|
+
if (this.config.removeRuleSet) this.config.removeRuleSet(ruleset, parent);
|
|
678
|
+
else if (parent) parent.rules = parent.rules.filter((r) => r !== ruleset);
|
|
679
|
+
this.handleTouched();
|
|
680
|
+
this.handleDataChange();
|
|
681
|
+
}
|
|
682
|
+
transitionEnd(e) {
|
|
683
|
+
this.treeContainer.nativeElement.style.maxHeight = null;
|
|
684
|
+
}
|
|
685
|
+
toggleCollapse() {
|
|
686
|
+
this.computedTreeContainerHeight();
|
|
687
|
+
setTimeout(() => {
|
|
688
|
+
this.data.collapsed = !this.data.collapsed;
|
|
689
|
+
}, 100);
|
|
690
|
+
}
|
|
691
|
+
computedTreeContainerHeight() {
|
|
692
|
+
const nativeElement = this.treeContainer.nativeElement;
|
|
693
|
+
if (nativeElement && nativeElement.firstElementChild) nativeElement.style.maxHeight = nativeElement.firstElementChild.clientHeight + 8 + "px";
|
|
694
|
+
}
|
|
695
|
+
changeCondition(value) {
|
|
696
|
+
if (this.disabled) return;
|
|
697
|
+
this.data.condition = value;
|
|
698
|
+
this.handleTouched();
|
|
699
|
+
this.handleDataChange();
|
|
700
|
+
}
|
|
701
|
+
changeOperator(rule) {
|
|
702
|
+
if (this.disabled) return;
|
|
703
|
+
if (this.config.coerceValueForOperator) rule.value = this.config.coerceValueForOperator(rule.operator, rule.value, rule);
|
|
704
|
+
else rule.value = this.coerceValueForOperator(rule.operator, rule.value, rule);
|
|
705
|
+
this.handleTouched();
|
|
706
|
+
this.handleDataChange();
|
|
707
|
+
}
|
|
708
|
+
coerceValueForOperator(operator, value, rule) {
|
|
709
|
+
if (this.getInputType(rule.field, operator) === "multiselect" && !Array.isArray(value)) return [value];
|
|
710
|
+
return value;
|
|
711
|
+
}
|
|
712
|
+
changeInput() {
|
|
713
|
+
if (this.disabled) return;
|
|
714
|
+
this.handleTouched();
|
|
715
|
+
this.handleDataChange();
|
|
716
|
+
}
|
|
717
|
+
changeField(fieldValue, rule) {
|
|
718
|
+
if (this.disabled) return;
|
|
719
|
+
const inputContext = this.inputContextCache.get(rule);
|
|
720
|
+
const currentField = inputContext && inputContext.field;
|
|
721
|
+
const nextField = this.config.fields[fieldValue];
|
|
722
|
+
const nextValue = this.calculateFieldChangeValue(currentField, nextField, rule.value);
|
|
723
|
+
if (nextValue !== void 0) rule.value = nextValue;
|
|
724
|
+
else delete rule.value;
|
|
725
|
+
rule.operator = this.getDefaultOperator(nextField);
|
|
726
|
+
this.inputContextCache.delete(rule);
|
|
727
|
+
this.operatorContextCache.delete(rule);
|
|
728
|
+
this.fieldContextCache.delete(rule);
|
|
729
|
+
this.entityContextCache.delete(rule);
|
|
730
|
+
this.getInputContext(rule);
|
|
731
|
+
this.getFieldContext(rule);
|
|
732
|
+
this.getOperatorContext(rule);
|
|
733
|
+
this.getEntityContext(rule);
|
|
734
|
+
this.handleTouched();
|
|
735
|
+
this.handleDataChange();
|
|
736
|
+
}
|
|
737
|
+
changeEntity(entityValue, rule, index, data) {
|
|
738
|
+
if (this.disabled) return;
|
|
739
|
+
let i = index;
|
|
740
|
+
let rs = data;
|
|
741
|
+
const entity = this.entities.find((e) => e.value === entityValue);
|
|
742
|
+
const defaultField = this.getDefaultField(entity);
|
|
743
|
+
if (!rs) {
|
|
744
|
+
rs = this.data;
|
|
745
|
+
i = rs.rules.findIndex((x) => x === rule);
|
|
746
|
+
}
|
|
747
|
+
rule.field = defaultField.value;
|
|
748
|
+
rs.rules[i] = rule;
|
|
749
|
+
if (defaultField) this.changeField(defaultField.value, rule);
|
|
750
|
+
else {
|
|
751
|
+
this.handleTouched();
|
|
752
|
+
this.handleDataChange();
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
getDefaultValue(defaultValue) {
|
|
756
|
+
switch (typeof defaultValue) {
|
|
757
|
+
case "function": return defaultValue();
|
|
758
|
+
default: return defaultValue;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
getOperatorTemplate() {
|
|
762
|
+
const t = this.parentOperatorTemplate || this.operatorTemplate;
|
|
763
|
+
return t ? t.template : null;
|
|
764
|
+
}
|
|
765
|
+
getFieldTemplate() {
|
|
766
|
+
const t = this.parentFieldTemplate || this.fieldTemplate;
|
|
767
|
+
return t ? t.template : null;
|
|
768
|
+
}
|
|
769
|
+
getEntityTemplate() {
|
|
770
|
+
const t = this.parentEntityTemplate || this.entityTemplate;
|
|
771
|
+
return t ? t.template : null;
|
|
772
|
+
}
|
|
773
|
+
getArrowIconTemplate() {
|
|
774
|
+
const t = this.parentArrowIconTemplate || this.arrowIconTemplate;
|
|
775
|
+
return t ? t.template : null;
|
|
776
|
+
}
|
|
777
|
+
getButtonGroupTemplate() {
|
|
778
|
+
const t = this.parentButtonGroupTemplate || this.buttonGroupTemplate;
|
|
779
|
+
return t ? t.template : null;
|
|
780
|
+
}
|
|
781
|
+
getSwitchGroupTemplate() {
|
|
782
|
+
const t = this.parentSwitchGroupTemplate || this.switchGroupTemplate;
|
|
783
|
+
return t ? t.template : null;
|
|
784
|
+
}
|
|
785
|
+
getRemoveButtonTemplate() {
|
|
786
|
+
const t = this.parentRemoveButtonTemplate || this.removeButtonTemplate;
|
|
787
|
+
return t ? t.template : null;
|
|
788
|
+
}
|
|
789
|
+
getEmptyWarningTemplate() {
|
|
790
|
+
const t = this.parentEmptyWarningTemplate || this.emptyWarningTemplate;
|
|
791
|
+
return t ? t.template : null;
|
|
792
|
+
}
|
|
793
|
+
getQueryItemClassName(local) {
|
|
794
|
+
let cls = this.getClassNames("row", "connector", "transition");
|
|
795
|
+
cls += " " + this.getClassNames(local.ruleset ? "ruleSet" : "rule");
|
|
796
|
+
if (local.invalid) cls += " " + this.getClassNames("invalidRuleSet");
|
|
797
|
+
return cls;
|
|
798
|
+
}
|
|
799
|
+
getButtonGroupContext() {
|
|
800
|
+
if (!this.buttonGroupContext) this.buttonGroupContext = {
|
|
801
|
+
addRule: this.addRule.bind(this),
|
|
802
|
+
addRuleSet: this.allowRuleset && this.addRuleSet.bind(this),
|
|
803
|
+
removeRuleSet: this.allowRuleset && this.parentValue && this.removeRuleSet.bind(this),
|
|
804
|
+
getDisabledState: this.getDisabledState,
|
|
805
|
+
$implicit: this.data
|
|
806
|
+
};
|
|
807
|
+
return this.buttonGroupContext;
|
|
808
|
+
}
|
|
809
|
+
getRemoveButtonContext(rule) {
|
|
810
|
+
if (!this.removeButtonContextCache.has(rule)) this.removeButtonContextCache.set(rule, {
|
|
811
|
+
removeRule: this.removeRule.bind(this),
|
|
812
|
+
getDisabledState: this.getDisabledState,
|
|
813
|
+
$implicit: rule
|
|
814
|
+
});
|
|
815
|
+
return this.removeButtonContextCache.get(rule);
|
|
816
|
+
}
|
|
817
|
+
getFieldContext(rule) {
|
|
818
|
+
if (!this.fieldContextCache.has(rule)) this.fieldContextCache.set(rule, {
|
|
819
|
+
onChange: this.changeField.bind(this),
|
|
820
|
+
getFields: this.getFields.bind(this),
|
|
821
|
+
getDisabledState: this.getDisabledState,
|
|
822
|
+
fields: this.fields,
|
|
823
|
+
$implicit: rule
|
|
824
|
+
});
|
|
825
|
+
return this.fieldContextCache.get(rule);
|
|
826
|
+
}
|
|
827
|
+
getEntityContext(rule) {
|
|
828
|
+
if (!this.entityContextCache.has(rule)) this.entityContextCache.set(rule, {
|
|
829
|
+
onChange: this.changeEntity.bind(this),
|
|
830
|
+
getDisabledState: this.getDisabledState,
|
|
831
|
+
entities: this.entities,
|
|
832
|
+
$implicit: rule
|
|
833
|
+
});
|
|
834
|
+
return this.entityContextCache.get(rule);
|
|
835
|
+
}
|
|
836
|
+
getSwitchGroupContext() {
|
|
837
|
+
return {
|
|
838
|
+
onChange: this.changeCondition.bind(this),
|
|
839
|
+
getDisabledState: this.getDisabledState,
|
|
840
|
+
$implicit: this.data
|
|
841
|
+
};
|
|
842
|
+
}
|
|
843
|
+
getArrowIconContext() {
|
|
844
|
+
return {
|
|
845
|
+
getDisabledState: this.getDisabledState,
|
|
846
|
+
$implicit: this.data
|
|
847
|
+
};
|
|
848
|
+
}
|
|
849
|
+
getEmptyWarningContext() {
|
|
850
|
+
return {
|
|
851
|
+
getDisabledState: this.getDisabledState,
|
|
852
|
+
message: this.emptyMessage,
|
|
853
|
+
$implicit: this.data
|
|
854
|
+
};
|
|
855
|
+
}
|
|
856
|
+
getOperatorContext(rule) {
|
|
857
|
+
if (!this.operatorContextCache.has(rule)) this.operatorContextCache.set(rule, {
|
|
858
|
+
onChange: this.changeOperator.bind(this),
|
|
859
|
+
getDisabledState: this.getDisabledState,
|
|
860
|
+
operators: this.getOperators(rule.field),
|
|
861
|
+
$implicit: rule
|
|
862
|
+
});
|
|
863
|
+
return this.operatorContextCache.get(rule);
|
|
864
|
+
}
|
|
865
|
+
getInputContext(rule) {
|
|
866
|
+
if (!this.inputContextCache.has(rule)) this.inputContextCache.set(rule, {
|
|
867
|
+
onChange: this.changeInput.bind(this),
|
|
868
|
+
getDisabledState: this.getDisabledState,
|
|
869
|
+
options: this.getOptions(rule.field),
|
|
870
|
+
field: this.config.fields[rule.field],
|
|
871
|
+
$implicit: rule
|
|
872
|
+
});
|
|
873
|
+
return this.inputContextCache.get(rule);
|
|
874
|
+
}
|
|
875
|
+
calculateFieldChangeValue(currentField, nextField, currentValue) {
|
|
876
|
+
if (this.config.calculateFieldChangeValue != null) return this.config.calculateFieldChangeValue(currentField, nextField, currentValue);
|
|
877
|
+
const canKeepValue = () => {
|
|
878
|
+
if (currentField == null || nextField == null) return false;
|
|
879
|
+
return currentField.type === nextField.type && this.defaultPersistValueTypes.indexOf(currentField.type) !== -1;
|
|
880
|
+
};
|
|
881
|
+
if (this.persistValueOnFieldChange && canKeepValue()) return currentValue;
|
|
882
|
+
if (nextField && nextField.defaultValue !== void 0) return this.getDefaultValue(nextField.defaultValue);
|
|
883
|
+
}
|
|
884
|
+
checkEmptyRuleInRuleset(ruleset) {
|
|
885
|
+
if (!ruleset || !ruleset.rules || ruleset.rules.length === 0) return true;
|
|
886
|
+
else return ruleset.rules.some((item) => {
|
|
887
|
+
if (item.rules) return this.checkEmptyRuleInRuleset(item);
|
|
888
|
+
else return false;
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
validateRulesInRuleset(ruleset, errorStore) {
|
|
892
|
+
if (ruleset && ruleset.rules && ruleset.rules.length > 0) ruleset.rules.forEach((item) => {
|
|
893
|
+
if (item.rules) return this.validateRulesInRuleset(item, errorStore);
|
|
894
|
+
else if (item.field) {
|
|
895
|
+
const field = this.config.fields[item.field];
|
|
896
|
+
if (field && field.validator) {
|
|
897
|
+
const error = field.validator(item, ruleset);
|
|
898
|
+
if (error != null) errorStore.push(error);
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
});
|
|
902
|
+
}
|
|
903
|
+
handleDataChange() {
|
|
904
|
+
this.changeDetectorRef.markForCheck();
|
|
905
|
+
if (this.onChangeCallback) this.onChangeCallback();
|
|
906
|
+
if (this.parentChangeCallback) this.parentChangeCallback();
|
|
907
|
+
}
|
|
908
|
+
handleTouched() {
|
|
909
|
+
if (this.onTouchedCallback) this.onTouchedCallback();
|
|
910
|
+
if (this.parentTouchedCallback) this.parentTouchedCallback();
|
|
911
|
+
}
|
|
912
|
+
static {
|
|
913
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
914
|
+
minVersion: "12.0.0",
|
|
915
|
+
version: "22.3.0",
|
|
916
|
+
ngImport: i0,
|
|
917
|
+
type: QueryBuilderComponent,
|
|
918
|
+
deps: [{ token: i0.ChangeDetectorRef }],
|
|
919
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
static {
|
|
923
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
924
|
+
minVersion: "17.0.0",
|
|
925
|
+
version: "22.3.0",
|
|
926
|
+
type: QueryBuilderComponent,
|
|
927
|
+
isStandalone: false,
|
|
928
|
+
selector: "query-builder",
|
|
929
|
+
inputs: {
|
|
930
|
+
disabled: "disabled",
|
|
931
|
+
data: "data",
|
|
932
|
+
allowRuleset: "allowRuleset",
|
|
933
|
+
allowCollapse: "allowCollapse",
|
|
934
|
+
emptyMessage: "emptyMessage",
|
|
935
|
+
classNames: "classNames",
|
|
936
|
+
operatorMap: "operatorMap",
|
|
937
|
+
parentValue: "parentValue",
|
|
938
|
+
config: "config",
|
|
939
|
+
parentArrowIconTemplate: "parentArrowIconTemplate",
|
|
940
|
+
parentInputTemplates: "parentInputTemplates",
|
|
941
|
+
parentOperatorTemplate: "parentOperatorTemplate",
|
|
942
|
+
parentFieldTemplate: "parentFieldTemplate",
|
|
943
|
+
parentEntityTemplate: "parentEntityTemplate",
|
|
944
|
+
parentSwitchGroupTemplate: "parentSwitchGroupTemplate",
|
|
945
|
+
parentButtonGroupTemplate: "parentButtonGroupTemplate",
|
|
946
|
+
parentRemoveButtonTemplate: "parentRemoveButtonTemplate",
|
|
947
|
+
parentEmptyWarningTemplate: "parentEmptyWarningTemplate",
|
|
948
|
+
parentChangeCallback: "parentChangeCallback",
|
|
949
|
+
parentTouchedCallback: "parentTouchedCallback",
|
|
950
|
+
persistValueOnFieldChange: "persistValueOnFieldChange",
|
|
951
|
+
value: "value"
|
|
952
|
+
},
|
|
953
|
+
host: { properties: { "attr.query-builder-condition": "this.condition" } },
|
|
954
|
+
providers: [CONTROL_VALUE_ACCESSOR, VALIDATOR],
|
|
955
|
+
queries: [
|
|
956
|
+
{
|
|
957
|
+
propertyName: "buttonGroupTemplate",
|
|
958
|
+
first: true,
|
|
959
|
+
predicate: QueryButtonGroupDirective,
|
|
960
|
+
descendants: true
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
propertyName: "switchGroupTemplate",
|
|
964
|
+
first: true,
|
|
965
|
+
predicate: QuerySwitchGroupDirective,
|
|
966
|
+
descendants: true
|
|
967
|
+
},
|
|
968
|
+
{
|
|
969
|
+
propertyName: "fieldTemplate",
|
|
970
|
+
first: true,
|
|
971
|
+
predicate: QueryFieldDirective,
|
|
972
|
+
descendants: true
|
|
973
|
+
},
|
|
974
|
+
{
|
|
975
|
+
propertyName: "entityTemplate",
|
|
976
|
+
first: true,
|
|
977
|
+
predicate: QueryEntityDirective,
|
|
978
|
+
descendants: true
|
|
979
|
+
},
|
|
980
|
+
{
|
|
981
|
+
propertyName: "operatorTemplate",
|
|
982
|
+
first: true,
|
|
983
|
+
predicate: QueryOperatorDirective,
|
|
984
|
+
descendants: true
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
propertyName: "removeButtonTemplate",
|
|
988
|
+
first: true,
|
|
989
|
+
predicate: QueryRemoveButtonDirective,
|
|
990
|
+
descendants: true
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
propertyName: "emptyWarningTemplate",
|
|
994
|
+
first: true,
|
|
995
|
+
predicate: QueryEmptyWarningDirective,
|
|
996
|
+
descendants: true
|
|
997
|
+
},
|
|
998
|
+
{
|
|
999
|
+
propertyName: "arrowIconTemplate",
|
|
1000
|
+
first: true,
|
|
1001
|
+
predicate: QueryArrowIconDirective,
|
|
1002
|
+
descendants: true
|
|
1003
|
+
},
|
|
1004
|
+
{
|
|
1005
|
+
propertyName: "inputTemplates",
|
|
1006
|
+
predicate: QueryInputDirective,
|
|
1007
|
+
descendants: true
|
|
1008
|
+
}
|
|
1009
|
+
],
|
|
1010
|
+
viewQueries: [{
|
|
1011
|
+
propertyName: "treeContainer",
|
|
1012
|
+
first: true,
|
|
1013
|
+
predicate: ["treeContainer"],
|
|
1014
|
+
descendants: true,
|
|
1015
|
+
static: true
|
|
1016
|
+
}],
|
|
1017
|
+
usesOnChanges: true,
|
|
1018
|
+
ngImport: i0,
|
|
1019
|
+
template: "<div [ngClass]=\"getClassNames('switchRow')\">\n @if (allowCollapse) {\n <a\n (click)=\"toggleCollapse()\"\n [ngClass]=\"getClassNames('arrowIconButton', data.collapsed ? 'collapsed' : '')\"\n >\n @if (getArrowIconTemplate(); as template) {\n <ng-container *ngTemplateOutlet=\"template; context: getArrowIconContext()\"></ng-container>\n } @else {\n <i [ngClass]=\"getClassNames('arrowIcon')\"></i>\n }\n </a>\n }\n\n @if (getButtonGroupTemplate(); as template) {\n <div [ngClass]=\"getClassNames('buttonGroup', 'rightAlign')\">\n <ng-container *ngTemplateOutlet=\"template; context: getButtonGroupContext()\"></ng-container>\n </div>\n } @else {\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 @if (allowRuleset) {\n <button\n type=\"button\"\n (click)=\"addRuleSet()\"\n [ngClass]=\"getClassNames('button')\"\n [disabled]=\"disabled\"\n >\n <i [ngClass]=\"getClassNames('addIcon')\"></i> Ruleset\n </button>\n }\n @if (!!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 }\n </div>\n }\n\n @if (getSwitchGroupTemplate(); as template) {\n <ng-container *ngTemplateOutlet=\"template; context: getSwitchGroupContext()\"></ng-container>\n } @else {\n @if (data) {\n <div [ngClass]=\"getClassNames('switchGroup', 'transition')\">\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 }\n }\n</div>\n\n<div\n #treeContainer\n (transitionend)=\"transitionEnd($event)\"\n [ngClass]=\"getClassNames('treeContainer', data.collapsed ? 'collapsed' : '')\"\n>\n @if (data && data.rules) {\n <ul [ngClass]=\"getClassNames('tree')\">\n @for (rule of data.rules; track rule; let i = $index) {\n @if (\n {\n ruleset: !!rule.rules,\n invalid: !config.allowEmptyRulesets && rule.rules && rule.rules.length === 0\n };\n as local\n ) {\n <li [ngClass]=\"getQueryItemClassName(local)\">\n @if (!local.ruleset) {\n @if (getRemoveButtonTemplate(); as template) {\n <div [ngClass]=\"getClassNames('buttonGroup', 'rightAlign')\">\n <ng-container\n *ngTemplateOutlet=\"template; context: getRemoveButtonContext(rule)\"\n ></ng-container>\n </div>\n } @else {\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 }\n @if (entities?.length) {\n <div class=\"q-inline-block-display\">\n @if (getEntityTemplate(); as template) {\n <ng-container\n *ngTemplateOutlet=\"template; context: getEntityContext(rule)\"\n ></ng-container>\n } @else {\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 @for (entity of entities; track entity) {\n <option [ngValue]=\"entity.value\">\n {{ entity.name }}\n </option>\n }\n </select>\n </div>\n }\n </div>\n }\n @if (getFieldTemplate(); as template) {\n <ng-container\n *ngTemplateOutlet=\"template; context: getFieldContext(rule)\"\n ></ng-container>\n } @else {\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 @for (field of getFields(rule.entity); track field) {\n <option [ngValue]=\"field.value\">\n {{ field.name }}\n </option>\n }\n </select>\n </div>\n }\n @if (getOperatorTemplate(); as template) {\n <ng-container\n *ngTemplateOutlet=\"template; context: getOperatorContext(rule)\"\n ></ng-container>\n } @else {\n <div [ngClass]=\"getClassNames('operatorControlSize')\">\n <select\n [ngClass]=\"getClassNames('operatorControl')\"\n [(ngModel)]=\"rule.operator\"\n (ngModelChange)=\"changeOperator(rule)\"\n [disabled]=\"disabled\"\n >\n @for (operator of getOperators(rule.field); track operator) {\n <option [ngValue]=\"operator\">\n {{ operator }}\n </option>\n }\n </select>\n </div>\n }\n @if (findTemplateForRule(rule); as template) {\n <ng-container\n *ngTemplateOutlet=\"template; context: getInputContext(rule)\"\n ></ng-container>\n } @else {\n <div [ngClass]=\"getClassNames('inputControlSize')\">\n @switch (getInputType(rule.field, rule.operator)) {\n @case (\"string\") {\n <input\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n type=\"text\"\n />\n }\n @case (\"number\") {\n <input\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n type=\"number\"\n />\n }\n @case (\"date\") {\n <input\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n type=\"date\"\n />\n }\n @case (\"time\") {\n <input\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n type=\"time\"\n />\n }\n @case (\"category\") {\n <select\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n >\n @for (opt of getOptions(rule.field); track opt) {\n <option [ngValue]=\"opt.value\">\n {{ opt.name }}\n </option>\n }\n </select>\n }\n @case (\"multiselect\") {\n <select\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n multiple\n >\n @for (opt of getOptions(rule.field); track opt) {\n <option [ngValue]=\"opt.value\">\n {{ opt.name }}\n </option>\n }\n </select>\n }\n @case (\"boolean\") {\n <input\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n type=\"checkbox\"\n />\n }\n }\n </div>\n }\n }\n @if (local.ruleset) {\n <query-builder\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 @if (getEmptyWarningTemplate(); as template) {\n @if (local.invalid) {\n <ng-container\n *ngTemplateOutlet=\"template; context: getEmptyWarningContext()\"\n ></ng-container>\n }\n } @else {\n @if (local.invalid) {\n <p [ngClass]=\"getClassNames('emptyWarning')\">\n {{ emptyMessage }}\n </p>\n }\n }\n </li>\n }\n }\n </ul>\n }\n</div>\n",
|
|
1020
|
+
styles: ["@charset \"UTF-8\";:host{display:block;width:100%}:host .q-icon{font-style:normal;font-size:12px}:host .q-remove-icon:before{content:\"\\274c\"}:host .q-arrow-icon-button{float:left;margin:4px 6px 4px 0;transform:rotate(90deg);transition:linear .25s transform;cursor:pointer}:host .q-arrow-icon-button.q-collapsed{transform:rotate(0)}:host .q-arrow-icon:before{content:\"\\25b6\"}:host .q-add-icon{color:#555}:host .q-add-icon:before{content:\"\\2795\"}:host .q-remove-button{color:#b3415d;width:31px}:host .q-switch-group,:host .q-button-group{font-family:Lucida Grande,Tahoma,Verdana,sans-serif;overflow:hidden}:host .q-right-align{float:right}:host .q-button{margin-left:8px;padding:0 8px;background-color:#fff}:host .q-button:disabled{display:none}:host .q-control-size{display:inline-block;vertical-align:top;padding-right:10px}:host .q-input-control,:host .q-operator-control,:host .q-field-control,:host .q-entity-control{display:inline-block;padding:5px 8px;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;box-sizing:border-box;width:auto;min-width:180px}:host .q-input-control:disabled,:host .q-operator-control:disabled,:host .q-field-control:disabled,:host .q-entity-control:disabled{border-color:transparent}:host .q-operator-control,:host .q-field-control,:host .q-entity-control,:host .q-input-control:not([type=checkbox]){min-height:32px;-webkit-appearance:none}:host .q-switch-label,:host .q-button{float:left;margin-bottom:0;font-size:14px;line-height:30px;font-weight:400;text-align:center;text-shadow:none;border:1px solid rgba(0,0,0,.2);box-sizing:border-box}:host .q-switch-label:hover,:host .q-button:hover{cursor:pointer;background-color:#f0f0f0}:host .q-switch-label{background-color:#e4e4e4;padding:0 8px}:host .q-switch-radio{position:absolute;clip:rect(0,0,0,0);height:1px;width:1px;border:0;overflow:hidden}:host .q-switch-radio:checked+.q-switch-label{border:1px solid rgb(97,158,215);background:#fff;color:#3176b3}:host .q-switch-radio:disabled+.q-switch-label{display:none}:host .q-switch-radio:checked:disabled+.q-switch-label{display:initial;color:initial;cursor:default;border-color:transparent}:host .q-invalid-ruleset{border:1px solid rgba(179,65,93,.5)!important;background:#b3415d1a!important}:host .q-empty-warning{color:#8d252e;text-align:center}:host .q-ruleset{border:1px solid #ccc}:host .q-rule{border:1px solid #ccc;background:#fff}:host .q-transition{-webkit-transition:all .1s ease-in-out;-moz-transition:all .1s ease-in-out;-ms-transition:all .1s ease-in-out;-o-transition:all .1s ease-in-out;transition:all .1s ease-in-out}:host .q-tree-container{width:100%;overflow:hidden;transition:ease-in .25s max-height}:host .q-tree-container.q-collapsed{max-height:0!important}:host .q-tree{list-style:none;margin:4px 0 2px}:host .q-row{padding:6px 8px;margin-top:6px}:host .q-connector{position:relative}:host .q-connector:before{top:-5px;border-width:0 0 2px 2px}:host .q-connector:after{border-width:0 0 0 2px;top:50%}:host .q-connector:before,:host .q-connector:after{content:\"\";left:-12px;border-color:#ccc;border-style:solid;width:9px;height:calc(50% + 6px);position:absolute}:host .q-connector:last-child:after{content:none}:host .q-inline-block-display{display:inline-block;vertical-align:top}\n"],
|
|
1021
|
+
dependencies: [
|
|
1022
|
+
{
|
|
1023
|
+
kind: "directive",
|
|
1024
|
+
type: i1.NgClass,
|
|
1025
|
+
selector: "[ngClass]",
|
|
1026
|
+
inputs: ["class", "ngClass"]
|
|
1027
|
+
},
|
|
1028
|
+
{
|
|
1029
|
+
kind: "directive",
|
|
1030
|
+
type: i1.NgTemplateOutlet,
|
|
1031
|
+
selector: "[ngTemplateOutlet]",
|
|
1032
|
+
inputs: [
|
|
1033
|
+
"ngTemplateOutletContext",
|
|
1034
|
+
"ngTemplateOutlet",
|
|
1035
|
+
"ngTemplateOutletInjector"
|
|
1036
|
+
]
|
|
1037
|
+
},
|
|
1038
|
+
{
|
|
1039
|
+
kind: "directive",
|
|
1040
|
+
type: i2.NgSelectOption,
|
|
1041
|
+
selector: "option",
|
|
1042
|
+
inputs: ["ngValue", "value"]
|
|
1043
|
+
},
|
|
1044
|
+
{
|
|
1045
|
+
kind: "directive",
|
|
1046
|
+
type: i2.ɵNgSelectMultipleOption,
|
|
1047
|
+
selector: "option",
|
|
1048
|
+
inputs: ["ngValue", "value"]
|
|
1049
|
+
},
|
|
1050
|
+
{
|
|
1051
|
+
kind: "directive",
|
|
1052
|
+
type: i2.DefaultValueAccessor,
|
|
1053
|
+
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
kind: "directive",
|
|
1057
|
+
type: i2.NumberValueAccessor,
|
|
1058
|
+
selector: "input[type=number]:not([ngNoCva])[formControlName],input[type=number]:not([ngNoCva])[formControl],input[type=number]:not([ngNoCva])[ngModel]"
|
|
1059
|
+
},
|
|
1060
|
+
{
|
|
1061
|
+
kind: "directive",
|
|
1062
|
+
type: i2.CheckboxControlValueAccessor,
|
|
1063
|
+
selector: "input[type=checkbox]:not([ngNoCva])[formControlName],input[type=checkbox]:not([ngNoCva])[formControl],input[type=checkbox]:not([ngNoCva])[ngModel]"
|
|
1064
|
+
},
|
|
1065
|
+
{
|
|
1066
|
+
kind: "directive",
|
|
1067
|
+
type: i2.SelectControlValueAccessor,
|
|
1068
|
+
selector: "select:not([multiple]):not([ngNoCva])[formControlName],select:not([multiple]):not([ngNoCva])[formControl],select:not([multiple]):not([ngNoCva])[ngModel]",
|
|
1069
|
+
inputs: ["compareWith"]
|
|
1070
|
+
},
|
|
1071
|
+
{
|
|
1072
|
+
kind: "directive",
|
|
1073
|
+
type: i2.SelectMultipleControlValueAccessor,
|
|
1074
|
+
selector: "select[multiple]:not([ngNoCva])[formControlName],select[multiple]:not([ngNoCva])[formControl],select[multiple]:not([ngNoCva])[ngModel]",
|
|
1075
|
+
inputs: ["compareWith"]
|
|
1076
|
+
},
|
|
1077
|
+
{
|
|
1078
|
+
kind: "directive",
|
|
1079
|
+
type: i2.RadioControlValueAccessor,
|
|
1080
|
+
selector: "input[type=radio]:not([ngNoCva])[formControlName],input[type=radio]:not([ngNoCva])[formControl],input[type=radio]:not([ngNoCva])[ngModel]",
|
|
1081
|
+
inputs: [
|
|
1082
|
+
"name",
|
|
1083
|
+
"formControlName",
|
|
1084
|
+
"value"
|
|
1085
|
+
]
|
|
1086
|
+
},
|
|
1087
|
+
{
|
|
1088
|
+
kind: "directive",
|
|
1089
|
+
type: i2.NgControlStatus,
|
|
1090
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
1091
|
+
},
|
|
1092
|
+
{
|
|
1093
|
+
kind: "directive",
|
|
1094
|
+
type: i2.NgModel,
|
|
1095
|
+
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
1096
|
+
inputs: [
|
|
1097
|
+
"name",
|
|
1098
|
+
"disabled",
|
|
1099
|
+
"ngModel",
|
|
1100
|
+
"ngModelOptions"
|
|
1101
|
+
],
|
|
1102
|
+
outputs: ["ngModelChange"],
|
|
1103
|
+
exportAs: ["ngModel"]
|
|
1104
|
+
},
|
|
1105
|
+
{
|
|
1106
|
+
kind: "component",
|
|
1107
|
+
type: QueryBuilderComponent,
|
|
1108
|
+
selector: "query-builder",
|
|
1109
|
+
inputs: [
|
|
1110
|
+
"disabled",
|
|
1111
|
+
"data",
|
|
1112
|
+
"allowRuleset",
|
|
1113
|
+
"allowCollapse",
|
|
1114
|
+
"emptyMessage",
|
|
1115
|
+
"classNames",
|
|
1116
|
+
"operatorMap",
|
|
1117
|
+
"parentValue",
|
|
1118
|
+
"config",
|
|
1119
|
+
"parentArrowIconTemplate",
|
|
1120
|
+
"parentInputTemplates",
|
|
1121
|
+
"parentOperatorTemplate",
|
|
1122
|
+
"parentFieldTemplate",
|
|
1123
|
+
"parentEntityTemplate",
|
|
1124
|
+
"parentSwitchGroupTemplate",
|
|
1125
|
+
"parentButtonGroupTemplate",
|
|
1126
|
+
"parentRemoveButtonTemplate",
|
|
1127
|
+
"parentEmptyWarningTemplate",
|
|
1128
|
+
"parentChangeCallback",
|
|
1129
|
+
"parentTouchedCallback",
|
|
1130
|
+
"persistValueOnFieldChange",
|
|
1131
|
+
"value"
|
|
1132
|
+
]
|
|
1133
|
+
}
|
|
1134
|
+
],
|
|
1135
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
1136
|
+
});
|
|
1137
|
+
}
|
|
1138
|
+
};
|
|
1139
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1140
|
+
minVersion: "12.0.0",
|
|
1141
|
+
version: "22.3.0",
|
|
1142
|
+
ngImport: i0,
|
|
1143
|
+
type: QueryBuilderComponent,
|
|
1144
|
+
decorators: [{
|
|
1145
|
+
type: Component,
|
|
1146
|
+
args: [{
|
|
1147
|
+
selector: "query-builder",
|
|
1148
|
+
providers: [CONTROL_VALUE_ACCESSOR, VALIDATOR],
|
|
1149
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
1150
|
+
standalone: false,
|
|
1151
|
+
template: "<div [ngClass]=\"getClassNames('switchRow')\">\n @if (allowCollapse) {\n <a\n (click)=\"toggleCollapse()\"\n [ngClass]=\"getClassNames('arrowIconButton', data.collapsed ? 'collapsed' : '')\"\n >\n @if (getArrowIconTemplate(); as template) {\n <ng-container *ngTemplateOutlet=\"template; context: getArrowIconContext()\"></ng-container>\n } @else {\n <i [ngClass]=\"getClassNames('arrowIcon')\"></i>\n }\n </a>\n }\n\n @if (getButtonGroupTemplate(); as template) {\n <div [ngClass]=\"getClassNames('buttonGroup', 'rightAlign')\">\n <ng-container *ngTemplateOutlet=\"template; context: getButtonGroupContext()\"></ng-container>\n </div>\n } @else {\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 @if (allowRuleset) {\n <button\n type=\"button\"\n (click)=\"addRuleSet()\"\n [ngClass]=\"getClassNames('button')\"\n [disabled]=\"disabled\"\n >\n <i [ngClass]=\"getClassNames('addIcon')\"></i> Ruleset\n </button>\n }\n @if (!!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 }\n </div>\n }\n\n @if (getSwitchGroupTemplate(); as template) {\n <ng-container *ngTemplateOutlet=\"template; context: getSwitchGroupContext()\"></ng-container>\n } @else {\n @if (data) {\n <div [ngClass]=\"getClassNames('switchGroup', 'transition')\">\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 }\n }\n</div>\n\n<div\n #treeContainer\n (transitionend)=\"transitionEnd($event)\"\n [ngClass]=\"getClassNames('treeContainer', data.collapsed ? 'collapsed' : '')\"\n>\n @if (data && data.rules) {\n <ul [ngClass]=\"getClassNames('tree')\">\n @for (rule of data.rules; track rule; let i = $index) {\n @if (\n {\n ruleset: !!rule.rules,\n invalid: !config.allowEmptyRulesets && rule.rules && rule.rules.length === 0\n };\n as local\n ) {\n <li [ngClass]=\"getQueryItemClassName(local)\">\n @if (!local.ruleset) {\n @if (getRemoveButtonTemplate(); as template) {\n <div [ngClass]=\"getClassNames('buttonGroup', 'rightAlign')\">\n <ng-container\n *ngTemplateOutlet=\"template; context: getRemoveButtonContext(rule)\"\n ></ng-container>\n </div>\n } @else {\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 }\n @if (entities?.length) {\n <div class=\"q-inline-block-display\">\n @if (getEntityTemplate(); as template) {\n <ng-container\n *ngTemplateOutlet=\"template; context: getEntityContext(rule)\"\n ></ng-container>\n } @else {\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 @for (entity of entities; track entity) {\n <option [ngValue]=\"entity.value\">\n {{ entity.name }}\n </option>\n }\n </select>\n </div>\n }\n </div>\n }\n @if (getFieldTemplate(); as template) {\n <ng-container\n *ngTemplateOutlet=\"template; context: getFieldContext(rule)\"\n ></ng-container>\n } @else {\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 @for (field of getFields(rule.entity); track field) {\n <option [ngValue]=\"field.value\">\n {{ field.name }}\n </option>\n }\n </select>\n </div>\n }\n @if (getOperatorTemplate(); as template) {\n <ng-container\n *ngTemplateOutlet=\"template; context: getOperatorContext(rule)\"\n ></ng-container>\n } @else {\n <div [ngClass]=\"getClassNames('operatorControlSize')\">\n <select\n [ngClass]=\"getClassNames('operatorControl')\"\n [(ngModel)]=\"rule.operator\"\n (ngModelChange)=\"changeOperator(rule)\"\n [disabled]=\"disabled\"\n >\n @for (operator of getOperators(rule.field); track operator) {\n <option [ngValue]=\"operator\">\n {{ operator }}\n </option>\n }\n </select>\n </div>\n }\n @if (findTemplateForRule(rule); as template) {\n <ng-container\n *ngTemplateOutlet=\"template; context: getInputContext(rule)\"\n ></ng-container>\n } @else {\n <div [ngClass]=\"getClassNames('inputControlSize')\">\n @switch (getInputType(rule.field, rule.operator)) {\n @case (\"string\") {\n <input\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n type=\"text\"\n />\n }\n @case (\"number\") {\n <input\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n type=\"number\"\n />\n }\n @case (\"date\") {\n <input\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n type=\"date\"\n />\n }\n @case (\"time\") {\n <input\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n type=\"time\"\n />\n }\n @case (\"category\") {\n <select\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n >\n @for (opt of getOptions(rule.field); track opt) {\n <option [ngValue]=\"opt.value\">\n {{ opt.name }}\n </option>\n }\n </select>\n }\n @case (\"multiselect\") {\n <select\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n multiple\n >\n @for (opt of getOptions(rule.field); track opt) {\n <option [ngValue]=\"opt.value\">\n {{ opt.name }}\n </option>\n }\n </select>\n }\n @case (\"boolean\") {\n <input\n [ngClass]=\"getClassNames('inputControl')\"\n [(ngModel)]=\"rule.value\"\n (ngModelChange)=\"changeInput()\"\n [disabled]=\"disabled\"\n type=\"checkbox\"\n />\n }\n }\n </div>\n }\n }\n @if (local.ruleset) {\n <query-builder\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 @if (getEmptyWarningTemplate(); as template) {\n @if (local.invalid) {\n <ng-container\n *ngTemplateOutlet=\"template; context: getEmptyWarningContext()\"\n ></ng-container>\n }\n } @else {\n @if (local.invalid) {\n <p [ngClass]=\"getClassNames('emptyWarning')\">\n {{ emptyMessage }}\n </p>\n }\n }\n </li>\n }\n }\n </ul>\n }\n</div>\n",
|
|
1152
|
+
styles: ["@charset \"UTF-8\";:host{display:block;width:100%}:host .q-icon{font-style:normal;font-size:12px}:host .q-remove-icon:before{content:\"\\274c\"}:host .q-arrow-icon-button{float:left;margin:4px 6px 4px 0;transform:rotate(90deg);transition:linear .25s transform;cursor:pointer}:host .q-arrow-icon-button.q-collapsed{transform:rotate(0)}:host .q-arrow-icon:before{content:\"\\25b6\"}:host .q-add-icon{color:#555}:host .q-add-icon:before{content:\"\\2795\"}:host .q-remove-button{color:#b3415d;width:31px}:host .q-switch-group,:host .q-button-group{font-family:Lucida Grande,Tahoma,Verdana,sans-serif;overflow:hidden}:host .q-right-align{float:right}:host .q-button{margin-left:8px;padding:0 8px;background-color:#fff}:host .q-button:disabled{display:none}:host .q-control-size{display:inline-block;vertical-align:top;padding-right:10px}:host .q-input-control,:host .q-operator-control,:host .q-field-control,:host .q-entity-control{display:inline-block;padding:5px 8px;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;box-sizing:border-box;width:auto;min-width:180px}:host .q-input-control:disabled,:host .q-operator-control:disabled,:host .q-field-control:disabled,:host .q-entity-control:disabled{border-color:transparent}:host .q-operator-control,:host .q-field-control,:host .q-entity-control,:host .q-input-control:not([type=checkbox]){min-height:32px;-webkit-appearance:none}:host .q-switch-label,:host .q-button{float:left;margin-bottom:0;font-size:14px;line-height:30px;font-weight:400;text-align:center;text-shadow:none;border:1px solid rgba(0,0,0,.2);box-sizing:border-box}:host .q-switch-label:hover,:host .q-button:hover{cursor:pointer;background-color:#f0f0f0}:host .q-switch-label{background-color:#e4e4e4;padding:0 8px}:host .q-switch-radio{position:absolute;clip:rect(0,0,0,0);height:1px;width:1px;border:0;overflow:hidden}:host .q-switch-radio:checked+.q-switch-label{border:1px solid rgb(97,158,215);background:#fff;color:#3176b3}:host .q-switch-radio:disabled+.q-switch-label{display:none}:host .q-switch-radio:checked:disabled+.q-switch-label{display:initial;color:initial;cursor:default;border-color:transparent}:host .q-invalid-ruleset{border:1px solid rgba(179,65,93,.5)!important;background:#b3415d1a!important}:host .q-empty-warning{color:#8d252e;text-align:center}:host .q-ruleset{border:1px solid #ccc}:host .q-rule{border:1px solid #ccc;background:#fff}:host .q-transition{-webkit-transition:all .1s ease-in-out;-moz-transition:all .1s ease-in-out;-ms-transition:all .1s ease-in-out;-o-transition:all .1s ease-in-out;transition:all .1s ease-in-out}:host .q-tree-container{width:100%;overflow:hidden;transition:ease-in .25s max-height}:host .q-tree-container.q-collapsed{max-height:0!important}:host .q-tree{list-style:none;margin:4px 0 2px}:host .q-row{padding:6px 8px;margin-top:6px}:host .q-connector{position:relative}:host .q-connector:before{top:-5px;border-width:0 0 2px 2px}:host .q-connector:after{border-width:0 0 0 2px;top:50%}:host .q-connector:before,:host .q-connector:after{content:\"\";left:-12px;border-color:#ccc;border-style:solid;width:9px;height:calc(50% + 6px);position:absolute}:host .q-connector:last-child:after{content:none}:host .q-inline-block-display{display:inline-block;vertical-align:top}\n"]
|
|
1153
|
+
}]
|
|
1154
|
+
}],
|
|
1155
|
+
ctorParameters: () => [{ type: i0.ChangeDetectorRef }],
|
|
1156
|
+
propDecorators: {
|
|
1157
|
+
disabled: [{ type: Input }],
|
|
1158
|
+
data: [{ type: Input }],
|
|
1159
|
+
condition: [{
|
|
1160
|
+
type: HostBinding,
|
|
1161
|
+
args: ["attr.query-builder-condition"]
|
|
1162
|
+
}],
|
|
1163
|
+
allowRuleset: [{ type: Input }],
|
|
1164
|
+
allowCollapse: [{ type: Input }],
|
|
1165
|
+
emptyMessage: [{ type: Input }],
|
|
1166
|
+
classNames: [{ type: Input }],
|
|
1167
|
+
operatorMap: [{ type: Input }],
|
|
1168
|
+
parentValue: [{ type: Input }],
|
|
1169
|
+
config: [{ type: Input }],
|
|
1170
|
+
parentArrowIconTemplate: [{ type: Input }],
|
|
1171
|
+
parentInputTemplates: [{ type: Input }],
|
|
1172
|
+
parentOperatorTemplate: [{ type: Input }],
|
|
1173
|
+
parentFieldTemplate: [{ type: Input }],
|
|
1174
|
+
parentEntityTemplate: [{ type: Input }],
|
|
1175
|
+
parentSwitchGroupTemplate: [{ type: Input }],
|
|
1176
|
+
parentButtonGroupTemplate: [{ type: Input }],
|
|
1177
|
+
parentRemoveButtonTemplate: [{ type: Input }],
|
|
1178
|
+
parentEmptyWarningTemplate: [{ type: Input }],
|
|
1179
|
+
parentChangeCallback: [{ type: Input }],
|
|
1180
|
+
parentTouchedCallback: [{ type: Input }],
|
|
1181
|
+
persistValueOnFieldChange: [{ type: Input }],
|
|
1182
|
+
treeContainer: [{
|
|
1183
|
+
type: ViewChild,
|
|
1184
|
+
args: ["treeContainer", { static: true }]
|
|
1185
|
+
}],
|
|
1186
|
+
buttonGroupTemplate: [{
|
|
1187
|
+
type: ContentChild,
|
|
1188
|
+
args: [QueryButtonGroupDirective]
|
|
1189
|
+
}],
|
|
1190
|
+
switchGroupTemplate: [{
|
|
1191
|
+
type: ContentChild,
|
|
1192
|
+
args: [QuerySwitchGroupDirective]
|
|
1193
|
+
}],
|
|
1194
|
+
fieldTemplate: [{
|
|
1195
|
+
type: ContentChild,
|
|
1196
|
+
args: [QueryFieldDirective]
|
|
1197
|
+
}],
|
|
1198
|
+
entityTemplate: [{
|
|
1199
|
+
type: ContentChild,
|
|
1200
|
+
args: [QueryEntityDirective]
|
|
1201
|
+
}],
|
|
1202
|
+
operatorTemplate: [{
|
|
1203
|
+
type: ContentChild,
|
|
1204
|
+
args: [QueryOperatorDirective]
|
|
1205
|
+
}],
|
|
1206
|
+
removeButtonTemplate: [{
|
|
1207
|
+
type: ContentChild,
|
|
1208
|
+
args: [QueryRemoveButtonDirective]
|
|
1209
|
+
}],
|
|
1210
|
+
emptyWarningTemplate: [{
|
|
1211
|
+
type: ContentChild,
|
|
1212
|
+
args: [QueryEmptyWarningDirective]
|
|
1213
|
+
}],
|
|
1214
|
+
inputTemplates: [{
|
|
1215
|
+
type: ContentChildren,
|
|
1216
|
+
args: [QueryInputDirective, { descendants: true }]
|
|
1217
|
+
}],
|
|
1218
|
+
arrowIconTemplate: [{
|
|
1219
|
+
type: ContentChild,
|
|
1220
|
+
args: [QueryArrowIconDirective]
|
|
1221
|
+
}],
|
|
1222
|
+
value: [{ type: Input }]
|
|
1223
|
+
}
|
|
1224
|
+
});
|
|
1225
|
+
var NgxAngularQueryBuilderModule = class NgxAngularQueryBuilderModule {
|
|
1226
|
+
static {
|
|
1227
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1228
|
+
minVersion: "12.0.0",
|
|
1229
|
+
version: "22.3.0",
|
|
1230
|
+
ngImport: i0,
|
|
1231
|
+
type: NgxAngularQueryBuilderModule,
|
|
1232
|
+
deps: [],
|
|
1233
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
1234
|
+
});
|
|
1235
|
+
}
|
|
1236
|
+
static {
|
|
1237
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
1238
|
+
minVersion: "14.0.0",
|
|
1239
|
+
version: "22.3.0",
|
|
1240
|
+
ngImport: i0,
|
|
1241
|
+
type: NgxAngularQueryBuilderModule,
|
|
1242
|
+
declarations: [
|
|
1243
|
+
QueryBuilderComponent,
|
|
1244
|
+
QueryInputDirective,
|
|
1245
|
+
QueryOperatorDirective,
|
|
1246
|
+
QueryFieldDirective,
|
|
1247
|
+
QueryEntityDirective,
|
|
1248
|
+
QueryButtonGroupDirective,
|
|
1249
|
+
QuerySwitchGroupDirective,
|
|
1250
|
+
QueryRemoveButtonDirective,
|
|
1251
|
+
QueryEmptyWarningDirective,
|
|
1252
|
+
QueryArrowIconDirective
|
|
1253
|
+
],
|
|
1254
|
+
imports: [CommonModule, FormsModule],
|
|
1255
|
+
exports: [
|
|
1256
|
+
QueryBuilderComponent,
|
|
1257
|
+
QueryInputDirective,
|
|
1258
|
+
QueryOperatorDirective,
|
|
1259
|
+
QueryFieldDirective,
|
|
1260
|
+
QueryEntityDirective,
|
|
1261
|
+
QueryButtonGroupDirective,
|
|
1262
|
+
QuerySwitchGroupDirective,
|
|
1263
|
+
QueryRemoveButtonDirective,
|
|
1264
|
+
QueryEmptyWarningDirective,
|
|
1265
|
+
QueryArrowIconDirective
|
|
1266
|
+
]
|
|
1267
|
+
});
|
|
1268
|
+
}
|
|
1269
|
+
static {
|
|
1270
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
1271
|
+
minVersion: "12.0.0",
|
|
1272
|
+
version: "22.3.0",
|
|
1273
|
+
ngImport: i0,
|
|
1274
|
+
type: NgxAngularQueryBuilderModule,
|
|
1275
|
+
imports: [CommonModule, FormsModule]
|
|
1276
|
+
});
|
|
1277
|
+
}
|
|
1278
|
+
};
|
|
1279
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1280
|
+
minVersion: "12.0.0",
|
|
1281
|
+
version: "22.3.0",
|
|
1282
|
+
ngImport: i0,
|
|
1283
|
+
type: NgxAngularQueryBuilderModule,
|
|
1284
|
+
decorators: [{
|
|
1285
|
+
type: NgModule,
|
|
1286
|
+
args: [{
|
|
1287
|
+
imports: [CommonModule, FormsModule],
|
|
1288
|
+
declarations: [
|
|
1289
|
+
QueryBuilderComponent,
|
|
1290
|
+
QueryInputDirective,
|
|
1291
|
+
QueryOperatorDirective,
|
|
1292
|
+
QueryFieldDirective,
|
|
1293
|
+
QueryEntityDirective,
|
|
1294
|
+
QueryButtonGroupDirective,
|
|
1295
|
+
QuerySwitchGroupDirective,
|
|
1296
|
+
QueryRemoveButtonDirective,
|
|
1297
|
+
QueryEmptyWarningDirective,
|
|
1298
|
+
QueryArrowIconDirective
|
|
1299
|
+
],
|
|
1300
|
+
exports: [
|
|
1301
|
+
QueryBuilderComponent,
|
|
1302
|
+
QueryInputDirective,
|
|
1303
|
+
QueryOperatorDirective,
|
|
1304
|
+
QueryFieldDirective,
|
|
1305
|
+
QueryEntityDirective,
|
|
1306
|
+
QueryButtonGroupDirective,
|
|
1307
|
+
QuerySwitchGroupDirective,
|
|
1308
|
+
QueryRemoveButtonDirective,
|
|
1309
|
+
QueryEmptyWarningDirective,
|
|
1310
|
+
QueryArrowIconDirective
|
|
1311
|
+
]
|
|
1312
|
+
}]
|
|
1313
|
+
}]
|
|
1314
|
+
});
|
|
963
1315
|
export { CONTROL_VALUE_ACCESSOR, NgxAngularQueryBuilderModule, QueryArrowIconDirective, QueryBuilderComponent, QueryButtonGroupDirective, QueryEmptyWarningDirective, QueryEntityDirective, QueryFieldDirective, QueryInputDirective, QueryOperatorDirective, QueryRemoveButtonDirective, QuerySwitchGroupDirective, VALIDATOR };
|
|
964
|
-
|
|
1316
|
+
|
|
1317
|
+
//# sourceMappingURL=ngx-angular-query-builder.mjs.map
|