ln-20-lib-components 0.0.38 → 0.0.39

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.
@@ -0,0 +1,3558 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, model, input, computed, output, forwardRef, ChangeDetectionStrategy, effect, signal, ContentChildren, inject, ViewChild, Pipe, viewChild, ContentChild } from '@angular/core';
3
+ import { toObservable, takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
4
+ import * as i1 from '@angular/forms';
5
+ import { ReactiveFormsModule, NG_VALUE_ACCESSOR, FormsModule, NonNullableFormBuilder, FormGroup } from '@angular/forms';
6
+ import { switchMap, debounceTime, filter, map, distinctUntilChanged, Subject } from 'rxjs';
7
+ import * as i1$1 from '@angular/common';
8
+ import { NgClass, CommonModule } from '@angular/common';
9
+ import { CheckboxModule } from 'primeng/checkbox';
10
+ import * as i2 from 'primeng/datepicker';
11
+ import { DatePickerModule } from 'primeng/datepicker';
12
+ import { IftaLabelModule } from 'primeng/iftalabel';
13
+ import * as i6 from 'primeng/inputotp';
14
+ import { InputOtpModule } from 'primeng/inputotp';
15
+ import * as i3 from 'primeng/multiselect';
16
+ import { MultiSelectModule } from 'primeng/multiselect';
17
+ import * as i4 from 'primeng/select';
18
+ import { SelectModule } from 'primeng/select';
19
+ import * as i5 from 'primeng/togglebutton';
20
+ import { ToggleButtonModule } from 'primeng/togglebutton';
21
+ import * as i7 from 'primeng/toggleswitch';
22
+ import { ToggleSwitchModule } from 'primeng/toggleswitch';
23
+ import * as i10 from 'primeng/tooltip';
24
+ import { TooltipModule } from 'primeng/tooltip';
25
+ import * as i8 from 'primeng/inputnumber';
26
+ import { InputNumberModule } from 'primeng/inputnumber';
27
+ import * as i9 from 'primeng/textarea';
28
+ import { TextareaModule } from 'primeng/textarea';
29
+ import * as i2$1 from 'primeng/inputtext';
30
+ import { InputTextModule } from 'primeng/inputtext';
31
+ import { InputMaskModule } from 'primeng/inputmask';
32
+ import * as i9$1 from 'primeng/knob';
33
+ import { KnobModule } from 'primeng/knob';
34
+ import * as i11 from 'primeng/chip';
35
+ import { ChipModule } from 'primeng/chip';
36
+ import * as i4$1 from 'primeng/api';
37
+ import { PrimeTemplate, FilterService } from 'primeng/api';
38
+ import * as i1$2 from 'primeng/button';
39
+ import { ButtonModule } from 'primeng/button';
40
+ import jsPDF from 'jspdf';
41
+ import autoTable from 'jspdf-autotable';
42
+ import * as i2$2 from 'primeng/table';
43
+ import { TableModule } from 'primeng/table';
44
+ import * as XLSX from 'xlsx';
45
+ import * as i1$3 from 'primeng/badge';
46
+ import { BadgeModule } from 'primeng/badge';
47
+ import * as i1$4 from 'primeng/toolbar';
48
+ import { ToolbarModule } from 'primeng/toolbar';
49
+ import { DialogService, DynamicDialogRef, DynamicDialogConfig } from 'primeng/dynamicdialog';
50
+ import * as i1$5 from 'primeng/speeddial';
51
+ import { SpeedDialModule } from 'primeng/speeddial';
52
+
53
+ class LibComponentsService {
54
+ constructor() { }
55
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: LibComponentsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
56
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: LibComponentsService, providedIn: 'root' });
57
+ }
58
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: LibComponentsService, decorators: [{
59
+ type: Injectable,
60
+ args: [{
61
+ providedIn: 'root'
62
+ }]
63
+ }], ctorParameters: () => [] });
64
+
65
+ class LibComponentsComponent {
66
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: LibComponentsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
67
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: LibComponentsComponent, isStandalone: true, selector: "lib-lib-components", ngImport: i0, template: `
68
+ <p>
69
+ lib-components works!
70
+ </p>
71
+ `, isInline: true, styles: [""] });
72
+ }
73
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: LibComponentsComponent, decorators: [{
74
+ type: Component,
75
+ args: [{ selector: 'lib-lib-components', imports: [], template: `
76
+ <p>
77
+ lib-components works!
78
+ </p>
79
+ ` }]
80
+ }] });
81
+
82
+ var ETypeInput;
83
+ (function (ETypeInput) {
84
+ ETypeInput["TEXT"] = "text";
85
+ ETypeInput["PASSWORD"] = "password";
86
+ ETypeInput["EMAIL"] = "email";
87
+ ETypeInput["EMAIL_PASSWORD"] = "email-password";
88
+ ETypeInput["NUMBER"] = "number";
89
+ ETypeInput["DATE"] = "date";
90
+ ETypeInput["TIME"] = "time";
91
+ ETypeInput["DATETIME_LOCAL"] = "datetime-local";
92
+ ETypeInput["SEARCH"] = "search";
93
+ ETypeInput["TEL"] = "tel";
94
+ ETypeInput["URL"] = "url";
95
+ ETypeInput["COLOR"] = "color";
96
+ ETypeInput["MONTH"] = "month";
97
+ ETypeInput["WEEK"] = "week";
98
+ ETypeInput["FILE"] = "file";
99
+ ETypeInput["CHECKBOX"] = "checkbox";
100
+ ETypeInput["RADIO"] = "radio";
101
+ ETypeInput["RANGE"] = "range";
102
+ ETypeInput["HIDDEN"] = "hidden";
103
+ ETypeInput["TEXTAREA"] = "textarea";
104
+ ETypeInput["SELECT"] = "select";
105
+ ETypeInput["MULTISELECT"] = "multiselect";
106
+ ETypeInput["AUTOCOMPLETE"] = "autocomplete";
107
+ ETypeInput["SWITCH"] = "switch";
108
+ ETypeInput["CALENDAR"] = "calendar";
109
+ ETypeInput["DROPDOWN"] = "dropdown";
110
+ ETypeInput["CHIPS"] = "chips";
111
+ ETypeInput["TOGGLE"] = "toggle";
112
+ ETypeInput["OTP"] = "otp";
113
+ ETypeInput["CURRENCY"] = "currency";
114
+ ETypeInput["KNOB"] = "knob";
115
+ ETypeInput["BADGE"] = "badge";
116
+ ETypeInput["DECIMAL"] = "decimal";
117
+ ETypeInput["IMAGE"] = "image";
118
+ ETypeInput["COMPONENT"] = "component";
119
+ })(ETypeInput || (ETypeInput = {}));
120
+
121
+ class DisabledContainerComponent {
122
+ disabled = model(false);
123
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DisabledContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
124
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.17", type: DisabledContainerComponent, isStandalone: true, selector: "lib-disabled-container", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange" }, ngImport: i0, template: "<fieldset [disabled]=\"disabled()\" class=\"disabled-container\">\r\n <ng-content></ng-content>\r\n</fieldset>\r\n", styles: [".disabled-container{border:none;margin:0;padding:0;min-width:0}.disabled-container:disabled{opacity:.6;cursor:not-allowed}.disabled-container:disabled *{pointer-events:none}\n"] });
125
+ }
126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DisabledContainerComponent, decorators: [{
127
+ type: Component,
128
+ args: [{ selector: 'lib-disabled-container', imports: [], template: "<fieldset [disabled]=\"disabled()\" class=\"disabled-container\">\r\n <ng-content></ng-content>\r\n</fieldset>\r\n", styles: [".disabled-container{border:none;margin:0;padding:0;min-width:0}.disabled-container:disabled{opacity:.6;cursor:not-allowed}.disabled-container:disabled *{pointer-events:none}\n"] }]
129
+ }] });
130
+
131
+ class CustomInputComponent {
132
+ controlData = input.required();
133
+ controlUpperName = computed(() => this.controlData().controlName.toLocaleUpperCase());
134
+ showPassword = false;
135
+ output = output();
136
+ onChange = (_value) => { };
137
+ constructor() { }
138
+ writeValue(value) {
139
+ if (value !== this.controlData().control.value) {
140
+ this.controlData().control.setValue(value, { emitEvent: false });
141
+ }
142
+ }
143
+ get showLabel() {
144
+ return !this.controlData().hideLabel;
145
+ }
146
+ get inputTypesEnum() {
147
+ return ETypeInput;
148
+ }
149
+ onCheckboxChange(event, control) {
150
+ const input = event.target;
151
+ const isChecked = input.checked;
152
+ control.setValue(isChecked);
153
+ }
154
+ registerOnChange(fn) {
155
+ this.onChange = fn;
156
+ }
157
+ onBlur() {
158
+ this.controlData().onBlur?.();
159
+ }
160
+ onFocus() {
161
+ this.controlData().onFocus?.();
162
+ }
163
+ onTouched = () => { };
164
+ registerOnTouched(fn) {
165
+ this.onTouched = fn;
166
+ }
167
+ // setDisabledState(isDisabled: boolean): void {
168
+ // if (isDisabled) {
169
+ // this.controlData().control.disable()
170
+ // } else {
171
+ // this.controlData().control.enable()
172
+ // }
173
+ // }
174
+ generateUniqueId(baseString) {
175
+ const timestamp = new Date().getTime();
176
+ const random = Math.random().toString(36).substring(2, 8);
177
+ return `${baseString}-${timestamp}-${random}`;
178
+ }
179
+ togglePasswordVisibility() {
180
+ this.showPassword = !this.showPassword;
181
+ }
182
+ onSelectChange() {
183
+ this.output.emit(this.controlData());
184
+ }
185
+ /**
186
+ * Sincroniza el valor del input visible con el input oculto de password
187
+ * para mantener ambos actualizados
188
+ */
189
+ syncPasswordAutofill(event) {
190
+ const visibleInput = event.target;
191
+ const currentComponent = visibleInput.closest('lib-custom-input');
192
+ if (!currentComponent)
193
+ return;
194
+ const hiddenInput = currentComponent.querySelector('input[type="password"][id^="password-autofill-hidden-"]');
195
+ if (hiddenInput && hiddenInput.value !== visibleInput.value) {
196
+ hiddenInput.value = visibleInput.value;
197
+ }
198
+ }
199
+ /**
200
+ * Maneja el autocompletado cuando el navegador llena el input oculto de password.
201
+ * Actualiza el input visible y el FormControl.
202
+ */
203
+ onPasswordAutofillHidden(event) {
204
+ const hiddenInput = event.target;
205
+ const passwordValue = hiddenInput.value;
206
+ if (!passwordValue)
207
+ return;
208
+ // Buscar el input visible de password en el mismo componente
209
+ const currentComponent = hiddenInput.closest('lib-custom-input');
210
+ if (!currentComponent)
211
+ return;
212
+ const visibleInput = currentComponent.querySelector('input[type="password"]:not([id^="password-autofill-hidden-"]), input[type="text"][class*="custom-password"]');
213
+ if (visibleInput && visibleInput.value !== passwordValue) {
214
+ // Actualizar el input visible
215
+ visibleInput.value = passwordValue;
216
+ // Actualizar el FormControl
217
+ this.controlData().control.setValue(passwordValue, { emitEvent: true });
218
+ // Disparar eventos para que Angular Forms lo detecte
219
+ visibleInput.dispatchEvent(new Event('input', { bubbles: true, cancelable: true }));
220
+ visibleInput.dispatchEvent(new Event('change', { bubbles: true, cancelable: true }));
221
+ }
222
+ }
223
+ /**
224
+ * Maneja el autocompletado del password cuando el navegador llena automáticamente
225
+ * el campo de password oculto en EMAIL_PASSWORD. Busca el siguiente campo de password
226
+ * en el formulario y actualiza su FormControl directamente.
227
+ */
228
+ onPasswordAutofill(event) {
229
+ const passwordInput = event.target;
230
+ const passwordValue = passwordInput.value;
231
+ if (!passwordValue)
232
+ return;
233
+ // Buscar el formulario padre
234
+ let parent = passwordInput.parentElement;
235
+ let formElement = null;
236
+ for (let i = 0; i < 6 && parent; i++) {
237
+ if (parent.tagName === 'FORM') {
238
+ formElement = parent;
239
+ break;
240
+ }
241
+ parent = parent.parentElement;
242
+ }
243
+ if (!formElement)
244
+ return;
245
+ // Buscar el componente lib-custom-input actual (EMAIL_PASSWORD)
246
+ const currentComponent = passwordInput.closest('lib-custom-input');
247
+ if (!currentComponent)
248
+ return;
249
+ // Buscar todos los componentes lib-custom-input en el formulario
250
+ const allCustomInputs = formElement.querySelectorAll('lib-custom-input');
251
+ const currentIndex = Array.from(allCustomInputs).indexOf(currentComponent);
252
+ // Buscar el siguiente componente después del actual que tenga un campo de password
253
+ for (let i = currentIndex + 1; i < allCustomInputs.length; i++) {
254
+ const nextComponent = allCustomInputs[i];
255
+ // Buscar el input de password dentro del componente siguiente
256
+ const passwordField = nextComponent.querySelector('input[type="password"]:not([id="password-autofill-helper"])');
257
+ if (passwordField) {
258
+ // Actualizar el valor directamente en el input
259
+ // y disparar eventos para que Angular Forms lo detecte
260
+ passwordField.value = passwordValue;
261
+ passwordField.dispatchEvent(new Event('input', { bubbles: true, cancelable: true }));
262
+ passwordField.dispatchEvent(new Event('change', { bubbles: true, cancelable: true }));
263
+ // Forzar la actualización después de un breve delay
264
+ // para asegurar que Angular Forms procese el cambio
265
+ setTimeout(() => {
266
+ if (passwordField.value !== passwordValue) {
267
+ passwordField.value = passwordValue;
268
+ passwordField.dispatchEvent(new Event('input', { bubbles: true }));
269
+ }
270
+ }, 50);
271
+ break;
272
+ }
273
+ }
274
+ }
275
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CustomInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
276
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: CustomInputComponent, isStandalone: true, selector: "lib-custom-input", inputs: { controlData: { classPropertyName: "controlData", publicName: "controlData", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { output: "output" }, providers: [{
277
+ provide: NG_VALUE_ACCESSOR,
278
+ useExisting: forwardRef(() => CustomInputComponent),
279
+ multi: true
280
+ }], ngImport: i0, template: "@let localControl = controlData().control;\r\n@let placeholder = controlData().label || controlUpperName();\r\n@let name = controlData().controlName;\r\n@let typeInput = controlData().typeInput;\r\n@let readonly = controlData().readonly || false;\r\n@let dateConfig = controlData().dateConfig;\r\n@let multiSelectConfig = controlData().multiSelectConfig;\r\n@let selectConfig = controlData().selectConfig;\r\n@let toggleConfig = controlData().toggleConfig;\r\n@let textareaConfig = controlData().textareaConfig;\r\n@let currencyConfig = controlData().currencyConfig;\r\n@let decimalConfig = controlData().decimalConfig;\r\n@let autoFocus = controlData().autoFocus ?? false;\r\n<div class=\"flex flex-col gap-1 \">\r\n <lib-disabled-container [disabled]=\"readonly\">\r\n\r\n <p style=\"font-size: 12px; letter-spacing: 0.5px;\" class=\"text-sm text-gray-600 dark:text-gray-300 truncate\"\r\n [pTooltip]=\"placeholder\" tooltipPosition=\"top\" [showDelay]=\"300\">\r\n {{ placeholder }}\r\n </p>\r\n @switch (typeInput) {\r\n @case (inputTypesEnum.EMAIL_PASSWORD) {\r\n <input [formControl]=\"localControl\" (blur)=\"onTouched()\" pInputText [id]=\"generateUniqueId(name)\" [name]=\"name\"\r\n type=\"email\" [readOnly]=\"readonly\" autocomplete=\"email\" autocorrect=\"on\" autocapitalize=\"on\"\r\n spellcheck=\"true\" [ngClass]=\"{\r\n 'border-red-500 focus:ring-red-500':\r\n localControl.invalid &&\r\n (localControl.dirty || localControl.touched),\r\n 'bg-gray-100 cursor-not-allowed': readonly,\r\n }\"\r\n class=\"custom-input h-12 w-full px-3 py-2 border border-gray-300 dark:border-transparent rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-all duration-200 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100\" />\r\n <input type=\"password\" name=\"password\" id=\"password-autofill-helper\" autocomplete=\"current-password\" tabindex=\"-1\"\r\n style=\"position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0;\"\r\n aria-hidden=\"true\"\r\n (input)=\"onPasswordAutofill($event)\" />\r\n }\r\n @case (inputTypesEnum.PASSWORD) {\r\n <!-- Input oculto siempre de tipo password para el autocompletado del navegador -->\r\n <input \r\n type=\"password\" \r\n name=\"password-autofill\"\r\n [id]=\"'password-autofill-hidden-' + generateUniqueId(name)\"\r\n autocomplete=\"current-password\" \r\n tabindex=\"-1\"\r\n style=\"position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0;\"\r\n aria-hidden=\"true\"\r\n [value]=\"localControl.value || ''\"\r\n (input)=\"onPasswordAutofillHidden($event)\" />\r\n <div class=\"relative\">\r\n <input [readOnly]=\"readonly || false\" [id]=\"generateUniqueId(name)\" [type]=\"showPassword ? 'text' : 'password'\"\r\n autocomplete=\"password\" autocorrect=\"on\" autocapitalize=\"on\" spellcheck=\"true\"\r\n class=\"custom-password w-full px-3 py-2 border border-gray-300 dark:border-transparent rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 transition-all duration-200\"\r\n aria-describedby=\"password-help\" [formControl]=\"localControl\" \r\n (input)=\"syncPasswordAutofill($event)\" />\r\n <button type=\"button\"\r\n class=\"custom-password-toggle absolute inset-y-0 right-0 flex items-center justify-center w-12 h-full text-gray-400 transition-colors duration-200 ease-in-out hover:text-gray-600 focus:outline-none focus:text-gray-600 active:text-gray-700 dark:text-gray-500 dark:hover:text-gray-300 dark:focus:text-gray-300\"\r\n (click)=\"togglePasswordVisibility()\" [attr.aria-label]=\"\r\n showPassword ? 'Ocultar contrase\u00F1a' : 'Mostrar contrase\u00F1a'\r\n \">\r\n <i class=\"fas text-lg transition-all duration-200 ease-in-out\" [ngClass]=\"{\r\n 'fa-solid fa-eye': !showPassword,\r\n 'fa-solid fa-eye-slash': showPassword,\r\n }\"></i>\r\n </button>\r\n </div>\r\n }\r\n @case (inputTypesEnum.EMAIL) {\r\n <input [formControl]=\"localControl\" (blur)=\"onTouched()\" pInputText [id]=\"generateUniqueId(name)\" [name]=\"name\"\r\n [type]=\"typeInput\" [readOnly]=\"readonly\" autocomplete=\"email\" autocorrect=\"on\" autocapitalize=\"on\" spellcheck=\"true\"\r\n [ngClass]=\"{\r\n 'border-red-500 focus:ring-red-500':\r\n localControl.invalid &&\r\n (localControl.dirty || localControl.touched),\r\n 'bg-gray-100 cursor-not-allowed': readonly,\r\n }\"\r\n class=\"custom-input h-12 w-full px-3 py-2 border border-gray-300 dark:border-transparent rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-all duration-200 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100\" />\r\n }\r\n @case (inputTypesEnum.CURRENCY) {\r\n <p-inputnumber [autofocus]=\"autoFocus ?? false\" [formControl]=\"localControl\" (onFocus)=\"onFocus()\" (onBlur)=\"onBlur()\" (blur)=\"onTouched()\" [id]=\"generateUniqueId(name)\" mode=\"currency\"\r\n [currency]=\"currencyConfig?.currency ?? 'USD'\" [locale]=\"currencyConfig?.locale ?? 'es-CO'\" [minFractionDigits]=\"currencyConfig?.minFractionDigits ?? 2\"\r\n [maxFractionDigits]=\"currencyConfig?.maxFractionDigits ?? 2\" [readonly]=\"readonly\" [disabled]=\"readonly\" />\r\n }\r\n @case (inputTypesEnum.DATE) {\r\n <lib-disabled-container [disabled]=\"readonly\">\r\n <p-datepicker [formControl]=\"localControl\" [selectionMode]=\"dateConfig?.selectionMode || 'single'\"\r\n [maxDate]=\"dateConfig?.maxDate || null\" [minDate]=\"dateConfig?.minDate || null\" class=\"custom-datepicker\"\r\n appendTo=\"body\" />\r\n </lib-disabled-container>\r\n }\r\n @case (inputTypesEnum.TOGGLE) {\r\n <div class=\"flex justify-center items-center p-4\">\r\n <p-togglebutton [formControl]=\"localControl\" [onLabel]=\"toggleConfig?.onLabel || 'Si'\"\r\n [offLabel]=\"toggleConfig?.offLabel || 'No'\" class=\"custom-toggle\" />\r\n </div>\r\n }\r\n @case (inputTypesEnum.MULTISELECT) {\r\n <p-multiselect [filter]=\"true\" [options]=\"multiSelectConfig?.options\" [formControl]=\"localControl\"\r\n [optionLabel]=\"multiSelectConfig?.optionLabel ?? 'name'\" placeholder=\"\" [maxSelectedLabels]=\"3\"\r\n class=\"custom-multiselect\" appendTo=\"body\" />\r\n }\r\n @case (inputTypesEnum.SELECT) {\r\n <p-select [filter]=\"true\" [options]=\"selectConfig?.options\" [formControl]=\"localControl\"\r\n [optionLabel]=\"selectConfig?.optionLabel ?? 'name'\" placeholder=\"\" class=\"custom-select\"\r\n (onChange)=\"onSelectChange()\" appendTo=\"body\" [disabled]=\"readonly\" [readonly]=\"readonly\" [styleClass]=\"\r\n (localControl.invalid && (localControl.dirty || localControl.touched) ? 'border-red-500 focus:ring-red-500 ' : '') +\r\n (readonly ? 'bg-gray-100 cursor-not-allowed' : '')\r\n \" />\r\n }\r\n \r\n @case (inputTypesEnum.CHECKBOX) {\r\n <div class=\"flex justify-center items-center p-4\">\r\n <input [id]=\"generateUniqueId(name)\" [readOnly]=\"readonly\" [type]=\"typeInput\" [checked]=\"localControl.value\"\r\n (change)=\"onCheckboxChange($event, localControl)\"\r\n class=\"custom-checkbox h-5 w-5 border-2 border-gray-300 dark:border-transparent rounded focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 transition-all duration-200\"\r\n [formControl]=\"localControl\" />\r\n </div>\r\n }\r\n @case (inputTypesEnum.OTP) {\r\n <div class=\"flex justify-center items-center p-4\">\r\n <p-inputotp [id]=\"generateUniqueId(name)\" (onBlur)=\"onTouched()\" [mask]=\"controlData().otpConfig?.mask ?? false\"\r\n [length]=\"controlData().otpConfig?.length ?? 6\" [integerOnly]=\"controlData().otpConfig?.integerOnly ?? false\"\r\n class=\"custom-otp border-2 border-gray-300 dark:border-transparent rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 transition-all duration-200\"\r\n [formControl]=\"localControl\" />\r\n </div>\r\n }\r\n @case (inputTypesEnum.SWITCH) {\r\n <div class=\"flex justify-center items-center p-4\">\r\n <p-toggleswitch [id]=\"generateUniqueId(name)\" [formControl]=\"localControl\"\r\n class=\"custom-switch border-2 border-gray-300 dark:border-transparent rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 transition-all duration-200\"\r\n (change)=\"onCheckboxChange($event, localControl)\">\r\n <ng-template #handle let-checked=\"checked\">\r\n <span class=\"text-xs bg-gray-100 dark:bg-gray-600 text-gray-800 dark:text-gray-200 rounded-full px-1\">\r\n @if (checked) {\r\n Si\r\n }\r\n @else {\r\n No\r\n }\r\n </span>\r\n </ng-template>\r\n </p-toggleswitch>\r\n </div>\r\n }\r\n @case (inputTypesEnum.DECIMAL) {\r\n <p-inputnumber [autofocus]=\"autoFocus ?? false\" [formControl]=\"localControl\" (onBlur)=\"onBlur()\" (blur)=\"onTouched()\" [id]=\"generateUniqueId(name)\" mode=\"decimal\"\r\n (onFocus)=\"onFocus()\"\r\n [locale]=\"'es-CO'\" [minFractionDigits]=\"decimalConfig?.minFractionDigits ?? 2\" [maxFractionDigits]=\"decimalConfig?.maxFractionDigits ?? 2\" [useGrouping]=\"decimalConfig?.useGrouping ?? true\" [readonly]=\"readonly\" [disabled]=\"readonly\" />\r\n }\r\n @case (inputTypesEnum.TEXTAREA) {\r\n <textarea pTextarea [formControl]=\"localControl\" [rows]=\"textareaConfig?.rows ?? 3\"\r\n [cols]=\"textareaConfig?.cols ?? 30\" [autoResize]=\"true\" [variant]=\"textareaConfig?.variant ?? 'outlined'\"\r\n (blur)=\"onTouched()\" [id]=\"generateUniqueId(name)\" [readonly]=\"readonly\" autocomplete=\"off\" autocorrect=\"off\"\r\n autocapitalize=\"off\" spellcheck=\"false\"\r\n class=\"custom-textarea w-full px-3 py-2 border border-gray-300 dark:border-transparent rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-all duration-200 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100\"></textarea>\r\n }\r\n @default {\r\n <input [formControl]=\"localControl\" (blur)=\"onTouched()\" pInputText [id]=\"generateUniqueId(name)\" [type]=\"typeInput\"\r\n [readOnly]=\"readonly\" autocomplete=\"off\" autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" [ngClass]=\"{\r\n 'border-red-500 focus:ring-red-500':\r\n localControl.invalid &&\r\n (localControl.dirty || localControl.touched),\r\n 'bg-gray-100 cursor-not-allowed': readonly,\r\n }\"\r\n class=\"custom-input h-12 w-full px-3 py-2 border border-gray-300 dark:border-transparent rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-all duration-200 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100\" />\r\n }\r\n }\r\n </lib-disabled-container>\r\n\r\n</div>\r\n\r\n@if (localControl.invalid && (localControl.dirty || localControl.touched)) {\r\n<div class=\"custom-error mt-1 text-sm text-red-600 dark:text-red-400\">\r\n @if (localControl.errors?.[\"required\"]) {\r\n <span style=\"font-size: 0.675rem; font-style: italic; letter-spacing: 0.02em;\">{{\r\n 'El campo es requerido' }}</span>\r\n }\r\n @if (localControl.errors?.[\"min\"]) {\r\n <span style=\"font-size: 0.675rem; font-style: italic; letter-spacing: 0.02em;\">{{ 'El valor m\u00EDnimo es de ' +\r\n localControl.errors?.[\"min\"].min.toFixed(2) }}</span>\r\n }\r\n @if (localControl.errors?.[\"max\"]) {\r\n <span style=\"font-size: 0.675rem; font-style: italic; letter-spacing: 0.02em;\">{{ 'El valor m\u00E1ximo es de ' +\r\n localControl.errors?.[\"max\"].max.toFixed(2) }}</span>\r\n }\r\n @if (localControl.errors?.[\"minlength\"]) {\r\n <span style=\"font-size: 0.675rem; font-style: italic; letter-spacing: 0.02em;\">{{\r\n 'El largo m\u00EDnimo es de ' + localControl.errors?.[\"minlength\"].requiredLength\r\n }}</span>\r\n }\r\n @if (localControl.errors?.[\"maxlength\"]) {\r\n <span style=\"font-size: 0.675rem; font-style: italic; letter-spacing: 0.02em;\">{{\r\n 'El largo m\u00E1ximo es de ' + localControl.errors?.[\"maxlength\"].requiredLength\r\n }}</span>\r\n }\r\n @if (localControl.errors?.[\"email\"]) {\r\n <span style=\"font-size: 0.675rem; font-style: italic; letter-spacing: 0.02em;\">{{\r\n 'El correo electr\u00F3nico no es v\u00E1lido' }}</span>\r\n }\r\n @if (localControl.errors?.[\"pattern\"]) {\r\n <span style=\"font-size: 0.675rem; font-style: italic; letter-spacing: 0.02em;\">{{\r\n 'El formato no es v\u00E1lido' }}</span>\r\n }\r\n</div>\r\n}", styles: ["@charset \"UTF-8\";:host ::ng-deep p-datepicker>span>.p-inputtext{width:100%;border-radius:.5rem;outline:none;background-color:#f9fafb;height:44px;padding-right:2.5rem;color:#111827;transition:all .2s ease-in-out}:host ::ng-deep p-datepicker>.p-datepicker>.p-inputtext{background:transparent;color:#111827;height:44px;transition:all .2s ease-in-out}:host ::ng-deep .my-app-dark p-datepicker>.p-datepicker>.p-inputtext{background:transparent;background-color:#374151;color:#f3f4f6}:host ::ng-deep p-datepicker>span{width:100%;position:relative;display:inline-flex}:host ::ng-deep p-datepicker .p-datepicker-trigger{position:absolute!important;right:0!important;top:0!important;height:44px!important;width:2.5rem!important;background:transparent!important;border:none!important;box-shadow:none!important;color:#6b7280!important;display:flex!important;align-items:center!important;justify-content:center!important;z-index:1!important}:host ::ng-deep .my-app-dark p-datepicker .p-datepicker-trigger{color:#9ca3af!important}:host ::ng-deep p-datepicker .p-datepicker-trigger .p-button-icon{font-size:.875rem}:host ::ng-deep p-multiselect{border:1px solid #d1d5db;background:transparent;color:#111827;height:44px;width:100%;border-radius:.5rem;transition:all .2s ease-in-out}:host ::ng-deep .my-app-dark p-multiselect{background:transparent;color:#f3f4f6}:host ::ng-deep p-select{background:transparent;color:#111827;height:44px;width:100%;border-radius:.5rem;transition:all .2s ease-in-out}:host ::ng-deep .my-app-dark p-select{background:transparent;color:#f3f4f6}:host ::ng-deep p-select>.p-select-label{font-size:small;position:relative}:host ::ng-deep p-inputnumber{background:transparent;color:#111827;height:44px;width:100%;border:1px solid #d1d5db;border-radius:.5rem;transition:all .2s ease-in-out}:host ::ng-deep .my-app-dark p-inputnumber{background:transparent;color:#f3f4f6}:host-context(.my-app-dark) ::ng-deep .custom-datepicker>.p-inputwrapper>.p-inputtext{color:#f3f4f6;background-color:#374151}:host-context(.my-app-dark) ::ng-deep p-datepicker>span>.p-inputtext{background-color:#374151;color:#f3f4f6}:host-context(.my-app-dark) ::ng-deep .p-inputtext{background-color:#374151;color:#f3f4f6;border-color:transparent}:host-context(.my-app-dark) ::ng-deep .p-inputnumber-input{background-color:#374151;color:#f3f4f6;border-color:transparent}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: IftaLabelModule }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: DatePickerModule }, { kind: "component", type: i2.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "fluid", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "size", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i3.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "fluid", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "size", "showClear", "autofocus", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i4.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "size", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "fluid", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: ToggleButtonModule }, { kind: "component", type: i5.ToggleButton, selector: "p-toggleButton, p-togglebutton, p-toggle-button", inputs: ["onLabel", "offLabel", "onIcon", "offIcon", "ariaLabel", "ariaLabelledBy", "disabled", "style", "styleClass", "inputId", "tabindex", "size", "iconPos", "autofocus", "allowEmpty"], outputs: ["onChange"] }, { kind: "ngmodule", type: InputOtpModule }, { kind: "component", type: i6.InputOtp, selector: "p-inputOtp, p-inputotp, p-input-otp", inputs: ["invalid", "disabled", "readonly", "variant", "tabindex", "length", "styleClass", "mask", "integerOnly", "autofocus", "size"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: ToggleSwitchModule }, { kind: "component", type: i7.ToggleSwitch, selector: "p-toggleswitch, p-toggleSwitch, p-toggle-switch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabel", "ariaLabelledBy", "autofocus"], outputs: ["onChange"] }, { kind: "ngmodule", type: InputNumberModule }, { kind: "component", type: i8.InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabelledBy", "ariaDescribedBy", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "variant", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus", "disabled", "fluid"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "ngmodule", type: TextareaModule }, { kind: "directive", type: i9.Textarea, selector: "[pTextarea], [pInputTextarea]", inputs: ["autoResize", "variant", "fluid", "pSize"], outputs: ["onResize"] }, { kind: "component", type: DisabledContainerComponent, selector: "lib-disabled-container", inputs: ["disabled"], outputs: ["disabledChange"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i10.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
281
+ }
282
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CustomInputComponent, decorators: [{
283
+ type: Component,
284
+ args: [{ selector: 'lib-custom-input', imports: [
285
+ ReactiveFormsModule,
286
+ IftaLabelModule,
287
+ NgClass,
288
+ DatePickerModule,
289
+ CheckboxModule,
290
+ MultiSelectModule,
291
+ SelectModule,
292
+ ToggleButtonModule,
293
+ InputOtpModule,
294
+ ToggleSwitchModule,
295
+ InputNumberModule,
296
+ TextareaModule,
297
+ DisabledContainerComponent,
298
+ TooltipModule,
299
+ ], changeDetection: ChangeDetectionStrategy.OnPush, providers: [{
300
+ provide: NG_VALUE_ACCESSOR,
301
+ useExisting: forwardRef(() => CustomInputComponent),
302
+ multi: true
303
+ }], template: "@let localControl = controlData().control;\r\n@let placeholder = controlData().label || controlUpperName();\r\n@let name = controlData().controlName;\r\n@let typeInput = controlData().typeInput;\r\n@let readonly = controlData().readonly || false;\r\n@let dateConfig = controlData().dateConfig;\r\n@let multiSelectConfig = controlData().multiSelectConfig;\r\n@let selectConfig = controlData().selectConfig;\r\n@let toggleConfig = controlData().toggleConfig;\r\n@let textareaConfig = controlData().textareaConfig;\r\n@let currencyConfig = controlData().currencyConfig;\r\n@let decimalConfig = controlData().decimalConfig;\r\n@let autoFocus = controlData().autoFocus ?? false;\r\n<div class=\"flex flex-col gap-1 \">\r\n <lib-disabled-container [disabled]=\"readonly\">\r\n\r\n <p style=\"font-size: 12px; letter-spacing: 0.5px;\" class=\"text-sm text-gray-600 dark:text-gray-300 truncate\"\r\n [pTooltip]=\"placeholder\" tooltipPosition=\"top\" [showDelay]=\"300\">\r\n {{ placeholder }}\r\n </p>\r\n @switch (typeInput) {\r\n @case (inputTypesEnum.EMAIL_PASSWORD) {\r\n <input [formControl]=\"localControl\" (blur)=\"onTouched()\" pInputText [id]=\"generateUniqueId(name)\" [name]=\"name\"\r\n type=\"email\" [readOnly]=\"readonly\" autocomplete=\"email\" autocorrect=\"on\" autocapitalize=\"on\"\r\n spellcheck=\"true\" [ngClass]=\"{\r\n 'border-red-500 focus:ring-red-500':\r\n localControl.invalid &&\r\n (localControl.dirty || localControl.touched),\r\n 'bg-gray-100 cursor-not-allowed': readonly,\r\n }\"\r\n class=\"custom-input h-12 w-full px-3 py-2 border border-gray-300 dark:border-transparent rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-all duration-200 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100\" />\r\n <input type=\"password\" name=\"password\" id=\"password-autofill-helper\" autocomplete=\"current-password\" tabindex=\"-1\"\r\n style=\"position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0;\"\r\n aria-hidden=\"true\"\r\n (input)=\"onPasswordAutofill($event)\" />\r\n }\r\n @case (inputTypesEnum.PASSWORD) {\r\n <!-- Input oculto siempre de tipo password para el autocompletado del navegador -->\r\n <input \r\n type=\"password\" \r\n name=\"password-autofill\"\r\n [id]=\"'password-autofill-hidden-' + generateUniqueId(name)\"\r\n autocomplete=\"current-password\" \r\n tabindex=\"-1\"\r\n style=\"position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0;\"\r\n aria-hidden=\"true\"\r\n [value]=\"localControl.value || ''\"\r\n (input)=\"onPasswordAutofillHidden($event)\" />\r\n <div class=\"relative\">\r\n <input [readOnly]=\"readonly || false\" [id]=\"generateUniqueId(name)\" [type]=\"showPassword ? 'text' : 'password'\"\r\n autocomplete=\"password\" autocorrect=\"on\" autocapitalize=\"on\" spellcheck=\"true\"\r\n class=\"custom-password w-full px-3 py-2 border border-gray-300 dark:border-transparent rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 transition-all duration-200\"\r\n aria-describedby=\"password-help\" [formControl]=\"localControl\" \r\n (input)=\"syncPasswordAutofill($event)\" />\r\n <button type=\"button\"\r\n class=\"custom-password-toggle absolute inset-y-0 right-0 flex items-center justify-center w-12 h-full text-gray-400 transition-colors duration-200 ease-in-out hover:text-gray-600 focus:outline-none focus:text-gray-600 active:text-gray-700 dark:text-gray-500 dark:hover:text-gray-300 dark:focus:text-gray-300\"\r\n (click)=\"togglePasswordVisibility()\" [attr.aria-label]=\"\r\n showPassword ? 'Ocultar contrase\u00F1a' : 'Mostrar contrase\u00F1a'\r\n \">\r\n <i class=\"fas text-lg transition-all duration-200 ease-in-out\" [ngClass]=\"{\r\n 'fa-solid fa-eye': !showPassword,\r\n 'fa-solid fa-eye-slash': showPassword,\r\n }\"></i>\r\n </button>\r\n </div>\r\n }\r\n @case (inputTypesEnum.EMAIL) {\r\n <input [formControl]=\"localControl\" (blur)=\"onTouched()\" pInputText [id]=\"generateUniqueId(name)\" [name]=\"name\"\r\n [type]=\"typeInput\" [readOnly]=\"readonly\" autocomplete=\"email\" autocorrect=\"on\" autocapitalize=\"on\" spellcheck=\"true\"\r\n [ngClass]=\"{\r\n 'border-red-500 focus:ring-red-500':\r\n localControl.invalid &&\r\n (localControl.dirty || localControl.touched),\r\n 'bg-gray-100 cursor-not-allowed': readonly,\r\n }\"\r\n class=\"custom-input h-12 w-full px-3 py-2 border border-gray-300 dark:border-transparent rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-all duration-200 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100\" />\r\n }\r\n @case (inputTypesEnum.CURRENCY) {\r\n <p-inputnumber [autofocus]=\"autoFocus ?? false\" [formControl]=\"localControl\" (onFocus)=\"onFocus()\" (onBlur)=\"onBlur()\" (blur)=\"onTouched()\" [id]=\"generateUniqueId(name)\" mode=\"currency\"\r\n [currency]=\"currencyConfig?.currency ?? 'USD'\" [locale]=\"currencyConfig?.locale ?? 'es-CO'\" [minFractionDigits]=\"currencyConfig?.minFractionDigits ?? 2\"\r\n [maxFractionDigits]=\"currencyConfig?.maxFractionDigits ?? 2\" [readonly]=\"readonly\" [disabled]=\"readonly\" />\r\n }\r\n @case (inputTypesEnum.DATE) {\r\n <lib-disabled-container [disabled]=\"readonly\">\r\n <p-datepicker [formControl]=\"localControl\" [selectionMode]=\"dateConfig?.selectionMode || 'single'\"\r\n [maxDate]=\"dateConfig?.maxDate || null\" [minDate]=\"dateConfig?.minDate || null\" class=\"custom-datepicker\"\r\n appendTo=\"body\" />\r\n </lib-disabled-container>\r\n }\r\n @case (inputTypesEnum.TOGGLE) {\r\n <div class=\"flex justify-center items-center p-4\">\r\n <p-togglebutton [formControl]=\"localControl\" [onLabel]=\"toggleConfig?.onLabel || 'Si'\"\r\n [offLabel]=\"toggleConfig?.offLabel || 'No'\" class=\"custom-toggle\" />\r\n </div>\r\n }\r\n @case (inputTypesEnum.MULTISELECT) {\r\n <p-multiselect [filter]=\"true\" [options]=\"multiSelectConfig?.options\" [formControl]=\"localControl\"\r\n [optionLabel]=\"multiSelectConfig?.optionLabel ?? 'name'\" placeholder=\"\" [maxSelectedLabels]=\"3\"\r\n class=\"custom-multiselect\" appendTo=\"body\" />\r\n }\r\n @case (inputTypesEnum.SELECT) {\r\n <p-select [filter]=\"true\" [options]=\"selectConfig?.options\" [formControl]=\"localControl\"\r\n [optionLabel]=\"selectConfig?.optionLabel ?? 'name'\" placeholder=\"\" class=\"custom-select\"\r\n (onChange)=\"onSelectChange()\" appendTo=\"body\" [disabled]=\"readonly\" [readonly]=\"readonly\" [styleClass]=\"\r\n (localControl.invalid && (localControl.dirty || localControl.touched) ? 'border-red-500 focus:ring-red-500 ' : '') +\r\n (readonly ? 'bg-gray-100 cursor-not-allowed' : '')\r\n \" />\r\n }\r\n \r\n @case (inputTypesEnum.CHECKBOX) {\r\n <div class=\"flex justify-center items-center p-4\">\r\n <input [id]=\"generateUniqueId(name)\" [readOnly]=\"readonly\" [type]=\"typeInput\" [checked]=\"localControl.value\"\r\n (change)=\"onCheckboxChange($event, localControl)\"\r\n class=\"custom-checkbox h-5 w-5 border-2 border-gray-300 dark:border-transparent rounded focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 transition-all duration-200\"\r\n [formControl]=\"localControl\" />\r\n </div>\r\n }\r\n @case (inputTypesEnum.OTP) {\r\n <div class=\"flex justify-center items-center p-4\">\r\n <p-inputotp [id]=\"generateUniqueId(name)\" (onBlur)=\"onTouched()\" [mask]=\"controlData().otpConfig?.mask ?? false\"\r\n [length]=\"controlData().otpConfig?.length ?? 6\" [integerOnly]=\"controlData().otpConfig?.integerOnly ?? false\"\r\n class=\"custom-otp border-2 border-gray-300 dark:border-transparent rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 transition-all duration-200\"\r\n [formControl]=\"localControl\" />\r\n </div>\r\n }\r\n @case (inputTypesEnum.SWITCH) {\r\n <div class=\"flex justify-center items-center p-4\">\r\n <p-toggleswitch [id]=\"generateUniqueId(name)\" [formControl]=\"localControl\"\r\n class=\"custom-switch border-2 border-gray-300 dark:border-transparent rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 transition-all duration-200\"\r\n (change)=\"onCheckboxChange($event, localControl)\">\r\n <ng-template #handle let-checked=\"checked\">\r\n <span class=\"text-xs bg-gray-100 dark:bg-gray-600 text-gray-800 dark:text-gray-200 rounded-full px-1\">\r\n @if (checked) {\r\n Si\r\n }\r\n @else {\r\n No\r\n }\r\n </span>\r\n </ng-template>\r\n </p-toggleswitch>\r\n </div>\r\n }\r\n @case (inputTypesEnum.DECIMAL) {\r\n <p-inputnumber [autofocus]=\"autoFocus ?? false\" [formControl]=\"localControl\" (onBlur)=\"onBlur()\" (blur)=\"onTouched()\" [id]=\"generateUniqueId(name)\" mode=\"decimal\"\r\n (onFocus)=\"onFocus()\"\r\n [locale]=\"'es-CO'\" [minFractionDigits]=\"decimalConfig?.minFractionDigits ?? 2\" [maxFractionDigits]=\"decimalConfig?.maxFractionDigits ?? 2\" [useGrouping]=\"decimalConfig?.useGrouping ?? true\" [readonly]=\"readonly\" [disabled]=\"readonly\" />\r\n }\r\n @case (inputTypesEnum.TEXTAREA) {\r\n <textarea pTextarea [formControl]=\"localControl\" [rows]=\"textareaConfig?.rows ?? 3\"\r\n [cols]=\"textareaConfig?.cols ?? 30\" [autoResize]=\"true\" [variant]=\"textareaConfig?.variant ?? 'outlined'\"\r\n (blur)=\"onTouched()\" [id]=\"generateUniqueId(name)\" [readonly]=\"readonly\" autocomplete=\"off\" autocorrect=\"off\"\r\n autocapitalize=\"off\" spellcheck=\"false\"\r\n class=\"custom-textarea w-full px-3 py-2 border border-gray-300 dark:border-transparent rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-all duration-200 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100\"></textarea>\r\n }\r\n @default {\r\n <input [formControl]=\"localControl\" (blur)=\"onTouched()\" pInputText [id]=\"generateUniqueId(name)\" [type]=\"typeInput\"\r\n [readOnly]=\"readonly\" autocomplete=\"off\" autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" [ngClass]=\"{\r\n 'border-red-500 focus:ring-red-500':\r\n localControl.invalid &&\r\n (localControl.dirty || localControl.touched),\r\n 'bg-gray-100 cursor-not-allowed': readonly,\r\n }\"\r\n class=\"custom-input h-12 w-full px-3 py-2 border border-gray-300 dark:border-transparent rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-all duration-200 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100\" />\r\n }\r\n }\r\n </lib-disabled-container>\r\n\r\n</div>\r\n\r\n@if (localControl.invalid && (localControl.dirty || localControl.touched)) {\r\n<div class=\"custom-error mt-1 text-sm text-red-600 dark:text-red-400\">\r\n @if (localControl.errors?.[\"required\"]) {\r\n <span style=\"font-size: 0.675rem; font-style: italic; letter-spacing: 0.02em;\">{{\r\n 'El campo es requerido' }}</span>\r\n }\r\n @if (localControl.errors?.[\"min\"]) {\r\n <span style=\"font-size: 0.675rem; font-style: italic; letter-spacing: 0.02em;\">{{ 'El valor m\u00EDnimo es de ' +\r\n localControl.errors?.[\"min\"].min.toFixed(2) }}</span>\r\n }\r\n @if (localControl.errors?.[\"max\"]) {\r\n <span style=\"font-size: 0.675rem; font-style: italic; letter-spacing: 0.02em;\">{{ 'El valor m\u00E1ximo es de ' +\r\n localControl.errors?.[\"max\"].max.toFixed(2) }}</span>\r\n }\r\n @if (localControl.errors?.[\"minlength\"]) {\r\n <span style=\"font-size: 0.675rem; font-style: italic; letter-spacing: 0.02em;\">{{\r\n 'El largo m\u00EDnimo es de ' + localControl.errors?.[\"minlength\"].requiredLength\r\n }}</span>\r\n }\r\n @if (localControl.errors?.[\"maxlength\"]) {\r\n <span style=\"font-size: 0.675rem; font-style: italic; letter-spacing: 0.02em;\">{{\r\n 'El largo m\u00E1ximo es de ' + localControl.errors?.[\"maxlength\"].requiredLength\r\n }}</span>\r\n }\r\n @if (localControl.errors?.[\"email\"]) {\r\n <span style=\"font-size: 0.675rem; font-style: italic; letter-spacing: 0.02em;\">{{\r\n 'El correo electr\u00F3nico no es v\u00E1lido' }}</span>\r\n }\r\n @if (localControl.errors?.[\"pattern\"]) {\r\n <span style=\"font-size: 0.675rem; font-style: italic; letter-spacing: 0.02em;\">{{\r\n 'El formato no es v\u00E1lido' }}</span>\r\n }\r\n</div>\r\n}", styles: ["@charset \"UTF-8\";:host ::ng-deep p-datepicker>span>.p-inputtext{width:100%;border-radius:.5rem;outline:none;background-color:#f9fafb;height:44px;padding-right:2.5rem;color:#111827;transition:all .2s ease-in-out}:host ::ng-deep p-datepicker>.p-datepicker>.p-inputtext{background:transparent;color:#111827;height:44px;transition:all .2s ease-in-out}:host ::ng-deep .my-app-dark p-datepicker>.p-datepicker>.p-inputtext{background:transparent;background-color:#374151;color:#f3f4f6}:host ::ng-deep p-datepicker>span{width:100%;position:relative;display:inline-flex}:host ::ng-deep p-datepicker .p-datepicker-trigger{position:absolute!important;right:0!important;top:0!important;height:44px!important;width:2.5rem!important;background:transparent!important;border:none!important;box-shadow:none!important;color:#6b7280!important;display:flex!important;align-items:center!important;justify-content:center!important;z-index:1!important}:host ::ng-deep .my-app-dark p-datepicker .p-datepicker-trigger{color:#9ca3af!important}:host ::ng-deep p-datepicker .p-datepicker-trigger .p-button-icon{font-size:.875rem}:host ::ng-deep p-multiselect{border:1px solid #d1d5db;background:transparent;color:#111827;height:44px;width:100%;border-radius:.5rem;transition:all .2s ease-in-out}:host ::ng-deep .my-app-dark p-multiselect{background:transparent;color:#f3f4f6}:host ::ng-deep p-select{background:transparent;color:#111827;height:44px;width:100%;border-radius:.5rem;transition:all .2s ease-in-out}:host ::ng-deep .my-app-dark p-select{background:transparent;color:#f3f4f6}:host ::ng-deep p-select>.p-select-label{font-size:small;position:relative}:host ::ng-deep p-inputnumber{background:transparent;color:#111827;height:44px;width:100%;border:1px solid #d1d5db;border-radius:.5rem;transition:all .2s ease-in-out}:host ::ng-deep .my-app-dark p-inputnumber{background:transparent;color:#f3f4f6}:host-context(.my-app-dark) ::ng-deep .custom-datepicker>.p-inputwrapper>.p-inputtext{color:#f3f4f6;background-color:#374151}:host-context(.my-app-dark) ::ng-deep p-datepicker>span>.p-inputtext{background-color:#374151;color:#f3f4f6}:host-context(.my-app-dark) ::ng-deep .p-inputtext{background-color:#374151;color:#f3f4f6;border-color:transparent}:host-context(.my-app-dark) ::ng-deep .p-inputnumber-input{background-color:#374151;color:#f3f4f6;border-color:transparent}\n"] }]
304
+ }], ctorParameters: () => [] });
305
+
306
+ class FormChildComponent {
307
+ controlsData = input.required();
308
+ formGroup = input.required();
309
+ formSubmit = output();
310
+ constructor() {
311
+ }
312
+ submit() {
313
+ this.formSubmit.emit(this.formGroup());
314
+ }
315
+ onSelectChange(controlConfig) {
316
+ controlConfig.selectConfig?.change?.(controlConfig);
317
+ }
318
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FormChildComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
319
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: FormChildComponent, isStandalone: true, selector: "lib-form-child", inputs: { controlsData: { classPropertyName: "controlsData", publicName: "controlsData", isSignal: true, isRequired: true, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { formSubmit: "formSubmit" }, ngImport: i0, template: "@let controls = controlsData();\r\n\r\n<form\r\n [formGroup]=\"formGroup()\"\r\n (submit)=\"submit()\"\r\n autocomplete=\"off\"\r\n class=\"grid grid-cols-12 gap-3\"\r\n>\r\n @for (controlData of controls; track controlData.controlName) {\r\n <div\r\n class=\"flex flex-col w-full\"\r\n [ngClass]=\"{\r\n 'col-span-1': !controlData.colSpan,\r\n 'col-span-2': controlData.colSpan === 2,\r\n 'col-span-3': controlData.colSpan === 3,\r\n 'col-span-4': controlData.colSpan === 4,\r\n 'col-span-5': controlData.colSpan === 5,\r\n 'col-span-6': controlData.colSpan === 6,\r\n 'col-span-7': controlData.colSpan === 7,\r\n 'col-span-8': controlData.colSpan === 8,\r\n 'col-span-9': controlData.colSpan === 9,\r\n 'col-span-10': controlData.colSpan === 10,\r\n 'col-span-11': controlData.colSpan === 11,\r\n 'col-span-12': controlData.colSpan === 12,\r\n }\"\r\n >\r\n <lib-custom-input\r\n [id]=\"controlData.controlName\"\r\n [controlData]=\"controlData\"\r\n [formControlName]=\"controlData.controlName\"\r\n class=\"w-full\"\r\n (output)=\"onSelectChange($event)\"\r\n >\r\n </lib-custom-input>\r\n </div>\r\n }\r\n</form>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: CustomInputComponent, selector: "lib-custom-input", inputs: ["controlData"], outputs: ["output"] }] });
320
+ }
321
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FormChildComponent, decorators: [{
322
+ type: Component,
323
+ args: [{ selector: 'lib-form-child', imports: [
324
+ ReactiveFormsModule,
325
+ CommonModule,
326
+ CustomInputComponent
327
+ ], template: "@let controls = controlsData();\r\n\r\n<form\r\n [formGroup]=\"formGroup()\"\r\n (submit)=\"submit()\"\r\n autocomplete=\"off\"\r\n class=\"grid grid-cols-12 gap-3\"\r\n>\r\n @for (controlData of controls; track controlData.controlName) {\r\n <div\r\n class=\"flex flex-col w-full\"\r\n [ngClass]=\"{\r\n 'col-span-1': !controlData.colSpan,\r\n 'col-span-2': controlData.colSpan === 2,\r\n 'col-span-3': controlData.colSpan === 3,\r\n 'col-span-4': controlData.colSpan === 4,\r\n 'col-span-5': controlData.colSpan === 5,\r\n 'col-span-6': controlData.colSpan === 6,\r\n 'col-span-7': controlData.colSpan === 7,\r\n 'col-span-8': controlData.colSpan === 8,\r\n 'col-span-9': controlData.colSpan === 9,\r\n 'col-span-10': controlData.colSpan === 10,\r\n 'col-span-11': controlData.colSpan === 11,\r\n 'col-span-12': controlData.colSpan === 12,\r\n }\"\r\n >\r\n <lib-custom-input\r\n [id]=\"controlData.controlName\"\r\n [controlData]=\"controlData\"\r\n [formControlName]=\"controlData.controlName\"\r\n class=\"w-full\"\r\n (output)=\"onSelectChange($event)\"\r\n >\r\n </lib-custom-input>\r\n </div>\r\n }\r\n</form>\r\n" }]
328
+ }], ctorParameters: () => [] });
329
+
330
+ class HttpMessageComponent {
331
+ httpMessage = model();
332
+ clearMessage() {
333
+ this.httpMessage.set(undefined);
334
+ }
335
+ get isError() {
336
+ const message = this.httpMessage();
337
+ return message?.type === 'error';
338
+ }
339
+ get isSuccess() {
340
+ const message = this.httpMessage();
341
+ return message?.type === 'success';
342
+ }
343
+ get isWarning() {
344
+ const message = this.httpMessage();
345
+ return message?.type === 'warning';
346
+ }
347
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: HttpMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
348
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: HttpMessageComponent, isStandalone: true, selector: "lib-http-message", inputs: { httpMessage: { classPropertyName: "httpMessage", publicName: "httpMessage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { httpMessage: "httpMessageChange" }, ngImport: i0, template: "@if (httpMessage()) {\r\n @if (isError) {\r\n <div class=\"group relative mt-3 p-3 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 transition-all duration-200 hover:shadow-md\">\r\n <div class=\"flex items-start gap-2\">\r\n <svg class=\"w-5 h-5 text-red-500 dark:text-red-400 flex-shrink-0 mt-0.5\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\r\n <path fill-rule=\"evenodd\" d=\"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z\" clip-rule=\"evenodd\" />\r\n </svg>\r\n <p class=\"flex-1 text-red-700 dark:text-red-300 text-sm font-medium leading-relaxed\">\r\n {{ httpMessage()?.message }}\r\n </p>\r\n <button\r\n type=\"button\"\r\n (click)=\"clearMessage()\"\r\n class=\"opacity-0 group-hover:opacity-100 transition-opacity duration-200 text-red-500 dark:text-red-400 hover:text-red-700 dark:hover:text-red-200 p-1 rounded hover:bg-red-100 dark:hover:bg-red-800/30\"\r\n aria-label=\"Cerrar mensaje de error\"\r\n >\r\n <svg class=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\" />\r\n </svg>\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n @if (isSuccess) {\r\n <div class=\"group relative mt-3 p-3 rounded-lg bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 transition-all duration-200 hover:shadow-md\">\r\n <div class=\"flex items-start gap-2\">\r\n <svg class=\"w-5 h-5 text-green-500 dark:text-green-400 flex-shrink-0 mt-0.5\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\r\n <path fill-rule=\"evenodd\" d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z\" clip-rule=\"evenodd\" />\r\n </svg>\r\n <p class=\"flex-1 text-green-700 dark:text-green-300 text-sm font-medium leading-relaxed\">\r\n {{ httpMessage()?.message }}\r\n </p>\r\n <button\r\n type=\"button\"\r\n (click)=\"clearMessage()\"\r\n class=\"opacity-0 group-hover:opacity-100 transition-opacity duration-200 text-green-500 dark:text-green-400 hover:text-green-700 dark:hover:text-green-200 p-1 rounded hover:bg-green-100 dark:hover:bg-green-800/30\"\r\n aria-label=\"Cerrar mensaje de \u00E9xito\"\r\n >\r\n <svg class=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\" />\r\n </svg>\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n @if (isWarning) {\r\n <div class=\"group relative mt-3 p-3 rounded-lg bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 transition-all duration-200 hover:shadow-md\">\r\n <div class=\"flex items-start gap-2\">\r\n <svg class=\"w-5 h-5 text-amber-500 dark:text-amber-400 flex-shrink-0 mt-0.5\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\r\n <path fill-rule=\"evenodd\" d=\"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z\" clip-rule=\"evenodd\" />\r\n </svg>\r\n <p class=\"flex-1 text-amber-700 dark:text-amber-300 text-sm font-medium leading-relaxed\">\r\n {{ httpMessage()?.message }}\r\n </p>\r\n <button\r\n type=\"button\"\r\n (click)=\"clearMessage()\"\r\n class=\"opacity-0 group-hover:opacity-100 transition-opacity duration-200 text-amber-500 dark:text-amber-400 hover:text-amber-700 dark:hover:text-amber-200 p-1 rounded hover:bg-amber-100 dark:hover:bg-amber-800/30\"\r\n aria-label=\"Cerrar mensaje de advertencia\"\r\n >\r\n <svg class=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\" />\r\n </svg>\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n}\r\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush });
349
+ }
350
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: HttpMessageComponent, decorators: [{
351
+ type: Component,
352
+ args: [{ selector: 'lib-http-message', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (httpMessage()) {\r\n @if (isError) {\r\n <div class=\"group relative mt-3 p-3 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 transition-all duration-200 hover:shadow-md\">\r\n <div class=\"flex items-start gap-2\">\r\n <svg class=\"w-5 h-5 text-red-500 dark:text-red-400 flex-shrink-0 mt-0.5\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\r\n <path fill-rule=\"evenodd\" d=\"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z\" clip-rule=\"evenodd\" />\r\n </svg>\r\n <p class=\"flex-1 text-red-700 dark:text-red-300 text-sm font-medium leading-relaxed\">\r\n {{ httpMessage()?.message }}\r\n </p>\r\n <button\r\n type=\"button\"\r\n (click)=\"clearMessage()\"\r\n class=\"opacity-0 group-hover:opacity-100 transition-opacity duration-200 text-red-500 dark:text-red-400 hover:text-red-700 dark:hover:text-red-200 p-1 rounded hover:bg-red-100 dark:hover:bg-red-800/30\"\r\n aria-label=\"Cerrar mensaje de error\"\r\n >\r\n <svg class=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\" />\r\n </svg>\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n @if (isSuccess) {\r\n <div class=\"group relative mt-3 p-3 rounded-lg bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 transition-all duration-200 hover:shadow-md\">\r\n <div class=\"flex items-start gap-2\">\r\n <svg class=\"w-5 h-5 text-green-500 dark:text-green-400 flex-shrink-0 mt-0.5\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\r\n <path fill-rule=\"evenodd\" d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z\" clip-rule=\"evenodd\" />\r\n </svg>\r\n <p class=\"flex-1 text-green-700 dark:text-green-300 text-sm font-medium leading-relaxed\">\r\n {{ httpMessage()?.message }}\r\n </p>\r\n <button\r\n type=\"button\"\r\n (click)=\"clearMessage()\"\r\n class=\"opacity-0 group-hover:opacity-100 transition-opacity duration-200 text-green-500 dark:text-green-400 hover:text-green-700 dark:hover:text-green-200 p-1 rounded hover:bg-green-100 dark:hover:bg-green-800/30\"\r\n aria-label=\"Cerrar mensaje de \u00E9xito\"\r\n >\r\n <svg class=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\" />\r\n </svg>\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n @if (isWarning) {\r\n <div class=\"group relative mt-3 p-3 rounded-lg bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 transition-all duration-200 hover:shadow-md\">\r\n <div class=\"flex items-start gap-2\">\r\n <svg class=\"w-5 h-5 text-amber-500 dark:text-amber-400 flex-shrink-0 mt-0.5\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\r\n <path fill-rule=\"evenodd\" d=\"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z\" clip-rule=\"evenodd\" />\r\n </svg>\r\n <p class=\"flex-1 text-amber-700 dark:text-amber-300 text-sm font-medium leading-relaxed\">\r\n {{ httpMessage()?.message }}\r\n </p>\r\n <button\r\n type=\"button\"\r\n (click)=\"clearMessage()\"\r\n class=\"opacity-0 group-hover:opacity-100 transition-opacity duration-200 text-amber-500 dark:text-amber-400 hover:text-amber-700 dark:hover:text-amber-200 p-1 rounded hover:bg-amber-100 dark:hover:bg-amber-800/30\"\r\n aria-label=\"Cerrar mensaje de advertencia\"\r\n >\r\n <svg class=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\" />\r\n </svg>\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n}\r\n" }]
353
+ }] });
354
+
355
+ class FormComponent {
356
+ formGroup = model.required();
357
+ controls = input.required();
358
+ formConfig = input();
359
+ httpMessage = model();
360
+ formSubmit = output();
361
+ formChanges = output();
362
+ formChangesDebounced = output();
363
+ constructor() {
364
+ effect(() => {
365
+ const controls = this.controls();
366
+ const controlsNames = this.controls().map((controlConfig) => controlConfig.controlName);
367
+ const controlsToDelete = Object.keys(this.formGroup().controls).filter(control => !controlsNames.includes(control));
368
+ controls.forEach((controlData) => {
369
+ this.formGroup.update((formGroup) => {
370
+ if (formGroup.contains(controlData.controlName)) {
371
+ formGroup.setControl(controlData.controlName, controlData.control);
372
+ }
373
+ else {
374
+ formGroup.addControl(controlData.controlName, controlData.control);
375
+ }
376
+ controlsToDelete.forEach(controlName => {
377
+ formGroup.removeControl(controlName);
378
+ });
379
+ return formGroup;
380
+ });
381
+ });
382
+ });
383
+ effect(() => {
384
+ const controlsDataTypeSelect = this.controls().filter((controlData) => controlData.typeInput === ETypeInput.SELECT);
385
+ controlsDataTypeSelect.forEach((controlData) => {
386
+ const control = this.formGroup().get(controlData.controlName);
387
+ const controlValue = control?.value;
388
+ if (controlValue) {
389
+ const options = controlData.selectConfig?.options ?? [];
390
+ const optionSelected = options.find((option) => {
391
+ return option.code === controlValue.code;
392
+ });
393
+ if (optionSelected) {
394
+ control?.setValue(optionSelected);
395
+ }
396
+ }
397
+ });
398
+ });
399
+ effect(() => {
400
+ this.formGroup().valueChanges.subscribe(() => {
401
+ this.formChanges.emit(this.formGroup());
402
+ });
403
+ });
404
+ const fg$ = toObservable(this.formGroup);
405
+ fg$.pipe(switchMap((fg) => fg.valueChanges.pipe(debounceTime(650), filter(() => this.anyInteracted(fg)), map(() => fg))), takeUntilDestroyed())
406
+ .subscribe(() => this.formChangesDebounced.emit(this.formGroup()));
407
+ }
408
+ anyInteracted(formGroup) {
409
+ return Object.values(formGroup.controls).some(control => control.touched || control.dirty);
410
+ }
411
+ submit(formGroup) {
412
+ this.formSubmit.emit(formGroup);
413
+ }
414
+ clearHttpMessage() {
415
+ this.httpMessage.set(undefined);
416
+ }
417
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
418
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: FormComponent, isStandalone: true, selector: "lib-form", inputs: { formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: true, transformFunction: null }, controls: { classPropertyName: "controls", publicName: "controls", isSignal: true, isRequired: true, transformFunction: null }, formConfig: { classPropertyName: "formConfig", publicName: "formConfig", isSignal: true, isRequired: false, transformFunction: null }, httpMessage: { classPropertyName: "httpMessage", publicName: "httpMessage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { formGroup: "formGroupChange", httpMessage: "httpMessageChange", formSubmit: "formSubmit", formChanges: "formChanges", formChangesDebounced: "formChangesDebounced" }, ngImport: i0, template: "<div class=\"w-full p-2 rounded-lg\" [style.backgroundColor]=\"formConfig()?.backgroundColor || 'transparent'\">\r\n <lib-form-child [controlsData]=\"controls()\" [formGroup]=\"formGroup()\" (formSubmit)=\"submit($event)\">\r\n </lib-form-child>\r\n @if (httpMessage()) {\r\n <lib-http-message [(httpMessage)]=\"httpMessage\"></lib-http-message>\r\n }\r\n</div>", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: FormChildComponent, selector: "lib-form-child", inputs: ["controlsData", "formGroup"], outputs: ["formSubmit"] }, { kind: "component", type: HttpMessageComponent, selector: "lib-http-message", inputs: ["httpMessage"], outputs: ["httpMessageChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
419
+ }
420
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FormComponent, decorators: [{
421
+ type: Component,
422
+ args: [{ selector: 'lib-form', imports: [
423
+ ReactiveFormsModule,
424
+ FormChildComponent,
425
+ HttpMessageComponent
426
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"w-full p-2 rounded-lg\" [style.backgroundColor]=\"formConfig()?.backgroundColor || 'transparent'\">\r\n <lib-form-child [controlsData]=\"controls()\" [formGroup]=\"formGroup()\" (formSubmit)=\"submit($event)\">\r\n </lib-form-child>\r\n @if (httpMessage()) {\r\n <lib-http-message [(httpMessage)]=\"httpMessage\"></lib-http-message>\r\n }\r\n</div>" }]
427
+ }], ctorParameters: () => [] });
428
+
429
+ class InlineInputComponent {
430
+ config = input({ typeInput: ETypeInput.TEXT });
431
+ value = model(null);
432
+ outputValue = output();
433
+ outputBlur = output();
434
+ outputDebounced = output();
435
+ // Capturar templates proyectados desde el componente padre
436
+ templates;
437
+ // Para el manejo de chips
438
+ chips = [];
439
+ currentInput = '';
440
+ showDuplicateMessage = false;
441
+ duplicateChips = [];
442
+ duplicateMessageTimer = null;
443
+ constructor() {
444
+ effect(() => {
445
+ this.outputValue.emit(this.value());
446
+ });
447
+ const value$ = toObservable(this.value);
448
+ value$
449
+ .pipe(debounceTime(300), // <- adjust ms here
450
+ distinctUntilChanged(), // avoid repeats for same value
451
+ takeUntilDestroyed() // auto-cleanup on destroy
452
+ )
453
+ .subscribe(v => this.outputDebounced.emit(v));
454
+ effect(() => {
455
+ this.valueSelect.update((_prev) => {
456
+ const options = this.config()?.selectConfig?.options;
457
+ const currentValue = this.value();
458
+ if (this.isSelection(currentValue))
459
+ return currentValue;
460
+ if (currentValue === null || currentValue === undefined)
461
+ return undefined;
462
+ return options?.find(option => option.code === currentValue);
463
+ });
464
+ });
465
+ }
466
+ ngOnInit() {
467
+ }
468
+ onChange = () => { };
469
+ onTouched = () => { };
470
+ writeValue(value) {
471
+ this.value.set(value);
472
+ // Si es tipo CHIPS, inicializar los chips desde el valor
473
+ if (this.type === ETypeInput.CHIPS && typeof value === 'string') {
474
+ this.chips = value ? value.split(' ').filter(chip => chip.trim() !== '') : [];
475
+ }
476
+ }
477
+ registerOnChange(fn) {
478
+ this.onChange = fn;
479
+ }
480
+ registerOnTouched(fn) {
481
+ this.onTouched = fn;
482
+ }
483
+ onChangeValue(value) {
484
+ this.value.set(value);
485
+ this.onChange(value);
486
+ }
487
+ onBlur() {
488
+ this.onTouched();
489
+ this.outputBlur.emit(this.value());
490
+ }
491
+ /**
492
+ * Maneja eventos de teclado para prevenir la navegación de PrimeNG Table
493
+ * cuando se usan las flechas izquierda/derecha dentro del input
494
+ */
495
+ onKeyDown(event) {
496
+ // Verificar si son teclas de flecha izquierda o derecha
497
+ if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
498
+ // Detener la propagación del evento hacia el table
499
+ event.stopPropagation();
500
+ }
501
+ }
502
+ isSelection(value) {
503
+ return !!value && typeof value === 'object' && 'code' in value && 'name' in value;
504
+ }
505
+ valueSelect = signal(undefined);
506
+ setValueSelect(value) {
507
+ this.valueSelect.set(value);
508
+ }
509
+ get type() {
510
+ return this.config()?.typeInput ?? ETypeInput.TEXT;
511
+ }
512
+ get ETypeInput() {
513
+ return ETypeInput;
514
+ }
515
+ get duplicatesText() {
516
+ return this.duplicateChips.join(', ');
517
+ }
518
+ get currency() {
519
+ return this.config()?.currencyConfig?.currency ?? 'COP';
520
+ }
521
+ get locale() {
522
+ return this.config()?.currencyConfig?.locale ?? 'es-CO';
523
+ }
524
+ get minFractionDigits() {
525
+ return this.config()?.currencyConfig?.minFractionDigits ?? 2;
526
+ }
527
+ get maxFractionDigits() {
528
+ return this.config()?.currencyConfig?.maxFractionDigits ?? 2;
529
+ }
530
+ knobValueInput = computed(() => {
531
+ let response = this.value();
532
+ const knobConfig = this.config()?.knobConfig ?? { min: 0, max: 100, step: 1 };
533
+ response = parseInt(this.value()) ?? 0;
534
+ if (response < (knobConfig?.min ?? 0)) {
535
+ response = knobConfig.min ?? 0;
536
+ }
537
+ if (response > (knobConfig?.max ?? 100)) {
538
+ response = knobConfig.max ?? 100;
539
+ }
540
+ return response;
541
+ });
542
+ knobValueTemplate = computed(() => {
543
+ return this.config()?.knobConfig?.valueTemplate ?? '';
544
+ });
545
+ // Métodos para manejo de chips
546
+ onChipInputChange(event) {
547
+ const target = event.target;
548
+ this.currentInput = target.value;
549
+ }
550
+ onChipKeydown(event) {
551
+ if (event.key === ' ' || event.key === 'Enter') {
552
+ event.preventDefault();
553
+ this.addChip();
554
+ }
555
+ else if (event.key === 'Backspace' && this.currentInput === '' && this.chips.length > 0) {
556
+ // Si no hay texto y hay chips, eliminar el último chip
557
+ this.removeChip(this.chips.length - 1);
558
+ }
559
+ // No interceptar las flechas aquí ya que se maneja en onKeyDown
560
+ }
561
+ onChipPaste(event) {
562
+ event.preventDefault();
563
+ const pastedText = event.clipboardData?.getData('text') || '';
564
+ this.processPastedText(pastedText);
565
+ }
566
+ addChip() {
567
+ const trimmedValue = this.currentInput.trim();
568
+ if (trimmedValue) {
569
+ if (this.chips.includes(trimmedValue)) {
570
+ // Mostrar mensaje de duplicado con el chip específico
571
+ this.duplicateChips = [trimmedValue];
572
+ this.showDuplicateAlert();
573
+ }
574
+ else {
575
+ this.chips.push(trimmedValue);
576
+ this.currentInput = '';
577
+ this.updateChipsValue();
578
+ this.hideDuplicateAlert();
579
+ }
580
+ }
581
+ }
582
+ removeChip(index) {
583
+ this.chips.splice(index, 1);
584
+ this.updateChipsValue();
585
+ }
586
+ updateChipsValue() {
587
+ const chipsValue = this.chips.join(' ');
588
+ this.value.set(chipsValue);
589
+ this.onChange(chipsValue);
590
+ }
591
+ showDuplicateAlert() {
592
+ this.showDuplicateMessage = true;
593
+ // Limpiar timer anterior si existe
594
+ if (this.duplicateMessageTimer) {
595
+ clearTimeout(this.duplicateMessageTimer);
596
+ }
597
+ // Ocultar mensaje después de 3 segundos
598
+ this.duplicateMessageTimer = setTimeout(() => {
599
+ this.hideDuplicateAlert();
600
+ }, 3000);
601
+ }
602
+ hideDuplicateAlert() {
603
+ this.showDuplicateMessage = false;
604
+ this.duplicateChips = [];
605
+ if (this.duplicateMessageTimer) {
606
+ clearTimeout(this.duplicateMessageTimer);
607
+ this.duplicateMessageTimer = null;
608
+ }
609
+ }
610
+ processPastedText(text) {
611
+ // Dividir el texto por espacios y filtrar elementos vacíos
612
+ const newChips = text
613
+ .split(/\s+/) // Dividir por uno o más espacios
614
+ .map(chip => chip.trim()) // Limpiar espacios en cada elemento
615
+ .filter(chip => chip !== ''); // Filtrar elementos vacíos
616
+ const foundDuplicates = [];
617
+ let addedChips = 0;
618
+ // Agregar cada chip nuevo y recopilar duplicados
619
+ newChips.forEach(chipText => {
620
+ if (!this.chips.includes(chipText)) {
621
+ this.chips.push(chipText);
622
+ addedChips++;
623
+ }
624
+ else {
625
+ // Solo agregar a duplicados si no está ya en la lista
626
+ if (!foundDuplicates.includes(chipText)) {
627
+ foundDuplicates.push(chipText);
628
+ }
629
+ }
630
+ });
631
+ // Limpiar el input actual
632
+ this.currentInput = '';
633
+ // Actualizar el valor si se agregaron chips
634
+ if (addedChips > 0) {
635
+ this.updateChipsValue();
636
+ }
637
+ // Mostrar alerta si hubo duplicados
638
+ if (foundDuplicates.length > 0) {
639
+ this.duplicateChips = foundDuplicates;
640
+ this.showDuplicateAlert();
641
+ }
642
+ else {
643
+ this.hideDuplicateAlert();
644
+ }
645
+ }
646
+ /**
647
+ * Método público para establecer chips desde un array externo
648
+ * @param chipsArray Array de strings que representan las chips
649
+ */
650
+ setChipsFromArray(chipsArray) {
651
+ if (!Array.isArray(chipsArray)) {
652
+ console.warn('setChipsFromArray: El parámetro debe ser un array de strings');
653
+ return;
654
+ }
655
+ // Filtrar elementos válidos (strings no vacíos)
656
+ const validChips = chipsArray
657
+ .filter(chip => typeof chip === 'string' && chip.trim() !== '')
658
+ .map(chip => chip.trim());
659
+ // Actualizar el array de chips
660
+ this.chips = [...validChips];
661
+ // Limpiar el input actual
662
+ this.currentInput = '';
663
+ // Actualizar el valor del componente
664
+ this.updateChipsValue();
665
+ // Ocultar cualquier mensaje de duplicado
666
+ this.hideDuplicateAlert();
667
+ }
668
+ /**
669
+ * Método público para obtener las chips actuales como array
670
+ * @returns Array de strings con las chips actuales
671
+ */
672
+ getChipsAsArray() {
673
+ return [...this.chips];
674
+ }
675
+ /**
676
+ * Método público para limpiar todas las chips
677
+ */
678
+ clearAllChips() {
679
+ this.chips = [];
680
+ this.currentInput = '';
681
+ this.updateChipsValue();
682
+ this.hideDuplicateAlert();
683
+ }
684
+ /**
685
+ * Método público para agregar múltiples chips desde un array
686
+ * Evita duplicados y muestra mensajes de alerta si es necesario
687
+ * @param chipsArray Array de strings a agregar
688
+ */
689
+ addChipsFromArray(chipsArray) {
690
+ if (!Array.isArray(chipsArray)) {
691
+ console.warn('addChipsFromArray: El parámetro debe ser un array de strings');
692
+ return;
693
+ }
694
+ // Filtrar elementos válidos
695
+ const validChips = chipsArray
696
+ .filter(chip => typeof chip === 'string' && chip.trim() !== '')
697
+ .map(chip => chip.trim());
698
+ const foundDuplicates = [];
699
+ let addedChips = 0;
700
+ // Agregar cada chip nuevo y recopilar duplicados
701
+ validChips.forEach(chipText => {
702
+ if (!this.chips.includes(chipText)) {
703
+ this.chips.push(chipText);
704
+ addedChips++;
705
+ }
706
+ else {
707
+ // Solo agregar a duplicados si no está ya en la lista
708
+ if (!foundDuplicates.includes(chipText)) {
709
+ foundDuplicates.push(chipText);
710
+ }
711
+ }
712
+ });
713
+ // Actualizar el valor si se agregaron chips
714
+ if (addedChips > 0) {
715
+ this.updateChipsValue();
716
+ }
717
+ // Mostrar alerta si hubo duplicados
718
+ if (foundDuplicates.length > 0) {
719
+ this.duplicateChips = foundDuplicates;
720
+ this.showDuplicateAlert();
721
+ }
722
+ else {
723
+ this.hideDuplicateAlert();
724
+ }
725
+ }
726
+ // Limpiar timer al destruir el componente
727
+ ngOnDestroy() {
728
+ if (this.duplicateMessageTimer) {
729
+ clearTimeout(this.duplicateMessageTimer);
730
+ }
731
+ }
732
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: InlineInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
733
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: InlineInputComponent, isStandalone: true, selector: "lib-inline-input", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", outputValue: "outputValue", outputBlur: "outputBlur", outputDebounced: "outputDebounced" }, providers: [
734
+ {
735
+ provide: NG_VALUE_ACCESSOR,
736
+ useExisting: forwardRef(() => InlineInputComponent),
737
+ multi: true
738
+ }
739
+ ], queries: [{ propertyName: "templates", predicate: PrimeTemplate }], ngImport: i0, template: "@let valueInput = value();\n@let isDisabled = config().isDisabled ?? false;\n@let knobConfig = config().knobConfig;\n@let textareaConfig = config().textareaConfig;\n@let dateConfig = config().dateConfig;\n\n@switch (type) {\n@case (ETypeInput.CURRENCY) {\n<p-inputnumber [ngModel]=\"valueInput\" (ngModelChange)=\"onChangeValue($event)\" (onBlur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\" mode=\"currency\" [currency]=\"currency\" [locale]=\"locale\"\n [minFractionDigits]=\"minFractionDigits\" [maxFractionDigits]=\"maxFractionDigits\" class=\"w-full\"\n [disabled]=\"isDisabled\" />\n}\n@case (ETypeInput.DECIMAL) {\n<p-inputnumber [ngModel]=\"valueInput\" (ngModelChange)=\"onChangeValue($event)\" (onBlur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\" mode=\"decimal\" [locale]=\"locale\" [minFractionDigits]=\"2\" [maxFractionDigits]=\"2\"\n [useGrouping]=\"true\" class=\"w-full\" [disabled]=\"isDisabled\" />\n}\n@case (ETypeInput.DATE) {\n<p-datepicker [ngModel]=\"valueInput\" appendTo=\"body\" (ngModelChange)=\"onChangeValue($event)\" (onBlur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\" class=\"w-full\" [disabled]=\"isDisabled\" [maxDate]=\"dateConfig?.maxDate || null\"\n [minDate]=\"dateConfig?.minDate || null\" [selectionMode]=\"dateConfig?.selectionMode || 'single'\" />\n}\n@case (ETypeInput.DATETIME_LOCAL) {\n<p-datepicker [ngModel]=\"valueInput\" appendTo=\"body\" (ngModelChange)=\"onChangeValue($event)\" (onBlur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\" class=\"w-full\" [showTime]=\"true\" [hourFormat]=\"'24'\" [disabled]=\"isDisabled\"\n [maxDate]=\"dateConfig?.maxDate || null\" [minDate]=\"dateConfig?.minDate || null\" [selectionMode]=\"dateConfig?.selectionMode || 'single'\" />\n}\n@case (ETypeInput.SELECT) {\n<p-select [options]=\"config().selectConfig?.options ?? []\" [optionLabel]=\"config().selectConfig?.optionLabel ?? 'name'\"\n [(ngModel)]=\"valueSelect\" (ngModelChange)=\"onChangeValue($event)\" (onBlur)=\"onBlur()\" (keydown)=\"onKeyDown($event)\"\n appendTo=\"body\" class=\"w-full inline-input-select\" [disabled]=\"config().isDisabled ?? false\" >\n @for (template of templates; track $index) {\n <ng-template [pTemplate]=\"template.getType()\" let-item>\n <ng-container *ngTemplateOutlet=\"template.template; context: { $implicit: item }\"></ng-container>\n </ng-template>\n }\n</p-select>\n}\n@case (ETypeInput.MULTISELECT) {\n<p-multiselect [options]=\"config().multiSelectConfig?.options ?? []\"\n [optionLabel]=\"config().multiSelectConfig?.optionLabel ?? 'name'\" [ngModel]=\"valueInput\"\n (ngModelChange)=\"onChangeValue($event)\" (onBlur)=\"onBlur()\" (keydown)=\"onKeyDown($event)\" [filter]=\"true\"\n appendTo=\"body\" class=\"w-full\" [disabled]=\"isDisabled\" />\n}\n@case (ETypeInput.OTP) {\n<p-inputotp class=\"w-full\" [mask]=\"config().otpConfig?.mask ?? false\" [length]=\"config().otpConfig?.length ?? 6\"\n [integerOnly]=\"config().otpConfig?.integerOnly ?? false\" [ngModel]=\"valueInput\"\n (ngModelChange)=\"onChangeValue($event)\" (onBlur)=\"onBlur()\" (keydown)=\"onKeyDown($event)\" [disabled]=\"isDisabled\" />\n}\n@case (ETypeInput.KNOB) {\n<p-knob [ngModel]=\"knobValueInput()\" (ngModelChange)=\"onChangeValue($event)\" class=\"w-full\" [min]=\"knobConfig?.min ?? 0\"\n [max]=\"knobConfig?.max ?? 100\" [step]=\"knobConfig?.step ?? 1\" [disabled]=\"isDisabled\" [readonly]=\"true\"\n [valueTemplate]=\"knobValueTemplate()\" [size]=\"knobConfig?.size ?? 100\" />\n}\n@case (ETypeInput.TEXTAREA) {\n<textarea class=\"w-full h-full p-2 border border-gray-300 rounded-md\" pTextarea [rows]=\"textareaConfig?.rows ?? 3\"\n [cols]=\"textareaConfig?.cols ?? 30\" [autoResize]=\"true\" [variant]=\"textareaConfig?.variant ?? 'outlined'\"\n [disabled]=\"isDisabled\" [ngModel]=\"valueInput\" (ngModelChange)=\"onChangeValue($event)\" (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\"></textarea>\n}\n@case (ETypeInput.CHIPS) {\n<div class=\"chips-input-wrapper\">\n <div\n class=\"chips-container w-full p-2 border border-gray-300 rounded-md min-h-[40px] flex flex-wrap items-center gap-2\"\n [class.border-red-500]=\"showDuplicateMessage\">\n @for (chip of chips; track $index) {\n <p-chip [label]=\"chip\" [removable]=\"!isDisabled\" (onRemove)=\"removeChip($index)\" class=\"chip-item\" />\n }\n <input type=\"text\" class=\"chip-input flex-1 border-0 outline-0 bg-transparent min-w-[100px]\" [value]=\"currentInput\"\n (input)=\"onChipInputChange($event)\" (keydown)=\"onChipKeydown($event); onKeyDown($event)\"\n (paste)=\"onChipPaste($event)\" [disabled]=\"isDisabled\"\n placeholder=\"Escribe o pega elementos separados por espacios...\" />\n </div>\n @if (showDuplicateMessage) {\n <div class=\"duplicate-message text-red-500 text-sm mt-1 flex items-center gap-1\">\n <i class=\"pi pi-exclamation-triangle text-red-500\"></i>\n <span>\n @if (duplicateChips.length === 1) {\n El elemento \"<strong>{{ duplicatesText }}</strong>\" ya existe en la lista\n } @else {\n Los elementos \"<strong>{{ duplicatesText }}</strong>\" ya existen en la lista\n }\n </span>\n </div>\n }\n</div>\n}\n@case (ETypeInput.SWITCH) {\n<div class=\"flex justify-center items-center p-2\">\n <p-toggleswitch [ngModel]=\"valueInput\" (ngModelChange)=\"onChangeValue($event)\" (onBlur)=\"onBlur()\"\n class=\"w-full\" [disabled]=\"isDisabled\" />\n</div>\n}\n@default {\n<input pInputText class=\"w-full h-full p-2 border border-gray-300 rounded-md\" [type]=\"type\"\n [readOnly]=\"config().readonly ?? false\" [ngModel]=\"valueInput\" (ngModelChange)=\"onChangeValue($event)\"\n (blur)=\"onBlur()\" (keydown)=\"onKeyDown($event)\" [disabled]=\"isDisabled\" />\n}\n}", styles: [":host{width:100%;height:100%}.chips-input-wrapper{width:100%}.chips-input-wrapper .chips-container{cursor:text;transition:border-color .2s ease,box-shadow .2s ease}.chips-input-wrapper .chips-container:focus-within{border-color:#007ad9;box-shadow:0 0 0 1px #007ad9}.chips-input-wrapper .chips-container.border-red-500{border-color:#ef4444!important;box-shadow:0 0 0 1px #ef4444!important}.chips-input-wrapper .chips-container .chip-item{margin:0}.chips-input-wrapper .chips-container .chip-input:focus{outline:none}.chips-input-wrapper .chips-container .chip-input::placeholder{color:#6b7280;font-style:italic}.chips-input-wrapper .duplicate-message{animation:slideDown .3s ease-out}.chips-input-wrapper .duplicate-message i{font-size:14px}@keyframes slideDown{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}::ng-deep p-select.inline-input-select{border:1px solid #d1d5db!important;background:transparent;color:#111827;height:44px;width:100%;border-radius:.5rem;transition:all .2s ease-in-out;display:flex;align-items:center;justify-content:space-between}::ng-deep p-select.inline-input-select .p-select-label{border:none}::ng-deep p-select.inline-input-select .p-select-trigger{border:none}::ng-deep .my-app-dark p-select.inline-input-select{border:1px solid transparent!important;background:transparent;color:#f3f4f6}::ng-deep .my-app-dark p-inputnumber .p-inputnumber-input{background-color:#374151;color:#f3f4f6;border-color:transparent}::ng-deep .my-app-dark p-datepicker .p-inputtext{background-color:#374151;color:#f3f4f6}::ng-deep .my-app-dark p-multiselect .p-multiselect-label{background-color:#374151;color:#f3f4f6}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i2$1.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "ngmodule", type: DatePickerModule }, { kind: "component", type: i2.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "fluid", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "size", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "directive", type: i4$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i4.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "size", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "fluid", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i3.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "fluid", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "size", "showClear", "autofocus", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: InputMaskModule }, { kind: "ngmodule", type: InputNumberModule }, { kind: "component", type: i8.InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabelledBy", "ariaDescribedBy", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "variant", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus", "disabled", "fluid"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "ngmodule", type: InputOtpModule }, { kind: "component", type: i6.InputOtp, selector: "p-inputOtp, p-inputotp, p-input-otp", inputs: ["invalid", "disabled", "readonly", "variant", "tabindex", "length", "styleClass", "mask", "integerOnly", "autofocus", "size"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: KnobModule }, { kind: "component", type: i9$1.Knob, selector: "p-knob", inputs: ["styleClass", "style", "ariaLabel", "ariaLabelledBy", "tabindex", "valueColor", "rangeColor", "textColor", "valueTemplate", "name", "size", "step", "min", "max", "strokeWidth", "disabled", "showValue", "readonly"], outputs: ["onChange"] }, { kind: "ngmodule", type: TextareaModule }, { kind: "directive", type: i9.Textarea, selector: "[pTextarea], [pInputTextarea]", inputs: ["autoResize", "variant", "fluid", "pSize"], outputs: ["onResize"] }, { kind: "ngmodule", type: ChipModule }, { kind: "component", type: i11.Chip, selector: "p-chip", inputs: ["label", "icon", "image", "alt", "style", "styleClass", "removable", "removeIcon", "chipProps"], outputs: ["onRemove", "onImageError"] }, { kind: "ngmodule", type: ToggleSwitchModule }, { kind: "component", type: i7.ToggleSwitch, selector: "p-toggleswitch, p-toggleSwitch, p-toggle-switch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabel", "ariaLabelledBy", "autofocus"], outputs: ["onChange"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
740
+ }
741
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: InlineInputComponent, decorators: [{
742
+ type: Component,
743
+ args: [{ selector: 'lib-inline-input', standalone: true, imports: [
744
+ FormsModule,
745
+ InputTextModule,
746
+ DatePickerModule,
747
+ SelectModule,
748
+ MultiSelectModule,
749
+ InputMaskModule,
750
+ InputNumberModule,
751
+ InputOtpModule,
752
+ KnobModule,
753
+ TextareaModule,
754
+ ChipModule,
755
+ ToggleSwitchModule,
756
+ CommonModule
757
+ ], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
758
+ {
759
+ provide: NG_VALUE_ACCESSOR,
760
+ useExisting: forwardRef(() => InlineInputComponent),
761
+ multi: true
762
+ }
763
+ ], template: "@let valueInput = value();\n@let isDisabled = config().isDisabled ?? false;\n@let knobConfig = config().knobConfig;\n@let textareaConfig = config().textareaConfig;\n@let dateConfig = config().dateConfig;\n\n@switch (type) {\n@case (ETypeInput.CURRENCY) {\n<p-inputnumber [ngModel]=\"valueInput\" (ngModelChange)=\"onChangeValue($event)\" (onBlur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\" mode=\"currency\" [currency]=\"currency\" [locale]=\"locale\"\n [minFractionDigits]=\"minFractionDigits\" [maxFractionDigits]=\"maxFractionDigits\" class=\"w-full\"\n [disabled]=\"isDisabled\" />\n}\n@case (ETypeInput.DECIMAL) {\n<p-inputnumber [ngModel]=\"valueInput\" (ngModelChange)=\"onChangeValue($event)\" (onBlur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\" mode=\"decimal\" [locale]=\"locale\" [minFractionDigits]=\"2\" [maxFractionDigits]=\"2\"\n [useGrouping]=\"true\" class=\"w-full\" [disabled]=\"isDisabled\" />\n}\n@case (ETypeInput.DATE) {\n<p-datepicker [ngModel]=\"valueInput\" appendTo=\"body\" (ngModelChange)=\"onChangeValue($event)\" (onBlur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\" class=\"w-full\" [disabled]=\"isDisabled\" [maxDate]=\"dateConfig?.maxDate || null\"\n [minDate]=\"dateConfig?.minDate || null\" [selectionMode]=\"dateConfig?.selectionMode || 'single'\" />\n}\n@case (ETypeInput.DATETIME_LOCAL) {\n<p-datepicker [ngModel]=\"valueInput\" appendTo=\"body\" (ngModelChange)=\"onChangeValue($event)\" (onBlur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\" class=\"w-full\" [showTime]=\"true\" [hourFormat]=\"'24'\" [disabled]=\"isDisabled\"\n [maxDate]=\"dateConfig?.maxDate || null\" [minDate]=\"dateConfig?.minDate || null\" [selectionMode]=\"dateConfig?.selectionMode || 'single'\" />\n}\n@case (ETypeInput.SELECT) {\n<p-select [options]=\"config().selectConfig?.options ?? []\" [optionLabel]=\"config().selectConfig?.optionLabel ?? 'name'\"\n [(ngModel)]=\"valueSelect\" (ngModelChange)=\"onChangeValue($event)\" (onBlur)=\"onBlur()\" (keydown)=\"onKeyDown($event)\"\n appendTo=\"body\" class=\"w-full inline-input-select\" [disabled]=\"config().isDisabled ?? false\" >\n @for (template of templates; track $index) {\n <ng-template [pTemplate]=\"template.getType()\" let-item>\n <ng-container *ngTemplateOutlet=\"template.template; context: { $implicit: item }\"></ng-container>\n </ng-template>\n }\n</p-select>\n}\n@case (ETypeInput.MULTISELECT) {\n<p-multiselect [options]=\"config().multiSelectConfig?.options ?? []\"\n [optionLabel]=\"config().multiSelectConfig?.optionLabel ?? 'name'\" [ngModel]=\"valueInput\"\n (ngModelChange)=\"onChangeValue($event)\" (onBlur)=\"onBlur()\" (keydown)=\"onKeyDown($event)\" [filter]=\"true\"\n appendTo=\"body\" class=\"w-full\" [disabled]=\"isDisabled\" />\n}\n@case (ETypeInput.OTP) {\n<p-inputotp class=\"w-full\" [mask]=\"config().otpConfig?.mask ?? false\" [length]=\"config().otpConfig?.length ?? 6\"\n [integerOnly]=\"config().otpConfig?.integerOnly ?? false\" [ngModel]=\"valueInput\"\n (ngModelChange)=\"onChangeValue($event)\" (onBlur)=\"onBlur()\" (keydown)=\"onKeyDown($event)\" [disabled]=\"isDisabled\" />\n}\n@case (ETypeInput.KNOB) {\n<p-knob [ngModel]=\"knobValueInput()\" (ngModelChange)=\"onChangeValue($event)\" class=\"w-full\" [min]=\"knobConfig?.min ?? 0\"\n [max]=\"knobConfig?.max ?? 100\" [step]=\"knobConfig?.step ?? 1\" [disabled]=\"isDisabled\" [readonly]=\"true\"\n [valueTemplate]=\"knobValueTemplate()\" [size]=\"knobConfig?.size ?? 100\" />\n}\n@case (ETypeInput.TEXTAREA) {\n<textarea class=\"w-full h-full p-2 border border-gray-300 rounded-md\" pTextarea [rows]=\"textareaConfig?.rows ?? 3\"\n [cols]=\"textareaConfig?.cols ?? 30\" [autoResize]=\"true\" [variant]=\"textareaConfig?.variant ?? 'outlined'\"\n [disabled]=\"isDisabled\" [ngModel]=\"valueInput\" (ngModelChange)=\"onChangeValue($event)\" (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\"></textarea>\n}\n@case (ETypeInput.CHIPS) {\n<div class=\"chips-input-wrapper\">\n <div\n class=\"chips-container w-full p-2 border border-gray-300 rounded-md min-h-[40px] flex flex-wrap items-center gap-2\"\n [class.border-red-500]=\"showDuplicateMessage\">\n @for (chip of chips; track $index) {\n <p-chip [label]=\"chip\" [removable]=\"!isDisabled\" (onRemove)=\"removeChip($index)\" class=\"chip-item\" />\n }\n <input type=\"text\" class=\"chip-input flex-1 border-0 outline-0 bg-transparent min-w-[100px]\" [value]=\"currentInput\"\n (input)=\"onChipInputChange($event)\" (keydown)=\"onChipKeydown($event); onKeyDown($event)\"\n (paste)=\"onChipPaste($event)\" [disabled]=\"isDisabled\"\n placeholder=\"Escribe o pega elementos separados por espacios...\" />\n </div>\n @if (showDuplicateMessage) {\n <div class=\"duplicate-message text-red-500 text-sm mt-1 flex items-center gap-1\">\n <i class=\"pi pi-exclamation-triangle text-red-500\"></i>\n <span>\n @if (duplicateChips.length === 1) {\n El elemento \"<strong>{{ duplicatesText }}</strong>\" ya existe en la lista\n } @else {\n Los elementos \"<strong>{{ duplicatesText }}</strong>\" ya existen en la lista\n }\n </span>\n </div>\n }\n</div>\n}\n@case (ETypeInput.SWITCH) {\n<div class=\"flex justify-center items-center p-2\">\n <p-toggleswitch [ngModel]=\"valueInput\" (ngModelChange)=\"onChangeValue($event)\" (onBlur)=\"onBlur()\"\n class=\"w-full\" [disabled]=\"isDisabled\" />\n</div>\n}\n@default {\n<input pInputText class=\"w-full h-full p-2 border border-gray-300 rounded-md\" [type]=\"type\"\n [readOnly]=\"config().readonly ?? false\" [ngModel]=\"valueInput\" (ngModelChange)=\"onChangeValue($event)\"\n (blur)=\"onBlur()\" (keydown)=\"onKeyDown($event)\" [disabled]=\"isDisabled\" />\n}\n}", styles: [":host{width:100%;height:100%}.chips-input-wrapper{width:100%}.chips-input-wrapper .chips-container{cursor:text;transition:border-color .2s ease,box-shadow .2s ease}.chips-input-wrapper .chips-container:focus-within{border-color:#007ad9;box-shadow:0 0 0 1px #007ad9}.chips-input-wrapper .chips-container.border-red-500{border-color:#ef4444!important;box-shadow:0 0 0 1px #ef4444!important}.chips-input-wrapper .chips-container .chip-item{margin:0}.chips-input-wrapper .chips-container .chip-input:focus{outline:none}.chips-input-wrapper .chips-container .chip-input::placeholder{color:#6b7280;font-style:italic}.chips-input-wrapper .duplicate-message{animation:slideDown .3s ease-out}.chips-input-wrapper .duplicate-message i{font-size:14px}@keyframes slideDown{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}::ng-deep p-select.inline-input-select{border:1px solid #d1d5db!important;background:transparent;color:#111827;height:44px;width:100%;border-radius:.5rem;transition:all .2s ease-in-out;display:flex;align-items:center;justify-content:space-between}::ng-deep p-select.inline-input-select .p-select-label{border:none}::ng-deep p-select.inline-input-select .p-select-trigger{border:none}::ng-deep .my-app-dark p-select.inline-input-select{border:1px solid transparent!important;background:transparent;color:#f3f4f6}::ng-deep .my-app-dark p-inputnumber .p-inputnumber-input{background-color:#374151;color:#f3f4f6;border-color:transparent}::ng-deep .my-app-dark p-datepicker .p-inputtext{background-color:#374151;color:#f3f4f6}::ng-deep .my-app-dark p-multiselect .p-multiselect-label{background-color:#374151;color:#f3f4f6}\n"] }]
764
+ }], ctorParameters: () => [], propDecorators: { templates: [{
765
+ type: ContentChildren,
766
+ args: [PrimeTemplate]
767
+ }] } });
768
+
769
+ class AminatedContainerComponent {
770
+ isLoading = true;
771
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AminatedContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
772
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: AminatedContainerComponent, isStandalone: true, selector: "lib-aminated-container", ngImport: i0, template: "<div class=\"fade-in-container\">\r\n <ng-content></ng-content>\r\n</div>\r\n", styles: ["@keyframes fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.fade-in-container{animation:fadeIn .8s ease-out forwards;opacity:0;transform:translateY(10px)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
773
+ }
774
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AminatedContainerComponent, decorators: [{
775
+ type: Component,
776
+ args: [{ selector: 'lib-aminated-container', imports: [CommonModule], template: "<div class=\"fade-in-container\">\r\n <ng-content></ng-content>\r\n</div>\r\n", styles: ["@keyframes fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.fade-in-container{animation:fadeIn .8s ease-out forwards;opacity:0;transform:translateY(10px)}\n"] }]
777
+ }] });
778
+
779
+ class SpeedDialService {
780
+ panelOffset = 10;
781
+ mainButtonHost;
782
+ activeAnchor;
783
+ _isMenuOpen = signal(false);
784
+ _panelTop = signal('0px');
785
+ _panelLeft = signal('0px');
786
+ constructor() { }
787
+ _speedDialConfig = signal({});
788
+ speedDialConfig = this._speedDialConfig.asReadonly();
789
+ isMenuOpen = this._isMenuOpen.asReadonly();
790
+ panelTop = this._panelTop.asReadonly();
791
+ panelLeft = this._panelLeft.asReadonly();
792
+ setSpeedDialConfig(config) {
793
+ this._speedDialConfig.set(config);
794
+ if (this.isMenuOpen())
795
+ this.updatePanelPosition();
796
+ }
797
+ setMainButtonHost(host) {
798
+ this.mainButtonHost = host;
799
+ if (this.isMenuOpen())
800
+ this.updatePanelPosition();
801
+ }
802
+ buttons = computed(() => {
803
+ return this.speedDialConfig().buttons;
804
+ });
805
+ overlayButtons = computed(() => {
806
+ return this.buttons().map((button) => {
807
+ return {
808
+ ...button,
809
+ onClick: (data) => {
810
+ this.closeMenu();
811
+ button.onClick?.(data);
812
+ }
813
+ };
814
+ });
815
+ });
816
+ mainButton = computed(() => {
817
+ const rawMainButton = this.speedDialConfig().mainButton;
818
+ return {
819
+ ...rawMainButton,
820
+ icon: this.isMenuOpen() ? 'fa-solid fa-xmark' : rawMainButton.icon,
821
+ severity: this.isMenuOpen() ? 'danger' : rawMainButton.severity,
822
+ onClick: (data) => {
823
+ rawMainButton.onClick?.(data);
824
+ }
825
+ };
826
+ });
827
+ direction = computed(() => {
828
+ return this.speedDialConfig().direction;
829
+ });
830
+ toggleMenu(anchor) {
831
+ const nextState = !this.isMenuOpen();
832
+ this._isMenuOpen.set(nextState);
833
+ this.activeAnchor = anchor ?? this.mainButtonHost;
834
+ if (!nextState)
835
+ return;
836
+ this.updatePanelPosition();
837
+ window.addEventListener('resize', this.handleViewportChange);
838
+ window.addEventListener('scroll', this.handleViewportChange, true);
839
+ }
840
+ closeMenu() {
841
+ if (!this.isMenuOpen())
842
+ return;
843
+ this._isMenuOpen.set(false);
844
+ this.activeAnchor = undefined;
845
+ window.removeEventListener('resize', this.handleViewportChange);
846
+ window.removeEventListener('scroll', this.handleViewportChange, true);
847
+ }
848
+ destroy() {
849
+ this.closeMenu();
850
+ this.mainButtonHost = undefined;
851
+ }
852
+ handleViewportChange = () => {
853
+ if (!this.isMenuOpen())
854
+ return;
855
+ this.updatePanelPosition();
856
+ };
857
+ updatePanelPosition() {
858
+ const anchor = this.activeAnchor ?? this.mainButtonHost;
859
+ if (!anchor)
860
+ return;
861
+ const rect = anchor.getBoundingClientRect();
862
+ const fixedContainingBlock = this.getFixedContainingBlock(anchor);
863
+ const containingBlockRect = fixedContainingBlock?.getBoundingClientRect();
864
+ const offsetTop = containingBlockRect?.top ?? 0;
865
+ const offsetLeft = containingBlockRect?.left ?? 0;
866
+ switch (this.direction()) {
867
+ case 'top':
868
+ this._panelTop.set(`${rect.top - offsetTop - this.panelOffset}px`);
869
+ this._panelLeft.set(`${rect.left - offsetLeft}px`);
870
+ break;
871
+ case 'bottom':
872
+ this._panelTop.set(`${rect.bottom - offsetTop + this.panelOffset}px`);
873
+ this._panelLeft.set(`${rect.left - offsetLeft}px`);
874
+ break;
875
+ case 'left':
876
+ this._panelTop.set(`${rect.top - offsetTop}px`);
877
+ this._panelLeft.set(`${rect.left - offsetLeft - this.panelOffset}px`);
878
+ break;
879
+ case 'right':
880
+ this._panelTop.set(`${rect.top - offsetTop}px`);
881
+ this._panelLeft.set(`${rect.right - offsetLeft + this.panelOffset}px`);
882
+ break;
883
+ }
884
+ }
885
+ /**
886
+ * Detecta el ancestro que actúa como containing block para elementos fixed.
887
+ * Si existe (por transform/filter/contain/etc), el panel debe posicionarse
888
+ * relativo a ese contenedor y no al viewport.
889
+ */
890
+ getFixedContainingBlock(element) {
891
+ let current = element.parentElement;
892
+ while (current) {
893
+ const styles = window.getComputedStyle(current);
894
+ const hasTransformContext = styles.transform !== 'none' ||
895
+ styles.perspective !== 'none' ||
896
+ styles.filter !== 'none' ||
897
+ (styles.backdropFilter && styles.backdropFilter !== 'none') ||
898
+ styles.contain.includes('paint') ||
899
+ styles.contain.includes('layout') ||
900
+ styles.willChange.includes('transform') ||
901
+ styles.willChange.includes('filter') ||
902
+ styles.willChange.includes('perspective');
903
+ if (hasTransformContext) {
904
+ return current;
905
+ }
906
+ current = current.parentElement;
907
+ }
908
+ return null;
909
+ }
910
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SpeedDialService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
911
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SpeedDialService, providedIn: 'root' });
912
+ }
913
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SpeedDialService, decorators: [{
914
+ type: Injectable,
915
+ args: [{
916
+ providedIn: 'root'
917
+ }]
918
+ }], ctorParameters: () => [] });
919
+
920
+ class AppButtonNgService {
921
+ buttonConfig = signal({});
922
+ constructor() {
923
+ // Effect para manejar automáticamente la rotación de mensajes
924
+ effect(() => {
925
+ const config = this.buttonConfig();
926
+ if (config.loading && config.loadingMessages && config.loadingMessages.length > 1) {
927
+ this.startMessageRotation();
928
+ }
929
+ else {
930
+ this.stopMessageRotation();
931
+ }
932
+ });
933
+ }
934
+ setButtonConfig(buttonConfig) {
935
+ this.buttonConfig.set(buttonConfig);
936
+ }
937
+ // Computed público para acceder al label dinámico
938
+ label = computed(() => {
939
+ const config = this.buttonConfig();
940
+ // Si está cargando y tiene mensajes de carga, rotar entre ellos
941
+ if (config.loading && config.loadingMessages && config.loadingMessages.length > 0) {
942
+ const messages = config.loadingMessages;
943
+ const index = this.messageIndex() % messages.length; // Wrap around
944
+ return messages[index];
945
+ }
946
+ // Si no está cargando, retornar el label normal
947
+ return config.label ? config.label : '';
948
+ });
949
+ //#region Loading Messages
950
+ messageIndex = signal(0);
951
+ intervalId;
952
+ startMessageRotation() {
953
+ if (this.intervalId)
954
+ return;
955
+ this.intervalId = setInterval(() => {
956
+ this.messageIndex.update(index => index + 1);
957
+ }, 6000);
958
+ }
959
+ stopMessageRotation() {
960
+ if (this.intervalId) {
961
+ clearInterval(this.intervalId);
962
+ this.intervalId = undefined;
963
+ this.messageIndex.set(0);
964
+ }
965
+ }
966
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AppButtonNgService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
967
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AppButtonNgService, providedIn: 'root' });
968
+ }
969
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AppButtonNgService, decorators: [{
970
+ type: Injectable,
971
+ args: [{
972
+ providedIn: 'root'
973
+ }]
974
+ }], ctorParameters: () => [] });
975
+
976
+ class ButtonNgComponent {
977
+ appButtonNgService = inject(AppButtonNgService);
978
+ buttonConfig = model.required();
979
+ onClick = output();
980
+ constructor() {
981
+ effect(() => {
982
+ this.appButtonNgService.setButtonConfig(this.buttonConfig());
983
+ });
984
+ }
985
+ get label() {
986
+ return this.appButtonNgService.label();
987
+ }
988
+ onClickButton() {
989
+ if (this.buttonConfig().onClick) {
990
+ return;
991
+ }
992
+ this.onClick.emit();
993
+ }
994
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ButtonNgComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
995
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: ButtonNgComponent, isStandalone: true, selector: "lib-button-ng", inputs: { buttonConfig: { classPropertyName: "buttonConfig", publicName: "buttonConfig", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { buttonConfig: "buttonConfigChange", onClick: "onClick" }, providers: [AppButtonNgService], ngImport: i0, template: "@let config = buttonConfig(); @let tooltipConfig = buttonConfig().tooltipConfig;\r\n@if (!config.hideButton) {\r\n <div\r\n [ngClass]=\"{\r\n 'full-width-button': config.fullWidth,\r\n 'full-height-button': config.fullHeight,\r\n 'cursor-pointer': this.onClick\r\n }\"\r\n [class]=\"config.class ?? ''\"\r\n >\r\n <p-button\r\n [label]=\"config.hasTemplate ? undefined : label\"\r\n [icon]=\"config.hasTemplate ? undefined : config.icon\"\r\n [severity]=\"config.hasTemplate ? 'secondary' : config.severity\"\r\n [loading]=\"config.loading || false\"\r\n [disabled]=\"config.disabled || false\"\r\n [rounded]=\"config.rounded || false\"\r\n [raised]=\"config.raised || false\"\r\n [variant]=\"config.hasTemplate ? 'text' : config.variant\"\r\n [badge]=\"config.badge\"\r\n (onClick)=\"config?.onClick?.() ?? onClickButton()\"\r\n [size]=\"config?.size\"\r\n pTooltip=\"{{ tooltipConfig?.pTooltip }}\"\r\n [tooltipPosition]=\"tooltipConfig?.tooltipPosition ?? 'top'\"\r\n [iconPos]=\"config?.iconPos ?? 'left'\"\r\n [ngClass]=\"{\r\n 'cursor-pointer': (config.onClick || config.hasStaticClick) && !config.disabled,\r\n 'cursor-auto': !((config.onClick || config.hasStaticClick) && !config.disabled),\r\n 'no-hover-template': config.hasTemplate\r\n }\"\r\n [outlined]=\"config.outlined || false\"\r\n [text]=\"config.text || false\"\r\n >\r\n @if (config.hasTemplate) {\r\n <ng-content></ng-content>\r\n }\r\n </p-button>\r\n </div>\r\n}\r\n", styles: [".full-width-button ::ng-deep p-button button{width:100%}.full-height-button ::ng-deep p-button button{height:100%}::ng-deep .cursor-auto button{cursor:auto!important}::ng-deep .cursor-pointer button{cursor:pointer!important}::ng-deep .no-hover-template button{background:transparent!important;border:none!important;box-shadow:none!important;padding:0!important}::ng-deep .no-hover-template button:hover,::ng-deep .no-hover-template button:focus,::ng-deep .no-hover-template button:active{background:transparent!important;border:none!important;box-shadow:none!important}\n"], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i1$2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i10.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
996
+ }
997
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ButtonNgComponent, decorators: [{
998
+ type: Component,
999
+ args: [{ selector: 'lib-button-ng', imports: [
1000
+ ButtonModule,
1001
+ TooltipModule,
1002
+ CommonModule
1003
+ ], providers: [AppButtonNgService], template: "@let config = buttonConfig(); @let tooltipConfig = buttonConfig().tooltipConfig;\r\n@if (!config.hideButton) {\r\n <div\r\n [ngClass]=\"{\r\n 'full-width-button': config.fullWidth,\r\n 'full-height-button': config.fullHeight,\r\n 'cursor-pointer': this.onClick\r\n }\"\r\n [class]=\"config.class ?? ''\"\r\n >\r\n <p-button\r\n [label]=\"config.hasTemplate ? undefined : label\"\r\n [icon]=\"config.hasTemplate ? undefined : config.icon\"\r\n [severity]=\"config.hasTemplate ? 'secondary' : config.severity\"\r\n [loading]=\"config.loading || false\"\r\n [disabled]=\"config.disabled || false\"\r\n [rounded]=\"config.rounded || false\"\r\n [raised]=\"config.raised || false\"\r\n [variant]=\"config.hasTemplate ? 'text' : config.variant\"\r\n [badge]=\"config.badge\"\r\n (onClick)=\"config?.onClick?.() ?? onClickButton()\"\r\n [size]=\"config?.size\"\r\n pTooltip=\"{{ tooltipConfig?.pTooltip }}\"\r\n [tooltipPosition]=\"tooltipConfig?.tooltipPosition ?? 'top'\"\r\n [iconPos]=\"config?.iconPos ?? 'left'\"\r\n [ngClass]=\"{\r\n 'cursor-pointer': (config.onClick || config.hasStaticClick) && !config.disabled,\r\n 'cursor-auto': !((config.onClick || config.hasStaticClick) && !config.disabled),\r\n 'no-hover-template': config.hasTemplate\r\n }\"\r\n [outlined]=\"config.outlined || false\"\r\n [text]=\"config.text || false\"\r\n >\r\n @if (config.hasTemplate) {\r\n <ng-content></ng-content>\r\n }\r\n </p-button>\r\n </div>\r\n}\r\n", styles: [".full-width-button ::ng-deep p-button button{width:100%}.full-height-button ::ng-deep p-button button{height:100%}::ng-deep .cursor-auto button{cursor:auto!important}::ng-deep .cursor-pointer button{cursor:pointer!important}::ng-deep .no-hover-template button{background:transparent!important;border:none!important;box-shadow:none!important;padding:0!important}::ng-deep .no-hover-template button:hover,::ng-deep .no-hover-template button:focus,::ng-deep .no-hover-template button:active{background:transparent!important;border:none!important;box-shadow:none!important}\n"] }]
1004
+ }], ctorParameters: () => [] });
1005
+
1006
+ class SpeedDialComponent {
1007
+ mainButtonContainer;
1008
+ speedDialConfig = input.required();
1009
+ speedDialService = inject(SpeedDialService);
1010
+ constructor() {
1011
+ effect(() => {
1012
+ this.speedDialService.setSpeedDialConfig(this.speedDialConfig());
1013
+ });
1014
+ }
1015
+ get buttons() {
1016
+ return this.speedDialService.buttons();
1017
+ }
1018
+ get overlayButtons() {
1019
+ return this.speedDialService.overlayButtons();
1020
+ }
1021
+ get mainButton() {
1022
+ return this.speedDialService.mainButton();
1023
+ }
1024
+ get isMenuOpen() {
1025
+ return this.speedDialService.isMenuOpen();
1026
+ }
1027
+ get panelTop() {
1028
+ return this.speedDialService.panelTop();
1029
+ }
1030
+ get panelLeft() {
1031
+ return this.speedDialService.panelLeft();
1032
+ }
1033
+ get direction() {
1034
+ return this.speedDialService.direction();
1035
+ }
1036
+ ngAfterViewInit() {
1037
+ const hostElement = this.mainButtonContainer?.nativeElement;
1038
+ if (!hostElement)
1039
+ return;
1040
+ this.speedDialService.setMainButtonHost(hostElement);
1041
+ }
1042
+ ngOnDestroy() {
1043
+ this.speedDialService.destroy();
1044
+ }
1045
+ closeMenu() {
1046
+ this.speedDialService.closeMenu();
1047
+ }
1048
+ onMainButtonClick(event) {
1049
+ const target = event.target;
1050
+ const anchor = target?.closest('button,[role="button"]');
1051
+ this.speedDialService.toggleMenu(anchor ?? this.mainButtonContainer?.nativeElement);
1052
+ }
1053
+ stopPropagation(event) {
1054
+ event.stopPropagation();
1055
+ }
1056
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SpeedDialComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1057
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SpeedDialComponent, isStandalone: true, selector: "lib-speed-dial", inputs: { speedDialConfig: { classPropertyName: "speedDialConfig", publicName: "speedDialConfig", isSignal: true, isRequired: true, transformFunction: null } }, providers: [SpeedDialService], viewQueries: [{ propertyName: "mainButtonContainer", first: true, predicate: ["mainButtonContainer"], descendants: true }], ngImport: i0, template: "<div\r\n #mainButtonContainer\r\n class=\"speed-dial-main-button\"\r\n [class.speed-dial-main-button--open]=\"isMenuOpen\"\r\n (click)=\"onMainButtonClick($event)\"\r\n>\r\n <lib-button-ng [buttonConfig]=\"mainButton\"></lib-button-ng>\r\n</div>\r\n\r\n@if (isMenuOpen) {\r\n <div class=\"speed-dial-overlay\" (click)=\"closeMenu()\">\r\n <div\r\n class=\"speed-dial-panel bg-gray-100 dark:bg-gray-900 border border-gray-200 dark:border-gray-800 rounded-lg\"\r\n [style.top]=\"panelTop\"\r\n [style.left]=\"panelLeft\"\r\n (click)=\"stopPropagation($event)\"\r\n [ngClass]=\"{\r\n 'speed-dial-panel--top': direction === 'top',\r\n 'speed-dial-panel--bottom': direction === 'bottom',\r\n 'speed-dial-panel--left': direction === 'left',\r\n 'speed-dial-panel--right': direction === 'right'\r\n }\"\r\n >\r\n @for (button of overlayButtons; track $index) {\r\n <lib-button-ng [buttonConfig]=\"button\"></lib-button-ng>\r\n }\r\n </div>\r\n </div>\r\n}\r\n", styles: [".speed-dial-main-button{display:inline-flex}.speed-dial-main-button--open{position:relative;z-index:2147483647}.speed-dial-overlay{position:fixed;inset:0;z-index:2147483645}.speed-dial-panel{position:fixed;z-index:2147483646;display:flex;gap:.5rem;overflow:auto;padding:.75rem;border-radius:.75rem;background:#fff;box-shadow:0 10px 30px #0f172a40}.speed-dial-panel--top{flex-direction:column;max-width:22rem;max-height:30rem;transform:translateY(-100%)}.speed-dial-panel--bottom{flex-direction:column;max-width:22rem;max-height:30rem}.speed-dial-panel--left{flex-direction:row;max-width:40rem;max-height:8rem;transform:translate(-100%)}.speed-dial-panel--right{flex-direction:row;max-width:40rem;max-height:8rem}:host-context(.dark) .speed-dial-panel{background:#111827}\n"], dependencies: [{ kind: "component", type: ButtonNgComponent, selector: "lib-button-ng", inputs: ["buttonConfig"], outputs: ["buttonConfigChange", "onClick"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
1058
+ }
1059
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SpeedDialComponent, decorators: [{
1060
+ type: Component,
1061
+ args: [{ selector: 'lib-speed-dial', imports: [ButtonNgComponent, CommonModule], providers: [SpeedDialService], template: "<div\r\n #mainButtonContainer\r\n class=\"speed-dial-main-button\"\r\n [class.speed-dial-main-button--open]=\"isMenuOpen\"\r\n (click)=\"onMainButtonClick($event)\"\r\n>\r\n <lib-button-ng [buttonConfig]=\"mainButton\"></lib-button-ng>\r\n</div>\r\n\r\n@if (isMenuOpen) {\r\n <div class=\"speed-dial-overlay\" (click)=\"closeMenu()\">\r\n <div\r\n class=\"speed-dial-panel bg-gray-100 dark:bg-gray-900 border border-gray-200 dark:border-gray-800 rounded-lg\"\r\n [style.top]=\"panelTop\"\r\n [style.left]=\"panelLeft\"\r\n (click)=\"stopPropagation($event)\"\r\n [ngClass]=\"{\r\n 'speed-dial-panel--top': direction === 'top',\r\n 'speed-dial-panel--bottom': direction === 'bottom',\r\n 'speed-dial-panel--left': direction === 'left',\r\n 'speed-dial-panel--right': direction === 'right'\r\n }\"\r\n >\r\n @for (button of overlayButtons; track $index) {\r\n <lib-button-ng [buttonConfig]=\"button\"></lib-button-ng>\r\n }\r\n </div>\r\n </div>\r\n}\r\n", styles: [".speed-dial-main-button{display:inline-flex}.speed-dial-main-button--open{position:relative;z-index:2147483647}.speed-dial-overlay{position:fixed;inset:0;z-index:2147483645}.speed-dial-panel{position:fixed;z-index:2147483646;display:flex;gap:.5rem;overflow:auto;padding:.75rem;border-radius:.75rem;background:#fff;box-shadow:0 10px 30px #0f172a40}.speed-dial-panel--top{flex-direction:column;max-width:22rem;max-height:30rem;transform:translateY(-100%)}.speed-dial-panel--bottom{flex-direction:column;max-width:22rem;max-height:30rem}.speed-dial-panel--left{flex-direction:row;max-width:40rem;max-height:8rem;transform:translate(-100%)}.speed-dial-panel--right{flex-direction:row;max-width:40rem;max-height:8rem}:host-context(.dark) .speed-dial-panel{background:#111827}\n"] }]
1062
+ }], ctorParameters: () => [], propDecorators: { mainButtonContainer: [{
1063
+ type: ViewChild,
1064
+ args: ['mainButtonContainer']
1065
+ }] } });
1066
+
1067
+ class KeyToDisplayNamePipe {
1068
+ transform(key, keysNames) {
1069
+ return keysNames?.[key] ?? key;
1070
+ }
1071
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: KeyToDisplayNamePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1072
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: KeyToDisplayNamePipe, isStandalone: true, name: "keyToDisplayName" });
1073
+ }
1074
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: KeyToDisplayNamePipe, decorators: [{
1075
+ type: Pipe,
1076
+ args: [{
1077
+ name: 'keyToDisplayName'
1078
+ }]
1079
+ }] });
1080
+
1081
+ /**
1082
+ * Utilidades para manejar errores de API según la interfaz IApiError
1083
+ */
1084
+ class ApiErrorUtil {
1085
+ /**
1086
+ * Procesa errores de API y extrae el mensaje según la interfaz IApiError
1087
+ * @param error - El error HTTP recibido
1088
+ * @param fallbackMessage - Mensaje por defecto si no se puede extraer el mensaje del error
1089
+ * @returns El mensaje de error procesado
1090
+ */
1091
+ static handleApiError(error, fallbackMessage) {
1092
+ const apiError = error.error;
1093
+ const errorMessage = Array.isArray(apiError?.message)
1094
+ ? apiError.message.join(', ')
1095
+ : apiError?.message ?? fallbackMessage;
1096
+ return errorMessage;
1097
+ }
1098
+ /**
1099
+ * Procesa errores de API con información detallada de campos
1100
+ * y muestra tanto el mensaje general como los errores específicos de campo
1101
+ * @param error - El error HTTP recibido
1102
+ * @param fallbackMessage - Mensaje por defecto si no se puede extraer el mensaje del error
1103
+ * @returns El mensaje de error procesado con información de campos si está disponible
1104
+ */
1105
+ static handleApiErrorWithFields(error, fallbackMessage) {
1106
+ const apiError = error.error;
1107
+ let errorMessage = Array.isArray(apiError?.message)
1108
+ ? apiError.message.join(', ')
1109
+ : apiError?.message ?? fallbackMessage;
1110
+ // Si hay errores de campo específicos, los agregamos al mensaje
1111
+ if (apiError?.errors && apiError.errors.length > 0) {
1112
+ const fieldErrors = apiError.errors
1113
+ .map(fieldError => `${fieldError.field}: ${fieldError.message}`)
1114
+ .join(', ');
1115
+ errorMessage = `${errorMessage}. Errores de campos: ${fieldErrors}`;
1116
+ }
1117
+ return errorMessage;
1118
+ }
1119
+ /**
1120
+ * Obtiene solo los errores de campo específicos
1121
+ * @param error - El error HTTP recibido
1122
+ * @returns Array de errores de campo o array vacío si no hay errores
1123
+ */
1124
+ static getFieldErrors(error) {
1125
+ const apiError = error.error;
1126
+ return apiError?.errors ?? [];
1127
+ }
1128
+ /**
1129
+ * Verifica si el error tiene errores de campo específicos
1130
+ * @param error - El error HTTP recibido
1131
+ * @returns true si hay errores de campo, false en caso contrario
1132
+ */
1133
+ static hasFieldErrors(error) {
1134
+ const apiError = error.error;
1135
+ return apiError?.errors && apiError.errors.length > 0;
1136
+ }
1137
+ /**
1138
+ * Obtiene el código de error específico
1139
+ * @param error - El error HTTP recibido
1140
+ * @returns El código de error o undefined si no está disponible
1141
+ */
1142
+ static getErrorCode(error) {
1143
+ const apiError = error.error;
1144
+ return apiError?.errorCode;
1145
+ }
1146
+ /**
1147
+ * Obtiene el timestamp del error
1148
+ * @param error - El error HTTP recibido
1149
+ * @returns El timestamp del error o undefined si no está disponible
1150
+ */
1151
+ static getErrorTimestamp(error) {
1152
+ const apiError = error.error;
1153
+ return apiError?.timestamp;
1154
+ }
1155
+ }
1156
+
1157
+ class CookieUtil {
1158
+ /**
1159
+ * Obtiene el valor de una cookie por su nombre
1160
+ * @param name - Nombre de la cookie
1161
+ * @returns El valor de la cookie o null si no existe
1162
+ */
1163
+ static getCookie(name) {
1164
+ if (typeof document === 'undefined') {
1165
+ return null;
1166
+ }
1167
+ const nameEQ = name + '=';
1168
+ const ca = document.cookie.split(';');
1169
+ for (let i = 0; i < ca.length; i++) {
1170
+ let c = ca[i];
1171
+ while (c.charAt(0) === ' ') {
1172
+ c = c.substring(1, c.length);
1173
+ }
1174
+ if (c.indexOf(nameEQ) === 0) {
1175
+ return c.substring(nameEQ.length, c.length);
1176
+ }
1177
+ }
1178
+ return null;
1179
+ }
1180
+ /**
1181
+ * Establece una cookie
1182
+ * @param name - Nombre de la cookie
1183
+ * @param value - Valor de la cookie
1184
+ * @param days - Días hasta que expire (por defecto 365)
1185
+ * @param path - Ruta de la cookie (por defecto '/')
1186
+ */
1187
+ static setCookie(name, value, days = 365, path = '/') {
1188
+ if (typeof document === 'undefined') {
1189
+ return;
1190
+ }
1191
+ let expires = '';
1192
+ if (days) {
1193
+ const date = new Date();
1194
+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
1195
+ expires = '; expires=' + date.toUTCString();
1196
+ }
1197
+ document.cookie = name + '=' + (value || '') + expires + '; path=' + path;
1198
+ }
1199
+ /**
1200
+ * Elimina una cookie
1201
+ * @param name - Nombre de la cookie a eliminar
1202
+ * @param path - Ruta de la cookie (por defecto '/')
1203
+ */
1204
+ static eraseCookie(name, path = '/') {
1205
+ if (typeof document === 'undefined') {
1206
+ return;
1207
+ }
1208
+ document.cookie = name + '=; Path=' + path + '; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
1209
+ }
1210
+ /**
1211
+ * Obtiene un valor booleano desde una cookie
1212
+ * @param name - Nombre de la cookie
1213
+ * @param defaultValue - Valor por defecto si la cookie no existe
1214
+ * @returns El valor booleano
1215
+ */
1216
+ static getBooleanCookie(name, defaultValue = false) {
1217
+ const value = this.getCookie(name);
1218
+ if (value === null) {
1219
+ return defaultValue;
1220
+ }
1221
+ return value === 'true';
1222
+ }
1223
+ /**
1224
+ * Establece un valor booleano en una cookie
1225
+ * @param name - Nombre de la cookie
1226
+ * @param value - Valor booleano
1227
+ * @param days - Días hasta que expire (por defecto 365)
1228
+ * @param path - Ruta de la cookie (por defecto '/')
1229
+ */
1230
+ static setBooleanCookie(name, value, days = 365, path = '/') {
1231
+ this.setCookie(name, value.toString(), days, path);
1232
+ }
1233
+ }
1234
+
1235
+ const formatCurrency = (amount, currency) => {
1236
+ return new Intl.NumberFormat('es-CO', {
1237
+ style: 'currency',
1238
+ currency: currency || 'COP'
1239
+ }).format(amount);
1240
+ };
1241
+
1242
+ const isSameDay = (date1, date2) => {
1243
+ const date1Copy = new Date(date1.setHours(0, 0, 0, 0));
1244
+ const date2Copy = new Date(date2.setHours(0, 0, 0, 0));
1245
+ return date1Copy.getTime() === date2Copy.getTime();
1246
+ };
1247
+ const formatDateDMA = (date) => {
1248
+ return new Date(date).toLocaleDateString('es-CO', {
1249
+ year: 'numeric',
1250
+ month: '2-digit',
1251
+ day: '2-digit'
1252
+ });
1253
+ };
1254
+ // Crea una funcion que tambien muestre la hora
1255
+ const formatDateDMAWithTime = (date) => {
1256
+ return new Date(date).toLocaleDateString('es-CO', {
1257
+ year: 'numeric',
1258
+ month: '2-digit',
1259
+ day: '2-digit',
1260
+ hour: '2-digit',
1261
+ minute: '2-digit'
1262
+ });
1263
+ };
1264
+
1265
+ /**
1266
+ * Enum con los tipos de archivos más relevantes para la aplicación
1267
+ */
1268
+ var EFileType;
1269
+ (function (EFileType) {
1270
+ // Documentos
1271
+ EFileType["PDF"] = "application/pdf";
1272
+ EFileType["DOC"] = "application/msword";
1273
+ EFileType["DOCX"] = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
1274
+ EFileType["XLS"] = "application/vnd.ms-excel";
1275
+ EFileType["XLSX"] = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
1276
+ EFileType["PPT"] = "application/vnd.ms-powerpoint";
1277
+ EFileType["PPTX"] = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
1278
+ EFileType["TXT"] = "text/plain";
1279
+ EFileType["RTF"] = "application/rtf";
1280
+ // Imágenes
1281
+ EFileType["JPG"] = "image/jpeg";
1282
+ EFileType["PNG"] = "image/png";
1283
+ EFileType["GIF"] = "image/gif";
1284
+ EFileType["BMP"] = "image/bmp";
1285
+ EFileType["SVG"] = "image/svg+xml";
1286
+ EFileType["WEBP"] = "image/webp";
1287
+ // Archivos comprimidos
1288
+ EFileType["ZIP"] = "application/zip";
1289
+ EFileType["RAR"] = "application/vnd.rar";
1290
+ EFileType["TAR"] = "application/x-tar";
1291
+ EFileType["GZ"] = "application/gzip";
1292
+ // Archivos de datos
1293
+ EFileType["CSV"] = "text/csv";
1294
+ EFileType["JSON"] = "application/json";
1295
+ EFileType["XML"] = "application/xml";
1296
+ // Archivos de audio
1297
+ EFileType["MP3"] = "audio/mpeg";
1298
+ EFileType["WAV"] = "audio/wav";
1299
+ EFileType["OGG"] = "audio/ogg";
1300
+ // Archivos de video
1301
+ EFileType["MP4"] = "video/mp4";
1302
+ EFileType["AVI"] = "video/x-msvideo";
1303
+ EFileType["MOV"] = "video/quicktime";
1304
+ EFileType["WMV"] = "video/x-ms-wmv";
1305
+ // Todos los tipos de imagen
1306
+ EFileType["ALL_IMAGES"] = "image/*";
1307
+ // Todos los tipos de documento
1308
+ EFileType["ALL_DOCUMENTS"] = "application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,text/plain,application/rtf";
1309
+ // Todos los tipos de archivo
1310
+ EFileType["ALL_FILES"] = "*/*";
1311
+ })(EFileType || (EFileType = {}));
1312
+ /**
1313
+ * Método mejorado para abrir el selector de archivos
1314
+ * @param options - Opciones para configurar el input de archivo
1315
+ */
1316
+ const triggerFileInput = (options = {}) => {
1317
+ const { accept = EFileType.ALL_FILES, multiple = false, onFileSelected } = options;
1318
+ const input = document.createElement('input');
1319
+ input.type = 'file';
1320
+ input.accept = accept;
1321
+ input.multiple = multiple;
1322
+ input.style.display = 'none';
1323
+ input.onchange = (event) => {
1324
+ const target = event.target;
1325
+ const files = target.files;
1326
+ if (files && files.length > 0 && onFileSelected) {
1327
+ if (multiple) {
1328
+ // Si es múltiple, llamar al callback con todos los archivos
1329
+ Array.from(files).forEach(file => {
1330
+ onFileSelected(file);
1331
+ });
1332
+ }
1333
+ else {
1334
+ // Si es único, llamar al callback con el primer archivo
1335
+ const file = files[0];
1336
+ onFileSelected(file);
1337
+ }
1338
+ }
1339
+ document.body.removeChild(input);
1340
+ };
1341
+ document.body.appendChild(input);
1342
+ input.click();
1343
+ };
1344
+ /**
1345
+ * Función para capturar una foto usando la cámara
1346
+ */
1347
+ const capturePhotoFromCamera = async (options = {}) => {
1348
+ const { quality = 0.9, facingMode = 'environment', onPhotoTaken, onError } = options;
1349
+ try {
1350
+ if (!navigator.mediaDevices?.getUserMedia) {
1351
+ throw new Error('Cámara no soportada en este navegador');
1352
+ }
1353
+ const stream = await navigator.mediaDevices.getUserMedia({
1354
+ video: { facingMode }
1355
+ });
1356
+ const video = document.createElement('video');
1357
+ const canvas = document.createElement('canvas');
1358
+ const context = canvas.getContext('2d');
1359
+ // Crear modal
1360
+ const modal = document.createElement('div');
1361
+ modal.style.cssText = `
1362
+ position: fixed; top: 0; left: 0; width: 100%; height: 100%;
1363
+ background: rgba(0,0,0,0.9); display: flex; flex-direction: column;
1364
+ align-items: center; justify-content: center; z-index: 10000;
1365
+ `;
1366
+ video.style.cssText = 'width: 80%; max-width: 500px; border-radius: 8px;';
1367
+ video.srcObject = stream;
1368
+ video.autoplay = true;
1369
+ video.playsInline = true;
1370
+ const buttonsDiv = document.createElement('div');
1371
+ buttonsDiv.style.cssText = 'display: flex; gap: 20px; margin-top: 20px;';
1372
+ const captureBtn = document.createElement('button');
1373
+ captureBtn.textContent = 'Tomar Foto';
1374
+ captureBtn.style.cssText = `
1375
+ padding: 12px 24px; background: #007bff; color: white;
1376
+ border: none; border-radius: 6px; cursor: pointer; font-size: 16px;
1377
+ `;
1378
+ const cancelBtn = document.createElement('button');
1379
+ cancelBtn.textContent = 'Cancelar';
1380
+ cancelBtn.style.cssText = `
1381
+ padding: 12px 24px; background: #6c757d; color: white;
1382
+ border: none; border-radius: 6px; cursor: pointer; font-size: 16px;
1383
+ `;
1384
+ const cleanup = () => {
1385
+ stream.getTracks().forEach(track => track.stop());
1386
+ modal.remove();
1387
+ };
1388
+ captureBtn.onclick = () => {
1389
+ canvas.width = video.videoWidth;
1390
+ canvas.height = video.videoHeight;
1391
+ context.drawImage(video, 0, 0);
1392
+ canvas.toBlob((blob) => {
1393
+ if (blob && onPhotoTaken) {
1394
+ const file = new File([blob], `photo-${Date.now()}.jpg`, { type: 'image/jpeg' });
1395
+ onPhotoTaken(file);
1396
+ }
1397
+ cleanup();
1398
+ }, 'image/jpeg', quality);
1399
+ };
1400
+ cancelBtn.onclick = cleanup;
1401
+ document.addEventListener('keydown', (e) => {
1402
+ if (e.key === 'Escape')
1403
+ cleanup();
1404
+ });
1405
+ buttonsDiv.append(captureBtn, cancelBtn);
1406
+ modal.append(video, buttonsDiv);
1407
+ document.body.appendChild(modal);
1408
+ }
1409
+ catch (error) {
1410
+ if (onError)
1411
+ onError(error);
1412
+ }
1413
+ };
1414
+ var EFileIcons;
1415
+ (function (EFileIcons) {
1416
+ EFileIcons["FILE"] = "file";
1417
+ EFileIcons["IMAGE"] = "image";
1418
+ EFileIcons["VIDEO"] = "video";
1419
+ EFileIcons["FOLDER"] = "folder";
1420
+ EFileIcons["EXCEL"] = "excel";
1421
+ EFileIcons["SIGNATURE"] = "signature";
1422
+ EFileIcons["CONTRACT"] = "contract";
1423
+ EFileIcons["FINGERPRINT"] = "fingerprint";
1424
+ EFileIcons["ID_CARD"] = "id_card";
1425
+ EFileIcons["FILE_BOX"] = "file_box";
1426
+ EFileIcons["SECURE_BUILDING"] = "secure_building";
1427
+ EFileIcons["POLICE"] = "police";
1428
+ })(EFileIcons || (EFileIcons = {}));
1429
+ const DocumentIcon = {
1430
+ [EFileIcons.FILE]: 'fa-solid fa-file-lines',
1431
+ [EFileIcons.IMAGE]: 'fa-solid fa-file-image',
1432
+ [EFileIcons.VIDEO]: 'fa-solid fa-file-video',
1433
+ [EFileIcons.FOLDER]: 'fa-solid fa-folder',
1434
+ [EFileIcons.EXCEL]: 'fa-solid fa-file-excel',
1435
+ [EFileIcons.SIGNATURE]: 'fa-solid fa-signature',
1436
+ [EFileIcons.CONTRACT]: 'fa-solid fa-file-contract',
1437
+ [EFileIcons.FINGERPRINT]: 'fa-solid fa-fingerprint',
1438
+ [EFileIcons.ID_CARD]: 'fa-solid fa-id-card',
1439
+ [EFileIcons.SECURE_BUILDING]: 'fa-solid fa-building-shield',
1440
+ [EFileIcons.POLICE]: 'fa-solid fa-hand-middle-finger',
1441
+ [EFileIcons.FILE_BOX]: 'fa-solid fa-box-archive'
1442
+ };
1443
+ const downloadFile = (blob, fileName) => {
1444
+ const url = window.URL.createObjectURL(blob);
1445
+ const link = document.createElement('a');
1446
+ link.href = url;
1447
+ link.download = fileName;
1448
+ document.body.appendChild(link);
1449
+ link.click();
1450
+ document.body.removeChild(link);
1451
+ window.URL.revokeObjectURL(url);
1452
+ };
1453
+
1454
+ //sin uuid, codigo propio
1455
+ const generateId = () => {
1456
+ return Date.now().toString(36) + Math.random().toString(36).substring(2, 15);
1457
+ };
1458
+
1459
+ const formatNumber = (number) => {
1460
+ return new Intl.NumberFormat('es-CO', {
1461
+ minimumFractionDigits: 2,
1462
+ maximumFractionDigits: 2
1463
+ }).format(number);
1464
+ };
1465
+ const fixedNumber = (number) => {
1466
+ return Number(number.toFixed(2));
1467
+ };
1468
+
1469
+ const hasValues = (obj) => {
1470
+ return Object.values(obj).some(value => value !== null && value !== undefined);
1471
+ };
1472
+ /**
1473
+ * Elimina las propiedades de un objeto que tengan valores null o undefined.
1474
+ * Retorna un nuevo objeto sin mutar el original.
1475
+ * @param obj - Objeto del cual se eliminarán las propiedades null/undefined
1476
+ * @returns Nuevo objeto sin las propiedades con valores null o undefined
1477
+ */
1478
+ const removeNullUndefined = (obj) => {
1479
+ const result = {};
1480
+ Object.keys(obj).forEach(key => {
1481
+ const value = obj[key];
1482
+ if (value !== null && value !== undefined) {
1483
+ result[key] = value;
1484
+ }
1485
+ });
1486
+ return result;
1487
+ };
1488
+ /**
1489
+ * Realiza un upsert en un array de strings. Si el string ya existe, no hace nada.
1490
+ * Si no existe, lo agrega al array.
1491
+ * @param targetArray - Array de strings donde se realizará el upsert
1492
+ * @param value - String o array de strings a insertar
1493
+ * @returns Array actualizado con los nuevos valores
1494
+ */
1495
+ const upsertArrayStrings = (targetArray, value) => {
1496
+ // Crear una copia del array original para evitar mutaciones
1497
+ const result = [...targetArray];
1498
+ // Convertir el valor a array para procesamiento uniforme
1499
+ const valuesToInsert = Array.isArray(value) ? value : [value];
1500
+ // Procesar cada valor
1501
+ valuesToInsert.forEach(stringValue => {
1502
+ // Solo agregar si no existe en el array
1503
+ if (!result.includes(stringValue)) {
1504
+ result.push(stringValue);
1505
+ }
1506
+ });
1507
+ return result;
1508
+ };
1509
+ const sameArray = (arr1, arr2) => {
1510
+ if (arr1.length !== arr2.length)
1511
+ return false;
1512
+ const sorted1 = Array.from(arr1).sort();
1513
+ const sorted2 = Array.from(arr2).sort();
1514
+ return sorted1.every((item, index) => item === sorted2[index]);
1515
+ };
1516
+ const getOptionByCode = (options, code) => {
1517
+ if (!code)
1518
+ return undefined;
1519
+ return options.find((item) => item.code === code);
1520
+ };
1521
+ const createEnumeratedList = (items) => {
1522
+ if (items.length === 0) {
1523
+ return '';
1524
+ }
1525
+ if (items.length === 1) {
1526
+ return `1. ${items[0]}`;
1527
+ }
1528
+ return items
1529
+ .map((item, index) => `${index + 1}. ${item}`)
1530
+ .join('\n');
1531
+ };
1532
+
1533
+ class PrimeNgUtil {
1534
+ static isPrimeNgSelection(value) {
1535
+ return typeof value === 'object' && value !== null && 'name' in value && 'code' in value;
1536
+ }
1537
+ }
1538
+
1539
+ class BadgeNgComponent {
1540
+ config = model.required();
1541
+ get value() {
1542
+ return this.config().value;
1543
+ }
1544
+ get severity() {
1545
+ return this.config().severity;
1546
+ }
1547
+ get badgeSize() {
1548
+ return this.config().badgeSize ?? 'small';
1549
+ }
1550
+ get fullWidth() {
1551
+ return this.config().fullWidth ?? true;
1552
+ }
1553
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: BadgeNgComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1554
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.17", type: BadgeNgComponent, isStandalone: true, selector: "lib-badge-ng", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { config: "configChange" }, ngImport: i0, template: "<p-badge\r\n [style]=\"{\r\n textAlign: 'center',\r\n width: fullWidth ? '100%' : 'auto'\r\n }\"\r\n [value]=\"value\"\r\n [severity]=\"severity\"\r\n [badgeSize]=\"badgeSize\"\r\n/>\r\n", dependencies: [{ kind: "ngmodule", type: BadgeModule }, { kind: "component", type: i1$3.Badge, selector: "p-badge", inputs: ["styleClass", "style", "badgeSize", "size", "severity", "value", "badgeDisabled"] }] });
1555
+ }
1556
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: BadgeNgComponent, decorators: [{
1557
+ type: Component,
1558
+ args: [{ selector: 'lib-badge-ng', imports: [BadgeModule], template: "<p-badge\r\n [style]=\"{\r\n textAlign: 'center',\r\n width: fullWidth ? '100%' : 'auto'\r\n }\"\r\n [value]=\"value\"\r\n [severity]=\"severity\"\r\n [badgeSize]=\"badgeSize\"\r\n/>\r\n" }]
1559
+ }] });
1560
+
1561
+ class ToolbarNgComponent {
1562
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ToolbarNgComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1563
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: ToolbarNgComponent, isStandalone: true, selector: "lib-toolbar-ng", ngImport: i0, template: "<p-toolbar class=\"border-0 bg-transparent\">\r\n <ng-template pTemplate=\"start\">\r\n <ng-content select=\"[toolbarStart]\"></ng-content>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"center\">\r\n <ng-content select=\"[toolbarCenter]\"></ng-content>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"end\">\r\n <ng-content select=\"[toolbarEnd]\"></ng-content>\r\n </ng-template>\r\n</p-toolbar>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ToolbarModule }, { kind: "component", type: i1$4.Toolbar, selector: "p-toolbar", inputs: ["style", "styleClass", "ariaLabelledBy"] }, { kind: "directive", type: i4$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }] });
1564
+ }
1565
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ToolbarNgComponent, decorators: [{
1566
+ type: Component,
1567
+ args: [{ selector: 'lib-toolbar-ng', imports: [
1568
+ ToolbarModule
1569
+ ], template: "<p-toolbar class=\"border-0 bg-transparent\">\r\n <ng-template pTemplate=\"start\">\r\n <ng-content select=\"[toolbarStart]\"></ng-content>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"center\">\r\n <ng-content select=\"[toolbarCenter]\"></ng-content>\r\n </ng-template>\r\n\r\n <ng-template pTemplate=\"end\">\r\n <ng-content select=\"[toolbarEnd]\"></ng-content>\r\n </ng-template>\r\n</p-toolbar>\r\n" }]
1570
+ }] });
1571
+
1572
+ // services/dialog.service.ts
1573
+ class CustomDialogService {
1574
+ dialogRef;
1575
+ dialogService = inject(DialogService);
1576
+ constructor() { }
1577
+ open(component, options = {}) {
1578
+ const defaultConfig = {
1579
+ closable: true,
1580
+ header: options.header || '',
1581
+ width: options.width || '50%',
1582
+ height: options.height || 'auto',
1583
+ closeOnEscape: options.closeOnEscape ?? true,
1584
+ baseZIndex: options.baseZIndex || 10000,
1585
+ maximizable: options.maximizable ?? true,
1586
+ data: options.data || {},
1587
+ style: {
1588
+ borderRadius: '8px',
1589
+ ...options.style
1590
+ },
1591
+ modal: true
1592
+ };
1593
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
1594
+ this.dialogRef = this.dialogService.open(component, defaultConfig);
1595
+ return this.dialogRef;
1596
+ }
1597
+ close(result) {
1598
+ if (this.dialogRef) {
1599
+ this.dialogRef.close(result);
1600
+ }
1601
+ }
1602
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CustomDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1603
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CustomDialogService, providedIn: 'root' });
1604
+ }
1605
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CustomDialogService, decorators: [{
1606
+ type: Injectable,
1607
+ args: [{
1608
+ providedIn: 'root'
1609
+ }]
1610
+ }], ctorParameters: () => [] });
1611
+
1612
+ class BaseDialogComponent {
1613
+ destroy$ = new Subject();
1614
+ data;
1615
+ ref = inject(DynamicDialogRef);
1616
+ config = inject(DynamicDialogConfig);
1617
+ constructor() {
1618
+ this.data = this.config.data;
1619
+ }
1620
+ ngOnDestroy() {
1621
+ this.destroy$.next();
1622
+ this.destroy$.complete();
1623
+ }
1624
+ close(result) {
1625
+ this.ref.close(result);
1626
+ }
1627
+ dismiss() {
1628
+ this.ref.close({ success: false });
1629
+ }
1630
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: BaseDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1631
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: BaseDialogComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: '', isInline: true });
1632
+ }
1633
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: BaseDialogComponent, decorators: [{
1634
+ type: Component,
1635
+ args: [{
1636
+ standalone: true,
1637
+ template: ''
1638
+ }]
1639
+ }], ctorParameters: () => [] });
1640
+
1641
+ const pickListConstant = (e, element) => {
1642
+ if (e.id === element?.id) {
1643
+ e.isSelected = !e.isSelected;
1644
+ if (e.isSelected) {
1645
+ delete e.buttonConfig.variant;
1646
+ delete e.buttonConfig.raised;
1647
+ }
1648
+ else {
1649
+ e.buttonConfig.variant = 'outlined';
1650
+ e.buttonConfig.raised = true;
1651
+ }
1652
+ }
1653
+ };
1654
+
1655
+ class ContainerElementsComponent {
1656
+ cols = input(3);
1657
+ elements = model([]);
1658
+ severityButton = input('contrast');
1659
+ outputElements = output();
1660
+ constructor() {
1661
+ }
1662
+ ngOnInit() {
1663
+ this.elements.update((elements) => {
1664
+ elements.forEach((e) => {
1665
+ // Si e.isSelected es true, se elimina el variant y raised
1666
+ if (e.isSelected) {
1667
+ delete e.buttonConfig.variant;
1668
+ delete e.buttonConfig.raised;
1669
+ }
1670
+ else {
1671
+ e.buttonConfig.variant = 'outlined';
1672
+ e.buttonConfig.raised = true;
1673
+ }
1674
+ e.buttonConfig = {
1675
+ ...e.buttonConfig,
1676
+ fullWidth: true,
1677
+ fullHeight: true,
1678
+ hasStaticClick: true,
1679
+ severity: this.severityButton()
1680
+ };
1681
+ });
1682
+ return [...elements];
1683
+ });
1684
+ }
1685
+ containerClass = computed(() => 'w-[45%] flex flex-col shadow-md bg-white dark:bg-gray-800 rounded-xl h-full overflow-y-auto');
1686
+ titleClass = computed(() => 'text-lg font-bold self-center text-center');
1687
+ containerElementsClass = computed(() => `grid grid-cols-${this.cols() ?? 3} gap-2 p-2`);
1688
+ getButtonConfig(buttonConfig) {
1689
+ return { ...buttonConfig, fullWidth: true, severity: this.severityButton(), hasStaticClick: true };
1690
+ }
1691
+ onButtonClick(element) {
1692
+ this.elements.update((elements) => {
1693
+ elements.forEach((e) => {
1694
+ pickListConstant(e, element);
1695
+ });
1696
+ return [...elements];
1697
+ });
1698
+ this.outputElements.emit([...this.elements()]);
1699
+ }
1700
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ContainerElementsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1701
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: ContainerElementsComponent, isStandalone: true, selector: "lib-container-elements", inputs: { cols: { classPropertyName: "cols", publicName: "cols", isSignal: true, isRequired: false, transformFunction: null }, elements: { classPropertyName: "elements", publicName: "elements", isSignal: true, isRequired: false, transformFunction: null }, severityButton: { classPropertyName: "severityButton", publicName: "severityButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { elements: "elementsChange", outputElements: "outputElements" }, ngImport: i0, template: "<div class=\"h-full w-full\" [class]=\"containerClass()\">\r\n <div class=\"dynamic-grid\" [style.--grid-cols]=\"cols()\">\r\n @for (element of elements(); track element.id) {\r\n <div class=\"grid-item\">\r\n @if (element.buttonConfig) {\r\n <lib-button-ng [(buttonConfig)]=\"element.buttonConfig\" (onClick)=\"onButtonClick(element)\"></lib-button-ng>\r\n }\r\n </div>\r\n }\r\n </div>\r\n</div>", styles: [".dynamic-grid{display:grid;gap:.5rem;padding:.5rem;grid-template-columns:repeat(var(--grid-cols, 3),1fr)}.grid-item{border-radius:.375rem;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a}\n"], dependencies: [{ kind: "component", type: ButtonNgComponent, selector: "lib-button-ng", inputs: ["buttonConfig"], outputs: ["buttonConfigChange", "onClick"] }, { kind: "ngmodule", type: CommonModule }] });
1702
+ }
1703
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ContainerElementsComponent, decorators: [{
1704
+ type: Component,
1705
+ args: [{ selector: 'lib-container-elements', imports: [ButtonNgComponent, CommonModule], template: "<div class=\"h-full w-full\" [class]=\"containerClass()\">\r\n <div class=\"dynamic-grid\" [style.--grid-cols]=\"cols()\">\r\n @for (element of elements(); track element.id) {\r\n <div class=\"grid-item\">\r\n @if (element.buttonConfig) {\r\n <lib-button-ng [(buttonConfig)]=\"element.buttonConfig\" (onClick)=\"onButtonClick(element)\"></lib-button-ng>\r\n }\r\n </div>\r\n }\r\n </div>\r\n</div>", styles: [".dynamic-grid{display:grid;gap:.5rem;padding:.5rem;grid-template-columns:repeat(var(--grid-cols, 3),1fr)}.grid-item{border-radius:.375rem;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a}\n"] }]
1706
+ }], ctorParameters: () => [] });
1707
+
1708
+ class PickListComponent {
1709
+ constructor() {
1710
+ }
1711
+ ngOnInit() { }
1712
+ sourceElements = model([]);
1713
+ hasAnySourceElementSelected = computed(() => this.sourceElements().some(element => element.isSelected));
1714
+ targetElements = model([]);
1715
+ hasAnyTargetElementSelected = computed(() => this.targetElements().some(element => element.isSelected));
1716
+ config = input();
1717
+ outputElements = output();
1718
+ sourceSeverityButton = computed(() => this.config()?.sourceSeverityButton ?? 'secondary');
1719
+ targetSeverityButton = computed(() => this.config()?.targetSeverityButton ?? 'contrast');
1720
+ controlButtons = computed(() => [
1721
+ {
1722
+ label: '',
1723
+ icon: 'pi pi-angle-double-right',
1724
+ severity: this.sourceSeverityButton(),
1725
+ disabled: this.sourceElements().length === 0,
1726
+ tooltipConfig: {
1727
+ pTooltip: this.sourceElements().length === 0 ? 'No hay elementos' : 'Mover todos hacia la derecha',
1728
+ tooltipPosition: 'top'
1729
+ },
1730
+ onClick: () => {
1731
+ this.moveAllSourceToTarget();
1732
+ }
1733
+ },
1734
+ {
1735
+ label: '',
1736
+ icon: 'pi pi-angle-right',
1737
+ severity: this.sourceSeverityButton(),
1738
+ disabled: !this.hasAnySourceElementSelected(),
1739
+ tooltipConfig: {
1740
+ pTooltip: !this.hasAnySourceElementSelected() ? 'No hay elementos seleccionados' : 'Mover los elementos seleccionados hacia la derecha',
1741
+ tooltipPosition: 'top'
1742
+ },
1743
+ onClick: () => {
1744
+ this.moveSelectedSourceToTarget();
1745
+ }
1746
+ },
1747
+ {
1748
+ label: '',
1749
+ icon: 'pi pi-angle-double-left',
1750
+ severity: this.targetSeverityButton(),
1751
+ disabled: this.targetElements().length === 0,
1752
+ tooltipConfig: {
1753
+ pTooltip: this.targetElements().length === 0 ? 'No hay elementos' : 'Mover todos hacia la izquierda',
1754
+ tooltipPosition: 'top'
1755
+ },
1756
+ onClick: () => {
1757
+ this.moveAllTargetToSource();
1758
+ }
1759
+ },
1760
+ {
1761
+ label: '',
1762
+ icon: 'pi pi-angle-left',
1763
+ severity: this.targetSeverityButton(),
1764
+ disabled: !this.hasAnyTargetElementSelected(),
1765
+ tooltipConfig: {
1766
+ pTooltip: !this.hasAnyTargetElementSelected() ? 'No hay elementos seleccionados' : 'Mover los elementos seleccionados hacia la izquierda',
1767
+ tooltipPosition: 'top'
1768
+ },
1769
+ onClick: () => {
1770
+ this.moveSelectedTargetToSource();
1771
+ }
1772
+ }
1773
+ ]);
1774
+ /**
1775
+ * Mueve todos los elementos del sourceElements al targetElements,
1776
+ * convirtiendo su severidad para que coincida con targetSeverityButton
1777
+ */
1778
+ moveAllSourceToTarget() {
1779
+ const sourceElementsCopy = [...this.sourceElements()];
1780
+ if (sourceElementsCopy.length === 0) {
1781
+ return;
1782
+ }
1783
+ // Convertir los elementos para usar targetSeverityButton
1784
+ const convertedElements = sourceElementsCopy.map(element => {
1785
+ const convertedElement = {
1786
+ ...element,
1787
+ isSelected: false, // Limpiar selección
1788
+ buttonConfig: {
1789
+ ...element.buttonConfig,
1790
+ severity: this.targetSeverityButton(),
1791
+ variant: 'outlined',
1792
+ raised: true
1793
+ }
1794
+ };
1795
+ return convertedElement;
1796
+ });
1797
+ // Agregar elementos convertidos al target
1798
+ this.targetElements.update(currentTarget => [
1799
+ ...currentTarget,
1800
+ ...convertedElements
1801
+ ]);
1802
+ // Limpiar sourceElements
1803
+ this.sourceElements.set([]);
1804
+ this.handleOutputElements();
1805
+ }
1806
+ /**
1807
+ * Mueve todos los elementos del targetElements al sourceElements,
1808
+ * convirtiendo su severidad para que coincida con sourceSeverityButton
1809
+ */
1810
+ moveAllTargetToSource() {
1811
+ const targetElementsCopy = [...this.targetElements()];
1812
+ if (targetElementsCopy.length === 0) {
1813
+ return;
1814
+ }
1815
+ // Convertir los elementos para usar sourceSeverityButton
1816
+ const convertedElements = targetElementsCopy.map(element => {
1817
+ const convertedElement = {
1818
+ ...element,
1819
+ isSelected: false, // Limpiar selección
1820
+ buttonConfig: {
1821
+ ...element.buttonConfig,
1822
+ severity: this.sourceSeverityButton(),
1823
+ variant: 'outlined',
1824
+ raised: true
1825
+ }
1826
+ };
1827
+ return convertedElement;
1828
+ });
1829
+ // Agregar elementos convertidos al source
1830
+ this.sourceElements.update(currentSource => [
1831
+ ...currentSource,
1832
+ ...convertedElements
1833
+ ]);
1834
+ // Limpiar targetElements
1835
+ this.targetElements.set([]);
1836
+ this.handleOutputElements();
1837
+ }
1838
+ /**
1839
+ * Mueve los elementos seleccionados del sourceElements al targetElements,
1840
+ * ubicándolos en la primera posición y convirtiendo su severidad
1841
+ */
1842
+ moveSelectedSourceToTarget() {
1843
+ const selectedElements = this.sourceElements().filter(element => element.isSelected);
1844
+ const remainingElements = this.sourceElements().filter(element => !element.isSelected);
1845
+ if (selectedElements.length === 0) {
1846
+ return;
1847
+ }
1848
+ // Convertir los elementos seleccionados para usar targetSeverityButton
1849
+ const convertedElements = selectedElements.map(element => {
1850
+ const convertedElement = {
1851
+ ...element,
1852
+ isSelected: false, // Limpiar selección
1853
+ buttonConfig: {
1854
+ ...element.buttonConfig,
1855
+ severity: this.targetSeverityButton(),
1856
+ variant: 'outlined',
1857
+ raised: true
1858
+ }
1859
+ };
1860
+ return convertedElement;
1861
+ });
1862
+ // Agregar elementos convertidos al inicio de targetElements
1863
+ this.targetElements.update(currentTarget => [
1864
+ ...convertedElements,
1865
+ ...currentTarget
1866
+ ]);
1867
+ // Actualizar sourceElements sin los elementos seleccionados
1868
+ this.sourceElements.set(remainingElements);
1869
+ this.handleOutputElements();
1870
+ }
1871
+ /**
1872
+ * Mueve los elementos seleccionados del targetElements al sourceElements,
1873
+ * ubicándolos en la primera posición y convirtiendo su severidad
1874
+ */
1875
+ moveSelectedTargetToSource() {
1876
+ const selectedElements = this.targetElements().filter(element => element.isSelected);
1877
+ const remainingElements = this.targetElements().filter(element => !element.isSelected);
1878
+ if (selectedElements.length === 0) {
1879
+ return;
1880
+ }
1881
+ // Convertir los elementos seleccionados para usar sourceSeverityButton
1882
+ const convertedElements = selectedElements.map(element => {
1883
+ const convertedElement = {
1884
+ ...element,
1885
+ isSelected: false, // Limpiar selección
1886
+ buttonConfig: {
1887
+ ...element.buttonConfig,
1888
+ severity: this.sourceSeverityButton(),
1889
+ variant: 'outlined',
1890
+ raised: true
1891
+ }
1892
+ };
1893
+ return convertedElement;
1894
+ });
1895
+ // Agregar elementos convertidos al inicio de sourceElements
1896
+ this.sourceElements.update(currentSource => [
1897
+ ...convertedElements,
1898
+ ...currentSource
1899
+ ]);
1900
+ // Actualizar targetElements sin los elementos seleccionados
1901
+ this.targetElements.set(remainingElements);
1902
+ this.handleOutputElements();
1903
+ }
1904
+ handleOutputElements() {
1905
+ this.outputElements.emit({ sourceElements: this.sourceElements(), targetElements: this.targetElements() });
1906
+ }
1907
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: PickListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1908
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: PickListComponent, isStandalone: true, selector: "lib-pick-list", inputs: { sourceElements: { classPropertyName: "sourceElements", publicName: "sourceElements", isSignal: true, isRequired: false, transformFunction: null }, targetElements: { classPropertyName: "targetElements", publicName: "targetElements", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sourceElements: "sourceElementsChange", targetElements: "targetElementsChange", outputElements: "outputElements" }, ngImport: i0, template: "@let cols = config()?.cols ?? 3;\r\n@let sourceSeverityButton = config()?.sourceSeverityButton ?? 'secondary';\r\n@let targetSeverityButton = config()?.targetSeverityButton ?? 'contrast';\r\n<div class=\"flex gap-4 h-80 w-full bg-gray-100 dark:bg-gray-800 rounded-xl p-3\">\r\n <lib-container-elements id=\"source-container\" [cols]=\"cols\" class=\"w-full h-full\" [(elements)]=\"sourceElements\"\r\n #sourceContainer [severityButton]=\"sourceSeverityButton\"\r\n (outputElements)=\"handleOutputElements()\"></lib-container-elements>\r\n\r\n <div class=\"w-[10%] flex flex-col items-center justify-center gap-6 rounded-xl bg-gray-200 dark:bg-gray-800\">\r\n @for (button of controlButtons(); track $index) {\r\n <lib-button-ng [buttonConfig]=\"button\"></lib-button-ng>\r\n }\r\n </div>\r\n\r\n <lib-container-elements id=\"target-container\" [cols]=\"cols\" class=\"w-full h-full\" [(elements)]=\"targetElements\"\r\n #targetContainer [severityButton]=\"targetSeverityButton\"\r\n (outputElements)=\"handleOutputElements()\"></lib-container-elements>\r\n\r\n</div>", styles: [""], dependencies: [{ kind: "component", type: ButtonNgComponent, selector: "lib-button-ng", inputs: ["buttonConfig"], outputs: ["buttonConfigChange", "onClick"] }, { kind: "component", type: ContainerElementsComponent, selector: "lib-container-elements", inputs: ["cols", "elements", "severityButton"], outputs: ["elementsChange", "outputElements"] }] });
1909
+ }
1910
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: PickListComponent, decorators: [{
1911
+ type: Component,
1912
+ args: [{ selector: 'lib-pick-list', imports: [ButtonNgComponent, ContainerElementsComponent], template: "@let cols = config()?.cols ?? 3;\r\n@let sourceSeverityButton = config()?.sourceSeverityButton ?? 'secondary';\r\n@let targetSeverityButton = config()?.targetSeverityButton ?? 'contrast';\r\n<div class=\"flex gap-4 h-80 w-full bg-gray-100 dark:bg-gray-800 rounded-xl p-3\">\r\n <lib-container-elements id=\"source-container\" [cols]=\"cols\" class=\"w-full h-full\" [(elements)]=\"sourceElements\"\r\n #sourceContainer [severityButton]=\"sourceSeverityButton\"\r\n (outputElements)=\"handleOutputElements()\"></lib-container-elements>\r\n\r\n <div class=\"w-[10%] flex flex-col items-center justify-center gap-6 rounded-xl bg-gray-200 dark:bg-gray-800\">\r\n @for (button of controlButtons(); track $index) {\r\n <lib-button-ng [buttonConfig]=\"button\"></lib-button-ng>\r\n }\r\n </div>\r\n\r\n <lib-container-elements id=\"target-container\" [cols]=\"cols\" class=\"w-full h-full\" [(elements)]=\"targetElements\"\r\n #targetContainer [severityButton]=\"targetSeverityButton\"\r\n (outputElements)=\"handleOutputElements()\"></lib-container-elements>\r\n\r\n</div>" }]
1913
+ }], ctorParameters: () => [] });
1914
+
1915
+ class AdvancedFilterService {
1916
+ constructor() {
1917
+ // Effect para actualizar isSelected basado en los chips
1918
+ effect(() => {
1919
+ const chips = [...this.searchChips()];
1920
+ this.updateElementSelection(chips);
1921
+ });
1922
+ }
1923
+ configInlineInput = computed(() => ({
1924
+ typeInput: ETypeInput.CHIPS
1925
+ }));
1926
+ _searchChips = signal([]);
1927
+ searchChips = this._searchChips.asReadonly();
1928
+ setSearchChips(searchChips) {
1929
+ this._searchChips.set(searchChips);
1930
+ }
1931
+ setStringToArrayChips(searchValue) {
1932
+ this._searchChips.set(searchValue.split(' ').filter(chip => chip.trim() !== ''));
1933
+ }
1934
+ _sourceElements = signal([]);
1935
+ sourceElements = this._sourceElements.asReadonly();
1936
+ setSourceElements(sourceElements) {
1937
+ this._sourceElements.set(sourceElements);
1938
+ }
1939
+ configPickList = computed(() => ({
1940
+ cols: 3,
1941
+ sourceSeverityButton: 'contrast',
1942
+ targetSeverityButton: 'success'
1943
+ }));
1944
+ /**
1945
+ * Actualiza la selección de elementos basándose en los chips del input
1946
+ * @param chips Array de strings que representan los chips actuales
1947
+ */
1948
+ updateElementSelection(chips) {
1949
+ this._sourceElements.update(currentElements => {
1950
+ return currentElements.map((element) => {
1951
+ // Verificar si el label del elemento está en el array de chips
1952
+ const shouldBeSelected = chips.includes(element.buttonConfig?.label || '');
1953
+ if (shouldBeSelected) {
1954
+ delete element.buttonConfig.variant;
1955
+ delete element.buttonConfig.raised;
1956
+ }
1957
+ else {
1958
+ element.buttonConfig.variant = 'outlined';
1959
+ element.buttonConfig.raised = true;
1960
+ }
1961
+ return {
1962
+ ...element,
1963
+ isSelected: shouldBeSelected
1964
+ };
1965
+ });
1966
+ });
1967
+ }
1968
+ outputElements(event) {
1969
+ const { sourceElements } = event;
1970
+ this.setSourceElements(sourceElements);
1971
+ this.validateAndSyncChipsWithElements(sourceElements);
1972
+ }
1973
+ /**
1974
+ * Valida y sincroniza los chips con los elementos de sourceElements
1975
+ * @param sourceElements Array de elementos fuente
1976
+ */
1977
+ validateAndSyncChipsWithElements(sourceElements) {
1978
+ const currentChips = this._searchChips();
1979
+ if (sourceElements.length === 0) {
1980
+ this.setSearchChips([]);
1981
+ return;
1982
+ }
1983
+ const validChips = [];
1984
+ // Iterar sobre cada chip actual
1985
+ currentChips.forEach(chip => {
1986
+ // Buscar el elemento correspondiente en sourceElements
1987
+ const element = sourceElements.find(el => el.buttonConfig?.label === chip);
1988
+ if (element) {
1989
+ // Si la chip existe en sourceElements
1990
+ if (element.isSelected === false) {
1991
+ // Si la chip está en isSelected false, NO la incluimos en validChips (la eliminamos)
1992
+ return;
1993
+ }
1994
+ else {
1995
+ // Si la chip está seleccionada, la mantenemos
1996
+ validChips.push(chip);
1997
+ }
1998
+ }
1999
+ else {
2000
+ // Si la chip no está en sourceElements, NO la incluimos en validChips (la eliminamos)
2001
+ return;
2002
+ }
2003
+ });
2004
+ // Verificar si hay elementos seleccionados que no tienen chip correspondiente
2005
+ sourceElements.forEach(element => {
2006
+ if (element.isSelected && element.buttonConfig?.label) {
2007
+ const chipExists = currentChips.includes(element.buttonConfig.label);
2008
+ if (!chipExists) {
2009
+ // Si el elemento está seleccionado pero no tiene chip, agregamos la chip
2010
+ validChips.push(element.buttonConfig.label);
2011
+ }
2012
+ }
2013
+ });
2014
+ // Actualizar los chips solo si hay cambios
2015
+ if (JSON.stringify(validChips.sort()) !== JSON.stringify(currentChips.sort())) {
2016
+ this._searchChips.set(validChips);
2017
+ }
2018
+ }
2019
+ /**
2020
+ * Método público para establecer chips desde un array externo
2021
+ * Útil para gestionar las chips programáticamente
2022
+ * @param chipsArray Array de strings que representan las chips
2023
+ */
2024
+ setChipsFromArray(chipsArray) {
2025
+ if (!Array.isArray(chipsArray)) {
2026
+ console.warn('setChipsFromArray: El parámetro debe ser un array de strings');
2027
+ return;
2028
+ }
2029
+ // Filtrar elementos válidos (strings no vacíos)
2030
+ const validChips = chipsArray
2031
+ .filter(chip => typeof chip === 'string' && chip.trim() !== '')
2032
+ .map(chip => chip.trim());
2033
+ // Actualizar las chips
2034
+ this._searchChips.set(validChips);
2035
+ }
2036
+ /**
2037
+ * Método público para limpiar todas las chips
2038
+ */
2039
+ clearAllChips() {
2040
+ this._searchChips.set([]);
2041
+ }
2042
+ /**
2043
+ * Método público para agregar chips desde un array
2044
+ * Evita duplicados
2045
+ * @param chipsArray Array de strings a agregar
2046
+ */
2047
+ addChipsFromArray(chipsArray) {
2048
+ if (!Array.isArray(chipsArray)) {
2049
+ console.warn('addChipsFromArray: El parámetro debe ser un array de strings');
2050
+ return;
2051
+ }
2052
+ const currentChips = this._searchChips();
2053
+ // Filtrar elementos válidos y únicos
2054
+ const validChips = chipsArray
2055
+ .filter(chip => typeof chip === 'string' && chip.trim() !== '')
2056
+ .map(chip => chip.trim())
2057
+ .filter(chip => !currentChips.includes(chip));
2058
+ // Agregar las nuevas chips
2059
+ if (validChips.length > 0) {
2060
+ this._searchChips.set([...currentChips, ...validChips]);
2061
+ }
2062
+ }
2063
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AdvancedFilterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2064
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AdvancedFilterService, providedIn: 'root' });
2065
+ }
2066
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AdvancedFilterService, decorators: [{
2067
+ type: Injectable,
2068
+ args: [{
2069
+ providedIn: 'root'
2070
+ }]
2071
+ }], ctorParameters: () => [] });
2072
+
2073
+ class AdvancedFilterComponent {
2074
+ advancedFilterService = inject(AdvancedFilterService);
2075
+ sourceElements = model([]);
2076
+ targetElements = model([]);
2077
+ // Referencia al componente de inline input para gestionar las chips
2078
+ inlineInputComponent = viewChild('inlineInputRef');
2079
+ constructor() {
2080
+ // Sincronizar el service con el model del componente
2081
+ effect(() => {
2082
+ this.sourceElements.set(this.advancedFilterService.sourceElements());
2083
+ });
2084
+ // Efecto para sincronizar chips con el inline input
2085
+ effect(() => {
2086
+ const chips = this.advancedFilterService.searchChips();
2087
+ const inlineInput = this.inlineInputComponent();
2088
+ if (inlineInput && Array.isArray(chips)) {
2089
+ // Usar el nuevo método para establecer las chips
2090
+ inlineInput.setChipsFromArray(chips);
2091
+ }
2092
+ });
2093
+ }
2094
+ ngOnInit() {
2095
+ this.initializeChipsWhitSourceElementsSelected();
2096
+ this.advancedFilterService.setSourceElements(this.sourceElements());
2097
+ }
2098
+ initializeChipsWhitSourceElementsSelected() {
2099
+ this.advancedFilterService.setSearchChips(this.sourceElements()
2100
+ .filter((element) => element.isSelected)
2101
+ .map((element) => element.buttonConfig?.label?.toString() ?? ''));
2102
+ }
2103
+ get configInlineInput() {
2104
+ return this.advancedFilterService.configInlineInput();
2105
+ }
2106
+ valueChangeInlineInput(value) {
2107
+ this.advancedFilterService.setStringToArrayChips(value);
2108
+ }
2109
+ get configPickList() {
2110
+ return this.advancedFilterService.configPickList();
2111
+ }
2112
+ outputElements(event) {
2113
+ this.advancedFilterService.outputElements(event);
2114
+ }
2115
+ /**
2116
+ * Método público para establecer chips desde un array externo
2117
+ * @param chipsArray Array de strings que representan las chips
2118
+ */
2119
+ setChipsFromArray(chipsArray) {
2120
+ this.advancedFilterService.setChipsFromArray(chipsArray);
2121
+ }
2122
+ /**
2123
+ * Método público para limpiar todas las chips
2124
+ */
2125
+ clearAllChips() {
2126
+ this.advancedFilterService.clearAllChips();
2127
+ }
2128
+ /**
2129
+ * Método público para agregar chips desde un array
2130
+ * @param chipsArray Array de strings a agregar
2131
+ */
2132
+ addChipsFromArray(chipsArray) {
2133
+ this.advancedFilterService.addChipsFromArray(chipsArray);
2134
+ }
2135
+ /**
2136
+ * Método público para obtener las chips actuales como array
2137
+ * @returns Array de strings con las chips actuales
2138
+ */
2139
+ getChipsAsArray() {
2140
+ return this.advancedFilterService.searchChips();
2141
+ }
2142
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AdvancedFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2143
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.17", type: AdvancedFilterComponent, isStandalone: true, selector: "lib-advanced-filter", inputs: { sourceElements: { classPropertyName: "sourceElements", publicName: "sourceElements", isSignal: true, isRequired: false, transformFunction: null }, targetElements: { classPropertyName: "targetElements", publicName: "targetElements", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sourceElements: "sourceElementsChange", targetElements: "targetElementsChange" }, providers: [AdvancedFilterService], viewQueries: [{ propertyName: "inlineInputComponent", first: true, predicate: ["inlineInputRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex flex-col gap-4\">\r\n <lib-inline-input #inlineInputRef [config]=\"configInlineInput\" (valueChange)=\"valueChangeInlineInput($event)\">\r\n </lib-inline-input>\r\n <lib-pick-list [(sourceElements)]=\"sourceElements\" [(targetElements)]=\"targetElements\"\r\n (outputElements)=\"outputElements($event)\" [config]=\"configPickList\"></lib-pick-list>\r\n</div>", styles: [""], dependencies: [{ kind: "component", type: InlineInputComponent, selector: "lib-inline-input", inputs: ["config", "value"], outputs: ["valueChange", "outputValue", "outputBlur", "outputDebounced"] }, { kind: "component", type: PickListComponent, selector: "lib-pick-list", inputs: ["sourceElements", "targetElements", "config"], outputs: ["sourceElementsChange", "targetElementsChange", "outputElements"] }] });
2144
+ }
2145
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AdvancedFilterComponent, decorators: [{
2146
+ type: Component,
2147
+ args: [{ selector: 'lib-advanced-filter', imports: [InlineInputComponent, PickListComponent], providers: [AdvancedFilterService], template: "<div class=\"flex flex-col gap-4\">\r\n <lib-inline-input #inlineInputRef [config]=\"configInlineInput\" (valueChange)=\"valueChangeInlineInput($event)\">\r\n </lib-inline-input>\r\n <lib-pick-list [(sourceElements)]=\"sourceElements\" [(targetElements)]=\"targetElements\"\r\n (outputElements)=\"outputElements($event)\" [config]=\"configPickList\"></lib-pick-list>\r\n</div>" }]
2148
+ }], ctorParameters: () => [] });
2149
+
2150
+ class ModalAdvancedFilterComponent extends BaseDialogComponent {
2151
+ constructor() {
2152
+ super();
2153
+ }
2154
+ sourceElements = signal([]);
2155
+ targetElements = signal([]);
2156
+ ngOnInit() {
2157
+ if (this.data) {
2158
+ this.sourceElements.set(this.data.sourceElements ?? []);
2159
+ this.targetElements.set(this.data.targetElements ?? []);
2160
+ }
2161
+ }
2162
+ applyFiltersButton = computed(() => {
2163
+ return {
2164
+ label: 'Aplicar Filtros',
2165
+ severity: 'info',
2166
+ onClick: () => {
2167
+ this.close({ success: true, data: { sourceElements: this.sourceElements(), targetElements: this.targetElements() } });
2168
+ },
2169
+ disabled: this.targetElements().length === 0
2170
+ };
2171
+ });
2172
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ModalAdvancedFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2173
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: ModalAdvancedFilterComponent, isStandalone: true, selector: "lib-modal-advanced-filter", usesInheritance: true, ngImport: i0, template: "<div class=\"flex flex-col gap-4\">\r\n <lib-advanced-filter [(sourceElements)]=\"sourceElements\" [(targetElements)]=\"targetElements\"></lib-advanced-filter>\r\n <div class=\"flex justify-end\">\r\n <lib-button-ng [buttonConfig]=\"applyFiltersButton()\"></lib-button-ng>\r\n </div>\r\n</div>", styles: [""], dependencies: [{ kind: "component", type: AdvancedFilterComponent, selector: "lib-advanced-filter", inputs: ["sourceElements", "targetElements"], outputs: ["sourceElementsChange", "targetElementsChange"] }, { kind: "component", type: ButtonNgComponent, selector: "lib-button-ng", inputs: ["buttonConfig"], outputs: ["buttonConfigChange", "onClick"] }] });
2174
+ }
2175
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ModalAdvancedFilterComponent, decorators: [{
2176
+ type: Component,
2177
+ args: [{ selector: 'lib-modal-advanced-filter', imports: [AdvancedFilterComponent, ButtonNgComponent], template: "<div class=\"flex flex-col gap-4\">\r\n <lib-advanced-filter [(sourceElements)]=\"sourceElements\" [(targetElements)]=\"targetElements\"></lib-advanced-filter>\r\n <div class=\"flex justify-end\">\r\n <lib-button-ng [buttonConfig]=\"applyFiltersButton()\"></lib-button-ng>\r\n </div>\r\n</div>" }]
2178
+ }], ctorParameters: () => [] });
2179
+
2180
+ class TableNgEditService {
2181
+ editConfig = signal(undefined);
2182
+ keysNames = signal({});
2183
+ constructor() { }
2184
+ setEditConfig(editConfig) {
2185
+ this.editConfig.set(editConfig);
2186
+ }
2187
+ setKeysNames(keysNames) {
2188
+ this.keysNames.set(keysNames);
2189
+ }
2190
+ fb = inject(NonNullableFormBuilder);
2191
+ controls = computed(() => {
2192
+ const formValues = this.searchFormGroup().value;
2193
+ const controls = [
2194
+ {
2195
+ controlName: 'search',
2196
+ control: this.fb.control(formValues.search, { validators: [] }),
2197
+ typeInput: ETypeInput.TEXT,
2198
+ colSpan: 12,
2199
+ label: '-'
2200
+ }
2201
+ ];
2202
+ return controls;
2203
+ });
2204
+ searchFormGroup = signal(new FormGroup({}));
2205
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TableNgEditService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2206
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TableNgEditService, providedIn: 'root' });
2207
+ }
2208
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TableNgEditService, decorators: [{
2209
+ type: Injectable,
2210
+ args: [{
2211
+ providedIn: 'root'
2212
+ }]
2213
+ }], ctorParameters: () => [] });
2214
+
2215
+ class TableNgGeneralService {
2216
+ constructor() { }
2217
+ MOCK_EMPTY_DATE = new Date(1900, 0, 1);
2218
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TableNgGeneralService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2219
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TableNgGeneralService, providedIn: 'root' });
2220
+ }
2221
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TableNgGeneralService, decorators: [{
2222
+ type: Injectable,
2223
+ args: [{
2224
+ providedIn: 'root'
2225
+ }]
2226
+ }], ctorParameters: () => [] });
2227
+
2228
+ class TableNgService {
2229
+ tableNgGeneralService = inject(TableNgGeneralService);
2230
+ filterService = inject(FilterService);
2231
+ dialogService = inject(CustomDialogService);
2232
+ initialValue;
2233
+ constructor() {
2234
+ this.filterService.register('globalCustomFilter', (rowData, filter) => {
2235
+ if (!filter || filter.trim() === '')
2236
+ return true;
2237
+ const searchTerm = filter.toLowerCase();
2238
+ // Si es string
2239
+ if (typeof rowData === 'string') {
2240
+ return rowData.toLowerCase().includes(searchTerm);
2241
+ }
2242
+ // Si es array de botones
2243
+ if (Array.isArray(rowData)) {
2244
+ return rowData.some((button) => {
2245
+ const label = button.label || '';
2246
+ return label.toLowerCase().includes(searchTerm);
2247
+ });
2248
+ }
2249
+ return false;
2250
+ });
2251
+ /**
2252
+ * Filtro para arrays de strings que verifica si el valor contiene alguno de los strings del filtro.
2253
+ * Uso: dt.filter(['valor1', 'valor2'], 'nombreColumna', 'arrayStringFilter')
2254
+ * @param rowData - Puede ser un string o array de strings
2255
+ * @param filter - Array de strings para filtrar
2256
+ * @returns true si encuentra coincidencias parciales (case-insensitive)
2257
+ */
2258
+ this.filterService.register('arrayStringFilter', (rowData, filter) => {
2259
+ // Si no hay filtro o el filtro está vacío, mostrar todos los elementos
2260
+ if (!filter || !Array.isArray(filter) || filter.length === 0)
2261
+ return true;
2262
+ // Si rowData es null, undefined o vacío, no mostrar el elemento
2263
+ if (rowData == null || rowData === '')
2264
+ return false;
2265
+ // Si rowData es un string
2266
+ if (typeof rowData === 'string') {
2267
+ return filter.some(filterValue => rowData.toLowerCase().includes(filterValue.toLowerCase()));
2268
+ }
2269
+ // Si rowData es un array de strings
2270
+ if (Array.isArray(rowData)) {
2271
+ return rowData.some(dataValue => filter.some(filterValue => typeof dataValue === 'string' &&
2272
+ dataValue.toLowerCase().includes(filterValue.toLowerCase())));
2273
+ }
2274
+ // Para otros tipos de datos, convertir a string si es posible
2275
+ const stringValue = String(rowData);
2276
+ if (stringValue && stringValue !== 'undefined' && stringValue !== 'null') {
2277
+ return filter.some(filterValue => stringValue.toLowerCase().includes(filterValue.toLowerCase()));
2278
+ }
2279
+ return false;
2280
+ });
2281
+ /**
2282
+ * Filtro exacto para arrays de strings que verifica coincidencias exactas.
2283
+ * Uso: dt.filter(['valor1', 'valor2'], 'nombreColumna', 'arrayStringExactFilter')
2284
+ * @param rowData - Puede ser un string o array de strings
2285
+ * @param filter - Array de strings para filtrar
2286
+ * @returns true si encuentra coincidencias exactas (case-sensitive)
2287
+ */
2288
+ this.filterService.register('arrayStringExactFilter', (rowData, filter) => {
2289
+ if (!filter || !Array.isArray(filter) || filter.length === 0)
2290
+ return true;
2291
+ // Si rowData es null, undefined o vacío, no mostrar el elemento
2292
+ if (rowData == null || rowData === '')
2293
+ return false;
2294
+ // Si rowData es un string
2295
+ if (typeof rowData === 'string') {
2296
+ return filter.includes(rowData);
2297
+ }
2298
+ // Si rowData es un array de strings
2299
+ if (Array.isArray(rowData)) {
2300
+ return rowData.some(dataValue => filter.includes(dataValue));
2301
+ }
2302
+ // Para otros tipos de datos, convertir a string si es posible
2303
+ const stringValue = String(rowData);
2304
+ if (stringValue && stringValue !== 'undefined' && stringValue !== 'null') {
2305
+ return filter.includes(stringValue);
2306
+ }
2307
+ return false;
2308
+ });
2309
+ this.filterService.register('customIn', (rowData, filter) => {
2310
+ if (!filter || !Array.isArray(filter) || filter.length === 0)
2311
+ return true;
2312
+ // Si rowData es null, undefined o vacío, no mostrar el elemento
2313
+ if (rowData == null || rowData === '')
2314
+ return false;
2315
+ if (typeof rowData === 'string') {
2316
+ return filter.includes(rowData);
2317
+ }
2318
+ // Para otros tipos de datos, convertir a string si es posible
2319
+ const stringValue = String(rowData);
2320
+ if (stringValue && stringValue !== 'undefined' && stringValue !== 'null') {
2321
+ return filter.includes(stringValue);
2322
+ }
2323
+ return false;
2324
+ });
2325
+ }
2326
+ get MOCK_EMPTY_DATE() {
2327
+ return this.tableNgGeneralService.MOCK_EMPTY_DATE;
2328
+ }
2329
+ setInitialValue(data) {
2330
+ this.initialValue = data;
2331
+ }
2332
+ //#region SORT
2333
+ customSort(event) {
2334
+ let field = undefined;
2335
+ let order = undefined;
2336
+ switch (event.mode) {
2337
+ case 'single':
2338
+ field = event.field;
2339
+ order = event.order;
2340
+ break;
2341
+ case 'multiple': {
2342
+ const multiSortMeta = event.multiSortMeta ?? [];
2343
+ const sortMeta = multiSortMeta[0];
2344
+ field = sortMeta?.field ?? undefined;
2345
+ order = sortMeta?.order ?? undefined;
2346
+ break;
2347
+ }
2348
+ default:
2349
+ break;
2350
+ }
2351
+ if (!field || order === undefined)
2352
+ return;
2353
+ const data = event.data ?? [];
2354
+ if (order === 0) {
2355
+ // Sin sorting - restaurar orden original
2356
+ data.splice(0, data.length, ...this.initialValue);
2357
+ }
2358
+ else {
2359
+ // Aplicar sorting
2360
+ data.sort((a, b) => {
2361
+ const valueA = this.getFieldValue(a, field);
2362
+ const valueB = this.getFieldValue(b, field);
2363
+ const result = this.compareValues(valueA, valueB);
2364
+ return order * result; // 1 para ASC, -1 para DESC
2365
+ });
2366
+ }
2367
+ }
2368
+ getFieldValue(item, field) {
2369
+ const rawValue = item.rowData[field];
2370
+ // Si es un array (probablemente IButtonConfig[])
2371
+ if (Array.isArray(rawValue) && rawValue.length > 0) {
2372
+ // Verificar si tenemos configuración de sorting para este campo
2373
+ const buttonKeyToSort = item.sortConfig?.buttonKeyToSort?.[field];
2374
+ if (buttonKeyToSort) {
2375
+ // Usar la primera configuración de botón del array
2376
+ const firstButton = rawValue[0];
2377
+ return firstButton[buttonKeyToSort];
2378
+ }
2379
+ // Si no hay configuración, intentar usar 'label' por defecto
2380
+ const firstButton = rawValue[0];
2381
+ return firstButton.label || '';
2382
+ }
2383
+ // Si es un string o cualquier otro tipo
2384
+ return rawValue;
2385
+ }
2386
+ compareValues(a, b) {
2387
+ // Manejar valores null/undefined
2388
+ if (a == null && b == null)
2389
+ return 0;
2390
+ if (a == null)
2391
+ return -1;
2392
+ if (b == null)
2393
+ return 1;
2394
+ // Si ambos son strings, usar localeCompare para mejor sorting
2395
+ if (typeof a === 'string' && typeof b === 'string') {
2396
+ return a.toLowerCase().localeCompare(b.toLowerCase());
2397
+ }
2398
+ // Si ambos son números
2399
+ if (typeof a === 'number' && typeof b === 'number') {
2400
+ return a - b;
2401
+ }
2402
+ // Si ambos son booleanos
2403
+ if (typeof a === 'boolean' && typeof b === 'boolean') {
2404
+ return a === b ? 0 : a ? 1 : -1;
2405
+ }
2406
+ // Si son fechas
2407
+ if (a instanceof Date && b instanceof Date) {
2408
+ return a.getTime() - b.getTime();
2409
+ }
2410
+ // Para otros tipos, convertir a string y comparar
2411
+ const strA = String(a).toLowerCase();
2412
+ const strB = String(b).toLowerCase();
2413
+ return strA.localeCompare(strB);
2414
+ }
2415
+ //#endregion
2416
+ //#region Global Filter
2417
+ fb = inject(NonNullableFormBuilder);
2418
+ controls = computed(() => {
2419
+ const formValues = this.searchFormGroup().value;
2420
+ const controls = [
2421
+ {
2422
+ controlName: 'search',
2423
+ control: this.fb.control(formValues.search, { validators: [] }),
2424
+ typeInput: ETypeInput.TEXT,
2425
+ colSpan: 12,
2426
+ label: 'Buscar'
2427
+ }
2428
+ ];
2429
+ return controls;
2430
+ });
2431
+ searchFormGroup = signal(new FormGroup({}));
2432
+ values = toSignal(this.searchFormGroup().valueChanges);
2433
+ submitGlobalSearch(formGroup, dt) {
2434
+ const search = formGroup.value.search ?? '';
2435
+ dt.filterGlobal(search, 'globalCustomFilter');
2436
+ }
2437
+ clearSearchInput() {
2438
+ this.searchFormGroup().get('search')?.setValue('');
2439
+ }
2440
+ //#endregion
2441
+ //#region Selection
2442
+ async openModalManagementSelectedItems(selectedItems, config) {
2443
+ const { SelectedItemsManagementComponent } = await import('./ln-20-lib-components-selected-items-management.component-CHuW-NSi.mjs');
2444
+ let configSelectedItems = config;
2445
+ if (config) {
2446
+ configSelectedItems = structuredClone(config);
2447
+ delete configSelectedItems.lazyLoadingConfig;
2448
+ const selectionTableConfig = {
2449
+ ...(configSelectedItems.selectionTableConfig ?? {}),
2450
+ showManagementConfig: false
2451
+ };
2452
+ const globalFilterConfig = {
2453
+ ...(configSelectedItems.globalFilterConfig ?? {}),
2454
+ advancedIdentifierFiltersConfig: {
2455
+ isEnabled: false
2456
+ }
2457
+ };
2458
+ configSelectedItems.globalFilterConfig = globalFilterConfig;
2459
+ configSelectedItems.selectionTableConfig = selectionTableConfig;
2460
+ }
2461
+ const ref = this.dialogService?.open(SelectedItemsManagementComponent, {
2462
+ header: 'Gestionar Seleccionados',
2463
+ data: {
2464
+ selectedItems: selectedItems(),
2465
+ config: configSelectedItems
2466
+ },
2467
+ width: '90%',
2468
+ height: '90%',
2469
+ styleClass: 'overflow-hidden'
2470
+ });
2471
+ ref.onClose.subscribe((selectedReturnItems) => {
2472
+ if (selectedReturnItems) {
2473
+ selectedItems.set(selectedReturnItems);
2474
+ }
2475
+ });
2476
+ }
2477
+ //#endregion
2478
+ //#region Custom Filter
2479
+ //#endregion
2480
+ excelButton = computed(() => {
2481
+ return {
2482
+ label: '',
2483
+ icon: 'fa-solid fa-file-excel',
2484
+ variant: 'text',
2485
+ severity: 'success',
2486
+ raised: true,
2487
+ size: 'large',
2488
+ tooltipConfig: {
2489
+ pTooltip: this.config()?.labelsConfig?.exportExcelTooltip ?? 'Exportar a Excel',
2490
+ tooltipPosition: 'top'
2491
+ }
2492
+ };
2493
+ });
2494
+ pdfButton = computed(() => {
2495
+ return {
2496
+ label: '',
2497
+ icon: 'fa-solid fa-file-pdf',
2498
+ variant: 'text',
2499
+ severity: 'danger',
2500
+ raised: true,
2501
+ size: 'large',
2502
+ tooltipConfig: {
2503
+ pTooltip: this.config()?.labelsConfig?.exportPdfTooltip ?? 'Exportar a PDF',
2504
+ tooltipPosition: 'top'
2505
+ }
2506
+ };
2507
+ });
2508
+ refreshButton = computed(() => {
2509
+ return {
2510
+ label: '',
2511
+ icon: 'fa-solid fa-refresh',
2512
+ variant: 'text',
2513
+ severity: 'info',
2514
+ raised: true,
2515
+ size: 'large',
2516
+ onClick: () => {
2517
+ this.refreshTable();
2518
+ },
2519
+ tooltipConfig: {
2520
+ pTooltip: this.config()?.labelsConfig?.refreshTooltip ?? 'Refrescar',
2521
+ tooltipPosition: 'top'
2522
+ },
2523
+ loading: this.isLoadingRefreshButton(),
2524
+ disabled: this.isLoadingRefreshButton(),
2525
+ };
2526
+ });
2527
+ refreshTable() {
2528
+ if (this.refreshConfig()) {
2529
+ this.refreshConfig()?.callback();
2530
+ }
2531
+ }
2532
+ _config = signal(undefined);
2533
+ config = this._config.asReadonly();
2534
+ setConfig(value) {
2535
+ this._config.set(value);
2536
+ }
2537
+ refreshConfig = computed(() => {
2538
+ return this.config()?.refreshConfig;
2539
+ });
2540
+ enableRefreshButton = computed(() => {
2541
+ return this.refreshConfig()?.isEnabled ?? false;
2542
+ });
2543
+ isLoadingRefreshButton = computed(() => {
2544
+ return this.refreshConfig()?.isLoading ?? false;
2545
+ });
2546
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TableNgService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2547
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TableNgService, providedIn: 'root' });
2548
+ }
2549
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TableNgService, decorators: [{
2550
+ type: Injectable,
2551
+ args: [{
2552
+ providedIn: 'root'
2553
+ }]
2554
+ }], ctorParameters: () => [] });
2555
+
2556
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
2557
+ class TableNgComponent {
2558
+ tableNgService = inject(TableNgService);
2559
+ tableNgEditService = inject(TableNgEditService);
2560
+ dialogService = inject(CustomDialogService);
2561
+ data = model.required();
2562
+ // Loading state management
2563
+ loadingTimeout = null;
2564
+ isLoading = signal(false);
2565
+ timeoutExpired = signal(false);
2566
+ config = model();
2567
+ editConfig = model();
2568
+ footerConfig = model();
2569
+ toolbarButtons = model([]);
2570
+ toolbarSpeedDialButtons = model([]);
2571
+ sourceElements = model([]);
2572
+ targetElements = model([]);
2573
+ httpMessage = model();
2574
+ lazyLoading = output();
2575
+ outputChangeData = output();
2576
+ outputHandleEditInitButton = output();
2577
+ outputAddRow = output();
2578
+ outputDeleteRow = output();
2579
+ outputRowInlineChange = output();
2580
+ outputRowDataChange = output();
2581
+ outputEditData = output();
2582
+ outputIsEditing = output();
2583
+ resetData() {
2584
+ this.data.set([]);
2585
+ }
2586
+ advancedFiltersPerformed = [];
2587
+ advancedFiltersValues = signal({});
2588
+ dt;
2589
+ fb = inject(NonNullableFormBuilder);
2590
+ //#region Labels Configuration
2591
+ /** Get pagination report template with default English value */
2592
+ getCustomPageReport() {
2593
+ return this.config()?.labelsConfig?.customPageReport ?? 'Showing {first} to {last} of {totalRecords} entries';
2594
+ }
2595
+ /** Get selected items label with default English value */
2596
+ getSelectedItemsLabel() {
2597
+ return this.config()?.labelsConfig?.selectedItemsLabel ?? 'You have selected';
2598
+ }
2599
+ /** Get records label with default English value */
2600
+ getRecordsLabel() {
2601
+ return this.config()?.labelsConfig?.recordsLabel ?? 'records';
2602
+ }
2603
+ /** Get loading message with default English value */
2604
+ getLoadingMessage() {
2605
+ return this.config()?.labelsConfig?.loadingMessage ?? 'Loading...';
2606
+ }
2607
+ /** Get no data message with default English value */
2608
+ getNoDataMessage() {
2609
+ return this.config()?.labelsConfig?.noDataMessage ?? 'No information available';
2610
+ }
2611
+ //#endregion
2612
+ constructor() {
2613
+ this.tableNgEditService.setEditConfig(this.editConfig());
2614
+ this.tableNgEditService.setKeysNames(this.config()?.keysNames ?? {});
2615
+ // Effect para sincronizar el config con el servicio cuando cambie
2616
+ effect(() => {
2617
+ const configValue = this.config();
2618
+ if (configValue) {
2619
+ this.tableNgService.setConfig(configValue);
2620
+ }
2621
+ });
2622
+ effect(() => {
2623
+ this.outputChangeData.emit([...this.data()]);
2624
+ });
2625
+ // Effect para gestionar el loading basado en el estado de data
2626
+ effect(() => {
2627
+ const currentData = this.data();
2628
+ // Limpiar el timeout anterior si existe
2629
+ if (this.loadingTimeout) {
2630
+ clearTimeout(this.loadingTimeout);
2631
+ this.loadingTimeout = null;
2632
+ }
2633
+ if (currentData.length === 0) {
2634
+ // Si data está vacío, activar loading
2635
+ this.isLoading.set(true);
2636
+ this.loadingTimeout = setTimeout(() => {
2637
+ if (this.data().length === 0) {
2638
+ this.isLoading.set(false);
2639
+ this.timeoutExpired.set(true);
2640
+ }
2641
+ }, 0);
2642
+ }
2643
+ else {
2644
+ // Si hay data, desactivar loading y resetear timeout
2645
+ this.isLoading.set(false);
2646
+ this.timeoutExpired.set(false);
2647
+ }
2648
+ });
2649
+ }
2650
+ ngOnInit() {
2651
+ this.tableNgService.setInitialValue([...this.data()]);
2652
+ }
2653
+ ngOnDestroy() {
2654
+ // Limpiar el timeout al destruir el componente
2655
+ if (this.loadingTimeout) {
2656
+ clearTimeout(this.loadingTimeout);
2657
+ this.loadingTimeout = null;
2658
+ }
2659
+ }
2660
+ get hideToolbar() { return this.config()?.hideToolbar ?? false; }
2661
+ /**
2662
+ * Calcula el número total de columnas para el colspan del mensaje vacío
2663
+ */
2664
+ totalColumns = computed(() => {
2665
+ const selectedColumns = this.config()?.selectedColumns ?? [];
2666
+ const baseColumns = selectedColumns.length > 0 ? selectedColumns.length : this.keys().length;
2667
+ const selectionColumn = this.config()?.selectionTableConfig?.isEnabled ? 1 : 0;
2668
+ const expansionColumn = this.config()?.rowExpansionConfig?.isEnabled ? 1 : 0;
2669
+ const editColumn = (this.editConfig()?.type === 'row' || this.editConfig()?.type === 'cell') && this.editConfig()?.isEnabled ? 1 : 0;
2670
+ return baseColumns + selectionColumn + expansionColumn + editColumn;
2671
+ });
2672
+ isPrimeNgSelection(value) {
2673
+ return PrimeNgUtil.isPrimeNgSelection(value);
2674
+ }
2675
+ hasErrorValues(object) {
2676
+ return Object.keys(object).length > 0;
2677
+ }
2678
+ rowFieldsValue = signal({});
2679
+ rowFieldsHasValue = computed(() => {
2680
+ return Object.keys(this.rowFieldsValue()).reduce((acc, key) => {
2681
+ acc[key] = !!this.rowFieldsValue()[key];
2682
+ return acc;
2683
+ }, {});
2684
+ });
2685
+ inlineChange(value, key) {
2686
+ this.rowFieldsValue.update((prev) => {
2687
+ return { ...prev, [key]: value };
2688
+ });
2689
+ this.outputRowInlineChange.emit({ ...this.rowFieldsValue() });
2690
+ }
2691
+ trackById(index, item) {
2692
+ return item.id;
2693
+ }
2694
+ frozenHandle(value) {
2695
+ return value ? value : false;
2696
+ }
2697
+ isDate(value) {
2698
+ return value instanceof Date;
2699
+ }
2700
+ onFilter(event) {
2701
+ const filters = event.filters;
2702
+ if (!filters)
2703
+ return;
2704
+ const global = filters['global'];
2705
+ if (!global?.['value']) {
2706
+ this.handleAdvancedFiltersPerformed(filters);
2707
+ }
2708
+ }
2709
+ resetRowDatas() {
2710
+ this.data.update((data) => {
2711
+ return data.map((item) => {
2712
+ return {
2713
+ ...item,
2714
+ rowData: {}
2715
+ };
2716
+ });
2717
+ });
2718
+ }
2719
+ get ETypeInput() {
2720
+ return ETypeInput;
2721
+ }
2722
+ handleAdvancedFiltersPerformed(filters) {
2723
+ if (!filters)
2724
+ return;
2725
+ const entriesFilters = Object.entries(filters);
2726
+ const keysColumn = this.config()?.keys ?? [];
2727
+ entriesFilters.forEach(([key, value]) => {
2728
+ const valueArray = value;
2729
+ const hasValue = !!valueArray[0]?.value;
2730
+ const keyColumn = key.split('.')[1];
2731
+ if (keysColumn.includes(keyColumn)) {
2732
+ const index = this.advancedFiltersPerformed.indexOf(keyColumn);
2733
+ if (hasValue && index === -1) {
2734
+ // Agregar si no existe
2735
+ this.advancedFiltersPerformed.push(keyColumn);
2736
+ }
2737
+ else if (!hasValue && index !== -1) {
2738
+ // Quitar si ya no tiene valor
2739
+ this.advancedFiltersPerformed.splice(index, 1);
2740
+ }
2741
+ }
2742
+ });
2743
+ }
2744
+ numberOfRecords = computed(() => {
2745
+ return this.data().length ?? 0;
2746
+ });
2747
+ hasRecords = computed(() => {
2748
+ return this.numberOfRecords() > 0;
2749
+ });
2750
+ /**
2751
+ * Computed que valida si al menos una fila tiene datos válidos en rowData.
2752
+ * Retorna true si al menos una fila tiene un valor que no sea '', null o undefined.
2753
+ * Retorna false si todas las filas tienen valores vacíos, null o undefined.
2754
+ */
2755
+ hasValidRowData = computed(() => {
2756
+ const data = this.data();
2757
+ return data.some(item => {
2758
+ if (!item?.rowData || typeof item.rowData !== 'object') {
2759
+ return false;
2760
+ }
2761
+ const values = Object.values(item.rowData);
2762
+ // Verificar si al menos un valor es válido (no vacío, null o undefined)
2763
+ return values.some(value => {
2764
+ if (value === null || value === undefined || value === '') {
2765
+ return false;
2766
+ }
2767
+ // Si es string, verificar que no esté vacío después de trim
2768
+ if (typeof value === 'string') {
2769
+ return value.trim() !== '';
2770
+ }
2771
+ // Para otros tipos (números, fechas, booleanos, etc.)
2772
+ return true;
2773
+ });
2774
+ });
2775
+ });
2776
+ keys = computed(() => {
2777
+ return this.config()?.keys ?? [];
2778
+ });
2779
+ onRowClick(item) {
2780
+ item.onClick();
2781
+ }
2782
+ //#region Scroll Config
2783
+ scrollHeight = computed(() => {
2784
+ const scrollHeightInitial = this.config()?.scrollConfig?.scrollHeight ?? '58vh';
2785
+ let res = scrollHeightInitial;
2786
+ if (this.showBottomToolbar()) {
2787
+ const { number: size, unit } = this.parseValue(scrollHeightInitial);
2788
+ res = `${size - 7.6}${unit}`;
2789
+ }
2790
+ return res;
2791
+ });
2792
+ parseValue(str) {
2793
+ const match = str.match(/^(-?\d+\.?\d*)(.*)$/);
2794
+ if (match) {
2795
+ return {
2796
+ number: parseFloat(match[1]),
2797
+ unit: match[2]
2798
+ };
2799
+ }
2800
+ return { number: 0, unit: '' };
2801
+ }
2802
+ //#endregion
2803
+ //#region Paginator Config
2804
+ paginatorStyleClass = computed(() => {
2805
+ if (this.showBottomToolbar()) {
2806
+ return 'p-datatable-paginator p-datatable-paginator-bottom sticky bottom-18 z-10';
2807
+ }
2808
+ return 'p-datatable-paginator p-datatable-paginator-bottom sticky bottom-2 z-10';
2809
+ });
2810
+ //#endregion
2811
+ //#region toolbar config
2812
+ showBottomToolbar = computed(() => {
2813
+ return this.showManagementSelectionConfig();
2814
+ });
2815
+ //#endregion
2816
+ //#region Clear Filters
2817
+ clearFilters() {
2818
+ this.tableNgService.clearSearchInput();
2819
+ this.advancedFiltersPerformed = [];
2820
+ this.advancedFiltersValues.set({});
2821
+ this.dt.clear();
2822
+ this.targetElements.set([]);
2823
+ this.handleTableValueToSourceElements();
2824
+ this.selectedItems.set([]);
2825
+ }
2826
+ get filteredValue() {
2827
+ return !!this.dt?.filteredValue && this.dt.filteredValue.length > 0;
2828
+ }
2829
+ clearFiltersButton = computed(() => {
2830
+ return {
2831
+ icon: 'fa-solid fa-filter-circle-xmark',
2832
+ rounded: true,
2833
+ raised: true,
2834
+ severity: 'contrast',
2835
+ tooltipConfig: {
2836
+ pTooltip: 'Limpiar filtros'
2837
+ },
2838
+ onClick: () => {
2839
+ this.clearFilters();
2840
+ }
2841
+ };
2842
+ });
2843
+ //#endregion
2844
+ //#region Global Filter
2845
+ get controlsGlobalFilter() {
2846
+ return this.tableNgService.controls();
2847
+ }
2848
+ get searchFormGroupGlobalFilter() {
2849
+ return this.tableNgService.searchFormGroup();
2850
+ }
2851
+ submitGlobalSearch(formGroup) {
2852
+ this.dt.globalFilterFields = this.config()?.globalFilterConfig?.globalFilterFields ?? [];
2853
+ this.tableNgService.submitGlobalSearch(formGroup, this.dt);
2854
+ }
2855
+ //#endregion
2856
+ //#region SORT
2857
+ customSort(event) {
2858
+ this.tableNgService.customSort(event);
2859
+ }
2860
+ //#endregion
2861
+ //#region Selection
2862
+ selectedItems = model([]);
2863
+ totalItemsSelected = computed(() => this.selectedItems().length);
2864
+ showManagementSelectionConfig = computed(() => this.totalItemsSelected() > 0 && (this.config()?.selectionTableConfig?.showManagementConfig ?? false));
2865
+ buttonTotalItemsSelected = computed(() => {
2866
+ return {
2867
+ label: this.totalItemsSelected().toLocaleString(),
2868
+ variant: 'text',
2869
+ rounded: true
2870
+ };
2871
+ });
2872
+ showSelectedItemsManagementButton = computed(() => {
2873
+ return {
2874
+ icon: 'fa-solid fa-eye',
2875
+ rounded: true,
2876
+ variant: 'text',
2877
+ severity: 'secondary',
2878
+ onClick: () => {
2879
+ this.openModalManagementSelectedItems();
2880
+ }
2881
+ };
2882
+ });
2883
+ openModalManagementSelectedItems() {
2884
+ this.tableNgService.openModalManagementSelectedItems(this.selectedItems, this.config())
2885
+ .then(() => { })
2886
+ .catch(() => { });
2887
+ }
2888
+ //#endregion
2889
+ //#region Custom Filter
2890
+ inlineFormChanges(inlineValue, filter, typeInput, key) {
2891
+ const lazyLoadingConfig = this.config()?.lazyLoadingConfig;
2892
+ if (typeInput === ETypeInput.MULTISELECT) {
2893
+ const options = inlineValue ? inlineValue : undefined;
2894
+ const arrayValue = options ? options.map((data) => lazyLoadingConfig?.isEnabled ? data.code : data.name) : undefined;
2895
+ if (Array.isArray(arrayValue) && arrayValue.length === 0) {
2896
+ if (key) {
2897
+ this.advancedFiltersValues.update((prev) => {
2898
+ const { [key]: _value, ...rest } = prev;
2899
+ return { ...rest };
2900
+ });
2901
+ }
2902
+ }
2903
+ if (inlineValue && (Array.isArray(arrayValue) && arrayValue.length > 0)) {
2904
+ filter(arrayValue);
2905
+ }
2906
+ }
2907
+ }
2908
+ formChanges(formValue, filter, key) {
2909
+ if (Array.isArray(formValue['multiSelect'])) {
2910
+ this.advancedFiltersValues.update((prev) => {
2911
+ return { ...prev, [key]: formValue };
2912
+ });
2913
+ }
2914
+ if (!Array.isArray(formValue['multiSelect']) && this.advancedFiltersValues()?.[key]) {
2915
+ this.advancedFiltersValues.update((prev) => {
2916
+ const { [key]: _value, ...rest } = prev;
2917
+ return { ...rest };
2918
+ });
2919
+ }
2920
+ const arrayValue = Array.isArray(formValue['multiSelect'])
2921
+ ? formValue['multiSelect'].map((data) => data.code)
2922
+ : [];
2923
+ if (arrayValue.length > 0) {
2924
+ filter(arrayValue);
2925
+ }
2926
+ }
2927
+ rowDataKey(key) {
2928
+ return `rowData.${key}`;
2929
+ }
2930
+ //#endregion
2931
+ //#region Lazy Loading
2932
+ onLazyLoad(event) {
2933
+ const filters = event.filters ?? {};
2934
+ const filtersWithValue = this.getFiltersWithValue(filters);
2935
+ const metaPagination = {};
2936
+ if (event.first) {
2937
+ metaPagination.skip = event.first;
2938
+ }
2939
+ if (event.rows) {
2940
+ metaPagination.limit = event.rows;
2941
+ }
2942
+ if (event.sortOrder) {
2943
+ metaPagination.sortOrder = event.sortOrder === 1 ? 'ASC' : 'DESC';
2944
+ }
2945
+ if (event.sortField) {
2946
+ metaPagination.sortBy = event.sortField;
2947
+ }
2948
+ const lazyLoadResponse = {
2949
+ filters: filtersWithValue,
2950
+ metaPagination
2951
+ };
2952
+ this.lazyLoading.emit(lazyLoadResponse);
2953
+ }
2954
+ getFiltersWithValue(filters) {
2955
+ const result = {};
2956
+ Object.entries(filters).forEach(([key, filter]) => {
2957
+ const keyColumn = key.split('.')[1];
2958
+ if (!filter)
2959
+ return;
2960
+ if (Array.isArray(filter)) {
2961
+ // Si es un array, filtrar solo los elementos que tienen value
2962
+ const filtersWithValue = filter.filter(f => f.value !== undefined && f.value !== null && f.value !== '');
2963
+ if (filtersWithValue.length > 0) {
2964
+ result[keyColumn] = filtersWithValue;
2965
+ }
2966
+ }
2967
+ else {
2968
+ // Si es un objeto único, verificar si tiene value
2969
+ if (filter.value !== undefined && filter.value !== null && filter.value !== '') {
2970
+ result[keyColumn] = filter;
2971
+ }
2972
+ }
2973
+ });
2974
+ return result;
2975
+ }
2976
+ //#endregion
2977
+ //#region Edit
2978
+ onCellValueChange() {
2979
+ this.updateDataWithTableValue();
2980
+ }
2981
+ onRowDataChange(_data) {
2982
+ }
2983
+ onEditData() {
2984
+ this.updateDataWithTableValue();
2985
+ this.outputEditData.emit([...this.data()]);
2986
+ }
2987
+ get controlsEdit() {
2988
+ return this.tableNgEditService.controls();
2989
+ }
2990
+ get searchFormGroupEdit() {
2991
+ return this.tableNgEditService.searchFormGroup();
2992
+ }
2993
+ customControlConfig(key, value) {
2994
+ return {
2995
+ controlName: key,
2996
+ control: this.fb.control(value),
2997
+ typeInput: ETypeInput.TEXT
2998
+ };
2999
+ }
3000
+ cellFormGroup = this.fb.group({});
3001
+ //#region Row
3002
+ addRowButton = computed(() => {
3003
+ const editConfig = this.editConfig();
3004
+ const isDisabled = editConfig?.type === 'cell'
3005
+ ? (editConfig?.cellEditConfig?.isDisabledAddButton ?? false)
3006
+ : (editConfig?.rowEditConfig?.isDisabledAddButton ?? false) || this.hasRowInEdit;
3007
+ const button = {
3008
+ icon: 'fa-solid fa-plus',
3009
+ rounded: true,
3010
+ severity: 'success',
3011
+ tooltipConfig: {
3012
+ pTooltip: 'Agregar registro',
3013
+ tooltipPosition: 'top'
3014
+ },
3015
+ onClick: () => {
3016
+ this.addRow();
3017
+ },
3018
+ disabled: isDisabled
3019
+ };
3020
+ return button;
3021
+ });
3022
+ addRow() {
3023
+ const editConfig = this.editConfig();
3024
+ // Si es modo cell y hay defaultTableNgData configurado, agregar la fila directamente
3025
+ if (editConfig?.type === 'cell' && editConfig?.cellEditConfig?.defaultTableNgData) {
3026
+ const newRow = this.editConfig()?.cellEditConfig?.defaultTableNgData;
3027
+ if (newRow) {
3028
+ this.data.update(currentData => [...currentData, newRow]);
3029
+ this.outputChangeData.emit(this.data());
3030
+ return;
3031
+ }
3032
+ }
3033
+ // Comportamiento original para modo row o cuando no hay defaultTableNgData
3034
+ this.outputAddRow.emit(this.data());
3035
+ this.setEditingRowId(null);
3036
+ }
3037
+ defaultTableNgData = computed(() => {
3038
+ const editConfig = this.editConfig();
3039
+ let defaultData;
3040
+ // Usar la configuración apropiada según el tipo de edición
3041
+ if (editConfig?.type === 'cell' && editConfig?.cellEditConfig?.defaultTableNgData) {
3042
+ defaultData = editConfig.cellEditConfig.defaultTableNgData;
3043
+ }
3044
+ else if (editConfig?.type === 'row' && editConfig?.rowEditConfig?.defaultTableNgData) {
3045
+ defaultData = editConfig.rowEditConfig.defaultTableNgData;
3046
+ }
3047
+ const res = { ...defaultData };
3048
+ return {
3049
+ ...res,
3050
+ id: generateId()
3051
+ };
3052
+ });
3053
+ clonedRowData = null;
3054
+ editingRowId = signal(null);
3055
+ /**
3056
+ * Verifica si una fila específica está siendo editada
3057
+ */
3058
+ isRowEditing(id) {
3059
+ return this.editingRowId() === id;
3060
+ }
3061
+ /**
3062
+ * Verifica si hay alguna fila siendo editada actualmente
3063
+ */
3064
+ get hasRowInEdit() {
3065
+ return this.editingRowId() !== null;
3066
+ }
3067
+ onRowEditInit(data) {
3068
+ // Verificar si ya hay una fila en edición
3069
+ this.clonedRowData = structuredClone(data.rowData);
3070
+ this.setEditingRowId(data.id);
3071
+ this.outputHandleEditInitButton.emit(data);
3072
+ }
3073
+ setEditingRowId(id) {
3074
+ this.editingRowId.set(id);
3075
+ this.outputIsEditing.emit(true);
3076
+ }
3077
+ onRowEditSave(_data) {
3078
+ this.clonedRowData = null;
3079
+ this.editingRowId.set(null);
3080
+ this.updateDataWithTableValue();
3081
+ this.setEnableErrors(false);
3082
+ this.outputIsEditing.emit(false);
3083
+ this.outputRowDataChange.emit(_data);
3084
+ }
3085
+ onRowEditCancel(data, index) {
3086
+ if (this.clonedRowData && this.editingRowId() === data.id) {
3087
+ const items = [...this.data()];
3088
+ items[index] = { ...items[index], rowData: this.clonedRowData };
3089
+ this.data.set(items);
3090
+ }
3091
+ this.clonedRowData = null;
3092
+ this.setEditingRowId(null);
3093
+ this.setEnableErrors(false);
3094
+ this.outputIsEditing.emit(false);
3095
+ }
3096
+ updateDataWithTableValue() {
3097
+ const tableValue = (this.dt.value ?? []);
3098
+ this.data.set([...tableValue]);
3099
+ }
3100
+ editInitButton = computed(() => {
3101
+ return {
3102
+ icon: 'fa-solid fa-pencil',
3103
+ rounded: true,
3104
+ variant: 'text',
3105
+ severity: 'secondary'
3106
+ };
3107
+ });
3108
+ getEditInitButton(productId) {
3109
+ return {
3110
+ ...this.editInitButton(),
3111
+ disabled: this.hasRowInEdit && !this.isRowEditing(productId)
3112
+ };
3113
+ }
3114
+ editSaveButton = computed(() => {
3115
+ return {
3116
+ icon: 'fa-solid fa-check',
3117
+ rounded: true,
3118
+ variant: 'text',
3119
+ severity: 'secondary'
3120
+ };
3121
+ });
3122
+ editSaveButtonWithErrors = computed(() => {
3123
+ return {
3124
+ icon: 'fa-solid fa-check',
3125
+ rounded: true,
3126
+ variant: 'text',
3127
+ severity: 'secondary'
3128
+ };
3129
+ });
3130
+ enableErrors = false;
3131
+ setEnableErrors(value) {
3132
+ this.enableErrors = value;
3133
+ }
3134
+ onEditSaveWithErrors() {
3135
+ this.setEnableErrors(true);
3136
+ }
3137
+ editCancelButton = computed(() => {
3138
+ return {
3139
+ icon: 'fa-solid fa-times',
3140
+ rounded: true,
3141
+ variant: 'text',
3142
+ severity: 'secondary'
3143
+ };
3144
+ });
3145
+ deleteRowButton = computed(() => {
3146
+ return {
3147
+ icon: 'fa-solid fa-trash',
3148
+ rounded: true,
3149
+ variant: 'text',
3150
+ severity: 'danger'
3151
+ };
3152
+ });
3153
+ getDeleteRowButton() {
3154
+ return {
3155
+ ...this.deleteRowButton(),
3156
+ disabled: this.hasRowInEdit
3157
+ };
3158
+ }
3159
+ removeRowFromData(data) {
3160
+ const { id } = data;
3161
+ const items = [...this.data()];
3162
+ items.splice(items.findIndex(item => item.id === id), 1);
3163
+ this.data.set(items);
3164
+ this.outputDeleteRow.emit(data);
3165
+ }
3166
+ deleteRow(data) {
3167
+ this.removeRowFromData(data);
3168
+ this.outputEditData.emit(this.data());
3169
+ }
3170
+ //#endregion Row
3171
+ get footerRows() {
3172
+ return this.footerConfig()?.footerRows || [];
3173
+ }
3174
+ applyPipe(value, pipeConfig) {
3175
+ if (!pipeConfig || !pipeConfig.pipe) {
3176
+ return value?.toString() || '';
3177
+ }
3178
+ switch (pipeConfig.pipe) {
3179
+ case 'currency': {
3180
+ const currencyCode = pipeConfig.args?.[0] || 'COP';
3181
+ return new Intl.NumberFormat('es-CO', {
3182
+ style: 'currency',
3183
+ currency: currencyCode
3184
+ }).format(value);
3185
+ }
3186
+ case 'number': {
3187
+ const digits = pipeConfig.args?.[0] || '1.2-2';
3188
+ const [minInteger, fractional] = digits.split('.');
3189
+ const [minFractional, maxFractional] = fractional ? fractional.split('-') : ['0', '0'];
3190
+ return new Intl.NumberFormat('es-CO', {
3191
+ minimumIntegerDigits: parseInt(minInteger),
3192
+ minimumFractionDigits: parseInt(minFractional),
3193
+ maximumFractionDigits: parseInt(maxFractional || minFractional)
3194
+ }).format(value);
3195
+ }
3196
+ case 'date': {
3197
+ if (value instanceof Date) {
3198
+ return value.toLocaleDateString('es-CO');
3199
+ }
3200
+ return value?.toString() || '';
3201
+ }
3202
+ default:
3203
+ return value?.toString() || '';
3204
+ }
3205
+ }
3206
+ // #endregion
3207
+ //#region Row Expansion
3208
+ rowExpansionButton(isRowExpanded) {
3209
+ return computed(() => {
3210
+ return {
3211
+ icon: isRowExpanded ? 'fa-solid fa-chevron-down' : 'fa-solid fa-chevron-right',
3212
+ rounded: true,
3213
+ variant: 'text',
3214
+ severity: 'contrast'
3215
+ };
3216
+ });
3217
+ }
3218
+ //#endregion
3219
+ itemTemplateInput = input(null);
3220
+ itemTemplate;
3221
+ get currentItemTemplate() {
3222
+ return this.itemTemplateInput() || this.itemTemplate || null;
3223
+ }
3224
+ isThatItemInTheProductSelection(field) {
3225
+ const selectedColumns = this.config()?.selectedColumns ?? [];
3226
+ if (!selectedColumns.length) {
3227
+ return true;
3228
+ }
3229
+ return selectedColumns.some((column) => column.field === field);
3230
+ }
3231
+ //#region Advanced Identifier Filters
3232
+ advancedIdentifierFiltersButton = computed(() => {
3233
+ return {
3234
+ icon: 'pi pi-filter',
3235
+ rounded: true,
3236
+ severity: 'warn',
3237
+ raised: true,
3238
+ tooltipConfig: {
3239
+ pTooltip: this.data().length === 0 ? 'No hay datos para filtrar' : 'Filtros avanzados',
3240
+ tooltipPosition: 'top'
3241
+ },
3242
+ onClick: () => {
3243
+ this.openAdvancedIdentifierFilters();
3244
+ },
3245
+ disabled: this.data().length === 0
3246
+ };
3247
+ });
3248
+ openAdvancedIdentifierFilters() {
3249
+ if (this.sourceElements().length === 0) {
3250
+ this.handleTableValueToSourceElements();
3251
+ }
3252
+ this.handleSelectedItemsToSourceElements();
3253
+ if (this.data().length === 0) {
3254
+ return;
3255
+ }
3256
+ const ref = this.dialogService.open(ModalAdvancedFilterComponent, {
3257
+ header: 'Filtros Avanzados',
3258
+ width: '70%',
3259
+ height: '70%',
3260
+ styleClass: 'overflow-hidden',
3261
+ data: {
3262
+ sourceElements: this.sourceElements(),
3263
+ targetElements: this.targetElements()
3264
+ }
3265
+ });
3266
+ ref.onClose.subscribe((result) => {
3267
+ const { sourceElements, targetElements } = result?.data ?? {};
3268
+ if (!result?.success) {
3269
+ return;
3270
+ }
3271
+ if (result?.data?.targetElements?.length === 0) {
3272
+ return;
3273
+ }
3274
+ if (sourceElements.length === 0) {
3275
+ return;
3276
+ }
3277
+ this.sourceElements.set(sourceElements ?? []);
3278
+ this.targetElements.set(targetElements ?? []);
3279
+ this.identifiersSelected.set((this.targetElements() ?? []).filter((element) => element.buttonConfig?.label).map((element) => element.buttonConfig?.label) ?? []);
3280
+ this.dt.filter(this.identifiersSelected(), 'rowData.identifier', 'arrayStringFilter');
3281
+ });
3282
+ }
3283
+ handleTableValueToSourceElements() {
3284
+ const value = this.data();
3285
+ if (!value.some((item) => item.rowData['identifier'])) {
3286
+ return;
3287
+ }
3288
+ const sourceElements = value.map((item) => ({
3289
+ id: item.id,
3290
+ buttonConfig: {
3291
+ label: item.rowData['identifier'],
3292
+ fullWidth: true,
3293
+ fullHeight: true
3294
+ },
3295
+ isSelected: false
3296
+ }));
3297
+ this.sourceElements.set(sourceElements);
3298
+ }
3299
+ handleSelectedItemsToSourceElements() {
3300
+ const selectedItems = this.selectedItems();
3301
+ if (!selectedItems.some((item) => item.rowData['identifier'])) {
3302
+ return;
3303
+ }
3304
+ const identifiers = selectedItems.map((item) => item.rowData['identifier']);
3305
+ const sourceElements = this.sourceElements().map((item) => ({
3306
+ ...item,
3307
+ isSelected: identifiers.includes(item.buttonConfig?.label)
3308
+ }));
3309
+ this.sourceElements.set(sourceElements);
3310
+ }
3311
+ identifiersSelected = signal([]);
3312
+ //#endregion
3313
+ get excelButton() {
3314
+ return this.tableNgService.excelButton();
3315
+ }
3316
+ get pdfButton() {
3317
+ return this.tableNgService.pdfButton();
3318
+ }
3319
+ lazyLoadingConfig = computed(() => {
3320
+ return this.config()?.lazyLoadingConfig ?? undefined;
3321
+ });
3322
+ isEnabledLazyLoading = computed(() => {
3323
+ return this.lazyLoadingConfig()?.isEnabled ?? false;
3324
+ });
3325
+ prepareDataForExport(dataToExport) {
3326
+ const keys = this.config()?.keys ?? [];
3327
+ const keysNames = this.config()?.keysNames ?? {};
3328
+ return dataToExport.map((item) => {
3329
+ const row = {};
3330
+ const rowData = item.rowData;
3331
+ keys.forEach((key) => {
3332
+ const keyName = keysNames[key] ?? key;
3333
+ if (rowData[key]) {
3334
+ let value = rowData[key];
3335
+ switch (typeof value) {
3336
+ case 'number':
3337
+ value = formatNumber(value);
3338
+ break;
3339
+ default:
3340
+ break;
3341
+ }
3342
+ row[keyName] = value;
3343
+ }
3344
+ });
3345
+ return row;
3346
+ });
3347
+ }
3348
+ exportCSV(data) {
3349
+ // Create a new workbook
3350
+ const workbook = XLSX.utils.book_new();
3351
+ const worksheet = XLSX.utils.json_to_sheet(data);
3352
+ // Get title from config or use default
3353
+ const name = this.config()?.excelConfig?.name ?? 'Report';
3354
+ const fileName = name || 'table-export';
3355
+ // Excel sheet names cannot exceed 31 characters
3356
+ const sheetName = name.substring(0, 31);
3357
+ // Add the worksheet to the workbook
3358
+ XLSX.utils.book_append_sheet(workbook, worksheet, sheetName);
3359
+ // Generate Excel file and trigger download
3360
+ XLSX.writeFile(workbook, `${fileName}.xlsx`);
3361
+ }
3362
+ exportData(dt, endpoint) {
3363
+ if (this.isEnabledLazyLoading()) {
3364
+ const filters = dt.filters ?? {};
3365
+ const filterQuery = {};
3366
+ Object.entries(filters).forEach(([key, value]) => {
3367
+ const keyName = key.split('.')[1];
3368
+ const valueFilter = value[0]?.value;
3369
+ filterQuery[keyName] = valueFilter;
3370
+ });
3371
+ this.lazyLoadingConfig()?.excelLazyLoadingConfig?.callback(removeNullUndefined(filterQuery))
3372
+ .subscribe((response) => {
3373
+ const data = this.prepareDataForExport(response);
3374
+ if (endpoint === 'excel') {
3375
+ this.exportCSV(data);
3376
+ }
3377
+ else {
3378
+ this.exportPDF(data);
3379
+ }
3380
+ });
3381
+ }
3382
+ else {
3383
+ const value = dt.value ?? this.data();
3384
+ const filteredValue = dt.filteredValue ?? [];
3385
+ let dataToExport = [];
3386
+ if (filteredValue.length > 0) {
3387
+ dataToExport = filteredValue;
3388
+ }
3389
+ else {
3390
+ dataToExport = value;
3391
+ }
3392
+ const data = this.prepareDataForExport(dataToExport);
3393
+ if (endpoint === 'excel') {
3394
+ this.exportCSV(data);
3395
+ }
3396
+ else {
3397
+ this.exportPDF(data);
3398
+ }
3399
+ }
3400
+ }
3401
+ exportPDF(data) {
3402
+ // Get title from config or use default
3403
+ const name = this.config()?.pdfConfig?.name ?? this.config()?.excelConfig?.name ?? 'Report';
3404
+ const fileName = name || 'table-export';
3405
+ // Get keys and column names
3406
+ const keys = this.config()?.keys ?? [];
3407
+ const keysNames = this.config()?.keysNames ?? {};
3408
+ // Prepare headers
3409
+ const headers = keys.map((key) => keysNames[key] ?? key);
3410
+ // Prepare rows data
3411
+ const rows = data.map((row) => {
3412
+ return keys.map((key) => {
3413
+ const keyName = keysNames[key] ?? key;
3414
+ return row[keyName] ?? '';
3415
+ });
3416
+ });
3417
+ // Create PDF document
3418
+ const doc = new jsPDF({
3419
+ orientation: 'landscape',
3420
+ unit: 'mm',
3421
+ format: 'a4'
3422
+ });
3423
+ // Add title
3424
+ doc.setFontSize(16);
3425
+ doc.text(name, 14, 15);
3426
+ // Add table
3427
+ autoTable(doc, {
3428
+ head: [headers],
3429
+ body: rows,
3430
+ startY: 20,
3431
+ styles: {
3432
+ fontSize: 8,
3433
+ cellPadding: 2
3434
+ },
3435
+ headStyles: {
3436
+ fillColor: [66, 139, 202],
3437
+ textColor: 255,
3438
+ fontStyle: 'bold'
3439
+ },
3440
+ alternateRowStyles: {
3441
+ fillColor: [245, 245, 245]
3442
+ },
3443
+ margin: { top: 20 }
3444
+ });
3445
+ // Save PDF
3446
+ doc.save(`${fileName}.pdf`);
3447
+ }
3448
+ enableExcelButton = computed(() => {
3449
+ return this.config()?.excelConfig?.isEnabled ?? false;
3450
+ });
3451
+ enablePdfButton = computed(() => {
3452
+ return this.config()?.pdfConfig?.isEnabled ?? false;
3453
+ });
3454
+ get enableRefreshButton() {
3455
+ return this.tableNgService.enableRefreshButton();
3456
+ }
3457
+ get refreshButton() {
3458
+ return this.tableNgService.refreshButton();
3459
+ }
3460
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TableNgComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3461
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TableNgComponent, isStandalone: true, selector: "lib-table-ng", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, editConfig: { classPropertyName: "editConfig", publicName: "editConfig", isSignal: true, isRequired: false, transformFunction: null }, footerConfig: { classPropertyName: "footerConfig", publicName: "footerConfig", isSignal: true, isRequired: false, transformFunction: null }, toolbarButtons: { classPropertyName: "toolbarButtons", publicName: "toolbarButtons", isSignal: true, isRequired: false, transformFunction: null }, toolbarSpeedDialButtons: { classPropertyName: "toolbarSpeedDialButtons", publicName: "toolbarSpeedDialButtons", isSignal: true, isRequired: false, transformFunction: null }, sourceElements: { classPropertyName: "sourceElements", publicName: "sourceElements", isSignal: true, isRequired: false, transformFunction: null }, targetElements: { classPropertyName: "targetElements", publicName: "targetElements", isSignal: true, isRequired: false, transformFunction: null }, httpMessage: { classPropertyName: "httpMessage", publicName: "httpMessage", isSignal: true, isRequired: false, transformFunction: null }, selectedItems: { classPropertyName: "selectedItems", publicName: "selectedItems", isSignal: true, isRequired: false, transformFunction: null }, itemTemplateInput: { classPropertyName: "itemTemplateInput", publicName: "itemTemplateInput", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { data: "dataChange", config: "configChange", editConfig: "editConfigChange", footerConfig: "footerConfigChange", toolbarButtons: "toolbarButtonsChange", toolbarSpeedDialButtons: "toolbarSpeedDialButtonsChange", sourceElements: "sourceElementsChange", targetElements: "targetElementsChange", httpMessage: "httpMessageChange", lazyLoading: "lazyLoading", outputChangeData: "outputChangeData", outputHandleEditInitButton: "outputHandleEditInitButton", outputAddRow: "outputAddRow", outputDeleteRow: "outputDeleteRow", outputRowInlineChange: "outputRowInlineChange", outputRowDataChange: "outputRowDataChange", outputEditData: "outputEditData", outputIsEditing: "outputIsEditing", selectedItems: "selectedItemsChange" }, providers: [TableNgService, TableNgEditService], queries: [{ propertyName: "itemTemplate", first: true, predicate: ["item"], descendants: true, static: true }], viewQueries: [{ propertyName: "dt", first: true, predicate: ["dt"], descendants: true }], ngImport: i0, template: "@let paginationConfig = config()?.paginationConfig;\n@let globalFilterConfig = config()?.globalFilterConfig;\n@let selectionTableConfig = config()?.selectionTableConfig;\n@let filterConfigByKey = config()?.filterConfigByKey;\n@let frozenColumnConfigByKey = config()?.frozenColumnConfigByKey;\n@let scrollConfig = config()?.scrollConfig;\n@let lazyLoadingConfig = config()?.lazyLoadingConfig;\n@let keysNames = config()?.keysNames;\n@let columnConfig = config()?.columnConfig;\n@let editEnabled = editConfig()?.isEnabled ?? false;\n@let editType = editConfig()?.type ?? 'cell';\n@let inlineControls = editConfig()?.inlineControls;\n@let rowErrorConfig = editConfig()?.rowEditConfig?.rowErrorConfig;\n@let footerRows = footerConfig()?.footerRows;\n@let footerEnabled = footerConfig()?.isEnabled ?? false;\n@let titleConfig = config()?.titleConfig;\n@let selectedColumns = config()?.selectedColumns;\n@let rowExpansionConfig = config()?.rowExpansionConfig;\n@let advancedIdentifierFiltersConfig = config()?.globalFilterConfig?.advancedIdentifierFiltersConfig;\n\n<div class=\"p-datatable-wrapper\">\n @if (titleConfig?.isEnabled && titleConfig?.title) {\n <div class=\"table-title-container\">\n <h2 class=\"table-title\">{{ titleConfig!.title }}</h2>\n </div>\n }\n @if (!hideToolbar || (filteredValue || advancedFiltersPerformed.length > 0)) {\n <lib-toolbar-ng class=\"p-toolbar-header sticky top-0 z-30 dark:bg-gray-800\">\n <div class=\"flex gap-2\" toolbarStart>\n @if (globalFilterConfig?.isEnabled && !lazyLoadingConfig?.isEnabled) {\n <lib-form [controls]=\"controlsGlobalFilter\" [(formGroup)]=\"searchFormGroupGlobalFilter\"\n (formSubmit)=\"submitGlobalSearch($event)\"></lib-form>\n }\n @if (advancedIdentifierFiltersConfig?.isEnabled) {\n <lib-button-ng class=\"animate__animated animate__fadeIn\"\n [buttonConfig]=\"advancedIdentifierFiltersButton()\"></lib-button-ng>\n }\n @if (filteredValue || advancedFiltersPerformed.length > 0) {\n <lib-button-ng class=\"animate__animated animate__fadeIn\" [buttonConfig]=\"clearFiltersButton()\"></lib-button-ng>\n }\n </div>\n <div class=\"flex gap-2\" toolbarEnd>\n @if (toolbarSpeedDialButtons().length > 0) {\n @for (speedDial of toolbarSpeedDialButtons(); track $index) {\n <lib-speed-dial [speedDialConfig]=\"speedDial\"></lib-speed-dial>\n }\n }\n @if (toolbarButtons().length > 0) {\n @for (button of toolbarButtons(); track $index) {\n <lib-button-ng [buttonConfig]=\"button\"></lib-button-ng>\n }\n }\n @if ((editType === 'row' || editType === 'cell') && editEnabled) {\n <lib-button-ng [buttonConfig]=\"addRowButton()\"></lib-button-ng>\n }\n @if (enableExcelButton()) {\n <lib-button-ng [buttonConfig]=\"excelButton\" (onClick)=\"exportData(dt,'excel')\"></lib-button-ng>\n }\n @if (enablePdfButton()) {\n <lib-button-ng [buttonConfig]=\"pdfButton\" (onClick)=\"exportData(dt,'pdf')\"></lib-button-ng>\n }\n @if (enableRefreshButton) {\n <lib-button-ng [buttonConfig]=\"refreshButton\"></lib-button-ng>\n }\n </div>\n </lib-toolbar-ng>\n }\n <p-table #dt styleClass=\"p-datatable-sm\" [value]=\"data()\" [lazy]=\"lazyLoadingConfig?.isEnabled ?? false\"\n [editMode]=\"editType\" [totalRecords]=\"\n lazyLoadingConfig?.isEnabled\n ? (lazyLoadingConfig?.totalRecords ?? 0)\n : data().length\n \" [customSort]=\"true\" [paginator]=\"paginationConfig?.paginator ?? true\" [showCurrentPageReport]=\"true\"\n [rows]=\"paginationConfig?.rows ?? 5\" [rowsPerPageOptions]=\"paginationConfig?.rowsPerPageOptions ?? [5, 10, 20]\"\n [paginatorStyleClass]=\"paginatorStyleClass()\" [resizableColumns]=\"true\" [rowTrackBy]=\"trackById\"\n [columns]=\"selectedColumns\" [scrollable]=\"scrollConfig?.isEnabled ?? false\"\n [scrollHeight]=\"scrollConfig?.isEnabled ? scrollHeight() : undefined\" (onLazyLoad)=\"onLazyLoad($event)\"\n (sortFunction)=\"customSort($event)\" (onFilter)=\"onFilter($event)\" [(selection)]=\"selectedItems\"\n [currentPageReportTemplate]=\"getCustomPageReport()\" selectionPageOnly=\"true\" dataKey=\"id\" class=\"w-full\">\n <ng-template #header let-columns>\n <tr>\n @if (rowExpansionConfig?.isEnabled) {\n <th alignFrozen=\"left\" pFrozenColumn style=\"width: 2rem\" class=\"p-datatable-header-cell p-frozen-column\">\n\n </th>\n }\n @if (selectionTableConfig?.isEnabled) {\n <th alignFrozen=\"left\" pFrozenColumn style=\"width: 2rem\" class=\"p-datatable-header-cell p-frozen-column\">\n <p-tableHeaderCheckbox />\n </th>\n }\n\n @if (selectedColumns) {\n @for (column of columns; track $index) {\n <th pResizableColumn [id]=\"column.field\" alignFrozen=\"right\" pFrozenColumn\n [frozen]=\"frozenHandle(frozenColumnConfigByKey?.[column.field])\" [pSortableColumn]=\"column.field\"\n class=\"p-datatable-header-cell\" [style.width.%]=\"columnConfig?.sizeByKey?.[column.field] ?? null\" [ngClass]=\"{\n 'p-frozen-column': frozenHandle(\n frozenColumnConfigByKey?.[column.field]\n ),\n }\">\n <div class=\"flex gap-2 justify-center items-center py-0 px-0\">\n {{ column.field | keyToDisplayName: keysNames }}\n @if(!editEnabled){\n <p-sortIcon [field]=\"column.field\" />\n }\n @if (filterConfigByKey?.[column.field]?.isEnabled) {\n <p-columnFilter type=\"text\" [field]=\"`rowData.${column.field}`\" display=\"menu\" [ngClass]=\"{\n 'bg-green-200 rounded-full p-1 shadow-sm text-green-500 transition-all duration-300 ease-in-out':\n advancedFiltersPerformed.includes(column.field),\n }\" [type]=\"\n filterConfigByKey?.[column.field]?.primeNgColumnFilterConfig?.type ??\n 'text'\n \" [matchMode]=\"\n filterConfigByKey?.[column.field]?.primeNgColumnFilterConfig\n ?.matchMode\n \" [showMatchModes]=\"\n filterConfigByKey?.[column.field]?.primeNgColumnFilterConfig\n ?.showMatchModes ?? false\n \" [showOperator]=\"\n filterConfigByKey?.[column.field]?.primeNgColumnFilterConfig\n ?.showOperator ?? false\n \" [showAddButton]=\"\n filterConfigByKey?.[column.field]?.primeNgColumnFilterConfig\n ?.showAddButton ?? false\n \" [showApplyButton]=\"\n filterConfigByKey?.[column.field]?.primeNgColumnFilterConfig\n ?.showApplyButton ?? false\n \" [showClearButton]=\"\n filterConfigByKey?.[column.field]?.primeNgColumnFilterConfig\n ?.showClearButton ?? false\n \">\n @if (\n filterConfigByKey?.[column.field]?.customColumnFilterConfig\n ?.isEnabled ?? false\n ) {\n <ng-template #filter let-value let-filter=\"filterCallback\">\n <div style=\"min-width: 20rem\" class=\"\">\n <lib-inline-input\n (outputValue)=\"inlineFormChanges($event, filter, filterConfigByKey?.[column.field]?.customColumnFilterConfig?.inlineControlConfig?.typeInput, column.field)\"\n (outputDebounced)=\"onFilter($event)\" [(ngModel)]=\"advancedFiltersValues()[column.field]\"\n [config]=\"filterConfigByKey?.[column.field]?.customColumnFilterConfig?.inlineControlConfig ?? {typeInput: ETypeInput.TEXT}\"></lib-inline-input>\n </div>\n </ng-template>\n }\n </p-columnFilter>\n }\n </div>\n </th>\n }\n }@else {\n @for (key of keys(); track $index) {\n <th [id]=\"key\" pResizableColumn alignFrozen=\"right\" pFrozenColumn\n [frozen]=\"frozenHandle(frozenColumnConfigByKey?.[key])\" [pSortableColumn]=\"key\"\n class=\"p-datatable-header-cell\" [style.width.%]=\"columnConfig?.sizeByKey?.[key] ?? null\" [ngClass]=\"{\n 'p-frozen-column': frozenHandle(frozenColumnConfigByKey?.[key]),\n }\">\n <div class=\"flex gap-2 justify-center items-center py-0 px-0\">\n {{ key | keyToDisplayName: keysNames }}\n @if(!editEnabled){\n <p-sortIcon [field]=\"key\" />\n }\n @if (filterConfigByKey?.[key]?.isEnabled) {\n <p-columnFilter type=\"text\" [field]=\"`rowData.${key}`\" display=\"menu\" [ngClass]=\"{\n 'bg-green-200 rounded-full p-1 shadow-sm text-green-500 transition-all duration-300 ease-in-out':\n advancedFiltersPerformed.includes(key),\n }\" [type]=\"filterConfigByKey?.[key]?.primeNgColumnFilterConfig?.type ?? 'text'\"\n [matchMode]=\"filterConfigByKey?.[key]?.primeNgColumnFilterConfig?.matchMode\"\n [showMatchModes]=\"filterConfigByKey?.[key]?.primeNgColumnFilterConfig?.showMatchModes ?? false\"\n [showOperator]=\"filterConfigByKey?.[key]?.primeNgColumnFilterConfig?.showOperator ?? false\"\n [showAddButton]=\"filterConfigByKey?.[key]?.primeNgColumnFilterConfig?.showAddButton ?? false\"\n [showApplyButton]=\"filterConfigByKey?.[key]?.primeNgColumnFilterConfig?.showApplyButton ?? false\"\n [showClearButton]=\"filterConfigByKey?.[key]?.primeNgColumnFilterConfig?.showClearButton ?? false\">\n @if (\n filterConfigByKey?.[key]?.customColumnFilterConfig\n ?.isEnabled ?? false\n ) {\n <ng-template #filter let-value let-filter=\"filterCallback\">\n <div style=\"min-width: 20rem\" class=\"\">\n <!-- <app-custom-advanced-filter filter\n [customColumnFilterConfig]=\"filterConfigByKey![key]!.customColumnFilterConfig!\"\n (formChanges)=\"formChanges($event, filter, key)\"\n [initialValue]=\"advancedFiltersValues[key]\"></app-custom-advanced-filter> -->\n <lib-inline-input\n (outputValue)=\"inlineFormChanges($event, filter, filterConfigByKey?.[key]?.customColumnFilterConfig?.inlineControlConfig?.typeInput, key)\"\n [(ngModel)]=\"advancedFiltersValues()[key]\"\n [config]=\"filterConfigByKey?.[key]?.customColumnFilterConfig?.inlineControlConfig ?? {typeInput: ETypeInput.TEXT}\"></lib-inline-input>\n </div>\n </ng-template>\n }\n </p-columnFilter>\n }\n </div>\n </th>\n }\n }\n\n @if (editType === 'cell' && editEnabled) {\n <th class=\"p-datatable-header-cell\" style=\"width: 100px\">\n </th>\n }\n @if (editType === 'row' && editEnabled) {\n <th class=\"p-datatable-header-cell\" style=\"width: 100px\">\n </th>\n }\n\n </tr>\n </ng-template>\n\n <ng-template #emptymessage>\n <tr>\n <td [attr.colspan]=\"totalColumns()\">\n @if (isLoading()) {\n <!-- Loading state -->\n <div class=\"p-8 text-center\">\n <div class=\"flex flex-col items-center justify-center gap-4\">\n <i class=\"pi pi-spin pi-spinner text-4xl text-blue-500\"></i>\n <p class=\"text-gray-600 text-lg\">{{ getLoadingMessage() }}</p>\n </div>\n </div>\n } @else if (timeoutExpired()) {\n <!-- No data available -->\n <div class=\"p-8 text-center text-gray-500\">\n <div class=\"flex flex-col items-center justify-center gap-3\">\n <i class=\"pi pi-info-circle text-4xl text-gray-400\"></i>\n <p class=\"text-lg\">{{ getNoDataMessage() }}</p>\n </div>\n </div>\n }\n </td>\n </tr>\n </ng-template>\n\n @if (hasRecords()) {\n @if (editEnabled) {\n @switch (editType) {\n @case ('cell') {\n <ng-template #body let-item let-editing=\"editing\">\n <tr class=\"p-datatable-row p-selectable-row\">\n @if (selectedColumns) {\n @for (column of selectedColumns; track $index){\n <td [pEditableColumn]=\"column.field\" pEditableColumnField=\"rowData.{{column.field}}\">\n <p-cellEditor>\n <ng-template #input>\n <lib-inline-input [(ngModel)]=\"item.rowData[column.field]\" (outputDebounced)=\"onEditData()\"\n [config]=\"inlineControls?.[column.field] ?? {typeInput: ETypeInput.TEXT}\">\n </lib-inline-input>\n </ng-template>\n <ng-template #output>\n @if (inlineControls?.[column.field]?.typeInput === ETypeInput.NUMBER) {\n <div class=\"text-right\">\n {{ item.rowData[column.field] | number: '1.2-2' }}\n\n </div>\n } @else if(inlineControls?.[column.field]?.typeInput === ETypeInput.CURRENCY) {\n <div class=\"text-right\">\n {{ item.rowData[column.field] | currency: item?.currencyTypeCellConfig?.[column.field]?.currency ??\n 'USD' }}\n </div>\n } @else if(inlineControls?.[column.field]?.typeInput === ETypeInput.DATE) {\n <div class=\"text-left\">\n {{ item.rowData[column.field] | date: \"dd/MM/yyyy\" }}\n </div>\n } @else if(inlineControls?.[column.field]?.typeInput === ETypeInput.DATETIME_LOCAL) {\n <div class=\"text-left\">\n {{ item.rowData[column.field] | date: \"dd/MM/yyyy HH:mm\" }}\n </div>\n } @else if(inlineControls?.[column.field]?.typeInput === ETypeInput.SWITCH) {\n <div class=\"text-center\">\n @if (item.rowData[column.field]) {\n <i class=\"fa-solid fa-check text-green-500\"></i>\n } @else {\n <i class=\"fa-solid fa-times text-red-500\"></i>\n }\n </div>\n } @else {\n @if (item.rowData[column.field]?.name) {\n {{ item.rowData[column.field]?.name }}\n } @else {\n {{ item.rowData[column.field] }}\n }\n }\n\n </ng-template>\n </p-cellEditor>\n </td>\n }\n } @else {\n @for (key of keys(); track $index){\n <td [pEditableColumn]=\"key\" pEditableColumnField=\"rowData.{{key}}\">\n <p-cellEditor>\n <ng-template #input>\n <lib-inline-input [(ngModel)]=\"item.rowData[key]\" (outputDebounced)=\"onEditData()\"\n [config]=\"inlineControls?.[key] ?? {typeInput: ETypeInput.TEXT}\">\n </lib-inline-input>\n </ng-template>\n <ng-template #output>\n @if (inlineControls?.[key]?.typeInput === ETypeInput.SWITCH) {\n <div class=\"text-center\">\n @if (item.rowData[key]) {\n <i class=\"fa-solid fa-check text-green-500\"></i>\n } @else {\n <i class=\"fa-solid fa-times text-red-500\"></i>\n }\n </div>\n } @else {\n {{ item.rowData[key] }}\n }\n </ng-template>\n </p-cellEditor>\n </td>\n }\n }\n @if (editType === 'cell' && editEnabled) {\n <td class=\"px-2 py-1 text-center\">\n <div class=\"flex justify-center items-center gap-2\">\n <lib-button-ng [buttonConfig]=\"getDeleteRowButton()\" (onClick)=\"deleteRow(item)\"></lib-button-ng>\n </div>\n </td>\n }\n </tr>\n </ng-template>\n }\n @case ('row') {\n <ng-template #body let-item let-editing=\"editing\" let-ri=\"rowIndex\">\n <tr [pEditableRow]=\"item\" class=\"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 border-b\">\n @if (selectedColumns) {\n @for (column of selectedColumns; track $index){\n <td>\n <div class=\"flex flex-col gap-2\">\n <p-cellEditor>\n <ng-template #input>\n <lib-inline-input [(ngModel)]=\"item.rowData[column.field]\"\n (outputValue)=\"inlineChange($event, column.field)\" (outputDebounced)=\"onEditData()\"\n [config]=\"inlineControls?.[column.field] ?? {typeInput: ETypeInput.TEXT}\">\n </lib-inline-input>\n\n </ng-template>\n <ng-template #output>\n\n @if (inlineControls?.[column.field]?.typeInput === ETypeInput.NUMBER) {\n <div class=\"text-right\">\n {{ item.rowData[column.field] | number: '1.2-2' }}\n\n </div>\n } @else if(inlineControls?.[column.field]?.typeInput === ETypeInput.CURRENCY) {\n <div class=\"text-right\">\n {{ item.rowData[column.field] | currency: item?.currencyTypeCellConfig?.[column.field]?.currency ??\n 'USD' }}\n </div>\n } @else if(inlineControls?.[column.field]?.typeInput === ETypeInput.DATE) {\n <div class=\"text-left\">\n {{ item.rowData[column.field] | date: \"dd/MM/yyyy\" }}\n </div>\n } @else if(inlineControls?.[column.field]?.typeInput === ETypeInput.DATETIME_LOCAL) {\n <div class=\"text-left\">\n {{ item.rowData[column.field] | date: \"dd/MM/yyyy HH:mm\" }}\n </div>\n } @else if(inlineControls?.[column.field]?.typeInput === ETypeInput.SWITCH) {\n <div class=\"text-center\">\n @if (item.rowData[column.field]) {\n <i class=\"fa-solid fa-check text-green-500\"></i>\n } @else {\n <i class=\"fa-solid fa-times text-red-500\"></i>\n }\n </div>\n } @else {\n @if (item.rowData[column.field]?.name) {\n {{ item.rowData[column.field]?.name }}\n } @else {\n {{ item.rowData[column.field] }}\n }\n }\n\n\n </ng-template>\n </p-cellEditor>\n\n @if (rowErrorConfig?.isEnabled && enableErrors && !rowFieldsHasValue()[column.field]) {\n <span class=\"text-red-500 italic text-xs\">{{\n rowErrorConfig?.fieldErrors?.[item.id]?.[column.field]?.message ??\n '' }}</span>\n }\n </div>\n </td>\n }\n } @else {\n @for (key of keys(); track $index){\n <td>\n <div class=\"flex flex-col gap-2\">\n <p-cellEditor>\n <ng-template #input>\n <lib-inline-input [(ngModel)]=\"item.rowData[key]\" (outputValue)=\"inlineChange($event, key)\"\n (outputDebounced)=\"onEditData()\" [config]=\"inlineControls?.[key] ?? {typeInput: ETypeInput.TEXT}\">\n </lib-inline-input>\n </ng-template>\n <ng-template #output>\n\n @if (inlineControls?.[key]?.typeInput === ETypeInput.NUMBER) {\n <div class=\"text-right\">\n {{ item.rowData[key] | number: '1.2-2' }}\n\n </div>\n }\n @else if(inlineControls?.[key]?.typeInput === ETypeInput.CURRENCY) {\n <div class=\"text-right\">\n {{ item.rowData[key] | currency: item?.currencyTypeCellConfig?.[key]?.currency ?? 'USD' }}\n </div>\n } @else if(inlineControls?.[key]?.typeInput === ETypeInput.SWITCH) {\n <div class=\"text-center\">\n @if (item.rowData[key]) {\n <i class=\"fa-solid fa-check text-green-500\"></i>\n } @else {\n <i class=\"fa-solid fa-times text-red-500\"></i>\n }\n </div>\n } @else {\n @if (item.rowData[key]?.name) {\n {{ item.rowData[key]?.name }}\n } @else {\n {{ item.rowData[key] }}\n }\n }\n\n\n </ng-template>\n </p-cellEditor>\n\n @if (rowErrorConfig?.isEnabled && enableErrors && !rowFieldsHasValue()[key]) {\n <span class=\"text-red-500 italic text-xs\">{{ rowErrorConfig?.fieldErrors?.[item.id]?.[key]?.message ??\n '' }}</span>\n }\n </div>\n </td>\n }\n }\n <td>\n <div class=\"flex justify-center items-center gap-2\">\n @if(!editing){\n <lib-button-ng pButton pRipple pInitEditableRow [buttonConfig]=\"getEditInitButton(item.id)\"\n (onClick)=\"onRowEditInit(item)\"></lib-button-ng>\n @if(!editConfig()?.rowEditConfig?.isDisabledDeleteButton){\n <lib-button-ng [buttonConfig]=\"getDeleteRowButton()\" (onClick)=\"deleteRow(item)\"></lib-button-ng>\n }\n }\n @if(editing){\n @if (hasErrorValues(rowErrorConfig?.fieldErrors?.[item.id] ?? {})) {\n <lib-button-ng [buttonConfig]=\"editSaveButtonWithErrors()\"\n (onClick)=\"onEditSaveWithErrors()\"></lib-button-ng>\n }\n @else {\n <lib-button-ng pButton pRipple pSaveEditableRow [buttonConfig]=\"editSaveButton()\"\n (onClick)=\"onRowEditSave(item)\"></lib-button-ng>\n }\n <lib-button-ng pButton pRipple pCancelEditableRow [buttonConfig]=\"editCancelButton()\"\n (onClick)=\"onRowEditCancel(item, ri)\"></lib-button-ng>\n }\n </div>\n </td>\n </tr>\n </ng-template>\n }\n }\n } @else {\n\n <ng-template #body let-item let-expanded=\"expanded\">\n <tr class=\"p-datatable-row p-selectable-row\" [ngClass]=\"{\n 'bg-gray-50 dark:bg-gray-800 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700': item.onClick && !item.isSelected && !item.isLoading,\n 'bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600': !item.onClick && !item.isSelected && !item.isLoading,\n 'bg-blue-100 dark:bg-blue-900 border-l-4 border-blue-500 hover:bg-blue-200 dark:hover:bg-blue-800': item.isSelected && !item.isLoading,\n 'skeleton-row': item.isLoading\n }\" (click)=\"item?.isLoading ? null : onRowClick(item)\">\n\n @if (rowExpansionConfig?.isEnabled) {\n <td (click)=\"$event.stopPropagation()\" [class.skeleton-cell]=\"item.isLoading\"\n [style.height]=\"item.isLoading ? '3rem' : 'auto'\">\n @if (!item.isLoading) {\n <lib-button-ng [buttonConfig]=\"rowExpansionButton(expanded)()\" type=\"button\" pRipple\n [pRowToggler]=\"item\"></lib-button-ng>\n } @else {\n <div class=\"skeleton-content\"></div>\n }\n </td>\n }\n\n @if (selectionTableConfig?.isEnabled) {\n <td (click)=\"$event.stopPropagation()\" alignFrozen=\"left\" pFrozenColumn class=\"shadow-lg\"\n [class.skeleton-cell]=\"item.isLoading\" [style.height]=\"item.isLoading ? '3rem' : 'auto'\">\n @if (!item.isLoading) {\n <p-tableCheckbox [id]=\"item\" [value]=\"item\" />\n } @else {\n <div class=\"skeleton-content\"></div>\n }\n </td>\n }\n\n @for (key of keys(); track $index) {\n @if (isThatItemInTheProductSelection(key)) {\n <td [id]=\"key\" class=\"p-datatable-cell\" [style.height]=\"item.isLoading ? '3rem' : 'min-content'\"\n alignFrozen=\"right\" pFrozenColumn [ngClass]=\"{\n 'p-frozen-column': frozenHandle(frozenColumnConfigByKey?.[key]),\n 'text-center': item.rowDataButtons?.[key] || item.typeCell?.[key] === ETypeInput.BADGE,\n 'skeleton-cell': item.isLoading\n }\" [frozen]=\"frozenHandle(frozenColumnConfigByKey?.[key])\">\n @if (item.isLoading) {\n <div class=\"skeleton-content\"></div>\n } @else {\n @if (item.rowDataButtons?.[key]) {\n <div class=\"flex gap-4 w-full justify-center items-center\">\n @for (btn of item.rowDataButtons[key]; track $index) {\n @if (btn) {\n <lib-button-ng class=\"w-full\" (click)=\"$event.stopPropagation()\" [buttonConfig]=\"btn\"></lib-button-ng>\n }\n }\n </div>\n } @else {\n @switch (item.typeCell?.[key]) {\n @case (ETypeInput.IMAGE) {\n <img [src]=\"item.rowData[key]\" alt=\"Image\" class=\"w-10 h-10 mx-auto\">\n }\n @case (ETypeInput.DATE) {\n {{ item.rowData[key] | date: \"dd/MM/yyyy\" }}\n }\n @case (ETypeInput.DATETIME_LOCAL) {\n {{ item.rowData[key] | date: \"dd/MM/yyyy HH:mm\" }}\n }\n @case (ETypeInput.CURRENCY) {\n {{item?.currencyTypeCellConfig?.[key]?.currency}} {{ item.rowData[key] | currency:\n item?.currencyTypeCellConfig?.[key]?.currency ?? 'USD' }}\n }\n @case (ETypeInput.BADGE) {\n <lib-badge-ng [config]=\"item.rowData[key]\"></lib-badge-ng>\n }\n @case (ETypeInput.COMPONENT) {\n <ng-container\n *ngTemplateOutlet=\"item.rowDataComponents?.[key]; context: { $implicit: item.raw }\"></ng-container>\n }\n @default {\n @if (isDate(item.rowData[key])) {\n {{ item.rowData[key] | date: \"dd/MM/yyyy\" }}\n } @else if (typeof item.rowData[key] === \"string\") {\n {{ item.rowData[key] }}\n } @else if (isPrimeNgSelection(item.rowData[key])) {\n {{ item.rowData[key].name }}\n } @else if(typeof item.rowData[key] === \"number\") {\n <p class=\"text-right\">\n {{ item.rowData[key] | number: '1.2-2' }}\n </p>\n }\n }\n }\n }\n }\n </td>\n }\n }\n </tr>\n </ng-template>\n }\n }\n\n <ng-template #footer>\n @if (footerEnabled) {\n @for (row of footerRows; track $index) {\n <tr class=\"p-datatable-row p-datatable-footer-row\">\n @for (cell of row; track $index) {\n <td colSpan=\"{{ cell.colSpan }}\" class=\"{{ cell.class }} text-right font-bold p-3 pb-0\">{{\n applyPipe(cell.value,\n cell.pipeConfig) }}</td>\n\n }\n </tr>\n }\n\n }\n </ng-template>\n <ng-template #expandedrow let-item>\n <tr>\n <td colspan=\"100%\">\n <div class=\"p-datatable-row-expansion\">\n <ng-container *ngTemplateOutlet=\"currentItemTemplate; context: { $implicit: item }\"></ng-container>\n\n </div>\n </td>\n </tr>\n </ng-template>\n </p-table>\n @if (showBottomToolbar()) {\n <div class=\"p-datatable-footer sticky bottom-2 z-9 animate__animated animate__fadeIn\">\n <lib-toolbar-ng>\n @if (showManagementSelectionConfig()) {\n <div toolbarStart\n class=\"p-datatable-footer-content flex items-center gap-3 px-4 rounded-lg animate__animated animate__fadeIn\">\n <span class=\"font-medium text-gray-700 dark:text-gray-300\">{{ getSelectedItemsLabel() }}</span>\n <div class=\"p-datatable-footer-badge flex items-center justify-center min-w-[28px] h-7 px-2 rounded-md\">\n <span class=\"font-semibold text-gray-900 dark:text-gray-100\">{{\n totalItemsSelected().toLocaleString()\n }}</span>\n </div>\n <span class=\"text-sm text-gray-600\">{{ getRecordsLabel() }}</span>\n <lib-button-ng [buttonConfig]=\"showSelectedItemsManagementButton()\"></lib-button-ng>\n </div>\n }\n </lib-toolbar-ng>\n </div>\n }\n</div>\n@if (httpMessage()) {\n<lib-http-message [(httpMessage)]=\"httpMessage\"></lib-http-message>\n}", styles: [".cursor-pointer{cursor:pointer}.empty-data-message{text-align:center;padding:2rem;color:#6c757d;font-style:italic}.table-title-container{background:var(--p-surface-50);border-bottom:1px solid var(--p-surface-200);padding:1.25rem 2rem;position:relative}.table-title{color:var(--p-text-color);font-size:1.5rem;font-weight:600;text-align:center;margin:0;letter-spacing:-.025em;text-shadow:0 1px 2px rgba(0,0,0,.05);background:linear-gradient(135deg,var(--p-text-color) 0%,var(--p-text-muted-color) 100%);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;position:relative}.table-title:after{content:\"\";position:absolute;bottom:-.5rem;left:50%;transform:translate(-50%);width:60px;height:2px;background:linear-gradient(90deg,var(--p-primary-color),var(--p-primary-600));border-radius:1px}:host ::ng-deep .p-datatable-paginator{background:var(--p-surface-100);border-top:1px solid var(--p-surface-300);padding:1rem}:host ::ng-deep .p-datatable-paginator .p-paginator{background:transparent;border:none;padding:0}:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-pages .p-paginator-page{background:var(--p-surface-200);border:1px solid var(--p-surface-300);color:var(--p-text-color)}:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-pages .p-paginator-page:hover{background:var(--p-surface-300);border-color:var(--p-primary-color)}:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-pages .p-paginator-page.p-highlight{background:var(--p-primary-color);border-color:var(--p-primary-color);color:var(--p-primary-contrast-color)}:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-first,:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-prev,:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-next,:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-last{background:var(--p-surface-200);border:1px solid var(--p-surface-300);color:var(--p-text-color)}:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-first:hover,:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-prev:hover,:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-next:hover,:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-last:hover{background:var(--p-surface-300);border-color:var(--p-primary-color)}:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-first:disabled,:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-prev:disabled,:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-next:disabled,:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-last:disabled{background:var(--p-surface-100);border-color:var(--p-surface-300);color:var(--p-text-muted-color)}:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-current{color:var(--p-text-color);font-weight:500}:host ::ng-deep .p-datatable-paginator .p-paginator .p-dropdown{background:var(--p-surface-200);border:1px solid var(--p-surface-300);color:var(--p-text-color)}:host ::ng-deep .p-datatable-paginator .p-paginator .p-dropdown:hover{border-color:var(--p-primary-color)}:host ::ng-deep .p-datatable-paginator .p-paginator .p-dropdown:focus{border-color:var(--p-primary-color);box-shadow:0 0 0 2px var(--p-primary-color-100)}.skeleton-row{pointer-events:none;-webkit-user-select:none;user-select:none;min-height:3rem}.skeleton-cell{position:relative;overflow:hidden;min-height:3rem;padding:.75rem .5rem!important}.skeleton-cell .skeleton-content{position:absolute;inset:.5rem;min-height:1.5rem;background:linear-gradient(90deg,#d1d5db33,#d1d5db66,#d1d5db33);background-size:200% 100%;animation:skeleton-loading 1.5s ease-in-out infinite;border-radius:4px}@keyframes skeleton-loading{0%{background-position:200% 0}to{background-position:-200% 0}}:host-context(.my-app-dark) .skeleton-cell .skeleton-content{background:linear-gradient(90deg,#4b556333,#4b556366,#4b556333);background-size:200% 100%}:host ::ng-deep .p-datatable .p-datatable-tbody .skeleton-row .skeleton-cell{width:auto;min-width:fit-content}:host-context(.my-app-dark) .table-title-container{background:var(--p-surface-800);border-bottom-color:var(--p-surface-700)}:host-context(.my-app-dark) .table-title{color:var(--p-text-color);background:linear-gradient(135deg,var(--p-text-color) 0%,var(--p-text-muted-color) 100%);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator{background:var(--p-surface-900);border-top-color:var(--p-surface-800)}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-pages .p-paginator-page{background:var(--p-surface-800);border-color:var(--p-surface-700);color:var(--p-text-color)}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-pages .p-paginator-page:hover{background:var(--p-surface-700);border-color:var(--p-primary-color)}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-pages .p-paginator-page.p-highlight{background:var(--p-primary-color);border-color:var(--p-primary-color);color:var(--p-primary-contrast-color)}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-first,:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-prev,:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-next,:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-last{background:var(--p-surface-800);border-color:var(--p-surface-700);color:var(--p-text-color)}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-first:hover,:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-prev:hover,:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-next:hover,:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-last:hover{background:var(--p-surface-700);border-color:var(--p-primary-color)}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-first:disabled,:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-prev:disabled,:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-next:disabled,:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-last:disabled{background:var(--p-surface-900);border-color:var(--p-surface-800);color:var(--p-text-muted-color)}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-current{color:var(--p-text-color)}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-dropdown{background:var(--p-surface-800);border-color:var(--p-surface-700);color:var(--p-text-color)}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-dropdown:hover{border-color:var(--p-primary-color)}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-dropdown:focus{border-color:var(--p-primary-color);box-shadow:0 0 0 2px var(--p-primary-color-100)}.flex{display:flex}.flex-col{flex-direction:column}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.justify-center{justify-content:center}.items-center{align-items:center}.text-center{text-align:center}.text-right{text-align:right}.text-left{text-align:left}.text-gray-400{color:#9ca3af}.text-gray-500{color:#6b7280}.text-gray-600{color:#4b5563}.text-gray-700{color:#374151}.text-gray-900{color:#111827}.text-blue-500{color:#3b82f6}.text-red-500{color:#ef4444}.text-green-500{color:#22c55e}.text-xs{font-size:.75rem;line-height:1rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.font-bold{font-weight:700}.italic{font-style:italic}.w-full{width:100%}.w-10{width:2.5rem}.h-10{height:2.5rem}.h-7{height:1.75rem}.min-w-28{min-width:28px}.mx-auto{margin-left:auto;margin-right:auto}.p-1{padding:.25rem}.p-3{padding:.75rem}.p-8{padding:2rem}.px-0{padding-left:0;padding-right:0}.py-0{padding-top:0;padding-bottom:0}.px-2{padding-left:.5rem;padding-right:.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.px-4{padding-left:1rem;padding-right:1rem}.pb-0{padding-bottom:0}.bg-gray-50{background-color:#f9fafb}.bg-gray-100{background-color:#f3f4f6}.bg-gray-200{background-color:#e5e7eb}.bg-gray-600{background-color:#4b5563}.bg-gray-700{background-color:#374151}.bg-gray-800{background-color:#1f2937}.bg-blue-100{background-color:#dbeafe}.bg-blue-200{background-color:#bfdbfe}.bg-blue-800{background-color:#1e40af}.bg-blue-900{background-color:#1e3a8a}.bg-green-200{background-color:#bbf7d0}.border-b{border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:var(--p-surface-300)}.border-l-4{border-left-width:4px;border-left-style:solid}.border-blue-500{border-color:#3b82f6}.rounded-full{border-radius:9999px}.rounded-md{border-radius:.375rem}.rounded-lg{border-radius:.5rem}.shadow-sm{box-shadow:0 1px 2px #0000000d}.shadow-lg{box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.sticky{position:sticky}.top-0{top:0}.bottom-2{bottom:.5rem}.bottom-18{bottom:4.5rem}.z-9{z-index:9}.z-10{z-index:10}.z-30{z-index:30}.hover\\:bg-gray-50:hover{background-color:#f9fafb}.hover\\:bg-gray-100:hover{background-color:#f3f4f6}.hover\\:bg-gray-200:hover{background-color:#e5e7eb}.hover\\:bg-blue-200:hover{background-color:#bfdbfe}.hover\\:bg-blue-800:hover{background-color:#1e40af}:host-context(.my-app-dark) .dark\\:bg-gray-800{background-color:#1f2937}:host-context(.my-app-dark) .dark\\:bg-gray-700{background-color:#374151}:host-context(.my-app-dark) .dark\\:bg-gray-600{background-color:#4b5563}:host-context(.my-app-dark) .dark\\:bg-blue-900{background-color:#1e3a8a}:host-context(.my-app-dark) .dark\\:bg-blue-800{background-color:#1e40af}:host-context(.my-app-dark) .dark\\:hover\\:bg-gray-800:hover{background-color:#1f2937}:host-context(.my-app-dark) .dark\\:hover\\:bg-gray-700:hover{background-color:#374151}:host-context(.my-app-dark) .dark\\:hover\\:bg-gray-600:hover{background-color:#4b5563}:host-context(.my-app-dark) .dark\\:hover\\:bg-blue-800:hover{background-color:#1e40af}.animate__animated{animation-duration:1s;animation-fill-mode:both}.animate__fadeIn{animation-name:fadeIn}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1$1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1$1.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i1$1.DatePipe, name: "date" }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i2$2.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "virtualRowHeight", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i2$2.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i2$2.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "directive", type: i2$2.RowToggler, selector: "[pRowToggler]", inputs: ["pRowToggler", "pRowTogglerDisabled"] }, { kind: "directive", type: i2$2.ResizableColumn, selector: "[pResizableColumn]", inputs: ["pResizableColumnDisabled"] }, { kind: "directive", type: i2$2.EditableColumn, selector: "[pEditableColumn]", inputs: ["pEditableColumn", "pEditableColumnField", "pEditableColumnRowIndex", "pEditableColumnDisabled", "pFocusCellSelector"] }, { kind: "component", type: i2$2.CellEditor, selector: "p-cellEditor" }, { kind: "component", type: i2$2.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i2$2.TableCheckbox, selector: "p-tableCheckbox", inputs: ["value", "disabled", "required", "index", "inputId", "name", "ariaLabel"] }, { kind: "component", type: i2$2.TableHeaderCheckbox, selector: "p-tableHeaderCheckbox", inputs: ["disabled", "inputId", "name", "ariaLabel"] }, { kind: "directive", type: i2$2.EditableRow, selector: "[pEditableRow]", inputs: ["pEditableRow", "pEditableRowDisabled"] }, { kind: "directive", type: i2$2.InitEditableRow, selector: "[pInitEditableRow]" }, { kind: "directive", type: i2$2.SaveEditableRow, selector: "[pSaveEditableRow]" }, { kind: "directive", type: i2$2.CancelEditableRow, selector: "[pCancelEditableRow]" }, { kind: "component", type: i2$2.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping", "showButtons", "ariaLabel", "filterButtonProps"], outputs: ["onShow", "onHide"] }, { kind: "component", type: ButtonNgComponent, selector: "lib-button-ng", inputs: ["buttonConfig"], outputs: ["buttonConfigChange", "onClick"] }, { kind: "component", type: ToolbarNgComponent, selector: "lib-toolbar-ng" }, { kind: "component", type: FormComponent, selector: "lib-form", inputs: ["formGroup", "controls", "formConfig", "httpMessage"], outputs: ["formGroupChange", "httpMessageChange", "formSubmit", "formChanges", "formChangesDebounced"] }, { kind: "pipe", type: KeyToDisplayNamePipe, name: "keyToDisplayName" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: InlineInputComponent, selector: "lib-inline-input", inputs: ["config", "value"], outputs: ["valueChange", "outputValue", "outputBlur", "outputDebounced"] }, { kind: "component", type: BadgeNgComponent, selector: "lib-badge-ng", inputs: ["config"], outputs: ["configChange"] }, { kind: "component", type: HttpMessageComponent, selector: "lib-http-message", inputs: ["httpMessage"], outputs: ["httpMessageChange"] }, { kind: "component", type: SpeedDialComponent, selector: "lib-speed-dial", inputs: ["speedDialConfig"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3462
+ }
3463
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TableNgComponent, decorators: [{
3464
+ type: Component,
3465
+ args: [{ selector: 'lib-table-ng', imports: [
3466
+ CommonModule,
3467
+ TableModule,
3468
+ ButtonNgComponent,
3469
+ ToolbarNgComponent,
3470
+ FormComponent,
3471
+ KeyToDisplayNamePipe,
3472
+ FormsModule,
3473
+ InlineInputComponent,
3474
+ BadgeNgComponent,
3475
+ HttpMessageComponent,
3476
+ SpeedDialComponent
3477
+ ], providers: [TableNgService, TableNgEditService], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let paginationConfig = config()?.paginationConfig;\n@let globalFilterConfig = config()?.globalFilterConfig;\n@let selectionTableConfig = config()?.selectionTableConfig;\n@let filterConfigByKey = config()?.filterConfigByKey;\n@let frozenColumnConfigByKey = config()?.frozenColumnConfigByKey;\n@let scrollConfig = config()?.scrollConfig;\n@let lazyLoadingConfig = config()?.lazyLoadingConfig;\n@let keysNames = config()?.keysNames;\n@let columnConfig = config()?.columnConfig;\n@let editEnabled = editConfig()?.isEnabled ?? false;\n@let editType = editConfig()?.type ?? 'cell';\n@let inlineControls = editConfig()?.inlineControls;\n@let rowErrorConfig = editConfig()?.rowEditConfig?.rowErrorConfig;\n@let footerRows = footerConfig()?.footerRows;\n@let footerEnabled = footerConfig()?.isEnabled ?? false;\n@let titleConfig = config()?.titleConfig;\n@let selectedColumns = config()?.selectedColumns;\n@let rowExpansionConfig = config()?.rowExpansionConfig;\n@let advancedIdentifierFiltersConfig = config()?.globalFilterConfig?.advancedIdentifierFiltersConfig;\n\n<div class=\"p-datatable-wrapper\">\n @if (titleConfig?.isEnabled && titleConfig?.title) {\n <div class=\"table-title-container\">\n <h2 class=\"table-title\">{{ titleConfig!.title }}</h2>\n </div>\n }\n @if (!hideToolbar || (filteredValue || advancedFiltersPerformed.length > 0)) {\n <lib-toolbar-ng class=\"p-toolbar-header sticky top-0 z-30 dark:bg-gray-800\">\n <div class=\"flex gap-2\" toolbarStart>\n @if (globalFilterConfig?.isEnabled && !lazyLoadingConfig?.isEnabled) {\n <lib-form [controls]=\"controlsGlobalFilter\" [(formGroup)]=\"searchFormGroupGlobalFilter\"\n (formSubmit)=\"submitGlobalSearch($event)\"></lib-form>\n }\n @if (advancedIdentifierFiltersConfig?.isEnabled) {\n <lib-button-ng class=\"animate__animated animate__fadeIn\"\n [buttonConfig]=\"advancedIdentifierFiltersButton()\"></lib-button-ng>\n }\n @if (filteredValue || advancedFiltersPerformed.length > 0) {\n <lib-button-ng class=\"animate__animated animate__fadeIn\" [buttonConfig]=\"clearFiltersButton()\"></lib-button-ng>\n }\n </div>\n <div class=\"flex gap-2\" toolbarEnd>\n @if (toolbarSpeedDialButtons().length > 0) {\n @for (speedDial of toolbarSpeedDialButtons(); track $index) {\n <lib-speed-dial [speedDialConfig]=\"speedDial\"></lib-speed-dial>\n }\n }\n @if (toolbarButtons().length > 0) {\n @for (button of toolbarButtons(); track $index) {\n <lib-button-ng [buttonConfig]=\"button\"></lib-button-ng>\n }\n }\n @if ((editType === 'row' || editType === 'cell') && editEnabled) {\n <lib-button-ng [buttonConfig]=\"addRowButton()\"></lib-button-ng>\n }\n @if (enableExcelButton()) {\n <lib-button-ng [buttonConfig]=\"excelButton\" (onClick)=\"exportData(dt,'excel')\"></lib-button-ng>\n }\n @if (enablePdfButton()) {\n <lib-button-ng [buttonConfig]=\"pdfButton\" (onClick)=\"exportData(dt,'pdf')\"></lib-button-ng>\n }\n @if (enableRefreshButton) {\n <lib-button-ng [buttonConfig]=\"refreshButton\"></lib-button-ng>\n }\n </div>\n </lib-toolbar-ng>\n }\n <p-table #dt styleClass=\"p-datatable-sm\" [value]=\"data()\" [lazy]=\"lazyLoadingConfig?.isEnabled ?? false\"\n [editMode]=\"editType\" [totalRecords]=\"\n lazyLoadingConfig?.isEnabled\n ? (lazyLoadingConfig?.totalRecords ?? 0)\n : data().length\n \" [customSort]=\"true\" [paginator]=\"paginationConfig?.paginator ?? true\" [showCurrentPageReport]=\"true\"\n [rows]=\"paginationConfig?.rows ?? 5\" [rowsPerPageOptions]=\"paginationConfig?.rowsPerPageOptions ?? [5, 10, 20]\"\n [paginatorStyleClass]=\"paginatorStyleClass()\" [resizableColumns]=\"true\" [rowTrackBy]=\"trackById\"\n [columns]=\"selectedColumns\" [scrollable]=\"scrollConfig?.isEnabled ?? false\"\n [scrollHeight]=\"scrollConfig?.isEnabled ? scrollHeight() : undefined\" (onLazyLoad)=\"onLazyLoad($event)\"\n (sortFunction)=\"customSort($event)\" (onFilter)=\"onFilter($event)\" [(selection)]=\"selectedItems\"\n [currentPageReportTemplate]=\"getCustomPageReport()\" selectionPageOnly=\"true\" dataKey=\"id\" class=\"w-full\">\n <ng-template #header let-columns>\n <tr>\n @if (rowExpansionConfig?.isEnabled) {\n <th alignFrozen=\"left\" pFrozenColumn style=\"width: 2rem\" class=\"p-datatable-header-cell p-frozen-column\">\n\n </th>\n }\n @if (selectionTableConfig?.isEnabled) {\n <th alignFrozen=\"left\" pFrozenColumn style=\"width: 2rem\" class=\"p-datatable-header-cell p-frozen-column\">\n <p-tableHeaderCheckbox />\n </th>\n }\n\n @if (selectedColumns) {\n @for (column of columns; track $index) {\n <th pResizableColumn [id]=\"column.field\" alignFrozen=\"right\" pFrozenColumn\n [frozen]=\"frozenHandle(frozenColumnConfigByKey?.[column.field])\" [pSortableColumn]=\"column.field\"\n class=\"p-datatable-header-cell\" [style.width.%]=\"columnConfig?.sizeByKey?.[column.field] ?? null\" [ngClass]=\"{\n 'p-frozen-column': frozenHandle(\n frozenColumnConfigByKey?.[column.field]\n ),\n }\">\n <div class=\"flex gap-2 justify-center items-center py-0 px-0\">\n {{ column.field | keyToDisplayName: keysNames }}\n @if(!editEnabled){\n <p-sortIcon [field]=\"column.field\" />\n }\n @if (filterConfigByKey?.[column.field]?.isEnabled) {\n <p-columnFilter type=\"text\" [field]=\"`rowData.${column.field}`\" display=\"menu\" [ngClass]=\"{\n 'bg-green-200 rounded-full p-1 shadow-sm text-green-500 transition-all duration-300 ease-in-out':\n advancedFiltersPerformed.includes(column.field),\n }\" [type]=\"\n filterConfigByKey?.[column.field]?.primeNgColumnFilterConfig?.type ??\n 'text'\n \" [matchMode]=\"\n filterConfigByKey?.[column.field]?.primeNgColumnFilterConfig\n ?.matchMode\n \" [showMatchModes]=\"\n filterConfigByKey?.[column.field]?.primeNgColumnFilterConfig\n ?.showMatchModes ?? false\n \" [showOperator]=\"\n filterConfigByKey?.[column.field]?.primeNgColumnFilterConfig\n ?.showOperator ?? false\n \" [showAddButton]=\"\n filterConfigByKey?.[column.field]?.primeNgColumnFilterConfig\n ?.showAddButton ?? false\n \" [showApplyButton]=\"\n filterConfigByKey?.[column.field]?.primeNgColumnFilterConfig\n ?.showApplyButton ?? false\n \" [showClearButton]=\"\n filterConfigByKey?.[column.field]?.primeNgColumnFilterConfig\n ?.showClearButton ?? false\n \">\n @if (\n filterConfigByKey?.[column.field]?.customColumnFilterConfig\n ?.isEnabled ?? false\n ) {\n <ng-template #filter let-value let-filter=\"filterCallback\">\n <div style=\"min-width: 20rem\" class=\"\">\n <lib-inline-input\n (outputValue)=\"inlineFormChanges($event, filter, filterConfigByKey?.[column.field]?.customColumnFilterConfig?.inlineControlConfig?.typeInput, column.field)\"\n (outputDebounced)=\"onFilter($event)\" [(ngModel)]=\"advancedFiltersValues()[column.field]\"\n [config]=\"filterConfigByKey?.[column.field]?.customColumnFilterConfig?.inlineControlConfig ?? {typeInput: ETypeInput.TEXT}\"></lib-inline-input>\n </div>\n </ng-template>\n }\n </p-columnFilter>\n }\n </div>\n </th>\n }\n }@else {\n @for (key of keys(); track $index) {\n <th [id]=\"key\" pResizableColumn alignFrozen=\"right\" pFrozenColumn\n [frozen]=\"frozenHandle(frozenColumnConfigByKey?.[key])\" [pSortableColumn]=\"key\"\n class=\"p-datatable-header-cell\" [style.width.%]=\"columnConfig?.sizeByKey?.[key] ?? null\" [ngClass]=\"{\n 'p-frozen-column': frozenHandle(frozenColumnConfigByKey?.[key]),\n }\">\n <div class=\"flex gap-2 justify-center items-center py-0 px-0\">\n {{ key | keyToDisplayName: keysNames }}\n @if(!editEnabled){\n <p-sortIcon [field]=\"key\" />\n }\n @if (filterConfigByKey?.[key]?.isEnabled) {\n <p-columnFilter type=\"text\" [field]=\"`rowData.${key}`\" display=\"menu\" [ngClass]=\"{\n 'bg-green-200 rounded-full p-1 shadow-sm text-green-500 transition-all duration-300 ease-in-out':\n advancedFiltersPerformed.includes(key),\n }\" [type]=\"filterConfigByKey?.[key]?.primeNgColumnFilterConfig?.type ?? 'text'\"\n [matchMode]=\"filterConfigByKey?.[key]?.primeNgColumnFilterConfig?.matchMode\"\n [showMatchModes]=\"filterConfigByKey?.[key]?.primeNgColumnFilterConfig?.showMatchModes ?? false\"\n [showOperator]=\"filterConfigByKey?.[key]?.primeNgColumnFilterConfig?.showOperator ?? false\"\n [showAddButton]=\"filterConfigByKey?.[key]?.primeNgColumnFilterConfig?.showAddButton ?? false\"\n [showApplyButton]=\"filterConfigByKey?.[key]?.primeNgColumnFilterConfig?.showApplyButton ?? false\"\n [showClearButton]=\"filterConfigByKey?.[key]?.primeNgColumnFilterConfig?.showClearButton ?? false\">\n @if (\n filterConfigByKey?.[key]?.customColumnFilterConfig\n ?.isEnabled ?? false\n ) {\n <ng-template #filter let-value let-filter=\"filterCallback\">\n <div style=\"min-width: 20rem\" class=\"\">\n <!-- <app-custom-advanced-filter filter\n [customColumnFilterConfig]=\"filterConfigByKey![key]!.customColumnFilterConfig!\"\n (formChanges)=\"formChanges($event, filter, key)\"\n [initialValue]=\"advancedFiltersValues[key]\"></app-custom-advanced-filter> -->\n <lib-inline-input\n (outputValue)=\"inlineFormChanges($event, filter, filterConfigByKey?.[key]?.customColumnFilterConfig?.inlineControlConfig?.typeInput, key)\"\n [(ngModel)]=\"advancedFiltersValues()[key]\"\n [config]=\"filterConfigByKey?.[key]?.customColumnFilterConfig?.inlineControlConfig ?? {typeInput: ETypeInput.TEXT}\"></lib-inline-input>\n </div>\n </ng-template>\n }\n </p-columnFilter>\n }\n </div>\n </th>\n }\n }\n\n @if (editType === 'cell' && editEnabled) {\n <th class=\"p-datatable-header-cell\" style=\"width: 100px\">\n </th>\n }\n @if (editType === 'row' && editEnabled) {\n <th class=\"p-datatable-header-cell\" style=\"width: 100px\">\n </th>\n }\n\n </tr>\n </ng-template>\n\n <ng-template #emptymessage>\n <tr>\n <td [attr.colspan]=\"totalColumns()\">\n @if (isLoading()) {\n <!-- Loading state -->\n <div class=\"p-8 text-center\">\n <div class=\"flex flex-col items-center justify-center gap-4\">\n <i class=\"pi pi-spin pi-spinner text-4xl text-blue-500\"></i>\n <p class=\"text-gray-600 text-lg\">{{ getLoadingMessage() }}</p>\n </div>\n </div>\n } @else if (timeoutExpired()) {\n <!-- No data available -->\n <div class=\"p-8 text-center text-gray-500\">\n <div class=\"flex flex-col items-center justify-center gap-3\">\n <i class=\"pi pi-info-circle text-4xl text-gray-400\"></i>\n <p class=\"text-lg\">{{ getNoDataMessage() }}</p>\n </div>\n </div>\n }\n </td>\n </tr>\n </ng-template>\n\n @if (hasRecords()) {\n @if (editEnabled) {\n @switch (editType) {\n @case ('cell') {\n <ng-template #body let-item let-editing=\"editing\">\n <tr class=\"p-datatable-row p-selectable-row\">\n @if (selectedColumns) {\n @for (column of selectedColumns; track $index){\n <td [pEditableColumn]=\"column.field\" pEditableColumnField=\"rowData.{{column.field}}\">\n <p-cellEditor>\n <ng-template #input>\n <lib-inline-input [(ngModel)]=\"item.rowData[column.field]\" (outputDebounced)=\"onEditData()\"\n [config]=\"inlineControls?.[column.field] ?? {typeInput: ETypeInput.TEXT}\">\n </lib-inline-input>\n </ng-template>\n <ng-template #output>\n @if (inlineControls?.[column.field]?.typeInput === ETypeInput.NUMBER) {\n <div class=\"text-right\">\n {{ item.rowData[column.field] | number: '1.2-2' }}\n\n </div>\n } @else if(inlineControls?.[column.field]?.typeInput === ETypeInput.CURRENCY) {\n <div class=\"text-right\">\n {{ item.rowData[column.field] | currency: item?.currencyTypeCellConfig?.[column.field]?.currency ??\n 'USD' }}\n </div>\n } @else if(inlineControls?.[column.field]?.typeInput === ETypeInput.DATE) {\n <div class=\"text-left\">\n {{ item.rowData[column.field] | date: \"dd/MM/yyyy\" }}\n </div>\n } @else if(inlineControls?.[column.field]?.typeInput === ETypeInput.DATETIME_LOCAL) {\n <div class=\"text-left\">\n {{ item.rowData[column.field] | date: \"dd/MM/yyyy HH:mm\" }}\n </div>\n } @else if(inlineControls?.[column.field]?.typeInput === ETypeInput.SWITCH) {\n <div class=\"text-center\">\n @if (item.rowData[column.field]) {\n <i class=\"fa-solid fa-check text-green-500\"></i>\n } @else {\n <i class=\"fa-solid fa-times text-red-500\"></i>\n }\n </div>\n } @else {\n @if (item.rowData[column.field]?.name) {\n {{ item.rowData[column.field]?.name }}\n } @else {\n {{ item.rowData[column.field] }}\n }\n }\n\n </ng-template>\n </p-cellEditor>\n </td>\n }\n } @else {\n @for (key of keys(); track $index){\n <td [pEditableColumn]=\"key\" pEditableColumnField=\"rowData.{{key}}\">\n <p-cellEditor>\n <ng-template #input>\n <lib-inline-input [(ngModel)]=\"item.rowData[key]\" (outputDebounced)=\"onEditData()\"\n [config]=\"inlineControls?.[key] ?? {typeInput: ETypeInput.TEXT}\">\n </lib-inline-input>\n </ng-template>\n <ng-template #output>\n @if (inlineControls?.[key]?.typeInput === ETypeInput.SWITCH) {\n <div class=\"text-center\">\n @if (item.rowData[key]) {\n <i class=\"fa-solid fa-check text-green-500\"></i>\n } @else {\n <i class=\"fa-solid fa-times text-red-500\"></i>\n }\n </div>\n } @else {\n {{ item.rowData[key] }}\n }\n </ng-template>\n </p-cellEditor>\n </td>\n }\n }\n @if (editType === 'cell' && editEnabled) {\n <td class=\"px-2 py-1 text-center\">\n <div class=\"flex justify-center items-center gap-2\">\n <lib-button-ng [buttonConfig]=\"getDeleteRowButton()\" (onClick)=\"deleteRow(item)\"></lib-button-ng>\n </div>\n </td>\n }\n </tr>\n </ng-template>\n }\n @case ('row') {\n <ng-template #body let-item let-editing=\"editing\" let-ri=\"rowIndex\">\n <tr [pEditableRow]=\"item\" class=\"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 border-b\">\n @if (selectedColumns) {\n @for (column of selectedColumns; track $index){\n <td>\n <div class=\"flex flex-col gap-2\">\n <p-cellEditor>\n <ng-template #input>\n <lib-inline-input [(ngModel)]=\"item.rowData[column.field]\"\n (outputValue)=\"inlineChange($event, column.field)\" (outputDebounced)=\"onEditData()\"\n [config]=\"inlineControls?.[column.field] ?? {typeInput: ETypeInput.TEXT}\">\n </lib-inline-input>\n\n </ng-template>\n <ng-template #output>\n\n @if (inlineControls?.[column.field]?.typeInput === ETypeInput.NUMBER) {\n <div class=\"text-right\">\n {{ item.rowData[column.field] | number: '1.2-2' }}\n\n </div>\n } @else if(inlineControls?.[column.field]?.typeInput === ETypeInput.CURRENCY) {\n <div class=\"text-right\">\n {{ item.rowData[column.field] | currency: item?.currencyTypeCellConfig?.[column.field]?.currency ??\n 'USD' }}\n </div>\n } @else if(inlineControls?.[column.field]?.typeInput === ETypeInput.DATE) {\n <div class=\"text-left\">\n {{ item.rowData[column.field] | date: \"dd/MM/yyyy\" }}\n </div>\n } @else if(inlineControls?.[column.field]?.typeInput === ETypeInput.DATETIME_LOCAL) {\n <div class=\"text-left\">\n {{ item.rowData[column.field] | date: \"dd/MM/yyyy HH:mm\" }}\n </div>\n } @else if(inlineControls?.[column.field]?.typeInput === ETypeInput.SWITCH) {\n <div class=\"text-center\">\n @if (item.rowData[column.field]) {\n <i class=\"fa-solid fa-check text-green-500\"></i>\n } @else {\n <i class=\"fa-solid fa-times text-red-500\"></i>\n }\n </div>\n } @else {\n @if (item.rowData[column.field]?.name) {\n {{ item.rowData[column.field]?.name }}\n } @else {\n {{ item.rowData[column.field] }}\n }\n }\n\n\n </ng-template>\n </p-cellEditor>\n\n @if (rowErrorConfig?.isEnabled && enableErrors && !rowFieldsHasValue()[column.field]) {\n <span class=\"text-red-500 italic text-xs\">{{\n rowErrorConfig?.fieldErrors?.[item.id]?.[column.field]?.message ??\n '' }}</span>\n }\n </div>\n </td>\n }\n } @else {\n @for (key of keys(); track $index){\n <td>\n <div class=\"flex flex-col gap-2\">\n <p-cellEditor>\n <ng-template #input>\n <lib-inline-input [(ngModel)]=\"item.rowData[key]\" (outputValue)=\"inlineChange($event, key)\"\n (outputDebounced)=\"onEditData()\" [config]=\"inlineControls?.[key] ?? {typeInput: ETypeInput.TEXT}\">\n </lib-inline-input>\n </ng-template>\n <ng-template #output>\n\n @if (inlineControls?.[key]?.typeInput === ETypeInput.NUMBER) {\n <div class=\"text-right\">\n {{ item.rowData[key] | number: '1.2-2' }}\n\n </div>\n }\n @else if(inlineControls?.[key]?.typeInput === ETypeInput.CURRENCY) {\n <div class=\"text-right\">\n {{ item.rowData[key] | currency: item?.currencyTypeCellConfig?.[key]?.currency ?? 'USD' }}\n </div>\n } @else if(inlineControls?.[key]?.typeInput === ETypeInput.SWITCH) {\n <div class=\"text-center\">\n @if (item.rowData[key]) {\n <i class=\"fa-solid fa-check text-green-500\"></i>\n } @else {\n <i class=\"fa-solid fa-times text-red-500\"></i>\n }\n </div>\n } @else {\n @if (item.rowData[key]?.name) {\n {{ item.rowData[key]?.name }}\n } @else {\n {{ item.rowData[key] }}\n }\n }\n\n\n </ng-template>\n </p-cellEditor>\n\n @if (rowErrorConfig?.isEnabled && enableErrors && !rowFieldsHasValue()[key]) {\n <span class=\"text-red-500 italic text-xs\">{{ rowErrorConfig?.fieldErrors?.[item.id]?.[key]?.message ??\n '' }}</span>\n }\n </div>\n </td>\n }\n }\n <td>\n <div class=\"flex justify-center items-center gap-2\">\n @if(!editing){\n <lib-button-ng pButton pRipple pInitEditableRow [buttonConfig]=\"getEditInitButton(item.id)\"\n (onClick)=\"onRowEditInit(item)\"></lib-button-ng>\n @if(!editConfig()?.rowEditConfig?.isDisabledDeleteButton){\n <lib-button-ng [buttonConfig]=\"getDeleteRowButton()\" (onClick)=\"deleteRow(item)\"></lib-button-ng>\n }\n }\n @if(editing){\n @if (hasErrorValues(rowErrorConfig?.fieldErrors?.[item.id] ?? {})) {\n <lib-button-ng [buttonConfig]=\"editSaveButtonWithErrors()\"\n (onClick)=\"onEditSaveWithErrors()\"></lib-button-ng>\n }\n @else {\n <lib-button-ng pButton pRipple pSaveEditableRow [buttonConfig]=\"editSaveButton()\"\n (onClick)=\"onRowEditSave(item)\"></lib-button-ng>\n }\n <lib-button-ng pButton pRipple pCancelEditableRow [buttonConfig]=\"editCancelButton()\"\n (onClick)=\"onRowEditCancel(item, ri)\"></lib-button-ng>\n }\n </div>\n </td>\n </tr>\n </ng-template>\n }\n }\n } @else {\n\n <ng-template #body let-item let-expanded=\"expanded\">\n <tr class=\"p-datatable-row p-selectable-row\" [ngClass]=\"{\n 'bg-gray-50 dark:bg-gray-800 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700': item.onClick && !item.isSelected && !item.isLoading,\n 'bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600': !item.onClick && !item.isSelected && !item.isLoading,\n 'bg-blue-100 dark:bg-blue-900 border-l-4 border-blue-500 hover:bg-blue-200 dark:hover:bg-blue-800': item.isSelected && !item.isLoading,\n 'skeleton-row': item.isLoading\n }\" (click)=\"item?.isLoading ? null : onRowClick(item)\">\n\n @if (rowExpansionConfig?.isEnabled) {\n <td (click)=\"$event.stopPropagation()\" [class.skeleton-cell]=\"item.isLoading\"\n [style.height]=\"item.isLoading ? '3rem' : 'auto'\">\n @if (!item.isLoading) {\n <lib-button-ng [buttonConfig]=\"rowExpansionButton(expanded)()\" type=\"button\" pRipple\n [pRowToggler]=\"item\"></lib-button-ng>\n } @else {\n <div class=\"skeleton-content\"></div>\n }\n </td>\n }\n\n @if (selectionTableConfig?.isEnabled) {\n <td (click)=\"$event.stopPropagation()\" alignFrozen=\"left\" pFrozenColumn class=\"shadow-lg\"\n [class.skeleton-cell]=\"item.isLoading\" [style.height]=\"item.isLoading ? '3rem' : 'auto'\">\n @if (!item.isLoading) {\n <p-tableCheckbox [id]=\"item\" [value]=\"item\" />\n } @else {\n <div class=\"skeleton-content\"></div>\n }\n </td>\n }\n\n @for (key of keys(); track $index) {\n @if (isThatItemInTheProductSelection(key)) {\n <td [id]=\"key\" class=\"p-datatable-cell\" [style.height]=\"item.isLoading ? '3rem' : 'min-content'\"\n alignFrozen=\"right\" pFrozenColumn [ngClass]=\"{\n 'p-frozen-column': frozenHandle(frozenColumnConfigByKey?.[key]),\n 'text-center': item.rowDataButtons?.[key] || item.typeCell?.[key] === ETypeInput.BADGE,\n 'skeleton-cell': item.isLoading\n }\" [frozen]=\"frozenHandle(frozenColumnConfigByKey?.[key])\">\n @if (item.isLoading) {\n <div class=\"skeleton-content\"></div>\n } @else {\n @if (item.rowDataButtons?.[key]) {\n <div class=\"flex gap-4 w-full justify-center items-center\">\n @for (btn of item.rowDataButtons[key]; track $index) {\n @if (btn) {\n <lib-button-ng class=\"w-full\" (click)=\"$event.stopPropagation()\" [buttonConfig]=\"btn\"></lib-button-ng>\n }\n }\n </div>\n } @else {\n @switch (item.typeCell?.[key]) {\n @case (ETypeInput.IMAGE) {\n <img [src]=\"item.rowData[key]\" alt=\"Image\" class=\"w-10 h-10 mx-auto\">\n }\n @case (ETypeInput.DATE) {\n {{ item.rowData[key] | date: \"dd/MM/yyyy\" }}\n }\n @case (ETypeInput.DATETIME_LOCAL) {\n {{ item.rowData[key] | date: \"dd/MM/yyyy HH:mm\" }}\n }\n @case (ETypeInput.CURRENCY) {\n {{item?.currencyTypeCellConfig?.[key]?.currency}} {{ item.rowData[key] | currency:\n item?.currencyTypeCellConfig?.[key]?.currency ?? 'USD' }}\n }\n @case (ETypeInput.BADGE) {\n <lib-badge-ng [config]=\"item.rowData[key]\"></lib-badge-ng>\n }\n @case (ETypeInput.COMPONENT) {\n <ng-container\n *ngTemplateOutlet=\"item.rowDataComponents?.[key]; context: { $implicit: item.raw }\"></ng-container>\n }\n @default {\n @if (isDate(item.rowData[key])) {\n {{ item.rowData[key] | date: \"dd/MM/yyyy\" }}\n } @else if (typeof item.rowData[key] === \"string\") {\n {{ item.rowData[key] }}\n } @else if (isPrimeNgSelection(item.rowData[key])) {\n {{ item.rowData[key].name }}\n } @else if(typeof item.rowData[key] === \"number\") {\n <p class=\"text-right\">\n {{ item.rowData[key] | number: '1.2-2' }}\n </p>\n }\n }\n }\n }\n }\n </td>\n }\n }\n </tr>\n </ng-template>\n }\n }\n\n <ng-template #footer>\n @if (footerEnabled) {\n @for (row of footerRows; track $index) {\n <tr class=\"p-datatable-row p-datatable-footer-row\">\n @for (cell of row; track $index) {\n <td colSpan=\"{{ cell.colSpan }}\" class=\"{{ cell.class }} text-right font-bold p-3 pb-0\">{{\n applyPipe(cell.value,\n cell.pipeConfig) }}</td>\n\n }\n </tr>\n }\n\n }\n </ng-template>\n <ng-template #expandedrow let-item>\n <tr>\n <td colspan=\"100%\">\n <div class=\"p-datatable-row-expansion\">\n <ng-container *ngTemplateOutlet=\"currentItemTemplate; context: { $implicit: item }\"></ng-container>\n\n </div>\n </td>\n </tr>\n </ng-template>\n </p-table>\n @if (showBottomToolbar()) {\n <div class=\"p-datatable-footer sticky bottom-2 z-9 animate__animated animate__fadeIn\">\n <lib-toolbar-ng>\n @if (showManagementSelectionConfig()) {\n <div toolbarStart\n class=\"p-datatable-footer-content flex items-center gap-3 px-4 rounded-lg animate__animated animate__fadeIn\">\n <span class=\"font-medium text-gray-700 dark:text-gray-300\">{{ getSelectedItemsLabel() }}</span>\n <div class=\"p-datatable-footer-badge flex items-center justify-center min-w-[28px] h-7 px-2 rounded-md\">\n <span class=\"font-semibold text-gray-900 dark:text-gray-100\">{{\n totalItemsSelected().toLocaleString()\n }}</span>\n </div>\n <span class=\"text-sm text-gray-600\">{{ getRecordsLabel() }}</span>\n <lib-button-ng [buttonConfig]=\"showSelectedItemsManagementButton()\"></lib-button-ng>\n </div>\n }\n </lib-toolbar-ng>\n </div>\n }\n</div>\n@if (httpMessage()) {\n<lib-http-message [(httpMessage)]=\"httpMessage\"></lib-http-message>\n}", styles: [".cursor-pointer{cursor:pointer}.empty-data-message{text-align:center;padding:2rem;color:#6c757d;font-style:italic}.table-title-container{background:var(--p-surface-50);border-bottom:1px solid var(--p-surface-200);padding:1.25rem 2rem;position:relative}.table-title{color:var(--p-text-color);font-size:1.5rem;font-weight:600;text-align:center;margin:0;letter-spacing:-.025em;text-shadow:0 1px 2px rgba(0,0,0,.05);background:linear-gradient(135deg,var(--p-text-color) 0%,var(--p-text-muted-color) 100%);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;position:relative}.table-title:after{content:\"\";position:absolute;bottom:-.5rem;left:50%;transform:translate(-50%);width:60px;height:2px;background:linear-gradient(90deg,var(--p-primary-color),var(--p-primary-600));border-radius:1px}:host ::ng-deep .p-datatable-paginator{background:var(--p-surface-100);border-top:1px solid var(--p-surface-300);padding:1rem}:host ::ng-deep .p-datatable-paginator .p-paginator{background:transparent;border:none;padding:0}:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-pages .p-paginator-page{background:var(--p-surface-200);border:1px solid var(--p-surface-300);color:var(--p-text-color)}:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-pages .p-paginator-page:hover{background:var(--p-surface-300);border-color:var(--p-primary-color)}:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-pages .p-paginator-page.p-highlight{background:var(--p-primary-color);border-color:var(--p-primary-color);color:var(--p-primary-contrast-color)}:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-first,:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-prev,:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-next,:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-last{background:var(--p-surface-200);border:1px solid var(--p-surface-300);color:var(--p-text-color)}:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-first:hover,:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-prev:hover,:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-next:hover,:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-last:hover{background:var(--p-surface-300);border-color:var(--p-primary-color)}:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-first:disabled,:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-prev:disabled,:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-next:disabled,:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-last:disabled{background:var(--p-surface-100);border-color:var(--p-surface-300);color:var(--p-text-muted-color)}:host ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-current{color:var(--p-text-color);font-weight:500}:host ::ng-deep .p-datatable-paginator .p-paginator .p-dropdown{background:var(--p-surface-200);border:1px solid var(--p-surface-300);color:var(--p-text-color)}:host ::ng-deep .p-datatable-paginator .p-paginator .p-dropdown:hover{border-color:var(--p-primary-color)}:host ::ng-deep .p-datatable-paginator .p-paginator .p-dropdown:focus{border-color:var(--p-primary-color);box-shadow:0 0 0 2px var(--p-primary-color-100)}.skeleton-row{pointer-events:none;-webkit-user-select:none;user-select:none;min-height:3rem}.skeleton-cell{position:relative;overflow:hidden;min-height:3rem;padding:.75rem .5rem!important}.skeleton-cell .skeleton-content{position:absolute;inset:.5rem;min-height:1.5rem;background:linear-gradient(90deg,#d1d5db33,#d1d5db66,#d1d5db33);background-size:200% 100%;animation:skeleton-loading 1.5s ease-in-out infinite;border-radius:4px}@keyframes skeleton-loading{0%{background-position:200% 0}to{background-position:-200% 0}}:host-context(.my-app-dark) .skeleton-cell .skeleton-content{background:linear-gradient(90deg,#4b556333,#4b556366,#4b556333);background-size:200% 100%}:host ::ng-deep .p-datatable .p-datatable-tbody .skeleton-row .skeleton-cell{width:auto;min-width:fit-content}:host-context(.my-app-dark) .table-title-container{background:var(--p-surface-800);border-bottom-color:var(--p-surface-700)}:host-context(.my-app-dark) .table-title{color:var(--p-text-color);background:linear-gradient(135deg,var(--p-text-color) 0%,var(--p-text-muted-color) 100%);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator{background:var(--p-surface-900);border-top-color:var(--p-surface-800)}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-pages .p-paginator-page{background:var(--p-surface-800);border-color:var(--p-surface-700);color:var(--p-text-color)}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-pages .p-paginator-page:hover{background:var(--p-surface-700);border-color:var(--p-primary-color)}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-pages .p-paginator-page.p-highlight{background:var(--p-primary-color);border-color:var(--p-primary-color);color:var(--p-primary-contrast-color)}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-first,:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-prev,:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-next,:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-last{background:var(--p-surface-800);border-color:var(--p-surface-700);color:var(--p-text-color)}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-first:hover,:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-prev:hover,:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-next:hover,:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-last:hover{background:var(--p-surface-700);border-color:var(--p-primary-color)}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-first:disabled,:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-prev:disabled,:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-next:disabled,:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-last:disabled{background:var(--p-surface-900);border-color:var(--p-surface-800);color:var(--p-text-muted-color)}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-paginator-current{color:var(--p-text-color)}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-dropdown{background:var(--p-surface-800);border-color:var(--p-surface-700);color:var(--p-text-color)}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-dropdown:hover{border-color:var(--p-primary-color)}:host-context(.my-app-dark) ::ng-deep .p-datatable-paginator .p-paginator .p-dropdown:focus{border-color:var(--p-primary-color);box-shadow:0 0 0 2px var(--p-primary-color-100)}.flex{display:flex}.flex-col{flex-direction:column}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.justify-center{justify-content:center}.items-center{align-items:center}.text-center{text-align:center}.text-right{text-align:right}.text-left{text-align:left}.text-gray-400{color:#9ca3af}.text-gray-500{color:#6b7280}.text-gray-600{color:#4b5563}.text-gray-700{color:#374151}.text-gray-900{color:#111827}.text-blue-500{color:#3b82f6}.text-red-500{color:#ef4444}.text-green-500{color:#22c55e}.text-xs{font-size:.75rem;line-height:1rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.font-bold{font-weight:700}.italic{font-style:italic}.w-full{width:100%}.w-10{width:2.5rem}.h-10{height:2.5rem}.h-7{height:1.75rem}.min-w-28{min-width:28px}.mx-auto{margin-left:auto;margin-right:auto}.p-1{padding:.25rem}.p-3{padding:.75rem}.p-8{padding:2rem}.px-0{padding-left:0;padding-right:0}.py-0{padding-top:0;padding-bottom:0}.px-2{padding-left:.5rem;padding-right:.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.px-4{padding-left:1rem;padding-right:1rem}.pb-0{padding-bottom:0}.bg-gray-50{background-color:#f9fafb}.bg-gray-100{background-color:#f3f4f6}.bg-gray-200{background-color:#e5e7eb}.bg-gray-600{background-color:#4b5563}.bg-gray-700{background-color:#374151}.bg-gray-800{background-color:#1f2937}.bg-blue-100{background-color:#dbeafe}.bg-blue-200{background-color:#bfdbfe}.bg-blue-800{background-color:#1e40af}.bg-blue-900{background-color:#1e3a8a}.bg-green-200{background-color:#bbf7d0}.border-b{border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:var(--p-surface-300)}.border-l-4{border-left-width:4px;border-left-style:solid}.border-blue-500{border-color:#3b82f6}.rounded-full{border-radius:9999px}.rounded-md{border-radius:.375rem}.rounded-lg{border-radius:.5rem}.shadow-sm{box-shadow:0 1px 2px #0000000d}.shadow-lg{box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.sticky{position:sticky}.top-0{top:0}.bottom-2{bottom:.5rem}.bottom-18{bottom:4.5rem}.z-9{z-index:9}.z-10{z-index:10}.z-30{z-index:30}.hover\\:bg-gray-50:hover{background-color:#f9fafb}.hover\\:bg-gray-100:hover{background-color:#f3f4f6}.hover\\:bg-gray-200:hover{background-color:#e5e7eb}.hover\\:bg-blue-200:hover{background-color:#bfdbfe}.hover\\:bg-blue-800:hover{background-color:#1e40af}:host-context(.my-app-dark) .dark\\:bg-gray-800{background-color:#1f2937}:host-context(.my-app-dark) .dark\\:bg-gray-700{background-color:#374151}:host-context(.my-app-dark) .dark\\:bg-gray-600{background-color:#4b5563}:host-context(.my-app-dark) .dark\\:bg-blue-900{background-color:#1e3a8a}:host-context(.my-app-dark) .dark\\:bg-blue-800{background-color:#1e40af}:host-context(.my-app-dark) .dark\\:hover\\:bg-gray-800:hover{background-color:#1f2937}:host-context(.my-app-dark) .dark\\:hover\\:bg-gray-700:hover{background-color:#374151}:host-context(.my-app-dark) .dark\\:hover\\:bg-gray-600:hover{background-color:#4b5563}:host-context(.my-app-dark) .dark\\:hover\\:bg-blue-800:hover{background-color:#1e40af}.animate__animated{animation-duration:1s;animation-fill-mode:both}.animate__fadeIn{animation-name:fadeIn}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}\n"] }]
3478
+ }], ctorParameters: () => [], propDecorators: { dt: [{
3479
+ type: ViewChild,
3480
+ args: ['dt']
3481
+ }], itemTemplate: [{
3482
+ type: ContentChild,
3483
+ args: ['item', { static: true }]
3484
+ }] } });
3485
+
3486
+ class SpeedDialNgService {
3487
+ constructor() { }
3488
+ _config = signal({});
3489
+ config = this._config.asReadonly();
3490
+ items = computed(() => this.config().items);
3491
+ buttonProps = computed(() => this.config().buttonProps ?? { severity: 'primary', rounded: true });
3492
+ tooltipOptions = computed(() => this.config().tooltipOptions ?? { tooltipPosition: 'top' });
3493
+ style = computed(() => this.config().style ?? {});
3494
+ direction = computed(() => this.config().direction ?? 'down');
3495
+ setConfig(value) {
3496
+ this._config.set(value);
3497
+ }
3498
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SpeedDialNgService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3499
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SpeedDialNgService, providedIn: 'root' });
3500
+ }
3501
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SpeedDialNgService, decorators: [{
3502
+ type: Injectable,
3503
+ args: [{
3504
+ providedIn: 'root'
3505
+ }]
3506
+ }], ctorParameters: () => [] });
3507
+
3508
+ class SpeedDialNgComponent {
3509
+ speedDialNgService = inject(SpeedDialNgService);
3510
+ configInput = input.required();
3511
+ constructor() {
3512
+ }
3513
+ ngOnInit() {
3514
+ this.speedDialNgService.setConfig(this.configInput());
3515
+ }
3516
+ get config() {
3517
+ return this.speedDialNgService.config();
3518
+ }
3519
+ get items() {
3520
+ return this.speedDialNgService.items();
3521
+ }
3522
+ get buttonProps() {
3523
+ return this.speedDialNgService.buttonProps();
3524
+ }
3525
+ get tooltipOptions() {
3526
+ return this.speedDialNgService.tooltipOptions();
3527
+ }
3528
+ get style() {
3529
+ return this.speedDialNgService.style();
3530
+ }
3531
+ get direction() {
3532
+ return this.speedDialNgService.direction();
3533
+ }
3534
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SpeedDialNgComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3535
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.17", type: SpeedDialNgComponent, isStandalone: true, selector: "lib-speed-dial-ng", inputs: { configInput: { classPropertyName: "configInput", publicName: "configInput", isSignal: true, isRequired: true, transformFunction: null } }, providers: [SpeedDialNgService], ngImport: i0, template: "\r\n<p-speeddial \r\n[model]=\"items\" \r\ndirection=\"up\" \r\n[style]=\"style\" \r\n[buttonProps]=\"buttonProps\" \r\n[tooltipOptions]=\"tooltipOptions\" \r\n[direction]=\"direction\"\r\n/>", styles: [""], dependencies: [{ kind: "ngmodule", type: SpeedDialModule }, { kind: "component", type: i1$5.SpeedDial, selector: "p-speeddial, p-speedDial, p-speed-dial", inputs: ["id", "model", "visible", "style", "className", "direction", "transitionDelay", "type", "radius", "mask", "disabled", "hideOnClickOutside", "buttonStyle", "buttonClassName", "maskStyle", "maskClassName", "showIcon", "hideIcon", "rotateAnimation", "ariaLabel", "ariaLabelledBy", "tooltipOptions", "buttonProps"], outputs: ["onVisibleChange", "visibleChange", "onClick", "onShow", "onHide"] }] });
3536
+ }
3537
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SpeedDialNgComponent, decorators: [{
3538
+ type: Component,
3539
+ args: [{ selector: 'lib-speed-dial-ng', imports: [SpeedDialModule], providers: [SpeedDialNgService], template: "\r\n<p-speeddial \r\n[model]=\"items\" \r\ndirection=\"up\" \r\n[style]=\"style\" \r\n[buttonProps]=\"buttonProps\" \r\n[tooltipOptions]=\"tooltipOptions\" \r\n[direction]=\"direction\"\r\n/>" }]
3540
+ }], ctorParameters: () => [] });
3541
+
3542
+ /*
3543
+ * Public API Surface of lib-components
3544
+
3545
+ NPM TOKEN:
3546
+ 4f5f941cb6703a2bea326507bd5098aa7dd8224ef4d9b434f6209c73855bf7ac
3547
+ 8b61ac2dab0cf90c13878339c755b09f868b34906ad196a1138433f76f41feb4
3548
+ 37b8f0500846352a33a9d1e2a8504e8a4332cd035a3819d9dc4b2dcdf557c3f0
3549
+ 31f1ccdf0a47736bd3851647d485385323328542c49de9d95498d875e3977f5e
3550
+ de13d65e8a0357ce9f2e18c899c8e7f6f728181baa031761ecdd7ef5cb166eb2
3551
+ */
3552
+
3553
+ /**
3554
+ * Generated bundle index. Do not edit.
3555
+ */
3556
+
3557
+ export { AminatedContainerComponent as A, BaseDialogComponent as B, DisabledContainerComponent as D, ETypeInput as E, FormComponent as F, HttpMessageComponent as H, InlineInputComponent as I, LibComponentsService as L, SpeedDialComponent as S, TableNgComponent as T, ButtonNgComponent as a, LibComponentsComponent as b, SpeedDialService as c, SpeedDialNgComponent as d };
3558
+ //# sourceMappingURL=ln-20-lib-components-ln-20-lib-components-B5izPne0.mjs.map