ui-core-abv 0.0.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 (48) hide show
  1. package/README.md +63 -0
  2. package/fesm2022/ui-core-abv.mjs +1492 -0
  3. package/fesm2022/ui-core-abv.mjs.map +1 -0
  4. package/index.d.ts +5 -0
  5. package/lib/animations/animatedRow.animation.d.ts +1 -0
  6. package/lib/animations/animatios.index.d.ts +6 -0
  7. package/lib/animations/fadeAndRise.animation.d.ts +1 -0
  8. package/lib/animations/highlightRow.animation.d.ts +1 -0
  9. package/lib/animations/pushTop.animation.d.ts +1 -0
  10. package/lib/animations/sideModal.animation.d.ts +2 -0
  11. package/lib/animations/simpleFade.animation.d.ts +1 -0
  12. package/lib/base-value-accessot.d.ts +12 -0
  13. package/lib/button/button.component.d.ts +17 -0
  14. package/lib/checkbox/checkbox.component.d.ts +22 -0
  15. package/lib/dynamic-form/form/dynamic-form.component.d.ts +10 -0
  16. package/lib/dynamic-form/form-wrapper/form-wrapper.component.d.ts +26 -0
  17. package/lib/dynamic-form/form.models.d.ts +36 -0
  18. package/lib/inputs/input/input.component.d.ts +17 -0
  19. package/lib/inputs/searcher/searcher.component.d.ts +46 -0
  20. package/lib/inputs/select/select.component.d.ts +46 -0
  21. package/lib/modal/floating-modal/modal.component.d.ts +21 -0
  22. package/lib/modal/floating-modal/modalconfig.model.d.ts +7 -0
  23. package/lib/modal/modaRef.d.ts +15 -0
  24. package/lib/modal/modal.constant.d.ts +5 -0
  25. package/lib/modal/modal.service.d.ts +22 -0
  26. package/lib/modal/side-modal/side-modal.component.d.ts +30 -0
  27. package/lib/modal/side-modal/sideModalConfig.model.d.ts +11 -0
  28. package/lib/pipes/name-inits.pipe.d.ts +7 -0
  29. package/lib/push-alerts/alert/alert.component.d.ts +16 -0
  30. package/lib/push-alerts/alert-container/alert-container.component.d.ts +13 -0
  31. package/lib/push-alerts/alert.helpers.d.ts +5 -0
  32. package/lib/push-alerts/alert.model.d.ts +29 -0
  33. package/lib/push-alerts/push-alert.service.d.ts +12 -0
  34. package/lib/skeleton-loader/skeleton-loader.component.d.ts +10 -0
  35. package/lib/table/table-list/table-list.component.d.ts +7 -0
  36. package/lib/table/table-pagination/table-pagination.component.d.ts +16 -0
  37. package/lib/table/table-searcher/table-searcher.component.d.ts +13 -0
  38. package/lib/table/table-user/table-user.component.d.ts +7 -0
  39. package/lib/table/table.component.d.ts +49 -0
  40. package/lib/table/table.models.d.ts +56 -0
  41. package/lib/tiny-alert/tiny-alert.component.d.ts +15 -0
  42. package/lib/tiny-alert/tiny-alert.model.d.ts +32 -0
  43. package/lib/tiny-alert/tiny-alert.service.d.ts +8 -0
  44. package/lib/toggle-button/toggle-button.component.d.ts +11 -0
  45. package/lib/tooltip/tool-tip.directive.d.ts +17 -0
  46. package/lib/tooltip/tooltip.component.d.ts +8 -0
  47. package/package.json +26 -0
  48. package/public-api.d.ts +22 -0
