ln-20-lib-components 0.0.30 → 0.0.31

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