@main-class/componentes 3.2.6 → 3.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/crud/index.d.ts +7 -0
  2. package/crud/src/abstract-consulta-paginada-component.d.ts +24 -0
  3. package/crud/src/abstract-edicao-component.d.ts +19 -0
  4. package/crud/src/abstract-edicao-modal-component.d.ts +19 -0
  5. package/crud/src/query/query-field/query-field.component.d.ts +37 -0
  6. package/crud/src/query/query-form-field/query-form-field.component.d.ts +11 -0
  7. package/crud/src/query/query-form.component.d.ts +23 -0
  8. package/crud/src/query/query-modal-form/query-modal-form.component.d.ts +13 -0
  9. package/dialog/index.d.ts +10 -0
  10. package/dialog/src/dialog-confirmacao/dialog-confirmacao.component.d.ts +23 -0
  11. package/dialog/src/dialog-iframe/dialog-iframe.component.d.ts +21 -0
  12. package/dialog/src/dialog-sidebar/modal-template/modal-body.directive.d.ts +9 -0
  13. package/dialog/src/dialog-sidebar/modal-template/modal-close.directive.d.ts +9 -0
  14. package/dialog/src/dialog-sidebar/modal-template/modal-footer.directive.d.ts +6 -0
  15. package/dialog/src/dialog-sidebar/modal-template/modal-header.directive.d.ts +6 -0
  16. package/dialog/src/dialog-sidebar/modal-template/modal-template.component.d.ts +12 -0
  17. package/dialog/src/dialog-sidebar/modal.component.d.ts +8 -0
  18. package/dialog/src/dialog-sidebar/sidebar-modal-ref.d.ts +17 -0
  19. package/dialog/src/dialog.service.d.ts +26 -0
  20. package/fesm2022/main-class-componentes-crud.mjs +458 -0
  21. package/fesm2022/main-class-componentes-crud.mjs.map +1 -0
  22. package/fesm2022/main-class-componentes-dialog.mjs +393 -0
  23. package/fesm2022/main-class-componentes-dialog.mjs.map +1 -0
  24. package/fesm2022/main-class-componentes-form.mjs +209 -0
  25. package/fesm2022/main-class-componentes-form.mjs.map +1 -0
  26. package/fesm2022/main-class-componentes-input.mjs +1861 -0
  27. package/fesm2022/main-class-componentes-input.mjs.map +1 -0
  28. package/fesm2022/main-class-componentes-loader.mjs +213 -0
  29. package/fesm2022/main-class-componentes-loader.mjs.map +1 -0
  30. package/fesm2022/main-class-componentes-pipe.mjs +27 -0
  31. package/fesm2022/main-class-componentes-pipe.mjs.map +1 -0
  32. package/fesm2022/main-class-componentes-table.mjs +443 -0
  33. package/fesm2022/main-class-componentes-table.mjs.map +1 -0
  34. package/form/index.d.ts +3 -0
  35. package/form/src/form.component.d.ts +24 -0
  36. package/form/src/mensagens-erro/mensagens-erro.component.d.ts +17 -0
  37. package/form/src/single-click.directive.d.ts +13 -0
  38. package/input/index.d.ts +25 -0
  39. package/input/src/abstract-mat-form-field-control.d.ts +50 -0
  40. package/input/src/abstract-mat-form-field-select-control.d.ts +28 -0
  41. package/input/src/input-currency/input-currency.component.d.ts +11 -0
  42. package/input/src/input-datetime/input-datetime.component.d.ts +28 -0
  43. package/input/src/input-fileupload/input-fileupload.component.d.ts +69 -0
  44. package/input/src/input-fileupload/input-fileupload.directive.d.ts +8 -0
  45. package/input/src/input-mask/input-cep.component.d.ts +7 -0
  46. package/input/src/input-mask/input-cnpj.component.d.ts +7 -0
  47. package/input/src/input-mask/input-cpf-cnpj.component.d.ts +8 -0
  48. package/input/src/input-mask/input-cpf.component.d.ts +7 -0
  49. package/input/src/input-mask/input-mask.component.d.ts +24 -0
  50. package/input/src/input-mask/input-phone.component.d.ts +7 -0
  51. package/input/src/input-telefone-internacional/input-telefone-internacional-validator.directive.d.ts +8 -0
  52. package/input/src/input-telefone-internacional/input-telefone-internacional.component.d.ts +21 -0
  53. package/input/src/option-checkbox/all-option-checkbox.component.d.ts +18 -0
  54. package/input/src/option-checkbox/node-pool.d.ts +23 -0
  55. package/input/src/option-checkbox/option-checkbox-group.component.d.ts +25 -0
  56. package/input/src/option-checkbox/option-checkbox.component.d.ts +23 -0
  57. package/input/src/option-checkbox/option-checkbox.service.d.ts +16 -0
  58. package/input/src/option-checkbox/option-node.d.ts +13 -0
  59. package/input/src/select-autocomplete/select-autocomplete.component.d.ts +17 -0
  60. package/input/src/select-chips/select-chips.component.d.ts +11 -0
  61. package/input/src/select-many-checkbox/select-many-checkbox.component.d.ts +11 -0
  62. package/input/src/select-option/delegate-option-provider.directive.d.ts +13 -0
  63. package/input/src/select-option/select-option-provider.d.ts +10 -0
  64. package/input/src/select-option/select-option.component.d.ts +10 -0
  65. package/input/src/select-option/select-option.d.ts +4 -0
  66. package/input/src/select-radio/select-radio.component.d.ts +8 -0
  67. package/loader/index.d.ts +2 -0
  68. package/loader/src/loader.component.d.ts +25 -0
  69. package/loader/src/loader.service.d.ts +20 -0
  70. package/package.json +5 -5
  71. package/pipe/index.d.ts +1 -0
  72. package/pipe/src/nome-resumido.pipe.d.ts +7 -0
  73. package/table/index.d.ts +9 -0
  74. package/table/src/column/column-cell.directive.d.ts +8 -0
  75. package/table/src/column/column-footer.directive.d.ts +8 -0
  76. package/table/src/column/column-header.directive.d.ts +8 -0
  77. package/table/src/column/column.directive.d.ts +16 -0
  78. package/table/src/numeric-paginator/numeric-paginator.component.d.ts +6 -0
  79. package/table/src/paginated-table/paginated-table.component.d.ts +58 -0
  80. package/table/src/paginator-i18n.d.ts +8 -0
  81. package/table/src/table/table.component.d.ts +39 -0
  82. package/table/src/td/td.component.d.ts +8 -0
  83. package/table/src/th/th.component.d.ts +8 -0
  84. package/table/src/undefined-paginator/undefined-paginator.component.d.ts +25 -0
