angular-matecu 4.1.0 → 4.1.1

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 (87) hide show
  1. package/fesm2022/angular-matecu.mjs +1736 -0
  2. package/fesm2022/angular-matecu.mjs.map +1 -0
  3. package/package.json +16 -3
  4. package/types/angular-matecu.d.ts +489 -0
  5. package/ng-package.json +0 -7
  6. package/src/css/main.css +0 -1
  7. package/src/lib/components/matecu-alert-box/matecu-alert-box.component.html +0 -11
  8. package/src/lib/components/matecu-alert-box/matecu-alert-box.component.scss +0 -39
  9. package/src/lib/components/matecu-alert-box/matecu-alert-box.component.spec.ts +0 -25
  10. package/src/lib/components/matecu-alert-box/matecu-alert-box.component.ts +0 -60
  11. package/src/lib/components/matecu-alert-dialog/matecu-alert-dialog.component.html +0 -24
  12. package/src/lib/components/matecu-alert-dialog/matecu-alert-dialog.component.scss +0 -5
  13. package/src/lib/components/matecu-alert-dialog/matecu-alert-dialog.component.spec.ts +0 -25
  14. package/src/lib/components/matecu-alert-dialog/matecu-alert-dialog.component.ts +0 -53
  15. package/src/lib/components/matecu-alert-snack-bar/matecu-alert-snack-bar.component.html +0 -10
  16. package/src/lib/components/matecu-alert-snack-bar/matecu-alert-snack-bar.component.scss +0 -34
  17. package/src/lib/components/matecu-alert-snack-bar/matecu-alert-snack-bar.component.spec.ts +0 -25
  18. package/src/lib/components/matecu-alert-snack-bar/matecu-alert-snack-bar.component.ts +0 -45
  19. package/src/lib/components/matecu-autocomplete/matecu-autocomplete.html +0 -36
  20. package/src/lib/components/matecu-autocomplete/matecu-autocomplete.scss +0 -56
  21. package/src/lib/components/matecu-autocomplete/matecu-autocomplete.spec.ts +0 -23
  22. package/src/lib/components/matecu-autocomplete/matecu-autocomplete.ts +0 -336
  23. package/src/lib/components/matecu-autocomplete-multiple/matecu-autocomplete-multiple.html +0 -64
  24. package/src/lib/components/matecu-autocomplete-multiple/matecu-autocomplete-multiple.scss +0 -23
  25. package/src/lib/components/matecu-autocomplete-multiple/matecu-autocomplete-multiple.spec.ts +0 -23
  26. package/src/lib/components/matecu-autocomplete-multiple/matecu-autocomplete-multiple.ts +0 -314
  27. package/src/lib/components/matecu-file-input/matecu-file-input-customization.md +0 -284
  28. package/src/lib/components/matecu-file-input/matecu-file-input.example.md +0 -228
  29. package/src/lib/components/matecu-file-input/matecu-file-input.html +0 -128
  30. package/src/lib/components/matecu-file-input/matecu-file-input.scss +0 -461
  31. package/src/lib/components/matecu-file-input/matecu-file-input.spec.ts +0 -340
  32. package/src/lib/components/matecu-file-input/matecu-file-input.ts +0 -438
  33. package/src/lib/components/matecu-spinner/matecu-spinner.component.css +0 -15
  34. package/src/lib/components/matecu-spinner/matecu-spinner.component.html +0 -44
  35. package/src/lib/components/matecu-spinner/matecu-spinner.component.spec.ts +0 -25
  36. package/src/lib/components/matecu-spinner/matecu-spinner.component.ts +0 -54
  37. package/src/lib/components/matecu-spinner/spinner-loader.component.scss +0 -13
  38. package/src/lib/components/matecu-topbar-action/matecu-topbar-action.component.html +0 -1
  39. package/src/lib/components/matecu-topbar-action/matecu-topbar-action.component.scss +0 -19
  40. package/src/lib/components/matecu-topbar-action/matecu-topbar-action.component.spec.ts +0 -25
  41. package/src/lib/components/matecu-topbar-action/matecu-topbar-action.component.ts +0 -14
  42. package/src/lib/components/matecu-topbar-body/matecu-topbar-body.component.html +0 -1
  43. package/src/lib/components/matecu-topbar-body/matecu-topbar-body.component.scss +0 -14
  44. package/src/lib/components/matecu-topbar-body/matecu-topbar-body.component.spec.ts +0 -25
  45. package/src/lib/components/matecu-topbar-body/matecu-topbar-body.component.ts +0 -11
  46. package/src/lib/components/matecu-topbar-fab/matecu-topbar-fab.component.html +0 -3
  47. package/src/lib/components/matecu-topbar-fab/matecu-topbar-fab.component.scss +0 -19
  48. package/src/lib/components/matecu-topbar-fab/matecu-topbar-fab.component.spec.ts +0 -25
  49. package/src/lib/components/matecu-topbar-fab/matecu-topbar-fab.component.ts +0 -31
  50. package/src/lib/components/matecu-topbar-header-column/matecu-topbar-header-column.component.html +0 -1
  51. package/src/lib/components/matecu-topbar-header-column/matecu-topbar-header-column.component.scss +0 -8
  52. package/src/lib/components/matecu-topbar-header-column/matecu-topbar-header-column.component.spec.ts +0 -23
  53. package/src/lib/components/matecu-topbar-header-column/matecu-topbar-header-column.component.ts +0 -11
  54. package/src/lib/components/matecu-topbar-header-row/matecu-topbar-header-row.component.html +0 -9
  55. package/src/lib/components/matecu-topbar-header-row/matecu-topbar-header-row.component.scss +0 -34
  56. package/src/lib/components/matecu-topbar-header-row/matecu-topbar-header-row.component.spec.ts +0 -23
  57. package/src/lib/components/matecu-topbar-header-row/matecu-topbar-header-row.component.ts +0 -18
  58. package/src/lib/components/matecu-topbar-layout/matecu-topbar-layout.component.html +0 -7
  59. package/src/lib/components/matecu-topbar-layout/matecu-topbar-layout.component.scss +0 -49
  60. package/src/lib/components/matecu-topbar-layout/matecu-topbar-layout.component.spec.ts +0 -25
  61. package/src/lib/components/matecu-topbar-layout/matecu-topbar-layout.component.ts +0 -112
  62. package/src/lib/components/matecu-topbar-search/matecu-topbar-search.component.html +0 -20
  63. package/src/lib/components/matecu-topbar-search/matecu-topbar-search.component.scss +0 -90
  64. package/src/lib/components/matecu-topbar-search/matecu-topbar-search.component.spec.ts +0 -25
  65. package/src/lib/components/matecu-topbar-search/matecu-topbar-search.component.ts +0 -92
  66. package/src/lib/components/matecu-topbar-title/matecu-topbar-title.component.html +0 -1
  67. package/src/lib/components/matecu-topbar-title/matecu-topbar-title.component.scss +0 -91
  68. package/src/lib/components/matecu-topbar-title/matecu-topbar-title.component.spec.ts +0 -25
  69. package/src/lib/components/matecu-topbar-title/matecu-topbar-title.component.ts +0 -14
  70. package/src/lib/modules/matecu-alert-box/matecu-alert-box.module.ts +0 -16
  71. package/src/lib/modules/matecu-spinner/matecu-spinner.module.ts +0 -14
  72. package/src/lib/modules/matecu-topbar-layout/matecu-topbar-layout.module.ts +0 -45
  73. package/src/lib/services/matecu-snack-bar.service.spec.ts +0 -16
  74. package/src/lib/services/matecu-snack-bar.service.ts +0 -66
  75. package/src/lib/services/matecu-spinner.service.spec.ts +0 -16
  76. package/src/lib/services/matecu-spinner.service.ts +0 -39
  77. package/src/lib/types/matecu-alert-dialog.ts +0 -10
  78. package/src/lib/types/matecu-alert-snackbar.ts +0 -8
  79. package/src/lib/types/matecu-altert-box-type.ts +0 -6
  80. package/src/lib/types/matecu-autocomplete.ts +0 -5
  81. package/src/public-api.ts +0 -42
  82. package/src/scss/main.scss +0 -2
  83. package/src/scss/matecu-spinner-module/_matecu-spinner-component.scss +0 -8
  84. package/src/scss/matecu-topbar-layout/_variables.scss +0 -2
  85. package/tsconfig.lib.json +0 -17
  86. package/tsconfig.lib.prod.json +0 -11
  87. package/tsconfig.spec.json +0 -15
