@main-class/componentes 3.11.2 → 4.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 +17 -0
- package/fesm2022/main-class-componentes-arquivo.mjs +851 -369
- package/fesm2022/main-class-componentes-arquivo.mjs.map +1 -1
- package/fesm2022/main-class-componentes-core.mjs +288 -240
- package/fesm2022/main-class-componentes-core.mjs.map +1 -1
- package/fesm2022/main-class-componentes-crud.mjs +1004 -546
- package/fesm2022/main-class-componentes-crud.mjs.map +1 -1
- package/fesm2022/main-class-componentes-dialog.mjs +758 -385
- package/fesm2022/main-class-componentes-dialog.mjs.map +1 -1
- package/fesm2022/main-class-componentes-form.mjs +299 -196
- package/fesm2022/main-class-componentes-form.mjs.map +1 -1
- package/fesm2022/main-class-componentes-input.mjs +4143 -2141
- package/fesm2022/main-class-componentes-input.mjs.map +1 -1
- package/fesm2022/main-class-componentes-loader.mjs +262 -212
- package/fesm2022/main-class-componentes-loader.mjs.map +1 -1
- package/fesm2022/main-class-componentes-misc.mjs +508 -354
- package/fesm2022/main-class-componentes-misc.mjs.map +1 -1
- package/fesm2022/main-class-componentes-pipe.mjs +39 -26
- package/fesm2022/main-class-componentes-pipe.mjs.map +1 -1
- package/fesm2022/main-class-componentes-table.mjs +1331 -624
- package/fesm2022/main-class-componentes-table.mjs.map +1 -1
- package/fesm2022/main-class-componentes.mjs +3 -11
- package/fesm2022/main-class-componentes.mjs.map +1 -1
- package/package.json +32 -16
- package/types/main-class-componentes-arquivo.d.ts +190 -0
- package/types/main-class-componentes-core.d.ts +99 -0
- package/types/main-class-componentes-crud.d.ts +172 -0
- package/types/main-class-componentes-dialog.d.ts +125 -0
- package/types/main-class-componentes-form.d.ts +70 -0
- package/types/main-class-componentes-input.d.ts +687 -0
- package/types/main-class-componentes-loader.d.ts +69 -0
- package/types/main-class-componentes-misc.d.ts +87 -0
- package/types/main-class-componentes-pipe.d.ts +10 -0
- package/types/main-class-componentes-table.d.ts +265 -0
- package/types/main-class-componentes.d.ts +4 -0
- package/arquivo/index.d.ts +0 -5
- package/arquivo/src/arquivo-manager.service.d.ts +0 -13
- package/arquivo/src/download-arquivo.directive.d.ts +0 -12
- package/arquivo/src/imagem.directive.d.ts +0 -21
- package/arquivo/src/preview-arquivo/dialog-preview-arquivo/dialog-preview-arquivo.component.d.ts +0 -23
- package/arquivo/src/preview-arquivo/preview-arquivo.component.d.ts +0 -27
- package/core/index.d.ts +0 -4
- package/core/src/criptografia/criptografia.service.d.ts +0 -6
- package/core/src/mensageria/mensageria.service.d.ts +0 -17
- package/core/src/mobile/mobile.service.d.ts +0 -15
- package/core/src/validator/valida-modulo11.service.d.ts +0 -55
- package/crud/index.d.ts +0 -7
- package/crud/src/abstract-consulta-paginada-component.d.ts +0 -24
- package/crud/src/abstract-edicao-component.d.ts +0 -19
- package/crud/src/abstract-edicao-modal-component.d.ts +0 -19
- package/crud/src/query/query-field/query-field.component.d.ts +0 -40
- package/crud/src/query/query-form-field/query-form-field.component.d.ts +0 -12
- package/crud/src/query/query-form.component.d.ts +0 -28
- package/crud/src/query/query-modal-form/query-modal-form.component.d.ts +0 -13
- package/dialog/index.d.ts +0 -10
- package/dialog/src/dialog-confirmacao/dialog-confirmacao.component.d.ts +0 -23
- package/dialog/src/dialog-iframe/dialog-iframe.component.d.ts +0 -21
- package/dialog/src/dialog-sidebar/modal-template/modal-body.directive.d.ts +0 -9
- package/dialog/src/dialog-sidebar/modal-template/modal-close.directive.d.ts +0 -9
- package/dialog/src/dialog-sidebar/modal-template/modal-footer.directive.d.ts +0 -6
- package/dialog/src/dialog-sidebar/modal-template/modal-header.directive.d.ts +0 -6
- package/dialog/src/dialog-sidebar/modal-template/modal-template.component.d.ts +0 -12
- package/dialog/src/dialog-sidebar/modal.component.d.ts +0 -8
- package/dialog/src/dialog-sidebar/sidebar-modal-ref.d.ts +0 -21
- package/dialog/src/dialog.service.d.ts +0 -26
- package/form/index.d.ts +0 -3
- package/form/src/form.component.d.ts +0 -24
- package/form/src/mensagens-erro/mensagens-erro.component.d.ts +0 -17
- package/form/src/single-click.directive.d.ts +0 -13
- package/index.d.ts +0 -5
- package/input/index.d.ts +0 -26
- package/input/src/abstract-control-value-accessor.d.ts +0 -18
- package/input/src/abstract-mat-form-field-control.d.ts +0 -42
- package/input/src/abstract-mat-form-field-select-control.d.ts +0 -31
- package/input/src/input-currency/input-currency.component.d.ts +0 -9
- package/input/src/input-datetime/input-datetime.component.d.ts +0 -32
- package/input/src/input-fileupload/input-fileupload-validator.directive.d.ts +0 -8
- package/input/src/input-fileupload/input-fileupload.component.d.ts +0 -70
- package/input/src/input-mask/documento-validators.d.ts +0 -7
- package/input/src/input-mask/input-cep.component.d.ts +0 -7
- package/input/src/input-mask/input-cnpj.component.d.ts +0 -7
- package/input/src/input-mask/input-cpf-cnpj.component.d.ts +0 -7
- package/input/src/input-mask/input-cpf.component.d.ts +0 -7
- package/input/src/input-mask/input-mask-validator.directive.d.ts +0 -16
- package/input/src/input-mask/input-mask.component.d.ts +0 -24
- package/input/src/input-mask/input-phone.component.d.ts +0 -7
- package/input/src/input-mask/mask-functions.d.ts +0 -2
- package/input/src/input-telefone-internacional/input-telefone-internacional-validator.directive.d.ts +0 -8
- package/input/src/input-telefone-internacional/input-telefone-internacional.component.d.ts +0 -19
- package/input/src/option-checkbox/all-option-checkbox.component.d.ts +0 -18
- package/input/src/option-checkbox/node-pool.d.ts +0 -23
- package/input/src/option-checkbox/option-checkbox-group.component.d.ts +0 -25
- package/input/src/option-checkbox/option-checkbox.component.d.ts +0 -23
- package/input/src/option-checkbox/option-checkbox.service.d.ts +0 -16
- package/input/src/option-checkbox/option-node.d.ts +0 -13
- package/input/src/select-autocomplete/select-autocomplete.component.d.ts +0 -15
- package/input/src/select-chips/select-chips.component.d.ts +0 -12
- package/input/src/select-many-checkbox/select-many-checkbox.component.d.ts +0 -12
- package/input/src/select-option/delegate-option-provider.directive.d.ts +0 -13
- package/input/src/select-option/select-option-provider.d.ts +0 -10
- package/input/src/select-option/select-option.component.d.ts +0 -10
- package/input/src/select-option/select-option.d.ts +0 -4
- package/input/src/select-radio/select-radio.component.d.ts +0 -9
- package/loader/index.d.ts +0 -2
- package/loader/src/loader.component.d.ts +0 -25
- package/loader/src/loader.service.d.ts +0 -20
- package/misc/index.d.ts +0 -12
- package/misc/src/cnpj/cnpj.directive.d.ts +0 -12
- package/misc/src/cnpj/cnpjs.pipe.d.ts +0 -7
- package/misc/src/cpf/cpf.directive.d.ts +0 -12
- package/misc/src/cpf/cpf.pipe.d.ts +0 -7
- package/misc/src/cpf-cnpj/cpf-cnpj.directive.d.ts +0 -12
- package/misc/src/cpf-cnpj/cpf-cnpj.pipe.d.ts +0 -7
- package/misc/src/mask/mask.pipe.d.ts +0 -8
- package/misc/src/monetario/monetario-mask.d.ts +0 -1
- package/misc/src/monetario/monetario.pipe.d.ts +0 -7
- package/misc/src/porcentagem/porcentagem-mask.d.ts +0 -1
- package/misc/src/porcentagem/porcentagem.pipe.d.ts +0 -7
- package/misc/src/telefone/telefone.pipe.d.ts +0 -7
- package/misc/src/unsafe-inner-html/unsafe-inner-html.directive.d.ts +0 -10
- package/pipe/index.d.ts +0 -1
- package/pipe/src/nome-resumido.pipe.d.ts +0 -7
- package/public-api.d.ts +0 -2
- package/table/index.d.ts +0 -10
- package/table/src/column/column-cell.directive.d.ts +0 -8
- package/table/src/column/column-footer.directive.d.ts +0 -8
- package/table/src/column/column-header.directive.d.ts +0 -8
- package/table/src/column/column.directive.d.ts +0 -16
- package/table/src/numeric-paginator/numeric-paginator.component.d.ts +0 -26
- package/table/src/paginated-table/paginated-table.component.d.ts +0 -58
- package/table/src/paginator-i18n.d.ts +0 -8
- package/table/src/table/table.component.d.ts +0 -41
- package/table/src/td/td.component.d.ts +0 -8
- package/table/src/th/th.component.d.ts +0 -8
- package/table/src/undefined-paginator/undefined-paginator.component.d.ts +0 -25
- package/table/src/virtual-paginated-table/virtual-paginated-table.component.d.ts +0 -28
|
@@ -1,547 +1,1005 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import * as i1 from
|
|
4
|
-
import { FormControl,
|
|
5
|
-
import {
|
|
6
|
-
import { DatePipe, NgClass } from
|
|
7
|
-
import {
|
|
8
|
-
import { CpfCnpjPipe,
|
|
9
|
-
import { MensagensErroComponent } from
|
|
10
|
-
import {
|
|
11
|
-
import { MatIcon } from
|
|
12
|
-
import { MatFormField,
|
|
13
|
-
import { MatInput } from
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import { delay } from
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
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
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, ContentChildren, EventEmitter, Inject, Input, Optional, Output, Self, TemplateRef, ViewChild, inject } from "@angular/core";
|
|
3
|
+
import * as i1 from "@angular/forms";
|
|
4
|
+
import { FormBuilder, FormControl, FormsModule, ReactiveFormsModule, Validators } from "@angular/forms";
|
|
5
|
+
import { debounceTime, lastValueFrom, of } from "rxjs";
|
|
6
|
+
import { DatePipe, NgClass } from "@angular/common";
|
|
7
|
+
import { DelegateOptionProviderDirective, InputCnpjComponent, InputCpfCnpjComponent, InputCpfComponent, InputCurrencyComponent, InputDatetimeComponent, InputMaskComponent, SELECT_OPTION_PROVIDER, SelectAutocompleteComponent, SelectOptionComponent } from "@main-class/componentes/input";
|
|
8
|
+
import { CpfCnpjPipe, MaskPipe, MonetarioPipe } from "@main-class/componentes/misc";
|
|
9
|
+
import { MensagensErroComponent } from "@main-class/componentes/form";
|
|
10
|
+
import { MatButton, MatIconButton } from "@angular/material/button";
|
|
11
|
+
import { MatIcon } from "@angular/material/icon";
|
|
12
|
+
import { MatError, MatFormField, MatHint, MatLabel, MatSuffix } from "@angular/material/form-field";
|
|
13
|
+
import { MatInput } from "@angular/material/input";
|
|
14
|
+
import { DialogService, ModalBodyDirective, ModalCloseDirective, ModalFooterDirective, ModalHeaderDirective, SIDEBAR_MODAL_DATA, SidebarModalRef } from "@main-class/componentes/dialog";
|
|
15
|
+
import { ActivatedRoute, Router } from "@angular/router";
|
|
16
|
+
import { delay } from "rxjs/operators";
|
|
17
|
+
import { LoaderService } from "@main-class/componentes/loader";
|
|
18
|
+
import { PaginatedTableComponent } from "@main-class/componentes/table";
|
|
19
|
+
import { MensageriaService, observaParametrosDaRota } from "@main-class/componentes/core";
|
|
20
|
+
import { MatDialogRef } from "@angular/material/dialog";
|
|
21
|
+
var QueryFieldComponent = class QueryFieldComponent {
|
|
22
|
+
optionProvider;
|
|
23
|
+
cpfCnpjPipe = new CpfCnpjPipe();
|
|
24
|
+
datePipe = new DatePipe("pt-BR");
|
|
25
|
+
currencyPipe = new MonetarioPipe();
|
|
26
|
+
maskPipe = new MaskPipe();
|
|
27
|
+
$fieldType;
|
|
28
|
+
formControl = new FormControl("");
|
|
29
|
+
labelText;
|
|
30
|
+
description;
|
|
31
|
+
mask;
|
|
32
|
+
name;
|
|
33
|
+
$fixed;
|
|
34
|
+
options;
|
|
35
|
+
fields;
|
|
36
|
+
constructor(optionProvider) {
|
|
37
|
+
this.optionProvider = optionProvider;
|
|
38
|
+
}
|
|
39
|
+
set fixed(fixed) {
|
|
40
|
+
this.$fixed = fixed || fixed === "";
|
|
41
|
+
}
|
|
42
|
+
get fixed() {
|
|
43
|
+
return this.$fixed;
|
|
44
|
+
}
|
|
45
|
+
get required() {
|
|
46
|
+
return this.formControl.hasValidator(Validators.required);
|
|
47
|
+
}
|
|
48
|
+
get fieldType() {
|
|
49
|
+
return this.$fieldType;
|
|
50
|
+
}
|
|
51
|
+
set fieldType(fieldType) {
|
|
52
|
+
this.$fieldType = fieldType;
|
|
53
|
+
}
|
|
54
|
+
get empty() {
|
|
55
|
+
if (this.fieldType === "group") return !this.fields?.find((field) => !field.empty);
|
|
56
|
+
return this.formControl?.value === "" || this.formControl?.value === void 0 || this.formControl?.value === null;
|
|
57
|
+
}
|
|
58
|
+
get value() {
|
|
59
|
+
if (!this.empty) {
|
|
60
|
+
switch (this.fieldType) {
|
|
61
|
+
case "cpf":
|
|
62
|
+
case "cnpj":
|
|
63
|
+
case "cpf_cnpj": return this.cpfCnpjPipe.transform(this.formControl?.value);
|
|
64
|
+
case "date": return this.datePipe.transform(this.formControl?.value, "dd/MM/yyyy");
|
|
65
|
+
case "option": return this.label(this.formControl?.value);
|
|
66
|
+
case "currency": return this.currencyPipe.transform(this.formControl?.value);
|
|
67
|
+
case "mask": return this.maskPipe.transform(this.formControl?.value, this.mask);
|
|
68
|
+
}
|
|
69
|
+
return this.formControl?.value;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
type() {
|
|
73
|
+
switch (this.fieldType) {
|
|
74
|
+
case "date": return "date";
|
|
75
|
+
case "option": return this.optionProvider?.type() || "object";
|
|
76
|
+
}
|
|
77
|
+
return "string";
|
|
78
|
+
}
|
|
79
|
+
provide(search) {
|
|
80
|
+
if (!!this.optionProvider) return this.optionProvider.provide(search);
|
|
81
|
+
if (typeof search === "string" || search == void 0) return of((this.options?.toArray() || []).filter((op) => (op.label || "").indexOf((search || "").toLowerCase()) >= 0));
|
|
82
|
+
return of(this.options?.toArray() || []);
|
|
83
|
+
}
|
|
84
|
+
label(value) {
|
|
85
|
+
if (!!this.optionProvider) return this.optionProvider.label(value);
|
|
86
|
+
return this.options?.find((op) => op.value === value)?.label || "";
|
|
87
|
+
}
|
|
88
|
+
trackBy(value) {
|
|
89
|
+
if (!!this.optionProvider?.trackBy) return this.optionProvider.trackBy(value);
|
|
90
|
+
return value;
|
|
91
|
+
}
|
|
92
|
+
clear() {
|
|
93
|
+
if (this.fieldType === "group") this.fields?.forEach((field) => field.clear());
|
|
94
|
+
else this.formControl?.setValue(void 0);
|
|
95
|
+
}
|
|
96
|
+
serialized() {
|
|
97
|
+
if (!this.empty) {
|
|
98
|
+
switch (this.type()) {
|
|
99
|
+
case "object": return JSON.stringify(this.formControl.value);
|
|
100
|
+
}
|
|
101
|
+
return String(this.formControl.value);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
desserialize(value) {
|
|
105
|
+
if (!!value) {
|
|
106
|
+
switch (this.type()) {
|
|
107
|
+
case "object": return JSON.parse(value);
|
|
108
|
+
case "date": return new Date(value);
|
|
109
|
+
case "number": return Number(value);
|
|
110
|
+
}
|
|
111
|
+
return value;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
115
|
+
minVersion: "12.0.0",
|
|
116
|
+
version: "22.3.2",
|
|
117
|
+
ngImport: i0,
|
|
118
|
+
type: QueryFieldComponent,
|
|
119
|
+
deps: [{
|
|
120
|
+
token: SELECT_OPTION_PROVIDER,
|
|
121
|
+
optional: true,
|
|
122
|
+
self: true
|
|
123
|
+
}],
|
|
124
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
125
|
+
});
|
|
126
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
127
|
+
minVersion: "14.0.0",
|
|
128
|
+
version: "22.3.2",
|
|
129
|
+
type: QueryFieldComponent,
|
|
130
|
+
isStandalone: true,
|
|
131
|
+
selector: "mcl-query-field",
|
|
132
|
+
inputs: {
|
|
133
|
+
labelText: ["label", "labelText"],
|
|
134
|
+
description: "description",
|
|
135
|
+
mask: "mask",
|
|
136
|
+
name: "name",
|
|
137
|
+
fixed: "fixed",
|
|
138
|
+
fieldType: ["type", "fieldType"]
|
|
139
|
+
},
|
|
140
|
+
queries: [{
|
|
141
|
+
propertyName: "options",
|
|
142
|
+
predicate: SelectOptionComponent
|
|
143
|
+
}, {
|
|
144
|
+
propertyName: "fields",
|
|
145
|
+
predicate: QueryFieldComponent
|
|
146
|
+
}],
|
|
147
|
+
ngImport: i0,
|
|
148
|
+
template: "",
|
|
149
|
+
styles: [""],
|
|
150
|
+
dependencies: [{
|
|
151
|
+
kind: "ngmodule",
|
|
152
|
+
type: ReactiveFormsModule
|
|
153
|
+
}],
|
|
154
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
158
|
+
minVersion: "12.0.0",
|
|
159
|
+
version: "22.3.2",
|
|
160
|
+
ngImport: i0,
|
|
161
|
+
type: QueryFieldComponent,
|
|
162
|
+
decorators: [{
|
|
163
|
+
type: Component,
|
|
164
|
+
args: [{
|
|
165
|
+
selector: "mcl-query-field",
|
|
166
|
+
imports: [ReactiveFormsModule],
|
|
167
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
168
|
+
template: ""
|
|
169
|
+
}]
|
|
170
|
+
}],
|
|
171
|
+
ctorParameters: () => [{
|
|
172
|
+
type: void 0,
|
|
173
|
+
decorators: [
|
|
174
|
+
{
|
|
175
|
+
type: Inject,
|
|
176
|
+
args: [SELECT_OPTION_PROVIDER]
|
|
177
|
+
},
|
|
178
|
+
{ type: Self },
|
|
179
|
+
{ type: Optional }
|
|
180
|
+
]
|
|
181
|
+
}],
|
|
182
|
+
propDecorators: {
|
|
183
|
+
labelText: [{
|
|
184
|
+
type: Input,
|
|
185
|
+
args: ["label"]
|
|
186
|
+
}],
|
|
187
|
+
description: [{ type: Input }],
|
|
188
|
+
mask: [{ type: Input }],
|
|
189
|
+
name: [{ type: Input }],
|
|
190
|
+
options: [{
|
|
191
|
+
type: ContentChildren,
|
|
192
|
+
args: [SelectOptionComponent]
|
|
193
|
+
}],
|
|
194
|
+
fields: [{
|
|
195
|
+
type: ContentChildren,
|
|
196
|
+
args: [QueryFieldComponent]
|
|
197
|
+
}],
|
|
198
|
+
fixed: [{ type: Input }],
|
|
199
|
+
fieldType: [{
|
|
200
|
+
type: Input,
|
|
201
|
+
args: ["type"]
|
|
202
|
+
}]
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
var QueryFormFieldComponent = class QueryFormFieldComponent {
|
|
206
|
+
field;
|
|
207
|
+
control;
|
|
208
|
+
get formControl() {
|
|
209
|
+
return this.control;
|
|
210
|
+
}
|
|
211
|
+
get formGroup() {
|
|
212
|
+
return this.control;
|
|
213
|
+
}
|
|
214
|
+
clear() {
|
|
215
|
+
this.formControl.setValue(void 0);
|
|
216
|
+
}
|
|
217
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
218
|
+
minVersion: "12.0.0",
|
|
219
|
+
version: "22.3.2",
|
|
220
|
+
ngImport: i0,
|
|
221
|
+
type: QueryFormFieldComponent,
|
|
222
|
+
deps: [],
|
|
223
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
224
|
+
});
|
|
225
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
226
|
+
minVersion: "17.0.0",
|
|
227
|
+
version: "22.3.2",
|
|
228
|
+
type: QueryFormFieldComponent,
|
|
229
|
+
isStandalone: true,
|
|
230
|
+
selector: "mcl-query-form-field",
|
|
231
|
+
inputs: {
|
|
232
|
+
field: "field",
|
|
233
|
+
control: "control"
|
|
234
|
+
},
|
|
235
|
+
ngImport: i0,
|
|
236
|
+
template: "@if (field!.fieldType === 'group') {\n <div [formGroup]=\"formGroup\">\n @for (child of field!.fields; track child.labelText) {\n <mcl-query-form-field [field]=\"child\"\n [control]=\"formGroup.controls[child.labelText!]\"></mcl-query-form-field>\n }\n </div>\n} @else {\n <mat-form-field>\n <mat-label>{{ field!.labelText }}</mat-label>\n @switch (field!.fieldType) {\n @case ('input') {\n <input matInput [formControl]=\"formControl\"/>\n }\n @case ('cpf') {\n <mcl-input cpf [formControl]=\"formControl\"/>\n }\n @case ('cnpj') {\n <mcl-input cnpj [formControl]=\"formControl\"/>\n }\n @case ('cpf_cnpj') {\n <mcl-input cpfCnpj [formControl]=\"formControl\"/>\n }\n @case ('date') {\n <mcl-input-datetime type=\"date\" [formControl]=\"formControl\"/>\n }\n @case ('option') {\n <mcl-select-autocomplete [formControl]=\"formControl\" [delegate]=\"field\"/>\n }\n @case ('mask') {\n <mcl-input [mask]=\"field!.mask!\" [formControl]=\"formControl\"/>\n }\n @case ('currency') {\n <mcl-input currency [formControl]=\"formControl\"/>\n }\n }\n @if (formControl.value) {\n <button mat-icon-button matSuffix (click)=\"clear()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n @if (!!field?.description) {\n <mat-hint>{{ field?.description }}</mat-hint>\n }\n <mat-error [mclErrorFor]=\"formControl\"></mat-error>\n </mat-form-field>\n}\n",
|
|
237
|
+
styles: [""],
|
|
238
|
+
dependencies: [
|
|
239
|
+
{
|
|
240
|
+
kind: "component",
|
|
241
|
+
type: QueryFormFieldComponent,
|
|
242
|
+
selector: "mcl-query-form-field",
|
|
243
|
+
inputs: ["field", "control"]
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
kind: "component",
|
|
247
|
+
type: MatFormField,
|
|
248
|
+
selector: "mat-form-field",
|
|
249
|
+
inputs: [
|
|
250
|
+
"hideRequiredMarker",
|
|
251
|
+
"color",
|
|
252
|
+
"floatLabel",
|
|
253
|
+
"appearance",
|
|
254
|
+
"subscriptSizing",
|
|
255
|
+
"hintLabel"
|
|
256
|
+
],
|
|
257
|
+
exportAs: ["matFormField"]
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
kind: "ngmodule",
|
|
261
|
+
type: ReactiveFormsModule
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
kind: "directive",
|
|
265
|
+
type: i1.DefaultValueAccessor,
|
|
266
|
+
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]"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
kind: "directive",
|
|
270
|
+
type: i1.NgControlStatus,
|
|
271
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
kind: "directive",
|
|
275
|
+
type: i1.NgControlStatusGroup,
|
|
276
|
+
selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
kind: "directive",
|
|
280
|
+
type: i1.FormControlDirective,
|
|
281
|
+
selector: "[formControl]",
|
|
282
|
+
inputs: [
|
|
283
|
+
"formControl",
|
|
284
|
+
"disabled",
|
|
285
|
+
"ngModel"
|
|
286
|
+
],
|
|
287
|
+
outputs: ["ngModelChange"],
|
|
288
|
+
exportAs: ["ngForm"]
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
kind: "directive",
|
|
292
|
+
type: i1.FormGroupDirective,
|
|
293
|
+
selector: "[formGroup]",
|
|
294
|
+
inputs: ["formGroup"],
|
|
295
|
+
outputs: ["ngSubmit"],
|
|
296
|
+
exportAs: ["ngForm"]
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
kind: "directive",
|
|
300
|
+
type: MatInput,
|
|
301
|
+
selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
|
|
302
|
+
inputs: [
|
|
303
|
+
"disabled",
|
|
304
|
+
"id",
|
|
305
|
+
"placeholder",
|
|
306
|
+
"name",
|
|
307
|
+
"required",
|
|
308
|
+
"type",
|
|
309
|
+
"errorStateMatcher",
|
|
310
|
+
"aria-describedby",
|
|
311
|
+
"value",
|
|
312
|
+
"readonly",
|
|
313
|
+
"disabledInteractive"
|
|
314
|
+
],
|
|
315
|
+
exportAs: ["matInput"]
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
kind: "component",
|
|
319
|
+
type: InputDatetimeComponent,
|
|
320
|
+
selector: "mcl-input-datetime",
|
|
321
|
+
inputs: [
|
|
322
|
+
"type",
|
|
323
|
+
"readonly",
|
|
324
|
+
"name"
|
|
325
|
+
]
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
kind: "directive",
|
|
329
|
+
type: MatError,
|
|
330
|
+
selector: "mat-error, [matError]",
|
|
331
|
+
inputs: ["id"]
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
kind: "directive",
|
|
335
|
+
type: MatLabel,
|
|
336
|
+
selector: "mat-label"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
kind: "directive",
|
|
340
|
+
type: MatHint,
|
|
341
|
+
selector: "mat-hint",
|
|
342
|
+
inputs: ["align", "id"]
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
kind: "component",
|
|
346
|
+
type: InputCpfComponent,
|
|
347
|
+
selector: "mcl-input[cpf]"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
kind: "component",
|
|
351
|
+
type: InputCnpjComponent,
|
|
352
|
+
selector: "mcl-input[cnpj]"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
kind: "component",
|
|
356
|
+
type: InputCpfCnpjComponent,
|
|
357
|
+
selector: "mcl-input[cpfCnpj]"
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
kind: "component",
|
|
361
|
+
type: SelectAutocompleteComponent,
|
|
362
|
+
selector: "mcl-select-autocomplete",
|
|
363
|
+
inputs: ["readonly"],
|
|
364
|
+
outputs: ["select", "blur"]
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
kind: "component",
|
|
368
|
+
type: InputMaskComponent,
|
|
369
|
+
selector: "mcl-input[mask]",
|
|
370
|
+
inputs: ["keepMask", "mask"],
|
|
371
|
+
outputs: ["focusin", "focusout"]
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
kind: "component",
|
|
375
|
+
type: MensagensErroComponent,
|
|
376
|
+
selector: "[mclErrorFor],[mclError]",
|
|
377
|
+
inputs: ["mclErrorFor"]
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
kind: "component",
|
|
381
|
+
type: InputCurrencyComponent,
|
|
382
|
+
selector: "mcl-input[currency]"
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
kind: "directive",
|
|
386
|
+
type: DelegateOptionProviderDirective,
|
|
387
|
+
selector: "mcl-select-autocomplete[delegate]",
|
|
388
|
+
inputs: ["delegate"]
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
kind: "component",
|
|
392
|
+
type: MatIconButton,
|
|
393
|
+
selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
|
|
394
|
+
exportAs: ["matButton", "matAnchor"]
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
kind: "component",
|
|
398
|
+
type: MatIcon,
|
|
399
|
+
selector: "mat-icon",
|
|
400
|
+
inputs: [
|
|
401
|
+
"color",
|
|
402
|
+
"inline",
|
|
403
|
+
"svgIcon",
|
|
404
|
+
"fontSet",
|
|
405
|
+
"fontIcon"
|
|
406
|
+
],
|
|
407
|
+
exportAs: ["matIcon"]
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
kind: "directive",
|
|
411
|
+
type: MatSuffix,
|
|
412
|
+
selector: "[matSuffix], [matIconSuffix], [matTextSuffix]",
|
|
413
|
+
inputs: ["matTextSuffix"]
|
|
414
|
+
}
|
|
415
|
+
],
|
|
416
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
417
|
+
});
|
|
418
|
+
};
|
|
419
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
420
|
+
minVersion: "12.0.0",
|
|
421
|
+
version: "22.3.2",
|
|
422
|
+
ngImport: i0,
|
|
423
|
+
type: QueryFormFieldComponent,
|
|
424
|
+
decorators: [{
|
|
425
|
+
type: Component,
|
|
426
|
+
args: [{
|
|
427
|
+
selector: "mcl-query-form-field",
|
|
428
|
+
imports: [
|
|
429
|
+
MatFormField,
|
|
430
|
+
ReactiveFormsModule,
|
|
431
|
+
MatInput,
|
|
432
|
+
InputDatetimeComponent,
|
|
433
|
+
MatError,
|
|
434
|
+
MatLabel,
|
|
435
|
+
MatHint,
|
|
436
|
+
InputCpfComponent,
|
|
437
|
+
InputCnpjComponent,
|
|
438
|
+
InputCpfCnpjComponent,
|
|
439
|
+
SelectAutocompleteComponent,
|
|
440
|
+
InputMaskComponent,
|
|
441
|
+
MensagensErroComponent,
|
|
442
|
+
InputCurrencyComponent,
|
|
443
|
+
DelegateOptionProviderDirective,
|
|
444
|
+
MatIconButton,
|
|
445
|
+
MatIcon,
|
|
446
|
+
MatSuffix
|
|
447
|
+
],
|
|
448
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
449
|
+
template: "@if (field!.fieldType === 'group') {\n <div [formGroup]=\"formGroup\">\n @for (child of field!.fields; track child.labelText) {\n <mcl-query-form-field [field]=\"child\"\n [control]=\"formGroup.controls[child.labelText!]\"></mcl-query-form-field>\n }\n </div>\n} @else {\n <mat-form-field>\n <mat-label>{{ field!.labelText }}</mat-label>\n @switch (field!.fieldType) {\n @case ('input') {\n <input matInput [formControl]=\"formControl\"/>\n }\n @case ('cpf') {\n <mcl-input cpf [formControl]=\"formControl\"/>\n }\n @case ('cnpj') {\n <mcl-input cnpj [formControl]=\"formControl\"/>\n }\n @case ('cpf_cnpj') {\n <mcl-input cpfCnpj [formControl]=\"formControl\"/>\n }\n @case ('date') {\n <mcl-input-datetime type=\"date\" [formControl]=\"formControl\"/>\n }\n @case ('option') {\n <mcl-select-autocomplete [formControl]=\"formControl\" [delegate]=\"field\"/>\n }\n @case ('mask') {\n <mcl-input [mask]=\"field!.mask!\" [formControl]=\"formControl\"/>\n }\n @case ('currency') {\n <mcl-input currency [formControl]=\"formControl\"/>\n }\n }\n @if (formControl.value) {\n <button mat-icon-button matSuffix (click)=\"clear()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n @if (!!field?.description) {\n <mat-hint>{{ field?.description }}</mat-hint>\n }\n <mat-error [mclErrorFor]=\"formControl\"></mat-error>\n </mat-form-field>\n}\n"
|
|
450
|
+
}]
|
|
451
|
+
}],
|
|
452
|
+
propDecorators: {
|
|
453
|
+
field: [{ type: Input }],
|
|
454
|
+
control: [{ type: Input }]
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
var QueryModalFormComponent = class QueryModalFormComponent {
|
|
458
|
+
modalRef;
|
|
459
|
+
fields;
|
|
460
|
+
form;
|
|
461
|
+
constructor(fb, modalRef, fields) {
|
|
462
|
+
this.modalRef = modalRef;
|
|
463
|
+
this.fields = fields;
|
|
464
|
+
this.form = fb.group(fields.map((field) => {
|
|
465
|
+
if (field.fieldType === "group") return { [field.name]: fb.group(field.fields.map((child) => ({ [child.name]: fb.control(child.formControl.value) })).reduce((c1, c2) => ({
|
|
466
|
+
...c1,
|
|
467
|
+
...c2
|
|
468
|
+
}))) };
|
|
469
|
+
else return { [field.name]: fb.control(field.formControl.value) };
|
|
470
|
+
}).reduce((c1, c2) => ({
|
|
471
|
+
...c1,
|
|
472
|
+
...c2
|
|
473
|
+
})));
|
|
474
|
+
}
|
|
475
|
+
apply() {
|
|
476
|
+
this.fields.forEach((field) => {
|
|
477
|
+
if (field.fieldType === "group") {
|
|
478
|
+
const formGroup = this.form.controls[field.name];
|
|
479
|
+
field.fields?.forEach((child) => {
|
|
480
|
+
child.formControl.patchValue(formGroup.controls[child.name].value);
|
|
481
|
+
});
|
|
482
|
+
} else {
|
|
483
|
+
const formControl = this.form.controls[field.name];
|
|
484
|
+
field.formControl.patchValue(formControl.value);
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
this.modalRef.close();
|
|
488
|
+
}
|
|
489
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
490
|
+
minVersion: "12.0.0",
|
|
491
|
+
version: "22.3.2",
|
|
492
|
+
ngImport: i0,
|
|
493
|
+
type: QueryModalFormComponent,
|
|
494
|
+
deps: [
|
|
495
|
+
{ token: FormBuilder },
|
|
496
|
+
{ token: SidebarModalRef },
|
|
497
|
+
{ token: SIDEBAR_MODAL_DATA }
|
|
498
|
+
],
|
|
499
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
500
|
+
});
|
|
501
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
502
|
+
minVersion: "17.0.0",
|
|
503
|
+
version: "22.3.2",
|
|
504
|
+
type: QueryModalFormComponent,
|
|
505
|
+
isStandalone: true,
|
|
506
|
+
selector: "mcl-query-form",
|
|
507
|
+
ngImport: i0,
|
|
508
|
+
template: "<form (ngSubmit)=\"apply()\" class=\"sidebar\">\n <h2 mclSidebarModalHeader>\n <mat-icon>search</mat-icon>\n Aplicar filtros\n </h2>\n\n <div mclSidebarModalBody>\n @for (field of fields; track field.name) {\n <div [ngClass]=\"field.fieldType\">\n @if (field.fieldType === 'group') {\n <h3>{{ field.labelText }}</h3>\n }\n\n <mcl-query-form-field [field]=\"field\" [control]=\"form.controls[field.name!]!\"></mcl-query-form-field>\n </div>\n }\n </div>\n\n <div mclSidebarModalFooter>\n <button mat-flat-button color=\"primary\" type=\"submit\">\n Aplicar\n </button>\n <button mat-button type=\"button\" mclSidebarModalClose>\n Cancelar\n </button>\n </div>\n</form>\n",
|
|
509
|
+
styles: ["@charset \"UTF-8\";:host{--af-bg: var(--lib-color-surface, var(--mat-sys-surface));--af-fg: var(--lib-color-on-surface, var(--mat-sys-on-surface));--af-muted: var(--lib-color-outline, var(--mat-sys-outline));--af-border: var(--lib-color-outline-variant, var(--mat-sys-outline-variant));--af-primary: var(--lib-color-primary, var(--mat-sys-primary));--af-struct: var(--lib-color-secondary, var(--mat-sys-secondary));--af-gap: 12px;--af-slot-gap: 10px;--af-slot-min: 220px;display:block;background:var(--af-bg);color:var(--af-fg)}.aff{display:grid;gap:var(--af-gap)}.aff__section-title{display:flex;align-items:center;gap:8px;margin:8px 0 4px;font-size:.95rem;font-weight:700;color:var(--af-fg)}.aff__section-mark{inline-size:4px;block-size:16px;border-radius:999px;background:var(--af-struct)}.aff__slot{display:grid;gap:var(--af-slot-gap);grid-template-columns:repeat(auto-fit,minmax(var(--af-slot-min),1fr));align-items:start}.aff-group{background:transparent;border:1px solid var(--af-border);border-radius:12px;padding:12px;display:grid;gap:10px}.aff-group__head{display:flex;align-items:center;gap:8px}.aff-group__title{display:inline-flex;align-items:center;gap:8px;font-size:.92rem;font-weight:700;color:var(--af-fg);margin:0}.aff-group__title-mark{inline-size:4px;block-size:16px;border-radius:999px;background:var(--af-struct)}.aff-group__clear{margin-inline-start:auto;inline-size:30px;block-size:30px;display:grid;place-items:center;border-radius:10px;border:1px solid transparent;background:transparent;color:var(--af-muted);cursor:pointer;transition:background-color .15s ease,color .15s ease}.aff-group__clear:hover{background:color-mix(in oklab,var(--af-primary) 10%,#fff);color:var(--af-fg)}.aff-group__clear:focus-visible{outline:2px solid color-mix(in oklab,var(--af-primary) 60%,#fff);outline-offset:2px}.aff-group__clear mat-icon{font-size:20px}.aff-group__fields{display:grid;gap:var(--af-slot-gap);grid-template-columns:repeat(auto-fit,minmax(var(--af-slot-min),1fr));align-items:start}.aff-subtitle{font-size:.85rem;font-weight:700;color:color-mix(in oklab,var(--af-fg) 90%,#222);margin:4px 0 0}.aff__inline-actions{display:flex;gap:8px;justify-content:flex-end}.aff__btn{height:32px;padding:0 10px;border-radius:10px;border:1px solid var(--af-border);background:#fff;color:var(--af-fg);display:inline-flex;align-items:center;gap:6px;transition:background-color .15s ease,border-color .15s ease,color .15s ease}.aff__btn:hover{background:color-mix(in oklab,var(--af-primary) 8%,#fff)}.aff__btn mat-icon{font-size:20px}@media(max-width:600px){.aff__slot,.aff-group__fields{grid-template-columns:1fr}}\n"],
|
|
510
|
+
dependencies: [
|
|
511
|
+
{
|
|
512
|
+
kind: "ngmodule",
|
|
513
|
+
type: ReactiveFormsModule
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
kind: "directive",
|
|
517
|
+
type: i1.ɵNgNoValidate,
|
|
518
|
+
selector: "form:not([ngNoForm]):not([ngNativeValidate])"
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
kind: "directive",
|
|
522
|
+
type: i1.NgControlStatusGroup,
|
|
523
|
+
selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
kind: "ngmodule",
|
|
527
|
+
type: FormsModule
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
kind: "directive",
|
|
531
|
+
type: i1.NgForm,
|
|
532
|
+
selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]",
|
|
533
|
+
inputs: ["ngFormOptions"],
|
|
534
|
+
outputs: ["ngSubmit"],
|
|
535
|
+
exportAs: ["ngForm"]
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
kind: "directive",
|
|
539
|
+
type: ModalHeaderDirective,
|
|
540
|
+
selector: "[mclSidebarModalHeader]"
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
kind: "directive",
|
|
544
|
+
type: ModalCloseDirective,
|
|
545
|
+
selector: "[mclSidebarModalClose]"
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
kind: "directive",
|
|
549
|
+
type: ModalBodyDirective,
|
|
550
|
+
selector: "[mclSidebarModalBody]"
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
kind: "directive",
|
|
554
|
+
type: ModalFooterDirective,
|
|
555
|
+
selector: "[mclSidebarModalFooter]"
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
kind: "component",
|
|
559
|
+
type: QueryFormFieldComponent,
|
|
560
|
+
selector: "mcl-query-form-field",
|
|
561
|
+
inputs: ["field", "control"]
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
kind: "directive",
|
|
565
|
+
type: NgClass,
|
|
566
|
+
selector: "[ngClass]",
|
|
567
|
+
inputs: ["class", "ngClass"]
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
kind: "component",
|
|
571
|
+
type: MatButton,
|
|
572
|
+
selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
|
|
573
|
+
inputs: ["matButton"],
|
|
574
|
+
exportAs: ["matButton", "matAnchor"]
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
kind: "component",
|
|
578
|
+
type: MatIcon,
|
|
579
|
+
selector: "mat-icon",
|
|
580
|
+
inputs: [
|
|
581
|
+
"color",
|
|
582
|
+
"inline",
|
|
583
|
+
"svgIcon",
|
|
584
|
+
"fontSet",
|
|
585
|
+
"fontIcon"
|
|
586
|
+
],
|
|
587
|
+
exportAs: ["matIcon"]
|
|
588
|
+
}
|
|
589
|
+
],
|
|
590
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
591
|
+
});
|
|
592
|
+
};
|
|
593
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
594
|
+
minVersion: "12.0.0",
|
|
595
|
+
version: "22.3.2",
|
|
596
|
+
ngImport: i0,
|
|
597
|
+
type: QueryModalFormComponent,
|
|
598
|
+
decorators: [{
|
|
599
|
+
type: Component,
|
|
600
|
+
args: [{
|
|
601
|
+
selector: "mcl-query-form",
|
|
602
|
+
imports: [
|
|
603
|
+
ReactiveFormsModule,
|
|
604
|
+
FormsModule,
|
|
605
|
+
ModalHeaderDirective,
|
|
606
|
+
ModalCloseDirective,
|
|
607
|
+
ModalBodyDirective,
|
|
608
|
+
ModalFooterDirective,
|
|
609
|
+
QueryFormFieldComponent,
|
|
610
|
+
NgClass,
|
|
611
|
+
ModalFooterDirective,
|
|
612
|
+
ModalCloseDirective,
|
|
613
|
+
MatButton,
|
|
614
|
+
ModalBodyDirective,
|
|
615
|
+
ModalHeaderDirective,
|
|
616
|
+
MatIcon
|
|
617
|
+
],
|
|
618
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
619
|
+
template: "<form (ngSubmit)=\"apply()\" class=\"sidebar\">\n <h2 mclSidebarModalHeader>\n <mat-icon>search</mat-icon>\n Aplicar filtros\n </h2>\n\n <div mclSidebarModalBody>\n @for (field of fields; track field.name) {\n <div [ngClass]=\"field.fieldType\">\n @if (field.fieldType === 'group') {\n <h3>{{ field.labelText }}</h3>\n }\n\n <mcl-query-form-field [field]=\"field\" [control]=\"form.controls[field.name!]!\"></mcl-query-form-field>\n </div>\n }\n </div>\n\n <div mclSidebarModalFooter>\n <button mat-flat-button color=\"primary\" type=\"submit\">\n Aplicar\n </button>\n <button mat-button type=\"button\" mclSidebarModalClose>\n Cancelar\n </button>\n </div>\n</form>\n",
|
|
620
|
+
styles: ["@charset \"UTF-8\";:host{--af-bg: var(--lib-color-surface, var(--mat-sys-surface));--af-fg: var(--lib-color-on-surface, var(--mat-sys-on-surface));--af-muted: var(--lib-color-outline, var(--mat-sys-outline));--af-border: var(--lib-color-outline-variant, var(--mat-sys-outline-variant));--af-primary: var(--lib-color-primary, var(--mat-sys-primary));--af-struct: var(--lib-color-secondary, var(--mat-sys-secondary));--af-gap: 12px;--af-slot-gap: 10px;--af-slot-min: 220px;display:block;background:var(--af-bg);color:var(--af-fg)}.aff{display:grid;gap:var(--af-gap)}.aff__section-title{display:flex;align-items:center;gap:8px;margin:8px 0 4px;font-size:.95rem;font-weight:700;color:var(--af-fg)}.aff__section-mark{inline-size:4px;block-size:16px;border-radius:999px;background:var(--af-struct)}.aff__slot{display:grid;gap:var(--af-slot-gap);grid-template-columns:repeat(auto-fit,minmax(var(--af-slot-min),1fr));align-items:start}.aff-group{background:transparent;border:1px solid var(--af-border);border-radius:12px;padding:12px;display:grid;gap:10px}.aff-group__head{display:flex;align-items:center;gap:8px}.aff-group__title{display:inline-flex;align-items:center;gap:8px;font-size:.92rem;font-weight:700;color:var(--af-fg);margin:0}.aff-group__title-mark{inline-size:4px;block-size:16px;border-radius:999px;background:var(--af-struct)}.aff-group__clear{margin-inline-start:auto;inline-size:30px;block-size:30px;display:grid;place-items:center;border-radius:10px;border:1px solid transparent;background:transparent;color:var(--af-muted);cursor:pointer;transition:background-color .15s ease,color .15s ease}.aff-group__clear:hover{background:color-mix(in oklab,var(--af-primary) 10%,#fff);color:var(--af-fg)}.aff-group__clear:focus-visible{outline:2px solid color-mix(in oklab,var(--af-primary) 60%,#fff);outline-offset:2px}.aff-group__clear mat-icon{font-size:20px}.aff-group__fields{display:grid;gap:var(--af-slot-gap);grid-template-columns:repeat(auto-fit,minmax(var(--af-slot-min),1fr));align-items:start}.aff-subtitle{font-size:.85rem;font-weight:700;color:color-mix(in oklab,var(--af-fg) 90%,#222);margin:4px 0 0}.aff__inline-actions{display:flex;gap:8px;justify-content:flex-end}.aff__btn{height:32px;padding:0 10px;border-radius:10px;border:1px solid var(--af-border);background:#fff;color:var(--af-fg);display:inline-flex;align-items:center;gap:6px;transition:background-color .15s ease,border-color .15s ease,color .15s ease}.aff__btn:hover{background:color-mix(in oklab,var(--af-primary) 8%,#fff)}.aff__btn mat-icon{font-size:20px}@media(max-width:600px){.aff__slot,.aff-group__fields{grid-template-columns:1fr}}\n"]
|
|
621
|
+
}]
|
|
622
|
+
}],
|
|
623
|
+
ctorParameters: () => [
|
|
624
|
+
{ type: FormBuilder },
|
|
625
|
+
{ type: SidebarModalRef },
|
|
626
|
+
{
|
|
627
|
+
type: Array,
|
|
628
|
+
decorators: [{
|
|
629
|
+
type: Inject,
|
|
630
|
+
args: [SIDEBAR_MODAL_DATA]
|
|
631
|
+
}]
|
|
632
|
+
}
|
|
633
|
+
]
|
|
634
|
+
});
|
|
635
|
+
var QueryFormComponent = class QueryFormComponent {
|
|
636
|
+
router;
|
|
637
|
+
dialogService;
|
|
638
|
+
activatedRoute;
|
|
639
|
+
fields;
|
|
640
|
+
modalTemplate;
|
|
641
|
+
query = new EventEmitter();
|
|
642
|
+
_subscriptions = {};
|
|
643
|
+
constructor(router, dialogService, activatedRoute) {
|
|
644
|
+
this.router = router;
|
|
645
|
+
this.dialogService = dialogService;
|
|
646
|
+
this.activatedRoute = activatedRoute;
|
|
647
|
+
}
|
|
648
|
+
ngAfterViewInit() {
|
|
649
|
+
this.activatedRoute.queryParams.pipe(debounceTime(300)).subscribe((qp) => {
|
|
650
|
+
this.desserialize(qp);
|
|
651
|
+
});
|
|
652
|
+
this.fields.changes.subscribe(() => {
|
|
653
|
+
this.configFieldsSubscriptions();
|
|
654
|
+
});
|
|
655
|
+
this.configFieldsSubscriptions();
|
|
656
|
+
}
|
|
657
|
+
ngOnDestroy() {
|
|
658
|
+
Object.keys(this._subscriptions).forEach((key) => {
|
|
659
|
+
this._subscriptions[key].unsubscribe();
|
|
660
|
+
delete this._subscriptions[key];
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
get filterCount() {
|
|
664
|
+
return this.fields?.filter((f) => !f.fixed && !f.empty)?.length || 0;
|
|
665
|
+
}
|
|
666
|
+
openFilter($event) {
|
|
667
|
+
$event.stopPropagation();
|
|
668
|
+
this.dialogService.openSidebar(QueryModalFormComponent, { data: this.fields.toArray() }).afterClosed().subscribe((query) => {
|
|
669
|
+
this.router.navigate(["./"], {
|
|
670
|
+
relativeTo: this.activatedRoute,
|
|
671
|
+
queryParams: this.serialized()
|
|
672
|
+
});
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
clearAll() {
|
|
676
|
+
this.fields?.forEach((field) => {
|
|
677
|
+
field.clear();
|
|
678
|
+
});
|
|
679
|
+
this.router.navigate(["./"], {
|
|
680
|
+
relativeTo: this.activatedRoute,
|
|
681
|
+
queryParams: this.serialized()
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
clear(item) {
|
|
685
|
+
item.clear();
|
|
686
|
+
this.router.navigate(["./"], {
|
|
687
|
+
relativeTo: this.activatedRoute,
|
|
688
|
+
queryParams: this.serialized()
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
Validators = Validators;
|
|
692
|
+
serialized() {
|
|
693
|
+
let obj = this.fields?.map((field) => {
|
|
694
|
+
if (field.fieldType === "group") return field.fields.map((child) => ({ [`${field.name}.${child.name}`]: child.serialized() })).reduce((c1, c2) => ({
|
|
695
|
+
...c1,
|
|
696
|
+
...c2
|
|
697
|
+
}));
|
|
698
|
+
else return { [field.name]: field.serialized() };
|
|
699
|
+
}).reduce((c1, c2) => ({
|
|
700
|
+
...c1,
|
|
701
|
+
...c2
|
|
702
|
+
}));
|
|
703
|
+
console.log("filtro: ", obj);
|
|
704
|
+
return obj;
|
|
705
|
+
}
|
|
706
|
+
desserialize(value) {
|
|
707
|
+
this.fields?.forEach((field) => {
|
|
708
|
+
if (field.fieldType === "group") field.fields.forEach((child) => {
|
|
709
|
+
child.formControl.patchValue(child.desserialize(value[`${field.name}.${child.name}`]));
|
|
710
|
+
});
|
|
711
|
+
else field.formControl.patchValue(field.desserialize(value[field.name]));
|
|
712
|
+
});
|
|
713
|
+
const query = this.fields?.filter((field) => !field.empty)?.map((field) => {
|
|
714
|
+
if (field.fieldType === "group") return { [field.name]: field.fields?.filter((field) => !field.empty)?.map((field) => ({ [field.name]: field.formControl.value })).reduce((o1, o2) => ({
|
|
715
|
+
...o1,
|
|
716
|
+
...o2
|
|
717
|
+
}), {}) };
|
|
718
|
+
else return { [field.name]: field.formControl.value };
|
|
719
|
+
}).reduce((o1, o2) => ({
|
|
720
|
+
...o1,
|
|
721
|
+
...o2
|
|
722
|
+
}), {});
|
|
723
|
+
this.query.emit(query);
|
|
724
|
+
}
|
|
725
|
+
configFieldsSubscriptions() {
|
|
726
|
+
this.fields.forEach((field) => {
|
|
727
|
+
if (!this._subscriptions[field.name]) this._subscriptions[field.name] = field.formControl.valueChanges.pipe(delay(300)).subscribe((_) => {
|
|
728
|
+
console.log("field: ", field.name, " value: ", field.formControl.value);
|
|
729
|
+
const queryParams = this.activatedRoute.snapshot.queryParams;
|
|
730
|
+
if (field.serialized() !== queryParams[field.name]) this.router.navigate(["./"], {
|
|
731
|
+
relativeTo: this.activatedRoute,
|
|
732
|
+
queryParams: this.serialized()
|
|
733
|
+
});
|
|
734
|
+
});
|
|
735
|
+
});
|
|
736
|
+
Object.keys(this._subscriptions).forEach((key) => {
|
|
737
|
+
if (!this.fields?.find((field) => field.name === key)) {
|
|
738
|
+
this._subscriptions[key].unsubscribe();
|
|
739
|
+
delete this._subscriptions[key];
|
|
740
|
+
}
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
744
|
+
minVersion: "12.0.0",
|
|
745
|
+
version: "22.3.2",
|
|
746
|
+
ngImport: i0,
|
|
747
|
+
type: QueryFormComponent,
|
|
748
|
+
deps: [
|
|
749
|
+
{ token: Router },
|
|
750
|
+
{ token: DialogService },
|
|
751
|
+
{ token: ActivatedRoute }
|
|
752
|
+
],
|
|
753
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
754
|
+
});
|
|
755
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
756
|
+
minVersion: "17.0.0",
|
|
757
|
+
version: "22.3.2",
|
|
758
|
+
type: QueryFormComponent,
|
|
759
|
+
isStandalone: true,
|
|
760
|
+
selector: "mcl-query-form",
|
|
761
|
+
outputs: { query: "query" },
|
|
762
|
+
queries: [{
|
|
763
|
+
propertyName: "fields",
|
|
764
|
+
predicate: QueryFieldComponent
|
|
765
|
+
}],
|
|
766
|
+
viewQueries: [{
|
|
767
|
+
propertyName: "modalTemplate",
|
|
768
|
+
first: true,
|
|
769
|
+
predicate: ["modalTemplate"],
|
|
770
|
+
descendants: true,
|
|
771
|
+
read: TemplateRef
|
|
772
|
+
}],
|
|
773
|
+
ngImport: i0,
|
|
774
|
+
template: "@if (!!fields) {\n <section class=\"flt\" aria-label=\"Filtros e busca\">\n <!-- Barra de filtros aplicados (chips) -->\n @if (filterCount > 0) {\n <div class=\"flt__applied\">\n <div class=\"flt__applied-title\">Filtros aplicados:</div>\n\n <ul class=\"flt__chips\" role=\"list\">\n @for (field of fields.toArray(); track field.labelText) {\n @if (!field.fixed && !field.empty) {\n\n @if (field.fieldType === 'group') {\n\n <li class=\"flt__chip-group\">\n <div class=\"flt__chip-group-head\">\n <span class=\"flt__chip-group-title\">{{ field.labelText }}</span>\n @if (!field.required) {\n <button\n type=\"button\"\n class=\"flt__chip-group-clear\"\n (click)=\"clear(field)\">\n <mat-icon aria-hidden=\"true\">close</mat-icon>\n </button>\n }\n </div>\n\n <ul class=\"flt__chip-group-items\" role=\"list\">\n @for (sub of field.fields; track sub.labelText) {\n <li class=\"flt__chip flt__chip--sub\">\n @if (sub.labelText) {\n <span class=\"flt__chip-label\">{{ sub.labelText }}:</span>\n }\n <span class=\"flt__chip-value\">{{ sub.value }}</span>\n\n @if (!sub.required) {\n <button\n type=\"button\"\n class=\"flt__chip-remove\"\n (click)=\"clear(field)\">\n <mat-icon aria-hidden=\"true\">close</mat-icon>\n </button>\n }\n </li>\n }\n </ul>\n </li>\n } @else {\n <li class=\"flt__chip\">\n <span class=\"flt__chip-label\">{{ field.labelText }}:</span>\n <span class=\"flt__chip-value\">{{ field.value }}</span>\n\n @if (!field.required) {\n <button\n type=\"button\"\n class=\"flt__chip-remove\"\n (click)=\"clear(field)\">\n <mat-icon aria-hidden=\"true\">close</mat-icon>\n </button>\n }\n </li>\n }\n\n }\n }\n </ul>\n\n <button type=\"button\" class=\"flt__clear\" (click)=\"clearAll()\">\n <mat-icon aria-hidden=\"true\">filter_alt_off</mat-icon>\n Limpar tudo\n </button>\n </div>\n }\n\n <div class=\"flt__body\">\n @for (field of fields; track field.name) {\n @if (field.fixed) {\n <div [ngClass]=\"field.fieldType\" class=\"flt__field\" >\n @if (field.fieldType === 'group') {\n <h3>{{ field.labelText }}</h3>\n }\n\n <mcl-query-form-field [field]=\"field\" [control]=\"field.formControl\"></mcl-query-form-field>\n </div>\n }\n }\n\n <div class=\"flt__separator\"></div>\n\n <!-- Ações -->\n <div class=\"flt__actions\">\n <button mat-stroked-button type=\"button\" (click)=\"openFilter($event)\">\n <mat-icon aria-hidden=\"true\">tune</mat-icon>\n Filtros avançados\n </button>\n </div>\n </div>\n </section>\n\n}\n\n",
|
|
775
|
+
styles: ["@charset \"UTF-8\";:host{--flt-bg: var(--lib-color-surface, var(--mat-sys-surface));--flt-fg: var(--lib-color-on-surface, var(--mat-sys-on-surface));--flt-muted: var(--lib-color-on-surface-variant, var(--mat-sys-on-surface-variant));--flt-border: var(--lib-color-outline-variant, var(--mat-sys-outline-variant));--flt-primary: var(--lib-color-primary, var(--mat-sys-primary));--flt-chip-bg: var(--lib-color-surface-container-low, var(--mat-sys-surface-container-low));--flt-radius: var(--mcl-radius-md, 12px);display:block}.flt{background:var(--flt-bg);border:1px solid var(--flt-border);border-radius:var(--flt-radius);box-shadow:var(--mcl-shadow-1, 0 1px 3px rgba(0, 0, 0, .05));margin-bottom:16px}.flt__applied{display:flex;align-items:center;gap:10px;padding:10px 16px;border-bottom:1px solid var(--flt-border);background:var(--flt-chip-bg);flex-wrap:wrap}.flt__applied-title{font-size:.8125rem;color:var(--flt-muted);white-space:nowrap}.flt__chips{display:flex;flex-wrap:wrap;gap:6px;list-style:none;padding:0;margin:0;flex:1 1 auto}.flt__chip{display:inline-flex;align-items:center;gap:6px;max-width:100%;height:30px;padding:0 6px 0 12px;border:1px solid var(--flt-border);border-radius:var(--mcl-radius-full, 999px);background:var(--flt-bg);color:var(--flt-fg)}.flt__chip-label{font-size:.78rem;font-weight:600;color:var(--flt-muted)}.flt__chip-value{font-size:.78rem;color:var(--flt-fg);font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:26ch}.flt__chip-remove{inline-size:20px;block-size:20px;display:grid;place-items:center;border:0;border-radius:var(--mcl-radius-full, 999px);background:transparent;color:var(--flt-muted);transition:background-color var(--mcl-transition, .18s ease),color var(--mcl-transition, .18s ease)}.flt__chip-remove mat-icon{font-size:16px;height:16px;width:16px}.flt__chip-remove:hover{background:color-mix(in oklab,var(--flt-fg) 8%,var(--flt-bg));color:var(--flt-fg)}.flt__chip-remove:focus-visible{outline:2px solid var(--flt-primary);outline-offset:2px}.flt__chip-group{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}.flt__chip-group-head{display:inline-flex;align-items:center;gap:2px}.flt__chip-group-title{display:inline-flex;align-items:center;height:30px;padding:0 10px;border-radius:var(--mcl-radius-full, 999px);background:color-mix(in oklab,var(--flt-primary) 10%,var(--flt-bg));color:var(--flt-primary);font-size:.78rem;font-weight:600;white-space:nowrap}.flt__chip-group-items{display:inline-flex;align-items:center;gap:6px;list-style:none;padding:0;margin:0}.flt__chip--sub{border-color:color-mix(in oklab,var(--flt-primary) 24%,var(--flt-border))}.flt__chip-group-clear{inline-size:22px;block-size:22px;display:grid;place-items:center;border-radius:var(--mcl-radius-full, 999px);border:0;background:transparent;color:var(--flt-muted);transition:background-color var(--mcl-transition, .18s ease),color var(--mcl-transition, .18s ease)}.flt__chip-group-clear mat-icon{font-size:16px;height:16px;width:16px}.flt__chip-group-clear:hover{background:color-mix(in oklab,var(--flt-fg) 8%,var(--flt-bg));color:var(--flt-fg)}.flt__clear{height:30px;padding:0 12px;display:inline-flex;align-items:center;gap:6px;border-radius:var(--mcl-radius-full, 999px);border:1px solid var(--flt-border);background:var(--flt-bg);color:var(--flt-muted);font-size:.8125rem;white-space:nowrap;transition:background-color var(--mcl-transition, .18s ease),border-color var(--mcl-transition, .18s ease),color var(--mcl-transition, .18s ease)}.flt__clear mat-icon{font-size:16px;height:16px;width:16px}.flt__clear:hover{background:color-mix(in oklab,var(--flt-fg) 5%,var(--flt-bg));color:var(--flt-fg)}.flt__body{display:flex;flex-wrap:wrap;gap:4px 16px;align-items:center;padding:16px 16px 4px}.flt__field{flex:1 1 220px;min-width:220px;max-width:340px}.flt__separator{flex:1 1 auto}.flt__actions{display:flex;justify-content:flex-end;gap:8px;padding-bottom:12px}@media(max-width:767.98px){.flt__body{padding:12px 12px 4px}.flt__field{flex-basis:100%;min-width:0;max-width:none}.flt__actions{width:100%;justify-content:stretch}.flt__actions button{width:100%}.flt__applied{padding-inline:12px}}\n"],
|
|
776
|
+
dependencies: [
|
|
777
|
+
{
|
|
778
|
+
kind: "ngmodule",
|
|
779
|
+
type: FormsModule
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
kind: "component",
|
|
783
|
+
type: MatIcon,
|
|
784
|
+
selector: "mat-icon",
|
|
785
|
+
inputs: [
|
|
786
|
+
"color",
|
|
787
|
+
"inline",
|
|
788
|
+
"svgIcon",
|
|
789
|
+
"fontSet",
|
|
790
|
+
"fontIcon"
|
|
791
|
+
],
|
|
792
|
+
exportAs: ["matIcon"]
|
|
793
|
+
},
|
|
794
|
+
{
|
|
795
|
+
kind: "component",
|
|
796
|
+
type: QueryFormFieldComponent,
|
|
797
|
+
selector: "mcl-query-form-field",
|
|
798
|
+
inputs: ["field", "control"]
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
kind: "directive",
|
|
802
|
+
type: NgClass,
|
|
803
|
+
selector: "[ngClass]",
|
|
804
|
+
inputs: ["class", "ngClass"]
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
kind: "component",
|
|
808
|
+
type: MatButton,
|
|
809
|
+
selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
|
|
810
|
+
inputs: ["matButton"],
|
|
811
|
+
exportAs: ["matButton", "matAnchor"]
|
|
812
|
+
}
|
|
813
|
+
],
|
|
814
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
815
|
+
});
|
|
816
|
+
};
|
|
817
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
818
|
+
minVersion: "12.0.0",
|
|
819
|
+
version: "22.3.2",
|
|
820
|
+
ngImport: i0,
|
|
821
|
+
type: QueryFormComponent,
|
|
822
|
+
decorators: [{
|
|
823
|
+
type: Component,
|
|
824
|
+
args: [{
|
|
825
|
+
selector: "mcl-query-form",
|
|
826
|
+
imports: [
|
|
827
|
+
FormsModule,
|
|
828
|
+
MatIcon,
|
|
829
|
+
QueryFormFieldComponent,
|
|
830
|
+
NgClass,
|
|
831
|
+
MatButton
|
|
832
|
+
],
|
|
833
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
834
|
+
template: "@if (!!fields) {\n <section class=\"flt\" aria-label=\"Filtros e busca\">\n <!-- Barra de filtros aplicados (chips) -->\n @if (filterCount > 0) {\n <div class=\"flt__applied\">\n <div class=\"flt__applied-title\">Filtros aplicados:</div>\n\n <ul class=\"flt__chips\" role=\"list\">\n @for (field of fields.toArray(); track field.labelText) {\n @if (!field.fixed && !field.empty) {\n\n @if (field.fieldType === 'group') {\n\n <li class=\"flt__chip-group\">\n <div class=\"flt__chip-group-head\">\n <span class=\"flt__chip-group-title\">{{ field.labelText }}</span>\n @if (!field.required) {\n <button\n type=\"button\"\n class=\"flt__chip-group-clear\"\n (click)=\"clear(field)\">\n <mat-icon aria-hidden=\"true\">close</mat-icon>\n </button>\n }\n </div>\n\n <ul class=\"flt__chip-group-items\" role=\"list\">\n @for (sub of field.fields; track sub.labelText) {\n <li class=\"flt__chip flt__chip--sub\">\n @if (sub.labelText) {\n <span class=\"flt__chip-label\">{{ sub.labelText }}:</span>\n }\n <span class=\"flt__chip-value\">{{ sub.value }}</span>\n\n @if (!sub.required) {\n <button\n type=\"button\"\n class=\"flt__chip-remove\"\n (click)=\"clear(field)\">\n <mat-icon aria-hidden=\"true\">close</mat-icon>\n </button>\n }\n </li>\n }\n </ul>\n </li>\n } @else {\n <li class=\"flt__chip\">\n <span class=\"flt__chip-label\">{{ field.labelText }}:</span>\n <span class=\"flt__chip-value\">{{ field.value }}</span>\n\n @if (!field.required) {\n <button\n type=\"button\"\n class=\"flt__chip-remove\"\n (click)=\"clear(field)\">\n <mat-icon aria-hidden=\"true\">close</mat-icon>\n </button>\n }\n </li>\n }\n\n }\n }\n </ul>\n\n <button type=\"button\" class=\"flt__clear\" (click)=\"clearAll()\">\n <mat-icon aria-hidden=\"true\">filter_alt_off</mat-icon>\n Limpar tudo\n </button>\n </div>\n }\n\n <div class=\"flt__body\">\n @for (field of fields; track field.name) {\n @if (field.fixed) {\n <div [ngClass]=\"field.fieldType\" class=\"flt__field\" >\n @if (field.fieldType === 'group') {\n <h3>{{ field.labelText }}</h3>\n }\n\n <mcl-query-form-field [field]=\"field\" [control]=\"field.formControl\"></mcl-query-form-field>\n </div>\n }\n }\n\n <div class=\"flt__separator\"></div>\n\n <!-- Ações -->\n <div class=\"flt__actions\">\n <button mat-stroked-button type=\"button\" (click)=\"openFilter($event)\">\n <mat-icon aria-hidden=\"true\">tune</mat-icon>\n Filtros avançados\n </button>\n </div>\n </div>\n </section>\n\n}\n\n",
|
|
835
|
+
styles: ["@charset \"UTF-8\";:host{--flt-bg: var(--lib-color-surface, var(--mat-sys-surface));--flt-fg: var(--lib-color-on-surface, var(--mat-sys-on-surface));--flt-muted: var(--lib-color-on-surface-variant, var(--mat-sys-on-surface-variant));--flt-border: var(--lib-color-outline-variant, var(--mat-sys-outline-variant));--flt-primary: var(--lib-color-primary, var(--mat-sys-primary));--flt-chip-bg: var(--lib-color-surface-container-low, var(--mat-sys-surface-container-low));--flt-radius: var(--mcl-radius-md, 12px);display:block}.flt{background:var(--flt-bg);border:1px solid var(--flt-border);border-radius:var(--flt-radius);box-shadow:var(--mcl-shadow-1, 0 1px 3px rgba(0, 0, 0, .05));margin-bottom:16px}.flt__applied{display:flex;align-items:center;gap:10px;padding:10px 16px;border-bottom:1px solid var(--flt-border);background:var(--flt-chip-bg);flex-wrap:wrap}.flt__applied-title{font-size:.8125rem;color:var(--flt-muted);white-space:nowrap}.flt__chips{display:flex;flex-wrap:wrap;gap:6px;list-style:none;padding:0;margin:0;flex:1 1 auto}.flt__chip{display:inline-flex;align-items:center;gap:6px;max-width:100%;height:30px;padding:0 6px 0 12px;border:1px solid var(--flt-border);border-radius:var(--mcl-radius-full, 999px);background:var(--flt-bg);color:var(--flt-fg)}.flt__chip-label{font-size:.78rem;font-weight:600;color:var(--flt-muted)}.flt__chip-value{font-size:.78rem;color:var(--flt-fg);font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:26ch}.flt__chip-remove{inline-size:20px;block-size:20px;display:grid;place-items:center;border:0;border-radius:var(--mcl-radius-full, 999px);background:transparent;color:var(--flt-muted);transition:background-color var(--mcl-transition, .18s ease),color var(--mcl-transition, .18s ease)}.flt__chip-remove mat-icon{font-size:16px;height:16px;width:16px}.flt__chip-remove:hover{background:color-mix(in oklab,var(--flt-fg) 8%,var(--flt-bg));color:var(--flt-fg)}.flt__chip-remove:focus-visible{outline:2px solid var(--flt-primary);outline-offset:2px}.flt__chip-group{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}.flt__chip-group-head{display:inline-flex;align-items:center;gap:2px}.flt__chip-group-title{display:inline-flex;align-items:center;height:30px;padding:0 10px;border-radius:var(--mcl-radius-full, 999px);background:color-mix(in oklab,var(--flt-primary) 10%,var(--flt-bg));color:var(--flt-primary);font-size:.78rem;font-weight:600;white-space:nowrap}.flt__chip-group-items{display:inline-flex;align-items:center;gap:6px;list-style:none;padding:0;margin:0}.flt__chip--sub{border-color:color-mix(in oklab,var(--flt-primary) 24%,var(--flt-border))}.flt__chip-group-clear{inline-size:22px;block-size:22px;display:grid;place-items:center;border-radius:var(--mcl-radius-full, 999px);border:0;background:transparent;color:var(--flt-muted);transition:background-color var(--mcl-transition, .18s ease),color var(--mcl-transition, .18s ease)}.flt__chip-group-clear mat-icon{font-size:16px;height:16px;width:16px}.flt__chip-group-clear:hover{background:color-mix(in oklab,var(--flt-fg) 8%,var(--flt-bg));color:var(--flt-fg)}.flt__clear{height:30px;padding:0 12px;display:inline-flex;align-items:center;gap:6px;border-radius:var(--mcl-radius-full, 999px);border:1px solid var(--flt-border);background:var(--flt-bg);color:var(--flt-muted);font-size:.8125rem;white-space:nowrap;transition:background-color var(--mcl-transition, .18s ease),border-color var(--mcl-transition, .18s ease),color var(--mcl-transition, .18s ease)}.flt__clear mat-icon{font-size:16px;height:16px;width:16px}.flt__clear:hover{background:color-mix(in oklab,var(--flt-fg) 5%,var(--flt-bg));color:var(--flt-fg)}.flt__body{display:flex;flex-wrap:wrap;gap:4px 16px;align-items:center;padding:16px 16px 4px}.flt__field{flex:1 1 220px;min-width:220px;max-width:340px}.flt__separator{flex:1 1 auto}.flt__actions{display:flex;justify-content:flex-end;gap:8px;padding-bottom:12px}@media(max-width:767.98px){.flt__body{padding:12px 12px 4px}.flt__field{flex-basis:100%;min-width:0;max-width:none}.flt__actions{width:100%;justify-content:stretch}.flt__actions button{width:100%}.flt__applied{padding-inline:12px}}\n"]
|
|
836
|
+
}]
|
|
837
|
+
}],
|
|
838
|
+
ctorParameters: () => [
|
|
839
|
+
{ type: Router },
|
|
840
|
+
{ type: DialogService },
|
|
841
|
+
{ type: ActivatedRoute }
|
|
842
|
+
],
|
|
843
|
+
propDecorators: {
|
|
844
|
+
fields: [{
|
|
845
|
+
type: ContentChildren,
|
|
846
|
+
args: [QueryFieldComponent]
|
|
847
|
+
}],
|
|
848
|
+
modalTemplate: [{
|
|
849
|
+
type: ViewChild,
|
|
850
|
+
args: ["modalTemplate", { read: TemplateRef }]
|
|
851
|
+
}],
|
|
852
|
+
query: [{ type: Output }]
|
|
853
|
+
}
|
|
854
|
+
});
|
|
855
|
+
var AbstractConsultaPaginadaComponent = class AbstractConsultaPaginadaComponent {
|
|
856
|
+
router = inject(Router);
|
|
857
|
+
dialogService = inject(DialogService);
|
|
858
|
+
loaderService = inject(LoaderService);
|
|
859
|
+
timeoutConsulta;
|
|
860
|
+
filtro = {};
|
|
861
|
+
page;
|
|
862
|
+
table;
|
|
863
|
+
ngAfterViewInit() {
|
|
864
|
+
this.reset();
|
|
865
|
+
}
|
|
866
|
+
async reset(filtro = this.filtro) {
|
|
867
|
+
this.filtro = filtro;
|
|
868
|
+
this.page = void 0;
|
|
869
|
+
await this.busca();
|
|
870
|
+
}
|
|
871
|
+
get tamanhoPagina() {
|
|
872
|
+
return this.page?.tamanhoPagina || this.page?.size;
|
|
873
|
+
}
|
|
874
|
+
async busca(event = {
|
|
875
|
+
type: "numeric",
|
|
876
|
+
page: 1,
|
|
877
|
+
size: 10
|
|
878
|
+
}) {
|
|
879
|
+
if (event.type === "numeric") {
|
|
880
|
+
clearTimeout(this.timeoutConsulta);
|
|
881
|
+
this.timeoutConsulta = setTimeout(async () => {
|
|
882
|
+
this.page = await lastValueFrom(this.table.loadingAround(this.consultaEntidades(event.page, event.size)));
|
|
883
|
+
}, 300);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
async remove(entidade) {
|
|
887
|
+
if (await this.dialogService.confirma("mcl.consulta.confirma-remocao").toPromise()) await this.loaderService.listen(this.deleteEntidade(entidade)).toPromise();
|
|
888
|
+
}
|
|
889
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
890
|
+
minVersion: "12.0.0",
|
|
891
|
+
version: "22.3.2",
|
|
892
|
+
ngImport: i0,
|
|
893
|
+
type: AbstractConsultaPaginadaComponent,
|
|
894
|
+
deps: [],
|
|
895
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
896
|
+
});
|
|
897
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
898
|
+
minVersion: "14.0.0",
|
|
899
|
+
version: "22.3.2",
|
|
900
|
+
type: AbstractConsultaPaginadaComponent,
|
|
901
|
+
isStandalone: true,
|
|
902
|
+
selector: "ng-component",
|
|
903
|
+
viewQueries: [{
|
|
904
|
+
propertyName: "table",
|
|
905
|
+
first: true,
|
|
906
|
+
predicate: PaginatedTableComponent,
|
|
907
|
+
descendants: true
|
|
908
|
+
}],
|
|
909
|
+
ngImport: i0,
|
|
910
|
+
template: "",
|
|
911
|
+
isInline: true,
|
|
912
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
913
|
+
});
|
|
914
|
+
};
|
|
915
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
916
|
+
minVersion: "12.0.0",
|
|
917
|
+
version: "22.3.2",
|
|
918
|
+
ngImport: i0,
|
|
919
|
+
type: AbstractConsultaPaginadaComponent,
|
|
920
|
+
decorators: [{
|
|
921
|
+
type: Component,
|
|
922
|
+
args: [{
|
|
923
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
924
|
+
template: ""
|
|
925
|
+
}]
|
|
926
|
+
}],
|
|
927
|
+
propDecorators: { table: [{
|
|
928
|
+
type: ViewChild,
|
|
929
|
+
args: [PaginatedTableComponent]
|
|
930
|
+
}] }
|
|
931
|
+
});
|
|
932
|
+
var AbstractEdicaoComponent = class AbstractEdicaoComponent {
|
|
933
|
+
entidade = {};
|
|
934
|
+
router = inject(Router);
|
|
935
|
+
activatedRoute = inject(ActivatedRoute);
|
|
936
|
+
mensageriaService = inject(MensageriaService);
|
|
937
|
+
loaderService = inject(LoaderService);
|
|
938
|
+
ngOnInit() {
|
|
939
|
+
if (!!this.detalhaEntidade) observaParametrosDaRota(this.activatedRoute).subscribe((params) => {
|
|
940
|
+
if (params["id"]) this.loaderService.listen(this.detalhaEntidade(params["id"])).subscribe((entidade) => this.entidade = entidade);
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
async salva(form) {
|
|
944
|
+
if (!form.valid) return;
|
|
945
|
+
await this.loaderService.listen(this.salvaEntidade()).toPromise();
|
|
946
|
+
this.mensageriaService.addMensagem("mcl.edicao.salvo-sucesso");
|
|
947
|
+
}
|
|
948
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
949
|
+
minVersion: "12.0.0",
|
|
950
|
+
version: "22.3.2",
|
|
951
|
+
ngImport: i0,
|
|
952
|
+
type: AbstractEdicaoComponent,
|
|
953
|
+
deps: [],
|
|
954
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
955
|
+
});
|
|
956
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
957
|
+
minVersion: "14.0.0",
|
|
958
|
+
version: "22.3.2",
|
|
959
|
+
type: AbstractEdicaoComponent,
|
|
960
|
+
isStandalone: true,
|
|
961
|
+
selector: "ng-component",
|
|
962
|
+
ngImport: i0,
|
|
963
|
+
template: "",
|
|
964
|
+
isInline: true,
|
|
965
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
966
|
+
});
|
|
967
|
+
};
|
|
968
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
969
|
+
minVersion: "12.0.0",
|
|
970
|
+
version: "22.3.2",
|
|
971
|
+
ngImport: i0,
|
|
972
|
+
type: AbstractEdicaoComponent,
|
|
973
|
+
decorators: [{
|
|
974
|
+
type: Component,
|
|
975
|
+
args: [{
|
|
976
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
977
|
+
template: ""
|
|
978
|
+
}]
|
|
979
|
+
}]
|
|
980
|
+
});
|
|
981
|
+
var AbstractEdicaoModalComponent = class {
|
|
982
|
+
router = inject(Router);
|
|
983
|
+
activatedRoute = inject(ActivatedRoute);
|
|
984
|
+
dialogService = inject(DialogService);
|
|
985
|
+
loaderService = inject(LoaderService);
|
|
986
|
+
mensageriaService = inject(MensageriaService);
|
|
987
|
+
dialogRef = inject(MatDialogRef);
|
|
988
|
+
async salva(form) {
|
|
989
|
+
if (!form.valid) return;
|
|
990
|
+
const salvo = await this.loaderService.listen(this.salvaEntidade()).toPromise();
|
|
991
|
+
this.mensageriaService.addMensagem("mcl.edicao.salvo-sucesso");
|
|
992
|
+
this.dialogRef.close(salvo);
|
|
993
|
+
}
|
|
994
|
+
async remove(entidade) {
|
|
995
|
+
if (!!this.deleteEntidade) {
|
|
996
|
+
if (await this.dialogService.confirma("mcl.consulta.confirma-remocao").toPromise()) {
|
|
997
|
+
await this.loaderService.listen(this.deleteEntidade(entidade)).toPromise();
|
|
998
|
+
this.dialogRef.close(true);
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
};
|
|
546
1003
|
export { AbstractConsultaPaginadaComponent, AbstractEdicaoComponent, AbstractEdicaoModalComponent, QueryFieldComponent, QueryFormComponent, QueryFormFieldComponent, QueryModalFormComponent };
|
|
547
|
-
|
|
1004
|
+
|
|
1005
|
+
//# sourceMappingURL=main-class-componentes-crud.mjs.map
|