@@ -0,0 +1,1861 @@
1
+ import * as i1 from '@angular/forms';
2
+ import { NgControl, FormGroupDirective, FormControl, FormsModule, NG_VALIDATORS, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
3
+ import { Subject, BehaviorSubject, concat, of, debounceTime, Observable, combineLatest } from 'rxjs';
4
+ import * as i0 from '@angular/core';
5
+ import { inject, Input, HostBinding, ViewChild, Component, InjectionToken, QueryList, ContentChildren, EventEmitter, Output, LOCALE_ID, Optional, Self, Inject, Directive, Injectable } from '@angular/core';
6
+ import * as i1$2 from '@angular/material/core';
7
+ import { ErrorStateMatcher, MAT_DATE_LOCALE } from '@angular/material/core';
8
+ import { coerceBooleanProperty } from '@angular/cdk/coercion';
9
+ import { map, switchMap } from 'rxjs/operators';
10
+ import { MatInput } from '@angular/material/input';
11
+ import { monetarioMask } from '@main-class/componentes/misc';
12
+ import { MatFormFieldControl, MatPrefix, MatSuffix } from '@angular/material/form-field';
13
+ import * as i1$1 from '@mat-datetimepicker/core';
14
+ import { MAT_DATETIME_FORMATS, DatetimeAdapter, MatDatetimepickerModule } from '@mat-datetimepicker/core';
15
+ import { MatMomentDatetimeModule, MomentDatetimeAdapter } from '@mat-datetimepicker/moment';
16
+ import moment from 'moment';
17
+ import { ARQUIVO_MANAGER_SERVICE, PreviewArquivoComponent, DownloadArquivoDirective } from '@main-class/componentes/arquivo';
18
+ import { MatChipGrid, MatChip, MatChipInput } from '@angular/material/chips';
19
+ import { NgClass, AsyncPipe, NgStyle } from '@angular/common';
20
+ import { MatProgressSpinner } from '@angular/material/progress-spinner';
21
+ import { MatIcon } from '@angular/material/icon';
22
+ import { MatIconButton } from '@angular/material/button';
23
+ import { MatTooltip } from '@angular/material/tooltip';
24
+ import { MatCheckbox } from '@angular/material/checkbox';
25
+ import { MatAutocompleteTrigger, MatAutocomplete, MatOption } from '@angular/material/autocomplete';
26
+ import { MatRadioGroup, MatRadioButton } from '@angular/material/radio';
27
+ import * as i1$3 from 'lac-mat-tel-input';
28
+ import { LacMatTelInputModule, phoneNumberValidator } from 'lac-mat-tel-input';
29
+
30
+ class AbstractMatFormFieldControl {
31
+ errorStateMatcher = inject(ErrorStateMatcher);
32
+ ngControl = inject(NgControl, { optional: true, self: true });
33
+ parentFormGroup = inject(FormGroupDirective, { optional: true });
34
+ static nextId = 0;
35
+ $value;
36
+ $placeholder = '';
37
+ $disabled = false;
38
+ $required = false;
39
+ focused = false;
40
+ constructor() {
41
+ if (this.ngControl != null) {
42
+ this.ngControl.valueAccessor = this;
43
+ }
44
+ }
45
+ _input;
46
+ get input() {
47
+ return this._input;
48
+ }
49
+ set input(value) {
50
+ this._input = value;
51
+ }
52
+ stateChanges = new Subject();
53
+ id = `custom-input-${AbstractMatFormFieldControl.nextId++}`;
54
+ describedBy = '';
55
+ onChange = (val) => {
56
+ };
57
+ onTouched = () => {
58
+ };
59
+ get value() {
60
+ return this.$value;
61
+ }
62
+ set value(value) {
63
+ this.$value = value;
64
+ this.onChange(value);
65
+ this.stateChanges.next();
66
+ }
67
+ get empty() {
68
+ return !this.value;
69
+ }
70
+ get autofilled() {
71
+ return false;
72
+ }
73
+ get userAriaDescribedBy() {
74
+ return undefined;
75
+ }
76
+ get disableAutomaticLabeling() {
77
+ return undefined;
78
+ }
79
+ onContainerClick(event) {
80
+ }
81
+ get shouldLabelFloat() {
82
+ return !this.empty || (this.input && this.input.nativeElement.value) || this.focused;
83
+ }
84
+ get placeholder() {
85
+ return this.$placeholder;
86
+ }
87
+ set placeholder(plh) {
88
+ this.$placeholder = plh;
89
+ this.stateChanges.next();
90
+ }
91
+ get required() {
92
+ return this.$required;
93
+ }
94
+ set required(value) {
95
+ this.$required = coerceBooleanProperty(value);
96
+ this.stateChanges.next();
97
+ }
98
+ get disabled() {
99
+ return this.$disabled;
100
+ }
101
+ set disabled(value) {
102
+ this.$disabled = coerceBooleanProperty(value);
103
+ this.stateChanges.next();
104
+ }
105
+ get errorState() {
106
+ return this.errorStateMatcher.isErrorState(this.ngControl?.control, this.parentFormGroup);
107
+ }
108
+ get controlType() {
109
+ return 'custom-input';
110
+ }
111
+ setDescribedByIds(ids) {
112
+ this.describedBy = ids.join(' ');
113
+ }
114
+ ngOnDestroy() {
115
+ this.stateChanges.complete();
116
+ }
117
+ registerOnTouched(fn) {
118
+ this.onTouched = fn;
119
+ }
120
+ registerOnChange(fn) {
121
+ this.onChange = fn;
122
+ }
123
+ setDisabledState(isDisabled) {
124
+ this.disabled = isDisabled;
125
+ }
126
+ writeValue(value) {
127
+ this.$value = value;
128
+ }
129
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractMatFormFieldControl, deps: [], target: i0.ɵɵFactoryTarget.Component });
130
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: AbstractMatFormFieldControl, isStandalone: true, selector: "ng-component", inputs: { placeholder: "placeholder", required: "required", disabled: "disabled" }, host: { properties: { "id": "this.id", "attr.aria-describedby": "this.describedBy", "class.floating": "this.shouldLabelFloat" } }, viewQueries: [{ propertyName: "_input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: '', isInline: true });
131
+ }
132
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractMatFormFieldControl, decorators: [{
133
+ type: Component,
134
+ args: [{
135
+ template: ''
136
+ }]
137
+ }], ctorParameters: () => [], propDecorators: { _input: [{
138
+ type: ViewChild,
139
+ args: ['input']
140
+ }], id: [{
141
+ type: HostBinding
142
+ }], describedBy: [{
143
+ type: HostBinding,
144
+ args: ['attr.aria-describedby']
145
+ }], shouldLabelFloat: [{
146
+ type: HostBinding,
147
+ args: ['class.floating']
148
+ }], placeholder: [{
149
+ type: Input
150
+ }], required: [{
151
+ type: Input
152
+ }], disabled: [{
153
+ type: Input
154
+ }] } });
155
+
156
+ const SELECT_OPTION_PROVIDER = new InjectionToken('mainclass.SELECT_OPTION_PROVIDER');
157
+
158
+ class SelectOptionComponent {
159
+ value;
160
+ $label;
161
+ set label(label) {
162
+ this.$label = label !== null && label !== undefined ? String(label) : undefined;
163
+ }
164
+ get label() {
165
+ return this.$label;
166
+ }
167
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
168
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: SelectOptionComponent, isStandalone: true, selector: "mcl-select-option", inputs: { value: "value", label: "label" }, ngImport: i0, template: "", styles: [""] });
169
+ }
170
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectOptionComponent, decorators: [{
171
+ type: Component,
172
+ args: [{ selector: 'mcl-select-option', imports: [], template: "" }]
173
+ }], propDecorators: { value: [{
174
+ type: Input
175
+ }], label: [{
176
+ type: Input
177
+ }] } });
178
+
179
+ class AbstractMatFormFieldSelectControl extends AbstractMatFormFieldControl {
180
+ optionProvider = inject(SELECT_OPTION_PROVIDER, { self: true, optional: true });
181
+ optionsSubscription;
182
+ $args = new BehaviorSubject(undefined);
183
+ wvt;
184
+ filteredOptions;
185
+ control = new FormControl('');
186
+ trackBy = (val) => val;
187
+ options = new QueryList();
188
+ defaultOptionProvider = {
189
+ type: () => 'object',
190
+ label: (value) => {
191
+ return this.options.find(op => this.doTrackBy(op.value) === this.doTrackBy(value))?.label || '';
192
+ },
193
+ provide: (search) => {
194
+ return concat(of({}), this.options.changes).pipe(map(() => {
195
+ return this.options.filter(op => {
196
+ if (!search || typeof search !== 'string') {
197
+ return true;
198
+ }
199
+ if (op.label !== undefined && op.label !== null) {
200
+ return String(op.label).toLowerCase()?.indexOf(search.toLowerCase()) >= 0;
201
+ }
202
+ return false;
203
+ });
204
+ }));
205
+ }
206
+ };
207
+ doTrackBy(val) {
208
+ if (this.optionProvider && this.optionProvider.trackBy) {
209
+ return this.optionProvider.trackBy(val);
210
+ }
211
+ return this.trackBy(val);
212
+ }
213
+ set args(args) {
214
+ this.$args.next(args);
215
+ }
216
+ ngAfterContentInit() {
217
+ this.filteredOptions = concat(of(''), this.control.valueChanges).pipe(debounceTime(300), switchMap(value => {
218
+ return (this.optionProvider || this.defaultOptionProvider).provide(value);
219
+ }));
220
+ this.optionsSubscription = this.options.changes.subscribe(() => {
221
+ if (this.value !== undefined && this.value !== null) {
222
+ this.control.setValue((this.optionProvider || this.defaultOptionProvider).label(this.value));
223
+ }
224
+ });
225
+ this.options.notifyOnChanges();
226
+ }
227
+ ngOnDestroy() {
228
+ super.ngOnDestroy();
229
+ this.optionsSubscription?.unsubscribe();
230
+ }
231
+ seleciona(event) {
232
+ this.doSeleciona(event.option.value);
233
+ }
234
+ doSeleciona(value) {
235
+ this.onTouched();
236
+ if (value) {
237
+ this.value = value;
238
+ this.control.setValue((this.optionProvider || this.defaultOptionProvider).label(value));
239
+ }
240
+ else {
241
+ this.value = undefined;
242
+ this.control.setValue('');
243
+ }
244
+ this.stateChanges.next();
245
+ }
246
+ writeValue(value) {
247
+ clearTimeout(this.wvt);
248
+ this.wvt = setTimeout(() => {
249
+ super.writeValue(value);
250
+ if (value) {
251
+ this.control.setValue((this.optionProvider || this.defaultOptionProvider).label(value));
252
+ }
253
+ else {
254
+ this.control.setValue('');
255
+ }
256
+ }, 150);
257
+ }
258
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractMatFormFieldSelectControl, deps: null, target: i0.ɵɵFactoryTarget.Component });
259
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: AbstractMatFormFieldSelectControl, isStandalone: true, selector: "ng-component", inputs: { trackBy: "trackBy", args: "args" }, queries: [{ propertyName: "options", predicate: SelectOptionComponent }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
260
+ }
261
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractMatFormFieldSelectControl, decorators: [{
262
+ type: Component,
263
+ args: [{
264
+ template: ''
265
+ }]
266
+ }], propDecorators: { trackBy: [{
267
+ type: Input
268
+ }], options: [{
269
+ type: ContentChildren,
270
+ args: [SelectOptionComponent]
271
+ }], args: [{
272
+ type: Input
273
+ }] } });
274
+
275
+ class InputCurrencyComponent extends AbstractMatFormFieldControl {
276
+ get value() {
277
+ return super.value;
278
+ }
279
+ set value(value) {
280
+ const unformatted = this.removeMask(value);
281
+ if (unformatted) {
282
+ super.value = unformatted;
283
+ if (!!this.input) {
284
+ this.input.nativeElement.text = this.applyMask(unformatted);
285
+ }
286
+ }
287
+ }
288
+ applyMask(value) {
289
+ if (value) {
290
+ return monetarioMask(value);
291
+ }
292
+ return undefined;
293
+ }
294
+ removeMask(value) {
295
+ if (value) {
296
+ return monetarioMask(value, '', '', '.');
297
+ }
298
+ return undefined;
299
+ }
300
+ writeValue(value) {
301
+ super.writeValue(value);
302
+ const masked = this.applyMask(value);
303
+ if (!!this.input && masked !== this.value) {
304
+ this.input.nativeElement.text = masked;
305
+ }
306
+ }
307
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCurrencyComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
308
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: InputCurrencyComponent, isStandalone: true, selector: "mcl-input[currency]", providers: [
309
+ {
310
+ provide: MatFormFieldControl,
311
+ useExisting: InputCurrencyComponent
312
+ }
313
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput [(ngModel)]=\"value\"\n [placeholder]=\"placeholder\"\n (focusin)=\"onTouched()\"/>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }] });
314
+ }
315
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCurrencyComponent, decorators: [{
316
+ type: Component,
317
+ args: [{ selector: 'mcl-input[currency]', imports: [
318
+ FormsModule,
319
+ MatInput
320
+ ], providers: [
321
+ {
322
+ provide: MatFormFieldControl,
323
+ useExisting: InputCurrencyComponent
324
+ }
325
+ ], template: "<input matInput [(ngModel)]=\"value\"\n [placeholder]=\"placeholder\"\n (focusin)=\"onTouched()\"/>\n" }]
326
+ }] });
327
+
328
+ class InputMaskComponent extends AbstractMatFormFieldControl {
329
+ /**
330
+ * Example ###.###
331
+ * @private
332
+ */
333
+ $mask;
334
+ keepMask;
335
+ onFocus = new EventEmitter();
336
+ onBlur = new EventEmitter();
337
+ get value() {
338
+ return super.value;
339
+ }
340
+ set value(value) {
341
+ const unformatted = this.removeMask(value);
342
+ if (unformatted) {
343
+ super.value = this.keepMask ? this.applyMask(unformatted) : unformatted;
344
+ if (!!this.input) {
345
+ this.input.nativeElement.text = this.applyMask(unformatted);
346
+ }
347
+ }
348
+ }
349
+ set mask(mask) {
350
+ if (this.$mask !== mask) {
351
+ this.$mask = mask;
352
+ this.writeValue(this.value);
353
+ }
354
+ }
355
+ ngAfterViewInit() {
356
+ if (this.input && this.mask) {
357
+ const masked = this.applyMask(this.value);
358
+ if (!!this.input && masked !== this.value) {
359
+ this.input.nativeElement.text = masked;
360
+ }
361
+ }
362
+ }
363
+ applyMask(value) {
364
+ if (value && this.$mask) {
365
+ value = this.removeMask(value);
366
+ let result = '';
367
+ for (let im = 0, iv = 0; im < this.$mask.length && iv < value.length; im++) {
368
+ if (this.$mask[im] === '#') {
369
+ result += value[iv];
370
+ iv++;
371
+ }
372
+ else {
373
+ result += this.$mask[im];
374
+ }
375
+ }
376
+ return result;
377
+ }
378
+ return '';
379
+ }
380
+ removeMask(value) {
381
+ if (typeof value === 'number') {
382
+ value = String(value).padStart(this.$mask?.replace(/[^#]/, '')?.length || 0, '0');
383
+ }
384
+ if (value) {
385
+ return value.replaceAll(/\D+/g, '');
386
+ }
387
+ return undefined;
388
+ }
389
+ writeValue(value) {
390
+ super.writeValue(value);
391
+ const masked = this.applyMask(value);
392
+ if (!!this.input && masked !== this.value) {
393
+ this.input.nativeElement.text = masked;
394
+ }
395
+ }
396
+ focus() {
397
+ this.onFocus.emit();
398
+ this.focused = true;
399
+ }
400
+ blur() {
401
+ this.onBlur.emit();
402
+ this.focused = false;
403
+ }
404
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputMaskComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
405
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: InputMaskComponent, isStandalone: true, selector: "mcl-input[mask]", inputs: { keepMask: "keepMask", mask: "mask" }, outputs: { onFocus: "focus", onBlur: "blur" }, providers: [
406
+ {
407
+ provide: MatFormFieldControl,
408
+ useExisting: InputMaskComponent
409
+ }
410
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\" (focus)=\"focus()\"\n (focusin)=\"onTouched()\" (blur)=\"blur()\"/>\n", styles: [""], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
411
+ }
412
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputMaskComponent, decorators: [{
413
+ type: Component,
414
+ args: [{ selector: 'mcl-input[mask]', imports: [
415
+ MatInput,
416
+ FormsModule
417
+ ], providers: [
418
+ {
419
+ provide: MatFormFieldControl,
420
+ useExisting: InputMaskComponent
421
+ }
422
+ ], template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\" (focus)=\"focus()\"\n (focusin)=\"onTouched()\" (blur)=\"blur()\"/>\n" }]
423
+ }], propDecorators: { keepMask: [{
424
+ type: Input
425
+ }], onFocus: [{
426
+ type: Output,
427
+ args: ['focus']
428
+ }], onBlur: [{
429
+ type: Output,
430
+ args: ['blur']
431
+ }], mask: [{
432
+ type: Input
433
+ }] } });
434
+
435
+ class InputDatetimeComponent extends AbstractMatFormFieldControl {
436
+ formats = inject(MAT_DATETIME_FORMATS);
437
+ adapter = inject(DatetimeAdapter);
438
+ type = 'date';
439
+ readonly;
440
+ name;
441
+ picker;
442
+ inputMask;
443
+ innerValue;
444
+ $maskedValue;
445
+ get input() {
446
+ return this.inputMask?.input;
447
+ }
448
+ set input(input) {
449
+ // não necessário
450
+ }
451
+ get empty() {
452
+ return !this.$maskedValue;
453
+ }
454
+ get maskedValue() {
455
+ return this.$maskedValue;
456
+ }
457
+ set maskedValue(maskedValue) {
458
+ if (this.$maskedValue !== maskedValue) {
459
+ this.onTouched();
460
+ this.$maskedValue = maskedValue;
461
+ if (maskedValue) {
462
+ if (maskedValue.match(new RegExp(`^${this.mask.replace(/#/g, '\\d')}$`))) {
463
+ this.innerValue = this.adapter.parse(maskedValue, this.format)?.toDate();
464
+ }
465
+ else {
466
+ this.innerValue = undefined;
467
+ }
468
+ }
469
+ else {
470
+ this.innerValue = undefined;
471
+ }
472
+ this.onChange(this.innerValue);
473
+ this.stateChanges.next();
474
+ }
475
+ }
476
+ get mask() {
477
+ switch (this.type) {
478
+ case 'date':
479
+ return '##/##/####';
480
+ case 'time':
481
+ return '##:##';
482
+ }
483
+ return '##/##/#### ##:##';
484
+ }
485
+ get format() {
486
+ switch (this.type) {
487
+ case 'date':
488
+ return this.formats.display.dateInput;
489
+ case 'time':
490
+ return this.formats.display.timeInput;
491
+ }
492
+ return this.formats.display.datetimeInput;
493
+ }
494
+ get value() {
495
+ return this.innerValue;
496
+ }
497
+ set value(value) {
498
+ if (this.innerValue !== value) {
499
+ this.onTouched();
500
+ if (value) {
501
+ this.innerValue = value instanceof Date ? value : value.toDate();
502
+ this.$maskedValue = this.adapter.format(moment(this.innerValue), this.format);
503
+ }
504
+ else {
505
+ this.innerValue = undefined;
506
+ this.$maskedValue = '';
507
+ }
508
+ this.onChange(this.innerValue);
509
+ this.stateChanges.next();
510
+ }
511
+ }
512
+ writeValue(value) {
513
+ this.innerValue = value;
514
+ if (value) {
515
+ this.$maskedValue = this.adapter.format(moment(value), this.format);
516
+ }
517
+ else {
518
+ this.$maskedValue = '';
519
+ }
520
+ this.stateChanges.next();
521
+ }
522
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputDatetimeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
523
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: InputDatetimeComponent, isStandalone: true, selector: "mcl-input-datetime", inputs: { type: "type", readonly: "readonly", name: "name" }, providers: [
524
+ {
525
+ provide: MatFormFieldControl,
526
+ useExisting: InputDatetimeComponent
527
+ },
528
+ { provide: MAT_DATE_LOCALE, useExisting: LOCALE_ID },
529
+ {
530
+ provide: DatetimeAdapter,
531
+ useClass: MomentDatetimeAdapter
532
+ },
533
+ {
534
+ provide: MAT_DATETIME_FORMATS,
535
+ useValue: {
536
+ parse: {
537
+ dateInput: 'L',
538
+ monthInput: 'MMMM',
539
+ timeInput: 'LT',
540
+ datetimeInput: 'L LT'
541
+ },
542
+ display: {
543
+ dateInput: 'L',
544
+ monthInput: 'MMMM',
545
+ datetimeInput: 'L LT',
546
+ timeInput: 'LT',
547
+ monthYearLabel: 'MMM YYYY',
548
+ dateA11yLabel: 'LL',
549
+ monthYearA11yLabel: 'MMMM YYYY',
550
+ popupHeaderDateLabel: 'ddd, DD MMM'
551
+ }
552
+ }
553
+ }
554
+ ], viewQueries: [{ propertyName: "picker", first: true, predicate: ["pickerData"], descendants: true }, { propertyName: "inputMask", first: true, predicate: ["inputMask"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"dateinput\">\n <mcl-input [disabled]=\"disabled\" [(ngModel)]=\"maskedValue\" [mask]=\"mask\" #inputMask\n (focus)=\"focused = true\" (blur)=\"focused = false\" [keepMask]=\"true\"\n />\n <mat-datetimepicker [disabled]=\"disabled || readonly\"\n [type]=\"type\" #pickerData></mat-datetimepicker>\n <mat-datetimepicker-toggle [for]=\"pickerData\"></mat-datetimepicker-toggle>\n</div>\n<input class=\"hidden\" [(ngModel)]=\"value\" [matDatetimepicker]=\"pickerData\" />\n", styles: [".dateinput{display:flex}.dateinput mcl-input{flex:1 1 auto}.dateinput mat-datetimepicker-toggle{margin:-16px 0 -6px}.hidden{display:none}\n"], dependencies: [{ kind: "ngmodule", type: MatDatetimepickerModule }, { kind: "component", type: i1$1.MatDatetimepickerComponent, selector: "mat-datetimepicker", inputs: ["multiYearSelector", "twelvehour", "startView", "mode", "timeInterval", "ariaNextMonthLabel", "ariaPrevMonthLabel", "ariaNextYearLabel", "ariaPrevYearLabel", "preventSameDateTimeSelection", "panelClass", "startAt", "openOnFocus", "type", "touchUi", "disabled"], outputs: ["selectedChanged", "opened", "closed", "viewChanged"], exportAs: ["matDatetimepicker"] }, { kind: "component", type: i1$1.MatDatetimepickerToggleComponent, selector: "mat-datetimepicker-toggle", inputs: ["for", "disabled"], exportAs: ["matDatetimepickerToggle"] }, { kind: "directive", type: i1$1.MatDatetimepickerInputDirective, selector: "input[matDatetimepicker]", inputs: ["matDatetimepicker", "matDatepickerFilter", "value", "min", "max", "disabled"], outputs: ["dateChange", "dateInput"], exportAs: ["matDatepickerInput"] }, { kind: "ngmodule", type: MatMomentDatetimeModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: InputMaskComponent, selector: "mcl-input[mask]", inputs: ["keepMask", "mask"], outputs: ["focus", "blur"] }] });
555
+ }
556
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputDatetimeComponent, decorators: [{
557
+ type: Component,
558
+ args: [{ selector: 'mcl-input-datetime', imports: [
559
+ MatDatetimepickerModule,
560
+ MatMomentDatetimeModule,
561
+ FormsModule,
562
+ InputMaskComponent
563
+ ], providers: [
564
+ {
565
+ provide: MatFormFieldControl,
566
+ useExisting: InputDatetimeComponent
567
+ },
568
+ { provide: MAT_DATE_LOCALE, useExisting: LOCALE_ID },
569
+ {
570
+ provide: DatetimeAdapter,
571
+ useClass: MomentDatetimeAdapter
572
+ },
573
+ {
574
+ provide: MAT_DATETIME_FORMATS,
575
+ useValue: {
576
+ parse: {
577
+ dateInput: 'L',
578
+ monthInput: 'MMMM',
579
+ timeInput: 'LT',
580
+ datetimeInput: 'L LT'
581
+ },
582
+ display: {
583
+ dateInput: 'L',
584
+ monthInput: 'MMMM',
585
+ datetimeInput: 'L LT',
586
+ timeInput: 'LT',
587
+ monthYearLabel: 'MMM YYYY',
588
+ dateA11yLabel: 'LL',
589
+ monthYearA11yLabel: 'MMMM YYYY',
590
+ popupHeaderDateLabel: 'ddd, DD MMM'
591
+ }
592
+ }
593
+ }
594
+ ], template: "<div class=\"dateinput\">\n <mcl-input [disabled]=\"disabled\" [(ngModel)]=\"maskedValue\" [mask]=\"mask\" #inputMask\n (focus)=\"focused = true\" (blur)=\"focused = false\" [keepMask]=\"true\"\n />\n <mat-datetimepicker [disabled]=\"disabled || readonly\"\n [type]=\"type\" #pickerData></mat-datetimepicker>\n <mat-datetimepicker-toggle [for]=\"pickerData\"></mat-datetimepicker-toggle>\n</div>\n<input class=\"hidden\" [(ngModel)]=\"value\" [matDatetimepicker]=\"pickerData\" />\n", styles: [".dateinput{display:flex}.dateinput mcl-input{flex:1 1 auto}.dateinput mat-datetimepicker-toggle{margin:-16px 0 -6px}.hidden{display:none}\n"] }]
595
+ }], propDecorators: { type: [{
596
+ type: Input
597
+ }], readonly: [{
598
+ type: Input
599
+ }], name: [{
600
+ type: Input
601
+ }], picker: [{
602
+ type: ViewChild,
603
+ args: ['pickerData']
604
+ }], inputMask: [{
605
+ type: ViewChild,
606
+ args: ['inputMask']
607
+ }] } });
608
+
609
+ class InputFileUploadComponent {
610
+ errorStateMatcher;
611
+ ngControl;
612
+ parentForm;
613
+ changeDetectorRef;
614
+ parentFormGroup;
615
+ arquivoService;
616
+ static nextId = 0;
617
+ $placeholder = '';
618
+ $disabled = false;
619
+ $required = false;
620
+ value;
621
+ multiple;
622
+ limite;
623
+ accept;
624
+ template = 'preview';
625
+ agrupadores;
626
+ input;
627
+ selectCancel = new EventEmitter();
628
+ stateChanges = new Subject();
629
+ change = new EventEmitter();
630
+ id = `input-fileupload-${InputFileUploadComponent.nextId++}`;
631
+ describedBy = '';
632
+ constructor(errorStateMatcher, ngControl, parentForm, changeDetectorRef, parentFormGroup, arquivoService) {
633
+ this.errorStateMatcher = errorStateMatcher;
634
+ this.ngControl = ngControl;
635
+ this.parentForm = parentForm;
636
+ this.changeDetectorRef = changeDetectorRef;
637
+ this.parentFormGroup = parentFormGroup;
638
+ this.arquivoService = arquivoService;
639
+ if (this.ngControl != null) {
640
+ this.ngControl.valueAccessor = this;
641
+ }
642
+ }
643
+ onChange = (val) => {
644
+ };
645
+ onTouched = () => {
646
+ };
647
+ get focused() {
648
+ return this.value && (this.multiple ? this.value.find((a) => a.loading) : this.value.loading);
649
+ }
650
+ get empty() {
651
+ return !this.value;
652
+ }
653
+ onContainerClick(event) {
654
+ // Não necessário
655
+ }
656
+ get shouldLabelFloat() {
657
+ return true;
658
+ }
659
+ get placeholder() {
660
+ return this.$placeholder;
661
+ }
662
+ set placeholder(plh) {
663
+ this.$placeholder = plh;
664
+ this.stateChanges.next();
665
+ }
666
+ get required() {
667
+ return this.$required;
668
+ }
669
+ set required(value) {
670
+ this.$required = coerceBooleanProperty(value);
671
+ this.stateChanges.next();
672
+ }
673
+ get disabled() {
674
+ return this.$disabled;
675
+ }
676
+ set disabled(value) {
677
+ this.$disabled = coerceBooleanProperty(value);
678
+ this.stateChanges.next();
679
+ }
680
+ get errorState() {
681
+ return this.errorStateMatcher.isErrorState(this.ngControl.control, this.parentFormGroup || this.parentForm);
682
+ }
683
+ get controlType() {
684
+ return 'input-fileupload';
685
+ }
686
+ setDescribedByIds(ids) {
687
+ this.describedBy = ids.join(' ');
688
+ }
689
+ ngOnDestroy() {
690
+ this.stateChanges.complete();
691
+ }
692
+ upload(arquivo) {
693
+ return new Observable(observer => {
694
+ if (!this.validaFormato(arquivo.nome)) {
695
+ arquivo.error = { fileFormat: true };
696
+ observer.error('Formato inválido');
697
+ this.onChange(this.value);
698
+ this.change.emit(this.value);
699
+ this.stateChanges.next();
700
+ return;
701
+ }
702
+ if (this.limite) {
703
+ const total = this.parseLimite();
704
+ if ((arquivo.length || 0) > total) {
705
+ arquivo.error = {
706
+ fileSize: {
707
+ limite: this.limite,
708
+ }
709
+ };
710
+ observer.error('Tamanho inválido');
711
+ this.onChange(this.value);
712
+ this.change.emit(this.value);
713
+ this.stateChanges.next();
714
+ return;
715
+ }
716
+ }
717
+ this.arquivoService.upload(arquivo.file, ...(this.agrupadores || []))
718
+ .subscribe({
719
+ next: event => {
720
+ if (event.type === 'conclusao') {
721
+ arquivo.progresso = undefined;
722
+ if (this.multiple) {
723
+ this.value = [
724
+ ...(this.value || []).map((a) => a === arquivo ? event.attachment : a)
725
+ ];
726
+ this.onChange(this.value);
727
+ this.change.emit(this.value);
728
+ this.stateChanges.next();
729
+ }
730
+ else {
731
+ this.value = event.attachment;
732
+ this.onChange(event.attachment);
733
+ this.change.emit(event.attachment);
734
+ this.stateChanges.next();
735
+ }
736
+ observer.next(null);
737
+ observer.complete();
738
+ }
739
+ else if (event.type === 'progresso') {
740
+ arquivo.progresso = event.progresso;
741
+ this.stateChanges.next();
742
+ }
743
+ },
744
+ error: err => {
745
+ arquivo.error = { fileError: true };
746
+ this.onChange(this.value);
747
+ this.change.emit(this.value);
748
+ this.stateChanges.next();
749
+ observer.error(err);
750
+ }
751
+ });
752
+ });
753
+ }
754
+ parseLimite() {
755
+ let total = Number(this.limite.replace(/\D+/g, ''));
756
+ if (this.limite.toUpperCase().indexOf('GB') >= 0) {
757
+ total = total * 1024 * 1024 * 1024;
758
+ }
759
+ if (this.limite.toUpperCase().indexOf('MB') >= 0) {
760
+ total = total * 1024 * 1024;
761
+ }
762
+ if (this.limite.toUpperCase().indexOf('KB') >= 0) {
763
+ total = total * 1024;
764
+ }
765
+ return total;
766
+ }
767
+ validaFormato(filename) {
768
+ if (this.accept) {
769
+ let formats = [];
770
+ if (typeof this.accept === 'string') {
771
+ formats = [this.accept];
772
+ }
773
+ else {
774
+ formats = this.accept;
775
+ }
776
+ for (const format of formats) {
777
+ if (filename.toLowerCase().indexOf(format.toLowerCase()) === filename.length - format.length) {
778
+ return true;
779
+ }
780
+ }
781
+ return false;
782
+ }
783
+ return true;
784
+ }
785
+ uploadNext() {
786
+ if (this.multiple) {
787
+ if (this.value) {
788
+ for (const item of this.value) {
789
+ if (item.loading && !item.error) {
790
+ this.upload(item).subscribe(() => this.uploadNext(), err => this.uploadNext());
791
+ break;
792
+ }
793
+ }
794
+ }
795
+ }
796
+ else if (this.value && this.value.loading && !this.value.error) {
797
+ this.upload(this.value).subscribe(() => this.uploadNext(), err => this.uploadNext());
798
+ }
799
+ }
800
+ onFileChange(event) {
801
+ this.onTouched();
802
+ if (event.target.files && event.target.files.length) {
803
+ if (this.multiple) {
804
+ const arqs = [];
805
+ for (const file of event.target.files) {
806
+ arqs.push({
807
+ file,
808
+ loading: true,
809
+ nome: file.name,
810
+ length: file.size,
811
+ });
812
+ }
813
+ this.value = [
814
+ ...(this.value || []),
815
+ ...arqs
816
+ ];
817
+ this.onChange(this.value);
818
+ this.change.emit(this.value);
819
+ this.stateChanges.next();
820
+ }
821
+ else {
822
+ this.value = {
823
+ file: event.target.files[0],
824
+ length: event.target.files[0].size,
825
+ loading: true,
826
+ nome: event.target.files[0].name
827
+ };
828
+ this.onChange(this.value);
829
+ this.change.emit(this.value);
830
+ this.stateChanges.next();
831
+ }
832
+ this.uploadNext();
833
+ }
834
+ else {
835
+ this.selectCancel.emit();
836
+ }
837
+ event.target.value = '';
838
+ }
839
+ openFileChooser() {
840
+ if (!this.disabled) {
841
+ this.input.nativeElement.click();
842
+ }
843
+ }
844
+ async remover(arquivo) {
845
+ if (this.value) {
846
+ if (this.multiple) {
847
+ if (Array.isArray(this.value)) {
848
+ this.value.splice(this.value.indexOf(arquivo), 1);
849
+ if (this.value.length) {
850
+ this.value = [...this.value];
851
+ this.onChange(this.value);
852
+ this.change.emit(this.value);
853
+ this.stateChanges.next();
854
+ }
855
+ else {
856
+ this.value = undefined;
857
+ this.onChange(undefined);
858
+ this.change.emit(undefined);
859
+ this.stateChanges.next();
860
+ }
861
+ }
862
+ }
863
+ else {
864
+ this.value = undefined;
865
+ this.onChange(undefined);
866
+ this.change.emit(undefined);
867
+ this.stateChanges.next();
868
+ }
869
+ }
870
+ }
871
+ registerOnTouched(fn) {
872
+ this.onTouched = fn;
873
+ }
874
+ registerOnChange(fn) {
875
+ this.onChange = fn;
876
+ }
877
+ setDisabledState(isDisabled) {
878
+ this.disabled = isDisabled;
879
+ }
880
+ writeValue(obj) {
881
+ if (obj) {
882
+ if (this.multiple) {
883
+ this.value = obj.map((a) => typeof a === 'string' ? { url: a } : a);
884
+ this.stateChanges.next();
885
+ }
886
+ else if (typeof obj === 'string') {
887
+ this.value = { url: obj };
888
+ this.stateChanges.next();
889
+ }
890
+ else {
891
+ this.value = obj;
892
+ this.stateChanges.next();
893
+ }
894
+ }
895
+ else {
896
+ this.value = obj;
897
+ this.stateChanges.next();
898
+ }
899
+ }
900
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputFileUploadComponent, deps: [{ token: i1$2.ErrorStateMatcher }, { token: i1.NgControl, optional: true, self: true }, { token: i1.NgForm, optional: true }, { token: i0.ChangeDetectorRef }, { token: i1.FormGroupDirective, optional: true }, { token: ARQUIVO_MANAGER_SERVICE }], target: i0.ɵɵFactoryTarget.Component });
901
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: InputFileUploadComponent, isStandalone: true, selector: "mcl-input-fileupload", inputs: { multiple: "multiple", limite: "limite", accept: "accept", template: "template", agrupadores: "agrupadores", placeholder: "placeholder", required: "required", disabled: "disabled" }, outputs: { selectCancel: "selectCancel", stateChanges: "change", change: "change" }, host: { properties: { "id": "this.id", "attr.aria-describedby": "this.describedBy", "class.floating": "this.shouldLabelFloat" } }, providers: [
902
+ {
903
+ provide: MatFormFieldControl,
904
+ useExisting: InputFileUploadComponent
905
+ }
906
+ ], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "@if (multiple && template == 'chips') {\r\n <div class=\"chips\">\r\n @if (value?.length) {\r\n <mat-chip-grid>\r\n @for (arquivo of value; track arquivo) {\r\n <mat-chip [ngClass]=\"{'error':arquivo.loading && arquivo.error,'success':!arquivo.loading}\">\r\n @if (arquivo.loading && !arquivo.error) {\r\n <mat-spinner [value]=\"arquivo.progresso\" [diameter]=\"24\"></mat-spinner>\r\n }\r\n @if (arquivo.loading && arquivo.error) {\r\n <mat-icon class=\"error\">remove_circle_outline</mat-icon>\r\n }\r\n @if (!arquivo.loading) {\r\n <mat-icon class=\"success\">check_circle_outline</mat-icon>\r\n }\r\n {{ arquivo.nome || arquivo.filename }}\r\n @if (!disabled) {\r\n <a (click)=\"remover(arquivo)\" href=\"javascript:void(0)\">\r\n <mat-icon>close</mat-icon>\r\n </a>\r\n }\r\n </mat-chip>\r\n }\r\n </mat-chip-grid>\r\n }\r\n\r\n @if (value?.length && !disabled) {\r\n <hr/>\r\n }\r\n\r\n @if (!disabled) {\r\n <input type=\"file\" (change)=\"onFileChange($event)\" #input [multiple]=\"multiple\"/>\r\n }\r\n </div>\r\n}\r\n\r\n@if (multiple && template == 'preview') {\r\n <div class=\"previews\">\r\n @if (value?.length) {\r\n <div fxLayout=\"row wrap\" fxLayoutGap=\"20px\" fxFlexAlign=\"center\">\r\n @for (arquivo of value; track arquivo) {\r\n <div>\r\n <div class=\"preview\" [ngClass]=\"{'error':arquivo.loading && arquivo.error,'success':!arquivo.loading}\">\r\n <mcl-preview-arquivo [group]=\"value\" [arquivo]=\"arquivo\"></mcl-preview-arquivo>\r\n\r\n @if (!disabled) {\r\n <div class=\"footer\">\r\n @if (arquivo.loading && !arquivo.error) {\r\n <mat-spinner [value]=\"arquivo.progresso\" [diameter]=\"24\"\r\n ></mat-spinner>\r\n }\r\n @if (arquivo.loading && arquivo.error) {\r\n <mat-icon class=\"error\">remove_circle_outline</mat-icon>\r\n }\r\n @if (!arquivo.loading) {\r\n <mat-icon class=\"success\">check_circle_outline</mat-icon>\r\n }\r\n <span>{{ arquivo.nome || arquivo.filename }}</span>\r\n @if (!disabled) {\r\n <a (click)=\"remover(arquivo)\" href=\"javascript:void(0)\">\r\n <mat-icon>close</mat-icon>\r\n </a>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n\r\n </div>\r\n }\r\n\r\n @if (value?.length && !disabled) {\r\n <hr/>\r\n }\r\n\r\n @if (!disabled) {\r\n <input type=\"file\" (change)=\"onFileChange($event)\" #input [multiple]=\"multiple\"/>\r\n }\r\n </div>\r\n}\r\n\r\n@if (template == 'manual') {\r\n <div>\r\n <input type=\"file\" [disabled]=\"disabled\" (change)=\"onFileChange($event)\" #input\r\n [multiple]=\"multiple\" style=\"display: none\"/>\r\n </div>\r\n}\r\n\r\n@if (!multiple && template != 'manual') {\r\n <input #input type=\"file\" style=\"display: none\"\r\n (change)=\"onFileChange($event)\"/>\r\n\r\n <div class=\"input\">\r\n @if (!value) {\r\n <button mat-icon-button type=\"button\"\r\n (click)=\"openFileChooser()\"\r\n matPrefix>\r\n <mat-icon>attach_file</mat-icon>\r\n </button>\r\n }\r\n @if (value && !value.loading && !value.error) {\r\n <button mat-icon-button type=\"button\"\r\n [mclDownloadArquivo]=\"value\"\r\n matPrefix>\r\n <mat-icon>download</mat-icon>\r\n </button>\r\n }\r\n @if (value?.error) {\r\n <button mat-icon-button type=\"button\" matPrefixdisabled>\r\n <mat-icon>warning</mat-icon>\r\n </button>\r\n }\r\n @if (value?.loading && !value?.error) {\r\n <button mat-icon-button type=\"button\" matPrefix disabled>\r\n <mat-spinner [value]=\"value.progresso\"\r\n [diameter]=\"24\"></mat-spinner>\r\n </button>\r\n }\r\n @if (!value) {\r\n <input matInput readonly (click)=\"openFileChooser()\" [required]=\"required\"\r\n value=\"Selecione um arquivo...\"/>\r\n }\r\n @if (value && value.loading && !value.error) {\r\n <input matInput readonly [required]=\"required\"\r\n value=\"Submetendo arquivo...\"/>\r\n }\r\n @if (value && value.error) {\r\n <input matInput readonly [required]=\"required\"\r\n [value]=\"value?.nome || value?.filename\"/>\r\n }\r\n @if (value && !value.loading) {\r\n <input matInput readonly [mclDownloadArquivo]=\"value\" [required]=\"required\"\r\n [value]=\"value?.nome || value?.filename\"/>\r\n }\r\n @if (value && (!value.loading || value?.error) && !disabled) {\r\n <button mat-icon-button type=\"button\" matSuffix\r\n matTooltip=\"Remover\" (click)=\"remover(value)\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n }\r\n </div>\r\n}\r\n", styles: ["span{opacity:0;transition:opacity .2s}:host.floating span{opacity:1}mat-chip>mat-spinner,mat-chip>mat-icon,.preview .footer>mat-spinner,.preview .footer>mat-icon{margin-right:5px;vertical-align:middle}mat-chip a,.preview .footer a{padding:5px}mat-chip a mat-icon,.preview .footer a mat-icon{margin-left:10px;vertical-align:middle}mat-chip.error,.preview.error{color:red}mat-chip.success,.preview.success{color:green}.preview{text-align:center;width:200px;overflow:hidden;margin:0 auto 20px}.preview mcl-preview-arquivo{margin:auto;display:block}.preview .footer{display:flex;text-align:left}.preview .footer span{flex:1 1 auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.preview .footer mat-icon,.preview .footer a{flex:1}.input{display:flex}.input input{flex:1 1 auto}\n"], dependencies: [{ kind: "component", type: MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "component", type: MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: PreviewArquivoComponent, selector: "mcl-preview-arquivo", inputs: ["showLoading", "height", "width", "group", "arquivo"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: DownloadArquivoDirective, selector: "[mclDownloadArquivo]", inputs: ["mclDownloadArquivo", "target"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }] });
907
+ }
908
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputFileUploadComponent, decorators: [{
909
+ type: Component,
910
+ args: [{ selector: 'mcl-input-fileupload', imports: [
911
+ MatChipGrid,
912
+ MatChip,
913
+ NgClass,
914
+ MatProgressSpinner,
915
+ MatIcon,
916
+ PreviewArquivoComponent,
917
+ MatIconButton,
918
+ MatPrefix,
919
+ DownloadArquivoDirective,
920
+ MatInput,
921
+ MatTooltip,
922
+ MatSuffix
923
+ ], providers: [
924
+ {
925
+ provide: MatFormFieldControl,
926
+ useExisting: InputFileUploadComponent
927
+ }
928
+ ], template: "@if (multiple && template == 'chips') {\r\n <div class=\"chips\">\r\n @if (value?.length) {\r\n <mat-chip-grid>\r\n @for (arquivo of value; track arquivo) {\r\n <mat-chip [ngClass]=\"{'error':arquivo.loading && arquivo.error,'success':!arquivo.loading}\">\r\n @if (arquivo.loading && !arquivo.error) {\r\n <mat-spinner [value]=\"arquivo.progresso\" [diameter]=\"24\"></mat-spinner>\r\n }\r\n @if (arquivo.loading && arquivo.error) {\r\n <mat-icon class=\"error\">remove_circle_outline</mat-icon>\r\n }\r\n @if (!arquivo.loading) {\r\n <mat-icon class=\"success\">check_circle_outline</mat-icon>\r\n }\r\n {{ arquivo.nome || arquivo.filename }}\r\n @if (!disabled) {\r\n <a (click)=\"remover(arquivo)\" href=\"javascript:void(0)\">\r\n <mat-icon>close</mat-icon>\r\n </a>\r\n }\r\n </mat-chip>\r\n }\r\n </mat-chip-grid>\r\n }\r\n\r\n @if (value?.length && !disabled) {\r\n <hr/>\r\n }\r\n\r\n @if (!disabled) {\r\n <input type=\"file\" (change)=\"onFileChange($event)\" #input [multiple]=\"multiple\"/>\r\n }\r\n </div>\r\n}\r\n\r\n@if (multiple && template == 'preview') {\r\n <div class=\"previews\">\r\n @if (value?.length) {\r\n <div fxLayout=\"row wrap\" fxLayoutGap=\"20px\" fxFlexAlign=\"center\">\r\n @for (arquivo of value; track arquivo) {\r\n <div>\r\n <div class=\"preview\" [ngClass]=\"{'error':arquivo.loading && arquivo.error,'success':!arquivo.loading}\">\r\n <mcl-preview-arquivo [group]=\"value\" [arquivo]=\"arquivo\"></mcl-preview-arquivo>\r\n\r\n @if (!disabled) {\r\n <div class=\"footer\">\r\n @if (arquivo.loading && !arquivo.error) {\r\n <mat-spinner [value]=\"arquivo.progresso\" [diameter]=\"24\"\r\n ></mat-spinner>\r\n }\r\n @if (arquivo.loading && arquivo.error) {\r\n <mat-icon class=\"error\">remove_circle_outline</mat-icon>\r\n }\r\n @if (!arquivo.loading) {\r\n <mat-icon class=\"success\">check_circle_outline</mat-icon>\r\n }\r\n <span>{{ arquivo.nome || arquivo.filename }}</span>\r\n @if (!disabled) {\r\n <a (click)=\"remover(arquivo)\" href=\"javascript:void(0)\">\r\n <mat-icon>close</mat-icon>\r\n </a>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n\r\n </div>\r\n }\r\n\r\n @if (value?.length && !disabled) {\r\n <hr/>\r\n }\r\n\r\n @if (!disabled) {\r\n <input type=\"file\" (change)=\"onFileChange($event)\" #input [multiple]=\"multiple\"/>\r\n }\r\n </div>\r\n}\r\n\r\n@if (template == 'manual') {\r\n <div>\r\n <input type=\"file\" [disabled]=\"disabled\" (change)=\"onFileChange($event)\" #input\r\n [multiple]=\"multiple\" style=\"display: none\"/>\r\n </div>\r\n}\r\n\r\n@if (!multiple && template != 'manual') {\r\n <input #input type=\"file\" style=\"display: none\"\r\n (change)=\"onFileChange($event)\"/>\r\n\r\n <div class=\"input\">\r\n @if (!value) {\r\n <button mat-icon-button type=\"button\"\r\n (click)=\"openFileChooser()\"\r\n matPrefix>\r\n <mat-icon>attach_file</mat-icon>\r\n </button>\r\n }\r\n @if (value && !value.loading && !value.error) {\r\n <button mat-icon-button type=\"button\"\r\n [mclDownloadArquivo]=\"value\"\r\n matPrefix>\r\n <mat-icon>download</mat-icon>\r\n </button>\r\n }\r\n @if (value?.error) {\r\n <button mat-icon-button type=\"button\" matPrefixdisabled>\r\n <mat-icon>warning</mat-icon>\r\n </button>\r\n }\r\n @if (value?.loading && !value?.error) {\r\n <button mat-icon-button type=\"button\" matPrefix disabled>\r\n <mat-spinner [value]=\"value.progresso\"\r\n [diameter]=\"24\"></mat-spinner>\r\n </button>\r\n }\r\n @if (!value) {\r\n <input matInput readonly (click)=\"openFileChooser()\" [required]=\"required\"\r\n value=\"Selecione um arquivo...\"/>\r\n }\r\n @if (value && value.loading && !value.error) {\r\n <input matInput readonly [required]=\"required\"\r\n value=\"Submetendo arquivo...\"/>\r\n }\r\n @if (value && value.error) {\r\n <input matInput readonly [required]=\"required\"\r\n [value]=\"value?.nome || value?.filename\"/>\r\n }\r\n @if (value && !value.loading) {\r\n <input matInput readonly [mclDownloadArquivo]=\"value\" [required]=\"required\"\r\n [value]=\"value?.nome || value?.filename\"/>\r\n }\r\n @if (value && (!value.loading || value?.error) && !disabled) {\r\n <button mat-icon-button type=\"button\" matSuffix\r\n matTooltip=\"Remover\" (click)=\"remover(value)\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n }\r\n </div>\r\n}\r\n", styles: ["span{opacity:0;transition:opacity .2s}:host.floating span{opacity:1}mat-chip>mat-spinner,mat-chip>mat-icon,.preview .footer>mat-spinner,.preview .footer>mat-icon{margin-right:5px;vertical-align:middle}mat-chip a,.preview .footer a{padding:5px}mat-chip a mat-icon,.preview .footer a mat-icon{margin-left:10px;vertical-align:middle}mat-chip.error,.preview.error{color:red}mat-chip.success,.preview.success{color:green}.preview{text-align:center;width:200px;overflow:hidden;margin:0 auto 20px}.preview mcl-preview-arquivo{margin:auto;display:block}.preview .footer{display:flex;text-align:left}.preview .footer span{flex:1 1 auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.preview .footer mat-icon,.preview .footer a{flex:1}.input{display:flex}.input input{flex:1 1 auto}\n"] }]
929
+ }], ctorParameters: () => [{ type: i1$2.ErrorStateMatcher }, { type: i1.NgControl, decorators: [{
930
+ type: Optional
931
+ }, {
932
+ type: Self
933
+ }] }, { type: i1.NgForm, decorators: [{
934
+ type: Optional
935
+ }] }, { type: i0.ChangeDetectorRef }, { type: i1.FormGroupDirective, decorators: [{
936
+ type: Optional
937
+ }] }, { type: undefined, decorators: [{
938
+ type: Inject,
939
+ args: [ARQUIVO_MANAGER_SERVICE]
940
+ }] }], propDecorators: { multiple: [{
941
+ type: Input
942
+ }], limite: [{
943
+ type: Input
944
+ }], accept: [{
945
+ type: Input
946
+ }], template: [{
947
+ type: Input
948
+ }], agrupadores: [{
949
+ type: Input
950
+ }], input: [{
951
+ type: ViewChild,
952
+ args: ['input']
953
+ }], selectCancel: [{
954
+ type: Output
955
+ }], stateChanges: [{
956
+ type: Output,
957
+ args: ['change']
958
+ }], change: [{
959
+ type: Output
960
+ }], id: [{
961
+ type: HostBinding
962
+ }], describedBy: [{
963
+ type: HostBinding,
964
+ args: ['attr.aria-describedby']
965
+ }], shouldLabelFloat: [{
966
+ type: HostBinding,
967
+ args: ['class.floating']
968
+ }], placeholder: [{
969
+ type: Input
970
+ }], required: [{
971
+ type: Input
972
+ }], disabled: [{
973
+ type: Input
974
+ }] } });
975
+
976
+ class InputFileUploadValidatorDirective {
977
+ multiple = false;
978
+ validate(control) {
979
+ if (control.value) {
980
+ if (this.multiple && Array.isArray(control.value)) {
981
+ const error = control.value.find(a => a.loading && a.error);
982
+ if (error) {
983
+ return error.error;
984
+ }
985
+ if (control.value.find(a => a.loading)) {
986
+ return { fileUploading: true };
987
+ }
988
+ }
989
+ else if (control.value.loading && control.value.error) {
990
+ return control.value.error;
991
+ }
992
+ else if (control.value.loading) {
993
+ return { fileUploading: true };
994
+ }
995
+ }
996
+ return null;
997
+ }
998
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputFileUploadValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
999
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: InputFileUploadValidatorDirective, isStandalone: true, selector: "mcl-input-fileupload,[mclFileupload]", inputs: { multiple: "multiple" }, providers: [{ provide: NG_VALIDATORS, useExisting: InputFileUploadValidatorDirective, multi: true }], ngImport: i0 });
1000
+ }
1001
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputFileUploadValidatorDirective, decorators: [{
1002
+ type: Directive,
1003
+ args: [{
1004
+ selector: 'mcl-input-fileupload,[mclFileupload]',
1005
+ providers: [{ provide: NG_VALIDATORS, useExisting: InputFileUploadValidatorDirective, multi: true }]
1006
+ }]
1007
+ }], propDecorators: { multiple: [{
1008
+ type: Input
1009
+ }] } });
1010
+
1011
+ class InputCnpjComponent extends InputMaskComponent {
1012
+ constructor() {
1013
+ super();
1014
+ this.mask = '##.###.###/####-##';
1015
+ }
1016
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCnpjComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1017
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: InputCnpjComponent, isStandalone: true, selector: "mcl-input[cnpj]", providers: [
1018
+ {
1019
+ provide: MatFormFieldControl,
1020
+ useExisting: InputCnpjComponent
1021
+ }
1022
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\" (focus)=\"focus()\"\n (focusin)=\"onTouched()\" (blur)=\"blur()\"/>\n", styles: [""], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
1023
+ }
1024
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCnpjComponent, decorators: [{
1025
+ type: Component,
1026
+ args: [{ selector: 'mcl-input[cnpj]', imports: [
1027
+ MatInput,
1028
+ FormsModule
1029
+ ], providers: [
1030
+ {
1031
+ provide: MatFormFieldControl,
1032
+ useExisting: InputCnpjComponent
1033
+ }
1034
+ ], template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\" (focus)=\"focus()\"\n (focusin)=\"onTouched()\" (blur)=\"blur()\"/>\n" }]
1035
+ }], ctorParameters: () => [] });
1036
+
1037
+ class InputCepComponent extends InputMaskComponent {
1038
+ constructor() {
1039
+ super();
1040
+ this.mask = '##.###-###';
1041
+ }
1042
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCepComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1043
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: InputCepComponent, isStandalone: true, selector: "mcl-input[cep]", providers: [
1044
+ {
1045
+ provide: MatFormFieldControl,
1046
+ useExisting: InputCepComponent
1047
+ }
1048
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\" (focus)=\"focus()\"\n (focusin)=\"onTouched()\" (blur)=\"blur()\"/>\n", styles: [""], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
1049
+ }
1050
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCepComponent, decorators: [{
1051
+ type: Component,
1052
+ args: [{ selector: 'mcl-input[cep]', imports: [
1053
+ MatInput,
1054
+ FormsModule
1055
+ ], providers: [
1056
+ {
1057
+ provide: MatFormFieldControl,
1058
+ useExisting: InputCepComponent
1059
+ }
1060
+ ], template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\" (focus)=\"focus()\"\n (focusin)=\"onTouched()\" (blur)=\"blur()\"/>\n" }]
1061
+ }], ctorParameters: () => [] });
1062
+
1063
+ class InputCpfCnpjComponent extends InputMaskComponent {
1064
+ get value() {
1065
+ return super.value;
1066
+ }
1067
+ set value(value) {
1068
+ const unmasked = this.removeMask(value);
1069
+ if (!!unmasked) {
1070
+ if (unmasked.length > 11) {
1071
+ this.mask = '##.###.###/####-##';
1072
+ }
1073
+ else {
1074
+ this.mask = '###.###.###-##';
1075
+ }
1076
+ super.value = value;
1077
+ }
1078
+ }
1079
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCpfCnpjComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1080
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: InputCpfCnpjComponent, isStandalone: true, selector: "mcl-input[cpfCnpj]", providers: [
1081
+ {
1082
+ provide: MatFormFieldControl,
1083
+ useExisting: InputCpfCnpjComponent
1084
+ }
1085
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\" (focus)=\"focus()\"\n (focusin)=\"onTouched()\" (blur)=\"blur()\"/>\n", styles: [""], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
1086
+ }
1087
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCpfCnpjComponent, decorators: [{
1088
+ type: Component,
1089
+ args: [{ selector: 'mcl-input[cpfCnpj]', imports: [
1090
+ MatInput,
1091
+ FormsModule
1092
+ ], providers: [
1093
+ {
1094
+ provide: MatFormFieldControl,
1095
+ useExisting: InputCpfCnpjComponent
1096
+ }
1097
+ ], template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\" (focus)=\"focus()\"\n (focusin)=\"onTouched()\" (blur)=\"blur()\"/>\n" }]
1098
+ }] });
1099
+
1100
+ class InputCpfComponent extends InputMaskComponent {
1101
+ constructor() {
1102
+ super();
1103
+ this.mask = '###.###.###-##';
1104
+ }
1105
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCpfComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1106
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: InputCpfComponent, isStandalone: true, selector: "mcl-input[cpf]", providers: [
1107
+ {
1108
+ provide: MatFormFieldControl,
1109
+ useExisting: InputCpfComponent
1110
+ }
1111
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\" (focus)=\"focus()\"\n (focusin)=\"onTouched()\" (blur)=\"blur()\"/>\n", styles: [""], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
1112
+ }
1113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCpfComponent, decorators: [{
1114
+ type: Component,
1115
+ args: [{ selector: 'mcl-input[cpf]', imports: [
1116
+ MatInput,
1117
+ FormsModule
1118
+ ], providers: [
1119
+ {
1120
+ provide: MatFormFieldControl,
1121
+ useExisting: InputCpfComponent
1122
+ }
1123
+ ], template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\" (focus)=\"focus()\"\n (focusin)=\"onTouched()\" (blur)=\"blur()\"/>\n" }]
1124
+ }], ctorParameters: () => [] });
1125
+
1126
+ class InputPhoneComponent extends InputMaskComponent {
1127
+ applyMask(value) {
1128
+ if (value) {
1129
+ const unmasked = this.removeMask(value);
1130
+ if (unmasked.length > 2 && unmasked[2] === '9') {
1131
+ this.mask = '(##) #####-####';
1132
+ }
1133
+ else {
1134
+ this.mask = '(##) ####-####';
1135
+ }
1136
+ }
1137
+ return super.applyMask(value);
1138
+ }
1139
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputPhoneComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1140
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: InputPhoneComponent, isStandalone: true, selector: "mcl-input[phone]", providers: [
1141
+ {
1142
+ provide: MatFormFieldControl,
1143
+ useExisting: InputPhoneComponent
1144
+ }
1145
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\" (focus)=\"focus()\"\n (focusin)=\"onTouched()\" (blur)=\"blur()\"/>\n", styles: [""], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
1146
+ }
1147
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputPhoneComponent, decorators: [{
1148
+ type: Component,
1149
+ args: [{ selector: 'mcl-input[phone]', imports: [
1150
+ MatInput,
1151
+ FormsModule
1152
+ ], providers: [
1153
+ {
1154
+ provide: MatFormFieldControl,
1155
+ useExisting: InputPhoneComponent
1156
+ }
1157
+ ], template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\" (focus)=\"focus()\"\n (focusin)=\"onTouched()\" (blur)=\"blur()\"/>\n" }]
1158
+ }] });
1159
+
1160
+ class OptionNode {
1161
+ pool;
1162
+ value;
1163
+ subject;
1164
+ constructor(pool, value, selected = false) {
1165
+ this.pool = pool;
1166
+ this.value = value;
1167
+ this.subject = new BehaviorSubject(selected);
1168
+ }
1169
+ get model() {
1170
+ return this.pool.model();
1171
+ }
1172
+ get observable() {
1173
+ return this.subject;
1174
+ }
1175
+ setSelected(selected) {
1176
+ this.subject.next(selected);
1177
+ }
1178
+ dispose() {
1179
+ this.subject.complete();
1180
+ }
1181
+ touched() {
1182
+ this.pool.touched();
1183
+ }
1184
+ }
1185
+
1186
+ class NodePool {
1187
+ name;
1188
+ _nodes = new BehaviorSubject([]);
1189
+ _touch = new Subject();
1190
+ _groups = [];
1191
+ constructor(name) {
1192
+ this.name = name;
1193
+ }
1194
+ model() {
1195
+ return this._nodes
1196
+ .pipe(switchMap(ns => combineLatest(ns
1197
+ .map(n => n.observable
1198
+ .pipe(map(selected => ({
1199
+ selected,
1200
+ value: n.value
1201
+ })))))))
1202
+ .pipe(map(ops => {
1203
+ const model = ops.filter(o => o.selected).map(o => o.value);
1204
+ return model.length ? model : undefined;
1205
+ }));
1206
+ }
1207
+ touch() {
1208
+ return this._touch;
1209
+ }
1210
+ all() {
1211
+ return this._nodes
1212
+ .pipe(switchMap(ns => combineLatest(ns
1213
+ .map(n => n.observable))))
1214
+ .pipe(map(ops => {
1215
+ if (ops.length) {
1216
+ const first = ops[0];
1217
+ for (const o of ops) {
1218
+ if (o !== first) {
1219
+ return false;
1220
+ }
1221
+ }
1222
+ return !!first;
1223
+ }
1224
+ return false;
1225
+ }));
1226
+ }
1227
+ get empty() {
1228
+ return !this._nodes.value.length && !this._groups.length;
1229
+ }
1230
+ dispose() {
1231
+ this._nodes.complete();
1232
+ this._touch.complete();
1233
+ }
1234
+ touched() {
1235
+ this._touch.next(undefined);
1236
+ }
1237
+ register(value) {
1238
+ const selected = !!this.lastValues && this.lastValues.indexOf(value) >= 0;
1239
+ const node = new OptionNode(this, value, selected);
1240
+ this._nodes.next([
1241
+ ...this._nodes.value,
1242
+ node
1243
+ ]);
1244
+ return node;
1245
+ }
1246
+ unregister(node) {
1247
+ this._nodes.next(this._nodes.value.filter(n => n !== node));
1248
+ node.dispose();
1249
+ }
1250
+ registerGroup(group) {
1251
+ this._groups.push(group);
1252
+ }
1253
+ unregisterGroup(group) {
1254
+ this._groups.splice(this._groups.indexOf(group), 1);
1255
+ }
1256
+ lastValues = [];
1257
+ writeValue(values) {
1258
+ if (values !== this.lastValues) {
1259
+ this.lastValues = values || [];
1260
+ if (values) {
1261
+ this._nodes.value.forEach(n => {
1262
+ n.setSelected(values.indexOf(n.value) >= 0);
1263
+ });
1264
+ }
1265
+ else {
1266
+ this._nodes.value.forEach(n => {
1267
+ n.setSelected(false);
1268
+ });
1269
+ }
1270
+ }
1271
+ }
1272
+ setAll(selected) {
1273
+ this._nodes.value.forEach(m => m.setSelected(selected));
1274
+ }
1275
+ }
1276
+
1277
+ class OptionCheckboxService {
1278
+ nodes = {};
1279
+ getPool(name) {
1280
+ if (!this.nodes[name]) {
1281
+ this.nodes[name] = new NodePool(name);
1282
+ }
1283
+ return this.nodes[name];
1284
+ }
1285
+ registerGroup(name, group) {
1286
+ const pool = this.getPool(name);
1287
+ pool.registerGroup(group);
1288
+ return pool;
1289
+ }
1290
+ unregisterGroup(name, group) {
1291
+ if (this.nodes[name]) {
1292
+ this.nodes[name].unregisterGroup(group);
1293
+ if (this.nodes[name].empty) {
1294
+ this.nodes[name].dispose();
1295
+ delete this.nodes[name];
1296
+ }
1297
+ }
1298
+ }
1299
+ unregister(name, node) {
1300
+ if (this.nodes[name]) {
1301
+ this.nodes[name].unregister(node);
1302
+ if (this.nodes[name].empty) {
1303
+ this.nodes[name].dispose();
1304
+ delete this.nodes[name];
1305
+ }
1306
+ }
1307
+ }
1308
+ register(name, value) {
1309
+ return this.getPool(name).register(value);
1310
+ }
1311
+ setAll(name, selected) {
1312
+ if (this.nodes[name]) {
1313
+ this.nodes[name].setAll(selected);
1314
+ }
1315
+ }
1316
+ writeValue(name, model) {
1317
+ this.getPool(name)?.writeValue(model);
1318
+ }
1319
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: OptionCheckboxService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1320
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: OptionCheckboxService, providedIn: 'root' });
1321
+ }
1322
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: OptionCheckboxService, decorators: [{
1323
+ type: Injectable,
1324
+ args: [{
1325
+ providedIn: 'root'
1326
+ }]
1327
+ }] });
1328
+
1329
+ class AllOptionCheckboxComponent {
1330
+ fotonOptionCheckboxService;
1331
+ _name;
1332
+ disabled = false;
1333
+ change = new EventEmitter();
1334
+ selected;
1335
+ pool;
1336
+ constructor(fotonOptionCheckboxService) {
1337
+ this.fotonOptionCheckboxService = fotonOptionCheckboxService;
1338
+ }
1339
+ get name() {
1340
+ return this._name;
1341
+ }
1342
+ set name(name) {
1343
+ this._name = name;
1344
+ this.pool = this.fotonOptionCheckboxService.getPool(name);
1345
+ this.selected = this.pool.all();
1346
+ }
1347
+ setSelected(selected) {
1348
+ this.pool?.touched();
1349
+ this.fotonOptionCheckboxService.setAll(this.name, selected);
1350
+ this.change.emit();
1351
+ }
1352
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AllOptionCheckboxComponent, deps: [{ token: OptionCheckboxService }], target: i0.ɵɵFactoryTarget.Component });
1353
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: AllOptionCheckboxComponent, isStandalone: true, selector: "mcl-option-checkbox[select-all-option]", inputs: { disabled: "disabled", name: "name" }, outputs: { change: "change" }, ngImport: i0, template: "<mat-checkbox [disabled]=\"disabled\"\n [ngModel]=\"selected | async\"\n (ngModelChange)=\"setSelected($event)\"\n [indeterminate]=\"(selected | async) === undefined\" >\n <ng-content></ng-content>\n</mat-checkbox>\n", dependencies: [{ kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: AsyncPipe, name: "async" }] });
1354
+ }
1355
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AllOptionCheckboxComponent, decorators: [{
1356
+ type: Component,
1357
+ args: [{ selector: 'mcl-option-checkbox[select-all-option]', imports: [
1358
+ MatCheckbox,
1359
+ FormsModule,
1360
+ AsyncPipe
1361
+ ], template: "<mat-checkbox [disabled]=\"disabled\"\n [ngModel]=\"selected | async\"\n (ngModelChange)=\"setSelected($event)\"\n [indeterminate]=\"(selected | async) === undefined\" >\n <ng-content></ng-content>\n</mat-checkbox>\n" }]
1362
+ }], ctorParameters: () => [{ type: OptionCheckboxService }], propDecorators: { disabled: [{
1363
+ type: Input
1364
+ }], change: [{
1365
+ type: Output
1366
+ }], name: [{
1367
+ type: Input
1368
+ }] } });
1369
+
1370
+ class OptionCheckboxComponent {
1371
+ fotonOptionCheckboxService;
1372
+ _name;
1373
+ _value;
1374
+ node;
1375
+ selected;
1376
+ disabled = false;
1377
+ change = new EventEmitter();
1378
+ constructor(fotonOptionCheckboxService) {
1379
+ this.fotonOptionCheckboxService = fotonOptionCheckboxService;
1380
+ }
1381
+ setSelected(selected) {
1382
+ if (this.node) {
1383
+ this.node.touched();
1384
+ this.node.setSelected(selected);
1385
+ this.change.emit();
1386
+ }
1387
+ }
1388
+ get value() {
1389
+ return this.node ? this.node.value : undefined;
1390
+ }
1391
+ set value(v) {
1392
+ if (v != this.value) {
1393
+ if (this.node) {
1394
+ this.node.value = v;
1395
+ }
1396
+ else {
1397
+ this._value = v;
1398
+ }
1399
+ }
1400
+ }
1401
+ get name() {
1402
+ return this._name;
1403
+ }
1404
+ set name(n) {
1405
+ if (n !== this.name && !this.node) {
1406
+ this.node = this.fotonOptionCheckboxService.register(n, this._value);
1407
+ this.selected = this.node.observable;
1408
+ this._name = n;
1409
+ }
1410
+ }
1411
+ onBlur() {
1412
+ }
1413
+ ngOnDestroy() {
1414
+ this.fotonOptionCheckboxService.unregister(this.name, this.node);
1415
+ }
1416
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: OptionCheckboxComponent, deps: [{ token: OptionCheckboxService }], target: i0.ɵɵFactoryTarget.Component });
1417
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: OptionCheckboxComponent, isStandalone: true, selector: "mcl-option-checkbox:not([select-all-option])", inputs: { disabled: "disabled", value: "value", name: "name" }, outputs: { change: "change" }, ngImport: i0, template: "<mat-checkbox [disabled]=\"disabled\"\n [ngModel]=\"selected | async\"\n (ngModelChange)=\"setSelected($event)\"\n [indeterminate]=\"(selected | async) === undefined\" >\n <ng-content></ng-content>\n</mat-checkbox>\n", dependencies: [{ kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: AsyncPipe, name: "async" }] });
1418
+ }
1419
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: OptionCheckboxComponent, decorators: [{
1420
+ type: Component,
1421
+ args: [{ selector: 'mcl-option-checkbox:not([select-all-option])', imports: [
1422
+ MatCheckbox,
1423
+ FormsModule,
1424
+ AsyncPipe
1425
+ ], template: "<mat-checkbox [disabled]=\"disabled\"\n [ngModel]=\"selected | async\"\n (ngModelChange)=\"setSelected($event)\"\n [indeterminate]=\"(selected | async) === undefined\" >\n <ng-content></ng-content>\n</mat-checkbox>\n" }]
1426
+ }], ctorParameters: () => [{ type: OptionCheckboxService }], propDecorators: { disabled: [{
1427
+ type: Input
1428
+ }], change: [{
1429
+ type: Output
1430
+ }], value: [{
1431
+ type: Input
1432
+ }], name: [{
1433
+ type: Input
1434
+ }] } });
1435
+
1436
+ class OptionCheckboxGroupComponent {
1437
+ optionCheckboxService;
1438
+ callbackTimeout;
1439
+ _name;
1440
+ pool;
1441
+ disabled = false;
1442
+ change = new EventEmitter();
1443
+ touched = new EventEmitter();
1444
+ constructor(optionCheckboxService) {
1445
+ this.optionCheckboxService = optionCheckboxService;
1446
+ }
1447
+ onTouchedCallback = () => {
1448
+ };
1449
+ onChangeCallback = () => {
1450
+ };
1451
+ get name() {
1452
+ return this._name;
1453
+ }
1454
+ set name(n) {
1455
+ if (n !== this.name && !this.pool) {
1456
+ this.pool = this.optionCheckboxService.registerGroup(n, this);
1457
+ this.pool.touch().subscribe(() => {
1458
+ this.onTouchedCallback();
1459
+ this.touched.emit();
1460
+ });
1461
+ this.pool.model().subscribe(model => {
1462
+ clearTimeout(this.callbackTimeout);
1463
+ this.callbackTimeout = setTimeout(() => {
1464
+ this.onChangeCallback(model);
1465
+ this.change.emit(model);
1466
+ });
1467
+ });
1468
+ this._name = n;
1469
+ }
1470
+ }
1471
+ onBlur() {
1472
+ }
1473
+ ngOnDestroy() {
1474
+ this.optionCheckboxService.unregisterGroup(this.name, this);
1475
+ }
1476
+ writeValue(value) {
1477
+ this.optionCheckboxService.writeValue(this.name, value);
1478
+ }
1479
+ registerOnChange(fn) {
1480
+ this.onChangeCallback = fn;
1481
+ }
1482
+ registerOnTouched(fn) {
1483
+ this.onTouchedCallback = fn;
1484
+ }
1485
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: OptionCheckboxGroupComponent, deps: [{ token: OptionCheckboxService }], target: i0.ɵɵFactoryTarget.Component });
1486
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: OptionCheckboxGroupComponent, isStandalone: true, selector: "mcl-option-checkbox-group", inputs: { disabled: "disabled", name: "name" }, outputs: { change: "change", touched: "touched" }, providers: [
1487
+ {
1488
+ provide: NG_VALUE_ACCESSOR,
1489
+ useExisting: OptionCheckboxGroupComponent,
1490
+ multi: true
1491
+ }
1492
+ ], ngImport: i0, template: '', isInline: true });
1493
+ }
1494
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: OptionCheckboxGroupComponent, decorators: [{
1495
+ type: Component,
1496
+ args: [{
1497
+ selector: 'mcl-option-checkbox-group',
1498
+ template: '',
1499
+ providers: [
1500
+ {
1501
+ provide: NG_VALUE_ACCESSOR,
1502
+ useExisting: OptionCheckboxGroupComponent,
1503
+ multi: true
1504
+ }
1505
+ ]
1506
+ }]
1507
+ }], ctorParameters: () => [{ type: OptionCheckboxService }], propDecorators: { disabled: [{
1508
+ type: Input
1509
+ }], change: [{
1510
+ type: Output
1511
+ }], touched: [{
1512
+ type: Output
1513
+ }], name: [{
1514
+ type: Input
1515
+ }] } });
1516
+
1517
+ class SelectChipsComponent extends AbstractMatFormFieldSelectControl {
1518
+ add(event) {
1519
+ this.onTouched();
1520
+ const value = event.value;
1521
+ if (!!value) {
1522
+ this.value = [
1523
+ ...(this.value || []),
1524
+ value
1525
+ ];
1526
+ this.onChange(this.value);
1527
+ }
1528
+ }
1529
+ remove(item) {
1530
+ this.onTouched();
1531
+ if (this.value) {
1532
+ const index = this.value.indexOf(item);
1533
+ if (index >= 0) {
1534
+ this.value.splice(index, 1);
1535
+ }
1536
+ if (!this.value.length) {
1537
+ this.value = undefined;
1538
+ }
1539
+ this.onChange(this.value);
1540
+ }
1541
+ }
1542
+ selected(event) {
1543
+ this.onTouched();
1544
+ if (!this.value || !this.value.find((v) => v === event.option.value)) {
1545
+ this.value = [
1546
+ ...(this.value || []),
1547
+ event.option.value
1548
+ ];
1549
+ this.onChange(this.value);
1550
+ }
1551
+ this.control.setValue('');
1552
+ }
1553
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectChipsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1554
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: SelectChipsComponent, isStandalone: true, selector: "mcl-select-chips", providers: [
1555
+ {
1556
+ provide: MatFormFieldControl,
1557
+ useExisting: SelectChipsComponent
1558
+ }
1559
+ ], usesInheritance: true, ngImport: i0, template: "<mat-chip-grid #chipList>\n @for (item of value; track doTrackBy(value)) {\n <mat-chip\n [removable]=\"!disabled\"\n (removed)=\"remove(item)\">\n {{ item }}\n @if (!disabled) {\n <mat-icon matChipRemove>cancel</mat-icon>\n }\n </mat-chip>\n }\n <input\n [placeholder]=\"placeholder\" required\n (focusin)=\"focused = true\"\n (focusout)=\"focused = false\"\n [formControl]=\"control\"\n [matAutocomplete]=\"filterAutocomplete\"\n [matChipInputFor]=\"chipList\"\n (matChipInputTokenEnd)=\"add($event)\">\n</mat-chip-grid>\n<mat-autocomplete #filterAutocomplete=\"matAutocomplete\" (optionSelected)=\"selected($event)\">\n @for (opcao of filteredOptions | async; track doTrackBy(opcao.value)) {\n <mat-option [value]=\"opcao.value\">\n {{ opcao.label }}\n </mat-option>\n }\n</mat-autocomplete>\n", styles: [""], dependencies: [{ kind: "component", type: MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "directive", type: MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "component", type: MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }] });
1560
+ }
1561
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectChipsComponent, decorators: [{
1562
+ type: Component,
1563
+ args: [{ selector: 'mcl-select-chips', imports: [
1564
+ MatChip,
1565
+ MatIcon,
1566
+ ReactiveFormsModule,
1567
+ MatAutocompleteTrigger,
1568
+ MatChipInput,
1569
+ MatChipGrid,
1570
+ AsyncPipe,
1571
+ MatAutocomplete,
1572
+ MatOption,
1573
+ ], providers: [
1574
+ {
1575
+ provide: MatFormFieldControl,
1576
+ useExisting: SelectChipsComponent
1577
+ }
1578
+ ], template: "<mat-chip-grid #chipList>\n @for (item of value; track doTrackBy(value)) {\n <mat-chip\n [removable]=\"!disabled\"\n (removed)=\"remove(item)\">\n {{ item }}\n @if (!disabled) {\n <mat-icon matChipRemove>cancel</mat-icon>\n }\n </mat-chip>\n }\n <input\n [placeholder]=\"placeholder\" required\n (focusin)=\"focused = true\"\n (focusout)=\"focused = false\"\n [formControl]=\"control\"\n [matAutocomplete]=\"filterAutocomplete\"\n [matChipInputFor]=\"chipList\"\n (matChipInputTokenEnd)=\"add($event)\">\n</mat-chip-grid>\n<mat-autocomplete #filterAutocomplete=\"matAutocomplete\" (optionSelected)=\"selected($event)\">\n @for (opcao of filteredOptions | async; track doTrackBy(opcao.value)) {\n <mat-option [value]=\"opcao.value\">\n {{ opcao.label }}\n </mat-option>\n }\n</mat-autocomplete>\n" }]
1579
+ }] });
1580
+
1581
+ class SelectAutocompleteComponent extends AbstractMatFormFieldSelectControl {
1582
+ readonly;
1583
+ select = new EventEmitter();
1584
+ blur = new EventEmitter();
1585
+ get shouldLabelFloat() {
1586
+ return this.focused || !this.empty;
1587
+ }
1588
+ get empty() {
1589
+ return !this.value;
1590
+ }
1591
+ onFocus() {
1592
+ this.focused = true;
1593
+ this.stateChanges.next();
1594
+ }
1595
+ onBlur() {
1596
+ this.focused = false;
1597
+ this.stateChanges.next();
1598
+ this.blur.emit();
1599
+ }
1600
+ didTouch() {
1601
+ this.onTouched();
1602
+ }
1603
+ ngOnDestroy() {
1604
+ super.ngOnDestroy();
1605
+ this.optionsSubscription?.unsubscribe();
1606
+ }
1607
+ setDisabledState(isDisabled) {
1608
+ this.disabled = isDisabled;
1609
+ if (isDisabled) {
1610
+ this.control.disable();
1611
+ }
1612
+ else {
1613
+ this.control.enable();
1614
+ }
1615
+ }
1616
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectAutocompleteComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1617
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: SelectAutocompleteComponent, isStandalone: true, selector: "mcl-select-autocomplete", inputs: { readonly: "readonly" }, outputs: { select: "select", blur: "blur" }, providers: [
1618
+ {
1619
+ provide: MatFormFieldControl,
1620
+ useExisting: SelectAutocompleteComponent
1621
+ }
1622
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput name=\"autocomplete\" autocomplete=\"off\"\n [formControl]=\"control\" [matAutocomplete]=\"autocompleteGeneric\"\n (keyup)=\"didTouch()\" (focus)=\"onFocus()\" (blur)=\"onBlur()\"\n [disabled]=\"disabled\" [readonly]=\"readonly\"/>\n<mat-autocomplete #autocompleteGeneric=\"matAutocomplete\"\n (optionSelected)=\"seleciona($event)\">\n @for (opcao of filteredOptions | async; track doTrackBy(opcao.value)) {\n <mat-option [value]=\"opcao.value\">\n {{ opcao.label }}\n </mat-option>\n }\n</mat-autocomplete>\n", styles: [".mat-option{line-height:inherit;height:inherit}h3{color:#333;margin:5px;white-space:nowrap;font-size:16px}p{color:#666;margin:5px;white-space:nowrap;font-size:12px}\n"], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "pipe", type: AsyncPipe, name: "async" }] });
1623
+ }
1624
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectAutocompleteComponent, decorators: [{
1625
+ type: Component,
1626
+ args: [{ selector: 'mcl-select-autocomplete', imports: [
1627
+ MatInput,
1628
+ MatAutocompleteTrigger,
1629
+ ReactiveFormsModule,
1630
+ MatAutocomplete,
1631
+ MatOption,
1632
+ AsyncPipe
1633
+ ], providers: [
1634
+ {
1635
+ provide: MatFormFieldControl,
1636
+ useExisting: SelectAutocompleteComponent
1637
+ }
1638
+ ], template: "<input matInput name=\"autocomplete\" autocomplete=\"off\"\n [formControl]=\"control\" [matAutocomplete]=\"autocompleteGeneric\"\n (keyup)=\"didTouch()\" (focus)=\"onFocus()\" (blur)=\"onBlur()\"\n [disabled]=\"disabled\" [readonly]=\"readonly\"/>\n<mat-autocomplete #autocompleteGeneric=\"matAutocomplete\"\n (optionSelected)=\"seleciona($event)\">\n @for (opcao of filteredOptions | async; track doTrackBy(opcao.value)) {\n <mat-option [value]=\"opcao.value\">\n {{ opcao.label }}\n </mat-option>\n }\n</mat-autocomplete>\n", styles: [".mat-option{line-height:inherit;height:inherit}h3{color:#333;margin:5px;white-space:nowrap;font-size:16px}p{color:#666;margin:5px;white-space:nowrap;font-size:12px}\n"] }]
1639
+ }], propDecorators: { readonly: [{
1640
+ type: Input
1641
+ }], select: [{
1642
+ type: Output
1643
+ }], blur: [{
1644
+ type: Output
1645
+ }] } });
1646
+
1647
+ class DelegateOptionProviderDirective {
1648
+ delegate;
1649
+ type() {
1650
+ return this.delegate?.type() || 'string';
1651
+ }
1652
+ provide(search) {
1653
+ return this.delegate.provide(search);
1654
+ }
1655
+ label(value) {
1656
+ return this.delegate.label(value);
1657
+ }
1658
+ trackBy(value) {
1659
+ if (!!this.delegate?.trackBy) {
1660
+ return this.delegate.trackBy(value);
1661
+ }
1662
+ return value;
1663
+ }
1664
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: DelegateOptionProviderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1665
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: DelegateOptionProviderDirective, isStandalone: true, selector: "mcl-select-autocomplete[delegate]", inputs: { delegate: "delegate" }, providers: [{
1666
+ provide: SELECT_OPTION_PROVIDER,
1667
+ useExisting: DelegateOptionProviderDirective,
1668
+ }], ngImport: i0 });
1669
+ }
1670
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: DelegateOptionProviderDirective, decorators: [{
1671
+ type: Directive,
1672
+ args: [{
1673
+ selector: 'mcl-select-autocomplete[delegate]',
1674
+ providers: [{
1675
+ provide: SELECT_OPTION_PROVIDER,
1676
+ useExisting: DelegateOptionProviderDirective,
1677
+ }]
1678
+ }]
1679
+ }], propDecorators: { delegate: [{
1680
+ type: Input
1681
+ }] } });
1682
+
1683
+ class SelectManyCheckboxComponent extends AbstractMatFormFieldSelectControl {
1684
+ layout = 'grid';
1685
+ layoutColumns = 3;
1686
+ get shouldLabelFloat() {
1687
+ return true;
1688
+ }
1689
+ selected(value) {
1690
+ return !!this.value?.find((v) => v === value);
1691
+ }
1692
+ change(value, checked) {
1693
+ if (checked) {
1694
+ if (!this.selected(value)) {
1695
+ this.value = [
1696
+ ...(this.value || []),
1697
+ value
1698
+ ];
1699
+ }
1700
+ }
1701
+ else if (this.selected(value)) {
1702
+ this.value = [
1703
+ ...(this.value || []).filter((v) => v !== value),
1704
+ ];
1705
+ }
1706
+ }
1707
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectManyCheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1708
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: SelectManyCheckboxComponent, isStandalone: true, selector: "mcl-select-many-checkbox", inputs: { layout: "layout", layoutColumns: "layoutColumns" }, providers: [
1709
+ {
1710
+ provide: MatFormFieldControl,
1711
+ useExisting: SelectManyCheckboxComponent
1712
+ }
1713
+ ], usesInheritance: true, ngImport: i0, template: "<div class=\"mat-checkbox-container\"\n [ngClass]=\"{'vertical':layout === 'vertical','horizontal':layout ==='horizontal','grid': layout === 'grid' }\"\n [ngStyle]=\"{'max-height': layout === 'grid' ? (((((filteredOptions | async)?.length || 0) / layoutColumns) + 1) * 40) + 'px' : undefined}\">\n @for (opcao of filteredOptions | async; track doTrackBy(opcao.value)) {\n <mat-checkbox\n [required]=\"required\"\n [disabled]=\"disabled\"\n [checked]=\"selected(opcao.value)\"\n (change)=\"change(opcao.value, $event.checked)\">\n {{ opcao.label }}\n </mat-checkbox>\n }\n</div>\n", styles: [".mat-checkbox-container{display:flex;flex-wrap:wrap}.mat-checkbox-container.horizontal{flex-direction:row}.mat-checkbox-container.vertical,.mat-checkbox-container.grid{flex-direction:column}.mat-checkbox-container mat-checkbox{flex:1;padding:5px 5px 10px 0}@media (max-width: 750px){.mat-checkbox-container{max-height:none!important}.mat-checkbox-container.horizontal,.mat-checkbox-container.vertical,.mat-checkbox-container.grid{flex-direction:column}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "pipe", type: AsyncPipe, name: "async" }] });
1714
+ }
1715
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectManyCheckboxComponent, decorators: [{
1716
+ type: Component,
1717
+ args: [{ selector: 'mcl-select-many-checkbox', imports: [
1718
+ NgClass,
1719
+ NgStyle,
1720
+ MatCheckbox,
1721
+ AsyncPipe
1722
+ ], providers: [
1723
+ {
1724
+ provide: MatFormFieldControl,
1725
+ useExisting: SelectManyCheckboxComponent
1726
+ }
1727
+ ], template: "<div class=\"mat-checkbox-container\"\n [ngClass]=\"{'vertical':layout === 'vertical','horizontal':layout ==='horizontal','grid': layout === 'grid' }\"\n [ngStyle]=\"{'max-height': layout === 'grid' ? (((((filteredOptions | async)?.length || 0) / layoutColumns) + 1) * 40) + 'px' : undefined}\">\n @for (opcao of filteredOptions | async; track doTrackBy(opcao.value)) {\n <mat-checkbox\n [required]=\"required\"\n [disabled]=\"disabled\"\n [checked]=\"selected(opcao.value)\"\n (change)=\"change(opcao.value, $event.checked)\">\n {{ opcao.label }}\n </mat-checkbox>\n }\n</div>\n", styles: [".mat-checkbox-container{display:flex;flex-wrap:wrap}.mat-checkbox-container.horizontal{flex-direction:row}.mat-checkbox-container.vertical,.mat-checkbox-container.grid{flex-direction:column}.mat-checkbox-container mat-checkbox{flex:1;padding:5px 5px 10px 0}@media (max-width: 750px){.mat-checkbox-container{max-height:none!important}.mat-checkbox-container.horizontal,.mat-checkbox-container.vertical,.mat-checkbox-container.grid{flex-direction:column}}\n"] }]
1728
+ }], propDecorators: { layout: [{
1729
+ type: Input
1730
+ }], layoutColumns: [{
1731
+ type: Input
1732
+ }] } });
1733
+
1734
+ class SelectRadioComponent extends AbstractMatFormFieldSelectControl {
1735
+ layout = 'vertical';
1736
+ get shouldLabelFloat() {
1737
+ return true;
1738
+ }
1739
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectRadioComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1740
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: SelectRadioComponent, isStandalone: true, selector: "mcl-select-radio", inputs: { layout: "layout" }, providers: [
1741
+ {
1742
+ provide: MatFormFieldControl,
1743
+ useExisting: SelectRadioComponent
1744
+ }
1745
+ ], usesInheritance: true, ngImport: i0, template: "<mat-radio-group\n [ngClass]=\"{'vertical':layout === 'vertical','horizontal':layout ==='horizontal'}\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"value\">\n\n @for (opcao of filteredOptions | async; track doTrackBy(opcao.value)) {\n <mat-radio-button [value]=\"opcao.value\">{{ opcao.label }}</mat-radio-button>\n }\n\n</mat-radio-group>\n", styles: ["mat-radio-group{display:flex}mat-radio-group.horizontal{flex-direction:row}mat-radio-group.vertical{flex-direction:column}mat-radio-group mat-radio-button{flex:1}@media (max-width: 750px){mat-radio-group.horizontal,mat-radio-group.vertical{flex-direction:column}mat-radio-group.horizontal mat-radio-button,mat-radio-group.vertical mat-radio-button{margin:10px 0}}\n"], dependencies: [{ kind: "directive", type: MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "pipe", type: AsyncPipe, name: "async" }] });
1746
+ }
1747
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectRadioComponent, decorators: [{
1748
+ type: Component,
1749
+ args: [{ selector: 'mcl-select-radio', imports: [
1750
+ MatRadioGroup,
1751
+ NgClass,
1752
+ FormsModule,
1753
+ MatRadioButton,
1754
+ AsyncPipe
1755
+ ], providers: [
1756
+ {
1757
+ provide: MatFormFieldControl,
1758
+ useExisting: SelectRadioComponent
1759
+ }
1760
+ ], template: "<mat-radio-group\n [ngClass]=\"{'vertical':layout === 'vertical','horizontal':layout ==='horizontal'}\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"value\">\n\n @for (opcao of filteredOptions | async; track doTrackBy(opcao.value)) {\n <mat-radio-button [value]=\"opcao.value\">{{ opcao.label }}</mat-radio-button>\n }\n\n</mat-radio-group>\n", styles: ["mat-radio-group{display:flex}mat-radio-group.horizontal{flex-direction:row}mat-radio-group.vertical{flex-direction:column}mat-radio-group mat-radio-button{flex:1}@media (max-width: 750px){mat-radio-group.horizontal,mat-radio-group.vertical{flex-direction:column}mat-radio-group.horizontal mat-radio-button,mat-radio-group.vertical mat-radio-button{margin:10px 0}}\n"] }]
1761
+ }], propDecorators: { layout: [{
1762
+ type: Input
1763
+ }] } });
1764
+
1765
+ class InputTelefoneInternacionalComponent extends AbstractMatFormFieldControl {
1766
+ preferredContries = ['br'];
1767
+ readonly;
1768
+ blur = new EventEmitter();
1769
+ alwaysShowCountry = false;
1770
+ telInput;
1771
+ $innerValue;
1772
+ get value() {
1773
+ return this.$innerValue;
1774
+ }
1775
+ set value(value) {
1776
+ this.$innerValue = value;
1777
+ this.stateChanges.next();
1778
+ this.onChange(value?.replace(/[^\d+]/g, ''));
1779
+ }
1780
+ get shouldLabelFloat() {
1781
+ return this.focused || !this.empty || this.alwaysShowCountry;
1782
+ }
1783
+ get empty() {
1784
+ return !this.value;
1785
+ }
1786
+ onFocus() {
1787
+ this.focused = true;
1788
+ this.stateChanges.next();
1789
+ }
1790
+ onBlur() {
1791
+ this.focused = false;
1792
+ this.stateChanges.next();
1793
+ this.blur.emit();
1794
+ }
1795
+ writeValue(value) {
1796
+ this.value = value;
1797
+ }
1798
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputTelefoneInternacionalComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1799
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: InputTelefoneInternacionalComponent, isStandalone: true, selector: "mcl-input-telefone-intl", inputs: { preferredContries: "preferredContries", readonly: "readonly", alwaysShowCountry: "alwaysShowCountry" }, outputs: { blur: "blur" }, providers: [
1800
+ {
1801
+ provide: MatFormFieldControl,
1802
+ useExisting: InputTelefoneInternacionalComponent
1803
+ },
1804
+ ], viewQueries: [{ propertyName: "telInput", first: true, predicate: ["input"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"input\">\n <lac-mat-country-selector\n [ngClass]=\"{'hidden': !focused && !value && !alwaysShowCountry}\"\n [preferredCountries]=\"preferredContries\"\n [selectorFor]=\"input\"\n searchPlaceholder=\"Filtrar paises...\"></lac-mat-country-selector>\n <lac-mat-tel-input #input\n [(ngModel)]=\"value\"\n (focusin)=\"onFocus()\" (focusout)=\"onBlur()\"></lac-mat-tel-input>\n</div>\n", styles: [".input{display:flex;align-items:center;margin:-8px 0;gap:8px}.input lac-mat-country-selector{transition:.3s}.input lac-mat-country-selector.hidden{opacity:0}.input lac-mat-tel-input{flex:1 1 auto}\n"], dependencies: [{ kind: "ngmodule", type: LacMatTelInputModule }, { kind: "component", type: i1$3.LacMatTelInputComponent, selector: "lac-mat-tel-input", inputs: ["required", "disabled", "internationalFormat"], outputs: ["blur"] }, { kind: "component", type: i1$3.LacMatCountrySelectorComponent, selector: "lac-mat-country-selector", inputs: ["selectorFor", "preferredCountries", "onlyCountries", "showDialCode", "disableSearch", "searchPlaceholder"], outputs: ["change"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
1805
+ }
1806
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputTelefoneInternacionalComponent, decorators: [{
1807
+ type: Component,
1808
+ args: [{ selector: 'mcl-input-telefone-intl', imports: [
1809
+ LacMatTelInputModule,
1810
+ NgClass,
1811
+ FormsModule
1812
+ ], providers: [
1813
+ {
1814
+ provide: MatFormFieldControl,
1815
+ useExisting: InputTelefoneInternacionalComponent
1816
+ },
1817
+ ], template: "<div class=\"input\">\n <lac-mat-country-selector\n [ngClass]=\"{'hidden': !focused && !value && !alwaysShowCountry}\"\n [preferredCountries]=\"preferredContries\"\n [selectorFor]=\"input\"\n searchPlaceholder=\"Filtrar paises...\"></lac-mat-country-selector>\n <lac-mat-tel-input #input\n [(ngModel)]=\"value\"\n (focusin)=\"onFocus()\" (focusout)=\"onBlur()\"></lac-mat-tel-input>\n</div>\n", styles: [".input{display:flex;align-items:center;margin:-8px 0;gap:8px}.input lac-mat-country-selector{transition:.3s}.input lac-mat-country-selector.hidden{opacity:0}.input lac-mat-tel-input{flex:1 1 auto}\n"] }]
1818
+ }], propDecorators: { preferredContries: [{
1819
+ type: Input
1820
+ }], readonly: [{
1821
+ type: Input
1822
+ }], blur: [{
1823
+ type: Output
1824
+ }], alwaysShowCountry: [{
1825
+ type: Input
1826
+ }], telInput: [{
1827
+ type: ViewChild,
1828
+ args: ['input']
1829
+ }] } });
1830
+
1831
+ class InputTelefoneInternacionalValidatorDirective {
1832
+ constructor() {
1833
+ }
1834
+ validate(control) {
1835
+ return phoneNumberValidator(control);
1836
+ }
1837
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputTelefoneInternacionalValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1838
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: InputTelefoneInternacionalValidatorDirective, isStandalone: true, selector: "mcl-input-telefone-intl,[mclInputTelefoneIntl]", providers: [{
1839
+ provide: NG_VALIDATORS,
1840
+ useExisting: InputTelefoneInternacionalValidatorDirective,
1841
+ multi: true,
1842
+ }], ngImport: i0 });
1843
+ }
1844
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputTelefoneInternacionalValidatorDirective, decorators: [{
1845
+ type: Directive,
1846
+ args: [{
1847
+ selector: 'mcl-input-telefone-intl,[mclInputTelefoneIntl]',
1848
+ providers: [{
1849
+ provide: NG_VALIDATORS,
1850
+ useExisting: InputTelefoneInternacionalValidatorDirective,
1851
+ multi: true,
1852
+ }]
1853
+ }]
1854
+ }], ctorParameters: () => [] });
1855
+
1856
+ /**
1857
+ * Generated bundle index. Do not edit.
1858
+ */
1859
+
1860
+ export { AbstractMatFormFieldControl, AbstractMatFormFieldSelectControl, AllOptionCheckboxComponent, DelegateOptionProviderDirective, InputCepComponent, InputCnpjComponent, InputCpfCnpjComponent, InputCpfComponent, InputCurrencyComponent, InputDatetimeComponent, InputFileUploadComponent, InputFileUploadValidatorDirective, InputMaskComponent, InputPhoneComponent, InputTelefoneInternacionalComponent, InputTelefoneInternacionalValidatorDirective, OptionCheckboxComponent, OptionCheckboxGroupComponent, SELECT_OPTION_PROVIDER, SelectAutocompleteComponent, SelectChipsComponent, SelectManyCheckboxComponent, SelectOptionComponent, SelectRadioComponent };
1861
+ //# sourceMappingURL=main-class-componentes-input.mjs.map