@main-class/componentes 3.2.6 → 3.2.7

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 +1845 -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 +20 -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 +9 -9
  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,1845 @@
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, LOCALE_ID, EventEmitter, Output, 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
+ _input;
41
+ get input() {
42
+ return this._input;
43
+ }
44
+ set input(value) {
45
+ this._input = value;
46
+ }
47
+ stateChanges = new Subject();
48
+ id = `custom-input-${AbstractMatFormFieldControl.nextId++}`;
49
+ describedBy = '';
50
+ onChange = (val) => {
51
+ };
52
+ onTouched = () => {
53
+ };
54
+ get value() {
55
+ return this.$value;
56
+ }
57
+ set value(value) {
58
+ this.$value = value;
59
+ this.onChange(value);
60
+ this.stateChanges.next();
61
+ }
62
+ get empty() {
63
+ return !this.value;
64
+ }
65
+ get autofilled() {
66
+ return false;
67
+ }
68
+ get userAriaDescribedBy() {
69
+ return undefined;
70
+ }
71
+ get disableAutomaticLabeling() {
72
+ return undefined;
73
+ }
74
+ onContainerClick(event) {
75
+ }
76
+ ngOnInit() {
77
+ if (this.ngControl != null) {
78
+ this.ngControl.valueAccessor = this;
79
+ }
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
+ }], 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
+ get value() {
336
+ return super.value;
337
+ }
338
+ set value(value) {
339
+ const unformatted = this.removeMask(value);
340
+ if (unformatted) {
341
+ super.value = this.keepMask ? this.applyMask(unformatted) : unformatted;
342
+ if (!!this.input) {
343
+ this.input.nativeElement.text = this.applyMask(unformatted);
344
+ }
345
+ }
346
+ }
347
+ set mask(mask) {
348
+ if (this.$mask !== mask) {
349
+ this.$mask = mask;
350
+ this.writeValue(this.value);
351
+ }
352
+ }
353
+ ngAfterViewInit() {
354
+ if (this.input && this.mask) {
355
+ const masked = this.applyMask(this.value);
356
+ if (!!this.input && masked !== this.value) {
357
+ this.input.nativeElement.text = masked;
358
+ }
359
+ }
360
+ }
361
+ applyMask(value) {
362
+ if (value && this.$mask) {
363
+ value = this.removeMask(value);
364
+ let result = '';
365
+ for (let im = 0, iv = 0; im < this.$mask.length && iv < value.length; im++) {
366
+ if (this.$mask[im] === '#') {
367
+ result += value[iv];
368
+ iv++;
369
+ }
370
+ else {
371
+ result += this.$mask[im];
372
+ }
373
+ }
374
+ return result;
375
+ }
376
+ return '';
377
+ }
378
+ removeMask(value) {
379
+ if (typeof value === 'number') {
380
+ value = String(value).padStart(this.$mask?.replace(/[^#]/, '')?.length || 0, '0');
381
+ }
382
+ if (value) {
383
+ return value.replaceAll(/\D+/g, '');
384
+ }
385
+ return undefined;
386
+ }
387
+ writeValue(value) {
388
+ super.writeValue(value);
389
+ const masked = this.applyMask(value);
390
+ if (!!this.input && masked !== this.value) {
391
+ this.input.nativeElement.text = masked;
392
+ }
393
+ }
394
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputMaskComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
395
+ 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" }, providers: [
396
+ {
397
+ provide: MatFormFieldControl,
398
+ useExisting: InputMaskComponent
399
+ }
400
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"onTouched()\"/>\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"] }] });
401
+ }
402
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputMaskComponent, decorators: [{
403
+ type: Component,
404
+ args: [{ selector: 'mcl-input[mask]', imports: [
405
+ MatInput,
406
+ FormsModule
407
+ ], providers: [
408
+ {
409
+ provide: MatFormFieldControl,
410
+ useExisting: InputMaskComponent
411
+ }
412
+ ], template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"onTouched()\"/>\n" }]
413
+ }], propDecorators: { keepMask: [{
414
+ type: Input
415
+ }], mask: [{
416
+ type: Input
417
+ }] } });
418
+
419
+ class InputDatetimeComponent extends AbstractMatFormFieldControl {
420
+ formats = inject(MAT_DATETIME_FORMATS);
421
+ adapter = inject(DatetimeAdapter);
422
+ type = 'date';
423
+ readonly;
424
+ name;
425
+ picker;
426
+ inputMask;
427
+ innerValue;
428
+ $maskedValue;
429
+ get input() {
430
+ return this.inputMask?.input;
431
+ }
432
+ set input(input) {
433
+ // não necessário
434
+ }
435
+ get empty() {
436
+ return !this.$maskedValue;
437
+ }
438
+ get maskedValue() {
439
+ return this.$maskedValue;
440
+ }
441
+ set maskedValue(maskedValue) {
442
+ if (this.$maskedValue !== maskedValue) {
443
+ this.onTouched();
444
+ this.$maskedValue = maskedValue;
445
+ if (maskedValue) {
446
+ if (maskedValue.match(new RegExp(`^${this.mask.replace(/#/g, '\\d')}$`))) {
447
+ this.innerValue = this.adapter.parse(maskedValue, this.format)?.toDate();
448
+ }
449
+ else {
450
+ this.innerValue = undefined;
451
+ }
452
+ }
453
+ else {
454
+ this.innerValue = undefined;
455
+ }
456
+ this.onChange(this.innerValue);
457
+ this.stateChanges.next();
458
+ }
459
+ }
460
+ get mask() {
461
+ switch (this.type) {
462
+ case 'date':
463
+ return '##/##/####';
464
+ case 'time':
465
+ return '##:##';
466
+ }
467
+ return '##/##/#### ##:##';
468
+ }
469
+ get format() {
470
+ switch (this.type) {
471
+ case 'date':
472
+ return this.formats.display.dateInput;
473
+ case 'time':
474
+ return this.formats.display.timeInput;
475
+ }
476
+ return this.formats.display.datetimeInput;
477
+ }
478
+ get value() {
479
+ return this.innerValue;
480
+ }
481
+ set value(value) {
482
+ if (this.innerValue !== value) {
483
+ this.onTouched();
484
+ if (value) {
485
+ this.innerValue = value instanceof Date ? value : value.toDate();
486
+ this.$maskedValue = this.adapter.format(moment(this.innerValue), this.format);
487
+ }
488
+ else {
489
+ this.innerValue = undefined;
490
+ this.$maskedValue = '';
491
+ }
492
+ this.onChange(this.innerValue);
493
+ this.stateChanges.next();
494
+ }
495
+ }
496
+ writeValue(value) {
497
+ this.innerValue = value;
498
+ if (value) {
499
+ this.$maskedValue = this.adapter.format(moment(value), this.format);
500
+ }
501
+ else {
502
+ this.$maskedValue = '';
503
+ }
504
+ this.stateChanges.next();
505
+ }
506
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputDatetimeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
507
+ 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: [
508
+ {
509
+ provide: MatFormFieldControl,
510
+ useExisting: InputDatetimeComponent
511
+ },
512
+ { provide: MAT_DATE_LOCALE, useExisting: LOCALE_ID },
513
+ {
514
+ provide: DatetimeAdapter,
515
+ useClass: MomentDatetimeAdapter
516
+ },
517
+ {
518
+ provide: MAT_DATETIME_FORMATS,
519
+ useValue: {
520
+ parse: {
521
+ dateInput: 'L',
522
+ monthInput: 'MMMM',
523
+ timeInput: 'LT',
524
+ datetimeInput: 'L LT'
525
+ },
526
+ display: {
527
+ dateInput: 'L',
528
+ monthInput: 'MMMM',
529
+ datetimeInput: 'L LT',
530
+ timeInput: 'LT',
531
+ monthYearLabel: 'MMM YYYY',
532
+ dateA11yLabel: 'LL',
533
+ monthYearA11yLabel: 'MMMM YYYY',
534
+ popupHeaderDateLabel: 'ddd, DD MMM'
535
+ }
536
+ }
537
+ }
538
+ ], 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"] }] });
539
+ }
540
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputDatetimeComponent, decorators: [{
541
+ type: Component,
542
+ args: [{ selector: 'mcl-input-datetime', imports: [
543
+ MatDatetimepickerModule,
544
+ MatMomentDatetimeModule,
545
+ FormsModule,
546
+ InputMaskComponent
547
+ ], providers: [
548
+ {
549
+ provide: MatFormFieldControl,
550
+ useExisting: InputDatetimeComponent
551
+ },
552
+ { provide: MAT_DATE_LOCALE, useExisting: LOCALE_ID },
553
+ {
554
+ provide: DatetimeAdapter,
555
+ useClass: MomentDatetimeAdapter
556
+ },
557
+ {
558
+ provide: MAT_DATETIME_FORMATS,
559
+ useValue: {
560
+ parse: {
561
+ dateInput: 'L',
562
+ monthInput: 'MMMM',
563
+ timeInput: 'LT',
564
+ datetimeInput: 'L LT'
565
+ },
566
+ display: {
567
+ dateInput: 'L',
568
+ monthInput: 'MMMM',
569
+ datetimeInput: 'L LT',
570
+ timeInput: 'LT',
571
+ monthYearLabel: 'MMM YYYY',
572
+ dateA11yLabel: 'LL',
573
+ monthYearA11yLabel: 'MMMM YYYY',
574
+ popupHeaderDateLabel: 'ddd, DD MMM'
575
+ }
576
+ }
577
+ }
578
+ ], 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"] }]
579
+ }], propDecorators: { type: [{
580
+ type: Input
581
+ }], readonly: [{
582
+ type: Input
583
+ }], name: [{
584
+ type: Input
585
+ }], picker: [{
586
+ type: ViewChild,
587
+ args: ['pickerData']
588
+ }], inputMask: [{
589
+ type: ViewChild,
590
+ args: ['inputMask']
591
+ }] } });
592
+
593
+ class InputFileUploadComponent {
594
+ errorStateMatcher;
595
+ ngControl;
596
+ parentForm;
597
+ changeDetectorRef;
598
+ parentFormGroup;
599
+ arquivoService;
600
+ static nextId = 0;
601
+ $placeholder = '';
602
+ $disabled = false;
603
+ $required = false;
604
+ value;
605
+ multiple;
606
+ limite;
607
+ accept;
608
+ template = 'preview';
609
+ agrupadores;
610
+ input;
611
+ selectCancel = new EventEmitter();
612
+ stateChanges = new Subject();
613
+ change = new EventEmitter();
614
+ id = `input-fileupload-${InputFileUploadComponent.nextId++}`;
615
+ describedBy = '';
616
+ constructor(errorStateMatcher, ngControl, parentForm, changeDetectorRef, parentFormGroup, arquivoService) {
617
+ this.errorStateMatcher = errorStateMatcher;
618
+ this.ngControl = ngControl;
619
+ this.parentForm = parentForm;
620
+ this.changeDetectorRef = changeDetectorRef;
621
+ this.parentFormGroup = parentFormGroup;
622
+ this.arquivoService = arquivoService;
623
+ if (this.ngControl != null) {
624
+ this.ngControl.valueAccessor = this;
625
+ }
626
+ }
627
+ onChange = (val) => {
628
+ };
629
+ onTouched = () => {
630
+ };
631
+ get focused() {
632
+ return this.value && (this.multiple ? this.value.find((a) => a.loading) : this.value.loading);
633
+ }
634
+ get empty() {
635
+ return !this.value;
636
+ }
637
+ onContainerClick(event) {
638
+ // Não necessário
639
+ }
640
+ get shouldLabelFloat() {
641
+ return true;
642
+ }
643
+ get placeholder() {
644
+ return this.$placeholder;
645
+ }
646
+ set placeholder(plh) {
647
+ this.$placeholder = plh;
648
+ this.stateChanges.next();
649
+ }
650
+ get required() {
651
+ return this.$required;
652
+ }
653
+ set required(value) {
654
+ this.$required = coerceBooleanProperty(value);
655
+ this.stateChanges.next();
656
+ }
657
+ get disabled() {
658
+ return this.$disabled;
659
+ }
660
+ set disabled(value) {
661
+ this.$disabled = coerceBooleanProperty(value);
662
+ this.stateChanges.next();
663
+ }
664
+ get errorState() {
665
+ return this.errorStateMatcher.isErrorState(this.ngControl.control, this.parentFormGroup || this.parentForm);
666
+ }
667
+ get controlType() {
668
+ return 'input-fileupload';
669
+ }
670
+ setDescribedByIds(ids) {
671
+ this.describedBy = ids.join(' ');
672
+ }
673
+ ngOnDestroy() {
674
+ this.stateChanges.complete();
675
+ }
676
+ upload(arquivo) {
677
+ return new Observable(observer => {
678
+ if (!this.validaFormato(arquivo.nome)) {
679
+ arquivo.error = { fileFormat: true };
680
+ observer.error('Formato inválido');
681
+ this.onChange(this.value);
682
+ this.change.emit(this.value);
683
+ this.stateChanges.next();
684
+ return;
685
+ }
686
+ if (this.limite) {
687
+ const total = this.parseLimite();
688
+ if ((arquivo.length || 0) > total) {
689
+ arquivo.error = {
690
+ fileSize: {
691
+ limite: this.limite,
692
+ }
693
+ };
694
+ observer.error('Tamanho inválido');
695
+ this.onChange(this.value);
696
+ this.change.emit(this.value);
697
+ this.stateChanges.next();
698
+ return;
699
+ }
700
+ }
701
+ this.arquivoService.upload(arquivo.file, ...(this.agrupadores || []))
702
+ .subscribe({
703
+ next: event => {
704
+ if (event.type === 'conclusao') {
705
+ arquivo.progresso = undefined;
706
+ if (this.multiple) {
707
+ this.value = [
708
+ ...(this.value || []).map((a) => a === arquivo ? event.attachment : a)
709
+ ];
710
+ this.onChange(this.value);
711
+ this.change.emit(this.value);
712
+ this.stateChanges.next();
713
+ }
714
+ else {
715
+ this.value = event.attachment;
716
+ this.onChange(event.attachment);
717
+ this.change.emit(event.attachment);
718
+ this.stateChanges.next();
719
+ }
720
+ observer.next(null);
721
+ observer.complete();
722
+ }
723
+ else if (event.type === 'progresso') {
724
+ arquivo.progresso = event.progresso;
725
+ this.stateChanges.next();
726
+ }
727
+ },
728
+ error: err => {
729
+ arquivo.error = { fileError: true };
730
+ this.onChange(this.value);
731
+ this.change.emit(this.value);
732
+ this.stateChanges.next();
733
+ observer.error(err);
734
+ }
735
+ });
736
+ });
737
+ }
738
+ parseLimite() {
739
+ let total = Number(this.limite.replace(/\D+/g, ''));
740
+ if (this.limite.toUpperCase().indexOf('GB') >= 0) {
741
+ total = total * 1024 * 1024 * 1024;
742
+ }
743
+ if (this.limite.toUpperCase().indexOf('MB') >= 0) {
744
+ total = total * 1024 * 1024;
745
+ }
746
+ if (this.limite.toUpperCase().indexOf('KB') >= 0) {
747
+ total = total * 1024;
748
+ }
749
+ return total;
750
+ }
751
+ validaFormato(filename) {
752
+ if (this.accept) {
753
+ let formats = [];
754
+ if (typeof this.accept === 'string') {
755
+ formats = [this.accept];
756
+ }
757
+ else {
758
+ formats = this.accept;
759
+ }
760
+ for (const format of formats) {
761
+ if (filename.toLowerCase().indexOf(format.toLowerCase()) === filename.length - format.length) {
762
+ return true;
763
+ }
764
+ }
765
+ return false;
766
+ }
767
+ return true;
768
+ }
769
+ uploadNext() {
770
+ if (this.multiple) {
771
+ if (this.value) {
772
+ for (const item of this.value) {
773
+ if (item.loading && !item.error) {
774
+ this.upload(item).subscribe(() => this.uploadNext(), err => this.uploadNext());
775
+ break;
776
+ }
777
+ }
778
+ }
779
+ }
780
+ else if (this.value && this.value.loading && !this.value.error) {
781
+ this.upload(this.value).subscribe(() => this.uploadNext(), err => this.uploadNext());
782
+ }
783
+ }
784
+ onFileChange(event) {
785
+ this.onTouched();
786
+ if (event.target.files && event.target.files.length) {
787
+ if (this.multiple) {
788
+ const arqs = [];
789
+ for (const file of event.target.files) {
790
+ arqs.push({
791
+ file,
792
+ loading: true,
793
+ nome: file.name,
794
+ length: file.size,
795
+ });
796
+ }
797
+ this.value = [
798
+ ...(this.value || []),
799
+ ...arqs
800
+ ];
801
+ this.onChange(this.value);
802
+ this.change.emit(this.value);
803
+ this.stateChanges.next();
804
+ }
805
+ else {
806
+ this.value = {
807
+ file: event.target.files[0],
808
+ length: event.target.files[0].size,
809
+ loading: true,
810
+ nome: event.target.files[0].name
811
+ };
812
+ this.onChange(this.value);
813
+ this.change.emit(this.value);
814
+ this.stateChanges.next();
815
+ }
816
+ this.uploadNext();
817
+ }
818
+ else {
819
+ this.selectCancel.emit();
820
+ }
821
+ event.target.value = '';
822
+ }
823
+ openFileChooser() {
824
+ if (!this.disabled) {
825
+ this.input.nativeElement.click();
826
+ }
827
+ }
828
+ async remover(arquivo) {
829
+ if (this.value) {
830
+ if (this.multiple) {
831
+ if (Array.isArray(this.value)) {
832
+ this.value.splice(this.value.indexOf(arquivo), 1);
833
+ if (this.value.length) {
834
+ this.value = [...this.value];
835
+ this.onChange(this.value);
836
+ this.change.emit(this.value);
837
+ this.stateChanges.next();
838
+ }
839
+ else {
840
+ this.value = undefined;
841
+ this.onChange(undefined);
842
+ this.change.emit(undefined);
843
+ this.stateChanges.next();
844
+ }
845
+ }
846
+ }
847
+ else {
848
+ this.value = undefined;
849
+ this.onChange(undefined);
850
+ this.change.emit(undefined);
851
+ this.stateChanges.next();
852
+ }
853
+ }
854
+ }
855
+ registerOnTouched(fn) {
856
+ this.onTouched = fn;
857
+ }
858
+ registerOnChange(fn) {
859
+ this.onChange = fn;
860
+ }
861
+ setDisabledState(isDisabled) {
862
+ this.disabled = isDisabled;
863
+ }
864
+ writeValue(obj) {
865
+ if (obj) {
866
+ if (this.multiple) {
867
+ this.value = obj.map((a) => typeof a === 'string' ? { url: a } : a);
868
+ this.stateChanges.next();
869
+ }
870
+ else if (typeof obj === 'string') {
871
+ this.value = { url: obj };
872
+ this.stateChanges.next();
873
+ }
874
+ else {
875
+ this.value = obj;
876
+ this.stateChanges.next();
877
+ }
878
+ }
879
+ else {
880
+ this.value = obj;
881
+ this.stateChanges.next();
882
+ }
883
+ }
884
+ 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 });
885
+ 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: [
886
+ {
887
+ provide: MatFormFieldControl,
888
+ useExisting: InputFileUploadComponent
889
+ }
890
+ ], 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"] }] });
891
+ }
892
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputFileUploadComponent, decorators: [{
893
+ type: Component,
894
+ args: [{ selector: 'mcl-input-fileupload', imports: [
895
+ MatChipGrid,
896
+ MatChip,
897
+ NgClass,
898
+ MatProgressSpinner,
899
+ MatIcon,
900
+ PreviewArquivoComponent,
901
+ MatIconButton,
902
+ MatPrefix,
903
+ DownloadArquivoDirective,
904
+ MatInput,
905
+ MatTooltip,
906
+ MatSuffix
907
+ ], providers: [
908
+ {
909
+ provide: MatFormFieldControl,
910
+ useExisting: InputFileUploadComponent
911
+ }
912
+ ], 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"] }]
913
+ }], ctorParameters: () => [{ type: i1$2.ErrorStateMatcher }, { type: i1.NgControl, decorators: [{
914
+ type: Optional
915
+ }, {
916
+ type: Self
917
+ }] }, { type: i1.NgForm, decorators: [{
918
+ type: Optional
919
+ }] }, { type: i0.ChangeDetectorRef }, { type: i1.FormGroupDirective, decorators: [{
920
+ type: Optional
921
+ }] }, { type: undefined, decorators: [{
922
+ type: Inject,
923
+ args: [ARQUIVO_MANAGER_SERVICE]
924
+ }] }], propDecorators: { multiple: [{
925
+ type: Input
926
+ }], limite: [{
927
+ type: Input
928
+ }], accept: [{
929
+ type: Input
930
+ }], template: [{
931
+ type: Input
932
+ }], agrupadores: [{
933
+ type: Input
934
+ }], input: [{
935
+ type: ViewChild,
936
+ args: ['input']
937
+ }], selectCancel: [{
938
+ type: Output
939
+ }], stateChanges: [{
940
+ type: Output,
941
+ args: ['change']
942
+ }], change: [{
943
+ type: Output
944
+ }], id: [{
945
+ type: HostBinding
946
+ }], describedBy: [{
947
+ type: HostBinding,
948
+ args: ['attr.aria-describedby']
949
+ }], shouldLabelFloat: [{
950
+ type: HostBinding,
951
+ args: ['class.floating']
952
+ }], placeholder: [{
953
+ type: Input
954
+ }], required: [{
955
+ type: Input
956
+ }], disabled: [{
957
+ type: Input
958
+ }] } });
959
+
960
+ class InputFileUploadValidatorDirective {
961
+ multiple = false;
962
+ validate(control) {
963
+ if (control.value) {
964
+ if (this.multiple && Array.isArray(control.value)) {
965
+ const error = control.value.find(a => a.loading && a.error);
966
+ if (error) {
967
+ return error.error;
968
+ }
969
+ if (control.value.find(a => a.loading)) {
970
+ return { fileUploading: true };
971
+ }
972
+ }
973
+ else if (control.value.loading && control.value.error) {
974
+ return control.value.error;
975
+ }
976
+ else if (control.value.loading) {
977
+ return { fileUploading: true };
978
+ }
979
+ }
980
+ return null;
981
+ }
982
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputFileUploadValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
983
+ 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 });
984
+ }
985
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputFileUploadValidatorDirective, decorators: [{
986
+ type: Directive,
987
+ args: [{
988
+ selector: 'mcl-input-fileupload,[mclFileupload]',
989
+ providers: [{ provide: NG_VALIDATORS, useExisting: InputFileUploadValidatorDirective, multi: true }]
990
+ }]
991
+ }], propDecorators: { multiple: [{
992
+ type: Input
993
+ }] } });
994
+
995
+ class InputCnpjComponent extends InputMaskComponent {
996
+ constructor() {
997
+ super();
998
+ this.mask = '##.###.###/####-##';
999
+ }
1000
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCnpjComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1001
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: InputCnpjComponent, isStandalone: true, selector: "mcl-input[cnpj]", providers: [
1002
+ {
1003
+ provide: MatFormFieldControl,
1004
+ useExisting: InputCnpjComponent
1005
+ }
1006
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"onTouched()\"/>\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"] }] });
1007
+ }
1008
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCnpjComponent, decorators: [{
1009
+ type: Component,
1010
+ args: [{ selector: 'mcl-input[cnpj]', imports: [
1011
+ MatInput,
1012
+ FormsModule
1013
+ ], providers: [
1014
+ {
1015
+ provide: MatFormFieldControl,
1016
+ useExisting: InputCnpjComponent
1017
+ }
1018
+ ], template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"onTouched()\"/>\n" }]
1019
+ }], ctorParameters: () => [] });
1020
+
1021
+ class InputCepComponent extends InputMaskComponent {
1022
+ constructor() {
1023
+ super();
1024
+ this.mask = '##.###-###';
1025
+ }
1026
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCepComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1027
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: InputCepComponent, isStandalone: true, selector: "mcl-input[cep]", providers: [
1028
+ {
1029
+ provide: MatFormFieldControl,
1030
+ useExisting: InputCepComponent
1031
+ }
1032
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"onTouched()\"/>\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"] }] });
1033
+ }
1034
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCepComponent, decorators: [{
1035
+ type: Component,
1036
+ args: [{ selector: 'mcl-input[cep]', imports: [
1037
+ MatInput,
1038
+ FormsModule
1039
+ ], providers: [
1040
+ {
1041
+ provide: MatFormFieldControl,
1042
+ useExisting: InputCepComponent
1043
+ }
1044
+ ], template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"onTouched()\"/>\n" }]
1045
+ }], ctorParameters: () => [] });
1046
+
1047
+ class InputCpfCnpjComponent extends InputMaskComponent {
1048
+ get value() {
1049
+ return super.value;
1050
+ }
1051
+ set value(value) {
1052
+ const unmasked = this.removeMask(value);
1053
+ if (!!unmasked) {
1054
+ if (unmasked.length > 11) {
1055
+ this.mask = '##.###.###/####-##';
1056
+ }
1057
+ else {
1058
+ this.mask = '###.###.###-##';
1059
+ }
1060
+ super.value = value;
1061
+ }
1062
+ }
1063
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCpfCnpjComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1064
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: InputCpfCnpjComponent, isStandalone: true, selector: "mcl-input[cpfCnpj]", providers: [
1065
+ {
1066
+ provide: MatFormFieldControl,
1067
+ useExisting: InputCpfCnpjComponent
1068
+ }
1069
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"onTouched()\"/>\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"] }] });
1070
+ }
1071
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCpfCnpjComponent, decorators: [{
1072
+ type: Component,
1073
+ args: [{ selector: 'mcl-input[cpfCnpj]', imports: [
1074
+ MatInput,
1075
+ FormsModule
1076
+ ], providers: [
1077
+ {
1078
+ provide: MatFormFieldControl,
1079
+ useExisting: InputCpfCnpjComponent
1080
+ }
1081
+ ], template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"onTouched()\"/>\n" }]
1082
+ }] });
1083
+
1084
+ class InputCpfComponent extends InputMaskComponent {
1085
+ constructor() {
1086
+ super();
1087
+ this.mask = '###.###.###-##';
1088
+ }
1089
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCpfComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1090
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: InputCpfComponent, isStandalone: true, selector: "mcl-input[cpf]", providers: [
1091
+ {
1092
+ provide: MatFormFieldControl,
1093
+ useExisting: InputCpfComponent
1094
+ }
1095
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"onTouched()\"/>\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"] }] });
1096
+ }
1097
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCpfComponent, decorators: [{
1098
+ type: Component,
1099
+ args: [{ selector: 'mcl-input[cpf]', imports: [
1100
+ MatInput,
1101
+ FormsModule
1102
+ ], providers: [
1103
+ {
1104
+ provide: MatFormFieldControl,
1105
+ useExisting: InputCpfComponent
1106
+ }
1107
+ ], template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"onTouched()\"/>\n" }]
1108
+ }], ctorParameters: () => [] });
1109
+
1110
+ class InputPhoneComponent extends InputMaskComponent {
1111
+ applyMask(value) {
1112
+ if (value) {
1113
+ const unmasked = this.removeMask(value);
1114
+ if (unmasked.length > 2 && unmasked[2] === '9') {
1115
+ this.mask = '(##) #####-####';
1116
+ }
1117
+ else {
1118
+ this.mask = '(##) ####-####';
1119
+ }
1120
+ }
1121
+ return super.applyMask(value);
1122
+ }
1123
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputPhoneComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1124
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: InputPhoneComponent, isStandalone: true, selector: "mcl-input[phone]", providers: [
1125
+ {
1126
+ provide: MatFormFieldControl,
1127
+ useExisting: InputPhoneComponent
1128
+ }
1129
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"onTouched()\"/>\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"] }] });
1130
+ }
1131
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputPhoneComponent, decorators: [{
1132
+ type: Component,
1133
+ args: [{ selector: 'mcl-input[phone]', imports: [
1134
+ MatInput,
1135
+ FormsModule
1136
+ ], providers: [
1137
+ {
1138
+ provide: MatFormFieldControl,
1139
+ useExisting: InputPhoneComponent
1140
+ }
1141
+ ], template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"onTouched()\"/>\n" }]
1142
+ }] });
1143
+
1144
+ class OptionNode {
1145
+ pool;
1146
+ value;
1147
+ subject;
1148
+ constructor(pool, value, selected = false) {
1149
+ this.pool = pool;
1150
+ this.value = value;
1151
+ this.subject = new BehaviorSubject(selected);
1152
+ }
1153
+ get model() {
1154
+ return this.pool.model();
1155
+ }
1156
+ get observable() {
1157
+ return this.subject;
1158
+ }
1159
+ setSelected(selected) {
1160
+ this.subject.next(selected);
1161
+ }
1162
+ dispose() {
1163
+ this.subject.complete();
1164
+ }
1165
+ touched() {
1166
+ this.pool.touched();
1167
+ }
1168
+ }
1169
+
1170
+ class NodePool {
1171
+ name;
1172
+ _nodes = new BehaviorSubject([]);
1173
+ _touch = new Subject();
1174
+ _groups = [];
1175
+ constructor(name) {
1176
+ this.name = name;
1177
+ }
1178
+ model() {
1179
+ return this._nodes
1180
+ .pipe(switchMap(ns => combineLatest(ns
1181
+ .map(n => n.observable
1182
+ .pipe(map(selected => ({
1183
+ selected,
1184
+ value: n.value
1185
+ })))))))
1186
+ .pipe(map(ops => {
1187
+ const model = ops.filter(o => o.selected).map(o => o.value);
1188
+ return model.length ? model : undefined;
1189
+ }));
1190
+ }
1191
+ touch() {
1192
+ return this._touch;
1193
+ }
1194
+ all() {
1195
+ return this._nodes
1196
+ .pipe(switchMap(ns => combineLatest(ns
1197
+ .map(n => n.observable))))
1198
+ .pipe(map(ops => {
1199
+ if (ops.length) {
1200
+ const first = ops[0];
1201
+ for (const o of ops) {
1202
+ if (o !== first) {
1203
+ return false;
1204
+ }
1205
+ }
1206
+ return !!first;
1207
+ }
1208
+ return false;
1209
+ }));
1210
+ }
1211
+ get empty() {
1212
+ return !this._nodes.value.length && !this._groups.length;
1213
+ }
1214
+ dispose() {
1215
+ this._nodes.complete();
1216
+ this._touch.complete();
1217
+ }
1218
+ touched() {
1219
+ this._touch.next(undefined);
1220
+ }
1221
+ register(value) {
1222
+ const selected = !!this.lastValues && this.lastValues.indexOf(value) >= 0;
1223
+ const node = new OptionNode(this, value, selected);
1224
+ this._nodes.next([
1225
+ ...this._nodes.value,
1226
+ node
1227
+ ]);
1228
+ return node;
1229
+ }
1230
+ unregister(node) {
1231
+ this._nodes.next(this._nodes.value.filter(n => n !== node));
1232
+ node.dispose();
1233
+ }
1234
+ registerGroup(group) {
1235
+ this._groups.push(group);
1236
+ }
1237
+ unregisterGroup(group) {
1238
+ this._groups.splice(this._groups.indexOf(group), 1);
1239
+ }
1240
+ lastValues = [];
1241
+ writeValue(values) {
1242
+ if (values !== this.lastValues) {
1243
+ this.lastValues = values || [];
1244
+ if (values) {
1245
+ this._nodes.value.forEach(n => {
1246
+ n.setSelected(values.indexOf(n.value) >= 0);
1247
+ });
1248
+ }
1249
+ else {
1250
+ this._nodes.value.forEach(n => {
1251
+ n.setSelected(false);
1252
+ });
1253
+ }
1254
+ }
1255
+ }
1256
+ setAll(selected) {
1257
+ this._nodes.value.forEach(m => m.setSelected(selected));
1258
+ }
1259
+ }
1260
+
1261
+ class OptionCheckboxService {
1262
+ nodes = {};
1263
+ getPool(name) {
1264
+ if (!this.nodes[name]) {
1265
+ this.nodes[name] = new NodePool(name);
1266
+ }
1267
+ return this.nodes[name];
1268
+ }
1269
+ registerGroup(name, group) {
1270
+ const pool = this.getPool(name);
1271
+ pool.registerGroup(group);
1272
+ return pool;
1273
+ }
1274
+ unregisterGroup(name, group) {
1275
+ if (this.nodes[name]) {
1276
+ this.nodes[name].unregisterGroup(group);
1277
+ if (this.nodes[name].empty) {
1278
+ this.nodes[name].dispose();
1279
+ delete this.nodes[name];
1280
+ }
1281
+ }
1282
+ }
1283
+ unregister(name, node) {
1284
+ if (this.nodes[name]) {
1285
+ this.nodes[name].unregister(node);
1286
+ if (this.nodes[name].empty) {
1287
+ this.nodes[name].dispose();
1288
+ delete this.nodes[name];
1289
+ }
1290
+ }
1291
+ }
1292
+ register(name, value) {
1293
+ return this.getPool(name).register(value);
1294
+ }
1295
+ setAll(name, selected) {
1296
+ if (this.nodes[name]) {
1297
+ this.nodes[name].setAll(selected);
1298
+ }
1299
+ }
1300
+ writeValue(name, model) {
1301
+ this.getPool(name)?.writeValue(model);
1302
+ }
1303
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: OptionCheckboxService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1304
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: OptionCheckboxService, providedIn: 'root' });
1305
+ }
1306
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: OptionCheckboxService, decorators: [{
1307
+ type: Injectable,
1308
+ args: [{
1309
+ providedIn: 'root'
1310
+ }]
1311
+ }] });
1312
+
1313
+ class AllOptionCheckboxComponent {
1314
+ fotonOptionCheckboxService;
1315
+ _name;
1316
+ disabled = false;
1317
+ change = new EventEmitter();
1318
+ selected;
1319
+ pool;
1320
+ constructor(fotonOptionCheckboxService) {
1321
+ this.fotonOptionCheckboxService = fotonOptionCheckboxService;
1322
+ }
1323
+ get name() {
1324
+ return this._name;
1325
+ }
1326
+ set name(name) {
1327
+ this._name = name;
1328
+ this.pool = this.fotonOptionCheckboxService.getPool(name);
1329
+ this.selected = this.pool.all();
1330
+ }
1331
+ setSelected(selected) {
1332
+ this.pool?.touched();
1333
+ this.fotonOptionCheckboxService.setAll(this.name, selected);
1334
+ this.change.emit();
1335
+ }
1336
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AllOptionCheckboxComponent, deps: [{ token: OptionCheckboxService }], target: i0.ɵɵFactoryTarget.Component });
1337
+ 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" }] });
1338
+ }
1339
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AllOptionCheckboxComponent, decorators: [{
1340
+ type: Component,
1341
+ args: [{ selector: 'mcl-option-checkbox[select-all-option]', imports: [
1342
+ MatCheckbox,
1343
+ FormsModule,
1344
+ AsyncPipe
1345
+ ], 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" }]
1346
+ }], ctorParameters: () => [{ type: OptionCheckboxService }], propDecorators: { disabled: [{
1347
+ type: Input
1348
+ }], change: [{
1349
+ type: Output
1350
+ }], name: [{
1351
+ type: Input
1352
+ }] } });
1353
+
1354
+ class OptionCheckboxComponent {
1355
+ fotonOptionCheckboxService;
1356
+ _name;
1357
+ _value;
1358
+ node;
1359
+ selected;
1360
+ disabled = false;
1361
+ change = new EventEmitter();
1362
+ constructor(fotonOptionCheckboxService) {
1363
+ this.fotonOptionCheckboxService = fotonOptionCheckboxService;
1364
+ }
1365
+ setSelected(selected) {
1366
+ if (this.node) {
1367
+ this.node.touched();
1368
+ this.node.setSelected(selected);
1369
+ this.change.emit();
1370
+ }
1371
+ }
1372
+ get value() {
1373
+ return this.node ? this.node.value : undefined;
1374
+ }
1375
+ set value(v) {
1376
+ if (v != this.value) {
1377
+ if (this.node) {
1378
+ this.node.value = v;
1379
+ }
1380
+ else {
1381
+ this._value = v;
1382
+ }
1383
+ }
1384
+ }
1385
+ get name() {
1386
+ return this._name;
1387
+ }
1388
+ set name(n) {
1389
+ if (n !== this.name && !this.node) {
1390
+ this.node = this.fotonOptionCheckboxService.register(n, this._value);
1391
+ this.selected = this.node.observable;
1392
+ this._name = n;
1393
+ }
1394
+ }
1395
+ onBlur() {
1396
+ }
1397
+ ngOnDestroy() {
1398
+ this.fotonOptionCheckboxService.unregister(this.name, this.node);
1399
+ }
1400
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: OptionCheckboxComponent, deps: [{ token: OptionCheckboxService }], target: i0.ɵɵFactoryTarget.Component });
1401
+ 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" }] });
1402
+ }
1403
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: OptionCheckboxComponent, decorators: [{
1404
+ type: Component,
1405
+ args: [{ selector: 'mcl-option-checkbox:not([select-all-option])', imports: [
1406
+ MatCheckbox,
1407
+ FormsModule,
1408
+ AsyncPipe
1409
+ ], 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" }]
1410
+ }], ctorParameters: () => [{ type: OptionCheckboxService }], propDecorators: { disabled: [{
1411
+ type: Input
1412
+ }], change: [{
1413
+ type: Output
1414
+ }], value: [{
1415
+ type: Input
1416
+ }], name: [{
1417
+ type: Input
1418
+ }] } });
1419
+
1420
+ class OptionCheckboxGroupComponent {
1421
+ optionCheckboxService;
1422
+ callbackTimeout;
1423
+ _name;
1424
+ pool;
1425
+ disabled = false;
1426
+ change = new EventEmitter();
1427
+ touched = new EventEmitter();
1428
+ constructor(optionCheckboxService) {
1429
+ this.optionCheckboxService = optionCheckboxService;
1430
+ }
1431
+ onTouchedCallback = () => {
1432
+ };
1433
+ onChangeCallback = () => {
1434
+ };
1435
+ get name() {
1436
+ return this._name;
1437
+ }
1438
+ set name(n) {
1439
+ if (n !== this.name && !this.pool) {
1440
+ this.pool = this.optionCheckboxService.registerGroup(n, this);
1441
+ this.pool.touch().subscribe(() => {
1442
+ this.onTouchedCallback();
1443
+ this.touched.emit();
1444
+ });
1445
+ this.pool.model().subscribe(model => {
1446
+ clearTimeout(this.callbackTimeout);
1447
+ this.callbackTimeout = setTimeout(() => {
1448
+ this.onChangeCallback(model);
1449
+ this.change.emit(model);
1450
+ });
1451
+ });
1452
+ this._name = n;
1453
+ }
1454
+ }
1455
+ onBlur() {
1456
+ }
1457
+ ngOnDestroy() {
1458
+ this.optionCheckboxService.unregisterGroup(this.name, this);
1459
+ }
1460
+ writeValue(value) {
1461
+ this.optionCheckboxService.writeValue(this.name, value);
1462
+ }
1463
+ registerOnChange(fn) {
1464
+ this.onChangeCallback = fn;
1465
+ }
1466
+ registerOnTouched(fn) {
1467
+ this.onTouchedCallback = fn;
1468
+ }
1469
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: OptionCheckboxGroupComponent, deps: [{ token: OptionCheckboxService }], target: i0.ɵɵFactoryTarget.Component });
1470
+ 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: [
1471
+ {
1472
+ provide: NG_VALUE_ACCESSOR,
1473
+ useExisting: OptionCheckboxGroupComponent,
1474
+ multi: true
1475
+ }
1476
+ ], ngImport: i0, template: '', isInline: true });
1477
+ }
1478
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: OptionCheckboxGroupComponent, decorators: [{
1479
+ type: Component,
1480
+ args: [{
1481
+ selector: 'mcl-option-checkbox-group',
1482
+ template: '',
1483
+ providers: [
1484
+ {
1485
+ provide: NG_VALUE_ACCESSOR,
1486
+ useExisting: OptionCheckboxGroupComponent,
1487
+ multi: true
1488
+ }
1489
+ ]
1490
+ }]
1491
+ }], ctorParameters: () => [{ type: OptionCheckboxService }], propDecorators: { disabled: [{
1492
+ type: Input
1493
+ }], change: [{
1494
+ type: Output
1495
+ }], touched: [{
1496
+ type: Output
1497
+ }], name: [{
1498
+ type: Input
1499
+ }] } });
1500
+
1501
+ class SelectChipsComponent extends AbstractMatFormFieldSelectControl {
1502
+ add(event) {
1503
+ this.onTouched();
1504
+ const value = event.value;
1505
+ if (!!value) {
1506
+ this.value = [
1507
+ ...(this.value || []),
1508
+ value
1509
+ ];
1510
+ this.onChange(this.value);
1511
+ }
1512
+ }
1513
+ remove(item) {
1514
+ this.onTouched();
1515
+ if (this.value) {
1516
+ const index = this.value.indexOf(item);
1517
+ if (index >= 0) {
1518
+ this.value.splice(index, 1);
1519
+ }
1520
+ if (!this.value.length) {
1521
+ this.value = undefined;
1522
+ }
1523
+ this.onChange(this.value);
1524
+ }
1525
+ }
1526
+ selected(event) {
1527
+ this.onTouched();
1528
+ if (!this.value || !this.value.find((v) => v === event.option.value)) {
1529
+ this.value = [
1530
+ ...(this.value || []),
1531
+ event.option.value
1532
+ ];
1533
+ this.onChange(this.value);
1534
+ }
1535
+ this.control.setValue('');
1536
+ }
1537
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectChipsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1538
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: SelectChipsComponent, isStandalone: true, selector: "mcl-select-chips", providers: [
1539
+ {
1540
+ provide: MatFormFieldControl,
1541
+ useExisting: SelectChipsComponent
1542
+ }
1543
+ ], 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"] }] });
1544
+ }
1545
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectChipsComponent, decorators: [{
1546
+ type: Component,
1547
+ args: [{ selector: 'mcl-select-chips', imports: [
1548
+ MatChip,
1549
+ MatIcon,
1550
+ ReactiveFormsModule,
1551
+ MatAutocompleteTrigger,
1552
+ MatChipInput,
1553
+ MatChipGrid,
1554
+ AsyncPipe,
1555
+ MatAutocomplete,
1556
+ MatOption,
1557
+ ], providers: [
1558
+ {
1559
+ provide: MatFormFieldControl,
1560
+ useExisting: SelectChipsComponent
1561
+ }
1562
+ ], 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" }]
1563
+ }] });
1564
+
1565
+ class SelectAutocompleteComponent extends AbstractMatFormFieldSelectControl {
1566
+ readonly;
1567
+ select = new EventEmitter();
1568
+ blur = new EventEmitter();
1569
+ get shouldLabelFloat() {
1570
+ return this.focused || !this.empty;
1571
+ }
1572
+ get empty() {
1573
+ return !this.value;
1574
+ }
1575
+ onFocus() {
1576
+ this.focused = true;
1577
+ this.stateChanges.next();
1578
+ }
1579
+ onBlur() {
1580
+ this.focused = false;
1581
+ this.stateChanges.next();
1582
+ this.blur.emit();
1583
+ }
1584
+ didTouch() {
1585
+ this.onTouched();
1586
+ }
1587
+ ngOnDestroy() {
1588
+ super.ngOnDestroy();
1589
+ this.optionsSubscription?.unsubscribe();
1590
+ }
1591
+ setDisabledState(isDisabled) {
1592
+ this.disabled = isDisabled;
1593
+ if (isDisabled) {
1594
+ this.control.disable();
1595
+ }
1596
+ else {
1597
+ this.control.enable();
1598
+ }
1599
+ }
1600
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectAutocompleteComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1601
+ 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: [
1602
+ {
1603
+ provide: MatFormFieldControl,
1604
+ useExisting: SelectAutocompleteComponent
1605
+ }
1606
+ ], 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" }] });
1607
+ }
1608
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectAutocompleteComponent, decorators: [{
1609
+ type: Component,
1610
+ args: [{ selector: 'mcl-select-autocomplete', imports: [
1611
+ MatInput,
1612
+ MatAutocompleteTrigger,
1613
+ ReactiveFormsModule,
1614
+ MatAutocomplete,
1615
+ MatOption,
1616
+ AsyncPipe
1617
+ ], providers: [
1618
+ {
1619
+ provide: MatFormFieldControl,
1620
+ useExisting: SelectAutocompleteComponent
1621
+ }
1622
+ ], 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"] }]
1623
+ }], propDecorators: { readonly: [{
1624
+ type: Input
1625
+ }], select: [{
1626
+ type: Output
1627
+ }], blur: [{
1628
+ type: Output
1629
+ }] } });
1630
+
1631
+ class DelegateOptionProviderDirective {
1632
+ delegate;
1633
+ type() {
1634
+ return this.delegate?.type() || 'string';
1635
+ }
1636
+ provide(search) {
1637
+ return this.delegate.provide(search);
1638
+ }
1639
+ label(value) {
1640
+ return this.delegate.label(value);
1641
+ }
1642
+ trackBy(value) {
1643
+ if (!!this.delegate?.trackBy) {
1644
+ return this.delegate.trackBy(value);
1645
+ }
1646
+ return value;
1647
+ }
1648
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: DelegateOptionProviderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1649
+ 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: [{
1650
+ provide: SELECT_OPTION_PROVIDER,
1651
+ useExisting: DelegateOptionProviderDirective,
1652
+ }], ngImport: i0 });
1653
+ }
1654
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: DelegateOptionProviderDirective, decorators: [{
1655
+ type: Directive,
1656
+ args: [{
1657
+ selector: 'mcl-select-autocomplete[delegate]',
1658
+ providers: [{
1659
+ provide: SELECT_OPTION_PROVIDER,
1660
+ useExisting: DelegateOptionProviderDirective,
1661
+ }]
1662
+ }]
1663
+ }], propDecorators: { delegate: [{
1664
+ type: Input
1665
+ }] } });
1666
+
1667
+ class SelectManyCheckboxComponent extends AbstractMatFormFieldSelectControl {
1668
+ layout = 'grid';
1669
+ layoutColumns = 3;
1670
+ get shouldLabelFloat() {
1671
+ return true;
1672
+ }
1673
+ selected(value) {
1674
+ return !!this.value?.find((v) => v === value);
1675
+ }
1676
+ change(value, checked) {
1677
+ if (checked) {
1678
+ if (!this.selected(value)) {
1679
+ this.value = [
1680
+ ...(this.value || []),
1681
+ value
1682
+ ];
1683
+ }
1684
+ }
1685
+ else if (this.selected(value)) {
1686
+ this.value = [
1687
+ ...(this.value || []).filter((v) => v !== value),
1688
+ ];
1689
+ }
1690
+ }
1691
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectManyCheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1692
+ 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: [
1693
+ {
1694
+ provide: MatFormFieldControl,
1695
+ useExisting: SelectManyCheckboxComponent
1696
+ }
1697
+ ], 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" }] });
1698
+ }
1699
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectManyCheckboxComponent, decorators: [{
1700
+ type: Component,
1701
+ args: [{ selector: 'mcl-select-many-checkbox', imports: [
1702
+ NgClass,
1703
+ NgStyle,
1704
+ MatCheckbox,
1705
+ AsyncPipe
1706
+ ], providers: [
1707
+ {
1708
+ provide: MatFormFieldControl,
1709
+ useExisting: SelectManyCheckboxComponent
1710
+ }
1711
+ ], 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"] }]
1712
+ }], propDecorators: { layout: [{
1713
+ type: Input
1714
+ }], layoutColumns: [{
1715
+ type: Input
1716
+ }] } });
1717
+
1718
+ class SelectRadioComponent extends AbstractMatFormFieldSelectControl {
1719
+ layout = 'vertical';
1720
+ get shouldLabelFloat() {
1721
+ return true;
1722
+ }
1723
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectRadioComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1724
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: SelectRadioComponent, isStandalone: true, selector: "mcl-select-radio", inputs: { layout: "layout" }, providers: [
1725
+ {
1726
+ provide: MatFormFieldControl,
1727
+ useExisting: SelectRadioComponent
1728
+ }
1729
+ ], 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" }] });
1730
+ }
1731
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectRadioComponent, decorators: [{
1732
+ type: Component,
1733
+ args: [{ selector: 'mcl-select-radio', imports: [
1734
+ MatRadioGroup,
1735
+ NgClass,
1736
+ FormsModule,
1737
+ MatRadioButton,
1738
+ AsyncPipe
1739
+ ], providers: [
1740
+ {
1741
+ provide: MatFormFieldControl,
1742
+ useExisting: SelectRadioComponent
1743
+ }
1744
+ ], 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"] }]
1745
+ }], propDecorators: { layout: [{
1746
+ type: Input
1747
+ }] } });
1748
+
1749
+ class InputTelefoneInternacionalComponent extends AbstractMatFormFieldControl {
1750
+ preferredContries = ['br'];
1751
+ readonly;
1752
+ blur = new EventEmitter();
1753
+ alwaysShowCountry = false;
1754
+ telInput;
1755
+ $innerValue;
1756
+ get value() {
1757
+ return this.$innerValue;
1758
+ }
1759
+ set value(value) {
1760
+ this.$innerValue = value;
1761
+ this.stateChanges.next();
1762
+ this.onChange(value?.replace(/[^\d+]/g, ''));
1763
+ }
1764
+ get shouldLabelFloat() {
1765
+ return this.focused || !this.empty || this.alwaysShowCountry;
1766
+ }
1767
+ get empty() {
1768
+ return !this.value;
1769
+ }
1770
+ onFocus() {
1771
+ this.focused = true;
1772
+ this.stateChanges.next();
1773
+ }
1774
+ onBlur() {
1775
+ this.focused = false;
1776
+ this.stateChanges.next();
1777
+ this.blur.emit();
1778
+ }
1779
+ writeValue(value) {
1780
+ this.value = value;
1781
+ }
1782
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputTelefoneInternacionalComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1783
+ 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: [
1784
+ {
1785
+ provide: MatFormFieldControl,
1786
+ useExisting: InputTelefoneInternacionalComponent
1787
+ },
1788
+ ], 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"] }] });
1789
+ }
1790
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputTelefoneInternacionalComponent, decorators: [{
1791
+ type: Component,
1792
+ args: [{ selector: 'mcl-input-telefone-intl', imports: [
1793
+ LacMatTelInputModule,
1794
+ NgClass,
1795
+ FormsModule
1796
+ ], providers: [
1797
+ {
1798
+ provide: MatFormFieldControl,
1799
+ useExisting: InputTelefoneInternacionalComponent
1800
+ },
1801
+ ], 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"] }]
1802
+ }], propDecorators: { preferredContries: [{
1803
+ type: Input
1804
+ }], readonly: [{
1805
+ type: Input
1806
+ }], blur: [{
1807
+ type: Output
1808
+ }], alwaysShowCountry: [{
1809
+ type: Input
1810
+ }], telInput: [{
1811
+ type: ViewChild,
1812
+ args: ['input']
1813
+ }] } });
1814
+
1815
+ class InputTelefoneInternacionalValidatorDirective {
1816
+ constructor() {
1817
+ }
1818
+ validate(control) {
1819
+ return phoneNumberValidator(control);
1820
+ }
1821
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputTelefoneInternacionalValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1822
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: InputTelefoneInternacionalValidatorDirective, isStandalone: true, selector: "mcl-input-telefone-intl,[mclInputTelefoneIntl]", providers: [{
1823
+ provide: NG_VALIDATORS,
1824
+ useExisting: InputTelefoneInternacionalValidatorDirective,
1825
+ multi: true,
1826
+ }], ngImport: i0 });
1827
+ }
1828
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputTelefoneInternacionalValidatorDirective, decorators: [{
1829
+ type: Directive,
1830
+ args: [{
1831
+ selector: 'mcl-input-telefone-intl,[mclInputTelefoneIntl]',
1832
+ providers: [{
1833
+ provide: NG_VALIDATORS,
1834
+ useExisting: InputTelefoneInternacionalValidatorDirective,
1835
+ multi: true,
1836
+ }]
1837
+ }]
1838
+ }], ctorParameters: () => [] });
1839
+
1840
+ /**
1841
+ * Generated bundle index. Do not edit.
1842
+ */
1843
+
1844
+ 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 };
1845
+ //# sourceMappingURL=main-class-componentes-input.mjs.map