ngx-dsxlibrary 1.0.53 → 1.0.55
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.
- package/fesm2022/ngx-dsxlibrary-src-lib-components.mjs +12 -12
- package/fesm2022/ngx-dsxlibrary-src-lib-components.mjs.map +1 -1
- package/fesm2022/ngx-dsxlibrary-src-lib-pipe.mjs +6 -6
- package/fesm2022/ngx-dsxlibrary-src-lib-pipe.mjs.map +1 -1
- package/fesm2022/ngx-dsxlibrary.mjs +241 -73
- package/fesm2022/ngx-dsxlibrary.mjs.map +1 -1
- package/index.d.ts +646 -3
- package/ngx-dsxlibrary-1.0.55.tgz +0 -0
- package/package.json +11 -11
- package/src/lib/components/index.d.ts +24 -5
- package/src/lib/directives/index.d.ts +2 -5
- package/src/lib/injections/index.d.ts +2 -5
- package/src/lib/interceptors/index.d.ts +2 -5
- package/src/lib/models/index.d.ts +79 -3
- package/src/lib/pipe/index.d.ts +25 -5
- package/src/lib/services/index.d.ts +2 -5
- package/src/lib/validations/index.d.ts +2 -5
- package/lib/components/app-message-error/app-message-error.component.d.ts +0 -8
- package/lib/components/index.d.ts +0 -1
- package/lib/components/json-values-debuj/json-values-debuj.component.d.ts +0 -10
- package/lib/components/kpicard/kpicard.component.d.ts +0 -13
- package/lib/components/loading/loading.component.d.ts +0 -9
- package/lib/components/navbar-dsx/navbar-dsx.component.d.ts +0 -21
- package/lib/components/public-api.d.ts +0 -2
- package/lib/directives/select-all-on-focus.directive.d.ts +0 -6
- package/lib/injections/cache.token.d.ts +0 -2
- package/lib/injections/environment.token.d.ts +0 -10
- package/lib/injections/parameterSecurity.d.ts +0 -3
- package/lib/interceptors/http-authorize.interceptor.d.ts +0 -2
- package/lib/models/index.d.ts +0 -1
- package/lib/models/public-api.d.ts +0 -6
- package/lib/models/src/cache.types.d.ts +0 -18
- package/lib/models/src/column.model.d.ts +0 -9
- package/lib/models/src/error.model.d.ts +0 -9
- package/lib/models/src/extensions.model.d.ts +0 -15
- package/lib/models/src/field-config.model.d.ts +0 -7
- package/lib/models/src/response-http.model.d.ts +0 -7
- package/lib/models/src/securityParameter.model.d.ts +0 -17
- package/lib/models/src/token.model.d.ts +0 -5
- package/lib/pipe/index.d.ts +0 -1
- package/lib/pipe/json-highlight.pipe.d.ts +0 -7
- package/lib/pipe/public-api.d.ts +0 -2
- package/lib/pipe/truncate.pipe.d.ts +0 -16
- package/lib/services/alerta.service.d.ts +0 -116
- package/lib/services/authorize.service.d.ts +0 -21
- package/lib/services/cache.service.d.ts +0 -40
- package/lib/services/endpoint.service.d.ts +0 -14
- package/lib/services/error-handler.service.d.ts +0 -9
- package/lib/services/parameter-values.service.d.ts +0 -11
- package/lib/services/security.service.d.ts +0 -23
- package/lib/services/spinner-loading.service.d.ts +0 -9
- package/lib/services/utility-add.service.d.ts +0 -112
- package/lib/validations/addons.validators.d.ts +0 -32
- package/ngx-dsxlibrary-1.0.53.tgz +0 -0
- package/public-api.d.ts +0 -19
- package/src/lib/components/app-message-error/app-message-error.component.d.ts +0 -8
- package/src/lib/components/kpicard/kpicard.component.d.ts +0 -13
- package/src/lib/components/public-api.d.ts +0 -2
- package/src/lib/directives/public-api.d.ts +0 -1
- package/src/lib/injections/public-api.d.ts +0 -1
- package/src/lib/interceptors/public-api.d.ts +0 -1
- package/src/lib/models/public-api.d.ts +0 -6
- package/src/lib/models/src/cache.types.d.ts +0 -18
- package/src/lib/models/src/column.model.d.ts +0 -9
- package/src/lib/models/src/extensions.model.d.ts +0 -15
- package/src/lib/models/src/field-config.model.d.ts +0 -7
- package/src/lib/models/src/response-http.model.d.ts +0 -7
- package/src/lib/models/src/securityParameter.model.d.ts +0 -17
- package/src/lib/pipe/json-highlight.pipe.d.ts +0 -7
- package/src/lib/pipe/public-api.d.ts +0 -2
- package/src/lib/pipe/truncate.pipe.d.ts +0 -16
- package/src/lib/services/public-api.d.ts +0 -1
- package/src/lib/validations/public-api.d.ts +0 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,648 @@
|
|
|
1
|
+
import { AbstractControl, FormGroup, FormBuilder, ValidatorFn, ValidationErrors } from '@angular/forms';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { OnInit, ElementRef, InjectionToken, PipeTransform } from '@angular/core';
|
|
4
|
+
import { SweetAlertIcon, SweetAlertResult } from 'sweetalert2';
|
|
5
|
+
import { Observable } from 'rxjs';
|
|
6
|
+
import { HttpInterceptorFn } from '@angular/common/http';
|
|
7
|
+
import { JwtHelperService } from '@auth0/angular-jwt';
|
|
8
|
+
import { CookieService } from 'ngx-cookie-service';
|
|
9
|
+
|
|
10
|
+
declare class AppMessageErrorComponent {
|
|
11
|
+
control: AbstractControl | null;
|
|
12
|
+
form: FormGroup | null;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AppMessageErrorComponent, never>;
|
|
14
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AppMessageErrorComponent, "app-message-error", never, { "control": { "alias": "control"; "required": false; }; "form": { "alias": "form"; "required": false; }; }, {}, never, never, true, never>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare class KpicardComponent {
|
|
18
|
+
option: i0.InputSignal<"currency" | "integer" | "percent">;
|
|
19
|
+
label: i0.InputSignal<string>;
|
|
20
|
+
iconType: i0.InputSignal<string>;
|
|
21
|
+
color: i0.InputSignal<string | undefined>;
|
|
22
|
+
valor: i0.InputSignal<number>;
|
|
23
|
+
theme: i0.InputSignal<"light" | "dark" | "aqua" | "sunset" | "mint" | "peach" | "plasma" | "nebula">;
|
|
24
|
+
options: Record<'currency' | 'integer' | 'percent', any>;
|
|
25
|
+
getSelectedOption(): any;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KpicardComponent, never>;
|
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<KpicardComponent, "app-kpicard", never, { "option": { "alias": "option"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "iconType": { "alias": "iconType"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "valor": { "alias": "valor"; "required": false; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
declare class JsonValuesDebujComponent {
|
|
31
|
+
form: FormGroup;
|
|
32
|
+
private environment;
|
|
33
|
+
private readonly isDevSignal;
|
|
34
|
+
isDev(): boolean;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<JsonValuesDebujComponent, never>;
|
|
36
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<JsonValuesDebujComponent, "app-json-values-debuj", never, { "form": { "alias": "form"; "required": false; }; }, {}, never, never, true, never>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare class SpinnerLoadingService {
|
|
40
|
+
spinnerVisible: i0.WritableSignal<boolean>;
|
|
41
|
+
constructor();
|
|
42
|
+
show(): void;
|
|
43
|
+
hide(): void;
|
|
44
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SpinnerLoadingService, never>;
|
|
45
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SpinnerLoadingService>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
declare class LoadingComponent {
|
|
49
|
+
currentYear: number;
|
|
50
|
+
constructor();
|
|
51
|
+
_spinnerService: SpinnerLoadingService;
|
|
52
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LoadingComponent, never>;
|
|
53
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LoadingComponent, "app-loading", never, {}, {}, never, never, true, never>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
interface ResponseHttpModel {
|
|
57
|
+
isSuccess: boolean;
|
|
58
|
+
statusCode: number;
|
|
59
|
+
title: string;
|
|
60
|
+
statusMessage: string;
|
|
61
|
+
isAdmin: boolean;
|
|
62
|
+
}
|
|
63
|
+
|
|
1
64
|
/**
|
|
2
|
-
*
|
|
65
|
+
* Configuración personalizable para las alertas visuales
|
|
66
|
+
*
|
|
67
|
+
* @property icono - Nombre del archivo de imagen ubicado en 'assets/dsxResource/'.
|
|
68
|
+
* Ejemplo: 'success-icon.png'. Por defecto usa 'icon/check02.png'.
|
|
69
|
+
*
|
|
70
|
+
* @property icon - Tipo de icono SweetAlert2 incorporado. Valores posibles:
|
|
71
|
+
* 'success' | 'error' | 'warning' | 'info' | 'question'.
|
|
72
|
+
* Por defecto: 'success'.
|
|
73
|
+
*
|
|
74
|
+
* @property showConfirmButton - Determina si se muestra el botón de confirmación.
|
|
75
|
+
* Cuando es true, desactiva el cierre automático.
|
|
76
|
+
* Por defecto: false.
|
|
77
|
+
*
|
|
78
|
+
* @property confirmButtonText - Texto personalizado para el botón de confirmación.
|
|
79
|
+
* Por defecto: 'Ok'.
|
|
80
|
+
*
|
|
81
|
+
* @property timer - Tiempo en milisegundos para el cierre automático de la alerta.
|
|
82
|
+
* Se ignora si showConfirmButton es true.
|
|
83
|
+
* Por defecto: 2000 (2 segundos).
|
|
84
|
+
*
|
|
85
|
+
* @property imageWidth - Ancho en píxeles para la imagen personalizada.
|
|
86
|
+
* Por defecto: 125.
|
|
87
|
+
*
|
|
88
|
+
* @property imageHeight - Alto en píxeles para la imagen personalizada.
|
|
89
|
+
* Por defecto: 125.
|
|
90
|
+
*
|
|
91
|
+
* @property showImage - Controla si se muestra la imagen personalizada.
|
|
92
|
+
* Cuando es false, solo se muestra el icono de SweetAlert2.
|
|
93
|
+
* Por defecto: true.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* // Ejemplo de configuración básica
|
|
97
|
+
* const options: AlertOptions = {
|
|
98
|
+
* icono: 'custom-icon.png',
|
|
99
|
+
* icon: 'warning',
|
|
100
|
+
* timer: 3000
|
|
101
|
+
* };
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* // Ejemplo de alerta con botón de confirmación
|
|
105
|
+
* const confirmOptions: AlertOptions = {
|
|
106
|
+
* showConfirmButton: true,
|
|
107
|
+
* confirmButtonText: 'Aceptar',
|
|
108
|
+
* showImage: false
|
|
109
|
+
* };
|
|
3
110
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
111
|
+
interface AlertOptions {
|
|
112
|
+
icono?: string;
|
|
113
|
+
icon?: SweetAlertIcon;
|
|
114
|
+
showConfirmButton?: boolean;
|
|
115
|
+
confirmButtonText?: string;
|
|
116
|
+
timer?: number;
|
|
117
|
+
imageWidth?: number;
|
|
118
|
+
imageHeight?: number;
|
|
119
|
+
showImage?: boolean;
|
|
120
|
+
}
|
|
121
|
+
declare class AlertaService {
|
|
122
|
+
private toastrService;
|
|
123
|
+
/**
|
|
124
|
+
* @param {number} toastrType - 1. Success 2. Info 3. Warning 4. Error
|
|
125
|
+
* @param {string} toastrTitle - Titulo de la alerta
|
|
126
|
+
* @param {string} toastrMessage - Mensaje de la alerta
|
|
127
|
+
* @param {number} toastrAlign - Alineación de la alerta, por defecto 1. OPCIONES: 0. top-left 1. top-center 2. top-right 3. bottom-left 4. bottom-center 5. bottom-right
|
|
128
|
+
* @param {number} toastrTimer - Tiempo de la alerta default 3000
|
|
129
|
+
* @returns - Retonar una alerta toastr
|
|
130
|
+
* */
|
|
131
|
+
toastrAlerts(toastrType: number, toastrTitle: string, toastrMessage: string, toastrAlign?: number, toastrTimer?: number): void;
|
|
132
|
+
private preloadImage;
|
|
133
|
+
alertConfirm(title: string, text: string, icono: string): Promise<boolean>;
|
|
134
|
+
alertaHtml(titleAlert: string, message: string, icono?: string, timer?: number): Promise<void>;
|
|
135
|
+
/**
|
|
136
|
+
* Muestra una alerta visual personalizada usando SweetAlert2 con múltiples opciones de configuración
|
|
137
|
+
*
|
|
138
|
+
* @param titleAlert Título principal de la alerta (requerido)
|
|
139
|
+
* @param messageHtml Mensaje en formato HTML (requerido)
|
|
140
|
+
* @param options Opciones configurables de la alerta (opcional)
|
|
141
|
+
*
|
|
142
|
+
* @returns Promise<SweetAlertResult> que se resuelve cuando el usuario interactúa con la alerta
|
|
143
|
+
* o cuando se cierra automáticamente. Puedes usar .then() para manejar la respuesta.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* // Alerta básica con icono de éxito y cierre automático
|
|
147
|
+
* alertaHtmlSuccess('Operación exitosa', 'Los datos se guardaron correctamente');
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* // Alerta de error con imagen personalizada
|
|
151
|
+
* alertaHtmlSuccess('Error crítico', 'No se pudo conectar al servidor', {
|
|
152
|
+
* icono: 'error-icon.png',
|
|
153
|
+
* icon: 'error',
|
|
154
|
+
* timer: 5000
|
|
155
|
+
* });
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* // Alerta de confirmación con botón
|
|
159
|
+
* alertaHtmlSuccess('Confirmar acción', '¿Está seguro de eliminar este registro?', {
|
|
160
|
+
* showConfirmButton: true,
|
|
161
|
+
* confirmButtonText: 'Sí, eliminar',
|
|
162
|
+
* icon: 'warning',
|
|
163
|
+
* showImage: false
|
|
164
|
+
* }).then((result) => {
|
|
165
|
+
* if (result.isConfirmed) {
|
|
166
|
+
* // Lógica cuando el usuario confirma
|
|
167
|
+
* }
|
|
168
|
+
* });
|
|
169
|
+
*/
|
|
170
|
+
alertaHtmlSuccess(titleAlert: string, messageHtml: string, options?: AlertOptions): Promise<SweetAlertResult>;
|
|
171
|
+
private configureTimer;
|
|
172
|
+
toastrHttpResponse(response: ResponseHttpModel): void;
|
|
173
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AlertaService, never>;
|
|
174
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AlertaService>;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
interface ParameterValue {
|
|
178
|
+
value: number;
|
|
179
|
+
}
|
|
180
|
+
interface ParameterSecurity {
|
|
181
|
+
parameterName: string;
|
|
182
|
+
parameterValues: ParameterValue[];
|
|
183
|
+
}
|
|
184
|
+
interface SeguridadITParameter {
|
|
185
|
+
sistemaId: number;
|
|
186
|
+
sistema: string;
|
|
187
|
+
parameterBase: string | null;
|
|
188
|
+
parameterSecurity: ParameterSecurity[];
|
|
189
|
+
}
|
|
190
|
+
interface MyParameterValues {
|
|
191
|
+
parameterName: string;
|
|
192
|
+
values: number[];
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
declare class ParameterValuesService {
|
|
196
|
+
private initialParameters;
|
|
197
|
+
private _dataParameter;
|
|
198
|
+
get dataParameter(): MyParameterValues[];
|
|
199
|
+
set dataParameter(values: MyParameterValues[]);
|
|
200
|
+
getAllParameterValues(data: SeguridadITParameter): MyParameterValues[];
|
|
201
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ParameterValuesService, never>;
|
|
202
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ParameterValuesService>;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
interface ModelToken {
|
|
206
|
+
token: string;
|
|
207
|
+
tokenRefresh: string;
|
|
208
|
+
refreshTokenExpiry: Date;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
declare class SecurityService {
|
|
212
|
+
private http;
|
|
213
|
+
private environment;
|
|
214
|
+
private urlApi;
|
|
215
|
+
/**
|
|
216
|
+
* Método para obtener un nuevo token de acceso utilizando un refresh token.
|
|
217
|
+
* @param refreshToken El refresh token que se utilizará para obtener un nuevo token de acceso.
|
|
218
|
+
* @returns Un Observable que emite un objeto de tipo ModelToken.
|
|
219
|
+
*/
|
|
220
|
+
tokenRefresh(refreshToken: string): Observable<ModelToken>;
|
|
221
|
+
/**
|
|
222
|
+
* Método para obtener los parámetros de seguridad.
|
|
223
|
+
* @param invalidCacheParam Indica si se debe invalidar la caché (opcional, por defecto es false).
|
|
224
|
+
* @returns Un Observable que emite un objeto de tipo SeguridadITParameter.
|
|
225
|
+
*/
|
|
226
|
+
getParameterSecurity(invalidCacheParam?: boolean): Observable<SeguridadITParameter>;
|
|
227
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SecurityService, never>;
|
|
228
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SecurityService>;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
declare class NavbarDsxComponent implements OnInit {
|
|
232
|
+
_securityService: SecurityService;
|
|
233
|
+
_parameterSecurityService: ParameterValuesService;
|
|
234
|
+
_alertaService: AlertaService;
|
|
235
|
+
logoWidth: i0.InputSignal<string>;
|
|
236
|
+
appVersion: i0.InputSignal<string>;
|
|
237
|
+
urlLogo: i0.InputSignal<string>;
|
|
238
|
+
checked: boolean;
|
|
239
|
+
ngOnInit(): void;
|
|
240
|
+
initializeTheme(): void;
|
|
241
|
+
onThemeChange(isDarkMode: boolean): void;
|
|
242
|
+
applyTheme(theme: string): void;
|
|
243
|
+
actualizarSeguridadIT(): void;
|
|
244
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NavbarDsxComponent, never>;
|
|
245
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NavbarDsxComponent, "app-navbar-dsx", never, { "logoWidth": { "alias": "logoWidth"; "required": false; "isSignal": true; }; "appVersion": { "alias": "appVersion"; "required": false; "isSignal": true; }; "urlLogo": { "alias": "urlLogo"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Directiva que permite solo la entrada de:
|
|
250
|
+
* - Dígitos (0-9)
|
|
251
|
+
* - Separadores punto (.)
|
|
252
|
+
* - Rango con guión (-)
|
|
253
|
+
*
|
|
254
|
+
* Ejemplos válidos:
|
|
255
|
+
* - 1.2.3
|
|
256
|
+
* - 4-6
|
|
257
|
+
* - 1.3.5-9
|
|
258
|
+
*
|
|
259
|
+
* Restringe:
|
|
260
|
+
* - Letras
|
|
261
|
+
* - Espacios
|
|
262
|
+
* - Caracteres especiales
|
|
263
|
+
* - Doble punto (..), doble guión (--), o combinaciones como (.-)
|
|
264
|
+
*/
|
|
265
|
+
declare class OnlyRangoPatternDirective {
|
|
266
|
+
private el;
|
|
267
|
+
constructor(el: ElementRef<HTMLInputElement>);
|
|
268
|
+
/**
|
|
269
|
+
* Expresión regular para permitir caracteres válidos individualmente (tecla por tecla).
|
|
270
|
+
*/
|
|
271
|
+
private keyRegex;
|
|
272
|
+
/**
|
|
273
|
+
* Escucha el evento de teclado y permite únicamente teclas válidas.
|
|
274
|
+
* También evita combinaciones inválidas como `..`, `--`, `.1`, etc.
|
|
275
|
+
*/
|
|
276
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
277
|
+
/**
|
|
278
|
+
* Previene el pegado de cadenas que no cumplan con la estructura válida.
|
|
279
|
+
* Solo permite: número o número separados por punto o guión correctamente.
|
|
280
|
+
*/
|
|
281
|
+
onPaste(event: ClipboardEvent): void;
|
|
282
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OnlyRangoPatternDirective, never>;
|
|
283
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<OnlyRangoPatternDirective, "[appOnlyRangoPattern]", never, {}, {}, never, never, true, never>;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
declare class SelectAllOnFocusDirective {
|
|
287
|
+
selectAll(event: Event): void;
|
|
288
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SelectAllOnFocusDirective, never>;
|
|
289
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SelectAllOnFocusDirective, "[appSelectAllOnFocus]", never, {}, {}, never, never, true, never>;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
declare const CACHE_KEYS: InjectionToken<Record<string, string>>;
|
|
293
|
+
|
|
294
|
+
interface EnvironmentConfig {
|
|
295
|
+
production: boolean;
|
|
296
|
+
myAppUrl: string;
|
|
297
|
+
tokenName: string;
|
|
298
|
+
tokenNameRF: string;
|
|
299
|
+
sessionStatus: string;
|
|
300
|
+
refreshTokenExpiry: string;
|
|
301
|
+
}
|
|
302
|
+
declare const ENVIRONMENT: InjectionToken<EnvironmentConfig>;
|
|
303
|
+
|
|
304
|
+
declare const INITIAL_PARAMETERS: InjectionToken<MyParameterValues[]>;
|
|
305
|
+
|
|
306
|
+
declare const httpAuthorizeInterceptor: HttpInterceptorFn;
|
|
307
|
+
|
|
308
|
+
type InferCacheKeyType<T extends Record<string, string>> = keyof T;
|
|
309
|
+
/**
|
|
310
|
+
* Transforma un tipo de mapa `T` cuyas claves son simbólicas
|
|
311
|
+
* y cuyos valores son nombres de propiedades reales de caché,
|
|
312
|
+
* a un objeto donde esas propiedades reales son claves booleanas.
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
* ```ts
|
|
316
|
+
* type T = { cliente: 'invalidateCacheCliente' };
|
|
317
|
+
* InferCacheOptions<T> // { invalidateCacheCliente: boolean }
|
|
318
|
+
* ```
|
|
319
|
+
*/
|
|
320
|
+
type InferCacheOptions<T extends Record<string, string>> = {
|
|
321
|
+
[K in keyof T as T[K]]: boolean;
|
|
322
|
+
};
|
|
323
|
+
declare function createInitialCache<T extends Record<string, string>>(cacheKeys: T): {
|
|
324
|
+
-readonly [K in keyof T as T[K]]: boolean;
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
interface ExportColumn {
|
|
328
|
+
title: string;
|
|
329
|
+
dataKey: string;
|
|
330
|
+
}
|
|
331
|
+
interface Column {
|
|
332
|
+
field: string;
|
|
333
|
+
header?: string;
|
|
334
|
+
customExportHeader: string;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
interface typeModel<T> {
|
|
338
|
+
values: T[];
|
|
339
|
+
}
|
|
340
|
+
interface T {
|
|
341
|
+
[key: string]: any;
|
|
342
|
+
}
|
|
343
|
+
type TipoFechaConversion = 'short' | 'zh';
|
|
344
|
+
interface FechasConversion {
|
|
345
|
+
nombre: string;
|
|
346
|
+
tipo: TipoFechaConversion;
|
|
347
|
+
}
|
|
348
|
+
interface FilterOption {
|
|
349
|
+
value: string;
|
|
350
|
+
field?: string;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
type FieldConfig<T> = {
|
|
354
|
+
[K in keyof T]: {
|
|
355
|
+
value: T[K] | null;
|
|
356
|
+
disabled?: boolean;
|
|
357
|
+
validators?: any[];
|
|
358
|
+
};
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
declare class JsonHighlightPipe implements PipeTransform {
|
|
362
|
+
transform(value: any): string;
|
|
363
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<JsonHighlightPipe, never>;
|
|
364
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<JsonHighlightPipe, "jsonHighlight", true>;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
declare class TruncatePipe implements PipeTransform {
|
|
368
|
+
/**
|
|
369
|
+
* Transforma una cadena de texto truncándola según los parámetros proporcionados.
|
|
370
|
+
*
|
|
371
|
+
* @param value - La cadena de texto que se desea truncar.
|
|
372
|
+
* @param limit - El número máximo de caracteres permitidos. Por defecto es 100. Si no se encuentra un espacio dentro del límite, usa el límite original (15).
|
|
373
|
+
* @param completeWords - Si es true, evita cortar palabras a la mitad. Por defecto es false.
|
|
374
|
+
* @param ellipsis - La cadena que se añadirá al final del texto truncado. Por defecto es '...'.
|
|
375
|
+
* @returns La cadena truncada con el ellipsis añadido, si es necesario.
|
|
376
|
+
*/
|
|
377
|
+
transform(value: string, limit?: number, completeWords?: boolean, ellipsis?: string): string;
|
|
378
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TruncatePipe, never>;
|
|
379
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<TruncatePipe, "truncate", true>;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
declare class AuthorizeService {
|
|
383
|
+
private environment;
|
|
384
|
+
_cookieService: CookieService;
|
|
385
|
+
helperJwt: JwtHelperService;
|
|
386
|
+
private _isRefreshing;
|
|
387
|
+
private getCookieOptions;
|
|
388
|
+
private setCookie;
|
|
389
|
+
get isRefreshing(): boolean;
|
|
390
|
+
set isRefreshing(value: boolean);
|
|
391
|
+
getToken(): string | null;
|
|
392
|
+
getTokenRefresh(): string | null;
|
|
393
|
+
setLastActivity(): void;
|
|
394
|
+
tokenReload(tokens: ModelToken): void;
|
|
395
|
+
getTokenValid(token: string | null): boolean;
|
|
396
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuthorizeService, never>;
|
|
397
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AuthorizeService>;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
declare class CacheService<T extends Record<string, string>> {
|
|
401
|
+
/**
|
|
402
|
+
* Mapa de claves simbólicas a claves reales de caché.
|
|
403
|
+
* Se inyecta desde el proyecto consumidor mediante `CACHE_KEYS`.
|
|
404
|
+
*/
|
|
405
|
+
private keys;
|
|
406
|
+
/**
|
|
407
|
+
* Servicio de alerta utilizado para mostrar notificaciones al usuario.
|
|
408
|
+
*/
|
|
409
|
+
private alert;
|
|
410
|
+
/**
|
|
411
|
+
* Estado reactivo que contiene un objeto donde cada propiedad (clave real de caché)
|
|
412
|
+
* tiene un valor booleano que indica si el caché ha sido invalidado (`true`)
|
|
413
|
+
* o sigue siendo válido (`false`).
|
|
414
|
+
*
|
|
415
|
+
* Este estado es tipado automáticamente en función de los valores de `T`.
|
|
416
|
+
*/
|
|
417
|
+
private _options;
|
|
418
|
+
/**
|
|
419
|
+
* Obtiene el estado actual del caché.
|
|
420
|
+
* Cada propiedad representa una clave real de caché con su valor booleano.
|
|
421
|
+
*/
|
|
422
|
+
get options(): InferCacheOptions<T>;
|
|
423
|
+
/**
|
|
424
|
+
* Invalida una o más claves simbólicas, marcando su correspondiente
|
|
425
|
+
* propiedad de caché como `true` (invalidada).
|
|
426
|
+
*
|
|
427
|
+
* @param keysToInvalidate - Lista de claves simbólicas (`keyof T`) a invalidar.
|
|
428
|
+
*
|
|
429
|
+
* @example
|
|
430
|
+
* ```ts
|
|
431
|
+
* cacheService.invalidate(['cliente', 'empresa']);
|
|
432
|
+
* ```
|
|
433
|
+
*/
|
|
434
|
+
invalidate(keysToInvalidate?: (keyof T)[] | null): void;
|
|
435
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CacheService<any>, never>;
|
|
436
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CacheService<any>>;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
declare class EndpointService<T> {
|
|
440
|
+
private http;
|
|
441
|
+
private environment;
|
|
442
|
+
private getUrl;
|
|
443
|
+
list(endpoint: string, invalidateCache?: boolean): Observable<T[]>;
|
|
444
|
+
edit(endpoint: string, id: number): Observable<T>;
|
|
445
|
+
save(endpoint: string, values: T): Observable<ResponseHttpModel>;
|
|
446
|
+
delete(endpoint: string, values: T, softDelete?: boolean): Observable<ResponseHttpModel>;
|
|
447
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EndpointService<any>, never>;
|
|
448
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<EndpointService<any>>;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
declare class UtilityAddService {
|
|
452
|
+
private _serviceAlerta;
|
|
453
|
+
private environment;
|
|
454
|
+
/**
|
|
455
|
+
* Convierte una fecha a una cadena de texto formateada según la zona horaria especificada.
|
|
456
|
+
*
|
|
457
|
+
* @param {string | Date} fecha - La fecha que se desea convertir. Puede ser una cadena de texto o un objeto Date.
|
|
458
|
+
* @returns {string | null} - La fecha formateada en la zona horaria especificada o null si la fecha es null.
|
|
459
|
+
*/
|
|
460
|
+
convertirFechaSegunZonaHoraria(fecha: string | Date): string | null;
|
|
461
|
+
/**
|
|
462
|
+
* Convierte una fecha a un objeto Date en formato ISO, opcionalmente ajustando la hora al inicio del día.
|
|
463
|
+
*
|
|
464
|
+
* @param {string | Date} fecha - La fecha que se desea convertir. Puede ser una cadena de texto o un objeto Date.
|
|
465
|
+
* @param {boolean} initHour - Si es true, la hora se ajusta al inicio del día (00:00:00).
|
|
466
|
+
* @returns {Date | null} - La fecha convertida en formato Date o null si la fecha es null.
|
|
467
|
+
*/
|
|
468
|
+
convertirFechaISOString(fecha: string | Date, initHour?: boolean): Date | null;
|
|
469
|
+
/**
|
|
470
|
+
* Convierte una fecha a una cadena de texto en formato corto (YYYY-MM-DD).
|
|
471
|
+
*
|
|
472
|
+
* @param {string | Date} fecha - La fecha que se desea convertir. Puede ser una cadena de texto o un objeto Date.
|
|
473
|
+
* @param {boolean} initHour - Si es true, la hora se ajusta al inicio del día (00:00:00).
|
|
474
|
+
* @returns {string | null} - La fecha formateada en formato corto (YYYY-MM-DD) o null si la fecha es null.
|
|
475
|
+
*/
|
|
476
|
+
convertirFechaShort(fecha: string | Date, initHour?: boolean): string | null;
|
|
477
|
+
/**
|
|
478
|
+
* Convierte una fecha a una cadena de texto que representa solo la hora (HH:mm).
|
|
479
|
+
*
|
|
480
|
+
* @param {string | Date} fecha - La fecha que se desea convertir. Puede ser una cadena de texto o un objeto Date.
|
|
481
|
+
* @returns {string | null} - La hora formateada (HH:mm) o null si la fecha es null.
|
|
482
|
+
*/
|
|
483
|
+
convertirFechaTime(fecha: string | Date): string | null;
|
|
484
|
+
/**
|
|
485
|
+
* Convierte una fecha a una cadena de texto en formato timestamp (YYYYMMDD).
|
|
486
|
+
*
|
|
487
|
+
* @param {string | Date} fecha - La fecha que se desea convertir. Puede ser una cadena de texto o un objeto Date.
|
|
488
|
+
* @returns {string | null} - La fecha formateada en formato timestamp (YYYYMMDD) o null si la fecha es null.
|
|
489
|
+
*/
|
|
490
|
+
convertirTimeStampString(fecha: string | Date): string | null;
|
|
491
|
+
/**
|
|
492
|
+
* Crea un FormGroup tipado a partir de una configuración de campos.
|
|
493
|
+
*
|
|
494
|
+
* @param {FormBuilder} fb - Instancia de FormBuilder para crear el FormGroup.
|
|
495
|
+
* @param {FieldConfig<T>} config - Configuración de los campos del formulario.
|
|
496
|
+
* @param {ValidatorFn[]} groupValidators - Validadores adicionales a nivel de grupo.
|
|
497
|
+
* @returns {FormGroup} - El FormGroup creado.
|
|
498
|
+
*/
|
|
499
|
+
createTypedForm<T>(fb: FormBuilder, config: FieldConfig<T>, groupValidators?: ValidatorFn[]): FormGroup;
|
|
500
|
+
/**
|
|
501
|
+
* Sanitiza un modelo obteniendo valores de un formulario, aplicando conversiones de fecha según los campos especificados.
|
|
502
|
+
*
|
|
503
|
+
* @template T - El tipo genérico del modelo a procesar.
|
|
504
|
+
* @param form - El formulario reactivo de Angular del que se obtendrán los valores.
|
|
505
|
+
* @param campos - Un array de objetos que especifican los campos de fecha y el tipo de conversión a aplicar. Cada objeto debe contener:
|
|
506
|
+
* - `nombre`: El nombre del campo de fecha en el modelo.
|
|
507
|
+
* - `tipo`: El tipo de conversión que se debe aplicar (por ejemplo, `'short'` o `'zh'`).
|
|
508
|
+
* @param fieldName - (Opcional) El nombre de un campo específico en el formulario que contiene los datos. Si no se proporciona, se obtendrán todos los valores del formulario.
|
|
509
|
+
* @returns Un objeto del tipo `typeModel<T>` que contiene un array `values` con los datos procesados y las conversiones de fecha aplicadas.
|
|
510
|
+
* @throws Error - Si el campo especificado no existe en el formulario, o si un campo de fecha especificado no existe en los datos.
|
|
511
|
+
*/
|
|
512
|
+
sanitizarModelo<T>(form: any, campos: FechasConversion[], fieldName?: string): typeModel<T>;
|
|
513
|
+
/**
|
|
514
|
+
* Convierte una fecha al formato especificado.
|
|
515
|
+
*
|
|
516
|
+
* @param fecha - La fecha en formato string que se desea convertir.
|
|
517
|
+
* Debe estar en un formato reconocible por `Date` o en ISO 8601.
|
|
518
|
+
* @param tipo - El tipo de conversión a realizar. Actualmente soporta:
|
|
519
|
+
* - `'short'`: Convierte la fecha a un formato corto (día/mes/año).
|
|
520
|
+
* - `'zh'`: Convierte la fecha considerando la zona horaria configurada.
|
|
521
|
+
* @returns La fecha convertida como string según el tipo especificado.
|
|
522
|
+
* @throws Error - Si el tipo de conversión no es válido o soportado.
|
|
523
|
+
*/
|
|
524
|
+
private convertirFecha;
|
|
525
|
+
/**
|
|
526
|
+
* Maneja la respuesta de un archivo descargable
|
|
527
|
+
* @param fileObservable Observable que emite el Blob del archivo
|
|
528
|
+
* @param actionId 0 para abrir en nueva ventana, 1 para descargar
|
|
529
|
+
* @param fileName Nombre del archivo sin extensión
|
|
530
|
+
*/
|
|
531
|
+
handleFileResponse(fileObservable: Observable<Blob>, actionId: number, fileName: string): void;
|
|
532
|
+
private isExcelFile;
|
|
533
|
+
private getFileExtension;
|
|
534
|
+
private handleNonExcelFiles;
|
|
535
|
+
private forceDownload;
|
|
536
|
+
private revokeObjectUrl;
|
|
537
|
+
/**
|
|
538
|
+
*
|
|
539
|
+
* @param message - Texto que se desea mostrar en consola
|
|
540
|
+
* solo se visualiza en desarrollo para evitar mostrar información innecesaria en producción
|
|
541
|
+
*/
|
|
542
|
+
logIfNotProduction(message: any): void;
|
|
543
|
+
/**
|
|
544
|
+
* Marca todos los controles de un formulario como "tocados" y muestra un mensaje de alerta.
|
|
545
|
+
* @param form - El formulario que se va a validar.
|
|
546
|
+
*/
|
|
547
|
+
checkFormValid(form: FormGroup): void;
|
|
548
|
+
/**
|
|
549
|
+
* Obtiene valores únicos de un campo específico de un array de objetos
|
|
550
|
+
* @param data Array de objetos de tipo T
|
|
551
|
+
* @param field Campo del objeto del cual extraer valores únicos
|
|
552
|
+
* @returns FilterOption[] Listado filtrado, tipado y ordenado alfabéticamente
|
|
553
|
+
*/
|
|
554
|
+
getUniqueValues<T>(data: T[], field: keyof T): FilterOption[];
|
|
555
|
+
/**
|
|
556
|
+
* Función pura que procesa una cadena de texto conteniendo números individuales y/o rangos numéricos,
|
|
557
|
+
* devolviendo un array con todos los números expandidos.
|
|
558
|
+
*
|
|
559
|
+
* @param input - Cadena de texto con el formato: número[.número][.inicio-fin][...]
|
|
560
|
+
* @returns Array de números con todos los valores individuales y rangos expandidos
|
|
561
|
+
*
|
|
562
|
+
* @example
|
|
563
|
+
* // Uso básico
|
|
564
|
+
* const result = parseNumericRanges('1.5.7.10-12');
|
|
565
|
+
* // Retorna: [1, 5, 7, 10, 11, 12]
|
|
566
|
+
*
|
|
567
|
+
* @example
|
|
568
|
+
* // Con espacios y caracteres especiales
|
|
569
|
+
* const result = parseNumericRanges(' 3. 5-7 .10-12abc');
|
|
570
|
+
* // Retorna: [3, 5, 6, 7, 10, 11, 12]
|
|
571
|
+
*
|
|
572
|
+
* @example
|
|
573
|
+
* // Rangos invertidos (serán ignorados)
|
|
574
|
+
* const result = parseNumericRanges('10-8');
|
|
575
|
+
* // Retorna: [] (array vacío)
|
|
576
|
+
*
|
|
577
|
+
* @note
|
|
578
|
+
* Características especiales:
|
|
579
|
+
* - Elimina automáticamente espacios y caracteres no numéricos
|
|
580
|
+
* - Los números deben estar separados por puntos (.)
|
|
581
|
+
* - Los rangos deben usar guión (-) sin espacios entre números
|
|
582
|
+
* - Es tolerante a formatos inconsistentes
|
|
583
|
+
* - Omite elementos inválidos sin generar errores
|
|
584
|
+
*/
|
|
585
|
+
parseNumericRanges(input: string): number[];
|
|
586
|
+
/**
|
|
587
|
+
* Adaptador para procesar eventos de input y extraer rangos numéricos.
|
|
588
|
+
*
|
|
589
|
+
* @param event - Objeto Event del DOM, preferiblemente de un elemento input
|
|
590
|
+
* @returns Array de números generado a partir del valor del input
|
|
591
|
+
*
|
|
592
|
+
* @example
|
|
593
|
+
* // Uso en template Angular
|
|
594
|
+
* <input (input)="processNumericRangesFromEvent($event)">
|
|
595
|
+
*
|
|
596
|
+
* @example
|
|
597
|
+
* // Uso directo
|
|
598
|
+
* const result = processNumericRangesFromEvent(inputEvent);
|
|
599
|
+
*
|
|
600
|
+
* @note
|
|
601
|
+
* Esta función es un wrapper que:
|
|
602
|
+
* - Extrae el valor del input del evento
|
|
603
|
+
* - Delega el procesamiento a parseNumericRanges()
|
|
604
|
+
* - Mantiene compatibilidad con eventos de diferentes frameworks
|
|
605
|
+
*
|
|
606
|
+
* @dependencies
|
|
607
|
+
* Requiere que el evento tenga la propiedad target.value (standard DOM)
|
|
608
|
+
* Para otros tipos de eventos (ej. Angular Material) puede necesitar ajustes
|
|
609
|
+
*/
|
|
610
|
+
processNumericRangesFromEvent(event: Event): number[];
|
|
611
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UtilityAddService, never>;
|
|
612
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<UtilityAddService>;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
/**
|
|
616
|
+
* Valida que el control contenga un rango de fechas válido (dos fechas no nulas y válidas).
|
|
617
|
+
*/
|
|
618
|
+
declare function dateRangeValidator(control: AbstractControl): ValidationErrors | null;
|
|
619
|
+
/**
|
|
620
|
+
* Valida que una fecha única esté dentro de un rango mínimo y máximo.
|
|
621
|
+
* @param minDate Fecha mínima permitida.
|
|
622
|
+
* @param maxDate Fecha máxima permitida.
|
|
623
|
+
*/
|
|
624
|
+
declare function dateMinMaxValidator(minDate: Date, maxDate: Date): (control: AbstractControl) => ValidationErrors | null;
|
|
625
|
+
/**
|
|
626
|
+
* Valida que al menos uno de los campos especificados esté lleno.
|
|
627
|
+
* @param fields Los nombres de los campos a validar.
|
|
628
|
+
*/
|
|
629
|
+
declare function atLeastOneFieldRequiredValidator(fields: string[]): (formGroup: AbstractControl) => ValidationErrors | null;
|
|
630
|
+
/**
|
|
631
|
+
* Validador personalizado para verificar si un NIT (Número de Identificación Tributaria) es válido.
|
|
632
|
+
* Este validador se puede usar en formularios reactivos de Angular.
|
|
633
|
+
*
|
|
634
|
+
* @param control - El control del formulario que contiene el valor del NIT.
|
|
635
|
+
* @returns Un objeto de error si el NIT no es válido, o `null` si el NIT es válido.
|
|
636
|
+
*/
|
|
637
|
+
declare function nitValidator(control: AbstractControl): ValidationErrors | null;
|
|
638
|
+
/**
|
|
639
|
+
* Validador personalizado para verificar si un CUI (Código Único de Identificación) es válido.
|
|
640
|
+
* Este validador se puede usar en formularios reactivos de Angular.
|
|
641
|
+
*
|
|
642
|
+
* @param control - El control del formulario que contiene el valor del CUI.
|
|
643
|
+
* @returns Un objeto de error si el CUI no es válido, o `null` si el CUI es válido.
|
|
644
|
+
*/
|
|
645
|
+
declare function cuiValidator(control: AbstractControl): ValidationErrors | null;
|
|
646
|
+
|
|
647
|
+
export { AlertaService, AppMessageErrorComponent, AuthorizeService, CACHE_KEYS, CacheService, ENVIRONMENT, EndpointService, INITIAL_PARAMETERS, JsonHighlightPipe, JsonValuesDebujComponent, KpicardComponent, LoadingComponent, NavbarDsxComponent, OnlyRangoPatternDirective, ParameterValuesService, SecurityService, SelectAllOnFocusDirective, TruncatePipe, UtilityAddService, atLeastOneFieldRequiredValidator, createInitialCache, cuiValidator, dateMinMaxValidator, dateRangeValidator, httpAuthorizeInterceptor, nitValidator };
|
|
648
|
+
export type { Column, EnvironmentConfig, ExportColumn, FechasConversion, FieldConfig, FilterOption, InferCacheKeyType, InferCacheOptions, MyParameterValues, ParameterSecurity, ParameterValue, ResponseHttpModel, SeguridadITParameter, T, TipoFechaConversion, typeModel };
|
|
Binary file
|