ln-20-lib-components 0.0.52 → 0.0.53

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