@@ -0,0 +1,1736 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Input, HostBinding, Component, NgModule, EventEmitter, ViewChild, Output, Inject, signal, computed, effect, forwardRef } from '@angular/core';
3
+ import * as i1 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import { BehaviorSubject, Subject, fromEvent, startWith, combineLatest, map as map$1, tap as tap$1, debounceTime as debounceTime$1 } from 'rxjs';
6
+ import { tap, takeUntil, map, debounceTime, distinctUntilChanged } from 'rxjs/operators';
7
+ import * as i2$1 from '@angular/material/button';
8
+ import { MatButtonModule } from '@angular/material/button';
9
+ import * as i3 from '@angular/material/icon';
10
+ import { MatIconModule } from '@angular/material/icon';
11
+ import { MatToolbarModule } from '@angular/material/toolbar';
12
+ import * as i2 from '@angular/forms';
13
+ import { FormControl, FormsModule, ReactiveFormsModule, NgControl, NG_VALUE_ACCESSOR } from '@angular/forms';
14
+ import * as i1$1 from '@angular/material/dialog';
15
+ import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
16
+ import * as i1$2 from '@angular/material/snack-bar';
17
+ import { MAT_SNACK_BAR_DATA, MatSnackBarModule } from '@angular/material/snack-bar';
18
+ import * as i2$2 from '@angular/material/autocomplete';
19
+ import { MatAutocompleteModule, MatAutocompleteTrigger } from '@angular/material/autocomplete';
20
+ import * as i3$1 from '@angular/material/divider';
21
+ import { MatDividerModule } from '@angular/material/divider';
22
+ import * as i5 from '@angular/material/progress-spinner';
23
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
24
+ import { MatFormFieldControl } from '@angular/material/form-field';
25
+ import { coerceBooleanProperty } from '@angular/cdk/coercion';
26
+ import * as i1$3 from '@angular/cdk/a11y';
27
+ import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
28
+ import * as i2$3 from '@angular/material/chips';
29
+ import { MatChipsModule } from '@angular/material/chips';
30
+ import { ScrollingModule } from '@angular/cdk/scrolling';
31
+ import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
32
+ import * as i7 from '@angular/material/tooltip';
33
+ import { MatTooltipModule } from '@angular/material/tooltip';
34
+
35
+ class MatecuSpinnerService {
36
+ active$ = new BehaviorSubject(false);
37
+ requestsKeys = [];
38
+ constructor() { }
39
+ watch() {
40
+ return this.active$.pipe();
41
+ }
42
+ add(customKey) {
43
+ const key = typeof customKey === 'string' && customKey.length > 0 ? customKey : this.createKey();
44
+ this.requestsKeys.push(key);
45
+ this.updateStatus();
46
+ return key;
47
+ }
48
+ remove(key) {
49
+ this.requestsKeys = this.requestsKeys.filter((requestKey) => requestKey !== key);
50
+ this.updateStatus();
51
+ }
52
+ clear() {
53
+ this.requestsKeys = [];
54
+ this.updateStatus();
55
+ }
56
+ updateStatus() {
57
+ const active = this.requestsKeys.length > 0;
58
+ this.active$.next(active);
59
+ }
60
+ createKey() {
61
+ const time = new Date().getTime();
62
+ const complement = Math.random();
63
+ return `${time}__${complement}`;
64
+ }
65
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuSpinnerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
66
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuSpinnerService, providedIn: 'root' });
67
+ }
68
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuSpinnerService, decorators: [{
69
+ type: Injectable,
70
+ args: [{
71
+ providedIn: 'root',
72
+ }]
73
+ }], ctorParameters: () => [] });
74
+
75
+ class MatecuSpinnerComponent {
76
+ spinnerService;
77
+ cdr;
78
+ destroy$ = new Subject();
79
+ hiddenClass = 'matecu-spinner--hidden';
80
+ activeCache = false;
81
+ className = 'matecu-spinner';
82
+ color = '#2196F3';
83
+ global = false;
84
+ get active() {
85
+ return this.activeCache;
86
+ }
87
+ set active(value) {
88
+ if (this.global) {
89
+ return;
90
+ }
91
+ this.activeCache = value;
92
+ this.className = value
93
+ ? this.className.replace(` ${this.hiddenClass}`, '')
94
+ : (this.className += ` ${this.hiddenClass}`);
95
+ }
96
+ size = '70px';
97
+ constructor(spinnerService, cdr) {
98
+ this.spinnerService = spinnerService;
99
+ this.cdr = cdr;
100
+ }
101
+ ngOnDestroy() {
102
+ this.destroy$.next();
103
+ this.destroy$.complete();
104
+ }
105
+ ngOnInit() {
106
+ if (this.global) {
107
+ this.spinnerService
108
+ .watch()
109
+ .pipe(tap((value) => (this.activeCache = value)), tap(() => this.cdr.detectChanges()), takeUntil(this.destroy$))
110
+ .subscribe();
111
+ }
112
+ }
113
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuSpinnerComponent, deps: [{ token: MatecuSpinnerService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
114
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: MatecuSpinnerComponent, isStandalone: true, selector: "matecu-spinner", inputs: { color: "color", global: "global", active: "active", size: "size" }, host: { properties: { "class": "this.className" } }, ngImport: i0, template: "@if(active){\n\n<svg xmlns:svg=\"http://www.w3.org/2000/svg\" [attr.width]=\"size\" [attr.height]=\"size\" xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.0\" viewBox=\"0 0 128 128\" xml:space=\"preserve\">\n <rect x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" fill=\"transparent\" />\n <g>\n <path class=\"matecu-spinner__100\" d=\"M122.5 69.25H96.47a33.1 33.1 0 0 0 0-10.5h26.05a5.25 5.25 0 0 1 0 10.5z\"\n [attr.fill]=\"color\" fill-opacity=\"1\" />\n <path class=\"matecu-spinner__30\"\n d=\"M112.04 97.83L89.47 84.8a33.1 33.1 0 0 0 5.25-9.1l22.57 13.03a5.25 5.25 0 0 1-5.28 9.1z\"\n [attr.fill]=\"color\" fill-opacity=\"0.3\" />\n <path class=\"matecu-spinner__30\"\n d=\"M88.68 117.35L75.65 94.78a33.1 33.1 0 0 0 9.1-5.25l13.02 22.57a5.25 5.25 0 1 1-9.1 5.25z\"\n [attr.fill]=\"color\" fill-opacity=\"0.3\" />\n <path class=\"matecu-spinner__30\" d=\"M58.7 122.57V96.5a33.1 33.1 0 0 0 10.5 0v26.07a5.25 5.25 0 0 1-10.5 0z\"\n [attr.fill]=\"color\" fill-opacity=\"0.3\" />\n <path class=\"matecu-spinner__30\"\n d=\"M30.1 112.1l13.04-22.57a33.1 33.1 0 0 0 9.1 5.25L39.2 117.35a5.25 5.25 0 1 1-9.1-5.25z\"\n [attr.fill]=\"color\" fill-opacity=\"0.3\" />\n <path class=\"matecu-spinner__30\"\n d=\"M10.6 88.74L33.16 75.7a33.1 33.1 0 0 0 5.25 9.1L15.88 97.83a5.25 5.25 0 1 1-5.25-9.1z\"\n [attr.fill]=\"color\" fill-opacity=\"0.3\" />\n <path class=\"matecu-spinner__40\" d=\"M5.37 58.75h26.06a33.1 33.1 0 0 0 0 10.5H5.37a5.25 5.25 0 0 1 0-10.5z\"\n [attr.fill]=\"color\" fill-opacity=\"0.4\" />\n <path class=\"matecu-spinner__50\"\n d=\"M15.85 30.17L38.4 43.2a33.1 33.1 0 0 0-5.24 9.1L10.6 39.25a5.25 5.25 0 1 1 5.25-9.1z\" [attr.fill]=\"color\"\n fill-opacity=\"0.5\" />\n <path class=\"matecu-spinner__60\"\n d=\"M39.2 10.65l13.03 22.57a33.1 33.1 0 0 0-9.1 5.25l-13-22.57a5.25 5.25 0 1 1 9.1-5.25z\" [attr.fill]=\"color\"\n fill-opacity=\"0.6\" />\n <path class=\"matecu-spinner__70\" d=\"M69.2 5.43V31.5a33.1 33.1 0 0 0-10.5 0V5.42a5.25 5.25 0 1 1 10.5 0z\"\n [attr.fill]=\"color\" fill-opacity=\"0.7\" />\n <path class=\"matecu-spinner__80\"\n d=\"M97.77 15.9L84.75 38.47a33.1 33.1 0 0 0-9.1-5.25l13.03-22.57a5.25 5.25 0 1 1 9.1 5.25z\"\n [attr.fill]=\"color\" fill-opacity=\"0.8\" />\n <path class=\"matecu-spinner__90\"\n d=\"M117.3 39.26L94.7 52.3a33.1 33.1 0 0 0-5.25-9.1l22.57-13.03a5.25 5.25 0 0 1 5.25 9.1z\"\n [attr.fill]=\"color\" fill-opacity=\"0.9\" />\n <animateTransform attributeName=\"transform\" type=\"rotate\"\n values=\"0 64 64;30 64 64;60 64 64;90 64 64;120 64 64;150 64 64;180 64 64;210 64 64;240 64 64;270 64 64;300 64 64;330 64 64\"\n calcMode=\"discrete\" dur=\"600ms\" repeatCount=\"indefinite\"></animateTransform>\n </g>\n</svg>\n}", styles: [".matecu-spinner{display:flex;align-items:center;justify-content:center}.matecu-spinner>svg{width:80px;height:80px}.matecu-spinner__hidden{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
115
+ }
116
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuSpinnerComponent, decorators: [{
117
+ type: Component,
118
+ args: [{ selector: 'matecu-spinner', standalone: true, imports: [CommonModule], template: "@if(active){\n\n<svg xmlns:svg=\"http://www.w3.org/2000/svg\" [attr.width]=\"size\" [attr.height]=\"size\" xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.0\" viewBox=\"0 0 128 128\" xml:space=\"preserve\">\n <rect x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" fill=\"transparent\" />\n <g>\n <path class=\"matecu-spinner__100\" d=\"M122.5 69.25H96.47a33.1 33.1 0 0 0 0-10.5h26.05a5.25 5.25 0 0 1 0 10.5z\"\n [attr.fill]=\"color\" fill-opacity=\"1\" />\n <path class=\"matecu-spinner__30\"\n d=\"M112.04 97.83L89.47 84.8a33.1 33.1 0 0 0 5.25-9.1l22.57 13.03a5.25 5.25 0 0 1-5.28 9.1z\"\n [attr.fill]=\"color\" fill-opacity=\"0.3\" />\n <path class=\"matecu-spinner__30\"\n d=\"M88.68 117.35L75.65 94.78a33.1 33.1 0 0 0 9.1-5.25l13.02 22.57a5.25 5.25 0 1 1-9.1 5.25z\"\n [attr.fill]=\"color\" fill-opacity=\"0.3\" />\n <path class=\"matecu-spinner__30\" d=\"M58.7 122.57V96.5a33.1 33.1 0 0 0 10.5 0v26.07a5.25 5.25 0 0 1-10.5 0z\"\n [attr.fill]=\"color\" fill-opacity=\"0.3\" />\n <path class=\"matecu-spinner__30\"\n d=\"M30.1 112.1l13.04-22.57a33.1 33.1 0 0 0 9.1 5.25L39.2 117.35a5.25 5.25 0 1 1-9.1-5.25z\"\n [attr.fill]=\"color\" fill-opacity=\"0.3\" />\n <path class=\"matecu-spinner__30\"\n d=\"M10.6 88.74L33.16 75.7a33.1 33.1 0 0 0 5.25 9.1L15.88 97.83a5.25 5.25 0 1 1-5.25-9.1z\"\n [attr.fill]=\"color\" fill-opacity=\"0.3\" />\n <path class=\"matecu-spinner__40\" d=\"M5.37 58.75h26.06a33.1 33.1 0 0 0 0 10.5H5.37a5.25 5.25 0 0 1 0-10.5z\"\n [attr.fill]=\"color\" fill-opacity=\"0.4\" />\n <path class=\"matecu-spinner__50\"\n d=\"M15.85 30.17L38.4 43.2a33.1 33.1 0 0 0-5.24 9.1L10.6 39.25a5.25 5.25 0 1 1 5.25-9.1z\" [attr.fill]=\"color\"\n fill-opacity=\"0.5\" />\n <path class=\"matecu-spinner__60\"\n d=\"M39.2 10.65l13.03 22.57a33.1 33.1 0 0 0-9.1 5.25l-13-22.57a5.25 5.25 0 1 1 9.1-5.25z\" [attr.fill]=\"color\"\n fill-opacity=\"0.6\" />\n <path class=\"matecu-spinner__70\" d=\"M69.2 5.43V31.5a33.1 33.1 0 0 0-10.5 0V5.42a5.25 5.25 0 1 1 10.5 0z\"\n [attr.fill]=\"color\" fill-opacity=\"0.7\" />\n <path class=\"matecu-spinner__80\"\n d=\"M97.77 15.9L84.75 38.47a33.1 33.1 0 0 0-9.1-5.25l13.03-22.57a5.25 5.25 0 1 1 9.1 5.25z\"\n [attr.fill]=\"color\" fill-opacity=\"0.8\" />\n <path class=\"matecu-spinner__90\"\n d=\"M117.3 39.26L94.7 52.3a33.1 33.1 0 0 0-5.25-9.1l22.57-13.03a5.25 5.25 0 0 1 5.25 9.1z\"\n [attr.fill]=\"color\" fill-opacity=\"0.9\" />\n <animateTransform attributeName=\"transform\" type=\"rotate\"\n values=\"0 64 64;30 64 64;60 64 64;90 64 64;120 64 64;150 64 64;180 64 64;210 64 64;240 64 64;270 64 64;300 64 64;330 64 64\"\n calcMode=\"discrete\" dur=\"600ms\" repeatCount=\"indefinite\"></animateTransform>\n </g>\n</svg>\n}", styles: [".matecu-spinner{display:flex;align-items:center;justify-content:center}.matecu-spinner>svg{width:80px;height:80px}.matecu-spinner__hidden{display:none}\n"] }]
119
+ }], ctorParameters: () => [{ type: MatecuSpinnerService }, { type: i0.ChangeDetectorRef }], propDecorators: { className: [{
120
+ type: HostBinding,
121
+ args: ['class']
122
+ }], color: [{
123
+ type: Input
124
+ }], global: [{
125
+ type: Input
126
+ }], active: [{
127
+ type: Input
128
+ }], size: [{
129
+ type: Input
130
+ }] } });
131
+
132
+ class MatecuSpinnerModule {
133
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuSpinnerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
134
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: MatecuSpinnerModule, imports: [CommonModule, MatecuSpinnerComponent], exports: [MatecuSpinnerComponent] });
135
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuSpinnerModule, imports: [CommonModule, MatecuSpinnerComponent] });
136
+ }
137
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuSpinnerModule, decorators: [{
138
+ type: NgModule,
139
+ args: [{
140
+ declarations: [],
141
+ imports: [
142
+ CommonModule, MatecuSpinnerComponent
143
+ ],
144
+ exports: [
145
+ MatecuSpinnerComponent
146
+ ]
147
+ }]
148
+ }] });
149
+
150
+ class MatecuTopbarLayoutComponent {
151
+ elementRef;
152
+ changeDetector;
153
+ zone;
154
+ _scrolled = false;
155
+ _prominent = false;
156
+ get scrolled() {
157
+ return this._scrolled;
158
+ }
159
+ set scrolled(value) {
160
+ this._scrolled = value;
161
+ this.className = this.className.replace(/scrolled/g, '').trim();
162
+ if (this.scrolled) {
163
+ this.className = `${this.className} scrolled`;
164
+ }
165
+ }
166
+ destroy$ = new Subject();
167
+ mobileStyle = false;
168
+ mobileStyleChange = new EventEmitter();
169
+ mobileWidth = 768;
170
+ whenResize = new EventEmitter();
171
+ get prominent() {
172
+ return this._prominent;
173
+ }
174
+ set prominent(value) {
175
+ this._prominent = value;
176
+ this.className = this.className.replace(/prominent/g, '').trim();
177
+ if (this.prominent) {
178
+ this.className = `${this.className} prominent`;
179
+ }
180
+ }
181
+ className = 'matecu-topbar-layout';
182
+ bodyElement;
183
+ constructor(elementRef, changeDetector, zone) {
184
+ this.elementRef = elementRef;
185
+ this.changeDetector = changeDetector;
186
+ this.zone = zone;
187
+ }
188
+ ngOnDestroy() {
189
+ this.destroy$.next();
190
+ this.destroy$.complete();
191
+ }
192
+ spyScroll(scrollabe) {
193
+ if (!scrollabe) {
194
+ return;
195
+ }
196
+ const maxScrollHeight = scrollabe.scrollHeight;
197
+ const scrollableHeight = scrollabe.clientHeight;
198
+ if (scrollableHeight > maxScrollHeight) {
199
+ return;
200
+ }
201
+ const scrollPosition = scrollabe.scrollTop;
202
+ this.scrolled = scrollPosition > 20;
203
+ }
204
+ ngAfterViewInit() {
205
+ const layoutElement = this.elementRef.nativeElement;
206
+ const resizeObserver = new ResizeObserver(() => {
207
+ const width = layoutElement?.clientWidth;
208
+ if (!width) {
209
+ return;
210
+ }
211
+ this.mobileStyle = width <= this.mobileWidth;
212
+ this.zone.run(() => {
213
+ this.mobileStyleChange.emit(this.mobileStyle);
214
+ this.whenResize.emit(width);
215
+ });
216
+ });
217
+ resizeObserver.observe(layoutElement);
218
+ this.destroy$.pipe(tap(() => resizeObserver.disconnect())).subscribe();
219
+ if (this.bodyElement) {
220
+ fromEvent(this.bodyElement.nativeElement, 'scroll')
221
+ .pipe(tap(() => this.spyScroll(this.bodyElement?.nativeElement)), takeUntil(this.destroy$))
222
+ .subscribe();
223
+ }
224
+ }
225
+ scrollTop() {
226
+ if (!this.bodyElement) {
227
+ return;
228
+ }
229
+ this.bodyElement.nativeElement.scroll({
230
+ top: 0,
231
+ behavior: 'smooth',
232
+ });
233
+ }
234
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuTopbarLayoutComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
235
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: MatecuTopbarLayoutComponent, isStandalone: true, selector: "matecu-topbar-layout", inputs: { mobileStyle: "mobileStyle", mobileWidth: "mobileWidth", prominent: "prominent" }, outputs: { mobileStyleChange: "mobileStyleChange", whenResize: "whenResize" }, host: { properties: { "class": "this.className" } }, viewQueries: [{ propertyName: "bodyElement", first: true, predicate: ["mtbBody"], descendants: true }], ngImport: i0, template: "<div class=\"matecu-topbar-layout__bar\">\n <ng-content select=\"matecu-topbar-header-row[first-row]\"></ng-content>\n <ng-content select=\"matecu-topbar-header-row[second-row]\"></ng-content>\n</div>\n<div class=\"matecu-topbar-layout__body\" #mtbBody>\n <ng-content select=\"matecu-topbar-body\"></ng-content>\n</div>\n", styles: [":host,.matecu-topbar-layout{position:relative;box-sizing:border-box}:host *,.matecu-topbar-layout *{box-sizing:border-box}:host,.matecu-topbar-layout{display:grid;grid-template-rows:auto 1fr;box-sizing:border-box;border:var(--mtb-border, none);margin:var(--mtb-margin, 0px);padding:0;width:var(--mtb-width, 100%);height:var(--mtb-height, 100vh);overflow:hidden}:host__bar,.matecu-topbar-layout__bar{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;background-color:var(--mtb-primary-color, #3f51b5);color:var(--mtb-bar-color, #fff);width:100%;padding:0;margin:0;min-height:var(--mtb-bar-height, 64px);transition:all .3s}:host__body,.matecu-topbar-layout__body{padding:0;margin:0;overflow-y:auto}:host.prominent .matecu-topbar-layout__bar,.matecu-topbar-layout.prominent .matecu-topbar-layout__bar{min-height:var(--mtb-bar-prominent-height, 128px)}:host.scrolled .matecu-topbar-layout__bar,.matecu-topbar-layout.scrolled .matecu-topbar-layout__bar{box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f;min-height:var(--mtb-bar-height, 64px)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatToolbarModule }] });
236
+ }
237
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuTopbarLayoutComponent, decorators: [{
238
+ type: Component,
239
+ args: [{ selector: 'matecu-topbar-layout', standalone: true, imports: [CommonModule, MatButtonModule, MatIconModule, MatToolbarModule], template: "<div class=\"matecu-topbar-layout__bar\">\n <ng-content select=\"matecu-topbar-header-row[first-row]\"></ng-content>\n <ng-content select=\"matecu-topbar-header-row[second-row]\"></ng-content>\n</div>\n<div class=\"matecu-topbar-layout__body\" #mtbBody>\n <ng-content select=\"matecu-topbar-body\"></ng-content>\n</div>\n", styles: [":host,.matecu-topbar-layout{position:relative;box-sizing:border-box}:host *,.matecu-topbar-layout *{box-sizing:border-box}:host,.matecu-topbar-layout{display:grid;grid-template-rows:auto 1fr;box-sizing:border-box;border:var(--mtb-border, none);margin:var(--mtb-margin, 0px);padding:0;width:var(--mtb-width, 100%);height:var(--mtb-height, 100vh);overflow:hidden}:host__bar,.matecu-topbar-layout__bar{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;background-color:var(--mtb-primary-color, #3f51b5);color:var(--mtb-bar-color, #fff);width:100%;padding:0;margin:0;min-height:var(--mtb-bar-height, 64px);transition:all .3s}:host__body,.matecu-topbar-layout__body{padding:0;margin:0;overflow-y:auto}:host.prominent .matecu-topbar-layout__bar,.matecu-topbar-layout.prominent .matecu-topbar-layout__bar{min-height:var(--mtb-bar-prominent-height, 128px)}:host.scrolled .matecu-topbar-layout__bar,.matecu-topbar-layout.scrolled .matecu-topbar-layout__bar{box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f;min-height:var(--mtb-bar-height, 64px)}\n"] }]
240
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }], propDecorators: { mobileStyle: [{
241
+ type: Input
242
+ }], mobileStyleChange: [{
243
+ type: Output
244
+ }], mobileWidth: [{
245
+ type: Input
246
+ }], whenResize: [{
247
+ type: Output
248
+ }], prominent: [{
249
+ type: Input
250
+ }], className: [{
251
+ type: HostBinding,
252
+ args: ['class']
253
+ }], bodyElement: [{
254
+ type: ViewChild,
255
+ args: ['mtbBody']
256
+ }] } });
257
+
258
+ class MatecuTopbarTitleComponent {
259
+ className = 'matecu-topbar-title';
260
+ constructor() { }
261
+ ngOnInit() { }
262
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuTopbarTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
263
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: MatecuTopbarTitleComponent, isStandalone: true, selector: "matecu-topbar-title", host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<ng-content></ng-content>", styles: [".matecu-topbar-search-mobile-only{display:none;border:none;background:none;cursor:pointer;color:var(--mtb-search-color, var(--mtb-bar-color, #fff));margin:var(--mtb-search-margin, 10px)}.matecu-topbar-search-mobile-only.mobile-style{display:block}:host,:host *,.matecu-topbar-search,.matecu-topbar-search *{box-sizing:border-box;outline:none}:host,.matecu-topbar-search{margin:var(--mtb-search-margin, 10px);position:relative;display:flex;align-items:center;color:var(--mtb-search-color, var(--mtb-bar-color, #fff));max-height:var(--bar-height, 64px)}:host input,.matecu-topbar-search input{width:var(--mtb-search-width, 200px);min-width:var(--mtb-search-width, 200px);height:var(--mtb-search-height, 40px);padding:var(--mtb-search-pading, 3px 35px);border-radius:4px;border:1px solid;border:var(--mtb-search-border, none);background-color:var(--search-background-color, rgba(255, 255, 255, .3019607843));color:currentColor;transition:all .3s ease-in-out}:host input::placeholder,.matecu-topbar-search input::placeholder{color:var(--mtb-search-color, var(--mtb-bar-color, #fff));opacity:1}:host input:focus,.matecu-topbar-search input:focus{min-width:var(--mtb-search-width-large, 290px)}:host__icon,.matecu-topbar-search__icon{position:absolute;top:50%;transform:translateY(-50%);padding:0}:host__icon--search,.matecu-topbar-search__icon--search{left:6px}:host__icon--clear,.matecu-topbar-search__icon--clear{border:0px;background:0px;cursor:pointer;color:currentColor;right:6px}.mobile-style.matecu-topbar-search{position:absolute;top:0;left:0;right:0;border-bottom:1px solid;border-bottom-color:var(--mtb-search-border-bottom-color, #ededed);z-index:3;padding:0;margin:0;height:64px;color:var(--mtb-search-mobile-color, #000);transform:translateY(-120%);transition:all .3s ease-in-out}.mobile-style.matecu-topbar-search.active-mobile{transform:translateY(0)}.mobile-style.matecu-topbar-search input{background-color:#fff;height:100%;width:100%;border-radius:0}.mobile-style.matecu-topbar-search input::placeholder{color:var(--mtb-search-mobile-color, #000)}\n"] });
264
+ }
265
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuTopbarTitleComponent, decorators: [{
266
+ type: Component,
267
+ args: [{ selector: 'matecu-topbar-title', standalone: true, template: "<ng-content></ng-content>", styles: [".matecu-topbar-search-mobile-only{display:none;border:none;background:none;cursor:pointer;color:var(--mtb-search-color, var(--mtb-bar-color, #fff));margin:var(--mtb-search-margin, 10px)}.matecu-topbar-search-mobile-only.mobile-style{display:block}:host,:host *,.matecu-topbar-search,.matecu-topbar-search *{box-sizing:border-box;outline:none}:host,.matecu-topbar-search{margin:var(--mtb-search-margin, 10px);position:relative;display:flex;align-items:center;color:var(--mtb-search-color, var(--mtb-bar-color, #fff));max-height:var(--bar-height, 64px)}:host input,.matecu-topbar-search input{width:var(--mtb-search-width, 200px);min-width:var(--mtb-search-width, 200px);height:var(--mtb-search-height, 40px);padding:var(--mtb-search-pading, 3px 35px);border-radius:4px;border:1px solid;border:var(--mtb-search-border, none);background-color:var(--search-background-color, rgba(255, 255, 255, .3019607843));color:currentColor;transition:all .3s ease-in-out}:host input::placeholder,.matecu-topbar-search input::placeholder{color:var(--mtb-search-color, var(--mtb-bar-color, #fff));opacity:1}:host input:focus,.matecu-topbar-search input:focus{min-width:var(--mtb-search-width-large, 290px)}:host__icon,.matecu-topbar-search__icon{position:absolute;top:50%;transform:translateY(-50%);padding:0}:host__icon--search,.matecu-topbar-search__icon--search{left:6px}:host__icon--clear,.matecu-topbar-search__icon--clear{border:0px;background:0px;cursor:pointer;color:currentColor;right:6px}.mobile-style.matecu-topbar-search{position:absolute;top:0;left:0;right:0;border-bottom:1px solid;border-bottom-color:var(--mtb-search-border-bottom-color, #ededed);z-index:3;padding:0;margin:0;height:64px;color:var(--mtb-search-mobile-color, #000);transform:translateY(-120%);transition:all .3s ease-in-out}.mobile-style.matecu-topbar-search.active-mobile{transform:translateY(0)}.mobile-style.matecu-topbar-search input{background-color:#fff;height:100%;width:100%;border-radius:0}.mobile-style.matecu-topbar-search input::placeholder{color:var(--mtb-search-mobile-color, #000)}\n"] }]
268
+ }], ctorParameters: () => [], propDecorators: { className: [{
269
+ type: HostBinding,
270
+ args: ['class']
271
+ }] } });
272
+
273
+ class MatecuTopbarBodyComponent {
274
+ className = 'matecu-topbar-body';
275
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuTopbarBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
276
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: MatecuTopbarBodyComponent, isStandalone: true, selector: "matecu-topbar-body", host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<ng-content></ng-content>", styles: [":host,.matecu-topbar-body{display:block}:host,:host *,.matecu-topbar-body,.matecu-topbar-body *{box-sizing:border-box;outline:none}:host,.matecu-topbar-body{padding:var(--mtb-body-padding, 30px);background-color:var(--mtb-body-background, auto);overflow-y:auto;padding-bottom:var(--mtb-body-padding-button, 60px)}\n"] });
277
+ }
278
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuTopbarBodyComponent, decorators: [{
279
+ type: Component,
280
+ args: [{ selector: 'matecu-topbar-body', standalone: true, template: "<ng-content></ng-content>", styles: [":host,.matecu-topbar-body{display:block}:host,:host *,.matecu-topbar-body,.matecu-topbar-body *{box-sizing:border-box;outline:none}:host,.matecu-topbar-body{padding:var(--mtb-body-padding, 30px);background-color:var(--mtb-body-background, auto);overflow-y:auto;padding-bottom:var(--mtb-body-padding-button, 60px)}\n"] }]
281
+ }], propDecorators: { className: [{
282
+ type: HostBinding,
283
+ args: ['class']
284
+ }] } });
285
+
286
+ class MatecuTopbarFabComponent {
287
+ _mobileStyle = false;
288
+ mainClassName = 'matecu-topbar-fab';
289
+ display = true;
290
+ get mobileStyle() {
291
+ return this._mobileStyle;
292
+ }
293
+ set mobileStyle(value) {
294
+ this._mobileStyle = value;
295
+ this.className = this.className.replace(/mobile-style/g, '').trim();
296
+ if (this._mobileStyle) {
297
+ this.className = `${this.className} mobile-style`;
298
+ }
299
+ }
300
+ className = this.mainClassName;
301
+ get color() {
302
+ return this.display ? 'flex' : 'none';
303
+ }
304
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuTopbarFabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
305
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: MatecuTopbarFabComponent, isStandalone: true, selector: "matecu-topbar-fab", inputs: { display: "display", mobileStyle: "mobileStyle" }, host: { properties: { "class": "this.className", "style.display": "this.color" } }, ngImport: i0, template: "@if(display){\n<ng-content></ng-content>\n}", styles: [":host,:host *,.matecu-topbar-fab,.matecu-topbar-fab *{box-sizing:border-box;outline:none}:host,.matecu-topbar-fab{display:flex;align-self:flex-end;align-items:flex-start;transform:translateY(50%);transition:all .3s ease-in-out}:host.mobile-style,.matecu-topbar-fab.mobile-style{position:absolute;transform:translate(0);bottom:var(--mtb-fab-mobile-bottom-position, 20px);right:var(--mtb-fab-mobile-right-position, 20px)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonModule }] });
306
+ }
307
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuTopbarFabComponent, decorators: [{
308
+ type: Component,
309
+ args: [{ selector: 'matecu-topbar-fab', standalone: true, imports: [CommonModule, MatButtonModule], template: "@if(display){\n<ng-content></ng-content>\n}", styles: [":host,:host *,.matecu-topbar-fab,.matecu-topbar-fab *{box-sizing:border-box;outline:none}:host,.matecu-topbar-fab{display:flex;align-self:flex-end;align-items:flex-start;transform:translateY(50%);transition:all .3s ease-in-out}:host.mobile-style,.matecu-topbar-fab.mobile-style{position:absolute;transform:translate(0);bottom:var(--mtb-fab-mobile-bottom-position, 20px);right:var(--mtb-fab-mobile-right-position, 20px)}\n"] }]
310
+ }], propDecorators: { display: [{
311
+ type: Input
312
+ }], mobileStyle: [{
313
+ type: Input
314
+ }], className: [{
315
+ type: HostBinding,
316
+ args: ['class']
317
+ }], color: [{
318
+ type: HostBinding,
319
+ args: ['style.display']
320
+ }] } });
321
+
322
+ class MatecuTopbarSearchComponent {
323
+ hasValue = false;
324
+ activeMobileSearch = false;
325
+ inputCtrl = new FormControl('');
326
+ _value = '';
327
+ _mobileStyle = false;
328
+ destroy$ = new Subject();
329
+ display = true;
330
+ placeholder = '';
331
+ delyValueChanges = 300; // valor en milisegundos
332
+ get value() {
333
+ return this._value;
334
+ }
335
+ set value(v) {
336
+ this._value = v;
337
+ this.inputCtrl.setValue(v);
338
+ }
339
+ get mobileStyle() {
340
+ return this._mobileStyle;
341
+ }
342
+ set mobileStyle(value) {
343
+ this._mobileStyle = value;
344
+ this.className = this.className.replace(/mobile-style/g, '').trim();
345
+ if (this._mobileStyle) {
346
+ this.className = `${this.className} mobile-style`;
347
+ }
348
+ }
349
+ valueChange = new EventEmitter();
350
+ className = 'matecu-topbar-search';
351
+ get color() {
352
+ return this.display ? 'flex' : 'none';
353
+ }
354
+ ngOnInit() {
355
+ this.inputCtrl.valueChanges
356
+ .pipe(map((value) => value ?? ''), tap(this.updateHasValueFn()), debounceTime(this.delyValueChanges), distinctUntilChanged(), tap((value) => this.valueChange.emit(value)), takeUntil(this.destroy$))
357
+ .subscribe();
358
+ }
359
+ toggleActiveMobildeSearch() {
360
+ this.activeMobileSearch = !this.activeMobileSearch;
361
+ }
362
+ clearSearch() {
363
+ this.inputCtrl.setValue('');
364
+ this.activeMobileSearch = false;
365
+ }
366
+ updateHasValueFn() {
367
+ return (value) => {
368
+ this.hasValue = value.length > 0;
369
+ };
370
+ }
371
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuTopbarSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
372
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: MatecuTopbarSearchComponent, isStandalone: true, selector: "matecu-topbar-search", inputs: { display: "display", placeholder: "placeholder", delyValueChanges: "delyValueChanges", value: "value", mobileStyle: "mobileStyle" }, outputs: { valueChange: "valueChange" }, host: { properties: { "className": "this.className", "style.display": "this.color" } }, ngImport: i0, template: "@if(display){\n<button class=\"matecu-topbar-search-mobile-only\" [ngClass]=\"{ 'mobile-style': mobileStyle }\"\n (click)=\"toggleActiveMobildeSearch()\">\n <mat-icon>search</mat-icon>\n</button>\n<div class=\"matecu-topbar-search\" [ngClass]=\"{\n 'mobile-style': mobileStyle,\n 'active-mobile': activeMobileSearch\n }\">\n <span class=\"matecu-topbar-search__icon matecu-topbar-search__icon--search\">\n <mat-icon>search</mat-icon>\n </span>\n @if(hasValue || mobileStyle){\n <button class=\"matecu-topbar-search__icon matecu-topbar-search__icon--clear\" (click)=\"clearSearch()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n <input type=\"text\" [placeholder]=\"placeholder\" [formControl]=\"inputCtrl\" />\n</div>\n}", styles: [".matecu-topbar-search-mobile-only{display:none;border:none;background:none;cursor:pointer;color:var(--mtb-search-color, var(--mtb-bar-color, #fff));margin:var(--mtb-search-margin, 10px)}.matecu-topbar-search-mobile-only.mobile-style{display:block}.matecu-topbar-search,.matecu-topbar-search *{box-sizing:border-box;outline:none}.matecu-topbar-search{margin:var(--mtb-search-margin, 10px);position:relative;display:flex;align-items:center;color:var(--mtb-search-color, var(--mtb-bar-color, #fff));max-height:var(--bar-height, 64px)}.matecu-topbar-search input{width:var(--mtb-search-width, 200px);min-width:var(--mtb-search-width, 200px);height:var(--mtb-search-height, 40px);padding:var(--mtb-search-pading, 3px 35px);border-radius:4px;border:1px solid;border:var(--mtb-search-border, none);background-color:var(--search-background-color, rgba(255, 255, 255, .3019607843));color:currentColor;transition:all .3s ease-in-out}.matecu-topbar-search input::placeholder{color:var(--mtb-search-color, var(--mtb-bar-color, #fff));opacity:1}.matecu-topbar-search input:focus{min-width:var(--mtb-search-width-large, 290px)}.matecu-topbar-search__icon{position:absolute;top:50%;transform:translateY(-50%);padding:0}.matecu-topbar-search__icon--search{left:6px}.matecu-topbar-search__icon--clear{border:0px;background:0px;cursor:pointer;color:currentColor;right:6px}.mobile-style.matecu-topbar-search{position:absolute;top:0;left:0;right:0;border-bottom:1px solid;border-bottom-color:var(--mtb-search-border-bottom-color, #ededed);z-index:3;padding:0;margin:0;height:64px;color:var(--mtb-search-mobile-color, #000);transform:translateY(-120%);transition:all .3s ease-in-out}.mobile-style.matecu-topbar-search.active-mobile{transform:translateY(0)}.mobile-style.matecu-topbar-search input{background-color:#fff;height:100%;width:100%;border-radius:0}.mobile-style.matecu-topbar-search input::placeholder{color:var(--mtb-search-mobile-color, #000)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }] });
373
+ }
374
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuTopbarSearchComponent, decorators: [{
375
+ type: Component,
376
+ args: [{ selector: 'matecu-topbar-search', standalone: true, imports: [
377
+ CommonModule,
378
+ FormsModule,
379
+ ReactiveFormsModule,
380
+ MatIconModule,
381
+ MatButtonModule,
382
+ ], template: "@if(display){\n<button class=\"matecu-topbar-search-mobile-only\" [ngClass]=\"{ 'mobile-style': mobileStyle }\"\n (click)=\"toggleActiveMobildeSearch()\">\n <mat-icon>search</mat-icon>\n</button>\n<div class=\"matecu-topbar-search\" [ngClass]=\"{\n 'mobile-style': mobileStyle,\n 'active-mobile': activeMobileSearch\n }\">\n <span class=\"matecu-topbar-search__icon matecu-topbar-search__icon--search\">\n <mat-icon>search</mat-icon>\n </span>\n @if(hasValue || mobileStyle){\n <button class=\"matecu-topbar-search__icon matecu-topbar-search__icon--clear\" (click)=\"clearSearch()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n <input type=\"text\" [placeholder]=\"placeholder\" [formControl]=\"inputCtrl\" />\n</div>\n}", styles: [".matecu-topbar-search-mobile-only{display:none;border:none;background:none;cursor:pointer;color:var(--mtb-search-color, var(--mtb-bar-color, #fff));margin:var(--mtb-search-margin, 10px)}.matecu-topbar-search-mobile-only.mobile-style{display:block}.matecu-topbar-search,.matecu-topbar-search *{box-sizing:border-box;outline:none}.matecu-topbar-search{margin:var(--mtb-search-margin, 10px);position:relative;display:flex;align-items:center;color:var(--mtb-search-color, var(--mtb-bar-color, #fff));max-height:var(--bar-height, 64px)}.matecu-topbar-search input{width:var(--mtb-search-width, 200px);min-width:var(--mtb-search-width, 200px);height:var(--mtb-search-height, 40px);padding:var(--mtb-search-pading, 3px 35px);border-radius:4px;border:1px solid;border:var(--mtb-search-border, none);background-color:var(--search-background-color, rgba(255, 255, 255, .3019607843));color:currentColor;transition:all .3s ease-in-out}.matecu-topbar-search input::placeholder{color:var(--mtb-search-color, var(--mtb-bar-color, #fff));opacity:1}.matecu-topbar-search input:focus{min-width:var(--mtb-search-width-large, 290px)}.matecu-topbar-search__icon{position:absolute;top:50%;transform:translateY(-50%);padding:0}.matecu-topbar-search__icon--search{left:6px}.matecu-topbar-search__icon--clear{border:0px;background:0px;cursor:pointer;color:currentColor;right:6px}.mobile-style.matecu-topbar-search{position:absolute;top:0;left:0;right:0;border-bottom:1px solid;border-bottom-color:var(--mtb-search-border-bottom-color, #ededed);z-index:3;padding:0;margin:0;height:64px;color:var(--mtb-search-mobile-color, #000);transform:translateY(-120%);transition:all .3s ease-in-out}.mobile-style.matecu-topbar-search.active-mobile{transform:translateY(0)}.mobile-style.matecu-topbar-search input{background-color:#fff;height:100%;width:100%;border-radius:0}.mobile-style.matecu-topbar-search input::placeholder{color:var(--mtb-search-mobile-color, #000)}\n"] }]
383
+ }], propDecorators: { display: [{
384
+ type: Input
385
+ }], placeholder: [{
386
+ type: Input
387
+ }], delyValueChanges: [{
388
+ type: Input
389
+ }], value: [{
390
+ type: Input
391
+ }], mobileStyle: [{
392
+ type: Input
393
+ }], valueChange: [{
394
+ type: Output
395
+ }], className: [{
396
+ type: HostBinding
397
+ }], color: [{
398
+ type: HostBinding,
399
+ args: ['style.display']
400
+ }] } });
401
+
402
+ class MatecuTopbarActionComponent {
403
+ className = 'matecu-topbar-action';
404
+ constructor() { }
405
+ ngOnInit() { }
406
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuTopbarActionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
407
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: MatecuTopbarActionComponent, isStandalone: true, selector: "matecu-topbar-action", host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{--mtb-bar-height: 64px;--mtb-action-padding: 10px;--mtb-action-margin: 0px}:host,:host *,.matecu-topbar-action,.matecu-topbar-action *{box-sizing:border-box;outline:none}:host,.matecu-topbar-action{height:100%;display:flex;align-items:flex-start;max-height:var(--mtb-bar-height);padding:var(--mtb-action-padding);margin:var(--mtb-action-margin)}\n"] });
408
+ }
409
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuTopbarActionComponent, decorators: [{
410
+ type: Component,
411
+ args: [{ selector: 'matecu-topbar-action', standalone: true, template: "<ng-content></ng-content>\n", styles: [":host{--mtb-bar-height: 64px;--mtb-action-padding: 10px;--mtb-action-margin: 0px}:host,:host *,.matecu-topbar-action,.matecu-topbar-action *{box-sizing:border-box;outline:none}:host,.matecu-topbar-action{height:100%;display:flex;align-items:flex-start;max-height:var(--mtb-bar-height);padding:var(--mtb-action-padding);margin:var(--mtb-action-margin)}\n"] }]
412
+ }], ctorParameters: () => [], propDecorators: { className: [{
413
+ type: HostBinding,
414
+ args: ['class']
415
+ }] } });
416
+
417
+ class MatecuTopbarHeaderRowComponent {
418
+ display = true;
419
+ className = 'matecu-topbar-header-row';
420
+ get color() {
421
+ return this.display ? 'flex' : 'none';
422
+ }
423
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuTopbarHeaderRowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
424
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: MatecuTopbarHeaderRowComponent, isStandalone: true, selector: "matecu-topbar-header-row", inputs: { display: "display" }, host: { properties: { "class": "this.className", "style.display": "this.color" } }, ngImport: i0, template: "@if(display){\n<div class=\"matecu-topbar-header-row__column matecu-topbar-header-row__column--left\">\n <ng-content select=\"matecu-topbar-header-column[left-column]\"></ng-content>\n</div>\n\n<div class=\"matecu-topbar-header-row__column matecu-topbar-header-row__column--right\">\n <ng-content select=\"matecu-topbar-header-column[right-column]\"></ng-content>\n</div>\n}", styles: [":host{--mtb-row-padding: 0px;--mtb-row-margin: 0;--mtb-row-max-width: 100%;--mtb-row-min-width: 320px}:host,:host *,.matecu-topbar-header-row,.matecu-topbar-header-row *{box-sizing:border-box;outline:none}:host,.matecu-topbar-header-row{padding:var(--mtb-row-padding);margin:var(--mtb-row-margin);display:flex;align-items:flex-start;justify-content:flex-start;box-sizing:border-box;width:100%;height:100%;max-width:var(--mtb-row-max-width);min-width:var(--mtb-row-min-width)}:host__column,.matecu-topbar-header-row__column{display:flex;height:100%;min-height:var(--mtb-bar-height, 64px);align-items:flex-start}:host__column--right,.matecu-topbar-header-row__column--right{margin-left:auto;justify-content:flex-end}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatToolbarModule }] });
425
+ }
426
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuTopbarHeaderRowComponent, decorators: [{
427
+ type: Component,
428
+ args: [{ selector: 'matecu-topbar-header-row', standalone: true, imports: [CommonModule, MatToolbarModule], template: "@if(display){\n<div class=\"matecu-topbar-header-row__column matecu-topbar-header-row__column--left\">\n <ng-content select=\"matecu-topbar-header-column[left-column]\"></ng-content>\n</div>\n\n<div class=\"matecu-topbar-header-row__column matecu-topbar-header-row__column--right\">\n <ng-content select=\"matecu-topbar-header-column[right-column]\"></ng-content>\n</div>\n}", styles: [":host{--mtb-row-padding: 0px;--mtb-row-margin: 0;--mtb-row-max-width: 100%;--mtb-row-min-width: 320px}:host,:host *,.matecu-topbar-header-row,.matecu-topbar-header-row *{box-sizing:border-box;outline:none}:host,.matecu-topbar-header-row{padding:var(--mtb-row-padding);margin:var(--mtb-row-margin);display:flex;align-items:flex-start;justify-content:flex-start;box-sizing:border-box;width:100%;height:100%;max-width:var(--mtb-row-max-width);min-width:var(--mtb-row-min-width)}:host__column,.matecu-topbar-header-row__column{display:flex;height:100%;min-height:var(--mtb-bar-height, 64px);align-items:flex-start}:host__column--right,.matecu-topbar-header-row__column--right{margin-left:auto;justify-content:flex-end}\n"] }]
429
+ }], propDecorators: { display: [{
430
+ type: Input
431
+ }], className: [{
432
+ type: HostBinding,
433
+ args: ['class']
434
+ }], color: [{
435
+ type: HostBinding,
436
+ args: ['style.display']
437
+ }] } });
438
+
439
+ class MatecuTopbarHeaderColumnComponent {
440
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuTopbarHeaderColumnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
441
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: MatecuTopbarHeaderColumnComponent, isStandalone: true, selector: "matecu-topbar-header-column", ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{display:flex;height:100%;min-height:var(--mtb-bar-height, 64px)}:host[right-row]{justify-content:flex-end}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
442
+ }
443
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuTopbarHeaderColumnComponent, decorators: [{
444
+ type: Component,
445
+ args: [{ selector: 'matecu-topbar-header-column', standalone: true, imports: [CommonModule], template: "<ng-content></ng-content>\n", styles: [":host{display:flex;height:100%;min-height:var(--mtb-bar-height, 64px)}:host[right-row]{justify-content:flex-end}\n"] }]
446
+ }] });
447
+
448
+ class MatecuTopbarLayoutModule {
449
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuTopbarLayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
450
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: MatecuTopbarLayoutModule, imports: [CommonModule,
451
+ MatToolbarModule,
452
+ MatIconModule,
453
+ FormsModule,
454
+ ReactiveFormsModule,
455
+ MatButtonModule,
456
+ MatecuTopbarLayoutComponent,
457
+ MatecuTopbarTitleComponent,
458
+ MatecuTopbarBodyComponent,
459
+ MatecuTopbarFabComponent,
460
+ MatecuTopbarSearchComponent,
461
+ MatecuTopbarActionComponent,
462
+ MatecuTopbarHeaderRowComponent,
463
+ MatecuTopbarHeaderColumnComponent], exports: [MatecuTopbarLayoutComponent,
464
+ MatecuTopbarTitleComponent,
465
+ MatecuTopbarBodyComponent,
466
+ MatecuTopbarFabComponent,
467
+ MatecuTopbarSearchComponent,
468
+ MatecuTopbarActionComponent,
469
+ MatecuTopbarHeaderRowComponent,
470
+ MatecuTopbarHeaderColumnComponent] });
471
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuTopbarLayoutModule, imports: [CommonModule,
472
+ MatToolbarModule,
473
+ MatIconModule,
474
+ FormsModule,
475
+ ReactiveFormsModule,
476
+ MatButtonModule,
477
+ MatecuTopbarLayoutComponent,
478
+ MatecuTopbarFabComponent,
479
+ MatecuTopbarSearchComponent,
480
+ MatecuTopbarHeaderRowComponent,
481
+ MatecuTopbarHeaderColumnComponent] });
482
+ }
483
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuTopbarLayoutModule, decorators: [{
484
+ type: NgModule,
485
+ args: [{
486
+ declarations: [],
487
+ imports: [
488
+ CommonModule,
489
+ MatToolbarModule,
490
+ MatIconModule,
491
+ FormsModule,
492
+ ReactiveFormsModule,
493
+ MatButtonModule,
494
+ MatecuTopbarLayoutComponent,
495
+ MatecuTopbarTitleComponent,
496
+ MatecuTopbarBodyComponent,
497
+ MatecuTopbarFabComponent,
498
+ MatecuTopbarSearchComponent,
499
+ MatecuTopbarActionComponent,
500
+ MatecuTopbarHeaderRowComponent,
501
+ MatecuTopbarHeaderColumnComponent,
502
+ ],
503
+ exports: [
504
+ MatecuTopbarLayoutComponent,
505
+ MatecuTopbarTitleComponent,
506
+ MatecuTopbarBodyComponent,
507
+ MatecuTopbarFabComponent,
508
+ MatecuTopbarSearchComponent,
509
+ MatecuTopbarActionComponent,
510
+ MatecuTopbarHeaderRowComponent,
511
+ MatecuTopbarHeaderColumnComponent,
512
+ ],
513
+ }]
514
+ }] });
515
+
516
+ var MatecuAlertBoxType;
517
+ (function (MatecuAlertBoxType) {
518
+ MatecuAlertBoxType["warning"] = "warning";
519
+ MatecuAlertBoxType["success"] = "success";
520
+ MatecuAlertBoxType["danger"] = "danger";
521
+ MatecuAlertBoxType["info"] = "info";
522
+ })(MatecuAlertBoxType || (MatecuAlertBoxType = {}));
523
+
524
+ class MatecuAlertBoxComponent {
525
+ classNameBase = 'matecu-alert-box';
526
+ alertColor;
527
+ iconValue;
528
+ alertIcon = false;
529
+ get color() {
530
+ return this.alertColor;
531
+ }
532
+ set color(value) {
533
+ this.alertColor = value;
534
+ if (!!value) {
535
+ this.className = `${this.classNameBase} ${this.classNameBase}--${value}`;
536
+ }
537
+ else {
538
+ this.className = this.classNameBase;
539
+ }
540
+ this.updateIcon();
541
+ }
542
+ get icon() {
543
+ return this.alertIcon;
544
+ }
545
+ set icon(value) {
546
+ this.alertIcon = value;
547
+ }
548
+ className = this.classNameBase;
549
+ constructor() { }
550
+ ngOnInit() { }
551
+ updateIcon() {
552
+ switch (this.color) {
553
+ case MatecuAlertBoxType.danger:
554
+ this.iconValue = 'dangerous';
555
+ break;
556
+ case MatecuAlertBoxType.warning:
557
+ this.iconValue = 'warning';
558
+ break;
559
+ case MatecuAlertBoxType.success:
560
+ this.iconValue = 'check_circle';
561
+ break;
562
+ case MatecuAlertBoxType.info:
563
+ this.iconValue = 'info';
564
+ break;
565
+ default:
566
+ this.iconValue = null;
567
+ break;
568
+ }
569
+ }
570
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuAlertBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
571
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: MatecuAlertBoxComponent, isStandalone: true, selector: "matecu-alert-box", inputs: { color: "color", icon: "icon" }, host: { properties: { "class": "this.className" } }, ngImport: i0, template: "@if (icon && iconValue) {\n<div class=\"matecu-alert-box__icon\">\n <mat-icon>{{iconValue}}</mat-icon>\n</div>\n}\n<div class=\"matecu-alert-box__content\">\n <ng-content>\n\n\n </ng-content>\n</div>", styles: [":host.matecu-alert-box{display:flex;padding:1rem;border-radius:.25rem;position:relative;border:1px solid rgb(224,224,224);box-sizing:border-box;margin:1rem 0}:host.matecu-alert-box--success{color:#0f5032;background-color:#d2e6dc;border-color:#badccd}:host.matecu-alert-box--danger{color:#821e28;background-color:#f8d7da;border-color:#f5c2c7}:host.matecu-alert-box--warning{color:#644d03;background-color:#fff3cd;border-color:#ffecb4}:host.matecu-alert-box--info{color:#055160;background-color:#cff4fc;border-color:#b6effb}:host.matecu-alert-box .matecu-alert-box__icon{display:flex;margin-right:1rem}:host.matecu-alert-box .matecu-alert-box__content{align-self:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
572
+ }
573
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuAlertBoxComponent, decorators: [{
574
+ type: Component,
575
+ args: [{ selector: 'matecu-alert-box', standalone: true, imports: [CommonModule, MatIconModule], template: "@if (icon && iconValue) {\n<div class=\"matecu-alert-box__icon\">\n <mat-icon>{{iconValue}}</mat-icon>\n</div>\n}\n<div class=\"matecu-alert-box__content\">\n <ng-content>\n\n\n </ng-content>\n</div>", styles: [":host.matecu-alert-box{display:flex;padding:1rem;border-radius:.25rem;position:relative;border:1px solid rgb(224,224,224);box-sizing:border-box;margin:1rem 0}:host.matecu-alert-box--success{color:#0f5032;background-color:#d2e6dc;border-color:#badccd}:host.matecu-alert-box--danger{color:#821e28;background-color:#f8d7da;border-color:#f5c2c7}:host.matecu-alert-box--warning{color:#644d03;background-color:#fff3cd;border-color:#ffecb4}:host.matecu-alert-box--info{color:#055160;background-color:#cff4fc;border-color:#b6effb}:host.matecu-alert-box .matecu-alert-box__icon{display:flex;margin-right:1rem}:host.matecu-alert-box .matecu-alert-box__content{align-self:center}\n"] }]
576
+ }], ctorParameters: () => [], propDecorators: { color: [{
577
+ type: Input
578
+ }], icon: [{
579
+ type: Input
580
+ }], className: [{
581
+ type: HostBinding,
582
+ args: ['class']
583
+ }] } });
584
+
585
+ class MatecuAlertDialogComponent {
586
+ dialogData;
587
+ dialogRef;
588
+ hasTitle = false;
589
+ hasDismissBtn = false;
590
+ hasActionBtn = false;
591
+ showActions = false;
592
+ constructor(dialogData, dialogRef) {
593
+ this.dialogData = dialogData;
594
+ this.dialogRef = dialogRef;
595
+ this.setHasTitle();
596
+ this.setHasDismissBtn();
597
+ this.setHasActionBtn();
598
+ this.setShowActions();
599
+ }
600
+ ngOnInit() { }
601
+ activateAction() {
602
+ this.dialogRef.close(true);
603
+ }
604
+ setHasTitle() {
605
+ this.hasTitle = this.isValidString(this.dialogData.title);
606
+ }
607
+ setHasDismissBtn() {
608
+ this.hasDismissBtn = this.isValidString(this.dialogData.dismissText);
609
+ }
610
+ setHasActionBtn() {
611
+ this.hasActionBtn = this.isValidString(this.dialogData.action);
612
+ }
613
+ setShowActions() {
614
+ this.showActions = this.hasActionBtn || this.hasDismissBtn;
615
+ }
616
+ isValidString(str) {
617
+ const isValid = typeof str === 'string' && str.trim().length > 0;
618
+ return isValid;
619
+ }
620
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuAlertDialogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1$1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
621
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: MatecuAlertDialogComponent, isStandalone: true, selector: "matecu-alert-dialog", ngImport: i0, template: "@if (hasTitle) {\n\n<h2 mat-dialog-title>{{dialogData.title}}</h2>\n}\n<mat-dialog-content>\n\n <matecu-alert-box [color]=\"dialogData.type\" [icon]=\"!!dialogData.icon\">\n {{dialogData.message}}\n </matecu-alert-box>\n\n</mat-dialog-content>\n@if (showActions) {\n\n<mat-dialog-actions align=\"end\">\n @if (hasDismissBtn) {\n <button mat-button color=\"primary\" tabindex=\"-1\" mat-dialog-close>{{dialogData.dismissText}}\n </button>\n }\n @if(hasActionBtn) {\n <button mat-button color=\"primary\" tabindex=\"-2\" (click)=\"activateAction()\">{{dialogData.action}}\n </button>\n }\n</mat-dialog-actions>\n}", styles: [":host matecu-alert-box{max-width:900px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: MatecuAlertBoxComponent, selector: "matecu-alert-box", inputs: ["color", "icon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }] });
622
+ }
623
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuAlertDialogComponent, decorators: [{
624
+ type: Component,
625
+ args: [{ selector: 'matecu-alert-dialog', standalone: true, imports: [CommonModule, MatDialogModule, MatIconModule, MatecuAlertBoxComponent, MatButtonModule], template: "@if (hasTitle) {\n\n<h2 mat-dialog-title>{{dialogData.title}}</h2>\n}\n<mat-dialog-content>\n\n <matecu-alert-box [color]=\"dialogData.type\" [icon]=\"!!dialogData.icon\">\n {{dialogData.message}}\n </matecu-alert-box>\n\n</mat-dialog-content>\n@if (showActions) {\n\n<mat-dialog-actions align=\"end\">\n @if (hasDismissBtn) {\n <button mat-button color=\"primary\" tabindex=\"-1\" mat-dialog-close>{{dialogData.dismissText}}\n </button>\n }\n @if(hasActionBtn) {\n <button mat-button color=\"primary\" tabindex=\"-2\" (click)=\"activateAction()\">{{dialogData.action}}\n </button>\n }\n</mat-dialog-actions>\n}", styles: [":host matecu-alert-box{max-width:900px}\n"] }]
626
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
627
+ type: Inject,
628
+ args: [MAT_DIALOG_DATA]
629
+ }] }, { type: i1$1.MatDialogRef }] });
630
+
631
+ class MatecuAlertSnackBarComponent {
632
+ data;
633
+ snackBarRef;
634
+ title;
635
+ message;
636
+ action;
637
+ classNameBase = 'matecu-alert-snackbar';
638
+ alertColor;
639
+ get color() {
640
+ return this.alertColor;
641
+ }
642
+ set color(value) {
643
+ this.alertColor = value;
644
+ this.className = `${this.classNameBase} ${this.classNameBase}--${value}`;
645
+ }
646
+ className = this.classNameBase;
647
+ constructor(data, snackBarRef) {
648
+ this.data = data;
649
+ this.snackBarRef = snackBarRef;
650
+ this.title = data.title;
651
+ this.message = data.message;
652
+ this.action = data.action;
653
+ this.color = data.type;
654
+ }
655
+ dismiss() {
656
+ this.snackBarRef.dismissWithAction();
657
+ }
658
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuAlertSnackBarComponent, deps: [{ token: MAT_SNACK_BAR_DATA }, { token: i1$2.MatSnackBarRef }], target: i0.ɵɵFactoryTarget.Component });
659
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: MatecuAlertSnackBarComponent, isStandalone: true, selector: "matecu-alert-snack-bar", host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<div>\n <strong>{{title}}</strong> &nbsp;\n <span>{{message}}</span>\n</div>\n@if(action?.length){\n\n<div>\n <button mat-button color=\"accent\" (click)=\"dismiss()\">{{action}}</button>\n</div>\n}", styles: [":host.matecu-alert-snackbar{display:flex;align-items:center}:host.matecu-alert-snackbar>*:not(:first-child){margin-left:10px}:host.matecu-alert-snackbar--success strong{color:#20db20}:host.matecu-alert-snackbar--danger strong{color:red}:host.matecu-alert-snackbar--warning strong{color:orange}:host.matecu-alert-snackbar--info strong{color:#07a0ed}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatSnackBarModule }] });
660
+ }
661
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuAlertSnackBarComponent, decorators: [{
662
+ type: Component,
663
+ args: [{ selector: 'matecu-alert-snack-bar', standalone: true, imports: [CommonModule, MatButtonModule, MatSnackBarModule], template: "<div>\n <strong>{{title}}</strong> &nbsp;\n <span>{{message}}</span>\n</div>\n@if(action?.length){\n\n<div>\n <button mat-button color=\"accent\" (click)=\"dismiss()\">{{action}}</button>\n</div>\n}", styles: [":host.matecu-alert-snackbar{display:flex;align-items:center}:host.matecu-alert-snackbar>*:not(:first-child){margin-left:10px}:host.matecu-alert-snackbar--success strong{color:#20db20}:host.matecu-alert-snackbar--danger strong{color:red}:host.matecu-alert-snackbar--warning strong{color:orange}:host.matecu-alert-snackbar--info strong{color:#07a0ed}\n"] }]
664
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
665
+ type: Inject,
666
+ args: [MAT_SNACK_BAR_DATA]
667
+ }] }, { type: i1$2.MatSnackBarRef }], propDecorators: { className: [{
668
+ type: HostBinding,
669
+ args: ['class']
670
+ }] } });
671
+
672
+ class MatecuAlertBoxModule {
673
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuAlertBoxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
674
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: MatecuAlertBoxModule, imports: [CommonModule, MatIconModule, MatDialogModule, MatButtonModule, MatSnackBarModule, MatecuAlertBoxComponent, MatecuAlertDialogComponent, MatecuAlertSnackBarComponent], exports: [MatecuAlertBoxComponent] });
675
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuAlertBoxModule, imports: [CommonModule, MatIconModule, MatDialogModule, MatButtonModule, MatSnackBarModule, MatecuAlertBoxComponent, MatecuAlertDialogComponent, MatecuAlertSnackBarComponent] });
676
+ }
677
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuAlertBoxModule, decorators: [{
678
+ type: NgModule,
679
+ args: [{
680
+ declarations: [],
681
+ imports: [CommonModule, MatIconModule, MatDialogModule, MatButtonModule, MatSnackBarModule, MatecuAlertBoxComponent, MatecuAlertDialogComponent, MatecuAlertSnackBarComponent],
682
+ exports: [MatecuAlertBoxComponent]
683
+ }]
684
+ }] });
685
+
686
+ class MatecuSnackBarService {
687
+ snackBar;
688
+ constructor(snackBar) {
689
+ this.snackBar = snackBar;
690
+ }
691
+ openError(error, title, action, config) {
692
+ const message = this.getErrorMessage(error);
693
+ const titleStr = title || 'ERROR';
694
+ const type = MatecuAlertBoxType.danger;
695
+ return this.openAlert(message, titleStr, type, action, config);
696
+ }
697
+ openSuccess(message, title, action, config) {
698
+ const titleStr = title || 'OK';
699
+ const type = MatecuAlertBoxType.success;
700
+ return this.openAlert(message, titleStr, type, action, config);
701
+ }
702
+ openWarning(message, title, action, config) {
703
+ const titleStr = title || 'WARNING';
704
+ const type = MatecuAlertBoxType.warning;
705
+ return this.openAlert(message, titleStr, type, action, config);
706
+ }
707
+ openInfo(message, title, action, config) {
708
+ const titleStr = title || 'INFO';
709
+ const type = MatecuAlertBoxType.info;
710
+ return this.openAlert(message, titleStr, type, action, config);
711
+ }
712
+ open(message, action, config) {
713
+ return this.snackBar.open(message, action, config);
714
+ }
715
+ dismiss() {
716
+ this.snackBar.dismiss();
717
+ }
718
+ openAlert(message, title, type, action, config) {
719
+ const data = {
720
+ message,
721
+ title,
722
+ action,
723
+ type
724
+ };
725
+ const dialogConfig = { ...config, data };
726
+ return this.snackBar.openFromComponent(MatecuAlertSnackBarComponent, dialogConfig);
727
+ }
728
+ getErrorMessage(err) {
729
+ const error = new Error();
730
+ if (typeof err === 'string') {
731
+ return err;
732
+ }
733
+ if (err instanceof Error) {
734
+ return err.message;
735
+ }
736
+ return '';
737
+ }
738
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuSnackBarService, deps: [{ token: i1$2.MatSnackBar }], target: i0.ɵɵFactoryTarget.Injectable });
739
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuSnackBarService, providedIn: 'root' });
740
+ }
741
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuSnackBarService, decorators: [{
742
+ type: Injectable,
743
+ args: [{
744
+ providedIn: 'root'
745
+ }]
746
+ }], ctorParameters: () => [{ type: i1$2.MatSnackBar }] });
747
+
748
+ class MatecuAutocomplete {
749
+ options = [];
750
+ allowCreate = false;
751
+ loading = false;
752
+ readonly = false;
753
+ filterFn = this.createFilterFn();
754
+ searchChangeDebounceTime = 300;
755
+ // MatFormFieldControl inputs
756
+ get placeholder() {
757
+ return this._placeholder;
758
+ }
759
+ set placeholder(value) {
760
+ this._placeholder = value;
761
+ this.stateChanges.next();
762
+ }
763
+ _placeholder = '';
764
+ get required() {
765
+ return this._required;
766
+ }
767
+ set required(value) {
768
+ this._required = coerceBooleanProperty(value);
769
+ this.stateChanges.next();
770
+ }
771
+ _required = false;
772
+ get disabled() {
773
+ return this._disabled;
774
+ }
775
+ set disabled(value) {
776
+ this._disabled = coerceBooleanProperty(value);
777
+ this.setDisabledState(this._disabled);
778
+ this.stateChanges.next();
779
+ }
780
+ _disabled = false;
781
+ get value() {
782
+ return this.internalValue;
783
+ }
784
+ set value(value) {
785
+ this.writeValue(value);
786
+ this.stateChanges.next();
787
+ }
788
+ searchChange = new EventEmitter();
789
+ create = new EventEmitter();
790
+ valueChange = new EventEmitter();
791
+ // MatFormFieldControl properties
792
+ static nextId = 0;
793
+ stateChanges = new Subject();
794
+ id = `matecu-autocomplete-${MatecuAutocomplete.nextId++}`;
795
+ ngControl = null;
796
+ focused = false;
797
+ lastSearchText = null;
798
+ controlType = 'matecu-autocomplete';
799
+ autofilled = false;
800
+ inputControl = new FormControl(null);
801
+ filteredOptions$;
802
+ internalValue = null;
803
+ focusMonitor;
804
+ elementRef;
805
+ injector;
806
+ optionMap = new Map();
807
+ onChange = () => { };
808
+ onTouched = () => { };
809
+ get empty() {
810
+ const isEmpty = this.inputControl.value === '' || !this.inputControl.value;
811
+ return isEmpty;
812
+ }
813
+ get shouldLabelFloat() {
814
+ const shouldFloat = this.focused || !this.empty;
815
+ return shouldFloat;
816
+ }
817
+ get errorState() {
818
+ return !!(this.ngControl && this.ngControl.invalid && this.ngControl.touched);
819
+ }
820
+ get showCreateOption() {
821
+ const value = this.inputControl.value;
822
+ return (this.allowCreate &&
823
+ typeof value === 'string' &&
824
+ this.internalValue !== value &&
825
+ this.options.some((option) => option[1].toLowerCase() === value.toLowerCase()) === false);
826
+ }
827
+ constructor(focusMonitor, elementRef, injector) {
828
+ this.focusMonitor = focusMonitor;
829
+ this.elementRef = elementRef;
830
+ this.injector = injector;
831
+ }
832
+ ngOnInit() {
833
+ // Intentar obtener NgControl de forma segura
834
+ try {
835
+ this.ngControl = this.injector.get(NgControl, null);
836
+ }
837
+ catch (error) {
838
+ // Ignorar si no se puede obtener NgControl
839
+ this.ngControl = null;
840
+ }
841
+ const value$ = this.inputControl.valueChanges.pipe(startWith(this.inputControl.value ?? ''));
842
+ this.filteredOptions$ = combineLatest([value$]).pipe(map$1(([value]) => this.filter(value ?? '')));
843
+ this.inputControl.valueChanges
844
+ .pipe(
845
+ // Almacena el último valor valido para la búsqueda esto se utiliza para enviar una emición para crear un elemento
846
+ tap$1((value) => (this.lastSearchText = value ?? this.lastSearchText)),
847
+ // CUando se escribe algo se limpian los valores seleccionados para que el usuario pueda seleccionar una opción o crear una nueva
848
+ tap$1(() => this.clearValue()), debounceTime$1(this.searchChangeDebounceTime))
849
+ .subscribe((value) => {
850
+ queueMicrotask(() => {
851
+ this.searchChange.emit(value ?? '');
852
+ });
853
+ });
854
+ this.focusMonitor.monitor(this.elementRef, true).subscribe((focused) => {
855
+ if (!!focused !== this.focused) {
856
+ this.focused = !!focused;
857
+ this.stateChanges.next();
858
+ }
859
+ });
860
+ }
861
+ ngOnDestroy() {
862
+ this.stateChanges.complete();
863
+ this.focusMonitor.stopMonitoring(this.elementRef);
864
+ }
865
+ ngDoCheck() {
866
+ if (this.ngControl) {
867
+ const newErrorState = !!(this.ngControl.invalid && this.ngControl.touched);
868
+ if (newErrorState !== this.errorState) {
869
+ this.stateChanges.next();
870
+ }
871
+ }
872
+ }
873
+ ngOnChanges(changes) {
874
+ if (changes['options']) {
875
+ this.rebuildOptionMap();
876
+ this.updateInputLabelFromValue();
877
+ this.stateChanges.next();
878
+ }
879
+ if (changes['placeholder'] || changes['required'] || changes['disabled']) {
880
+ this.stateChanges.next();
881
+ }
882
+ }
883
+ filter(search) {
884
+ return this.options.filter((option) => this.filterFn(option[1], search));
885
+ }
886
+ createFilterFn() {
887
+ return (v1, v2) => {
888
+ return v1.toLowerCase().includes(v2.toLowerCase());
889
+ };
890
+ }
891
+ displayLabel = (value) => {
892
+ if (value === null || value === undefined)
893
+ return '';
894
+ if (!Array.isArray(this.options)) {
895
+ return '';
896
+ }
897
+ return this.optionMap.get(value) ?? '';
898
+ };
899
+ onOptionSelected(value) {
900
+ if (!value || this.readonly || this.disabled) {
901
+ return;
902
+ }
903
+ this.internalValue = value;
904
+ this.inputControl.setValue(value, { emitEvent: false });
905
+ this.onChange(value);
906
+ this.onTouched();
907
+ this.valueChange.emit(value);
908
+ }
909
+ onCreateClick() {
910
+ if (!this.lastSearchText ||
911
+ this.lastSearchText.trim() === '' ||
912
+ this.options.some((option) => option[1].toLowerCase() === this.lastSearchText.toLowerCase()) ||
913
+ this.options.some((option) => option[1].toLowerCase() === this.lastSearchText.toLowerCase())) {
914
+ return;
915
+ }
916
+ this.create.emit(this.lastSearchText);
917
+ }
918
+ updateInputLabelFromValue() {
919
+ if (this.internalValue !== null) {
920
+ const label = this.displayLabel(this.internalValue);
921
+ this.inputControl.setValue(label, { emitEvent: false });
922
+ }
923
+ }
924
+ // ControlValueAccessor
925
+ writeValue(value) {
926
+ this.internalValue = value;
927
+ this.updateInputLabelFromValue();
928
+ this.stateChanges.next();
929
+ }
930
+ registerOnChange(fn) {
931
+ this.onChange = fn;
932
+ }
933
+ registerOnTouched(fn) {
934
+ this.onTouched = fn;
935
+ }
936
+ setDisabledState(isDisabled) {
937
+ this._disabled = isDisabled;
938
+ isDisabled ? this.inputControl.disable() : this.inputControl.enable();
939
+ this.stateChanges.next();
940
+ }
941
+ // MatFormFieldControl methods
942
+ focus(options) {
943
+ this.elementRef.nativeElement.querySelector('input')?.focus(options);
944
+ }
945
+ onContainerClick() {
946
+ this.focus();
947
+ }
948
+ setDescribedByIds(ids) {
949
+ const input = this.elementRef.nativeElement.querySelector('input');
950
+ if (input) {
951
+ input.setAttribute('aria-describedby', ids.join(' '));
952
+ }
953
+ }
954
+ rebuildOptionMap() {
955
+ this.optionMap.clear();
956
+ for (const [value, label] of this.options ?? []) {
957
+ this.optionMap.set(value, label);
958
+ }
959
+ }
960
+ clearValue() {
961
+ this.internalValue = null;
962
+ this.onChange(null);
963
+ this.onTouched();
964
+ this.valueChange.emit(null);
965
+ }
966
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuAutocomplete, deps: [{ token: i1$3.FocusMonitor }, { token: i0.ElementRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
967
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: MatecuAutocomplete, isStandalone: true, selector: "matecu-autocomplete", inputs: { options: "options", allowCreate: "allowCreate", loading: "loading", readonly: "readonly", filterFn: "filterFn", searchChangeDebounceTime: "searchChangeDebounceTime", placeholder: "placeholder", required: "required", disabled: "disabled", value: "value" }, outputs: { searchChange: "searchChange", create: "create", valueChange: "valueChange" }, providers: [
968
+ {
969
+ provide: NG_VALUE_ACCESSOR,
970
+ useExisting: MatecuAutocomplete,
971
+ multi: true,
972
+ },
973
+ {
974
+ provide: MatFormFieldControl,
975
+ useExisting: MatecuAutocomplete,
976
+ },
977
+ ], usesOnChanges: true, ngImport: i0, template: "<input matInput type=\"text\" matInput [formControl]=\"inputControl\" [matAutocomplete]=\"auto\" [class.loading]=\"loading\"\n [disabled]=\"disabled\" [readonly]=\"readonly\" />\n\n\n<mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"onOptionSelected($event.option.value)\"\n [displayWith]=\"displayLabel\">\n\n @for (option of filteredOptions$ | async; track $index) {\n\n <mat-option [value]=\"option[0]\">\n {{ option[1] }}\n </mat-option>\n\n }\n\n <!-- Crear nuevo -->\n @if(allowCreate){\n\n <mat-divider></mat-divider>\n\n @if(showCreateOption ){\n <mat-option (click)=\"onCreateClick()\" class=\"create-option\">\n <span>\u2795</span><span>\" {{ inputControl.value }}\"</span>\n\n </mat-option>\n }\n }\n\n</mat-autocomplete>\n\n<!-- Spinner -->\n@if(loading){\n<mat-progress-spinner class=\"loading-spinner\" diameter=\"20\" mode=\"indeterminate\"\n style=\"position:absolute; right:10px; top:50%; transform:translateY(-50%);\">\n</mat-progress-spinner>\n}", styles: ["@charset \"UTF-8\";:host{display:block;position:relative;box-sizing:border-box;width:100%}:host input{border:none;background-color:transparent;outline:none}:host .create-option{display:flex;justify-content:space-between;align-items:center}:host .create-option:first-child{margin-right:auto;color:green}.loading-spinner{position:absolute;right:12px;top:50%;transform:translateY(-50%);pointer-events:none}input.loading{padding-right:40px}.create-option{font-style:italic;opacity:.85}::ng-deep .mat-mdc-option.create-option:hover{background:#0000000a}::ng-deep .mat-mdc-autocomplete-panel mat-divider{margin:4px 0}:host(.mat-mdc-input-disabled){opacity:.6;pointer-events:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i2$2.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: i2$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i2$2.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i3$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i5.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
978
+ }
979
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuAutocomplete, decorators: [{
980
+ type: Component,
981
+ args: [{ selector: 'matecu-autocomplete', standalone: true, imports: [
982
+ CommonModule,
983
+ MatAutocompleteModule,
984
+ MatDividerModule,
985
+ FormsModule,
986
+ ReactiveFormsModule,
987
+ MatProgressSpinnerModule,
988
+ ], providers: [
989
+ {
990
+ provide: NG_VALUE_ACCESSOR,
991
+ useExisting: MatecuAutocomplete,
992
+ multi: true,
993
+ },
994
+ {
995
+ provide: MatFormFieldControl,
996
+ useExisting: MatecuAutocomplete,
997
+ },
998
+ ], template: "<input matInput type=\"text\" matInput [formControl]=\"inputControl\" [matAutocomplete]=\"auto\" [class.loading]=\"loading\"\n [disabled]=\"disabled\" [readonly]=\"readonly\" />\n\n\n<mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"onOptionSelected($event.option.value)\"\n [displayWith]=\"displayLabel\">\n\n @for (option of filteredOptions$ | async; track $index) {\n\n <mat-option [value]=\"option[0]\">\n {{ option[1] }}\n </mat-option>\n\n }\n\n <!-- Crear nuevo -->\n @if(allowCreate){\n\n <mat-divider></mat-divider>\n\n @if(showCreateOption ){\n <mat-option (click)=\"onCreateClick()\" class=\"create-option\">\n <span>\u2795</span><span>\" {{ inputControl.value }}\"</span>\n\n </mat-option>\n }\n }\n\n</mat-autocomplete>\n\n<!-- Spinner -->\n@if(loading){\n<mat-progress-spinner class=\"loading-spinner\" diameter=\"20\" mode=\"indeterminate\"\n style=\"position:absolute; right:10px; top:50%; transform:translateY(-50%);\">\n</mat-progress-spinner>\n}", styles: ["@charset \"UTF-8\";:host{display:block;position:relative;box-sizing:border-box;width:100%}:host input{border:none;background-color:transparent;outline:none}:host .create-option{display:flex;justify-content:space-between;align-items:center}:host .create-option:first-child{margin-right:auto;color:green}.loading-spinner{position:absolute;right:12px;top:50%;transform:translateY(-50%);pointer-events:none}input.loading{padding-right:40px}.create-option{font-style:italic;opacity:.85}::ng-deep .mat-mdc-option.create-option:hover{background:#0000000a}::ng-deep .mat-mdc-autocomplete-panel mat-divider{margin:4px 0}:host(.mat-mdc-input-disabled){opacity:.6;pointer-events:none}\n"] }]
999
+ }], ctorParameters: () => [{ type: i1$3.FocusMonitor }, { type: i0.ElementRef }, { type: i0.Injector }], propDecorators: { options: [{
1000
+ type: Input
1001
+ }], allowCreate: [{
1002
+ type: Input
1003
+ }], loading: [{
1004
+ type: Input
1005
+ }], readonly: [{
1006
+ type: Input
1007
+ }], filterFn: [{
1008
+ type: Input
1009
+ }], searchChangeDebounceTime: [{
1010
+ type: Input
1011
+ }], placeholder: [{
1012
+ type: Input
1013
+ }], required: [{
1014
+ type: Input
1015
+ }], disabled: [{
1016
+ type: Input
1017
+ }], value: [{
1018
+ type: Input
1019
+ }], searchChange: [{
1020
+ type: Output
1021
+ }], create: [{
1022
+ type: Output
1023
+ }], valueChange: [{
1024
+ type: Output
1025
+ }] } });
1026
+
1027
+ class MatecuAutocompleteMultiple {
1028
+ static nextId = 0;
1029
+ // ================= INPUTS =================
1030
+ placeholder = '';
1031
+ loading = false;
1032
+ searchChangeDebounceTime = 300;
1033
+ enableSelectAll = true;
1034
+ readonly = false;
1035
+ selectAllLabel = 'Select All';
1036
+ clearAllLabel = 'Clear All';
1037
+ showTooltip = true;
1038
+ filterFn = this.createFilterFn();
1039
+ _options = signal([], ...(ngDevMode ? [{ debugName: "_options" }] : []));
1040
+ set options(value) {
1041
+ this._options.set(value ?? []);
1042
+ }
1043
+ get options() {
1044
+ return this._options();
1045
+ }
1046
+ // ================= OUTPUT =================
1047
+ searchChange = new EventEmitter();
1048
+ // ================= INTERNAL CONTROL =================
1049
+ control = new FormControl([], { nonNullable: true });
1050
+ controlValue$ = toSignal(this.control.valueChanges);
1051
+ searchControl = new FormControl('', { nonNullable: true });
1052
+ autocompleteTrigger;
1053
+ // ================= SIGNALS =================
1054
+ searchText = signal('', ...(ngDevMode ? [{ debugName: "searchText" }] : [])); // 🔥 AHORA SÍ existe correctamente
1055
+ filteredOptions = computed(() => {
1056
+ const filter = this.searchText();
1057
+ return this._options().filter((o) => this.filterFn(o[1], filter) && !this.control.value.includes(o[0]));
1058
+ }, ...(ngDevMode ? [{ debugName: "filteredOptions" }] : []));
1059
+ selectedItems = computed(() => {
1060
+ const values = this.controlValue$() ?? [];
1061
+ return values.map((v) => {
1062
+ const found = this._options().find((o) => o[0] === v);
1063
+ return {
1064
+ value: v,
1065
+ label: found ? found[1] : v,
1066
+ };
1067
+ });
1068
+ }, ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
1069
+ // ================= FORM FIELD CONTROL =================
1070
+ stateChanges = new Subject();
1071
+ focused = false;
1072
+ controlType = 'autocomplete-multiple';
1073
+ id = `autocomplete-multiple-${MatecuAutocompleteMultiple.nextId++}`;
1074
+ describedBy = '';
1075
+ disabled = false;
1076
+ required = false;
1077
+ errorState = false;
1078
+ injector;
1079
+ ngControl = null;
1080
+ get empty() {
1081
+ return this.control.value.length === 0;
1082
+ }
1083
+ get shouldLabelFloat() {
1084
+ return true;
1085
+ }
1086
+ // ================= CONSTRUCTOR =================
1087
+ constructor(injector) {
1088
+ this.injector = injector;
1089
+ // Debounce search
1090
+ let timeout;
1091
+ this.searchControl.valueChanges.pipe(takeUntilDestroyed()).subscribe((value) => {
1092
+ this.searchText.set(value ?? '');
1093
+ });
1094
+ this.control.valueChanges.pipe(takeUntilDestroyed()).subscribe((value) => {
1095
+ this.onChange(value);
1096
+ this.stateChanges.next();
1097
+ });
1098
+ effect(() => {
1099
+ const value = this.searchText();
1100
+ clearTimeout(timeout);
1101
+ timeout = setTimeout(() => {
1102
+ this.searchChange.emit(value);
1103
+ }, this.searchChangeDebounceTime);
1104
+ });
1105
+ }
1106
+ value = null;
1107
+ autofilled;
1108
+ userAriaDescribedBy;
1109
+ disableAutomaticLabeling;
1110
+ describedByIds;
1111
+ ngOnInit() {
1112
+ try {
1113
+ this.ngControl = this.injector.get(NgControl, null);
1114
+ }
1115
+ catch (error) {
1116
+ // Ignorar si no se puede obtener NgControl
1117
+ this.ngControl = null;
1118
+ }
1119
+ // Propagar cambios del FormControl interno
1120
+ }
1121
+ // ================= AUTOCOMPLETE =================
1122
+ selectOption(option) {
1123
+ if (this.readonly || this.disabled)
1124
+ return;
1125
+ if (!Array.isArray(option))
1126
+ return;
1127
+ if (!this.control.value.includes(option[0])) {
1128
+ this.control.setValue([...this.control.value, option[0]]);
1129
+ }
1130
+ // limpiar input correctamente
1131
+ this.searchControl.setValue('');
1132
+ this.searchText.set('');
1133
+ // cerrar panel
1134
+ this.autocompleteTrigger.closePanel();
1135
+ }
1136
+ displayLabel(option) {
1137
+ return Array.isArray(option) ? option[1] : '';
1138
+ }
1139
+ // ================= CHIP ACTIONS =================
1140
+ remove(value) {
1141
+ if (this.readonly || this.disabled)
1142
+ return;
1143
+ this.control.setValue(this.control.value.filter((v) => v !== value));
1144
+ }
1145
+ selectAll() {
1146
+ if (this.readonly || this.disabled)
1147
+ return;
1148
+ const allValues = this._options().map((o) => o[0]);
1149
+ this.control.setValue([...new Set([...this.control.value, ...allValues])]);
1150
+ this.searchControl.setValue('');
1151
+ this.searchText.set('');
1152
+ this.autocompleteTrigger.closePanel();
1153
+ }
1154
+ clearAll() {
1155
+ if (this.disabled || this.readonly)
1156
+ return;
1157
+ if (this.control.value.length === 0)
1158
+ return;
1159
+ this.control.setValue([]);
1160
+ this.searchControl.setValue('');
1161
+ this.searchText.set('');
1162
+ this.autocompleteTrigger?.closePanel();
1163
+ }
1164
+ // ================= DRAG & DROP =================
1165
+ drop(event) {
1166
+ if (this.disabled || this.readonly)
1167
+ return;
1168
+ const current = [...this.control.value];
1169
+ moveItemInArray(current, event.previousIndex, event.currentIndex);
1170
+ this.control.setValue(current);
1171
+ }
1172
+ // ================= KEYBOARD =================
1173
+ onKeyDown(event) {
1174
+ if (this.readonly || this.disabled)
1175
+ return;
1176
+ if (event.key === 'Backspace' && !this.searchText() && this.control.value.length > 0) {
1177
+ const updated = [...this.control.value];
1178
+ updated.pop();
1179
+ this.control.setValue(updated);
1180
+ }
1181
+ }
1182
+ // ================= CVA =================
1183
+ onChange = () => { };
1184
+ onTouched = () => { };
1185
+ writeValue(value) {
1186
+ this.control.setValue(value ?? [], { emitEvent: false });
1187
+ }
1188
+ registerOnChange(fn) {
1189
+ this.onChange = fn;
1190
+ }
1191
+ registerOnTouched(fn) {
1192
+ this.onTouched = fn;
1193
+ }
1194
+ setDisabledState(isDisabled) {
1195
+ this.disabled = isDisabled;
1196
+ isDisabled
1197
+ ? this.control.disable({ emitEvent: false })
1198
+ : this.control.enable({ emitEvent: false });
1199
+ this.stateChanges.next();
1200
+ }
1201
+ setDescribedByIds(ids) {
1202
+ this.describedBy = ids.join(' ');
1203
+ }
1204
+ onContainerClick() { }
1205
+ ngOnDestroy() {
1206
+ this.stateChanges.complete();
1207
+ }
1208
+ trackByValue = (_, item) => item[0];
1209
+ openPanel() {
1210
+ this.autocompleteTrigger.openPanel();
1211
+ setTimeout(() => this.autocompleteTrigger.updatePosition());
1212
+ }
1213
+ createFilterFn() {
1214
+ return (v1, v2) => {
1215
+ return v1.toLowerCase().includes(v2.toLowerCase());
1216
+ };
1217
+ }
1218
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuAutocompleteMultiple, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
1219
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: MatecuAutocompleteMultiple, isStandalone: true, selector: "matecu-autocomplete-multiple", inputs: { placeholder: "placeholder", loading: "loading", searchChangeDebounceTime: "searchChangeDebounceTime", enableSelectAll: "enableSelectAll", readonly: "readonly", selectAllLabel: "selectAllLabel", clearAllLabel: "clearAllLabel", showTooltip: "showTooltip", filterFn: "filterFn", options: "options" }, outputs: { searchChange: "searchChange" }, providers: [
1220
+ {
1221
+ provide: NG_VALUE_ACCESSOR,
1222
+ useExisting: forwardRef(() => MatecuAutocompleteMultiple),
1223
+ multi: true,
1224
+ },
1225
+ {
1226
+ provide: MatFormFieldControl,
1227
+ useExisting: MatecuAutocompleteMultiple,
1228
+ },
1229
+ ], viewQueries: [{ propertyName: "autocompleteTrigger", first: true, predicate: MatAutocompleteTrigger, descendants: true }], ngImport: i0, template: "@if (loading) {\n\n<mat-progress-spinner matSuffix diameter=\"20\" mode=\"indeterminate\">\n</mat-progress-spinner>\n}\n<mat-chip-grid #chipGrid class=\"chip-list\">\n\n @for (item of selectedItems(); track item.value) {\n\n <mat-chip-row [removable]=\"!disabled && !readonly\" (removed)=\"remove(item.value)\"\n [matTooltip]=\"showTooltip ? item.label : ''\" matTooltipPosition=\"above\">\n\n\n\n {{ item.label }}\n @if (!disabled && !readonly) {\n\n <button matChipRemove aria-label=\"Remove {{item.label}}\">\n <mat-icon>cancel</mat-icon>\n </button>\n }\n\n </mat-chip-row>\n }\n\n <input type=\"text\" matInput [formControl]=\"searchControl\" [matAutocomplete]=\"auto\" (keydown)=\"onKeyDown($event)\"\n [placeholder]=\"placeholder\" />\n\n</mat-chip-grid>\n\n\n<mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"selectOption($event.option.value)\"\n class=\"autocomplete-large-panel\" [displayWith]=\"displayLabel\">\n\n @if (!readonly && !disabled && (enableSelectAll || control.value.length > 0)) {\n <mat-option>\n <div style=\"display: flex; gap: 10px; align-items: center; justify-content: center; \">\n\n @if (enableSelectAll) {\n <div>\n <button mat-icon-button (click)=\"selectAll()\" [matTooltip]=\"selectAllLabel\">\n <mat-icon>select_all</mat-icon>\n </button>\n </div>\n\n }\n @if (control.value.length > 0) {\n <div>\n\n <button mat-icon-button (click)=\"clearAll()\" [matTooltip]=\"clearAllLabel\">\n <mat-icon>clear_all</mat-icon>\n </button>\n </div>\n }\n </div>\n </mat-option>\n }\n\n @for (option of filteredOptions(); track $index) {\n <mat-option [value]=\"option\">\n {{ option[1] }}\n </mat-option>\n }\n</mat-autocomplete>", styles: [":host{display:inline-block;position:relative;width:100%}:host input{outline:none;border:none;background-color:transparent;width:100%}:host .clear-all-box{width:100%;display:flex;justify-content:flex-end;align-items:center}:host mat-option span{display:block}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i2$3.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i2$3.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i2$3.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i5.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i2$2.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: i2$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i2$2.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i7.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] });
1230
+ }
1231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuAutocompleteMultiple, decorators: [{
1232
+ type: Component,
1233
+ args: [{ selector: 'matecu-autocomplete-multiple', standalone: true, imports: [
1234
+ ReactiveFormsModule,
1235
+ MatChipsModule,
1236
+ DragDropModule,
1237
+ MatIconModule,
1238
+ MatProgressSpinnerModule,
1239
+ MatAutocompleteModule,
1240
+ ScrollingModule,
1241
+ MatButtonModule,
1242
+ MatTooltipModule,
1243
+ ], providers: [
1244
+ {
1245
+ provide: NG_VALUE_ACCESSOR,
1246
+ useExisting: forwardRef(() => MatecuAutocompleteMultiple),
1247
+ multi: true,
1248
+ },
1249
+ {
1250
+ provide: MatFormFieldControl,
1251
+ useExisting: MatecuAutocompleteMultiple,
1252
+ },
1253
+ ], template: "@if (loading) {\n\n<mat-progress-spinner matSuffix diameter=\"20\" mode=\"indeterminate\">\n</mat-progress-spinner>\n}\n<mat-chip-grid #chipGrid class=\"chip-list\">\n\n @for (item of selectedItems(); track item.value) {\n\n <mat-chip-row [removable]=\"!disabled && !readonly\" (removed)=\"remove(item.value)\"\n [matTooltip]=\"showTooltip ? item.label : ''\" matTooltipPosition=\"above\">\n\n\n\n {{ item.label }}\n @if (!disabled && !readonly) {\n\n <button matChipRemove aria-label=\"Remove {{item.label}}\">\n <mat-icon>cancel</mat-icon>\n </button>\n }\n\n </mat-chip-row>\n }\n\n <input type=\"text\" matInput [formControl]=\"searchControl\" [matAutocomplete]=\"auto\" (keydown)=\"onKeyDown($event)\"\n [placeholder]=\"placeholder\" />\n\n</mat-chip-grid>\n\n\n<mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"selectOption($event.option.value)\"\n class=\"autocomplete-large-panel\" [displayWith]=\"displayLabel\">\n\n @if (!readonly && !disabled && (enableSelectAll || control.value.length > 0)) {\n <mat-option>\n <div style=\"display: flex; gap: 10px; align-items: center; justify-content: center; \">\n\n @if (enableSelectAll) {\n <div>\n <button mat-icon-button (click)=\"selectAll()\" [matTooltip]=\"selectAllLabel\">\n <mat-icon>select_all</mat-icon>\n </button>\n </div>\n\n }\n @if (control.value.length > 0) {\n <div>\n\n <button mat-icon-button (click)=\"clearAll()\" [matTooltip]=\"clearAllLabel\">\n <mat-icon>clear_all</mat-icon>\n </button>\n </div>\n }\n </div>\n </mat-option>\n }\n\n @for (option of filteredOptions(); track $index) {\n <mat-option [value]=\"option\">\n {{ option[1] }}\n </mat-option>\n }\n</mat-autocomplete>", styles: [":host{display:inline-block;position:relative;width:100%}:host input{outline:none;border:none;background-color:transparent;width:100%}:host .clear-all-box{width:100%;display:flex;justify-content:flex-end;align-items:center}:host mat-option span{display:block}\n"] }]
1254
+ }], ctorParameters: () => [{ type: i0.Injector }], propDecorators: { placeholder: [{
1255
+ type: Input
1256
+ }], loading: [{
1257
+ type: Input
1258
+ }], searchChangeDebounceTime: [{
1259
+ type: Input
1260
+ }], enableSelectAll: [{
1261
+ type: Input
1262
+ }], readonly: [{
1263
+ type: Input
1264
+ }], selectAllLabel: [{
1265
+ type: Input
1266
+ }], clearAllLabel: [{
1267
+ type: Input
1268
+ }], showTooltip: [{
1269
+ type: Input
1270
+ }], filterFn: [{
1271
+ type: Input
1272
+ }], options: [{
1273
+ type: Input,
1274
+ args: [{ required: true }]
1275
+ }], searchChange: [{
1276
+ type: Output
1277
+ }], autocompleteTrigger: [{
1278
+ type: ViewChild,
1279
+ args: [MatAutocompleteTrigger]
1280
+ }] } });
1281
+
1282
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1283
+ var FileInputState;
1284
+ (function (FileInputState) {
1285
+ FileInputState["IDLE"] = "idle";
1286
+ FileInputState["LOADING"] = "loading";
1287
+ FileInputState["SUCCESS"] = "success";
1288
+ FileInputState["ERROR"] = "error";
1289
+ })(FileInputState || (FileInputState = {}));
1290
+ class MatecuFileInput {
1291
+ fileInput;
1292
+ // State
1293
+ files = [];
1294
+ file;
1295
+ isDisabled = false;
1296
+ fileName;
1297
+ selectedFileSize;
1298
+ hasInvalidSize = false;
1299
+ hasInvalidType = false;
1300
+ previewUrl;
1301
+ previewUrls = new Map(); // Para múltiples archivos
1302
+ currentState = FileInputState.IDLE;
1303
+ validationErrors = [];
1304
+ isDragOver = false;
1305
+ onChange;
1306
+ onTouched;
1307
+ // Inputs - Funcionalidad básica
1308
+ optimizeImage;
1309
+ optimizeImageToSize;
1310
+ maxFileSize; // tamaño máximo en bytes
1311
+ maxFiles = 1;
1312
+ multiple = false;
1313
+ showFileSize = false;
1314
+ fileSizeUnit = 'AUTO';
1315
+ displayName;
1316
+ placeholder = 'Select a file or drag here';
1317
+ buttonText = 'Select file';
1318
+ changeSelectedFileText = 'Change selected file(s)';
1319
+ loadingText = 'Processing...';
1320
+ ariaLabel;
1321
+ // Inputs - Validación
1322
+ acceptedMimeTypes = [];
1323
+ acceptedExtensions = [];
1324
+ errorMessages = {
1325
+ invalidSize: 'File exceeds maximum allowed size',
1326
+ invalidType: 'File type not allowed',
1327
+ tooManyFiles: 'Maximum number of files exceeded',
1328
+ uploadError: 'Error processing file',
1329
+ };
1330
+ // Inputs - UI/UX
1331
+ enableDragDrop = true;
1332
+ showPreview = false;
1333
+ previewMaxWidth = 200;
1334
+ previewMaxHeight = 200;
1335
+ showProgress = false;
1336
+ // Outputs
1337
+ fileSelected = new EventEmitter();
1338
+ filesSelected = new EventEmitter();
1339
+ fileRemoved = new EventEmitter();
1340
+ validationError = new EventEmitter();
1341
+ dragEnter = new EventEmitter();
1342
+ dragLeave = new EventEmitter();
1343
+ stateChange = new EventEmitter();
1344
+ // ControlValueAccessor Methods
1345
+ writeValue(value) {
1346
+ if (value instanceof File) {
1347
+ this.handleSingleFile(value);
1348
+ }
1349
+ else if (Array.isArray(value)) {
1350
+ this.handleMultipleFiles(value);
1351
+ }
1352
+ else if (typeof value === 'string') {
1353
+ this.fileName = value;
1354
+ }
1355
+ else {
1356
+ this.resetComponent();
1357
+ }
1358
+ }
1359
+ registerOnChange(fn) {
1360
+ this.onChange = fn;
1361
+ }
1362
+ registerOnTouched(fn) {
1363
+ this.onTouched = fn;
1364
+ }
1365
+ setDisabledState(isDisabled) {
1366
+ this.isDisabled = isDisabled;
1367
+ this.changeState(this.isDisabled ? FileInputState.IDLE : this.currentState);
1368
+ }
1369
+ ngOnDestroy() {
1370
+ this.cleanupPreview();
1371
+ }
1372
+ // Event Handlers
1373
+ onFileChange(event) {
1374
+ const input = event.target;
1375
+ const selectedFiles = Array.from(input.files || []);
1376
+ this.handleFileSelection(selectedFiles);
1377
+ }
1378
+ onDragOver(event) {
1379
+ if (!this.enableDragDrop || this.isDisabled)
1380
+ return;
1381
+ event.preventDefault();
1382
+ event.stopPropagation();
1383
+ if (!this.isDragOver) {
1384
+ this.isDragOver = true;
1385
+ this.dragEnter.emit(event);
1386
+ }
1387
+ }
1388
+ onDragLeave(event) {
1389
+ if (!this.enableDragDrop || this.isDisabled)
1390
+ return;
1391
+ event.preventDefault();
1392
+ event.stopPropagation();
1393
+ this.isDragOver = false;
1394
+ this.dragLeave.emit(event);
1395
+ }
1396
+ onDrop(event) {
1397
+ if (!this.enableDragDrop || this.isDisabled)
1398
+ return;
1399
+ event.preventDefault();
1400
+ event.stopPropagation();
1401
+ this.isDragOver = false;
1402
+ const files = Array.from(event.dataTransfer?.files || []);
1403
+ this.handleFileSelection(files);
1404
+ }
1405
+ openFileDialog() {
1406
+ if (this.isDisabled)
1407
+ return;
1408
+ this.fileInput?.nativeElement.click();
1409
+ }
1410
+ removeFile(fileToRemove) {
1411
+ // Limpiar preview del archivo eliminado
1412
+ const fileKey = `${fileToRemove.name}-${fileToRemove.size}-${fileToRemove.lastModified}`;
1413
+ const previewUrl = this.previewUrls.get(fileKey);
1414
+ if (previewUrl && previewUrl.startsWith('blob:')) {
1415
+ URL.revokeObjectURL(previewUrl);
1416
+ this.previewUrls.delete(fileKey);
1417
+ }
1418
+ if (this.multiple) {
1419
+ this.files = this.files.filter((file) => file !== fileToRemove);
1420
+ this.notifyChange(this.files.length > 0 ? this.files : null);
1421
+ this.filesSelected.emit([...this.files]);
1422
+ }
1423
+ else {
1424
+ this.resetComponent();
1425
+ this.notifyChange(null);
1426
+ }
1427
+ this.fileRemoved.emit(fileToRemove);
1428
+ }
1429
+ // Private Methods
1430
+ async handleFileSelection(selectedFiles) {
1431
+ if (selectedFiles.length === 0)
1432
+ return;
1433
+ this.changeState(FileInputState.LOADING);
1434
+ this.validationErrors = [];
1435
+ try {
1436
+ // Validar número máximo de archivos
1437
+ if (selectedFiles.length > this.maxFiles) {
1438
+ this.validationErrors.push(this.errorMessages.tooManyFiles);
1439
+ this.changeState(FileInputState.ERROR);
1440
+ return;
1441
+ }
1442
+ const processedFiles = [];
1443
+ for (const file of selectedFiles) {
1444
+ const validation = this.validateFile(file);
1445
+ if (!validation.isValid) {
1446
+ this.validationErrors.push(...validation.errors);
1447
+ continue;
1448
+ }
1449
+ try {
1450
+ const processedFile = await this.processFile(file);
1451
+ if (processedFile) {
1452
+ processedFiles.push(processedFile);
1453
+ }
1454
+ }
1455
+ catch (error) {
1456
+ this.validationErrors.push(this.errorMessages.uploadError);
1457
+ }
1458
+ }
1459
+ if (this.validationErrors.length > 0) {
1460
+ this.validationError.emit([...this.validationErrors]);
1461
+ this.changeState(FileInputState.ERROR);
1462
+ return;
1463
+ }
1464
+ if (processedFiles.length > 0) {
1465
+ if (this.multiple) {
1466
+ this.files = processedFiles;
1467
+ this.filesSelected.emit([...this.files]);
1468
+ this.notifyChange(this.files);
1469
+ }
1470
+ else {
1471
+ this.file = processedFiles[0];
1472
+ this.handleSingleFile(this.file);
1473
+ this.fileSelected.emit(this.file);
1474
+ this.notifyChange(this.file);
1475
+ }
1476
+ this.changeState(FileInputState.SUCCESS);
1477
+ }
1478
+ }
1479
+ catch (error) {
1480
+ this.validationErrors.push(this.errorMessages.uploadError);
1481
+ this.validationError.emit([...this.validationErrors]);
1482
+ this.changeState(FileInputState.ERROR);
1483
+ }
1484
+ }
1485
+ handleSingleFile(file) {
1486
+ this.file = file;
1487
+ this.fileName = this.displayName || file.name;
1488
+ this.selectedFileSize = this.calculateFileSizeInMB(file);
1489
+ this.generatePreview(file);
1490
+ }
1491
+ handleMultipleFiles(files) {
1492
+ this.files = files;
1493
+ this.file = files[0] || undefined;
1494
+ this.fileName = files.length > 0 ? `${files.length} file(s) selected` : undefined;
1495
+ }
1496
+ async processFile(file) {
1497
+ if (this.optimizeImage && file.type.includes('image') && this.optimizeImageToSize) {
1498
+ try {
1499
+ return await this.optimizeImage(file);
1500
+ }
1501
+ catch (error) {
1502
+ console.warn('Error optimizing image:', error);
1503
+ return file; // Return original if optimization fails
1504
+ }
1505
+ }
1506
+ return file;
1507
+ }
1508
+ validateFile(file) {
1509
+ const errors = [];
1510
+ // Validar tamaño
1511
+ if (this.maxFileSize && file.size > this.maxFileSize) {
1512
+ errors.push(this.errorMessages.invalidSize);
1513
+ }
1514
+ // Validar tipo MIME
1515
+ if (this.acceptedMimeTypes.length > 0) {
1516
+ if (!this.acceptedMimeTypes.some((type) => file.type.includes(type))) {
1517
+ errors.push(this.errorMessages.invalidType);
1518
+ }
1519
+ }
1520
+ // Validar extensión
1521
+ if (this.acceptedExtensions.length > 0) {
1522
+ const fileExtension = '.' + file.name.split('.').pop()?.toLowerCase();
1523
+ if (!this.acceptedExtensions.some((ext) => ext.toLowerCase() === fileExtension)) {
1524
+ errors.push(this.errorMessages.invalidType);
1525
+ }
1526
+ }
1527
+ return {
1528
+ isValid: errors.length === 0,
1529
+ errors,
1530
+ };
1531
+ }
1532
+ generatePreview(file) {
1533
+ this.cleanupPreview();
1534
+ if (this.showPreview && file.type.startsWith('image/')) {
1535
+ const reader = new FileReader();
1536
+ reader.onload = (e) => {
1537
+ this.previewUrl = e.target?.result;
1538
+ };
1539
+ reader.readAsDataURL(file);
1540
+ }
1541
+ }
1542
+ cleanupPreview() {
1543
+ // Limpiar preview simple
1544
+ if (this.previewUrl && this.previewUrl.startsWith('blob:')) {
1545
+ URL.revokeObjectURL(this.previewUrl);
1546
+ }
1547
+ this.previewUrl = undefined;
1548
+ // Limpiar previews múltiples
1549
+ this.previewUrls.forEach((url) => {
1550
+ if (url.startsWith('blob:')) {
1551
+ URL.revokeObjectURL(url);
1552
+ }
1553
+ });
1554
+ this.previewUrls.clear();
1555
+ }
1556
+ resetComponent() {
1557
+ this.files = [];
1558
+ this.file = undefined;
1559
+ this.fileName = undefined;
1560
+ this.selectedFileSize = undefined;
1561
+ this.validationErrors = [];
1562
+ this.hasInvalidSize = false;
1563
+ this.hasInvalidType = false;
1564
+ this.cleanupPreview();
1565
+ this.changeState(FileInputState.IDLE);
1566
+ }
1567
+ notifyChange(value) {
1568
+ if (this.onChange) {
1569
+ this.onChange(value);
1570
+ }
1571
+ if (this.onTouched) {
1572
+ this.onTouched();
1573
+ }
1574
+ }
1575
+ changeState(newState) {
1576
+ if (this.currentState !== newState) {
1577
+ this.currentState = newState;
1578
+ this.stateChange.emit(newState);
1579
+ }
1580
+ }
1581
+ calculateFileSizeInMB(file) {
1582
+ const sizeInMB = file.size / 1024 / 1024;
1583
+ return sizeInMB > 0.01 ? sizeInMB : 0.01;
1584
+ }
1585
+ formatFileSize(file) {
1586
+ const bytes = file.size;
1587
+ if (bytes === 0)
1588
+ return '0 bytes';
1589
+ const k = 1024;
1590
+ const sizes = ['bytes', 'KB', 'MB', 'GB', 'TB'];
1591
+ // Si se especifica una unidad específica, usarla
1592
+ if (this.fileSizeUnit !== 'AUTO') {
1593
+ const targetUnitIndex = sizes.indexOf(this.fileSizeUnit);
1594
+ if (targetUnitIndex !== -1) {
1595
+ const size = bytes / Math.pow(k, targetUnitIndex);
1596
+ const formattedSize = targetUnitIndex === 0 ? size.toString() : size.toFixed(2);
1597
+ return `${formattedSize} ${this.fileSizeUnit}`;
1598
+ }
1599
+ }
1600
+ // Comportamiento AUTO (original)
1601
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
1602
+ const size = bytes / Math.pow(k, i);
1603
+ const formattedSize = i === 0 ? size.toString() : size.toFixed(2);
1604
+ return `${formattedSize} ${sizes[i]}`;
1605
+ }
1606
+ // Public Utility Methods
1607
+ getFileIcon(file) {
1608
+ if (!file)
1609
+ return 'insert_drive_file';
1610
+ if (file.type.startsWith('image/'))
1611
+ return '🖼️';
1612
+ if (file.type.includes('pdf'))
1613
+ return '📄';
1614
+ if (file.type.startsWith('video/'))
1615
+ return '🎥';
1616
+ if (file.type.startsWith('audio/'))
1617
+ return '🎵';
1618
+ if (file.type.includes('zip') || file.type.includes('rar'))
1619
+ return '🗜️';
1620
+ if (file.type.includes('word'))
1621
+ return '📝';
1622
+ if (file.type.includes('excel') || file.type.includes('sheet'))
1623
+ return '📊';
1624
+ return '📄';
1625
+ }
1626
+ getPreviewUrl(file) {
1627
+ if (!file.type.startsWith('image/'))
1628
+ return '';
1629
+ const fileKey = `${file.name}-${file.size}-${file.lastModified}`;
1630
+ if (!this.previewUrls.has(fileKey)) {
1631
+ const url = URL.createObjectURL(file);
1632
+ this.previewUrls.set(fileKey, url);
1633
+ }
1634
+ return this.previewUrls.get(fileKey) || '';
1635
+ }
1636
+ get hasErrors() {
1637
+ return this.validationErrors.length > 0 || this.currentState === FileInputState.ERROR;
1638
+ }
1639
+ get isLoading() {
1640
+ return this.currentState === FileInputState.LOADING;
1641
+ }
1642
+ get hasFiles() {
1643
+ return this.multiple ? this.files.length > 0 : !!this.file;
1644
+ }
1645
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuFileInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
1646
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: MatecuFileInput, isStandalone: true, selector: "matecu-file-input", inputs: { optimizeImage: "optimizeImage", optimizeImageToSize: "optimizeImageToSize", maxFileSize: "maxFileSize", maxFiles: "maxFiles", multiple: "multiple", showFileSize: "showFileSize", fileSizeUnit: "fileSizeUnit", displayName: "displayName", placeholder: "placeholder", buttonText: "buttonText", changeSelectedFileText: "changeSelectedFileText", loadingText: "loadingText", ariaLabel: "ariaLabel", acceptedMimeTypes: "acceptedMimeTypes", acceptedExtensions: "acceptedExtensions", errorMessages: "errorMessages", enableDragDrop: "enableDragDrop", showPreview: "showPreview", previewMaxWidth: "previewMaxWidth", previewMaxHeight: "previewMaxHeight", showProgress: "showProgress" }, outputs: { fileSelected: "fileSelected", filesSelected: "filesSelected", fileRemoved: "fileRemoved", validationError: "validationError", dragEnter: "dragEnter", dragLeave: "dragLeave", stateChange: "stateChange" }, providers: [
1647
+ {
1648
+ provide: NG_VALUE_ACCESSOR,
1649
+ multi: true,
1650
+ useExisting: MatecuFileInput,
1651
+ },
1652
+ ], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }], ngImport: i0, template: "<!-- Hidden file input -->\n<input type=\"file\" #fileInput (change)=\"onFileChange($event)\" [multiple]=\"multiple\" [disabled]=\"isDisabled\"\n [attr.aria-label]=\"ariaLabel || 'Select file'\" [attr.aria-describedby]=\"hasErrors ? 'file-input-errors' : null\"\n [accept]=\"acceptedMimeTypes.join(',')\" />\n\n<!-- Main drop zone and file display -->\n<div class=\"file-input-container\" [class.drag-over]=\"isDragOver\" [class.disabled]=\"isDisabled\"\n [class.has-files]=\"hasFiles\" [class.has-errors]=\"hasErrors\" [class.loading]=\"isLoading\"\n (dragover)=\"onDragOver($event)\" (dragleave)=\"onDragLeave($event)\" (drop)=\"onDrop($event)\"\n (click)=\"openFileDialog()\">\n <!-- Loading state -->\n @if (isLoading) {\n <div class=\"loading-container\">\n <div class=\"spinner\"></div>\n <span class=\"loading-text\">{{ loadingText }}</span>\n </div>\n }\n\n <!-- Empty state / Drop zone -->\n @if (!hasFiles && !isLoading) {\n <div class=\"drop-zone\">\n <div class=\"drop-zone-icon\">\n \uD83D\uDCC1\n </div>\n <div class=\"drop-zone-content\">\n <p class=\"drop-zone-title\">{{ placeholder }}</p>\n <button type=\"button\" class=\"select-button\" [disabled]=\"isDisabled\"\n (click)=\"openFileDialog(); $event.stopPropagation()\">\n {{ buttonText }}\n </button>\n @if (enableDragDrop && !isDisabled) {\n }\n </div>\n </div>\n }\n\n <!-- Single file display -->\n @if (!multiple && file && !isLoading) {\n <div class=\"single-file-display\">\n <div class=\"file-info\">\n <!-- File preview -->\n @if (showPreview && file.type.startsWith('image/')) {\n <div class=\"file-preview\">\n <img [src]=\"getPreviewUrl(file)\" [alt]=\"file.name\" [style.max-width.px]=\"previewMaxWidth\"\n [style.max-height.px]=\"previewMaxHeight\" />\n </div>\n } @else {\n <div class=\"file-icon\">\n {{ getFileIcon(file) }}\n </div>\n }\n\n <div class=\"file-details\">\n <h3 class=\"file-name\">{{ displayName || file.name }}</h3>\n @if (showFileSize && selectedFileSize) {\n <p class=\"file-size\">\n {{ formatFileSize(file) }}\n </p>\n }\n <p class=\"file-type\">{{ file.type || 'Unknown type' }}</p>\n </div>\n </div>\n\n <button type=\"button\" class=\"remove-file-button\" (click)=\"removeFile(file); $event.stopPropagation()\"\n [attr.aria-label]=\"'Remove ' + file.name\">\n \u2715\n </button>\n </div>\n }\n\n <!-- Multiple files display -->\n @if (multiple && files.length > 0 && !isLoading) {\n <div class=\"multiple-files-display\">\n <div class=\"files-header\">\n @if (maxFiles > 1) {\n <span class=\"files-counter\">{{ files.length }} / {{ maxFiles }}</span>\n }\n </div>\n\n <div class=\"files-list\">\n @for (file of files; track file.name + file.size; let i = $index) {\n <div class=\"file-item\">\n <!-- File preview -->\n @if (showPreview && file.type.startsWith('image/')) {\n <div class=\"file-preview-small\">\n <img [src]=\"getPreviewUrl(file)\" [alt]=\"file.name\" />\n </div>\n } @else {\n <div class=\"file-icon-small\">\n {{ getFileIcon(file) }}\n </div>\n }\n\n <div class=\"file-item-details\">\n <div class=\"file-item-name\">{{ file.name }}</div>\n @if (showFileSize) {\n <div class=\"file-item-size\">\n {{ formatFileSize(file) }}\n </div>\n }\n </div>\n\n <button type=\"button\" class=\"remove-file-button-small\"\n (click)=\"removeFile(file); $event.stopPropagation()\" [attr.aria-label]=\"'Remove ' + file.name\">\n \u2715\n </button>\n </div>\n }\n </div>\n\n <!-- Add more files button -->\n @if (files.length < maxFiles) { <button type=\"button\" class=\"add-more-button\"\n (click)=\"openFileDialog(); $event.stopPropagation()\">\n {{ changeSelectedFileText }}\n </button>\n }\n </div>\n }\n</div>\n\n<!-- Error messages -->\n@if (hasErrors) {\n<div id=\"file-input-errors\" class=\"error-messages\" role=\"alert\">\n @for (error of validationErrors; track error) {\n <div class=\"error-message\">{{ error }}</div>\n }\n</div>\n}", styles: [":host{display:block;width:100%}:host>*{box-sizing:border-box}:host{--matecu-file-input-color-primary: #4f46e5;--matecu-file-input-color-primary-hover: #4338ca;--matecu-file-input-color-success: #10b981;--matecu-file-input-color-error: #ef4444;--matecu-file-input-color-error-hover: #dc2626;--matecu-file-input-color-loading: #8b5cf6;--matecu-file-input-color-disabled: #9ca3af;--matecu-file-input-border-default: #e1e5e9;--matecu-file-input-border-hover: var(--matecu-file-input-color-primary);--matecu-file-input-border-success: var(--matecu-file-input-color-success);--matecu-file-input-border-error: var(--matecu-file-input-color-error);--matecu-file-input-border-loading: var(--matecu-file-input-color-loading);--matecu-file-input-border-separator: #e5e7eb;--matecu-file-input-bg-default: #fafbfc;--matecu-file-input-bg-hover: #f8faff;--matecu-file-input-bg-drag-over: #eef2ff;--matecu-file-input-bg-disabled: #f5f5f5;--matecu-file-input-bg-success: #f0fdf4;--matecu-file-input-bg-error: #fef2f2;--matecu-file-input-bg-loading: #faf5ff;--matecu-file-input-bg-surface: #ffffff;--matecu-file-input-bg-surface-alt: #f3f4f6;--matecu-file-input-text-primary: #111827;--matecu-file-input-text-secondary: #374151;--matecu-file-input-text-muted: #6b7280;--matecu-file-input-text-disabled: #9ca3af;--matecu-file-input-text-on-primary: #ffffff;--matecu-file-input-text-error: #dc2626;--matecu-file-input-button-primary-bg: var(--matecu-file-input-color-primary);--matecu-file-input-button-primary-bg-hover: var(--matecu-file-input-color-primary-hover);--matecu-file-input-button-primary-text: var(--matecu-file-input-text-on-primary);--matecu-file-input-button-danger-bg: var(--matecu-file-input-color-error);--matecu-file-input-button-danger-bg-hover: var(--matecu-file-input-color-error-hover);--matecu-file-input-button-danger-text: var(--matecu-file-input-text-on-primary);--matecu-file-input-button-disabled-bg: var(--matecu-file-input-color-disabled);--matecu-file-input-spinner-track: #e5e7eb;--matecu-file-input-spinner-fill: var(--matecu-file-input-color-loading);--matecu-file-input-shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);--matecu-file-input-shadow-md: 0 1px 3px rgba(0, 0, 0, .1);--matecu-file-input-border-radius-sm: 4px;--matecu-file-input-border-radius-md: 6px;--matecu-file-input-border-radius-lg: 8px;--matecu-file-input-border-radius-xl: 12px;--matecu-file-input-border-width: 2px}:host input[type=file]{display:none}.file-input-container{position:relative;border:var(--matecu-file-input-border-width) dashed var(--matecu-file-input-border-default);border-radius:var(--matecu-file-input-border-radius-lg);padding:24px;transition:all .3s ease;background-color:var(--matecu-file-input-bg-default);cursor:pointer;min-height:120px;display:flex;align-items:center;justify-content:center}.file-input-container:hover:not(.disabled){border-color:var(--matecu-file-input-border-hover);background-color:var(--matecu-file-input-bg-hover)}.file-input-container.drag-over{border-color:var(--matecu-file-input-border-hover);background-color:var(--matecu-file-input-bg-drag-over);transform:scale(1.02)}.file-input-container.disabled{opacity:.6;cursor:not-allowed;background-color:var(--matecu-file-input-bg-disabled)}.file-input-container.has-files{border-style:solid;border-color:var(--matecu-file-input-border-success);background-color:var(--matecu-file-input-bg-success)}.file-input-container.has-errors{border-color:var(--matecu-file-input-border-error);background-color:var(--matecu-file-input-bg-error)}.file-input-container.loading{border-color:var(--matecu-file-input-border-loading);background-color:var(--matecu-file-input-bg-loading)}.loading-container{display:flex;flex-direction:column;align-items:center;gap:12px;color:var(--matecu-file-input-text-muted)}.loading-container .spinner{width:32px;height:32px;border:3px solid var(--matecu-file-input-spinner-track);border-top:3px solid var(--matecu-file-input-spinner-fill);border-radius:50%;animation:spin 1s linear infinite}.loading-container .loading-text{font-size:14px;font-weight:500}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.drop-zone{text-align:center;width:100%}.drop-zone .drop-zone-icon{font-size:48px;margin-bottom:16px}.drop-zone .drop-zone-content .drop-zone-title{font-size:16px;font-weight:600;color:var(--matecu-file-input-text-secondary);margin-bottom:12px}.drop-zone .drop-zone-content .drop-zone-subtitle{font-size:14px;color:var(--matecu-file-input-text-muted);margin-top:8px}.drop-zone .select-button{background-color:var(--matecu-file-input-button-primary-bg);color:var(--matecu-file-input-button-primary-text);border:none;padding:12px 24px;border-radius:var(--matecu-file-input-border-radius-md);font-weight:500;cursor:pointer;transition:background-color .2s ease}.drop-zone .select-button:hover:not(:disabled){background-color:var(--matecu-file-input-button-primary-bg-hover)}.drop-zone .select-button:disabled{background-color:var(--matecu-file-input-button-disabled-bg);cursor:not-allowed}.single-file-display{box-sizing:border-box;display:grid;grid-template-columns:1fr 32px;align-items:center;justify-content:space-between;width:100%;padding:16px;background-color:var(--matecu-file-input-bg-surface);border-radius:var(--matecu-file-input-border-radius-md);box-shadow:var(--matecu-file-input-shadow-md)}.single-file-display .file-info{display:flex;align-items:center;gap:16px;overflow:hidden}.single-file-display .file-info .file-preview img{border-radius:var(--matecu-file-input-border-radius-sm);object-fit:cover}.single-file-display .file-info .file-icon{width:48px;height:48px;background-color:var(--matecu-file-input-bg-surface-alt);border-radius:var(--matecu-file-input-border-radius-md);display:flex;align-items:center;justify-content:center;font-size:24px;color:var(--matecu-file-input-text-muted)}.single-file-display .file-info .file-details{max-width:calc(100% - 64px)}.single-file-display .file-info .file-details .file-name{max-width:100%;font-size:16px;font-weight:600;color:var(--matecu-file-input-text-primary);margin:0 0 4px;display:inline-block;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.single-file-display .file-info .file-details .file-size{font-size:14px;color:var(--matecu-file-input-text-muted);margin:0 0 2px}.single-file-display .file-info .file-details .file-type{font-size:12px;color:var(--matecu-file-input-text-disabled);margin:0}.single-file-display .remove-file-button{background-color:var(--matecu-file-input-button-danger-bg);color:var(--matecu-file-input-button-danger-text);border:none;width:32px;height:32px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:16px;transition:background-color .2s ease}.single-file-display .remove-file-button:hover{background-color:var(--matecu-file-input-button-danger-bg-hover)}.multiple-files-display{width:100%}.multiple-files-display .files-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;padding-bottom:8px;border-bottom:1px solid var(--matecu-file-input-border-separator)}.multiple-files-display .files-header h3{font-size:16px;font-weight:600;color:var(--matecu-file-input-text-primary);margin:0}.multiple-files-display .files-header .files-counter{font-size:14px;color:var(--matecu-file-input-text-muted);background-color:var(--matecu-file-input-bg-surface-alt);padding:4px 8px;border-radius:var(--matecu-file-input-border-radius-xl)}.multiple-files-display .files-list{display:flex;flex-direction:column;gap:8px;margin-bottom:16px}.multiple-files-display .file-item{display:flex;align-items:center;gap:12px;padding:12px;background-color:var(--matecu-file-input-bg-surface);border-radius:var(--matecu-file-input-border-radius-md);box-shadow:var(--matecu-file-input-shadow-sm);border:1px solid var(--matecu-file-input-border-separator)}.multiple-files-display .file-item .file-preview-small,.multiple-files-display .file-item .file-icon-small{width:32px;height:32px;background-color:var(--matecu-file-input-bg-surface-alt);border-radius:var(--matecu-file-input-border-radius-sm);display:flex;align-items:center;justify-content:center;font-size:14px;color:var(--matecu-file-input-text-muted);flex-shrink:0}.multiple-files-display .file-item .file-preview-small img,.multiple-files-display .file-item .file-icon-small img{width:100%;height:100%;object-fit:cover;border-radius:var(--matecu-file-input-border-radius-sm)}.multiple-files-display .file-item .file-item-details{flex:1;min-width:0}.multiple-files-display .file-item .file-item-details .file-item-name{font-size:14px;font-weight:500;color:var(--matecu-file-input-text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.multiple-files-display .file-item .file-item-details .file-item-size{font-size:12px;color:var(--matecu-file-input-text-muted)}.multiple-files-display .file-item .remove-file-button-small{background-color:var(--matecu-file-input-button-danger-bg);color:var(--matecu-file-input-button-danger-text);border:none;width:24px;height:24px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:12px;flex-shrink:0;transition:background-color .2s ease}.multiple-files-display .file-item .remove-file-button-small:hover{background-color:var(--matecu-file-input-button-danger-bg-hover)}.multiple-files-display .add-more-button{width:100%;background-color:var(--matecu-file-input-bg-surface-alt);color:var(--matecu-file-input-text-muted);border:var(--matecu-file-input-border-width) dashed var(--matecu-file-input-border-separator);padding:12px;border-radius:var(--matecu-file-input-border-radius-md);cursor:pointer;font-weight:500;transition:all .2s ease}.multiple-files-display .add-more-button:hover{background-color:var(--matecu-file-input-bg-hover);border-color:var(--matecu-file-input-text-disabled)}.error-messages{margin-top:12px}.error-messages .error-message{background-color:var(--matecu-file-input-bg-error);color:var(--matecu-file-input-text-error);padding:8px 12px;border-radius:var(--matecu-file-input-border-radius-sm);border-left:4px solid var(--matecu-file-input-color-error);font-size:14px;margin-bottom:4px}.error-messages .error-message:last-child{margin-bottom:0}@media(max-width:640px){.file-input-container{padding:16px;min-height:100px}.single-file-display .file-info{gap:12px}}@media screen and (max-width:640px)and (max-width:425px){.single-file-display .file-info{flex-direction:column}}@media(max-width:640px){.single-file-display .file-info .file-icon,.single-file-display .file-info .file-preview{width:40px;height:40px}}@media screen and (max-width:640px)and (max-width:425px){.single-file-display .file-info .file-icon,.single-file-display .file-info .file-preview{width:60px;height:60px}}@media(max-width:640px){.single-file-display .file-info .file-icon img,.single-file-display .file-info .file-preview img{width:100%;height:100%;object-fit:cover}.files-header{flex-direction:column;align-items:flex-start;gap:8px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
1653
+ }
1654
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MatecuFileInput, decorators: [{
1655
+ type: Component,
1656
+ args: [{ selector: 'matecu-file-input', imports: [CommonModule], providers: [
1657
+ {
1658
+ provide: NG_VALUE_ACCESSOR,
1659
+ multi: true,
1660
+ useExisting: MatecuFileInput,
1661
+ },
1662
+ ], template: "<!-- Hidden file input -->\n<input type=\"file\" #fileInput (change)=\"onFileChange($event)\" [multiple]=\"multiple\" [disabled]=\"isDisabled\"\n [attr.aria-label]=\"ariaLabel || 'Select file'\" [attr.aria-describedby]=\"hasErrors ? 'file-input-errors' : null\"\n [accept]=\"acceptedMimeTypes.join(',')\" />\n\n<!-- Main drop zone and file display -->\n<div class=\"file-input-container\" [class.drag-over]=\"isDragOver\" [class.disabled]=\"isDisabled\"\n [class.has-files]=\"hasFiles\" [class.has-errors]=\"hasErrors\" [class.loading]=\"isLoading\"\n (dragover)=\"onDragOver($event)\" (dragleave)=\"onDragLeave($event)\" (drop)=\"onDrop($event)\"\n (click)=\"openFileDialog()\">\n <!-- Loading state -->\n @if (isLoading) {\n <div class=\"loading-container\">\n <div class=\"spinner\"></div>\n <span class=\"loading-text\">{{ loadingText }}</span>\n </div>\n }\n\n <!-- Empty state / Drop zone -->\n @if (!hasFiles && !isLoading) {\n <div class=\"drop-zone\">\n <div class=\"drop-zone-icon\">\n \uD83D\uDCC1\n </div>\n <div class=\"drop-zone-content\">\n <p class=\"drop-zone-title\">{{ placeholder }}</p>\n <button type=\"button\" class=\"select-button\" [disabled]=\"isDisabled\"\n (click)=\"openFileDialog(); $event.stopPropagation()\">\n {{ buttonText }}\n </button>\n @if (enableDragDrop && !isDisabled) {\n }\n </div>\n </div>\n }\n\n <!-- Single file display -->\n @if (!multiple && file && !isLoading) {\n <div class=\"single-file-display\">\n <div class=\"file-info\">\n <!-- File preview -->\n @if (showPreview && file.type.startsWith('image/')) {\n <div class=\"file-preview\">\n <img [src]=\"getPreviewUrl(file)\" [alt]=\"file.name\" [style.max-width.px]=\"previewMaxWidth\"\n [style.max-height.px]=\"previewMaxHeight\" />\n </div>\n } @else {\n <div class=\"file-icon\">\n {{ getFileIcon(file) }}\n </div>\n }\n\n <div class=\"file-details\">\n <h3 class=\"file-name\">{{ displayName || file.name }}</h3>\n @if (showFileSize && selectedFileSize) {\n <p class=\"file-size\">\n {{ formatFileSize(file) }}\n </p>\n }\n <p class=\"file-type\">{{ file.type || 'Unknown type' }}</p>\n </div>\n </div>\n\n <button type=\"button\" class=\"remove-file-button\" (click)=\"removeFile(file); $event.stopPropagation()\"\n [attr.aria-label]=\"'Remove ' + file.name\">\n \u2715\n </button>\n </div>\n }\n\n <!-- Multiple files display -->\n @if (multiple && files.length > 0 && !isLoading) {\n <div class=\"multiple-files-display\">\n <div class=\"files-header\">\n @if (maxFiles > 1) {\n <span class=\"files-counter\">{{ files.length }} / {{ maxFiles }}</span>\n }\n </div>\n\n <div class=\"files-list\">\n @for (file of files; track file.name + file.size; let i = $index) {\n <div class=\"file-item\">\n <!-- File preview -->\n @if (showPreview && file.type.startsWith('image/')) {\n <div class=\"file-preview-small\">\n <img [src]=\"getPreviewUrl(file)\" [alt]=\"file.name\" />\n </div>\n } @else {\n <div class=\"file-icon-small\">\n {{ getFileIcon(file) }}\n </div>\n }\n\n <div class=\"file-item-details\">\n <div class=\"file-item-name\">{{ file.name }}</div>\n @if (showFileSize) {\n <div class=\"file-item-size\">\n {{ formatFileSize(file) }}\n </div>\n }\n </div>\n\n <button type=\"button\" class=\"remove-file-button-small\"\n (click)=\"removeFile(file); $event.stopPropagation()\" [attr.aria-label]=\"'Remove ' + file.name\">\n \u2715\n </button>\n </div>\n }\n </div>\n\n <!-- Add more files button -->\n @if (files.length < maxFiles) { <button type=\"button\" class=\"add-more-button\"\n (click)=\"openFileDialog(); $event.stopPropagation()\">\n {{ changeSelectedFileText }}\n </button>\n }\n </div>\n }\n</div>\n\n<!-- Error messages -->\n@if (hasErrors) {\n<div id=\"file-input-errors\" class=\"error-messages\" role=\"alert\">\n @for (error of validationErrors; track error) {\n <div class=\"error-message\">{{ error }}</div>\n }\n</div>\n}", styles: [":host{display:block;width:100%}:host>*{box-sizing:border-box}:host{--matecu-file-input-color-primary: #4f46e5;--matecu-file-input-color-primary-hover: #4338ca;--matecu-file-input-color-success: #10b981;--matecu-file-input-color-error: #ef4444;--matecu-file-input-color-error-hover: #dc2626;--matecu-file-input-color-loading: #8b5cf6;--matecu-file-input-color-disabled: #9ca3af;--matecu-file-input-border-default: #e1e5e9;--matecu-file-input-border-hover: var(--matecu-file-input-color-primary);--matecu-file-input-border-success: var(--matecu-file-input-color-success);--matecu-file-input-border-error: var(--matecu-file-input-color-error);--matecu-file-input-border-loading: var(--matecu-file-input-color-loading);--matecu-file-input-border-separator: #e5e7eb;--matecu-file-input-bg-default: #fafbfc;--matecu-file-input-bg-hover: #f8faff;--matecu-file-input-bg-drag-over: #eef2ff;--matecu-file-input-bg-disabled: #f5f5f5;--matecu-file-input-bg-success: #f0fdf4;--matecu-file-input-bg-error: #fef2f2;--matecu-file-input-bg-loading: #faf5ff;--matecu-file-input-bg-surface: #ffffff;--matecu-file-input-bg-surface-alt: #f3f4f6;--matecu-file-input-text-primary: #111827;--matecu-file-input-text-secondary: #374151;--matecu-file-input-text-muted: #6b7280;--matecu-file-input-text-disabled: #9ca3af;--matecu-file-input-text-on-primary: #ffffff;--matecu-file-input-text-error: #dc2626;--matecu-file-input-button-primary-bg: var(--matecu-file-input-color-primary);--matecu-file-input-button-primary-bg-hover: var(--matecu-file-input-color-primary-hover);--matecu-file-input-button-primary-text: var(--matecu-file-input-text-on-primary);--matecu-file-input-button-danger-bg: var(--matecu-file-input-color-error);--matecu-file-input-button-danger-bg-hover: var(--matecu-file-input-color-error-hover);--matecu-file-input-button-danger-text: var(--matecu-file-input-text-on-primary);--matecu-file-input-button-disabled-bg: var(--matecu-file-input-color-disabled);--matecu-file-input-spinner-track: #e5e7eb;--matecu-file-input-spinner-fill: var(--matecu-file-input-color-loading);--matecu-file-input-shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);--matecu-file-input-shadow-md: 0 1px 3px rgba(0, 0, 0, .1);--matecu-file-input-border-radius-sm: 4px;--matecu-file-input-border-radius-md: 6px;--matecu-file-input-border-radius-lg: 8px;--matecu-file-input-border-radius-xl: 12px;--matecu-file-input-border-width: 2px}:host input[type=file]{display:none}.file-input-container{position:relative;border:var(--matecu-file-input-border-width) dashed var(--matecu-file-input-border-default);border-radius:var(--matecu-file-input-border-radius-lg);padding:24px;transition:all .3s ease;background-color:var(--matecu-file-input-bg-default);cursor:pointer;min-height:120px;display:flex;align-items:center;justify-content:center}.file-input-container:hover:not(.disabled){border-color:var(--matecu-file-input-border-hover);background-color:var(--matecu-file-input-bg-hover)}.file-input-container.drag-over{border-color:var(--matecu-file-input-border-hover);background-color:var(--matecu-file-input-bg-drag-over);transform:scale(1.02)}.file-input-container.disabled{opacity:.6;cursor:not-allowed;background-color:var(--matecu-file-input-bg-disabled)}.file-input-container.has-files{border-style:solid;border-color:var(--matecu-file-input-border-success);background-color:var(--matecu-file-input-bg-success)}.file-input-container.has-errors{border-color:var(--matecu-file-input-border-error);background-color:var(--matecu-file-input-bg-error)}.file-input-container.loading{border-color:var(--matecu-file-input-border-loading);background-color:var(--matecu-file-input-bg-loading)}.loading-container{display:flex;flex-direction:column;align-items:center;gap:12px;color:var(--matecu-file-input-text-muted)}.loading-container .spinner{width:32px;height:32px;border:3px solid var(--matecu-file-input-spinner-track);border-top:3px solid var(--matecu-file-input-spinner-fill);border-radius:50%;animation:spin 1s linear infinite}.loading-container .loading-text{font-size:14px;font-weight:500}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.drop-zone{text-align:center;width:100%}.drop-zone .drop-zone-icon{font-size:48px;margin-bottom:16px}.drop-zone .drop-zone-content .drop-zone-title{font-size:16px;font-weight:600;color:var(--matecu-file-input-text-secondary);margin-bottom:12px}.drop-zone .drop-zone-content .drop-zone-subtitle{font-size:14px;color:var(--matecu-file-input-text-muted);margin-top:8px}.drop-zone .select-button{background-color:var(--matecu-file-input-button-primary-bg);color:var(--matecu-file-input-button-primary-text);border:none;padding:12px 24px;border-radius:var(--matecu-file-input-border-radius-md);font-weight:500;cursor:pointer;transition:background-color .2s ease}.drop-zone .select-button:hover:not(:disabled){background-color:var(--matecu-file-input-button-primary-bg-hover)}.drop-zone .select-button:disabled{background-color:var(--matecu-file-input-button-disabled-bg);cursor:not-allowed}.single-file-display{box-sizing:border-box;display:grid;grid-template-columns:1fr 32px;align-items:center;justify-content:space-between;width:100%;padding:16px;background-color:var(--matecu-file-input-bg-surface);border-radius:var(--matecu-file-input-border-radius-md);box-shadow:var(--matecu-file-input-shadow-md)}.single-file-display .file-info{display:flex;align-items:center;gap:16px;overflow:hidden}.single-file-display .file-info .file-preview img{border-radius:var(--matecu-file-input-border-radius-sm);object-fit:cover}.single-file-display .file-info .file-icon{width:48px;height:48px;background-color:var(--matecu-file-input-bg-surface-alt);border-radius:var(--matecu-file-input-border-radius-md);display:flex;align-items:center;justify-content:center;font-size:24px;color:var(--matecu-file-input-text-muted)}.single-file-display .file-info .file-details{max-width:calc(100% - 64px)}.single-file-display .file-info .file-details .file-name{max-width:100%;font-size:16px;font-weight:600;color:var(--matecu-file-input-text-primary);margin:0 0 4px;display:inline-block;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.single-file-display .file-info .file-details .file-size{font-size:14px;color:var(--matecu-file-input-text-muted);margin:0 0 2px}.single-file-display .file-info .file-details .file-type{font-size:12px;color:var(--matecu-file-input-text-disabled);margin:0}.single-file-display .remove-file-button{background-color:var(--matecu-file-input-button-danger-bg);color:var(--matecu-file-input-button-danger-text);border:none;width:32px;height:32px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:16px;transition:background-color .2s ease}.single-file-display .remove-file-button:hover{background-color:var(--matecu-file-input-button-danger-bg-hover)}.multiple-files-display{width:100%}.multiple-files-display .files-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;padding-bottom:8px;border-bottom:1px solid var(--matecu-file-input-border-separator)}.multiple-files-display .files-header h3{font-size:16px;font-weight:600;color:var(--matecu-file-input-text-primary);margin:0}.multiple-files-display .files-header .files-counter{font-size:14px;color:var(--matecu-file-input-text-muted);background-color:var(--matecu-file-input-bg-surface-alt);padding:4px 8px;border-radius:var(--matecu-file-input-border-radius-xl)}.multiple-files-display .files-list{display:flex;flex-direction:column;gap:8px;margin-bottom:16px}.multiple-files-display .file-item{display:flex;align-items:center;gap:12px;padding:12px;background-color:var(--matecu-file-input-bg-surface);border-radius:var(--matecu-file-input-border-radius-md);box-shadow:var(--matecu-file-input-shadow-sm);border:1px solid var(--matecu-file-input-border-separator)}.multiple-files-display .file-item .file-preview-small,.multiple-files-display .file-item .file-icon-small{width:32px;height:32px;background-color:var(--matecu-file-input-bg-surface-alt);border-radius:var(--matecu-file-input-border-radius-sm);display:flex;align-items:center;justify-content:center;font-size:14px;color:var(--matecu-file-input-text-muted);flex-shrink:0}.multiple-files-display .file-item .file-preview-small img,.multiple-files-display .file-item .file-icon-small img{width:100%;height:100%;object-fit:cover;border-radius:var(--matecu-file-input-border-radius-sm)}.multiple-files-display .file-item .file-item-details{flex:1;min-width:0}.multiple-files-display .file-item .file-item-details .file-item-name{font-size:14px;font-weight:500;color:var(--matecu-file-input-text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.multiple-files-display .file-item .file-item-details .file-item-size{font-size:12px;color:var(--matecu-file-input-text-muted)}.multiple-files-display .file-item .remove-file-button-small{background-color:var(--matecu-file-input-button-danger-bg);color:var(--matecu-file-input-button-danger-text);border:none;width:24px;height:24px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:12px;flex-shrink:0;transition:background-color .2s ease}.multiple-files-display .file-item .remove-file-button-small:hover{background-color:var(--matecu-file-input-button-danger-bg-hover)}.multiple-files-display .add-more-button{width:100%;background-color:var(--matecu-file-input-bg-surface-alt);color:var(--matecu-file-input-text-muted);border:var(--matecu-file-input-border-width) dashed var(--matecu-file-input-border-separator);padding:12px;border-radius:var(--matecu-file-input-border-radius-md);cursor:pointer;font-weight:500;transition:all .2s ease}.multiple-files-display .add-more-button:hover{background-color:var(--matecu-file-input-bg-hover);border-color:var(--matecu-file-input-text-disabled)}.error-messages{margin-top:12px}.error-messages .error-message{background-color:var(--matecu-file-input-bg-error);color:var(--matecu-file-input-text-error);padding:8px 12px;border-radius:var(--matecu-file-input-border-radius-sm);border-left:4px solid var(--matecu-file-input-color-error);font-size:14px;margin-bottom:4px}.error-messages .error-message:last-child{margin-bottom:0}@media(max-width:640px){.file-input-container{padding:16px;min-height:100px}.single-file-display .file-info{gap:12px}}@media screen and (max-width:640px)and (max-width:425px){.single-file-display .file-info{flex-direction:column}}@media(max-width:640px){.single-file-display .file-info .file-icon,.single-file-display .file-info .file-preview{width:40px;height:40px}}@media screen and (max-width:640px)and (max-width:425px){.single-file-display .file-info .file-icon,.single-file-display .file-info .file-preview{width:60px;height:60px}}@media(max-width:640px){.single-file-display .file-info .file-icon img,.single-file-display .file-info .file-preview img{width:100%;height:100%;object-fit:cover}.files-header{flex-direction:column;align-items:flex-start;gap:8px}}\n"] }]
1663
+ }], propDecorators: { fileInput: [{
1664
+ type: ViewChild,
1665
+ args: ['fileInput']
1666
+ }], optimizeImage: [{
1667
+ type: Input
1668
+ }], optimizeImageToSize: [{
1669
+ type: Input
1670
+ }], maxFileSize: [{
1671
+ type: Input
1672
+ }], maxFiles: [{
1673
+ type: Input
1674
+ }], multiple: [{
1675
+ type: Input
1676
+ }], showFileSize: [{
1677
+ type: Input
1678
+ }], fileSizeUnit: [{
1679
+ type: Input
1680
+ }], displayName: [{
1681
+ type: Input
1682
+ }], placeholder: [{
1683
+ type: Input
1684
+ }], buttonText: [{
1685
+ type: Input
1686
+ }], changeSelectedFileText: [{
1687
+ type: Input
1688
+ }], loadingText: [{
1689
+ type: Input
1690
+ }], ariaLabel: [{
1691
+ type: Input
1692
+ }], acceptedMimeTypes: [{
1693
+ type: Input
1694
+ }], acceptedExtensions: [{
1695
+ type: Input
1696
+ }], errorMessages: [{
1697
+ type: Input
1698
+ }], enableDragDrop: [{
1699
+ type: Input
1700
+ }], showPreview: [{
1701
+ type: Input
1702
+ }], previewMaxWidth: [{
1703
+ type: Input
1704
+ }], previewMaxHeight: [{
1705
+ type: Input
1706
+ }], showProgress: [{
1707
+ type: Input
1708
+ }], fileSelected: [{
1709
+ type: Output
1710
+ }], filesSelected: [{
1711
+ type: Output
1712
+ }], fileRemoved: [{
1713
+ type: Output
1714
+ }], validationError: [{
1715
+ type: Output
1716
+ }], dragEnter: [{
1717
+ type: Output
1718
+ }], dragLeave: [{
1719
+ type: Output
1720
+ }], stateChange: [{
1721
+ type: Output
1722
+ }] } });
1723
+
1724
+ /*
1725
+ * Public API Surface of angular-matecu
1726
+ */
1727
+ /**
1728
+ * spinner
1729
+ */
1730
+
1731
+ /**
1732
+ * Generated bundle index. Do not edit.
1733
+ */
1734
+
1735
+ export { FileInputState, MatecuAlertBoxComponent, MatecuAlertBoxModule, MatecuAlertBoxType, MatecuAlertDialogComponent, MatecuAlertSnackBarComponent, MatecuAutocomplete, MatecuAutocompleteMultiple, MatecuFileInput, MatecuSnackBarService, MatecuSpinnerComponent, MatecuSpinnerModule, MatecuSpinnerService, MatecuTopbarActionComponent, MatecuTopbarBodyComponent, MatecuTopbarFabComponent, MatecuTopbarHeaderColumnComponent, MatecuTopbarHeaderRowComponent, MatecuTopbarLayoutComponent, MatecuTopbarLayoutModule, MatecuTopbarSearchComponent, MatecuTopbarTitleComponent };
1736
+ //# sourceMappingURL=angular-matecu.mjs.map