@@ -0,0 +1,1492 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Output, Input, Directive, forwardRef, Component, Injectable, Pipe, createComponent, HostListener, inject, Renderer2, ViewChild, Injector, Inject, EnvironmentInjector } from '@angular/core';
3
+ import * as i1$1 from '@angular/forms';
4
+ import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule, FormBuilder, Validators } from '@angular/forms';
5
+ import * as i1 from '@angular/common';
6
+ import { CommonModule, AsyncPipe } from '@angular/common';
7
+ import { Subject, debounceTime, distinctUntilChanged, tap, switchMap, of, finalize } from 'rxjs';
8
+ import { trigger, transition, style, animate, state, keyframes } from '@angular/animations';
9
+ import * as i1$2 from '@angular/cdk/overlay';
10
+ import { OverlayModule, Overlay, OverlayRef } from '@angular/cdk/overlay';
11
+ import * as i2 from '@angular/cdk/portal';
12
+ import { TemplatePortal, ComponentPortal, PortalModule, CdkPortalOutlet } from '@angular/cdk/portal';
13
+
14
+ function createValueAccessor() {
15
+ class BaseValueAccessor {
16
+ value;
17
+ valueChange = new EventEmitter();
18
+ onChange = () => { };
19
+ onTouched = () => { };
20
+ writeValue(obj) {
21
+ this.value = obj;
22
+ }
23
+ registerOnChange(fn) {
24
+ this.onChange = fn;
25
+ }
26
+ registerOnTouched(fn) {
27
+ this.onTouched = fn;
28
+ }
29
+ setDisabledState(isDisabled) {
30
+ // opcional
31
+ }
32
+ notifyChange(value) {
33
+ this.value = value;
34
+ this.valueChange.emit(value);
35
+ this.onChange(value);
36
+ this.onTouched();
37
+ }
38
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: BaseValueAccessor, deps: [], target: i0.ɵɵFactoryTarget.Directive });
39
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.14", type: BaseValueAccessor, isStandalone: true, inputs: { value: "value" }, outputs: { valueChange: "valueChange" }, ngImport: i0 });
40
+ }
41
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: BaseValueAccessor, decorators: [{
42
+ type: Directive
43
+ }], propDecorators: { value: [{
44
+ type: Input
45
+ }], valueChange: [{
46
+ type: Output
47
+ }] } });
48
+ return BaseValueAccessor;
49
+ }
50
+
51
+ const base$1 = createValueAccessor();
52
+ class CheckboxComponent extends base$1 {
53
+ label = '';
54
+ placeholder = '';
55
+ disabled = false;
56
+ loading = false;
57
+ toggle() {
58
+ if (!this.disabled && !this.loading) {
59
+ this.notifyChange(!this.value);
60
+ }
61
+ }
62
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
63
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: CheckboxComponent, isStandalone: true, selector: "ui-checkbox", inputs: { label: "label", placeholder: "placeholder", disabled: "disabled", loading: "loading" }, providers: [
64
+ {
65
+ provide: NG_VALUE_ACCESSOR,
66
+ useExisting: forwardRef(() => CheckboxComponent),
67
+ multi: true
68
+ }
69
+ ], usesInheritance: true, ngImport: i0, template: "@if (label){\r\n <label for=\"\">{{label}} </label>\r\n}\r\n<div class=\"check-wrapper\">\r\n <button\r\n type=\"button\"\r\n class=\"checkbox\"\r\n [disabled]=\"disabled\"\r\n [class.checked]=\"value\"\r\n (click)=\"toggle()\"\r\n (keydown.enter)=\"toggle()\"\r\n (keydown.space)=\"toggle()\"\r\n >\r\n <span class=\"icon\">\r\n @if (value) {\r\n \u2714\r\n }@else {\r\n \u2212\r\n }\r\n </span>\r\n </button>\r\n {{placeholder}}\r\n</div>", styles: [".check-wrapper{padding:2px;display:flex;align-items:center;font-size:16px}.check-wrapper button{margin-right:8px}.checkbox{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border:2px solid #717680;border-radius:6px;background:#fff;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,box-shadow .2s ease;outline:none}.checkbox:hover:not(:disabled){border-color:#8230c4}.checkbox:focus,.checkbox:focus-visible{box-shadow:0 0 0 3px #8230c466}.checkbox:disabled{background:#d5d7da;border-color:#d5d7da;cursor:not-allowed}.checkbox:disabled .icon{opacity:.5}.checkbox.checked{background:#752bb0;border-color:#752bb0}.checkbox.checked:hover:not(:disabled){background:#8230c4;border-color:#8230c4}.checkbox.checked .icon{color:#fff}.checkbox.indeterminate{background:#752bb0;border-color:#752bb0}.checkbox.indeterminate .icon{color:#fff}.checkbox .icon{font-size:16px;font-weight:700;color:transparent;line-height:1;transition:color .2s ease}\n"] });
70
+ }
71
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: CheckboxComponent, decorators: [{
72
+ type: Component,
73
+ args: [{ selector: 'ui-checkbox', imports: [], providers: [
74
+ {
75
+ provide: NG_VALUE_ACCESSOR,
76
+ useExisting: forwardRef(() => CheckboxComponent),
77
+ multi: true
78
+ }
79
+ ], template: "@if (label){\r\n <label for=\"\">{{label}} </label>\r\n}\r\n<div class=\"check-wrapper\">\r\n <button\r\n type=\"button\"\r\n class=\"checkbox\"\r\n [disabled]=\"disabled\"\r\n [class.checked]=\"value\"\r\n (click)=\"toggle()\"\r\n (keydown.enter)=\"toggle()\"\r\n (keydown.space)=\"toggle()\"\r\n >\r\n <span class=\"icon\">\r\n @if (value) {\r\n \u2714\r\n }@else {\r\n \u2212\r\n }\r\n </span>\r\n </button>\r\n {{placeholder}}\r\n</div>", styles: [".check-wrapper{padding:2px;display:flex;align-items:center;font-size:16px}.check-wrapper button{margin-right:8px}.checkbox{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border:2px solid #717680;border-radius:6px;background:#fff;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,box-shadow .2s ease;outline:none}.checkbox:hover:not(:disabled){border-color:#8230c4}.checkbox:focus,.checkbox:focus-visible{box-shadow:0 0 0 3px #8230c466}.checkbox:disabled{background:#d5d7da;border-color:#d5d7da;cursor:not-allowed}.checkbox:disabled .icon{opacity:.5}.checkbox.checked{background:#752bb0;border-color:#752bb0}.checkbox.checked:hover:not(:disabled){background:#8230c4;border-color:#8230c4}.checkbox.checked .icon{color:#fff}.checkbox.indeterminate{background:#752bb0;border-color:#752bb0}.checkbox.indeterminate .icon{color:#fff}.checkbox .icon{font-size:16px;font-weight:700;color:transparent;line-height:1;transition:color .2s ease}\n"] }]
80
+ }], propDecorators: { label: [{
81
+ type: Input
82
+ }], placeholder: [{
83
+ type: Input
84
+ }], disabled: [{
85
+ type: Input
86
+ }], loading: [{
87
+ type: Input
88
+ }] } });
89
+
90
+ class ToggleButtonComponent {
91
+ checked = false;
92
+ checkedChange = new EventEmitter();
93
+ disabled = false;
94
+ placeholder = '';
95
+ toggle() {
96
+ if (this.disabled)
97
+ return;
98
+ this.checked = !this.checked;
99
+ this.checkedChange.emit(this.checked);
100
+ }
101
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ToggleButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
102
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ToggleButtonComponent, isStandalone: true, selector: "ui-switch", inputs: { checked: "checked", disabled: "disabled", placeholder: "placeholder" }, outputs: { checkedChange: "checkedChange" }, ngImport: i0, template: "<div class=\"toggle-wrapper\" [class.disabled]=\"disabled\">\r\n <button\r\n type=\"button\"\r\n class=\"toggle\"\r\n [class.checked]=\"checked\"\r\n [disabled]=\"disabled\"\r\n (click)=\"toggle()\"\r\n >\r\n <span class=\"thumb\"></span>\r\n </button>\r\n {{placeholder}}\r\n</div>", styles: [".toggle-wrapper{padding:2px;display:flex;align-items:center;font-size:16px}.toggle-wrapper button{margin-right:8px}.disabled{color:#d5d7da}.toggle{position:relative;width:44px;height:22px;border:none;border-radius:22px;background:#e9eaeb;cursor:pointer;padding:2px;display:flex;align-items:center;transition:background .2s ease}.toggle:disabled{background:#d5d7da;cursor:not-allowed}.toggle:disabled .thumb{opacity:.7}.toggle:hover:not(:disabled){background:#8230c4}.toggle:focus,.toggle:focus-visible{box-shadow:0 0 0 3px #8230c466}.toggle.checked{background:#752bb0}.toggle.checked:hover:not(:disabled){background:#8230c4}.toggle.checked .thumb{transform:translate(22px)}.toggle .thumb{width:18px;height:18px;background:#fff;border-radius:50%;transition:transform .2s ease;transform:translate(0)}\n"] });
103
+ }
104
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ToggleButtonComponent, decorators: [{
105
+ type: Component,
106
+ args: [{ selector: 'ui-switch', imports: [], template: "<div class=\"toggle-wrapper\" [class.disabled]=\"disabled\">\r\n <button\r\n type=\"button\"\r\n class=\"toggle\"\r\n [class.checked]=\"checked\"\r\n [disabled]=\"disabled\"\r\n (click)=\"toggle()\"\r\n >\r\n <span class=\"thumb\"></span>\r\n </button>\r\n {{placeholder}}\r\n</div>", styles: [".toggle-wrapper{padding:2px;display:flex;align-items:center;font-size:16px}.toggle-wrapper button{margin-right:8px}.disabled{color:#d5d7da}.toggle{position:relative;width:44px;height:22px;border:none;border-radius:22px;background:#e9eaeb;cursor:pointer;padding:2px;display:flex;align-items:center;transition:background .2s ease}.toggle:disabled{background:#d5d7da;cursor:not-allowed}.toggle:disabled .thumb{opacity:.7}.toggle:hover:not(:disabled){background:#8230c4}.toggle:focus,.toggle:focus-visible{box-shadow:0 0 0 3px #8230c466}.toggle.checked{background:#752bb0}.toggle.checked:hover:not(:disabled){background:#8230c4}.toggle.checked .thumb{transform:translate(22px)}.toggle .thumb{width:18px;height:18px;background:#fff;border-radius:50%;transition:transform .2s ease;transform:translate(0)}\n"] }]
107
+ }], propDecorators: { checked: [{
108
+ type: Input
109
+ }], checkedChange: [{
110
+ type: Output
111
+ }], disabled: [{
112
+ type: Input
113
+ }], placeholder: [{
114
+ type: Input
115
+ }] } });
116
+
117
+ class SkeletonLoaderComponent {
118
+ inputs = 3;
119
+ cols = 3;
120
+ get gridStyle() {
121
+ return {
122
+ 'grid-template-columns': `repeat(${this.cols}, 1fr)`
123
+ };
124
+ }
125
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SkeletonLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
126
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: SkeletonLoaderComponent, isStandalone: true, selector: "ui-skeleton-loader", inputs: { inputs: "inputs", cols: "cols" }, ngImport: i0, template: "<div class=\"skeleton-form\" [ngStyle]=\"gridStyle\">\r\n @for (r of [].constructor(inputs); track $index) {\r\n <div class=\"skeleton-input-container\">\r\n <div class=\"skeleton-input-label\"></div>\r\n <div class=\"skeleton-input\"></div>\r\n </div>\r\n }\r\n</div>", styles: [".skeleton-form{width:100%;display:grid;grid-template-columns:1fr 1fr 1fr;align-items:stretch;gap:16px;padding:24px 0}.skeleton-input-label{background:linear-gradient(90deg,#e0e0e0 25%,#f5f5f5,#e0e0e0 75%);background-size:200% 100%;animation:shimmer 1.5s infinite;border-radius:8px;height:20px;width:80%;margin-bottom:8px}.skeleton-input{background:linear-gradient(90deg,#e0e0e0 25%,#f5f5f5,#e0e0e0 75%);background-size:200% 100%;animation:shimmer 1.5s infinite;border-radius:8px;height:40px;width:100%}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
127
+ }
128
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SkeletonLoaderComponent, decorators: [{
129
+ type: Component,
130
+ args: [{ selector: 'ui-skeleton-loader', imports: [CommonModule], template: "<div class=\"skeleton-form\" [ngStyle]=\"gridStyle\">\r\n @for (r of [].constructor(inputs); track $index) {\r\n <div class=\"skeleton-input-container\">\r\n <div class=\"skeleton-input-label\"></div>\r\n <div class=\"skeleton-input\"></div>\r\n </div>\r\n }\r\n</div>", styles: [".skeleton-form{width:100%;display:grid;grid-template-columns:1fr 1fr 1fr;align-items:stretch;gap:16px;padding:24px 0}.skeleton-input-label{background:linear-gradient(90deg,#e0e0e0 25%,#f5f5f5,#e0e0e0 75%);background-size:200% 100%;animation:shimmer 1.5s infinite;border-radius:8px;height:20px;width:80%;margin-bottom:8px}.skeleton-input{background:linear-gradient(90deg,#e0e0e0 25%,#f5f5f5,#e0e0e0 75%);background-size:200% 100%;animation:shimmer 1.5s infinite;border-radius:8px;height:40px;width:100%}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}\n"] }]
131
+ }], propDecorators: { inputs: [{
132
+ type: Input
133
+ }], cols: [{
134
+ type: Input
135
+ }] } });
136
+
137
+ let nextId = 1;
138
+ function createSuccessAlert(message, options) {
139
+ return {
140
+ id: nextId++,
141
+ message,
142
+ type: 'success',
143
+ duration: 3000,
144
+ ...options,
145
+ };
146
+ }
147
+ function createErrorAlert(message, options) {
148
+ return {
149
+ id: nextId++,
150
+ message,
151
+ type: 'error',
152
+ duration: 5000,
153
+ ...options,
154
+ };
155
+ }
156
+ function createWarningAlert(message, options) {
157
+ return {
158
+ id: nextId++,
159
+ message,
160
+ type: 'warning',
161
+ duration: 4000,
162
+ ...options,
163
+ };
164
+ }
165
+ function createInfoAlert(message, options) {
166
+ return {
167
+ id: nextId++,
168
+ message,
169
+ type: 'info',
170
+ duration: 3000,
171
+ ...options,
172
+ };
173
+ }
174
+
175
+ class PushAlertService {
176
+ autoIncId = 0;
177
+ alerts$ = new Subject();
178
+ get stream() {
179
+ return this.alerts$.asObservable();
180
+ }
181
+ show(alertData) {
182
+ this.autoIncId++;
183
+ const alert = { ...alertData, id: this.autoIncId };
184
+ this.alerts$.next(alert);
185
+ }
186
+ success(message, options) {
187
+ this.show(createSuccessAlert(message, options));
188
+ }
189
+ error(message, options) {
190
+ this.show(createErrorAlert(message, options));
191
+ }
192
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PushAlertService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
193
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PushAlertService, providedIn: 'root' });
194
+ }
195
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PushAlertService, decorators: [{
196
+ type: Injectable,
197
+ args: [{
198
+ providedIn: 'root'
199
+ }]
200
+ }] });
201
+
202
+ class AlertComponent {
203
+ alert;
204
+ closeAlert = new EventEmitter();
205
+ interval;
206
+ progressValue = 0;
207
+ animationIntevalMs = 100;
208
+ pauseAnimation = false;
209
+ id = 0;
210
+ ngOnInit() {
211
+ this.id = this.alert.id;
212
+ if (this.alert.duration && this.alert.duration > 0) {
213
+ const duration = this.alert.duration;
214
+ let count = 0;
215
+ this.interval = setInterval(() => {
216
+ count = this.pauseAnimation ? count : count + this.animationIntevalMs;
217
+ this.progressValue = Math.floor((count / duration) * 100);
218
+ if (this.progressValue > 100) {
219
+ this.close();
220
+ }
221
+ }, this.animationIntevalMs);
222
+ }
223
+ }
224
+ close() {
225
+ clearInterval(this.interval);
226
+ this.closeAlert.emit(this.id);
227
+ }
228
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
229
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: AlertComponent, isStandalone: true, selector: "lib-alert", inputs: { alert: "alert" }, outputs: { closeAlert: "closeAlert" }, ngImport: i0, template: "<div [class]=\"'alert ' + alert.type + ' ' + (alert.style??'filled')\" >\r\n @if (alert.showProgressBar) {\r\n <div class=\"alert-process\">\r\n <div class=\"alert-process-bar\" [style.width.%]=\"progressValue\"></div>\r\n </div>\r\n }\r\n <div class=\"alert-body\">\r\n <button class=\"close\" (click)=\"close()\"> \u2715 </button>\r\n @if (alert.icon) {\r\n <i [class]=\"'highlighted ' + alert.icon\"></i>\r\n }\r\n <div>\r\n <div class=\"toast-title highlighted\">{{alert.title}}</div>\r\n <div class=\"toast-body\">{{alert.message}}</div>\r\n @if ( alert.okButtonText || alert.cancelButtonText){\r\n <div class=\"toast-buttons \">\r\n @if ( alert.okButtonText ) {\r\n <button style=\"font-weight: 500;\">{{alert.okButtonText}}</button>\r\n }\r\n @if ( alert.cancelButtonText ){\r\n <button (click)=\"close()\">{{alert.cancelButtonText}}</button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n</div>", styles: [".alert{display:flex;flex-direction:column;min-width:250px;max-width:450px;overflow:hidden;animation:fadeIn .3s ease;border-radius:12px}@keyframes fadeIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.alert-process{width:100%;height:4px;background-color:#0000004f;display:flex}.alert-process-bar{background-color:#ffffff69;height:4px}.alert-body{position:relative;padding:16px;display:flex}.alert-body i{font-size:20;width:22px;height:22px;margin-right:16px}.toast-title{font-weight:500;font-size:16px;line-height:24px}.toast-body{font-weight:400;font-size:14px;line-height:20px}.toast-buttons{margin-top:16px;display:flex;gap:16px}.toast-buttons button{color:#fff;border:none;background-color:transparent;font-size:16px;line-height:24px;padding:0}.toast-buttons button:hover{text-decoration:underline;cursor:pointer}.close{background:transparent;border:none;color:inherit;font-size:16px;cursor:pointer;position:absolute;right:5px;top:5px}.filled{color:#fff}.filled.success{background:#15803d}.filled.error{background:#d92d20}.filled.warning{background:#dc6803}.filled.info{background:#6193d5}.bordered{border:solid 1px;color:#717680}.bordered.success{border-color:#15803d;background:#bbf7d0}.bordered.success .highlighted,.bordered.success button{color:#15803d}.bordered.error{border-color:#d92d20;background:#fee4e2}.bordered.error .highlighted,.bordered.error button{color:#d92d20}.bordered.warning{border-color:#dc6803;background:#fef0c7}.bordered.warning .highlighted,.bordered.warning button{color:#dc6803}.bordered.info{border-color:#6193d5;background:#e4eefb}.bordered.info .highlighted,.bordered.info button{color:#6193d5}\n"] });
230
+ }
231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AlertComponent, decorators: [{
232
+ type: Component,
233
+ args: [{ selector: 'lib-alert', imports: [], template: "<div [class]=\"'alert ' + alert.type + ' ' + (alert.style??'filled')\" >\r\n @if (alert.showProgressBar) {\r\n <div class=\"alert-process\">\r\n <div class=\"alert-process-bar\" [style.width.%]=\"progressValue\"></div>\r\n </div>\r\n }\r\n <div class=\"alert-body\">\r\n <button class=\"close\" (click)=\"close()\"> \u2715 </button>\r\n @if (alert.icon) {\r\n <i [class]=\"'highlighted ' + alert.icon\"></i>\r\n }\r\n <div>\r\n <div class=\"toast-title highlighted\">{{alert.title}}</div>\r\n <div class=\"toast-body\">{{alert.message}}</div>\r\n @if ( alert.okButtonText || alert.cancelButtonText){\r\n <div class=\"toast-buttons \">\r\n @if ( alert.okButtonText ) {\r\n <button style=\"font-weight: 500;\">{{alert.okButtonText}}</button>\r\n }\r\n @if ( alert.cancelButtonText ){\r\n <button (click)=\"close()\">{{alert.cancelButtonText}}</button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n</div>", styles: [".alert{display:flex;flex-direction:column;min-width:250px;max-width:450px;overflow:hidden;animation:fadeIn .3s ease;border-radius:12px}@keyframes fadeIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.alert-process{width:100%;height:4px;background-color:#0000004f;display:flex}.alert-process-bar{background-color:#ffffff69;height:4px}.alert-body{position:relative;padding:16px;display:flex}.alert-body i{font-size:20;width:22px;height:22px;margin-right:16px}.toast-title{font-weight:500;font-size:16px;line-height:24px}.toast-body{font-weight:400;font-size:14px;line-height:20px}.toast-buttons{margin-top:16px;display:flex;gap:16px}.toast-buttons button{color:#fff;border:none;background-color:transparent;font-size:16px;line-height:24px;padding:0}.toast-buttons button:hover{text-decoration:underline;cursor:pointer}.close{background:transparent;border:none;color:inherit;font-size:16px;cursor:pointer;position:absolute;right:5px;top:5px}.filled{color:#fff}.filled.success{background:#15803d}.filled.error{background:#d92d20}.filled.warning{background:#dc6803}.filled.info{background:#6193d5}.bordered{border:solid 1px;color:#717680}.bordered.success{border-color:#15803d;background:#bbf7d0}.bordered.success .highlighted,.bordered.success button{color:#15803d}.bordered.error{border-color:#d92d20;background:#fee4e2}.bordered.error .highlighted,.bordered.error button{color:#d92d20}.bordered.warning{border-color:#dc6803;background:#fef0c7}.bordered.warning .highlighted,.bordered.warning button{color:#dc6803}.bordered.info{border-color:#6193d5;background:#e4eefb}.bordered.info .highlighted,.bordered.info button{color:#6193d5}\n"] }]
234
+ }], propDecorators: { alert: [{
235
+ type: Input
236
+ }], closeAlert: [{
237
+ type: Output
238
+ }] } });
239
+
240
+ class AlertContainerComponent {
241
+ alertService;
242
+ alerts = [];
243
+ constructor(alertService) {
244
+ this.alertService = alertService;
245
+ }
246
+ ngOnInit() {
247
+ this.alertService.stream.subscribe(alert => {
248
+ this.alerts.push(alert);
249
+ });
250
+ }
251
+ dismis(id) {
252
+ const idx = this.alerts.findIndex(f => f.id == id);
253
+ this.alerts.splice(idx, 1);
254
+ }
255
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AlertContainerComponent, deps: [{ token: PushAlertService }], target: i0.ɵɵFactoryTarget.Component });
256
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: AlertContainerComponent, isStandalone: true, selector: "lib-alert-container", ngImport: i0, template: "<div class=\"alert-container\">\r\n @for (alert of alerts; track alert.id){\r\n <lib-alert\r\n (closeAlert)=\"dismis($event)\"\r\n [alert]=\"alert\">\r\n </lib-alert>\r\n } \r\n</div>\r\n", styles: [".alert-container{position:fixed;top:1rem;right:1rem;display:flex;flex-direction:column;gap:.5rem;z-index:9999}\n"], dependencies: [{ kind: "component", type: AlertComponent, selector: "lib-alert", inputs: ["alert"], outputs: ["closeAlert"] }] });
257
+ }
258
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AlertContainerComponent, decorators: [{
259
+ type: Component,
260
+ args: [{ selector: 'lib-alert-container', imports: [AlertComponent], template: "<div class=\"alert-container\">\r\n @for (alert of alerts; track alert.id){\r\n <lib-alert\r\n (closeAlert)=\"dismis($event)\"\r\n [alert]=\"alert\">\r\n </lib-alert>\r\n } \r\n</div>\r\n", styles: [".alert-container{position:fixed;top:1rem;right:1rem;display:flex;flex-direction:column;gap:.5rem;z-index:9999}\n"] }]
261
+ }], ctorParameters: () => [{ type: PushAlertService }] });
262
+
263
+ class ButtonComponent {
264
+ text = '';
265
+ icon = '';
266
+ rightIcon = '';
267
+ iconOnly = false;
268
+ disabled = false;
269
+ loading = false;
270
+ size = 'm';
271
+ type = 'filled';
272
+ color = 'primary';
273
+ buttonTypeClass = "";
274
+ ngOnInit() {
275
+ this.buttonTypeClass = 'btn-' + this.type + ' btn-' + this.color + "-" + this.type;
276
+ }
277
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
278
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: ButtonComponent, isStandalone: true, selector: "ui-button", inputs: { text: "text", icon: "icon", rightIcon: "rightIcon", iconOnly: "iconOnly", disabled: "disabled", loading: "loading", size: "size", type: "type", color: "color" }, ngImport: i0, template: "<button\r\n [class]=\"'main-btn ' + buttonTypeClass\"\r\n [disabled]=\"disabled || loading\"\r\n [ngClass]=\"{\r\n 'btn-tiny' :size=='t',\r\n 'btn-small' :size=='s', \r\n 'btn-medium' :size=='m',\r\n 'btn-large' :size=='l', \r\n 'btn-gigant' :size=='g'\r\n }\" >\r\n \r\n @if (!loading) {\r\n @if (icon!='' ) {\r\n <i class=\"{{icon}}\"></i>\r\n }\r\n @if (!iconOnly) {\r\n <div class=\"btn-text\" [class.norighticon]=\"rightIcon==''\" [class.noicon]=\"icon==''\">\r\n {{text}}\r\n <ng-content ></ng-content>\r\n </div>\r\n }\r\n @if (rightIcon!='' ) {\r\n <i class=\"{{rightIcon}}\"></i>\r\n }\r\n } @else {\r\n <div class=\"btn-loader-container\"> <div class=\"btn-loader\"></div> </div>\r\n }\r\n</button>", styles: [":host{width:fit-content;display:block}.main-btn{display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;border:none;text-align:center;border-radius:8px;padding:0;white-space:nowrap;outline:none}.main-btn:focus,.main-btn:focus-visible{box-shadow:0 0 0 3px #8230c466}.noicon{padding-left:16px}.norighticon{padding-right:16px}.btn-text{font-weight:500}.btn-tiny{height:22px;min-width:22px}.btn-tiny>.btn-text{font-size:10px;line-height:22px}.btn-tiny i{font-size:14px;line-height:22px;width:22px}.btn-tiny .btn-loader{line-height:10px;width:10px}.btn-small{height:30px;min-width:30px}.btn-small>.btn-text{font-size:12px;line-height:30px}.btn-small i{font-size:16px;line-height:30px;width:30px}.btn-small .btn-loader{line-height:12px;width:12px}.btn-medium{height:38px;min-width:38px}.btn-medium>.btn-text{font-size:14px;line-height:38px}.btn-medium i{font-size:24px;line-height:38px;width:38px}.btn-medium .btn-loader{line-height:14px;width:14px}.btn-large{height:46px;min-width:46px}.btn-large>.btn-text{font-size:16px;line-height:46px}.btn-large i{font-size:24px;line-height:46px;width:46px}.btn-large .btn-loader{line-height:16px;width:16px}.btn-gigant{height:54px;min-width:54px}.btn-gigant>.btn-text{font-size:18px;line-height:54px}.btn-gigant i{font-size:24px;line-height:54px;width:54px}.btn-gigant .btn-loader{line-height:18px;width:18px}.btn-filled{color:#fff;transition:background .3s ease;cursor:pointer}.btn-filled:disabled{cursor:not-allowed;color:#d5d7da}.btn-bordered{border:solid 1px #e9eaeb;background-color:transparent;transition:background .3s ease;cursor:pointer}.btn-bordered:disabled{cursor:not-allowed;color:#d5d7da;border-color:#d5d7da}.btn-ghost{color:#252b37;background-color:transparent;transition:background .3s ease;cursor:pointer}.btn-ghost:disabled{cursor:not-allowed;color:#d5d7da}.btn-primary-filled{background-color:#63277d}.btn-primary-filled:hover{background-color:#4f1f64}.btn-primary-filled:active{background-color:#2d1238}.btn-primary-filled:disabled{background-color:#efe9f2}.btn-primary-bordered{color:#63277d}.btn-primary-bordered:hover{background-color:#efe9f2}.btn-primary-bordered:active{background-color:#cfbcd7}.btn-primary-bordered:disabled{background-color:#efe9f2}.btn-primary-ghost:hover{background-color:#efe9f2}.btn-primary-ghost:active{background-color:#cfbcd7}.btn-primary-ghost:disabled{background-color:transparent}.btn-black-filled{background-color:#0a0d12}.btn-black-filled:hover{background-color:#752bb0}.btn-black-filled:active{background-color:#4e1d76}.btn-black-filled:disabled{background-color:#f5f5f5}.btn-black-bordered{color:#414651}.btn-black-bordered:hover{background-color:#f3eaf9}.btn-black-bordered:active{background-color:#d8bfed}.btn-black-bordered:disabled{background-color:#fafafa}.btn-black-ghost:hover{background-color:#f3eaf9}.btn-black-ghost:active{background-color:#d8bfed}.btn-black-ghost:disabled{background-color:transparent}.btn-green-filled{background-color:#22c55e}.btn-green-filled:hover{background-color:#15803d}.btn-green-filled:active{background-color:#1a2e21}.btn-green-filled:disabled{background-color:#bbf7d0}.btn-green-bordered{color:#22c55e}.btn-green-bordered:hover{background-color:#bbf7d0}.btn-green-bordered:active{background-color:#4ade80}.btn-green-bordered:disabled{background-color:#bbf7d0}.btn-green-ghost:hover{background-color:#bbf7d0}.btn-green-ghost:active{background-color:#4ade80}.btn-green-ghost:disabled{background-color:transparent}.btn-yellow-filled{background-color:#fdb022}.btn-yellow-filled:hover{background-color:#dc6803}.btn-yellow-filled:active{background-color:#792e0d}.btn-yellow-filled:disabled{background-color:#fef0c7}.btn-yellow-bordered{color:#fdb022}.btn-yellow-bordered:hover{background-color:#fef0c7}.btn-yellow-bordered:active{background-color:#fec84b}.btn-yellow-bordered:disabled{background-color:#fef0c7}.btn-yellow-ghost:hover{background-color:#fef0c7}.btn-yellow-ghost:active{background-color:#fec84b}.btn-yellow-ghost:disabled{background-color:transparent}.btn-blue-filled{background-color:#93bbf0}.btn-blue-filled:hover{background-color:#6193d5}.btn-blue-filled:active{background-color:#273b55}.btn-blue-filled:disabled{background-color:#e4eefb}.btn-blue-bordered{color:#93bbf0}.btn-blue-bordered:hover{background-color:#e4eefb}.btn-blue-bordered:active{background-color:#aeccf4}.btn-blue-bordered:disabled{background-color:#e4eefb}.btn-blue-ghost:hover{background-color:#e4eefb}.btn-blue-ghost:active{background-color:#aeccf4}.btn-blue-ghost:disabled{background-color:transparent}.btn-red-filled{background-color:#f97066}.btn-red-filled:hover{background-color:#d92d20}.btn-red-filled:active{background-color:#7a271a}.btn-red-filled:disabled{background-color:#fee4e2}.btn-red-bordered{color:#f97066}.btn-red-bordered:hover{background-color:#fee4e2}.btn-red-bordered:active{background-color:#fda29b}.btn-red-bordered:disabled{background-color:#fee4e2}.btn-red-ghost:hover{background-color:#fee4e2}.btn-red-ghost:active{background-color:#fda29b}.btn-red-ghost:disabled{background-color:transparent}.btn-loader{width:14px;aspect-ratio:1;border-radius:50%;animation:l5 1s infinite linear alternate;margin:2px}.btn-loader-container{line-height:14px;margin:3px 0;display:flex;justify-content:center;width:65px}@keyframes l5{0%{box-shadow:20px 0 #e8dfec,-20px 0 #4f1f64;background:#e8dfec}33%{box-shadow:20px 0 #e8dfec,-20px 0 #4f1f64;background:#4f1f64}66%{box-shadow:20px 0 #4f1f64,-20px 0 #e8dfec;background:#4f1f64}to{box-shadow:20px 0 #4f1f64,-20px 0 #e8dfec;background:#e8dfec}}.btn-loader:before,.btn-loader:after{content:\"\";grid-area:1/1;margin:15%;border-radius:50%;background:inherit;transform:rotate(0) translate(150%);animation:l22 1s infinite}.btn-loader:after{animation-delay:-.5s}@keyframes l22-0{to{transform:rotate(1turn)}}@keyframes l22{to{transform:rotate(1turn) translate(150%)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
279
+ }
280
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ButtonComponent, decorators: [{
281
+ type: Component,
282
+ args: [{ selector: 'ui-button', imports: [CommonModule], template: "<button\r\n [class]=\"'main-btn ' + buttonTypeClass\"\r\n [disabled]=\"disabled || loading\"\r\n [ngClass]=\"{\r\n 'btn-tiny' :size=='t',\r\n 'btn-small' :size=='s', \r\n 'btn-medium' :size=='m',\r\n 'btn-large' :size=='l', \r\n 'btn-gigant' :size=='g'\r\n }\" >\r\n \r\n @if (!loading) {\r\n @if (icon!='' ) {\r\n <i class=\"{{icon}}\"></i>\r\n }\r\n @if (!iconOnly) {\r\n <div class=\"btn-text\" [class.norighticon]=\"rightIcon==''\" [class.noicon]=\"icon==''\">\r\n {{text}}\r\n <ng-content ></ng-content>\r\n </div>\r\n }\r\n @if (rightIcon!='' ) {\r\n <i class=\"{{rightIcon}}\"></i>\r\n }\r\n } @else {\r\n <div class=\"btn-loader-container\"> <div class=\"btn-loader\"></div> </div>\r\n }\r\n</button>", styles: [":host{width:fit-content;display:block}.main-btn{display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;border:none;text-align:center;border-radius:8px;padding:0;white-space:nowrap;outline:none}.main-btn:focus,.main-btn:focus-visible{box-shadow:0 0 0 3px #8230c466}.noicon{padding-left:16px}.norighticon{padding-right:16px}.btn-text{font-weight:500}.btn-tiny{height:22px;min-width:22px}.btn-tiny>.btn-text{font-size:10px;line-height:22px}.btn-tiny i{font-size:14px;line-height:22px;width:22px}.btn-tiny .btn-loader{line-height:10px;width:10px}.btn-small{height:30px;min-width:30px}.btn-small>.btn-text{font-size:12px;line-height:30px}.btn-small i{font-size:16px;line-height:30px;width:30px}.btn-small .btn-loader{line-height:12px;width:12px}.btn-medium{height:38px;min-width:38px}.btn-medium>.btn-text{font-size:14px;line-height:38px}.btn-medium i{font-size:24px;line-height:38px;width:38px}.btn-medium .btn-loader{line-height:14px;width:14px}.btn-large{height:46px;min-width:46px}.btn-large>.btn-text{font-size:16px;line-height:46px}.btn-large i{font-size:24px;line-height:46px;width:46px}.btn-large .btn-loader{line-height:16px;width:16px}.btn-gigant{height:54px;min-width:54px}.btn-gigant>.btn-text{font-size:18px;line-height:54px}.btn-gigant i{font-size:24px;line-height:54px;width:54px}.btn-gigant .btn-loader{line-height:18px;width:18px}.btn-filled{color:#fff;transition:background .3s ease;cursor:pointer}.btn-filled:disabled{cursor:not-allowed;color:#d5d7da}.btn-bordered{border:solid 1px #e9eaeb;background-color:transparent;transition:background .3s ease;cursor:pointer}.btn-bordered:disabled{cursor:not-allowed;color:#d5d7da;border-color:#d5d7da}.btn-ghost{color:#252b37;background-color:transparent;transition:background .3s ease;cursor:pointer}.btn-ghost:disabled{cursor:not-allowed;color:#d5d7da}.btn-primary-filled{background-color:#63277d}.btn-primary-filled:hover{background-color:#4f1f64}.btn-primary-filled:active{background-color:#2d1238}.btn-primary-filled:disabled{background-color:#efe9f2}.btn-primary-bordered{color:#63277d}.btn-primary-bordered:hover{background-color:#efe9f2}.btn-primary-bordered:active{background-color:#cfbcd7}.btn-primary-bordered:disabled{background-color:#efe9f2}.btn-primary-ghost:hover{background-color:#efe9f2}.btn-primary-ghost:active{background-color:#cfbcd7}.btn-primary-ghost:disabled{background-color:transparent}.btn-black-filled{background-color:#0a0d12}.btn-black-filled:hover{background-color:#752bb0}.btn-black-filled:active{background-color:#4e1d76}.btn-black-filled:disabled{background-color:#f5f5f5}.btn-black-bordered{color:#414651}.btn-black-bordered:hover{background-color:#f3eaf9}.btn-black-bordered:active{background-color:#d8bfed}.btn-black-bordered:disabled{background-color:#fafafa}.btn-black-ghost:hover{background-color:#f3eaf9}.btn-black-ghost:active{background-color:#d8bfed}.btn-black-ghost:disabled{background-color:transparent}.btn-green-filled{background-color:#22c55e}.btn-green-filled:hover{background-color:#15803d}.btn-green-filled:active{background-color:#1a2e21}.btn-green-filled:disabled{background-color:#bbf7d0}.btn-green-bordered{color:#22c55e}.btn-green-bordered:hover{background-color:#bbf7d0}.btn-green-bordered:active{background-color:#4ade80}.btn-green-bordered:disabled{background-color:#bbf7d0}.btn-green-ghost:hover{background-color:#bbf7d0}.btn-green-ghost:active{background-color:#4ade80}.btn-green-ghost:disabled{background-color:transparent}.btn-yellow-filled{background-color:#fdb022}.btn-yellow-filled:hover{background-color:#dc6803}.btn-yellow-filled:active{background-color:#792e0d}.btn-yellow-filled:disabled{background-color:#fef0c7}.btn-yellow-bordered{color:#fdb022}.btn-yellow-bordered:hover{background-color:#fef0c7}.btn-yellow-bordered:active{background-color:#fec84b}.btn-yellow-bordered:disabled{background-color:#fef0c7}.btn-yellow-ghost:hover{background-color:#fef0c7}.btn-yellow-ghost:active{background-color:#fec84b}.btn-yellow-ghost:disabled{background-color:transparent}.btn-blue-filled{background-color:#93bbf0}.btn-blue-filled:hover{background-color:#6193d5}.btn-blue-filled:active{background-color:#273b55}.btn-blue-filled:disabled{background-color:#e4eefb}.btn-blue-bordered{color:#93bbf0}.btn-blue-bordered:hover{background-color:#e4eefb}.btn-blue-bordered:active{background-color:#aeccf4}.btn-blue-bordered:disabled{background-color:#e4eefb}.btn-blue-ghost:hover{background-color:#e4eefb}.btn-blue-ghost:active{background-color:#aeccf4}.btn-blue-ghost:disabled{background-color:transparent}.btn-red-filled{background-color:#f97066}.btn-red-filled:hover{background-color:#d92d20}.btn-red-filled:active{background-color:#7a271a}.btn-red-filled:disabled{background-color:#fee4e2}.btn-red-bordered{color:#f97066}.btn-red-bordered:hover{background-color:#fee4e2}.btn-red-bordered:active{background-color:#fda29b}.btn-red-bordered:disabled{background-color:#fee4e2}.btn-red-ghost:hover{background-color:#fee4e2}.btn-red-ghost:active{background-color:#fda29b}.btn-red-ghost:disabled{background-color:transparent}.btn-loader{width:14px;aspect-ratio:1;border-radius:50%;animation:l5 1s infinite linear alternate;margin:2px}.btn-loader-container{line-height:14px;margin:3px 0;display:flex;justify-content:center;width:65px}@keyframes l5{0%{box-shadow:20px 0 #e8dfec,-20px 0 #4f1f64;background:#e8dfec}33%{box-shadow:20px 0 #e8dfec,-20px 0 #4f1f64;background:#4f1f64}66%{box-shadow:20px 0 #4f1f64,-20px 0 #e8dfec;background:#4f1f64}to{box-shadow:20px 0 #4f1f64,-20px 0 #e8dfec;background:#e8dfec}}.btn-loader:before,.btn-loader:after{content:\"\";grid-area:1/1;margin:15%;border-radius:50%;background:inherit;transform:rotate(0) translate(150%);animation:l22 1s infinite}.btn-loader:after{animation-delay:-.5s}@keyframes l22-0{to{transform:rotate(1turn)}}@keyframes l22{to{transform:rotate(1turn) translate(150%)}}\n"] }]
283
+ }], propDecorators: { text: [{
284
+ type: Input
285
+ }], icon: [{
286
+ type: Input
287
+ }], rightIcon: [{
288
+ type: Input
289
+ }], iconOnly: [{
290
+ type: Input
291
+ }], disabled: [{
292
+ type: Input
293
+ }], loading: [{
294
+ type: Input
295
+ }], size: [{
296
+ type: Input
297
+ }], type: [{
298
+ type: Input
299
+ }], color: [{
300
+ type: Input
301
+ }] } });
302
+
303
+ class TableSearcherComponent {
304
+ placeholder = '';
305
+ label = 'Buscar';
306
+ searchOnKeydown = false;
307
+ search = new EventEmitter();
308
+ text = "";
309
+ reset() {
310
+ this.text = '';
311
+ this.search.emit(this.text);
312
+ }
313
+ updateText() {
314
+ if (this.searchOnKeydown) {
315
+ this.search.emit(this.text);
316
+ }
317
+ }
318
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TableSearcherComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
319
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: TableSearcherComponent, isStandalone: true, selector: "table-searcher", inputs: { placeholder: "placeholder", label: "label", searchOnKeydown: "searchOnKeydown" }, outputs: { search: "search" }, ngImport: i0, template: "\r\n<div class=\"searcher\">\r\n <div class=\"fakeinput\">\r\n <i class=\"ri-search-line\"></i>\r\n <input [(ngModel)]=\"text\" type=\"text\" (ngModelChange)=\"updateText()\" (keydown.enter)=\"search.emit(text)\" placeholder=\"{{placeholder}}\">\r\n </div>\r\n <ui-button (click)=\"search.emit(text)\" color=\"black\" type=\"bordered\" rightIcon=\"ri-search-2-line\" size=\"m\">Buscar</ui-button>\r\n <ui-button (click)=\"reset()\" color=\"black\" type=\"bordered\" rightIcon=\"ri-close-circle-line\" size=\"m\">Limpiar</ui-button>\r\n</div>", styles: [".searcher{display:flex;gap:8px;align-items:center;flex-wrap:wrap}@media (max-width: 767px){.searcher{margin-bottom:16px}}.searcher .fakeinput{display:flex;align-items:center;border:solid 1px #e9eaeb;height:40px;padding:2px 1px 2px 10px;border-radius:8px;transition:ease .3s;width:350px}@media (max-width: 767px){.searcher .fakeinput{width:100%}}.searcher .fakeinput i{font-size:24px;margin-right:8px}.searcher .fakeinput input{border:none}.searcher .fakeinput:focus-within{border-color:#4f1f64}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
320
+ }
321
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TableSearcherComponent, decorators: [{
322
+ type: Component,
323
+ args: [{ selector: 'table-searcher', imports: [ButtonComponent, FormsModule], template: "\r\n<div class=\"searcher\">\r\n <div class=\"fakeinput\">\r\n <i class=\"ri-search-line\"></i>\r\n <input [(ngModel)]=\"text\" type=\"text\" (ngModelChange)=\"updateText()\" (keydown.enter)=\"search.emit(text)\" placeholder=\"{{placeholder}}\">\r\n </div>\r\n <ui-button (click)=\"search.emit(text)\" color=\"black\" type=\"bordered\" rightIcon=\"ri-search-2-line\" size=\"m\">Buscar</ui-button>\r\n <ui-button (click)=\"reset()\" color=\"black\" type=\"bordered\" rightIcon=\"ri-close-circle-line\" size=\"m\">Limpiar</ui-button>\r\n</div>", styles: [".searcher{display:flex;gap:8px;align-items:center;flex-wrap:wrap}@media (max-width: 767px){.searcher{margin-bottom:16px}}.searcher .fakeinput{display:flex;align-items:center;border:solid 1px #e9eaeb;height:40px;padding:2px 1px 2px 10px;border-radius:8px;transition:ease .3s;width:350px}@media (max-width: 767px){.searcher .fakeinput{width:100%}}.searcher .fakeinput i{font-size:24px;margin-right:8px}.searcher .fakeinput input{border:none}.searcher .fakeinput:focus-within{border-color:#4f1f64}\n"] }]
324
+ }], propDecorators: { placeholder: [{
325
+ type: Input
326
+ }], label: [{
327
+ type: Input
328
+ }], searchOnKeydown: [{
329
+ type: Input
330
+ }], search: [{
331
+ type: Output
332
+ }] } });
333
+
334
+ class TablePaginationComponent {
335
+ currentPage = 1;
336
+ totalPages = 1;
337
+ size = 25;
338
+ loading = false;
339
+ visiblePages = 3;
340
+ pagesInView = [];
341
+ pageChange = new EventEmitter();
342
+ sizeChange = new EventEmitter();
343
+ get pages() {
344
+ const pages = [];
345
+ const range = Math.floor(this.visiblePages / 2);
346
+ let start = Math.max(1, this.currentPage - range);
347
+ let end = Math.min(this.totalPages, this.currentPage + range);
348
+ if (end === this.totalPages) {
349
+ start = Math.max(1, this.totalPages - (this.visiblePages - 1));
350
+ }
351
+ if (start === 1) {
352
+ end = Math.min(this.totalPages, this.visiblePages);
353
+ }
354
+ if (start > 1) {
355
+ pages.push(1);
356
+ if (start > 2)
357
+ pages.push('...');
358
+ }
359
+ for (let i = start; i <= end; i++) {
360
+ pages.push(i);
361
+ }
362
+ if (end < this.totalPages) {
363
+ if (end < this.totalPages - 1)
364
+ pages.push('...');
365
+ pages.push(this.totalPages);
366
+ }
367
+ return pages;
368
+ }
369
+ changePage(newPage) {
370
+ if (newPage >= 1 && newPage <= this.totalPages && newPage !== this.currentPage) {
371
+ this.currentPage = newPage;
372
+ this.pageChange.emit(this.currentPage);
373
+ }
374
+ }
375
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TablePaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
376
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: TablePaginationComponent, isStandalone: true, selector: "app-table-pagination", inputs: { currentPage: "currentPage", totalPages: "totalPages", size: "size", loading: "loading" }, outputs: { pageChange: "pageChange", sizeChange: "sizeChange" }, ngImport: i0, template: "\r\n<div class=\"table-page\">\r\n <ui-button [disabled]=\"loading || currentPage == 1\" (click)=\"changePage(currentPage - 1)\" size=\"m\" color=\"black\" type=\"bordered\" text=\"Anterior\" icon=\"ri-arrow-left-line\" > </ui-button> \r\n <div class=\"table-numbers\">\r\n @for (p of pages; track $index) {\r\n @if ( p!= '...' ){\r\n <button [disabled]=\"loading\" (click)=\"changePage(+p)\" [ngClass]=\"{'selected':currentPage==p}\" class=\"number\">{{p}}</button>\r\n } @else {\r\n <div class=\"space\">...</div>\r\n }\r\n \r\n }\r\n </div>\r\n <ui-button [disabled]=\"loading || currentPage == totalPages\" (click)=\"changePage(currentPage + 1)\" size=\"m\" color=\"black\" type=\"bordered\" text=\"Siguiente\" rightIcon=\"ri-arrow-right-line\" > </ui-button>\r\n <!-- <div class=\"page-size\">\r\n <select [(ngModel)]=\"size\" (ngModelChange)=\"sizeChange.emit(+size)\" [disabled]=\"loading\">\r\n <option value=\"25\">25</option>\r\n <option value=\"50\">50</option>\r\n <option value=\"100\">100</option>\r\n </select>\r\n elementos por p\u00E1gina\r\n </div> -->\r\n</div>", styles: [".table-page{display:flex;align-items:center;justify-content:space-between;width:100%;gap:20px;padding:16px 24px}.table-numbers{display:flex;align-items:center;justify-content:center;gap:2px;-webkit-user-select:none;user-select:none;min-width:250px}.number{border:none;color:#717680;width:40px;height:40px;background-color:#fff;border-radius:8px;display:flex;align-items:center;justify-content:center;cursor:pointer}.number:hover{background-color:#752bb0}.selected{background-color:#f5f5f5;font-weight:600;color:#752bb0}.space{letter-spacing:5px}.page-size{flex:1 1;display:flex;font-size:13px;color:#717680;align-items:center;justify-content:flex-end}.page-size select{padding:5px 8px;margin-right:10px;color:#717680;border:solid 1px #592371;border-radius:5px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "ngmodule", type: FormsModule }] });
377
+ }
378
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TablePaginationComponent, decorators: [{
379
+ type: Component,
380
+ args: [{ selector: 'app-table-pagination', imports: [CommonModule, ButtonComponent, FormsModule], template: "\r\n<div class=\"table-page\">\r\n <ui-button [disabled]=\"loading || currentPage == 1\" (click)=\"changePage(currentPage - 1)\" size=\"m\" color=\"black\" type=\"bordered\" text=\"Anterior\" icon=\"ri-arrow-left-line\" > </ui-button> \r\n <div class=\"table-numbers\">\r\n @for (p of pages; track $index) {\r\n @if ( p!= '...' ){\r\n <button [disabled]=\"loading\" (click)=\"changePage(+p)\" [ngClass]=\"{'selected':currentPage==p}\" class=\"number\">{{p}}</button>\r\n } @else {\r\n <div class=\"space\">...</div>\r\n }\r\n \r\n }\r\n </div>\r\n <ui-button [disabled]=\"loading || currentPage == totalPages\" (click)=\"changePage(currentPage + 1)\" size=\"m\" color=\"black\" type=\"bordered\" text=\"Siguiente\" rightIcon=\"ri-arrow-right-line\" > </ui-button>\r\n <!-- <div class=\"page-size\">\r\n <select [(ngModel)]=\"size\" (ngModelChange)=\"sizeChange.emit(+size)\" [disabled]=\"loading\">\r\n <option value=\"25\">25</option>\r\n <option value=\"50\">50</option>\r\n <option value=\"100\">100</option>\r\n </select>\r\n elementos por p\u00E1gina\r\n </div> -->\r\n</div>", styles: [".table-page{display:flex;align-items:center;justify-content:space-between;width:100%;gap:20px;padding:16px 24px}.table-numbers{display:flex;align-items:center;justify-content:center;gap:2px;-webkit-user-select:none;user-select:none;min-width:250px}.number{border:none;color:#717680;width:40px;height:40px;background-color:#fff;border-radius:8px;display:flex;align-items:center;justify-content:center;cursor:pointer}.number:hover{background-color:#752bb0}.selected{background-color:#f5f5f5;font-weight:600;color:#752bb0}.space{letter-spacing:5px}.page-size{flex:1 1;display:flex;font-size:13px;color:#717680;align-items:center;justify-content:flex-end}.page-size select{padding:5px 8px;margin-right:10px;color:#717680;border:solid 1px #592371;border-radius:5px}\n"] }]
381
+ }], propDecorators: { currentPage: [{
382
+ type: Input
383
+ }], totalPages: [{
384
+ type: Input
385
+ }], size: [{
386
+ type: Input
387
+ }], loading: [{
388
+ type: Input
389
+ }], pageChange: [{
390
+ type: Output
391
+ }], sizeChange: [{
392
+ type: Output
393
+ }] } });
394
+
395
+ class TableListComponent {
396
+ list = [];
397
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TableListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
398
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: TableListComponent, isStandalone: true, selector: "app-table-list", inputs: { list: "list" }, ngImport: i0, template: "@for (item of list; track $index) {\r\n <div class=\"list-item\">\r\n <i [class]=\"item.icon??'ri-capsule-fill'\"></i>\r\n <div class=\"list-item-data\">\r\n <div>{{item.text}}</div>\r\n <p>{{item.subtext}}</p>\r\n </div> \r\n </div>\r\n\r\n}\r\n", styles: [".list-item{display:flex;margin-bottom:5px;align-items:center}.list-item i{color:#717680;margin-right:5px}.list-item-data p{color:#d5d7da;font-size:13px}\n"] });
399
+ }
400
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TableListComponent, decorators: [{
401
+ type: Component,
402
+ args: [{ selector: 'app-table-list', imports: [], template: "@for (item of list; track $index) {\r\n <div class=\"list-item\">\r\n <i [class]=\"item.icon??'ri-capsule-fill'\"></i>\r\n <div class=\"list-item-data\">\r\n <div>{{item.text}}</div>\r\n <p>{{item.subtext}}</p>\r\n </div> \r\n </div>\r\n\r\n}\r\n", styles: [".list-item{display:flex;margin-bottom:5px;align-items:center}.list-item i{color:#717680;margin-right:5px}.list-item-data p{color:#d5d7da;font-size:13px}\n"] }]
403
+ }], propDecorators: { list: [{
404
+ type: Input
405
+ }] } });
406
+
407
+ class NameInitsPipe {
408
+ transform(value) {
409
+ if (!value) {
410
+ return "";
411
+ }
412
+ const names = value.split(" ");
413
+ if (names.length > 1) {
414
+ return names[0].charAt(0) + names[1].charAt(0).toUpperCase();
415
+ }
416
+ else if (names[0].length >= 2) {
417
+ return names[0].substring(0, 2).toUpperCase();
418
+ }
419
+ else {
420
+ return '';
421
+ }
422
+ }
423
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NameInitsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
424
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: NameInitsPipe, isStandalone: true, name: "nameInitials" });
425
+ }
426
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NameInitsPipe, decorators: [{
427
+ type: Pipe,
428
+ args: [{
429
+ name: 'nameInitials'
430
+ }]
431
+ }] });
432
+
433
+ class TableUserComponent {
434
+ user;
435
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TableUserComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
436
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: TableUserComponent, isStandalone: true, selector: "app-table-user", inputs: { user: "user" }, ngImport: i0, template: "@if (user) {\r\n <div class=\"user-row\">\r\n <div class=\"user-inits\">\r\n {{user.name | nameInitials}}\r\n </div>\r\n <div class=\"user-row-data\">\r\n <div>{{user.name}}</div>\r\n <p>{{user.id}}</p>\r\n </div>\r\n </div>\r\n}@else{\r\n -\r\n}", styles: [".user-inits{width:32px;height:32px;border-radius:50px;border:solid 1px #68269d;background-color:#d8bfed;color:#68269d;display:flex;justify-content:center;align-items:center;margin-right:12px}.user-row{display:flex;align-items:center;width:fit-content}.user-row-data{flex:1 1;font-weight:600;color:#181d27;font-size:14px}.user-row-data p{color:#717680;font-weight:400;font-size:12px;line-height:16px}\n"], dependencies: [{ kind: "pipe", type: NameInitsPipe, name: "nameInitials" }] });
437
+ }
438
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TableUserComponent, decorators: [{
439
+ type: Component,
440
+ args: [{ selector: 'app-table-user', imports: [NameInitsPipe], template: "@if (user) {\r\n <div class=\"user-row\">\r\n <div class=\"user-inits\">\r\n {{user.name | nameInitials}}\r\n </div>\r\n <div class=\"user-row-data\">\r\n <div>{{user.name}}</div>\r\n <p>{{user.id}}</p>\r\n </div>\r\n </div>\r\n}@else{\r\n -\r\n}", styles: [".user-inits{width:32px;height:32px;border-radius:50px;border:solid 1px #68269d;background-color:#d8bfed;color:#68269d;display:flex;justify-content:center;align-items:center;margin-right:12px}.user-row{display:flex;align-items:center;width:fit-content}.user-row-data{flex:1 1;font-weight:600;color:#181d27;font-size:14px}.user-row-data p{color:#717680;font-weight:400;font-size:12px;line-height:16px}\n"] }]
441
+ }], propDecorators: { user: [{
442
+ type: Input
443
+ }] } });
444
+
445
+ const fadeAndRise = trigger('fadeAndRise', [
446
+ transition(':enter', [style({ opacity: 0, maxHeight: '0px' }), animate('.3s ease', style({ opacity: 1, maxHeight: '200px' }))]),
447
+ transition(':leave', [animate('.3s ease', style({ opacity: 0 }))])
448
+ ]);
449
+
450
+ class TooltipComponent {
451
+ tooltip = '';
452
+ left = 0;
453
+ top = 0;
454
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
455
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: TooltipComponent, isStandalone: true, selector: "app-tooltip", ngImport: i0, template: "<div @fadeAndRise class=\"tooltip\" \r\n [style.left]=\"left + 'px'\" [style.top]=\"top + 'px'\" [innerHTML]=\"tooltip\">\r\n</div>", styles: [".tooltip{position:fixed;background-color:#fff;box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;max-width:400px;color:#0a0d12;-webkit-user-select:none;user-select:none;padding:5px 10px;border-radius:4px;font-size:14px;margin-top:5px;transform:translate(-50%);z-index:1000}.tooltip:before{content:\"\";width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #ffffff;position:absolute;left:calc(50% - 8px);top:-8px}\n"], animations: [fadeAndRise] });
456
+ }
457
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TooltipComponent, decorators: [{
458
+ type: Component,
459
+ args: [{ selector: 'app-tooltip', imports: [], animations: [fadeAndRise], template: "<div @fadeAndRise class=\"tooltip\" \r\n [style.left]=\"left + 'px'\" [style.top]=\"top + 'px'\" [innerHTML]=\"tooltip\">\r\n</div>", styles: [".tooltip{position:fixed;background-color:#fff;box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;max-width:400px;color:#0a0d12;-webkit-user-select:none;user-select:none;padding:5px 10px;border-radius:4px;font-size:14px;margin-top:5px;transform:translate(-50%);z-index:1000}.tooltip:before{content:\"\";width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #ffffff;position:absolute;left:calc(50% - 8px);top:-8px}\n"] }]
460
+ }] });
461
+
462
+ class ToolTipDirective {
463
+ elementRef;
464
+ appRef;
465
+ injector;
466
+ tooltip = '';
467
+ componentRef = null;
468
+ constructor(elementRef, appRef, injector) {
469
+ this.elementRef = elementRef;
470
+ this.appRef = appRef;
471
+ this.injector = injector;
472
+ }
473
+ onMouseEnter() {
474
+ if (this.componentRef === null && this.tooltip != '' && this.tooltip != null) {
475
+ this.componentRef = createComponent(TooltipComponent, {
476
+ environmentInjector: this.injector
477
+ });
478
+ this.appRef.attachView(this.componentRef.hostView);
479
+ const domElem = this.componentRef.hostView
480
+ .rootNodes[0];
481
+ document.body.appendChild(domElem);
482
+ this.setTooltipComponentProperties();
483
+ }
484
+ }
485
+ setTooltipComponentProperties() {
486
+ if (this.componentRef !== null) {
487
+ this.componentRef.instance.tooltip = this.tooltip;
488
+ const { left, right, bottom } = this.elementRef.nativeElement.getBoundingClientRect();
489
+ this.componentRef.instance.left = (right - left) / 2 + left;
490
+ this.componentRef.instance.top = bottom;
491
+ }
492
+ }
493
+ onMouseLeave() {
494
+ this.destroy();
495
+ }
496
+ ngOnDestroy() {
497
+ this.destroy();
498
+ }
499
+ destroy() {
500
+ if (this.componentRef !== null) {
501
+ this.appRef.detachView(this.componentRef.hostView);
502
+ this.componentRef.destroy();
503
+ this.componentRef = null;
504
+ }
505
+ }
506
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ToolTipDirective, deps: [{ token: i0.ElementRef }, { token: i0.ApplicationRef }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Directive });
507
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.14", type: ToolTipDirective, isStandalone: true, selector: "[tooltip]", inputs: { tooltip: "tooltip" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" } }, ngImport: i0 });
508
+ }
509
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ToolTipDirective, decorators: [{
510
+ type: Directive,
511
+ args: [{
512
+ selector: '[tooltip]'
513
+ }]
514
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ApplicationRef }, { type: i0.EnvironmentInjector }], propDecorators: { tooltip: [{
515
+ type: Input
516
+ }], onMouseEnter: [{
517
+ type: HostListener,
518
+ args: ['mouseenter']
519
+ }], onMouseLeave: [{
520
+ type: HostListener,
521
+ args: ['mouseleave']
522
+ }] } });
523
+
524
+ const highlightRow = trigger('highlightRow', [
525
+ state('highlighted', style({ backgroundColor: '#efe1f5' })),
526
+ transition('* => highlighted', [
527
+ animate('1000ms ease-in', keyframes([
528
+ style({ backgroundColor: '#ffffff', offset: 0 }),
529
+ style({ backgroundColor: '#efe1f5', offset: 0.3 }),
530
+ style({ backgroundColor: '#ffffff', offset: 1.0 }),
531
+ ]))
532
+ ])
533
+ ]);
534
+
535
+ const animatedRow = trigger('animatedRow', [
536
+ transition(':enter', [
537
+ style({ opacity: 0, transform: 'translateY(-15px)' }),
538
+ animate('300ms ease-out', style({ opacity: 1, transform: 'translateY(0)' })),
539
+ ]),
540
+ transition(':leave', [
541
+ animate('300ms ease-in', style({ opacity: 0, height: 0, padding: 0, margin: 0 }))
542
+ ]),
543
+ ]);
544
+
545
+ class TableComponent {
546
+ columns = [];
547
+ data = [];
548
+ loading = false;
549
+ pages = 0;
550
+ size = 25;
551
+ highlightedId = 0;
552
+ headerText = '';
553
+ totalItems = 0;
554
+ searchEnabled = true;
555
+ searchLabel = 'Buscar';
556
+ searchPlaceholder = 'Buscar';
557
+ striped = false;
558
+ showPagination = true;
559
+ showEmptyMessage = false;
560
+ emptyMessage = 'No hay elementos';
561
+ action = new EventEmitter();
562
+ update = new EventEmitter();
563
+ checkedChange = new EventEmitter();
564
+ checkedIds = new Set();
565
+ sortKey = '';
566
+ sortAsc = true;
567
+ filter = '';
568
+ page = 1;
569
+ getValue(data, key) {
570
+ const col = data.find(col => col.key == key);
571
+ return col?.value ?? '-';
572
+ }
573
+ getFontColor(data, key) {
574
+ const col = data.find(col => col.key == key);
575
+ return 'trc-' + (col?.textColor ?? 'black');
576
+ }
577
+ getBackgroundColor(data, key) {
578
+ const col = data.find(col => col.key == key);
579
+ return col?.color ?? 'transparent';
580
+ }
581
+ isValidRule(data, key) {
582
+ if (!key)
583
+ return true;
584
+ let valid = true;
585
+ key.forEach(k => {
586
+ const col = data.find(col => col.key == k);
587
+ valid = valid && !!(col?.value);
588
+ });
589
+ return valid;
590
+ }
591
+ getIcon(data, key) {
592
+ const col = data.find(col => col.key == key);
593
+ return '<i class="' + col?.icon + '"></i>';
594
+ }
595
+ getList(data, key) {
596
+ const col = data.find(col => col.key == key);
597
+ return col?.list ?? [];
598
+ }
599
+ getUser(data, key) {
600
+ const col = data.find(col => col.key == key);
601
+ return col?.user;
602
+ }
603
+ sortClick(key) {
604
+ if (this.sortKey != key) {
605
+ this.sortKey = key;
606
+ this.sortAsc = true;
607
+ }
608
+ else if (this.sortAsc) {
609
+ this.sortAsc = false;
610
+ }
611
+ else {
612
+ this.sortKey = '';
613
+ this.sortAsc = true;
614
+ }
615
+ this.updateData();
616
+ }
617
+ sizeChabge(newSize) {
618
+ this.size = newSize;
619
+ this.updateData();
620
+ }
621
+ pageChage(newPage) {
622
+ this.page = newPage;
623
+ this.updateData();
624
+ }
625
+ search(text) {
626
+ this.filter = text;
627
+ this.updateData();
628
+ }
629
+ updateData() {
630
+ this.update.emit({
631
+ sortBy: this.sortKey,
632
+ isSortAscending: this.sortAsc,
633
+ pageNumber: this.page,
634
+ pageSize: this.size,
635
+ filter: this.filter
636
+ });
637
+ }
638
+ toggleSelection(id, checked) {
639
+ if (checked) {
640
+ this.checkedIds.add(id);
641
+ }
642
+ else {
643
+ this.checkedIds.delete(id);
644
+ }
645
+ this.areAllSelected();
646
+ this.checkedChange.emit(Array.from(this.checkedIds));
647
+ }
648
+ toggleAll(checked) {
649
+ if (checked) {
650
+ this.data.forEach(item => this.checkedIds.add(item.id));
651
+ }
652
+ else {
653
+ this.checkedIds.clear();
654
+ }
655
+ this.checkedChange.emit(Array.from(this.checkedIds));
656
+ }
657
+ areAllSelected() {
658
+ this.allSelected = this.checkedIds.size === this.data.length;
659
+ }
660
+ allSelected = false;
661
+ ngOnChanges() {
662
+ this.areAllSelected();
663
+ }
664
+ doAction(rowId, key) {
665
+ this.action.emit({ rowId, key });
666
+ }
667
+ resetCheckedIds() {
668
+ this.checkedIds.clear();
669
+ this.checkedChange.emit([]);
670
+ }
671
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
672
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: TableComponent, isStandalone: true, selector: "ui-table", inputs: { columns: "columns", data: "data", loading: "loading", pages: "pages", size: "size", highlightedId: "highlightedId", headerText: "headerText", totalItems: "totalItems", searchEnabled: "searchEnabled", searchLabel: "searchLabel", searchPlaceholder: "searchPlaceholder", striped: "striped", showPagination: "showPagination", showEmptyMessage: "showEmptyMessage", emptyMessage: "emptyMessage" }, outputs: { action: "action", update: "update", checkedChange: "checkedChange" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"table-filters\">\r\n @if (searchEnabled) {\r\n <table-searcher (search)=\"search($event)\" [placeholder]=\"searchPlaceholder\" ></table-searcher>\r\n }\r\n <div class=\"filter-actions\">\r\n <ng-content select=\"[actions]\"></ng-content>\r\n </div>\r\n</div>\r\n<div class=\"table-wrapper\">\r\n @if (headerText) {\r\n <div class=\"table-topbar\"> {{headerText}} <span class=\"hightlited-note\"> {{totalItems}} </span> </div>\r\n }\r\n <div class=\"table-container\"> \r\n <table [class.striped]=\"striped\">\r\n <thead>\r\n <tr>\r\n @for (header of columns; track $index) {\r\n <th>\r\n <div class=\"th-wrap\">{{header.label.toUpperCase() }} \r\n @if (header.sortEnable) {\r\n <div (click)=\"sortClick(header.key)\" [ngClass]=\"{'sort-active':header.key == sortKey}\">\r\n <i [class]=\"(sortAsc||header.key != sortKey)?'ri-arrow-down-line':'ri-arrow-up-line'\"></i> \r\n </div>\r\n }\r\n @if (header.type=='checkbox') {\r\n <ui-checkbox [(ngModel)]=\"allSelected\" (ngModelChange)=\"toggleAll($event)\"></ui-checkbox>\r\n }\r\n </div>\r\n </th> \r\n }\r\n </tr>\r\n </thead>\r\n <tbody>\r\n\r\n @if (loading) {\r\n @for (item of [].constructor(10); track $index) {\r\n <tr class=\"\">\r\n @for (header of columns; track $index) {\r\n <td> <div class=\"row-loader\"></div> </td>\r\n }\r\n </tr> \r\n }\r\n } @else {\r\n @for (row of data; track row.id) {\r\n <tr [@highlightRow]=\"highlightedId === row.id ? 'highlighted' : null\" [class.tr-highlighted]=\"row.highlighted\">\r\n @for (header of columns; track $index) {\r\n \r\n <!-- TIPOS DE HEADERS -->\r\n <td [class]=\"getFontColor(row.data,header.key)\">\r\n @if (header.type == 'text') {\r\n {{ getValue(row.data,header.key) }} \r\n }\r\n @if (header.type == 'icon-list') {\r\n <div class=\"table-icon-wrap\">\r\n @for (alert of getList(row.data,header.key); track $index) {\r\n <i [tooltip]=\"alert.text\" [class]=\"alert.icon + ' alert'\" ></i>\r\n }\r\n </div>\r\n }\r\n @else if (header.type == 'list'){\r\n <app-table-list [list]=\"getList(row.data,header.key)\"></app-table-list> \r\n }\r\n @else if (header.type == 'user'){\r\n <app-table-user [user]=\"getUser(row.data,header.key)\"></app-table-user> \r\n }\r\n @else if (header.type == 'checkbox'){\r\n <ui-checkbox [ngModel]=\"checkedIds.has(row.id)\" (ngModelChange)=\"toggleSelection(row.id,$event)\" ></ui-checkbox> \r\n }\r\n @else if (header.type == 'actions') { \r\n <div class=\"table-actions\">\r\n @for (btn of header.actions; track $index) {\r\n @if (isValidRule(row.data,btn.rule)) {\r\n <ui-button \r\n [disabled]=\"loading\"\r\n [tooltip]=\"btn.tooltip??''\"\r\n size=\"s\"\r\n [iconOnly]=\"btn.text==null\"\r\n [text]=\"btn.text??''\"\r\n [icon]=\"btn.icon??''\"\r\n [color]=\"btn.color\"\r\n (click)=\"doAction(row.id,btn.key)\">\r\n </ui-button> \r\n }\r\n } \r\n </div>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }@empty {\r\n @if (showEmptyMessage) {\r\n <tr> \r\n <td [colSpan]=\"columns.length\">\r\n <div class=\"empty\">{{emptyMessage}} </div>\r\n </td>\r\n </tr>\r\n }\r\n }\r\n }\r\n </tbody>\r\n </table>\r\n </div>\r\n \r\n @if (showPagination) {\r\n <app-table-pagination \r\n [loading]=\"loading\" \r\n [totalPages]=\"pages\" \r\n [size]=\"size\"\r\n (sizeChange)=\"sizeChabge($event)\"\r\n (pageChange)=\"pageChage($event)\">\r\n </app-table-pagination>\r\n }\r\n</div>", styles: [".table-wrapper{overflow:hidden;border:solid 1px #e9eaeb;border-radius:12px}table{width:100%;font-weight:400;color:#535862}table th{font-size:12px;height:44px;font-weight:500;background-color:#fafafa;border-left:solid 6px #fafafa}table th .th-wrap{white-space:nowrap;display:flex;align-items:center}table th .th-wrap div{padding:1px;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;border-radius:50%;margin-left:10px;cursor:pointer;transition:ease .3s;color:#a4a7ae}table th .th-wrap div:hover{color:#592371}table td{font-size:14px;height:64px}table td,table th{padding:4px 24px;vertical-align:middle;border-bottom:solid 1px #e9eaeb}table tr{transition:ease .3s}table tr:hover{background-color:#fafafa}.table-container{width:100%;overflow-x:auto}.table-topbar{padding:20px 24px;font-weight:600;font-size:18px;line-height:28px;gap:16px;display:flex;align-items:center;color:#181d27;border-bottom:solid 1px #e9eaeb}.table-actions{display:flex;gap:2px}.table-icon-wrap{display:flex;justify-content:center;gap:8px;font-size:18px;margin-right:5px}.loader-tr{border-bottom:none!important}.loader-tr td{padding:0}.sort-active{color:#752bb0!important;border:solid 1px}.empty{text-align:center;color:#d5d7da}.table-filters{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;padding:16px 0}.filter-actions{display:flex;gap:8px}.alert{width:24px;height:24px;font-size:18px;background-color:#f04438;color:#fff;border-radius:50%;padding:3px}.loader{height:5px;width:100%;--c:no-repeat linear-gradient(#592371 0 0);background:var(--c),var(--c),#592371;background-size:60% 100%;animation:l16 3s infinite}@keyframes l16{0%{background-position:-150% 0,-150% 0}66%{background-position:250% 0,-150% 0}to{background-position:250% 0,250% 0}}.striped tbody tr:nth-child(odd){background-color:#fafafa;transition:ease .3s}.striped tbody tr:nth-child(odd):hover{background-color:#592371}.tr-highlighted{border-left:solid 6px #16a34a}.trc-primary{color:#592371}.trc-red{color:#f04438}.trc-blue{color:#78aaec}.trc-green{color:#16a34a}.trc-yellow{color:#f79009}.trc-black{color:#181d27}.trc-grey{color:#d5d7da}.row-loader{background:linear-gradient(90deg,#e0e0e0 25%,#f5f5f5,#e0e0e0 75%);height:20px;width:100%;background-size:200% 100%;animation:shimmer 1.5s infinite;border-radius:4px}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }, { kind: "component", type: TableUserComponent, selector: "app-table-user", inputs: ["user"] }, { kind: "component", type: TableListComponent, selector: "app-table-list", inputs: ["list"] }, { kind: "component", type: TableSearcherComponent, selector: "table-searcher", inputs: ["placeholder", "label", "searchOnKeydown"], outputs: ["search"] }, { kind: "component", type: TablePaginationComponent, selector: "app-table-pagination", inputs: ["currentPage", "totalPages", "size", "loading"], outputs: ["pageChange", "sizeChange"] }, { kind: "directive", type: ToolTipDirective, selector: "[tooltip]", inputs: ["tooltip"] }, { kind: "component", type: CheckboxComponent, selector: "ui-checkbox", inputs: ["label", "placeholder", "disabled", "loading"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], animations: [highlightRow, animatedRow] });
673
+ }
674
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TableComponent, decorators: [{
675
+ type: Component,
676
+ args: [{ selector: 'ui-table', imports: [CommonModule, ButtonComponent, TableUserComponent, TableListComponent, TableSearcherComponent,
677
+ TablePaginationComponent, ToolTipDirective, CheckboxComponent, FormsModule], animations: [highlightRow, animatedRow], template: "<div class=\"table-filters\">\r\n @if (searchEnabled) {\r\n <table-searcher (search)=\"search($event)\" [placeholder]=\"searchPlaceholder\" ></table-searcher>\r\n }\r\n <div class=\"filter-actions\">\r\n <ng-content select=\"[actions]\"></ng-content>\r\n </div>\r\n</div>\r\n<div class=\"table-wrapper\">\r\n @if (headerText) {\r\n <div class=\"table-topbar\"> {{headerText}} <span class=\"hightlited-note\"> {{totalItems}} </span> </div>\r\n }\r\n <div class=\"table-container\"> \r\n <table [class.striped]=\"striped\">\r\n <thead>\r\n <tr>\r\n @for (header of columns; track $index) {\r\n <th>\r\n <div class=\"th-wrap\">{{header.label.toUpperCase() }} \r\n @if (header.sortEnable) {\r\n <div (click)=\"sortClick(header.key)\" [ngClass]=\"{'sort-active':header.key == sortKey}\">\r\n <i [class]=\"(sortAsc||header.key != sortKey)?'ri-arrow-down-line':'ri-arrow-up-line'\"></i> \r\n </div>\r\n }\r\n @if (header.type=='checkbox') {\r\n <ui-checkbox [(ngModel)]=\"allSelected\" (ngModelChange)=\"toggleAll($event)\"></ui-checkbox>\r\n }\r\n </div>\r\n </th> \r\n }\r\n </tr>\r\n </thead>\r\n <tbody>\r\n\r\n @if (loading) {\r\n @for (item of [].constructor(10); track $index) {\r\n <tr class=\"\">\r\n @for (header of columns; track $index) {\r\n <td> <div class=\"row-loader\"></div> </td>\r\n }\r\n </tr> \r\n }\r\n } @else {\r\n @for (row of data; track row.id) {\r\n <tr [@highlightRow]=\"highlightedId === row.id ? 'highlighted' : null\" [class.tr-highlighted]=\"row.highlighted\">\r\n @for (header of columns; track $index) {\r\n \r\n <!-- TIPOS DE HEADERS -->\r\n <td [class]=\"getFontColor(row.data,header.key)\">\r\n @if (header.type == 'text') {\r\n {{ getValue(row.data,header.key) }} \r\n }\r\n @if (header.type == 'icon-list') {\r\n <div class=\"table-icon-wrap\">\r\n @for (alert of getList(row.data,header.key); track $index) {\r\n <i [tooltip]=\"alert.text\" [class]=\"alert.icon + ' alert'\" ></i>\r\n }\r\n </div>\r\n }\r\n @else if (header.type == 'list'){\r\n <app-table-list [list]=\"getList(row.data,header.key)\"></app-table-list> \r\n }\r\n @else if (header.type == 'user'){\r\n <app-table-user [user]=\"getUser(row.data,header.key)\"></app-table-user> \r\n }\r\n @else if (header.type == 'checkbox'){\r\n <ui-checkbox [ngModel]=\"checkedIds.has(row.id)\" (ngModelChange)=\"toggleSelection(row.id,$event)\" ></ui-checkbox> \r\n }\r\n @else if (header.type == 'actions') { \r\n <div class=\"table-actions\">\r\n @for (btn of header.actions; track $index) {\r\n @if (isValidRule(row.data,btn.rule)) {\r\n <ui-button \r\n [disabled]=\"loading\"\r\n [tooltip]=\"btn.tooltip??''\"\r\n size=\"s\"\r\n [iconOnly]=\"btn.text==null\"\r\n [text]=\"btn.text??''\"\r\n [icon]=\"btn.icon??''\"\r\n [color]=\"btn.color\"\r\n (click)=\"doAction(row.id,btn.key)\">\r\n </ui-button> \r\n }\r\n } \r\n </div>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }@empty {\r\n @if (showEmptyMessage) {\r\n <tr> \r\n <td [colSpan]=\"columns.length\">\r\n <div class=\"empty\">{{emptyMessage}} </div>\r\n </td>\r\n </tr>\r\n }\r\n }\r\n }\r\n </tbody>\r\n </table>\r\n </div>\r\n \r\n @if (showPagination) {\r\n <app-table-pagination \r\n [loading]=\"loading\" \r\n [totalPages]=\"pages\" \r\n [size]=\"size\"\r\n (sizeChange)=\"sizeChabge($event)\"\r\n (pageChange)=\"pageChage($event)\">\r\n </app-table-pagination>\r\n }\r\n</div>", styles: [".table-wrapper{overflow:hidden;border:solid 1px #e9eaeb;border-radius:12px}table{width:100%;font-weight:400;color:#535862}table th{font-size:12px;height:44px;font-weight:500;background-color:#fafafa;border-left:solid 6px #fafafa}table th .th-wrap{white-space:nowrap;display:flex;align-items:center}table th .th-wrap div{padding:1px;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;border-radius:50%;margin-left:10px;cursor:pointer;transition:ease .3s;color:#a4a7ae}table th .th-wrap div:hover{color:#592371}table td{font-size:14px;height:64px}table td,table th{padding:4px 24px;vertical-align:middle;border-bottom:solid 1px #e9eaeb}table tr{transition:ease .3s}table tr:hover{background-color:#fafafa}.table-container{width:100%;overflow-x:auto}.table-topbar{padding:20px 24px;font-weight:600;font-size:18px;line-height:28px;gap:16px;display:flex;align-items:center;color:#181d27;border-bottom:solid 1px #e9eaeb}.table-actions{display:flex;gap:2px}.table-icon-wrap{display:flex;justify-content:center;gap:8px;font-size:18px;margin-right:5px}.loader-tr{border-bottom:none!important}.loader-tr td{padding:0}.sort-active{color:#752bb0!important;border:solid 1px}.empty{text-align:center;color:#d5d7da}.table-filters{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;padding:16px 0}.filter-actions{display:flex;gap:8px}.alert{width:24px;height:24px;font-size:18px;background-color:#f04438;color:#fff;border-radius:50%;padding:3px}.loader{height:5px;width:100%;--c:no-repeat linear-gradient(#592371 0 0);background:var(--c),var(--c),#592371;background-size:60% 100%;animation:l16 3s infinite}@keyframes l16{0%{background-position:-150% 0,-150% 0}66%{background-position:250% 0,-150% 0}to{background-position:250% 0,250% 0}}.striped tbody tr:nth-child(odd){background-color:#fafafa;transition:ease .3s}.striped tbody tr:nth-child(odd):hover{background-color:#592371}.tr-highlighted{border-left:solid 6px #16a34a}.trc-primary{color:#592371}.trc-red{color:#f04438}.trc-blue{color:#78aaec}.trc-green{color:#16a34a}.trc-yellow{color:#f79009}.trc-black{color:#181d27}.trc-grey{color:#d5d7da}.row-loader{background:linear-gradient(90deg,#e0e0e0 25%,#f5f5f5,#e0e0e0 75%);height:20px;width:100%;background-size:200% 100%;animation:shimmer 1.5s infinite;border-radius:4px}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}\n"] }]
678
+ }], propDecorators: { columns: [{
679
+ type: Input
680
+ }], data: [{
681
+ type: Input
682
+ }], loading: [{
683
+ type: Input
684
+ }], pages: [{
685
+ type: Input
686
+ }], size: [{
687
+ type: Input
688
+ }], highlightedId: [{
689
+ type: Input
690
+ }], headerText: [{
691
+ type: Input
692
+ }], totalItems: [{
693
+ type: Input
694
+ }], searchEnabled: [{
695
+ type: Input
696
+ }], searchLabel: [{
697
+ type: Input
698
+ }], searchPlaceholder: [{
699
+ type: Input
700
+ }], striped: [{
701
+ type: Input
702
+ }], showPagination: [{
703
+ type: Input
704
+ }], showEmptyMessage: [{
705
+ type: Input
706
+ }], emptyMessage: [{
707
+ type: Input
708
+ }], action: [{
709
+ type: Output
710
+ }], update: [{
711
+ type: Output
712
+ }], checkedChange: [{
713
+ type: Output
714
+ }] } });
715
+
716
+ ;
717
+ ;
718
+
719
+ const pushTop = trigger('pushTop', [
720
+ transition(':enter', [style({ opacity: 0, transform: 'translateY(20px)' }), animate('.3s ease', style({ opacity: 1, transform: 'translateY(0)' }))]),
721
+ transition(':leave', [animate('.3s ease', style({ opacity: 0, transform: 'translateY(-20px)' }))])
722
+ ]);
723
+
724
+ const sideModal = trigger('sideModal', [
725
+ state('visible', style({ transform: 'translateX(0)' })),
726
+ state('hidden', style({ transform: 'translateX(100%)' })),
727
+ // animación al CREARSE
728
+ transition('void => visible', [
729
+ style({ opacity: .8, transform: 'translateX(100%)' }),
730
+ animate('.5s ease')
731
+ ]),
732
+ // animación al CERRAR
733
+ transition('visible => hidden', [
734
+ animate('.5s ease')
735
+ ])
736
+ ]);
737
+ const fadeBackdrop = trigger('fadeBackdrop', [
738
+ state('visible', style({ opacity: 1 })),
739
+ state('hidden', style({ opacity: 0 })),
740
+ transition('void => visible', [
741
+ style({ opacity: 0 }),
742
+ animate('300ms ease-out')
743
+ ]),
744
+ transition('visible => hidden', [
745
+ animate('300ms ease-in')
746
+ ])
747
+ ]);
748
+
749
+ const simpleFade = trigger('simpleFade', [
750
+ transition(':enter', [style({ opacity: 0 }), animate('.3s ease', style({ opacity: 1 }))]),
751
+ transition(':leave', [animate('.3s ease', style({ opacity: 0 }))])
752
+ ]);
753
+
754
+ const base = createValueAccessor();
755
+ class SelectComponent extends base {
756
+ icon = ''; // Icono externo
757
+ iconColor = 'primary'; //color de ícono externo
758
+ internalIcon = ''; //Icono interno
759
+ size = 'm'; // tamaño general del input
760
+ label = '';
761
+ error = '';
762
+ tip = '';
763
+ disabled = false;
764
+ nullable = false;
765
+ options = [];
766
+ showSubtitle = false;
767
+ overlayPositions = [
768
+ {
769
+ originX: 'start',
770
+ originY: 'bottom',
771
+ overlayX: 'start',
772
+ overlayY: 'top'
773
+ },
774
+ {
775
+ originX: 'start',
776
+ originY: 'top',
777
+ overlayX: 'start',
778
+ overlayY: 'bottom'
779
+ }
780
+ ];
781
+ open = false;
782
+ emptyText = '- Seleccionar -';
783
+ renderer = inject(Renderer2);
784
+ toggleButton;
785
+ unlistener;
786
+ ngOnInit() {
787
+ this.emptyText = this.disabled ? '-' : '- Seleccionar -';
788
+ }
789
+ openList() {
790
+ if (!this.disabled) {
791
+ this.open = !this.open;
792
+ if (this.open) {
793
+ setTimeout(() => {
794
+ this.unlistener = this.renderer.listen('window', 'click', (e) => {
795
+ if (!this.toggleButton.nativeElement.contains(e.target)) {
796
+ this.open = false;
797
+ this.unlistener();
798
+ }
799
+ });
800
+ }, 200);
801
+ }
802
+ }
803
+ }
804
+ selectOption(option) {
805
+ this.open = false;
806
+ this.unlistener();
807
+ this.notifyChange(option);
808
+ }
809
+ //( overlay)
810
+ closeList() {
811
+ this.open = false;
812
+ }
813
+ openListOverlay() {
814
+ if (!this.disabled) {
815
+ this.open = !this.open;
816
+ }
817
+ }
818
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
819
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: SelectComponent, isStandalone: true, selector: "ui-select", inputs: { icon: "icon", iconColor: "iconColor", internalIcon: "internalIcon", size: "size", label: "label", error: "error", tip: "tip", disabled: "disabled", nullable: "nullable", options: "options", showSubtitle: "showSubtitle" }, providers: [
820
+ {
821
+ provide: NG_VALUE_ACCESSOR,
822
+ useExisting: forwardRef(() => SelectComponent),
823
+ multi: true
824
+ }
825
+ ], viewQueries: [{ propertyName: "toggleButton", first: true, predicate: ["inputwrapp"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"input-wrapper \">\r\n @if (icon) {\r\n <i class=\"input-externalicon f-{{iconColor}} {{icon}}\"></i>\r\n }\r\n <div class=\"input-elements\" [style]=\"icon?'max-width: calc(100% - 34px);':''\">\r\n @if (label) {\r\n <div class=\"label inputlabel\" [class.font-error]=\"error\">\r\n {{label}} \r\n </div>\r\n }\r\n <div class=\"fakeinput-wrapp\" #inputwrapp cdkOverlayOrigin #trigger=\"cdkOverlayOrigin\" > \r\n\r\n <!-- INPUT -->\r\n <div (click)=\"openList()\" class=\"fakeinput\" [ngClass]=\"{'activeselect':open, 'errorinput':error, 'disabledinput':disabled}\" style=\"cursor: pointer;\">\r\n @if (internalIcon) {\r\n <i class=\"input-internalicon-{{size}} {{internalIcon}}\" ></i>\r\n }\r\n <div class=\"fakeinput-content\">{{(value?.text || emptyText)}}</div>\r\n @if (!disabled) {\r\n <i class=\"ri-arrow-down-s-line\"></i>\r\n }\r\n </div> \r\n <!-- DESPLEGABLE -->\r\n @if (open) {\r\n\r\n <ng-template\r\n cdkConnectedOverlay\r\n [cdkConnectedOverlayOrigin]=\"trigger\"\r\n [cdkConnectedOverlayOpen]=\"open\"\r\n [cdkConnectedOverlayHasBackdrop]=\"true\"\r\n (backdropClick)=\"closeList()\"\r\n [cdkConnectedOverlayWidth]=\"trigger.elementRef.nativeElement.offsetWidth\"\r\n [cdkConnectedOverlayPositions]=\"overlayPositions\"\r\n >\r\n\r\n <div class=\"input-options\" @fadeAndRise >\r\n <!-- OPCIONES -->\r\n <div class=\"input-option-scroll\">\r\n @if (options.length > 0 && nullable) {\r\n <div (click)=\"selectOption(null)\" class=\"input-option \" style=\"padding: 3px;\" >- Ninguno -</div>\r\n }\r\n\r\n @for (option of options; track $index) {\r\n <div (click)=\"selectOption(option)\" class=\"input-option\">\r\n <div style=\"padding: 2px;\">\r\n <div class=\"f-medium\">{{option.text }}</div>\r\n <div *ngIf=\"showSubtitle\" class=\"f-extralight\">{{option.detail}}</div>\r\n </div>\r\n </div>\r\n }\r\n @if (options.length == 0) {\r\n <div class=\"fakeinput-alert t-disabled\">No hay elementos para mostrar</div>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n }\r\n\r\n </div>\r\n <!-- ALERTS -->\r\n @if (tip) {\r\n <div class=\"fakeinput-alert tip\">{{tip}}</div>\r\n }\r\n @if (error) {\r\n <div class=\"fakeinput-alert font-error\">{{error}}</div>\r\n }\r\n </div>\r\n</div>", styles: [":host{width:100%}.input-container{flex:1 1;padding:3px;overflow:hidden}.pad-s{padding:0}.pad-l{padding:5px}.input-options{position:absolute;border-radius:8px;background-color:#fff;box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;left:0;font-size:13px;z-index:50;overflow:hidden}.input-option{line-height:15px;display:flex;align-items:center;padding:7px 15px;border-bottom:solid 1px #efe9f2;-webkit-user-select:none;user-select:none;transition:ease .3s}.input-option-focused{background-color:#592371}.input-option:hover{background-color:#f3eaf9;cursor:pointer}.input-option-scroll{padding:0 3px;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px #e9eaeb;width:100%;margin-top:2px}.input-option-scroll-focused{background-color:#cfbcd7}.input-option-scroll-btns{border-top:solid 1px #e9eaeb;padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:#fff;border:solid 1px #e9eaeb;padding:4px 10px;border-radius:10px}.input-option-scroll app-checkbox{width:100%}.input-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.input-externalicon{margin-right:8px;font-size:26px;height:26px;width:26px}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon-s{color:#e9eaeb;font-size:17px}.input-internalicon-m{color:#e9eaeb;font-size:20px}.input-internalicon-l{color:#e9eaeb;font-size:24px}.label{font-size:14px;line-height:20px;font-weight:400;color:#0a0d12;margin-bottom:8px}.inputlabel-mini{font-size:12.5px;line-height:15px}.inputlabel-s{font-size:14px}.inputlabel-m{font-size:16px}.inputlabel-l{font-size:17px}.fakeinput{border-radius:8px;overflow:hidden;border:solid 1px #e9eaeb;display:flex;align-items:center;font-size:13px;padding-left:5px;-webkit-user-select:none;user-select:none;background-color:#fff;transition:ease .3s;height:40px}.fakeinput-wrapp{position:relative}.fakeinput-content{margin:0 5px;flex:1 1;padding:9px 0;overflow:hidden;white-space:nowrap}.fakeinput-content i{font-size:20px}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{padding:5px;font-size:14px;flex-grow:1;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:#d5d7da}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:#e9eaeb;color:#252b37}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:#e9eaeb}.fakeinput-button:disabled{background-color:#e9eaeb;color:#f04438}.fakeinput-button:enabled:hover{cursor:pointer;background-color:#cfbcd7;color:#fff}.fakeinput-button:enabled:active{background-color:#4a1d5e}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:#e9eaeb}.fakeinput:focus-within{box-shadow:0 0 3px #63277d}.fakeinput:focus-within button{background-color:#592371;color:#fff}.fakeinput:focus-within button:enabled:hover{cursor:pointer;background-color:#cfbcd7;color:#fff}.fakeinput:focus-within button:enabled:active{background-color:#4f1f64}.fakeinput:hover{border-color:#a4a7ae;cursor:text}.activeselect{border-color:#4f1f64}.inputpadnone{padding:0}.inputpadmini{padding:4px 5px}.inputpad0{padding:5px 10px}.inputpad1{padding:10px 15px}.inputpad2{padding:10px 20px}.errorinput{border-color:#f04438}.t-disabled{color:#d5d7da;padding:5px;text-align:center}.disabledinput{background-color:#fafafa -disabled;color:#252b37}.disabledinput ::ng-deep input{color:#252b37}.editor{border:none;border-radius:8px}.editor ::ng-deep .NgxEditor__MenuBar{border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:1px solid #e9eaeb}.editor ::ng-deep .NgxEditor__Content{min-height:100px}.editor ::ng-deep .NgxEditor{border-top-left-radius:0;border-top-right-radius:0;background-color:transparent;border:none}.editor.onfocus ::ng-deep .NgxEditor__MenuBar{display:none}.editor.onfocus:focus-within ::ng-deep .NgxEditor__MenuBar{display:flex}.fakeinput-files{display:flex;align-items:center;border:dashed #e9eaeb 1px;padding:2px;border-radius:8px}.input-files{display:flex;align-items:center;flex-wrap:wrap;padding:0 10px;width:100%;min-height:30px}.input-file{display:flex;align-items:center;padding:0 5px;font-size:14px;height:30px;overflow:hidden;background-color:#fff;width:fit-content;border-radius:8px;margin:2px;border:solid 1px #f79009;transition:ease .3s}.input-file:hover{cursor:pointer;color:#592371}.input-file i{width:18px;height:18px;font-size:18px;color:#e9eaeb;margin-right:5px}.inputlabel{display:flex;align-items:center}.f-primary{color:#592371}.f{color:#cfbcd7}.f-secondary{color:#752bb0}.f-error{color:#f04438}.f-grey{color:#d5d7da}.font-error{color:#f04438}.tip{color:#592371}.item-disabled{color:#d5d7da}.item-disabled:hover{background-color:#fff;cursor:not-allowed}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1$2.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1$2.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }], animations: [fadeAndRise] });
826
+ }
827
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SelectComponent, decorators: [{
828
+ type: Component,
829
+ args: [{ selector: 'ui-select', imports: [CommonModule, OverlayModule], providers: [
830
+ {
831
+ provide: NG_VALUE_ACCESSOR,
832
+ useExisting: forwardRef(() => SelectComponent),
833
+ multi: true
834
+ }
835
+ ], animations: [fadeAndRise], template: "<div class=\"input-wrapper \">\r\n @if (icon) {\r\n <i class=\"input-externalicon f-{{iconColor}} {{icon}}\"></i>\r\n }\r\n <div class=\"input-elements\" [style]=\"icon?'max-width: calc(100% - 34px);':''\">\r\n @if (label) {\r\n <div class=\"label inputlabel\" [class.font-error]=\"error\">\r\n {{label}} \r\n </div>\r\n }\r\n <div class=\"fakeinput-wrapp\" #inputwrapp cdkOverlayOrigin #trigger=\"cdkOverlayOrigin\" > \r\n\r\n <!-- INPUT -->\r\n <div (click)=\"openList()\" class=\"fakeinput\" [ngClass]=\"{'activeselect':open, 'errorinput':error, 'disabledinput':disabled}\" style=\"cursor: pointer;\">\r\n @if (internalIcon) {\r\n <i class=\"input-internalicon-{{size}} {{internalIcon}}\" ></i>\r\n }\r\n <div class=\"fakeinput-content\">{{(value?.text || emptyText)}}</div>\r\n @if (!disabled) {\r\n <i class=\"ri-arrow-down-s-line\"></i>\r\n }\r\n </div> \r\n <!-- DESPLEGABLE -->\r\n @if (open) {\r\n\r\n <ng-template\r\n cdkConnectedOverlay\r\n [cdkConnectedOverlayOrigin]=\"trigger\"\r\n [cdkConnectedOverlayOpen]=\"open\"\r\n [cdkConnectedOverlayHasBackdrop]=\"true\"\r\n (backdropClick)=\"closeList()\"\r\n [cdkConnectedOverlayWidth]=\"trigger.elementRef.nativeElement.offsetWidth\"\r\n [cdkConnectedOverlayPositions]=\"overlayPositions\"\r\n >\r\n\r\n <div class=\"input-options\" @fadeAndRise >\r\n <!-- OPCIONES -->\r\n <div class=\"input-option-scroll\">\r\n @if (options.length > 0 && nullable) {\r\n <div (click)=\"selectOption(null)\" class=\"input-option \" style=\"padding: 3px;\" >- Ninguno -</div>\r\n }\r\n\r\n @for (option of options; track $index) {\r\n <div (click)=\"selectOption(option)\" class=\"input-option\">\r\n <div style=\"padding: 2px;\">\r\n <div class=\"f-medium\">{{option.text }}</div>\r\n <div *ngIf=\"showSubtitle\" class=\"f-extralight\">{{option.detail}}</div>\r\n </div>\r\n </div>\r\n }\r\n @if (options.length == 0) {\r\n <div class=\"fakeinput-alert t-disabled\">No hay elementos para mostrar</div>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n }\r\n\r\n </div>\r\n <!-- ALERTS -->\r\n @if (tip) {\r\n <div class=\"fakeinput-alert tip\">{{tip}}</div>\r\n }\r\n @if (error) {\r\n <div class=\"fakeinput-alert font-error\">{{error}}</div>\r\n }\r\n </div>\r\n</div>", styles: [":host{width:100%}.input-container{flex:1 1;padding:3px;overflow:hidden}.pad-s{padding:0}.pad-l{padding:5px}.input-options{position:absolute;border-radius:8px;background-color:#fff;box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;left:0;font-size:13px;z-index:50;overflow:hidden}.input-option{line-height:15px;display:flex;align-items:center;padding:7px 15px;border-bottom:solid 1px #efe9f2;-webkit-user-select:none;user-select:none;transition:ease .3s}.input-option-focused{background-color:#592371}.input-option:hover{background-color:#f3eaf9;cursor:pointer}.input-option-scroll{padding:0 3px;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px #e9eaeb;width:100%;margin-top:2px}.input-option-scroll-focused{background-color:#cfbcd7}.input-option-scroll-btns{border-top:solid 1px #e9eaeb;padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:#fff;border:solid 1px #e9eaeb;padding:4px 10px;border-radius:10px}.input-option-scroll app-checkbox{width:100%}.input-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.input-externalicon{margin-right:8px;font-size:26px;height:26px;width:26px}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon-s{color:#e9eaeb;font-size:17px}.input-internalicon-m{color:#e9eaeb;font-size:20px}.input-internalicon-l{color:#e9eaeb;font-size:24px}.label{font-size:14px;line-height:20px;font-weight:400;color:#0a0d12;margin-bottom:8px}.inputlabel-mini{font-size:12.5px;line-height:15px}.inputlabel-s{font-size:14px}.inputlabel-m{font-size:16px}.inputlabel-l{font-size:17px}.fakeinput{border-radius:8px;overflow:hidden;border:solid 1px #e9eaeb;display:flex;align-items:center;font-size:13px;padding-left:5px;-webkit-user-select:none;user-select:none;background-color:#fff;transition:ease .3s;height:40px}.fakeinput-wrapp{position:relative}.fakeinput-content{margin:0 5px;flex:1 1;padding:9px 0;overflow:hidden;white-space:nowrap}.fakeinput-content i{font-size:20px}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{padding:5px;font-size:14px;flex-grow:1;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:#d5d7da}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:#e9eaeb;color:#252b37}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:#e9eaeb}.fakeinput-button:disabled{background-color:#e9eaeb;color:#f04438}.fakeinput-button:enabled:hover{cursor:pointer;background-color:#cfbcd7;color:#fff}.fakeinput-button:enabled:active{background-color:#4a1d5e}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:#e9eaeb}.fakeinput:focus-within{box-shadow:0 0 3px #63277d}.fakeinput:focus-within button{background-color:#592371;color:#fff}.fakeinput:focus-within button:enabled:hover{cursor:pointer;background-color:#cfbcd7;color:#fff}.fakeinput:focus-within button:enabled:active{background-color:#4f1f64}.fakeinput:hover{border-color:#a4a7ae;cursor:text}.activeselect{border-color:#4f1f64}.inputpadnone{padding:0}.inputpadmini{padding:4px 5px}.inputpad0{padding:5px 10px}.inputpad1{padding:10px 15px}.inputpad2{padding:10px 20px}.errorinput{border-color:#f04438}.t-disabled{color:#d5d7da;padding:5px;text-align:center}.disabledinput{background-color:#fafafa -disabled;color:#252b37}.disabledinput ::ng-deep input{color:#252b37}.editor{border:none;border-radius:8px}.editor ::ng-deep .NgxEditor__MenuBar{border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:1px solid #e9eaeb}.editor ::ng-deep .NgxEditor__Content{min-height:100px}.editor ::ng-deep .NgxEditor{border-top-left-radius:0;border-top-right-radius:0;background-color:transparent;border:none}.editor.onfocus ::ng-deep .NgxEditor__MenuBar{display:none}.editor.onfocus:focus-within ::ng-deep .NgxEditor__MenuBar{display:flex}.fakeinput-files{display:flex;align-items:center;border:dashed #e9eaeb 1px;padding:2px;border-radius:8px}.input-files{display:flex;align-items:center;flex-wrap:wrap;padding:0 10px;width:100%;min-height:30px}.input-file{display:flex;align-items:center;padding:0 5px;font-size:14px;height:30px;overflow:hidden;background-color:#fff;width:fit-content;border-radius:8px;margin:2px;border:solid 1px #f79009;transition:ease .3s}.input-file:hover{cursor:pointer;color:#592371}.input-file i{width:18px;height:18px;font-size:18px;color:#e9eaeb;margin-right:5px}.inputlabel{display:flex;align-items:center}.f-primary{color:#592371}.f{color:#cfbcd7}.f-secondary{color:#752bb0}.f-error{color:#f04438}.f-grey{color:#d5d7da}.font-error{color:#f04438}.tip{color:#592371}.item-disabled{color:#d5d7da}.item-disabled:hover{background-color:#fff;cursor:not-allowed}\n"] }]
836
+ }], propDecorators: { icon: [{
837
+ type: Input
838
+ }], iconColor: [{
839
+ type: Input
840
+ }], internalIcon: [{
841
+ type: Input
842
+ }], size: [{
843
+ type: Input
844
+ }], label: [{
845
+ type: Input
846
+ }], error: [{
847
+ type: Input
848
+ }], tip: [{
849
+ type: Input
850
+ }], disabled: [{
851
+ type: Input
852
+ }], nullable: [{
853
+ type: Input
854
+ }], options: [{
855
+ type: Input
856
+ }], showSubtitle: [{
857
+ type: Input
858
+ }], toggleButton: [{
859
+ type: ViewChild,
860
+ args: ['inputwrapp']
861
+ }] } });
862
+
863
+ class InputComponent {
864
+ icon = ''; // Icono externo
865
+ iconColor = 'secondary'; //color de ícono externo
866
+ internalIcon = ''; //Icono interno
867
+ size = 'm'; // tamaño general del input
868
+ // TEXTO
869
+ label = '';
870
+ error = '';
871
+ tip = '';
872
+ // FUNCTIONS
873
+ disabled = false;
874
+ clickButton = new EventEmitter();
875
+ disableBtn = false;
876
+ disableButton() {
877
+ this.clickButton.emit();
878
+ this.disableBtn = true;
879
+ setTimeout(() => {
880
+ this.disableBtn = false;
881
+ }, 200);
882
+ }
883
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
884
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: InputComponent, isStandalone: true, selector: "ui-input", inputs: { icon: "icon", iconColor: "iconColor", internalIcon: "internalIcon", size: "size", label: "label", error: "error", tip: "tip", disabled: "disabled" }, outputs: { clickButton: "clickButton" }, ngImport: i0, template: "<div class=\"input-wrapper\">\r\n \r\n @if (icon) {\r\n <i class=\"input-externalicon f-{{iconColor}} {{icon}}\"></i>\r\n }\r\n <div class=\"input-elements\" [style]=\"icon?'max-width: calc(100% - 34px);':''\">\r\n \r\n @if (label) {\r\n <div class=\"label inputlabel\" [class.font-error]=\"error\">\r\n {{label}} \r\n </div>\r\n }\r\n \r\n <div class=\"fakeinput\" [ngClass]=\"{'errorinput':error, 'disabledinput':disabled}\">\r\n @if (internalIcon) {\r\n <i class=\"input-internalicon-{{size}} {{internalIcon}}\" ></i>\r\n }\r\n <div class=\"input-container pad-{{size}}\" >\r\n <ng-content class=\"myinput\"></ng-content>\r\n </div> \r\n </div>\r\n\r\n @if (tip) {\r\n <div class=\"fakeinput-alert tip\">{{tip}}</div>\r\n }\r\n @if (error) {\r\n <div class=\"fakeinput-alert font-error\">{{error}}</div>\r\n }\r\n \r\n </div>\r\n</div>\r\n", styles: [":host{width:100%}.input-container{flex:1 1;padding:3px;overflow:hidden}.pad-s{padding:0}.pad-l{padding:5px}.input-options{position:absolute;border-radius:8px;background-color:#fff;box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;left:0;font-size:13px;z-index:50;overflow:hidden}.input-option{line-height:15px;display:flex;align-items:center;padding:7px 15px;border-bottom:solid 1px #efe9f2;-webkit-user-select:none;user-select:none;transition:ease .3s}.input-option-focused{background-color:#592371}.input-option:hover{background-color:#f3eaf9;cursor:pointer}.input-option-scroll{padding:0 3px;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px #e9eaeb;width:100%;margin-top:2px}.input-option-scroll-focused{background-color:#cfbcd7}.input-option-scroll-btns{border-top:solid 1px #e9eaeb;padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:#fff;border:solid 1px #e9eaeb;padding:4px 10px;border-radius:10px}.input-option-scroll app-checkbox{width:100%}.input-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.input-externalicon{margin-right:8px;font-size:26px;height:26px;width:26px}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon-s{color:#e9eaeb;font-size:17px}.input-internalicon-m{color:#e9eaeb;font-size:20px}.input-internalicon-l{color:#e9eaeb;font-size:24px}.label{font-size:14px;line-height:20px;font-weight:400;color:#0a0d12;margin-bottom:8px}.inputlabel-mini{font-size:12.5px;line-height:15px}.inputlabel-s{font-size:14px}.inputlabel-m{font-size:16px}.inputlabel-l{font-size:17px}.fakeinput{border-radius:8px;overflow:hidden;border:solid 1px #e9eaeb;display:flex;align-items:center;font-size:13px;padding-left:5px;-webkit-user-select:none;user-select:none;background-color:#fff;transition:ease .3s;height:40px}.fakeinput-wrapp{position:relative}.fakeinput-content{margin:0 5px;flex:1 1;padding:9px 0;overflow:hidden;white-space:nowrap}.fakeinput-content i{font-size:20px}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{padding:5px;font-size:14px;flex-grow:1;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:#d5d7da}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:#e9eaeb;color:#252b37}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:#e9eaeb}.fakeinput-button:disabled{background-color:#e9eaeb;color:#f04438}.fakeinput-button:enabled:hover{cursor:pointer;background-color:#cfbcd7;color:#fff}.fakeinput-button:enabled:active{background-color:#4a1d5e}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:#e9eaeb}.fakeinput:focus-within{box-shadow:0 0 3px #63277d}.fakeinput:focus-within button{background-color:#592371;color:#fff}.fakeinput:focus-within button:enabled:hover{cursor:pointer;background-color:#cfbcd7;color:#fff}.fakeinput:focus-within button:enabled:active{background-color:#4f1f64}.fakeinput:hover{border-color:#a4a7ae;cursor:text}.activeselect{border-color:#4f1f64}.inputpadnone{padding:0}.inputpadmini{padding:4px 5px}.inputpad0{padding:5px 10px}.inputpad1{padding:10px 15px}.inputpad2{padding:10px 20px}.errorinput{border-color:#f04438}.t-disabled{color:#d5d7da;padding:5px;text-align:center}.disabledinput{background-color:#fafafa -disabled;color:#252b37}.disabledinput ::ng-deep input{color:#252b37}.editor{border:none;border-radius:8px}.editor ::ng-deep .NgxEditor__MenuBar{border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:1px solid #e9eaeb}.editor ::ng-deep .NgxEditor__Content{min-height:100px}.editor ::ng-deep .NgxEditor{border-top-left-radius:0;border-top-right-radius:0;background-color:transparent;border:none}.editor.onfocus ::ng-deep .NgxEditor__MenuBar{display:none}.editor.onfocus:focus-within ::ng-deep .NgxEditor__MenuBar{display:flex}.fakeinput-files{display:flex;align-items:center;border:dashed #e9eaeb 1px;padding:2px;border-radius:8px}.input-files{display:flex;align-items:center;flex-wrap:wrap;padding:0 10px;width:100%;min-height:30px}.input-file{display:flex;align-items:center;padding:0 5px;font-size:14px;height:30px;overflow:hidden;background-color:#fff;width:fit-content;border-radius:8px;margin:2px;border:solid 1px #f79009;transition:ease .3s}.input-file:hover{cursor:pointer;color:#592371}.input-file i{width:18px;height:18px;font-size:18px;color:#e9eaeb;margin-right:5px}.inputlabel{display:flex;align-items:center}.f-primary{color:#592371}.f{color:#cfbcd7}.f-secondary{color:#752bb0}.f-error{color:#f04438}.f-grey{color:#d5d7da}.font-error{color:#f04438}.tip{color:#592371}.item-disabled{color:#d5d7da}.item-disabled:hover{background-color:#fff;cursor:not-allowed}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
885
+ }
886
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: InputComponent, decorators: [{
887
+ type: Component,
888
+ args: [{ selector: 'ui-input', imports: [CommonModule], template: "<div class=\"input-wrapper\">\r\n \r\n @if (icon) {\r\n <i class=\"input-externalicon f-{{iconColor}} {{icon}}\"></i>\r\n }\r\n <div class=\"input-elements\" [style]=\"icon?'max-width: calc(100% - 34px);':''\">\r\n \r\n @if (label) {\r\n <div class=\"label inputlabel\" [class.font-error]=\"error\">\r\n {{label}} \r\n </div>\r\n }\r\n \r\n <div class=\"fakeinput\" [ngClass]=\"{'errorinput':error, 'disabledinput':disabled}\">\r\n @if (internalIcon) {\r\n <i class=\"input-internalicon-{{size}} {{internalIcon}}\" ></i>\r\n }\r\n <div class=\"input-container pad-{{size}}\" >\r\n <ng-content class=\"myinput\"></ng-content>\r\n </div> \r\n </div>\r\n\r\n @if (tip) {\r\n <div class=\"fakeinput-alert tip\">{{tip}}</div>\r\n }\r\n @if (error) {\r\n <div class=\"fakeinput-alert font-error\">{{error}}</div>\r\n }\r\n \r\n </div>\r\n</div>\r\n", styles: [":host{width:100%}.input-container{flex:1 1;padding:3px;overflow:hidden}.pad-s{padding:0}.pad-l{padding:5px}.input-options{position:absolute;border-radius:8px;background-color:#fff;box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;left:0;font-size:13px;z-index:50;overflow:hidden}.input-option{line-height:15px;display:flex;align-items:center;padding:7px 15px;border-bottom:solid 1px #efe9f2;-webkit-user-select:none;user-select:none;transition:ease .3s}.input-option-focused{background-color:#592371}.input-option:hover{background-color:#f3eaf9;cursor:pointer}.input-option-scroll{padding:0 3px;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px #e9eaeb;width:100%;margin-top:2px}.input-option-scroll-focused{background-color:#cfbcd7}.input-option-scroll-btns{border-top:solid 1px #e9eaeb;padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:#fff;border:solid 1px #e9eaeb;padding:4px 10px;border-radius:10px}.input-option-scroll app-checkbox{width:100%}.input-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.input-externalicon{margin-right:8px;font-size:26px;height:26px;width:26px}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon-s{color:#e9eaeb;font-size:17px}.input-internalicon-m{color:#e9eaeb;font-size:20px}.input-internalicon-l{color:#e9eaeb;font-size:24px}.label{font-size:14px;line-height:20px;font-weight:400;color:#0a0d12;margin-bottom:8px}.inputlabel-mini{font-size:12.5px;line-height:15px}.inputlabel-s{font-size:14px}.inputlabel-m{font-size:16px}.inputlabel-l{font-size:17px}.fakeinput{border-radius:8px;overflow:hidden;border:solid 1px #e9eaeb;display:flex;align-items:center;font-size:13px;padding-left:5px;-webkit-user-select:none;user-select:none;background-color:#fff;transition:ease .3s;height:40px}.fakeinput-wrapp{position:relative}.fakeinput-content{margin:0 5px;flex:1 1;padding:9px 0;overflow:hidden;white-space:nowrap}.fakeinput-content i{font-size:20px}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{padding:5px;font-size:14px;flex-grow:1;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:#d5d7da}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:#e9eaeb;color:#252b37}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:#e9eaeb}.fakeinput-button:disabled{background-color:#e9eaeb;color:#f04438}.fakeinput-button:enabled:hover{cursor:pointer;background-color:#cfbcd7;color:#fff}.fakeinput-button:enabled:active{background-color:#4a1d5e}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:#e9eaeb}.fakeinput:focus-within{box-shadow:0 0 3px #63277d}.fakeinput:focus-within button{background-color:#592371;color:#fff}.fakeinput:focus-within button:enabled:hover{cursor:pointer;background-color:#cfbcd7;color:#fff}.fakeinput:focus-within button:enabled:active{background-color:#4f1f64}.fakeinput:hover{border-color:#a4a7ae;cursor:text}.activeselect{border-color:#4f1f64}.inputpadnone{padding:0}.inputpadmini{padding:4px 5px}.inputpad0{padding:5px 10px}.inputpad1{padding:10px 15px}.inputpad2{padding:10px 20px}.errorinput{border-color:#f04438}.t-disabled{color:#d5d7da;padding:5px;text-align:center}.disabledinput{background-color:#fafafa -disabled;color:#252b37}.disabledinput ::ng-deep input{color:#252b37}.editor{border:none;border-radius:8px}.editor ::ng-deep .NgxEditor__MenuBar{border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:1px solid #e9eaeb}.editor ::ng-deep .NgxEditor__Content{min-height:100px}.editor ::ng-deep .NgxEditor{border-top-left-radius:0;border-top-right-radius:0;background-color:transparent;border:none}.editor.onfocus ::ng-deep .NgxEditor__MenuBar{display:none}.editor.onfocus:focus-within ::ng-deep .NgxEditor__MenuBar{display:flex}.fakeinput-files{display:flex;align-items:center;border:dashed #e9eaeb 1px;padding:2px;border-radius:8px}.input-files{display:flex;align-items:center;flex-wrap:wrap;padding:0 10px;width:100%;min-height:30px}.input-file{display:flex;align-items:center;padding:0 5px;font-size:14px;height:30px;overflow:hidden;background-color:#fff;width:fit-content;border-radius:8px;margin:2px;border:solid 1px #f79009;transition:ease .3s}.input-file:hover{cursor:pointer;color:#592371}.input-file i{width:18px;height:18px;font-size:18px;color:#e9eaeb;margin-right:5px}.inputlabel{display:flex;align-items:center}.f-primary{color:#592371}.f{color:#cfbcd7}.f-secondary{color:#752bb0}.f-error{color:#f04438}.f-grey{color:#d5d7da}.font-error{color:#f04438}.tip{color:#592371}.item-disabled{color:#d5d7da}.item-disabled:hover{background-color:#fff;cursor:not-allowed}\n"] }]
889
+ }], propDecorators: { icon: [{
890
+ type: Input
891
+ }], iconColor: [{
892
+ type: Input
893
+ }], internalIcon: [{
894
+ type: Input
895
+ }], size: [{
896
+ type: Input
897
+ }], label: [{
898
+ type: Input
899
+ }], error: [{
900
+ type: Input
901
+ }], tip: [{
902
+ type: Input
903
+ }], disabled: [{
904
+ type: Input
905
+ }], clickButton: [{
906
+ type: Output
907
+ }] } });
908
+
909
+ class DynamicFormComponent {
910
+ fields = [];
911
+ form;
912
+ flag = false;
913
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
914
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DynamicFormComponent, isStandalone: true, selector: "app-dynamic-form", inputs: { fields: "fields", form: "form" }, ngImport: i0, template: "<div class=\"form\" [formGroup]=\"form\">\r\n @for (field of fields; track field.name) {\r\n <div class=\"col-span-{{field.colSpan || 1}}\">\r\n \r\n @if ( ['text','number','date'].includes(field.type) ) {\r\n <ui-input \r\n [error]=\"(form.get(field.name)?.touched && form.get(field.name)?.invalid) ? 'Error': ''\"\r\n [label]=\"field.label\">\r\n <input \r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [type]=\"field.type\"\r\n [placeholder]=\"field.placeholder??field.label\"\r\n />\r\n </ui-input>\r\n\r\n }\r\n\r\n @if (field.type === 'select') {\r\n <ui-select\r\n [error]=\"(form.get(field.name)?.touched && form.get(field.name)?.invalid) ? 'Error': ''\"\r\n [label]=\"field.label\"\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [options]=\"field.options || []\"\r\n ></ui-select>\r\n }\r\n\r\n @if (field.type === 'checkbox') {\r\n <ui-checkbox\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [placeholder]=\"field.placeholder??''\"\r\n [label]=\"field.label\"\r\n ></ui-checkbox>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: [".form{width:100%;display:grid;grid-template-columns:1fr 1fr 1fr;align-items:stretch;gap:16px;padding-bottom:24px}h2{margin-top:24px}.col-span-1{grid-column:span 1/span 1}.col-span-2{grid-column:span 2/span 2}.col-span-3{grid-column:span 3/span 3}.col-span-4{grid-column:span 4/span 4}.col-span-5{grid-column:span 5/span 5}.col-span-6{grid-column:span 6/span 6}.col-span-7{grid-column:span 7/span 7}.col-span-8{grid-column:span 8/span 8}.col-span-9{grid-column:span 9/span 9}.col-span-10{grid-column:span 10/span 10}.col-span-11{grid-column:span 11/span 11}.col-span-12{grid-column:span 12/span 12}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: SelectComponent, selector: "ui-select", inputs: ["icon", "iconColor", "internalIcon", "size", "label", "error", "tip", "disabled", "nullable", "options", "showSubtitle"] }, { kind: "component", type: InputComponent, selector: "ui-input", inputs: ["icon", "iconColor", "internalIcon", "size", "label", "error", "tip", "disabled"], outputs: ["clickButton"] }, { kind: "component", type: CheckboxComponent, selector: "ui-checkbox", inputs: ["label", "placeholder", "disabled", "loading"] }, { kind: "ngmodule", type: FormsModule }] });
915
+ }
916
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormComponent, decorators: [{
917
+ type: Component,
918
+ args: [{ selector: 'app-dynamic-form', imports: [ReactiveFormsModule, SelectComponent, InputComponent, CheckboxComponent, FormsModule], template: "<div class=\"form\" [formGroup]=\"form\">\r\n @for (field of fields; track field.name) {\r\n <div class=\"col-span-{{field.colSpan || 1}}\">\r\n \r\n @if ( ['text','number','date'].includes(field.type) ) {\r\n <ui-input \r\n [error]=\"(form.get(field.name)?.touched && form.get(field.name)?.invalid) ? 'Error': ''\"\r\n [label]=\"field.label\">\r\n <input \r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [type]=\"field.type\"\r\n [placeholder]=\"field.placeholder??field.label\"\r\n />\r\n </ui-input>\r\n\r\n }\r\n\r\n @if (field.type === 'select') {\r\n <ui-select\r\n [error]=\"(form.get(field.name)?.touched && form.get(field.name)?.invalid) ? 'Error': ''\"\r\n [label]=\"field.label\"\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [options]=\"field.options || []\"\r\n ></ui-select>\r\n }\r\n\r\n @if (field.type === 'checkbox') {\r\n <ui-checkbox\r\n [id]=\"field.name\"\r\n [formControlName]=\"field.name\"\r\n [placeholder]=\"field.placeholder??''\"\r\n [label]=\"field.label\"\r\n ></ui-checkbox>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: [".form{width:100%;display:grid;grid-template-columns:1fr 1fr 1fr;align-items:stretch;gap:16px;padding-bottom:24px}h2{margin-top:24px}.col-span-1{grid-column:span 1/span 1}.col-span-2{grid-column:span 2/span 2}.col-span-3{grid-column:span 3/span 3}.col-span-4{grid-column:span 4/span 4}.col-span-5{grid-column:span 5/span 5}.col-span-6{grid-column:span 6/span 6}.col-span-7{grid-column:span 7/span 7}.col-span-8{grid-column:span 8/span 8}.col-span-9{grid-column:span 9/span 9}.col-span-10{grid-column:span 10/span 10}.col-span-11{grid-column:span 11/span 11}.col-span-12{grid-column:span 12/span 12}\n"] }]
919
+ }], propDecorators: { fields: [{
920
+ type: Input
921
+ }], form: [{
922
+ type: Input,
923
+ args: [{ required: true }]
924
+ }] } });
925
+
926
+ class FormWrapperComponent {
927
+ schema;
928
+ loading = false;
929
+ initialValues = {};
930
+ useSteps = false;
931
+ formSubmit = new EventEmitter();
932
+ fb = inject(FormBuilder);
933
+ form = this.fb.group({});
934
+ currentStep = 0;
935
+ ngOnInit() {
936
+ this.buildForm();
937
+ this.useSteps = !!this.schema.steps && this.schema.steps.length > 0;
938
+ }
939
+ // rebuild form controls when schema changes (revisar)
940
+ ngOnChanges(changes) {
941
+ if (changes['schema']) {
942
+ this.buildForm();
943
+ this.useSteps = !!this.schema.steps && this.schema.steps.length > 0;
944
+ if (this.useSteps && this.schema?.steps) {
945
+ this.currentStep = Math.min(this.currentStep, (this.schema.steps.length - 1) || 0);
946
+ }
947
+ }
948
+ }
949
+ handleSubmit() {
950
+ if (this.form.valid) {
951
+ this.formSubmit.emit({ result: true, form: this.form.value });
952
+ }
953
+ else {
954
+ this.form.markAllAsTouched();
955
+ this.formSubmit.emit({ result: false, form: null });
956
+ }
957
+ }
958
+ collectAllFields() {
959
+ if (!this.schema)
960
+ return [];
961
+ if (this.useSteps && this.schema.steps) {
962
+ return this.schema.steps.flatMap(step => (step.blocks ?? []).flatMap(b => b.fields ?? []));
963
+ }
964
+ // modo sin steps: tomamos blocks del root (si existen)
965
+ return (this.schema.blocks ?? []).flatMap(b => b.fields ?? []);
966
+ }
967
+ buildForm() {
968
+ const fields = this.collectAllFields();
969
+ fields.forEach(f => {
970
+ if (!this.form.contains(f.name)) {
971
+ const validators = this.mapValidatorsFromField(f);
972
+ let initial = this.initialValues[f.name] ?? null;
973
+ if (f.type == 'checkbox' && initial == null)
974
+ initial = false;
975
+ this.form.addControl(f.name, this.fb.control(initial, validators));
976
+ }
977
+ });
978
+ const namesToKeep = new Set(fields.map(f => f.name));
979
+ Object.keys(this.form.controls).forEach(name => {
980
+ if (!namesToKeep.has(name)) {
981
+ this.form.removeControl(name);
982
+ }
983
+ });
984
+ }
985
+ mapValidatorsFromField(f) {
986
+ const validators = [];
987
+ if (f.required)
988
+ validators.push(Validators.required);
989
+ if (typeof f.min === 'number')
990
+ validators.push(Validators.min(f.min));
991
+ if (typeof f.max === 'number')
992
+ validators.push(Validators.max(f.max));
993
+ if (f.pattern instanceof RegExp)
994
+ validators.push(Validators.pattern(f.pattern));
995
+ return validators;
996
+ }
997
+ getCurrentBlocks() {
998
+ if (!this.schema)
999
+ return [];
1000
+ if (this.useSteps) {
1001
+ const step = this.schema.steps?.[this.currentStep];
1002
+ return step?.blocks ?? [];
1003
+ }
1004
+ return this.schema.blocks ?? [];
1005
+ }
1006
+ nextStep() {
1007
+ const stepsCount = this.schema?.steps?.length ?? 0;
1008
+ if (this.useSteps && this.currentStep < stepsCount - 1) {
1009
+ this.currentStep++;
1010
+ }
1011
+ }
1012
+ prevStep() {
1013
+ if (this.useSteps && this.currentStep > 0) {
1014
+ this.currentStep--;
1015
+ }
1016
+ }
1017
+ getStepTitle() {
1018
+ return this.schema.steps?.[this.currentStep]?.title ?? '';
1019
+ }
1020
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FormWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1021
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: FormWrapperComponent, isStandalone: true, selector: "ui-form-wrapper", inputs: { schema: "schema", loading: "loading", initialValues: "initialValues" }, outputs: { formSubmit: "formSubmit" }, usesOnChanges: true, ngImport: i0, template: "<form [formGroup]=\"form\" (ngSubmit)=\"handleSubmit()\">\r\n\r\n @if (useSteps) {\r\n @if (schema.steps?.length) {\r\n\r\n <div class=\"step-title\">{{ getStepTitle()}}</div>\r\n\r\n <!-- cuerpo: loader o bloques del step -->\r\n @if (loading) {\r\n <ui-skeleton-loader\r\n [cols]=\"schema.cols\"\r\n [inputs]=\"(schema.steps?.[currentStep]?.blocks?.[0]?.fields?.length) ?? 0\"\r\n ></ui-skeleton-loader>\r\n } \r\n @else {\r\n @for (block of getCurrentBlocks(); track block.title) {\r\n <section class=\"form-block\">\r\n <div class=\"block-title\">{{ block.title }}</div>\r\n <!-- pasamos solo fields y el formGroup -->\r\n <app-dynamic-form\r\n [fields]=\"block.fields\"\r\n [form]=\"form\">\r\n </app-dynamic-form>\r\n </section>\r\n }\r\n }\r\n\r\n <!-- controles de navegaci\u00F3n -->\r\n <div class=\"step-controls\">\r\n <button type=\"button\" (click)=\"prevStep()\" [disabled]=\"currentStep === 0\">Anterior</button>\r\n\r\n @if ((schema.steps?.length ?? 0) > 0 && currentStep < ((schema.steps?.length ?? 1) - 1)) {\r\n <button type=\"button\" (click)=\"nextStep()\">Siguiente</button>\r\n } @else {\r\n <button type=\"submit\">Guardar</button>\r\n }\r\n </div>\r\n } \r\n } \r\n @else {\r\n @for (block of getCurrentBlocks(); track block.title) {\r\n <section class=\"form-block\">\r\n @if (block.title){\r\n <div class=\"block-title\">{{ block.title }}</div>\r\n }\r\n @if (loading) {\r\n <ui-skeleton-loader\r\n [cols]=\"schema.cols\"\r\n [inputs]=\"block.fields.length\"\r\n ></ui-skeleton-loader>\r\n } @else {\r\n <app-dynamic-form\r\n [fields]=\"block.fields\"\r\n [form]=\"form\">\r\n </app-dynamic-form>\r\n }\r\n </section>\r\n }\r\n }\r\n</form>\r\n", styles: [":host{display:block;padding:4px 0}.block-title{font-weight:600;margin:24px 0;font-size:24px;line-height:28px;color:#0a0d12}\n"], dependencies: [{ kind: "component", type: DynamicFormComponent, selector: "app-dynamic-form", inputs: ["fields", "form"] }, { kind: "component", type: SkeletonLoaderComponent, selector: "ui-skeleton-loader", inputs: ["inputs", "cols"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
1022
+ }
1023
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FormWrapperComponent, decorators: [{
1024
+ type: Component,
1025
+ args: [{ selector: 'ui-form-wrapper', imports: [DynamicFormComponent, SkeletonLoaderComponent, ReactiveFormsModule], template: "<form [formGroup]=\"form\" (ngSubmit)=\"handleSubmit()\">\r\n\r\n @if (useSteps) {\r\n @if (schema.steps?.length) {\r\n\r\n <div class=\"step-title\">{{ getStepTitle()}}</div>\r\n\r\n <!-- cuerpo: loader o bloques del step -->\r\n @if (loading) {\r\n <ui-skeleton-loader\r\n [cols]=\"schema.cols\"\r\n [inputs]=\"(schema.steps?.[currentStep]?.blocks?.[0]?.fields?.length) ?? 0\"\r\n ></ui-skeleton-loader>\r\n } \r\n @else {\r\n @for (block of getCurrentBlocks(); track block.title) {\r\n <section class=\"form-block\">\r\n <div class=\"block-title\">{{ block.title }}</div>\r\n <!-- pasamos solo fields y el formGroup -->\r\n <app-dynamic-form\r\n [fields]=\"block.fields\"\r\n [form]=\"form\">\r\n </app-dynamic-form>\r\n </section>\r\n }\r\n }\r\n\r\n <!-- controles de navegaci\u00F3n -->\r\n <div class=\"step-controls\">\r\n <button type=\"button\" (click)=\"prevStep()\" [disabled]=\"currentStep === 0\">Anterior</button>\r\n\r\n @if ((schema.steps?.length ?? 0) > 0 && currentStep < ((schema.steps?.length ?? 1) - 1)) {\r\n <button type=\"button\" (click)=\"nextStep()\">Siguiente</button>\r\n } @else {\r\n <button type=\"submit\">Guardar</button>\r\n }\r\n </div>\r\n } \r\n } \r\n @else {\r\n @for (block of getCurrentBlocks(); track block.title) {\r\n <section class=\"form-block\">\r\n @if (block.title){\r\n <div class=\"block-title\">{{ block.title }}</div>\r\n }\r\n @if (loading) {\r\n <ui-skeleton-loader\r\n [cols]=\"schema.cols\"\r\n [inputs]=\"block.fields.length\"\r\n ></ui-skeleton-loader>\r\n } @else {\r\n <app-dynamic-form\r\n [fields]=\"block.fields\"\r\n [form]=\"form\">\r\n </app-dynamic-form>\r\n }\r\n </section>\r\n }\r\n }\r\n</form>\r\n", styles: [":host{display:block;padding:4px 0}.block-title{font-weight:600;margin:24px 0;font-size:24px;line-height:28px;color:#0a0d12}\n"] }]
1026
+ }], propDecorators: { schema: [{
1027
+ type: Input
1028
+ }], loading: [{
1029
+ type: Input
1030
+ }], initialValues: [{
1031
+ type: Input
1032
+ }], formSubmit: [{
1033
+ type: Output
1034
+ }] } });
1035
+
1036
+ class SearcherComponent {
1037
+ renderer;
1038
+ overlay;
1039
+ positionBuilder;
1040
+ vcr;
1041
+ icon = ''; // Icono externo
1042
+ iconColor = 'secondary'; //color de ícono externo
1043
+ internalIcon = ''; //Icono interno
1044
+ size = 'm'; // tamaño general del input
1045
+ // TEXTO
1046
+ label = '';
1047
+ error = '';
1048
+ tip = '';
1049
+ // FUNCTIONS
1050
+ disabled = false;
1051
+ showSelected = true;
1052
+ placeholder = 'Buscar...';
1053
+ open = false;
1054
+ searchFn;
1055
+ itemDisplayFn = item => String(item);
1056
+ itemIsEnabledFn = () => true;
1057
+ manualSearch = false;
1058
+ selectedItem = null;
1059
+ selectedItemChange = new EventEmitter();
1060
+ isLoading = false;
1061
+ searchText = '';
1062
+ searchSubject = new Subject();
1063
+ results$;
1064
+ toggleButton;
1065
+ unlistener;
1066
+ constructor(renderer, overlay, positionBuilder, vcr) {
1067
+ this.renderer = renderer;
1068
+ this.overlay = overlay;
1069
+ this.positionBuilder = positionBuilder;
1070
+ this.vcr = vcr;
1071
+ this.results$ = this.searchSubject.pipe(debounceTime(300), distinctUntilChanged(), tap(() => this.isLoading = true), switchMap(v => {
1072
+ if (v.length < 3) {
1073
+ this.isLoading = false;
1074
+ return of([]);
1075
+ }
1076
+ return this.searchFn(v).pipe(finalize(() => this.isLoading = false));
1077
+ }));
1078
+ }
1079
+ openList() {
1080
+ if (!this.disabled && !this.open) {
1081
+ this.open = true;
1082
+ this.openOverlay();
1083
+ if (this.open) {
1084
+ setTimeout(() => {
1085
+ this.unlistener = this.renderer.listen('window', 'click', (e) => {
1086
+ if (!this.toggleButton.nativeElement.contains(e.target)) {
1087
+ this.clearSearch();
1088
+ this.unlistener();
1089
+ }
1090
+ });
1091
+ }, 200);
1092
+ }
1093
+ }
1094
+ }
1095
+ onSearchChange(value) {
1096
+ this.searchText = value;
1097
+ if (!this.manualSearch) {
1098
+ this.searchSubject.next(value);
1099
+ }
1100
+ }
1101
+ triggerSearch() {
1102
+ this.searchSubject.next(this.searchText);
1103
+ }
1104
+ selectItem(item) {
1105
+ if (this.itemIsEnabledFn(item)) {
1106
+ this.clearSearch();
1107
+ this.selectedItemChange.emit(item);
1108
+ if (this.showSelected)
1109
+ this.selectedItem = item;
1110
+ }
1111
+ }
1112
+ clearSearch() {
1113
+ this.searchText = '';
1114
+ this.open = false;
1115
+ this.closeOverlay();
1116
+ this.searchSubject.next('');
1117
+ }
1118
+ unselect() {
1119
+ this.selectedItem = null;
1120
+ this.selectedItemChange.emit(null);
1121
+ }
1122
+ dropdownTemplateRef;
1123
+ overlayRef;
1124
+ closeOverlay() {
1125
+ if (this.overlayRef) {
1126
+ this.overlayRef.dispose();
1127
+ this.overlayRef = null;
1128
+ }
1129
+ }
1130
+ openOverlay() {
1131
+ if (this.overlayRef)
1132
+ return;
1133
+ const width = this.toggleButton.nativeElement.getBoundingClientRect().width;
1134
+ const positionStrategy = this.positionBuilder
1135
+ .flexibleConnectedTo(this.toggleButton)
1136
+ .withPositions([
1137
+ {
1138
+ originX: 'start',
1139
+ originY: 'bottom',
1140
+ overlayX: 'start',
1141
+ overlayY: 'top',
1142
+ },
1143
+ {
1144
+ originX: 'start',
1145
+ originY: 'top',
1146
+ overlayX: 'start',
1147
+ overlayY: 'bottom',
1148
+ }
1149
+ ])
1150
+ .withFlexibleDimensions(false)
1151
+ .withPush(false);
1152
+ this.overlayRef = this.overlay.create({
1153
+ positionStrategy,
1154
+ scrollStrategy: this.overlay.scrollStrategies.reposition(),
1155
+ hasBackdrop: true,
1156
+ backdropClass: 'transparent-backdrop'
1157
+ });
1158
+ const templatePortal = new TemplatePortal(this.dropdownTemplateRef, this.vcr);
1159
+ this.overlayRef.attach(templatePortal);
1160
+ this.overlayRef.backdropClick().subscribe(() => this.closeOverlay());
1161
+ this.overlayRef.overlayElement.style.width = `${width}px`;
1162
+ }
1163
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SearcherComponent, deps: [{ token: i0.Renderer2 }, { token: i1$2.Overlay }, { token: i1$2.OverlayPositionBuilder }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
1164
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: SearcherComponent, isStandalone: true, selector: "ui-searcher", inputs: { icon: "icon", iconColor: "iconColor", internalIcon: "internalIcon", size: "size", label: "label", error: "error", tip: "tip", disabled: "disabled", showSelected: "showSelected", placeholder: "placeholder", searchFn: "searchFn", itemDisplayFn: "itemDisplayFn", itemIsEnabledFn: "itemIsEnabledFn", manualSearch: "manualSearch", selectedItem: "selectedItem" }, outputs: { selectedItemChange: "selectedItemChange" }, viewQueries: [{ propertyName: "toggleButton", first: true, predicate: ["inputwrapp"], descendants: true }, { propertyName: "dropdownTemplateRef", first: true, predicate: ["dropdownTemplate"], descendants: true }], ngImport: i0, template: "\r\n<div class=\"input-wrapper\">\r\n @if (icon) {\r\n <i class=\"input-externalicon f-{{iconColor}} {{icon}}\"></i>\r\n }\r\n <div class=\"input-elements\" [style]=\"icon?'max-width: calc(100% - 34px);':''\"> \r\n <div class=\"label inputlabel\" [class.font-error]=\"error\">\r\n {{label}} \r\n </div>\r\n \r\n <div class=\"fakeinput-wrapp\" #inputwrapp >\r\n <!-- INPUT -->\r\n <div class=\"fakeinput\" [ngClass]=\"{'errorinput':error, 'disabledinput':disabled}\">\r\n @if (selectedItem == null) { \r\n @if (internalIcon) {\r\n <i class=\"input-internalicon-{{size}} {{internalIcon}}\" ></i>\r\n }\r\n <div class=\"input-container pad-{{size}}\" >\r\n <input\r\n (focus)=\"openList()\"\r\n type=\"text\"\r\n (keydown.enter)=\"triggerSearch()\"\r\n (keydown.escape)=\"clearSearch()\"\r\n [(ngModel)]=\"searchText\"\r\n (ngModelChange)=\"onSearchChange($event)\"\r\n [placeholder]=\"placeholder\"\r\n />\r\n </div> \r\n @if (manualSearch) {\r\n <ui-button (click)=\"triggerSearch()\" size=\"t\" ></ui-button>\r\n }\r\n <ui-button size=\"t\" icon=\"ri-close-large-line\" (click)=\"clearSearch()\"></ui-button>\r\n }@else {\r\n <div class=\"input-container pad-{{size}}\" >\r\n <div class=\"selected-item\" >\r\n <div class=\"selected-item-text\" [innerHTML]=\"itemDisplayFn(selectedItem)\"></div> \r\n <ui-button (click)=\"unselect()\" type=\"ghost\" size=\"t\" icon=\"ri-close-large-line\" color=\"red\"></ui-button>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (tip) {\r\n <div class=\"fakeinput-alert tip\">{{tip}}</div>\r\n }\r\n @if (error) {\r\n <div class=\"fakeinput-alert font-error\">{{error}}</div>\r\n }\r\n \r\n </div>\r\n</div>\r\n\r\n<ng-template #dropdownTemplate>\r\n @if (results$ | async; as items){\r\n <div class=\"results\">\r\n @if (isLoading) {\r\n <div class=\"loader\"></div>\r\n }\r\n <div class=\"input-option-scroll\">\r\n @for (item of items; track $index) {\r\n <div class=\"input-option\" [class.item-disabled]=\"!itemIsEnabledFn(item)\" (click)=\"selectItem(item)\" [innerHTML]=\"itemDisplayFn(item)\">\r\n </div>\r\n }@empty {\r\n <div class=\"t-disabled\">No hay elementos para mostrar</div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n\r\n\r\n", styles: [".loader{height:4px;width:100%;--c:no-repeat linear-gradient(#6100ee 0 0);background:var(--c),var(--c),#d7b8fc;background-size:60% 100%;animation:l16 3s infinite}@keyframes l16{0%{background-position:-150% 0,-150% 0}66%{background-position:250% 0,-150% 0}to{background-position:250% 0,250% 0}}.wrapp-fakeinput{position:relative}.selected-item{border-radius:5px;background-color:#592371;padding-left:10px;height:25px;display:flex;align-items:center;justify-content:space-between}.selected-item-text{overflow:hidden;white-space:nowrap}.results{background-color:#fff;box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;border:solid 1px #e9eaeb;border-radius:5px;font-size:13px;z-index:150;overflow:hidden}\n", ":host{width:100%}.input-container{flex:1 1;padding:3px;overflow:hidden}.pad-s{padding:0}.pad-l{padding:5px}.input-options{position:absolute;border-radius:8px;background-color:#fff;box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;left:0;font-size:13px;z-index:50;overflow:hidden}.input-option{line-height:15px;display:flex;align-items:center;padding:7px 15px;border-bottom:solid 1px #efe9f2;-webkit-user-select:none;user-select:none;transition:ease .3s}.input-option-focused{background-color:#592371}.input-option:hover{background-color:#f3eaf9;cursor:pointer}.input-option-scroll{padding:0 3px;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px #e9eaeb;width:100%;margin-top:2px}.input-option-scroll-focused{background-color:#cfbcd7}.input-option-scroll-btns{border-top:solid 1px #e9eaeb;padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:#fff;border:solid 1px #e9eaeb;padding:4px 10px;border-radius:10px}.input-option-scroll app-checkbox{width:100%}.input-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.input-externalicon{margin-right:8px;font-size:26px;height:26px;width:26px}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon-s{color:#e9eaeb;font-size:17px}.input-internalicon-m{color:#e9eaeb;font-size:20px}.input-internalicon-l{color:#e9eaeb;font-size:24px}.label{font-size:14px;line-height:20px;font-weight:400;color:#0a0d12;margin-bottom:8px}.inputlabel-mini{font-size:12.5px;line-height:15px}.inputlabel-s{font-size:14px}.inputlabel-m{font-size:16px}.inputlabel-l{font-size:17px}.fakeinput{border-radius:8px;overflow:hidden;border:solid 1px #e9eaeb;display:flex;align-items:center;font-size:13px;padding-left:5px;-webkit-user-select:none;user-select:none;background-color:#fff;transition:ease .3s;height:40px}.fakeinput-wrapp{position:relative}.fakeinput-content{margin:0 5px;flex:1 1;padding:9px 0;overflow:hidden;white-space:nowrap}.fakeinput-content i{font-size:20px}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{padding:5px;font-size:14px;flex-grow:1;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:#d5d7da}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:#e9eaeb;color:#252b37}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:#e9eaeb}.fakeinput-button:disabled{background-color:#e9eaeb;color:#f04438}.fakeinput-button:enabled:hover{cursor:pointer;background-color:#cfbcd7;color:#fff}.fakeinput-button:enabled:active{background-color:#4a1d5e}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:#e9eaeb}.fakeinput:focus-within{box-shadow:0 0 3px #63277d}.fakeinput:focus-within button{background-color:#592371;color:#fff}.fakeinput:focus-within button:enabled:hover{cursor:pointer;background-color:#cfbcd7;color:#fff}.fakeinput:focus-within button:enabled:active{background-color:#4f1f64}.fakeinput:hover{border-color:#a4a7ae;cursor:text}.activeselect{border-color:#4f1f64}.inputpadnone{padding:0}.inputpadmini{padding:4px 5px}.inputpad0{padding:5px 10px}.inputpad1{padding:10px 15px}.inputpad2{padding:10px 20px}.errorinput{border-color:#f04438}.t-disabled{color:#d5d7da;padding:5px;text-align:center}.disabledinput{background-color:#fafafa -disabled;color:#252b37}.disabledinput ::ng-deep input{color:#252b37}.editor{border:none;border-radius:8px}.editor ::ng-deep .NgxEditor__MenuBar{border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:1px solid #e9eaeb}.editor ::ng-deep .NgxEditor__Content{min-height:100px}.editor ::ng-deep .NgxEditor{border-top-left-radius:0;border-top-right-radius:0;background-color:transparent;border:none}.editor.onfocus ::ng-deep .NgxEditor__MenuBar{display:none}.editor.onfocus:focus-within ::ng-deep .NgxEditor__MenuBar{display:flex}.fakeinput-files{display:flex;align-items:center;border:dashed #e9eaeb 1px;padding:2px;border-radius:8px}.input-files{display:flex;align-items:center;flex-wrap:wrap;padding:0 10px;width:100%;min-height:30px}.input-file{display:flex;align-items:center;padding:0 5px;font-size:14px;height:30px;overflow:hidden;background-color:#fff;width:fit-content;border-radius:8px;margin:2px;border:solid 1px #f79009;transition:ease .3s}.input-file:hover{cursor:pointer;color:#592371}.input-file i{width:18px;height:18px;font-size:18px;color:#e9eaeb;margin-right:5px}.inputlabel{display:flex;align-items:center}.f-primary{color:#592371}.f{color:#cfbcd7}.f-secondary{color:#752bb0}.f-error{color:#f04438}.f-grey{color:#d5d7da}.font-error{color:#f04438}.tip{color:#592371}.item-disabled{color:#d5d7da}.item-disabled:hover{background-color:#fff;cursor:not-allowed}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }] });
1165
+ }
1166
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SearcherComponent, decorators: [{
1167
+ type: Component,
1168
+ args: [{ selector: 'ui-searcher', imports: [CommonModule, FormsModule, AsyncPipe, ButtonComponent], template: "\r\n<div class=\"input-wrapper\">\r\n @if (icon) {\r\n <i class=\"input-externalicon f-{{iconColor}} {{icon}}\"></i>\r\n }\r\n <div class=\"input-elements\" [style]=\"icon?'max-width: calc(100% - 34px);':''\"> \r\n <div class=\"label inputlabel\" [class.font-error]=\"error\">\r\n {{label}} \r\n </div>\r\n \r\n <div class=\"fakeinput-wrapp\" #inputwrapp >\r\n <!-- INPUT -->\r\n <div class=\"fakeinput\" [ngClass]=\"{'errorinput':error, 'disabledinput':disabled}\">\r\n @if (selectedItem == null) { \r\n @if (internalIcon) {\r\n <i class=\"input-internalicon-{{size}} {{internalIcon}}\" ></i>\r\n }\r\n <div class=\"input-container pad-{{size}}\" >\r\n <input\r\n (focus)=\"openList()\"\r\n type=\"text\"\r\n (keydown.enter)=\"triggerSearch()\"\r\n (keydown.escape)=\"clearSearch()\"\r\n [(ngModel)]=\"searchText\"\r\n (ngModelChange)=\"onSearchChange($event)\"\r\n [placeholder]=\"placeholder\"\r\n />\r\n </div> \r\n @if (manualSearch) {\r\n <ui-button (click)=\"triggerSearch()\" size=\"t\" ></ui-button>\r\n }\r\n <ui-button size=\"t\" icon=\"ri-close-large-line\" (click)=\"clearSearch()\"></ui-button>\r\n }@else {\r\n <div class=\"input-container pad-{{size}}\" >\r\n <div class=\"selected-item\" >\r\n <div class=\"selected-item-text\" [innerHTML]=\"itemDisplayFn(selectedItem)\"></div> \r\n <ui-button (click)=\"unselect()\" type=\"ghost\" size=\"t\" icon=\"ri-close-large-line\" color=\"red\"></ui-button>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (tip) {\r\n <div class=\"fakeinput-alert tip\">{{tip}}</div>\r\n }\r\n @if (error) {\r\n <div class=\"fakeinput-alert font-error\">{{error}}</div>\r\n }\r\n \r\n </div>\r\n</div>\r\n\r\n<ng-template #dropdownTemplate>\r\n @if (results$ | async; as items){\r\n <div class=\"results\">\r\n @if (isLoading) {\r\n <div class=\"loader\"></div>\r\n }\r\n <div class=\"input-option-scroll\">\r\n @for (item of items; track $index) {\r\n <div class=\"input-option\" [class.item-disabled]=\"!itemIsEnabledFn(item)\" (click)=\"selectItem(item)\" [innerHTML]=\"itemDisplayFn(item)\">\r\n </div>\r\n }@empty {\r\n <div class=\"t-disabled\">No hay elementos para mostrar</div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n\r\n\r\n", styles: [".loader{height:4px;width:100%;--c:no-repeat linear-gradient(#6100ee 0 0);background:var(--c),var(--c),#d7b8fc;background-size:60% 100%;animation:l16 3s infinite}@keyframes l16{0%{background-position:-150% 0,-150% 0}66%{background-position:250% 0,-150% 0}to{background-position:250% 0,250% 0}}.wrapp-fakeinput{position:relative}.selected-item{border-radius:5px;background-color:#592371;padding-left:10px;height:25px;display:flex;align-items:center;justify-content:space-between}.selected-item-text{overflow:hidden;white-space:nowrap}.results{background-color:#fff;box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;border:solid 1px #e9eaeb;border-radius:5px;font-size:13px;z-index:150;overflow:hidden}\n", ":host{width:100%}.input-container{flex:1 1;padding:3px;overflow:hidden}.pad-s{padding:0}.pad-l{padding:5px}.input-options{position:absolute;border-radius:8px;background-color:#fff;box-shadow:0 1px 1px #00000020,0 2px 5px #00000050;width:100%;top:100%;left:0;font-size:13px;z-index:50;overflow:hidden}.input-option{line-height:15px;display:flex;align-items:center;padding:7px 15px;border-bottom:solid 1px #efe9f2;-webkit-user-select:none;user-select:none;transition:ease .3s}.input-option-focused{background-color:#592371}.input-option:hover{background-color:#f3eaf9;cursor:pointer}.input-option-scroll{padding:0 3px;max-height:180px;overflow:auto}.input-option-scroll-line{border-bottom:solid 1px #e9eaeb;width:100%;margin-top:2px}.input-option-scroll-focused{background-color:#cfbcd7}.input-option-scroll-btns{border-top:solid 1px #e9eaeb;padding-top:5px;display:flex;justify-content:space-around}.input-option-scroll-btns button{background-color:#fff;border:solid 1px #e9eaeb;padding:4px 10px;border-radius:10px}.input-option-scroll app-checkbox{width:100%}.input-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.input-externalicon{margin-right:8px;font-size:26px;height:26px;width:26px}.input-elements{flex-grow:1;display:flex;flex-direction:column;width:100%}.input-internalicon-s{color:#e9eaeb;font-size:17px}.input-internalicon-m{color:#e9eaeb;font-size:20px}.input-internalicon-l{color:#e9eaeb;font-size:24px}.label{font-size:14px;line-height:20px;font-weight:400;color:#0a0d12;margin-bottom:8px}.inputlabel-mini{font-size:12.5px;line-height:15px}.inputlabel-s{font-size:14px}.inputlabel-m{font-size:16px}.inputlabel-l{font-size:17px}.fakeinput{border-radius:8px;overflow:hidden;border:solid 1px #e9eaeb;display:flex;align-items:center;font-size:13px;padding-left:5px;-webkit-user-select:none;user-select:none;background-color:#fff;transition:ease .3s;height:40px}.fakeinput-wrapp{position:relative}.fakeinput-content{margin:0 5px;flex:1 1;padding:9px 0;overflow:hidden;white-space:nowrap}.fakeinput-content i{font-size:20px}.fakeinput ::ng-deep input,.fakeinput ::ng-deep textarea{padding:5px;font-size:14px;flex-grow:1;width:100%;background-color:transparent;border:none!important}.fakeinput ::ng-deep input:disabled,.fakeinput ::ng-deep textarea:disabled{color:#d5d7da}.fakeinput ::ng-deep input:disabled~.fakeinput,.fakeinput ::ng-deep textarea:disabled~.fakeinput{background-color:#e9eaeb;color:#252b37}.fakeinput-button{margin:0;border:none;display:flex;justify-content:center;align-items:center;padding:4px 5px 5px;transition:ease .3s;background-color:#e9eaeb}.fakeinput-button:disabled{background-color:#e9eaeb;color:#f04438}.fakeinput-button:enabled:hover{cursor:pointer;background-color:#cfbcd7;color:#fff}.fakeinput-button:enabled:active{background-color:#4a1d5e}.fakeinput app-checkbox{width:100%}.fakeinput-alert{font-size:13px;line-height:15px;padding:1px 4px}.fakeinput button{color:#e9eaeb}.fakeinput:focus-within{box-shadow:0 0 3px #63277d}.fakeinput:focus-within button{background-color:#592371;color:#fff}.fakeinput:focus-within button:enabled:hover{cursor:pointer;background-color:#cfbcd7;color:#fff}.fakeinput:focus-within button:enabled:active{background-color:#4f1f64}.fakeinput:hover{border-color:#a4a7ae;cursor:text}.activeselect{border-color:#4f1f64}.inputpadnone{padding:0}.inputpadmini{padding:4px 5px}.inputpad0{padding:5px 10px}.inputpad1{padding:10px 15px}.inputpad2{padding:10px 20px}.errorinput{border-color:#f04438}.t-disabled{color:#d5d7da;padding:5px;text-align:center}.disabledinput{background-color:#fafafa -disabled;color:#252b37}.disabledinput ::ng-deep input{color:#252b37}.editor{border:none;border-radius:8px}.editor ::ng-deep .NgxEditor__MenuBar{border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:1px solid #e9eaeb}.editor ::ng-deep .NgxEditor__Content{min-height:100px}.editor ::ng-deep .NgxEditor{border-top-left-radius:0;border-top-right-radius:0;background-color:transparent;border:none}.editor.onfocus ::ng-deep .NgxEditor__MenuBar{display:none}.editor.onfocus:focus-within ::ng-deep .NgxEditor__MenuBar{display:flex}.fakeinput-files{display:flex;align-items:center;border:dashed #e9eaeb 1px;padding:2px;border-radius:8px}.input-files{display:flex;align-items:center;flex-wrap:wrap;padding:0 10px;width:100%;min-height:30px}.input-file{display:flex;align-items:center;padding:0 5px;font-size:14px;height:30px;overflow:hidden;background-color:#fff;width:fit-content;border-radius:8px;margin:2px;border:solid 1px #f79009;transition:ease .3s}.input-file:hover{cursor:pointer;color:#592371}.input-file i{width:18px;height:18px;font-size:18px;color:#e9eaeb;margin-right:5px}.inputlabel{display:flex;align-items:center}.f-primary{color:#592371}.f{color:#cfbcd7}.f-secondary{color:#752bb0}.f-error{color:#f04438}.f-grey{color:#d5d7da}.font-error{color:#f04438}.tip{color:#592371}.item-disabled{color:#d5d7da}.item-disabled:hover{background-color:#fff;cursor:not-allowed}\n"] }]
1169
+ }], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i1$2.Overlay }, { type: i1$2.OverlayPositionBuilder }, { type: i0.ViewContainerRef }], propDecorators: { icon: [{
1170
+ type: Input
1171
+ }], iconColor: [{
1172
+ type: Input
1173
+ }], internalIcon: [{
1174
+ type: Input
1175
+ }], size: [{
1176
+ type: Input
1177
+ }], label: [{
1178
+ type: Input
1179
+ }], error: [{
1180
+ type: Input
1181
+ }], tip: [{
1182
+ type: Input
1183
+ }], disabled: [{
1184
+ type: Input
1185
+ }], showSelected: [{
1186
+ type: Input
1187
+ }], placeholder: [{
1188
+ type: Input
1189
+ }], searchFn: [{
1190
+ type: Input
1191
+ }], itemDisplayFn: [{
1192
+ type: Input
1193
+ }], itemIsEnabledFn: [{
1194
+ type: Input
1195
+ }], manualSearch: [{
1196
+ type: Input
1197
+ }], selectedItem: [{
1198
+ type: Input
1199
+ }], selectedItemChange: [{
1200
+ type: Output
1201
+ }], toggleButton: [{
1202
+ type: ViewChild,
1203
+ args: ['inputwrapp']
1204
+ }], dropdownTemplateRef: [{
1205
+ type: ViewChild,
1206
+ args: ['dropdownTemplate']
1207
+ }] } });
1208
+
1209
+ const MODAL_DATA = 'MODAL_DATA';
1210
+ const MODAL_COMPONENT = 'MODAL_COMPONENT';
1211
+ const MODAL_CONFIG = 'MODAL_CONFIG';
1212
+ const MODAL_CLOSE_EVENT = 'modalClosed';
1213
+ const MODAL_CLOSE_REQUEST = 'modalCloserRequested';
1214
+
1215
+ class UiModalRef {
1216
+ overlayRef;
1217
+ modalService;
1218
+ _afterClosed = new Subject();
1219
+ constructor(overlayRef, modalService) {
1220
+ this.overlayRef = overlayRef;
1221
+ this.modalService = modalService;
1222
+ }
1223
+ close(result = null) {
1224
+ this.modalService.close(this.overlayRef, result);
1225
+ this._afterClosed.next({ status: result != null, data: result });
1226
+ this._afterClosed.complete();
1227
+ }
1228
+ closeFloating(result = null) {
1229
+ this.modalService.closeFloating(this.overlayRef, result);
1230
+ this._afterClosed.next({ status: result != null, data: result });
1231
+ this._afterClosed.complete();
1232
+ }
1233
+ afterClosed() {
1234
+ return this._afterClosed.asObservable();
1235
+ }
1236
+ }
1237
+
1238
+ class SideModalComponent {
1239
+ modalRef;
1240
+ component;
1241
+ congif;
1242
+ injector;
1243
+ modal;
1244
+ overlayRef; // lo setea el servicio
1245
+ state = 'visible';
1246
+ show = true;
1247
+ myConfig = {};
1248
+ ready = false;
1249
+ title = '';
1250
+ portalOutlet;
1251
+ constructor(modalRef, component, congif, injector, modal) {
1252
+ this.modalRef = modalRef;
1253
+ this.component = component;
1254
+ this.congif = congif;
1255
+ this.injector = injector;
1256
+ this.modal = modal;
1257
+ this.myConfig = congif;
1258
+ }
1259
+ ngOnInit() {
1260
+ if (this.overlayRef) {
1261
+ this.overlayRef.hostElement.addEventListener(MODAL_CLOSE_REQUEST, () => {
1262
+ this.close();
1263
+ });
1264
+ }
1265
+ }
1266
+ ngAfterViewInit() {
1267
+ const childInjector = Injector.create({
1268
+ providers: [
1269
+ { provide: UiModalRef, useValue: this.modalRef },
1270
+ { provide: MODAL_DATA, useValue: this.congif.data }
1271
+ ],
1272
+ parent: this.injector
1273
+ });
1274
+ const portal = new ComponentPortal(this.component, null, childInjector);
1275
+ this.portalOutlet.attachComponentPortal(portal);
1276
+ }
1277
+ closeOuside() {
1278
+ if (!this.congif.preventCloseingOutside === true) {
1279
+ this.close();
1280
+ }
1281
+ }
1282
+ close() {
1283
+ this.state = 'hidden';
1284
+ }
1285
+ onAnimationDone(event) {
1286
+ if (event.toState === 'hidden' && event.triggerName === 'sideModal') {
1287
+ this.overlayRef.dispose();
1288
+ }
1289
+ }
1290
+ save() {
1291
+ this.modal.triggerSave();
1292
+ }
1293
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SideModalComponent, deps: [{ token: UiModalRef }, { token: MODAL_COMPONENT }, { token: MODAL_CONFIG }, { token: i0.Injector }, { token: UiModalService }], target: i0.ɵɵFactoryTarget.Component });
1294
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: SideModalComponent, isStandalone: true, selector: "app-side-modal", viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }], ngImport: i0, template: "<div [@fadeBackdrop]=\"state\" class=\"backdrop\" (click)=\"closeOuside()\"> \r\n</div>\r\n<div [@sideModal]=\"state\" (@sideModal.done)=\"onAnimationDone($event)\" class=\"sidemodal\" [style.width]=\"myConfig.width??'60%'\" (click)=\"$event.stopPropagation()\">\r\n <ui-button class=\"close-icon\" (click)=\"close()\" icon=\"ri-close-large-line\" type=\"ghost\" color=\"black\" [iconOnly]=\"true\" size=\"m\"></ui-button>\r\n <div class=\"sidemodal-body\" [class.body-padding]=\"myConfig.title!=''\">\r\n <ng-template cdkPortalOutlet></ng-template>\r\n </div>\r\n @if (myConfig.footerEnabled) {\r\n <div class=\"sidemodal-footer\">\r\n @if (myConfig.showCancelButton) {\r\n <ui-button (click)=\"close()\" color=\"black\" size=\"l\" type=\"bordered\" icon=\"ri-close-line\">{{myConfig.footerCancelButtonText??'Cancelar'}}</ui-button>\r\n }\r\n <ui-button (click)=\"save()\" color=\"black\" size=\"l\" rightIcon=\"ri-check-line\">{{myConfig.footerOkButtonText??'Siguiente'}}</ui-button>\r\n </div>\r\n }\r\n</div>", styles: ["::ng-deep .side-modal-panel{position:fixed!important;top:0;right:0;height:100%;width:400px;background:#fff;z-index:2000;box-shadow:-2px 0 8px #0003;display:flex;flex-direction:column}.backdrop{position:fixed;inset:0;width:100%;height:100vh;background-color:#00000080;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);display:flex;justify-content:flex-end}.close-icon{position:absolute;right:32px;height:32px}.sidemodal{position:fixed;right:0;top:0;height:100%;background-color:#fff;display:flex;flex-direction:column;padding-top:28px}.sidemodal-header{height:32px;width:100%;padding:0 32px;display:flex;align-items:center;justify-content:space-between}.sidemodal-body{flex:1;overflow-y:auto;padding:32px}.sidemodal-footer{height:96px;padding:24px 40px;width:100%;display:flex;gap:8px;justify-content:flex-end;border-top:1px solid #d5d7da}\n"], dependencies: [{ kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i2.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }], animations: [sideModal, fadeBackdrop] });
1295
+ }
1296
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SideModalComponent, decorators: [{
1297
+ type: Component,
1298
+ args: [{ selector: 'app-side-modal', imports: [PortalModule, ButtonComponent], animations: [sideModal, fadeBackdrop], template: "<div [@fadeBackdrop]=\"state\" class=\"backdrop\" (click)=\"closeOuside()\"> \r\n</div>\r\n<div [@sideModal]=\"state\" (@sideModal.done)=\"onAnimationDone($event)\" class=\"sidemodal\" [style.width]=\"myConfig.width??'60%'\" (click)=\"$event.stopPropagation()\">\r\n <ui-button class=\"close-icon\" (click)=\"close()\" icon=\"ri-close-large-line\" type=\"ghost\" color=\"black\" [iconOnly]=\"true\" size=\"m\"></ui-button>\r\n <div class=\"sidemodal-body\" [class.body-padding]=\"myConfig.title!=''\">\r\n <ng-template cdkPortalOutlet></ng-template>\r\n </div>\r\n @if (myConfig.footerEnabled) {\r\n <div class=\"sidemodal-footer\">\r\n @if (myConfig.showCancelButton) {\r\n <ui-button (click)=\"close()\" color=\"black\" size=\"l\" type=\"bordered\" icon=\"ri-close-line\">{{myConfig.footerCancelButtonText??'Cancelar'}}</ui-button>\r\n }\r\n <ui-button (click)=\"save()\" color=\"black\" size=\"l\" rightIcon=\"ri-check-line\">{{myConfig.footerOkButtonText??'Siguiente'}}</ui-button>\r\n </div>\r\n }\r\n</div>", styles: ["::ng-deep .side-modal-panel{position:fixed!important;top:0;right:0;height:100%;width:400px;background:#fff;z-index:2000;box-shadow:-2px 0 8px #0003;display:flex;flex-direction:column}.backdrop{position:fixed;inset:0;width:100%;height:100vh;background-color:#00000080;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);display:flex;justify-content:flex-end}.close-icon{position:absolute;right:32px;height:32px}.sidemodal{position:fixed;right:0;top:0;height:100%;background-color:#fff;display:flex;flex-direction:column;padding-top:28px}.sidemodal-header{height:32px;width:100%;padding:0 32px;display:flex;align-items:center;justify-content:space-between}.sidemodal-body{flex:1;overflow-y:auto;padding:32px}.sidemodal-footer{height:96px;padding:24px 40px;width:100%;display:flex;gap:8px;justify-content:flex-end;border-top:1px solid #d5d7da}\n"] }]
1299
+ }], ctorParameters: () => [{ type: UiModalRef, decorators: [{
1300
+ type: Inject,
1301
+ args: [UiModalRef]
1302
+ }] }, { type: i0.Type, decorators: [{
1303
+ type: Inject,
1304
+ args: [MODAL_COMPONENT]
1305
+ }] }, { type: undefined, decorators: [{
1306
+ type: Inject,
1307
+ args: [MODAL_CONFIG]
1308
+ }] }, { type: i0.Injector }, { type: UiModalService }], propDecorators: { portalOutlet: [{
1309
+ type: ViewChild,
1310
+ args: [CdkPortalOutlet, { static: true }]
1311
+ }] } });
1312
+
1313
+ class ModalComponent {
1314
+ modalRef;
1315
+ component;
1316
+ congif;
1317
+ injector;
1318
+ myConfig = {};
1319
+ ready = false;
1320
+ title = '';
1321
+ portalOutlet;
1322
+ constructor(modalRef, component, congif, injector) {
1323
+ this.modalRef = modalRef;
1324
+ this.component = component;
1325
+ this.congif = congif;
1326
+ this.injector = injector;
1327
+ this.myConfig = congif;
1328
+ }
1329
+ ngAfterViewInit() {
1330
+ const childInjector = Injector.create({
1331
+ providers: [
1332
+ { provide: UiModalRef, useValue: this.modalRef },
1333
+ { provide: MODAL_DATA, useValue: this.congif.data }
1334
+ ],
1335
+ parent: this.injector
1336
+ });
1337
+ const portal = new ComponentPortal(this.component, null, childInjector);
1338
+ this.portalOutlet.attachComponentPortal(portal);
1339
+ }
1340
+ closeOuside() {
1341
+ if (!this.congif.preventCloseingOutside === true) {
1342
+ this.modalRef.closeFloating(null);
1343
+ }
1344
+ }
1345
+ close() {
1346
+ this.modalRef.closeFloating(null);
1347
+ }
1348
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ModalComponent, deps: [{ token: UiModalRef }, { token: MODAL_COMPONENT }, { token: MODAL_CONFIG }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
1349
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: ModalComponent, isStandalone: true, selector: "app-modal", viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }], ngImport: i0, template: "<div class=\"backdrop\" (click)=\"closeOuside()\"> \r\n <div @pushTop class=\"modal\" \r\n [class]=\"myConfig.size\"\r\n (click)=\"$event.stopPropagation()\">\r\n \r\n @if ( myConfig.title) {\r\n <div class=\"modal-header\">\r\n {{myConfig.title}}\r\n <ui-button color=\"red\" type=\"ghost\" icon=\"ri-close-large-line\" (click)=\"close()\" [iconOnly]=\"true\"></ui-button>\r\n </div>\r\n }\r\n <div class=\"modal-body\" [class.body-padding]=\"myConfig.title!='' && !myConfig.noPadding\">\r\n <ng-template cdkPortalOutlet></ng-template>\r\n </div>\r\n\r\n </div>\r\n</div>", styles: [".backdrop{position:fixed;width:100%;height:100vh;background-color:#00000080;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);display:flex;align-items:center;justify-content:center}@media (max-width: 767px){.backdrop{align-items:flex-start;padding-top:20px}}.modal{background:#fff;border-radius:20px;min-width:300px;max-width:90%;height:fit-content;max-height:90vh;box-shadow:0 20px 70px #00000052;padding:0 10px;display:flex;flex-direction:column}.modal-header{padding:0 15px;width:100%;display:flex;align-items:center;font-size:22px;font-weight:600;justify-content:space-between;margin:0 auto;color:#592371;height:63px;border-bottom:solid 1px #592371}@media (max-width: 767px){.modal-header{padding:5px}}.modal-body{flex:1 1;overflow-y:auto}.body-padding{padding:25px}@media (max-width: 767px){.body-padding{padding:10px}}.medium{width:70%;max-width:800px;max-height:80%}@media (max-width: 767px){.medium{width:90%}}.large{width:80%;max-width:900px}@media (max-width: 767px){.large{width:95%}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i2.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }], animations: [pushTop] });
1350
+ }
1351
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ModalComponent, decorators: [{
1352
+ type: Component,
1353
+ args: [{ selector: 'app-modal', imports: [CommonModule, PortalModule, ButtonComponent], animations: [pushTop], template: "<div class=\"backdrop\" (click)=\"closeOuside()\"> \r\n <div @pushTop class=\"modal\" \r\n [class]=\"myConfig.size\"\r\n (click)=\"$event.stopPropagation()\">\r\n \r\n @if ( myConfig.title) {\r\n <div class=\"modal-header\">\r\n {{myConfig.title}}\r\n <ui-button color=\"red\" type=\"ghost\" icon=\"ri-close-large-line\" (click)=\"close()\" [iconOnly]=\"true\"></ui-button>\r\n </div>\r\n }\r\n <div class=\"modal-body\" [class.body-padding]=\"myConfig.title!='' && !myConfig.noPadding\">\r\n <ng-template cdkPortalOutlet></ng-template>\r\n </div>\r\n\r\n </div>\r\n</div>", styles: [".backdrop{position:fixed;width:100%;height:100vh;background-color:#00000080;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);display:flex;align-items:center;justify-content:center}@media (max-width: 767px){.backdrop{align-items:flex-start;padding-top:20px}}.modal{background:#fff;border-radius:20px;min-width:300px;max-width:90%;height:fit-content;max-height:90vh;box-shadow:0 20px 70px #00000052;padding:0 10px;display:flex;flex-direction:column}.modal-header{padding:0 15px;width:100%;display:flex;align-items:center;font-size:22px;font-weight:600;justify-content:space-between;margin:0 auto;color:#592371;height:63px;border-bottom:solid 1px #592371}@media (max-width: 767px){.modal-header{padding:5px}}.modal-body{flex:1 1;overflow-y:auto}.body-padding{padding:25px}@media (max-width: 767px){.body-padding{padding:10px}}.medium{width:70%;max-width:800px;max-height:80%}@media (max-width: 767px){.medium{width:90%}}.large{width:80%;max-width:900px}@media (max-width: 767px){.large{width:95%}}\n"] }]
1354
+ }], ctorParameters: () => [{ type: UiModalRef, decorators: [{
1355
+ type: Inject,
1356
+ args: [UiModalRef]
1357
+ }] }, { type: i0.Type, decorators: [{
1358
+ type: Inject,
1359
+ args: [MODAL_COMPONENT]
1360
+ }] }, { type: undefined, decorators: [{
1361
+ type: Inject,
1362
+ args: [MODAL_CONFIG]
1363
+ }] }, { type: i0.Injector }], propDecorators: { portalOutlet: [{
1364
+ type: ViewChild,
1365
+ args: [CdkPortalOutlet, { static: true }]
1366
+ }] } });
1367
+
1368
+ class UiModalService {
1369
+ overlay = inject(Overlay);
1370
+ envInjector = inject(EnvironmentInjector);
1371
+ openFloatingModal(component, config = {}) {
1372
+ return this.openModal(component, config, true);
1373
+ }
1374
+ openSideModal(component, config = {}) {
1375
+ return this.openModal(component, config, false);
1376
+ }
1377
+ openModal(component, config = {}, isFloating = false) {
1378
+ const overlayConfig = this.createOverlayConfig(isFloating);
1379
+ const overlayRef = this.overlay.create(overlayConfig);
1380
+ const modalRef = new UiModalRef(overlayRef, this);
1381
+ const injector = this.createModalInjector(overlayRef, modalRef, component, config);
1382
+ if (isFloating) {
1383
+ const modalPortal = new ComponentPortal(ModalComponent, null, injector);
1384
+ overlayRef.attach(modalPortal);
1385
+ }
1386
+ else {
1387
+ const modalPortal = new ComponentPortal(SideModalComponent, null, injector);
1388
+ const componentRef = overlayRef.attach(modalPortal);
1389
+ componentRef.instance.overlayRef = overlayRef;
1390
+ }
1391
+ return modalRef;
1392
+ }
1393
+ close(overlayRef, result = null) {
1394
+ overlayRef.hostElement.dispatchEvent(new CustomEvent(MODAL_CLOSE_REQUEST, { detail: result }));
1395
+ }
1396
+ closeFloating(overlayRef, result = null) {
1397
+ overlayRef.backdropElement?.dispatchEvent(new CustomEvent(MODAL_CLOSE_EVENT, { detail: result }));
1398
+ overlayRef.dispose();
1399
+ }
1400
+ _save$ = new Subject();
1401
+ save$ = this._save$.asObservable();
1402
+ triggerSave() {
1403
+ this._save$.next();
1404
+ }
1405
+ createOverlayConfig(isFloating) {
1406
+ const positionStrategy = isFloating
1407
+ ? this.overlay.position().global().left()
1408
+ : this.overlay.position().global().right();
1409
+ return {
1410
+ hasBackdrop: true,
1411
+ backdropClass: 'cdk-overlay-dark-backdrop',
1412
+ positionStrategy,
1413
+ scrollStrategy: this.overlay.scrollStrategies.block(),
1414
+ disposeOnNavigation: true,
1415
+ };
1416
+ }
1417
+ createModalInjector(overlayRef, modalRef, component, config) {
1418
+ return Injector.create({
1419
+ providers: [
1420
+ { provide: OverlayRef, useValue: overlayRef },
1421
+ { provide: UiModalRef, useValue: modalRef },
1422
+ { provide: MODAL_COMPONENT, useValue: component },
1423
+ { provide: MODAL_CONFIG, useValue: config }
1424
+ ],
1425
+ parent: this.envInjector,
1426
+ });
1427
+ }
1428
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UiModalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1429
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UiModalService, providedIn: 'root' });
1430
+ }
1431
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UiModalService, decorators: [{
1432
+ type: Injectable,
1433
+ args: [{
1434
+ providedIn: 'root'
1435
+ }]
1436
+ }] });
1437
+
1438
+ class TinyAlertComponent {
1439
+ modalRef;
1440
+ data;
1441
+ constructor(inData, modalRef) {
1442
+ this.modalRef = modalRef;
1443
+ this.data = inData.alert;
1444
+ }
1445
+ response = {};
1446
+ close(value) {
1447
+ this.modalRef.closeFloating(value ? this.response : null);
1448
+ }
1449
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TinyAlertComponent, deps: [{ token: MODAL_DATA }, { token: UiModalRef }], target: i0.ɵɵFactoryTarget.Component });
1450
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: TinyAlertComponent, isStandalone: true, selector: "lib-tiny-alert", ngImport: i0, template: "<div class=\"alert-wrapper\">\r\n @if (data.iconPath != '') {\r\n <img [src]=\"data.iconPath\" alt=\"\"> \r\n }\r\n <h3> {{data.title}} </h3>\r\n <div class=\"alert-body\" [innerHTML]=\"data.body\"> </div>\r\n <div class=\"card-buttons\">\r\n @if (data.showCancelButton) {\r\n <ui-button (click)=\"close(false)\" type=\"bordered\" [color]=\"data.cancelButtonColor??'primary'\" size=\"l\"> {{data.cancelButtonText??'Cancelar'}} </ui-button>\r\n }\r\n <ui-button (click)=\"close(true)\" [color]=\"data.okButtonColor??'primary'\" size=\"l\"> {{data.okButtonText??'Continuar'}} </ui-button>\r\n </div>\r\n <button class=\"floating-close\" (click)=\"close(false)\" >\r\n <i class=\"ri-close-line\"></i>\r\n </button>\r\n</div>\r\n", styles: [".alert-wrapper{position:relative;display:flex;flex-direction:column;align-items:center;padding:20px 20px 5px;width:400px;max-width:100%;-webkit-user-select:none;user-select:none}.alert-wrapper img{height:88px;margin-bottom:20px}h3{font-size:24px;font-weight:800;margin-bottom:10px}.alert-body{font-size:18px;font-weight:700;line-height:24px;text-align:center;color:#717680}.floating-close{position:absolute;top:-10px;right:-20px;background-color:transparent;font-size:28px;border:none;cursor:pointer;transition:ease .3s}.floating-close:hover{color:#f04438}@media (max-width: 767px){.floating-close{top:0;right:-5px}}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["text", "icon", "rightIcon", "iconOnly", "disabled", "loading", "size", "type", "color"] }] });
1451
+ }
1452
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TinyAlertComponent, decorators: [{
1453
+ type: Component,
1454
+ args: [{ selector: 'lib-tiny-alert', imports: [ButtonComponent], template: "<div class=\"alert-wrapper\">\r\n @if (data.iconPath != '') {\r\n <img [src]=\"data.iconPath\" alt=\"\"> \r\n }\r\n <h3> {{data.title}} </h3>\r\n <div class=\"alert-body\" [innerHTML]=\"data.body\"> </div>\r\n <div class=\"card-buttons\">\r\n @if (data.showCancelButton) {\r\n <ui-button (click)=\"close(false)\" type=\"bordered\" [color]=\"data.cancelButtonColor??'primary'\" size=\"l\"> {{data.cancelButtonText??'Cancelar'}} </ui-button>\r\n }\r\n <ui-button (click)=\"close(true)\" [color]=\"data.okButtonColor??'primary'\" size=\"l\"> {{data.okButtonText??'Continuar'}} </ui-button>\r\n </div>\r\n <button class=\"floating-close\" (click)=\"close(false)\" >\r\n <i class=\"ri-close-line\"></i>\r\n </button>\r\n</div>\r\n", styles: [".alert-wrapper{position:relative;display:flex;flex-direction:column;align-items:center;padding:20px 20px 5px;width:400px;max-width:100%;-webkit-user-select:none;user-select:none}.alert-wrapper img{height:88px;margin-bottom:20px}h3{font-size:24px;font-weight:800;margin-bottom:10px}.alert-body{font-size:18px;font-weight:700;line-height:24px;text-align:center;color:#717680}.floating-close{position:absolute;top:-10px;right:-20px;background-color:transparent;font-size:28px;border:none;cursor:pointer;transition:ease .3s}.floating-close:hover{color:#f04438}@media (max-width: 767px){.floating-close{top:0;right:-5px}}\n"] }]
1455
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
1456
+ type: Inject,
1457
+ args: [MODAL_DATA]
1458
+ }] }, { type: UiModalRef, decorators: [{
1459
+ type: Inject,
1460
+ args: [UiModalRef]
1461
+ }] }] });
1462
+
1463
+ class TinyAlertService {
1464
+ modal = inject(UiModalService);
1465
+ showAlert(data) {
1466
+ return new Promise((resolve) => {
1467
+ this.modal.openFloatingModal(TinyAlertComponent, {
1468
+ data: { alert: data }
1469
+ }).afterClosed().subscribe(result => {
1470
+ resolve({
1471
+ value: result?.status,
1472
+ data: result?.data
1473
+ });
1474
+ });
1475
+ });
1476
+ }
1477
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TinyAlertService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1478
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TinyAlertService, providedIn: 'root' });
1479
+ }
1480
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TinyAlertService, decorators: [{
1481
+ type: Injectable,
1482
+ args: [{
1483
+ providedIn: 'root'
1484
+ }]
1485
+ }] });
1486
+
1487
+ /**
1488
+ * Generated bundle index. Do not edit.
1489
+ */
1490
+
1491
+ export { AlertContainerComponent, ButtonComponent, CheckboxComponent, FormWrapperComponent, InputComponent, MODAL_CLOSE_EVENT, MODAL_CLOSE_REQUEST, MODAL_COMPONENT, MODAL_CONFIG, MODAL_DATA, NameInitsPipe, PushAlertService, SearcherComponent, SelectComponent, SkeletonLoaderComponent, TableComponent, TinyAlertService, ToggleButtonComponent, ToolTipDirective, UiModalRef, UiModalService, animatedRow, fadeAndRise, fadeBackdrop, highlightRow, pushTop, sideModal, simpleFade };
1492
+ //# sourceMappingURL=ui-core-abv.mjs.map