ngx-dsxlibrary 1.0.61 → 1.0.63
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.mjs +183 -74
- package/fesm2022/ngx-dsxlibrary.mjs.map +1 -1
- package/index.d.ts +327 -260
- package/ngx-dsxlibrary-1.0.63.tgz +0 -0
- package/package.json +9 -9
- package/src/lib/models/index.d.ts +1 -1
- package/ngx-dsxlibrary-1.0.61.tgz +0 -0
package/index.d.ts
CHANGED
|
@@ -2,8 +2,6 @@ import * as i3 from '@angular/forms';
|
|
|
2
2
|
import { AbstractControl, FormGroup, FormBuilder, ValidatorFn, ValidationErrors } from '@angular/forms';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { OnInit, ElementRef, InjectionToken, PipeTransform, Provider } from '@angular/core';
|
|
5
|
-
import { SweetAlertIcon, SweetAlertResult } from 'sweetalert2';
|
|
6
|
-
import { Observable } from 'rxjs';
|
|
7
5
|
import { HttpInterceptorFn } from '@angular/common/http';
|
|
8
6
|
import * as i2 from '@angular/common';
|
|
9
7
|
import * as i1 from 'primeng/accordion';
|
|
@@ -37,8 +35,10 @@ import * as i28 from 'primeng/textarea';
|
|
|
37
35
|
import * as i29 from 'primeng/toast';
|
|
38
36
|
import * as i30 from 'primeng/togglebutton';
|
|
39
37
|
import * as i31 from 'primeng/tooltip';
|
|
38
|
+
import { SweetAlertIcon, SweetAlertResult } from 'sweetalert2';
|
|
40
39
|
import { JwtHelperService } from '@auth0/angular-jwt';
|
|
41
40
|
import { CookieService } from 'ngx-cookie-service';
|
|
41
|
+
import { Observable } from 'rxjs';
|
|
42
42
|
|
|
43
43
|
declare class AppMessageErrorComponent {
|
|
44
44
|
control: AbstractControl | null;
|
|
@@ -86,257 +86,9 @@ declare class LoadingComponent {
|
|
|
86
86
|
static ɵcmp: i0.ɵɵComponentDeclaration<LoadingComponent, "app-loading", never, {}, {}, never, never, true, never>;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
interface ResponseHttpModel {
|
|
90
|
-
isSuccess: boolean;
|
|
91
|
-
statusCode: number;
|
|
92
|
-
title: string;
|
|
93
|
-
statusMessage: string;
|
|
94
|
-
isAdmin: boolean;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Configuración personalizable para las alertas visuales
|
|
99
|
-
*
|
|
100
|
-
* @property icono - Nombre del archivo de imagen ubicado en 'assets/dsxResource/'.
|
|
101
|
-
* Ejemplo: 'success-icon.png'. Por defecto usa 'icon/check02.png'.
|
|
102
|
-
*
|
|
103
|
-
* @property icon - Tipo de icono SweetAlert2 incorporado. Valores posibles:
|
|
104
|
-
* 'success' | 'error' | 'warning' | 'info' | 'question'.
|
|
105
|
-
* Por defecto: 'success'.
|
|
106
|
-
*
|
|
107
|
-
* @property showConfirmButton - Determina si se muestra el botón de confirmación.
|
|
108
|
-
* Cuando es true, desactiva el cierre automático.
|
|
109
|
-
* Por defecto: false.
|
|
110
|
-
*
|
|
111
|
-
* @property confirmButtonText - Texto personalizado para el botón de confirmación.
|
|
112
|
-
* Por defecto: 'Ok'.
|
|
113
|
-
*
|
|
114
|
-
* @property timer - Tiempo en milisegundos para el cierre automático de la alerta.
|
|
115
|
-
* Se ignora si showConfirmButton es true.
|
|
116
|
-
* Por defecto: 2000 (2 segundos).
|
|
117
|
-
*
|
|
118
|
-
* @property imageWidth - Ancho en píxeles para la imagen personalizada.
|
|
119
|
-
* Por defecto: 125.
|
|
120
|
-
*
|
|
121
|
-
* @property imageHeight - Alto en píxeles para la imagen personalizada.
|
|
122
|
-
* Por defecto: 125.
|
|
123
|
-
*
|
|
124
|
-
* @property showImage - Controla si se muestra la imagen personalizada.
|
|
125
|
-
* Cuando es false, solo se muestra el icono de SweetAlert2.
|
|
126
|
-
* Por defecto: true.
|
|
127
|
-
*
|
|
128
|
-
* @example
|
|
129
|
-
* // Ejemplo de configuración básica
|
|
130
|
-
* const options: AlertOptions = {
|
|
131
|
-
* icono: 'custom-icon.png',
|
|
132
|
-
* icon: 'warning',
|
|
133
|
-
* timer: 3000
|
|
134
|
-
* };
|
|
135
|
-
*
|
|
136
|
-
* @example
|
|
137
|
-
* // Ejemplo de alerta con botón de confirmación
|
|
138
|
-
* const confirmOptions: AlertOptions = {
|
|
139
|
-
* showConfirmButton: true,
|
|
140
|
-
* confirmButtonText: 'Aceptar',
|
|
141
|
-
* showImage: false
|
|
142
|
-
* };
|
|
143
|
-
*/
|
|
144
|
-
interface AlertOptions {
|
|
145
|
-
icono?: string;
|
|
146
|
-
icon?: SweetAlertIcon;
|
|
147
|
-
showConfirmButton?: boolean;
|
|
148
|
-
confirmButtonText?: string;
|
|
149
|
-
timer?: number;
|
|
150
|
-
imageWidth?: number;
|
|
151
|
-
imageHeight?: number;
|
|
152
|
-
showImage?: boolean;
|
|
153
|
-
}
|
|
154
|
-
declare class AlertaService {
|
|
155
|
-
private toastrService;
|
|
156
|
-
/**
|
|
157
|
-
* @param {number} toastrType - 1. Success 2. Info 3. Warning 4. Error
|
|
158
|
-
* @param {string} toastrTitle - Titulo de la alerta
|
|
159
|
-
* @param {string} toastrMessage - Mensaje de la alerta
|
|
160
|
-
* @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
|
|
161
|
-
* @param {number} toastrTimer - Tiempo de la alerta default 3000
|
|
162
|
-
* @returns - Retonar una alerta toastr
|
|
163
|
-
* */
|
|
164
|
-
toastrAlerts(toastrType: number, toastrTitle: string, toastrMessage: string, toastrAlign?: number, toastrTimer?: number): void;
|
|
165
|
-
private preloadImage;
|
|
166
|
-
alertConfirm(title: string, text: string, icono: string): Promise<boolean>;
|
|
167
|
-
alertaHtml(titleAlert: string, message: string, icono?: string, timer?: number): Promise<void>;
|
|
168
|
-
/**
|
|
169
|
-
* Muestra una alerta visual personalizada usando SweetAlert2 con múltiples opciones de configuración
|
|
170
|
-
*
|
|
171
|
-
* @param titleAlert Título principal de la alerta (requerido)
|
|
172
|
-
* @param messageHtml Mensaje en formato HTML (requerido)
|
|
173
|
-
* @param options Opciones configurables de la alerta (opcional)
|
|
174
|
-
*
|
|
175
|
-
* @returns Promise<SweetAlertResult> que se resuelve cuando el usuario interactúa con la alerta
|
|
176
|
-
* o cuando se cierra automáticamente. Puedes usar .then() para manejar la respuesta.
|
|
177
|
-
*
|
|
178
|
-
* @example
|
|
179
|
-
* // Alerta básica con icono de éxito y cierre automático
|
|
180
|
-
* alertaHtmlSuccess('Operación exitosa', 'Los datos se guardaron correctamente');
|
|
181
|
-
*
|
|
182
|
-
* @example
|
|
183
|
-
* // Alerta de error con imagen personalizada
|
|
184
|
-
* alertaHtmlSuccess('Error crítico', 'No se pudo conectar al servidor', {
|
|
185
|
-
* icono: 'error-icon.png',
|
|
186
|
-
* icon: 'error',
|
|
187
|
-
* timer: 5000
|
|
188
|
-
* });
|
|
189
|
-
*
|
|
190
|
-
* @example
|
|
191
|
-
* // Alerta de confirmación con botón
|
|
192
|
-
* alertaHtmlSuccess('Confirmar acción', '¿Está seguro de eliminar este registro?', {
|
|
193
|
-
* showConfirmButton: true,
|
|
194
|
-
* confirmButtonText: 'Sí, eliminar',
|
|
195
|
-
* icon: 'warning',
|
|
196
|
-
* showImage: false
|
|
197
|
-
* }).then((result) => {
|
|
198
|
-
* if (result.isConfirmed) {
|
|
199
|
-
* // Lógica cuando el usuario confirma
|
|
200
|
-
* }
|
|
201
|
-
* });
|
|
202
|
-
*/
|
|
203
|
-
alertaHtmlSuccess(titleAlert: string, messageHtml: string, options?: AlertOptions): Promise<SweetAlertResult>;
|
|
204
|
-
private configureTimer;
|
|
205
|
-
toastrHttpResponse(response: ResponseHttpModel): void;
|
|
206
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AlertaService, never>;
|
|
207
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<AlertaService>;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
declare const INITIAL_PARAMETERS_FOR_TYPE: readonly ["pCreate", "pRead", "pUpdate", "pDelete"];
|
|
211
|
-
interface ParameterValue {
|
|
212
|
-
value: number;
|
|
213
|
-
}
|
|
214
|
-
interface ParameterSecurity {
|
|
215
|
-
parameterName: string;
|
|
216
|
-
parameterValues: ParameterValue[];
|
|
217
|
-
}
|
|
218
|
-
interface SeguridadITParameter {
|
|
219
|
-
sistemaId: number;
|
|
220
|
-
sistema: string;
|
|
221
|
-
parameterBase: string | null;
|
|
222
|
-
parameterSecurity: ParameterSecurity[];
|
|
223
|
-
}
|
|
224
|
-
interface MyParameterValues {
|
|
225
|
-
parameterName: string;
|
|
226
|
-
values: (string | number | boolean)[];
|
|
227
|
-
}
|
|
228
|
-
type ParameterName = (typeof INITIAL_PARAMETERS_FOR_TYPE)[number];
|
|
229
|
-
|
|
230
|
-
declare class ParameterValuesService {
|
|
231
|
-
/** Parámetros iniciales inyectados mediante INITIAL_PARAMETERS */
|
|
232
|
-
private initialParameters;
|
|
233
|
-
/** Servicio que contiene el método getParameterSecurity() */
|
|
234
|
-
private apiService;
|
|
235
|
-
/** Señal que contiene los parámetros cargados */
|
|
236
|
-
private _dataParameter;
|
|
237
|
-
/** Flag que indica si ya se cargaron los parámetros desde la API */
|
|
238
|
-
private _loaded;
|
|
239
|
-
/** ===================== GETTERS/SETTERS ===================== */
|
|
240
|
-
/**
|
|
241
|
-
* Devuelve los parámetros actuales como un array de solo lectura.
|
|
242
|
-
*/
|
|
243
|
-
get dataParameter(): Readonly<MyParameterValues[]>;
|
|
244
|
-
/**
|
|
245
|
-
* Setter privado para actualizar los parámetros.
|
|
246
|
-
* Solo puede ser usado dentro del servicio para mantener la integridad de los datos.
|
|
247
|
-
* @param values Array de parámetros a almacenar
|
|
248
|
-
*/
|
|
249
|
-
private setDataParameter;
|
|
250
|
-
/** ===================== MÉTODOS PRINCIPALES ===================== */
|
|
251
|
-
/**
|
|
252
|
-
* Carga los parámetros desde la API.
|
|
253
|
-
* Si ya se cargaron y force=false, devuelve la copia en memoria.
|
|
254
|
-
* @param force Indica si se debe forzar la recarga desde la API (default: false)
|
|
255
|
-
* @returns Observable que emite los parámetros cargados como MyParameterValues[]
|
|
256
|
-
*/
|
|
257
|
-
loadParameters(force?: boolean): Observable<MyParameterValues[]>;
|
|
258
|
-
/**
|
|
259
|
-
* Fuerza la recarga de los parámetros desde la API.
|
|
260
|
-
* @returns Observable que emite los parámetros actualizados
|
|
261
|
-
*/
|
|
262
|
-
refreshParameters(): Observable<MyParameterValues[]>;
|
|
263
|
-
/** ===================== MÉTODOS PRIVADOS ===================== */
|
|
264
|
-
/**
|
|
265
|
-
* Valida que los parámetros devueltos por la API coincidan con los iniciales.
|
|
266
|
-
* Muestra errores o advertencias en consola si existen diferencias.
|
|
267
|
-
* @param apiParameters Parámetros recibidos desde la API
|
|
268
|
-
*/
|
|
269
|
-
private validateParameters;
|
|
270
|
-
/**
|
|
271
|
-
* Transforma un array de ParameterSecurity en MyParameterValues
|
|
272
|
-
* @param apiParameters Parámetros recibidos desde la API
|
|
273
|
-
* @returns Array de MyParameterValues
|
|
274
|
-
*/
|
|
275
|
-
private mapToMyParameterValues;
|
|
276
|
-
/** ===================== HELPERS SEGUROS ===================== */
|
|
277
|
-
/**
|
|
278
|
-
* Obtiene un valor específico de un parámetro.
|
|
279
|
-
* Devuelve `defaultValue` si no existe o el índice es inválido.
|
|
280
|
-
* @param parameterName Nombre del parámetro
|
|
281
|
-
* @param index Índice del valor dentro del array (default: 0)
|
|
282
|
-
* @param defaultValue Valor por defecto si no existe
|
|
283
|
-
* @returns Valor del parámetro o defaultValue
|
|
284
|
-
*/
|
|
285
|
-
getValue<T = any>(parameterName: ParameterName, index?: number, defaultValue?: T | null): T;
|
|
286
|
-
/**
|
|
287
|
-
* Compara un valor específico con un valor esperado.
|
|
288
|
-
* @param parameterName Nombre del parámetro
|
|
289
|
-
* @param expectedValue Valor esperado
|
|
290
|
-
* @param index Índice del valor dentro del array (default: 0)
|
|
291
|
-
* @returns true si coincide, false en caso contrario
|
|
292
|
-
*/
|
|
293
|
-
isParameterValue<T = any>(parameterName: ParameterName, expectedValue: T, index?: number): boolean;
|
|
294
|
-
/**
|
|
295
|
-
* Verifica si un parámetro tiene al menos un valor.
|
|
296
|
-
* @param parameterName Nombre del parámetro
|
|
297
|
-
* @returns true si tiene al menos un valor, false si no tiene
|
|
298
|
-
*/
|
|
299
|
-
hasAnyValue(parameterName: ParameterName): boolean;
|
|
300
|
-
/**
|
|
301
|
-
* Devuelve todos los valores de un parámetro.
|
|
302
|
-
* @param parameterName Nombre del parámetro
|
|
303
|
-
* @returns Array de valores
|
|
304
|
-
*/
|
|
305
|
-
getAllValues<T = any>(parameterName: ParameterName): T[];
|
|
306
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ParameterValuesService, never>;
|
|
307
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ParameterValuesService>;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
interface ModelToken {
|
|
311
|
-
token: string;
|
|
312
|
-
tokenRefresh: string;
|
|
313
|
-
refreshTokenExpiry: Date;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
declare class SecurityService {
|
|
317
|
-
private http;
|
|
318
|
-
private environment;
|
|
319
|
-
private urlApi;
|
|
320
|
-
/**
|
|
321
|
-
* Método para obtener un nuevo token de acceso utilizando un refresh token.
|
|
322
|
-
* @param refreshToken El refresh token que se utilizará para obtener un nuevo token de acceso.
|
|
323
|
-
* @returns Un Observable que emite un objeto de tipo ModelToken.
|
|
324
|
-
*/
|
|
325
|
-
tokenRefresh(refreshToken: string): Observable<ModelToken>;
|
|
326
|
-
/**
|
|
327
|
-
* Método para obtener los parámetros de seguridad.
|
|
328
|
-
* @param invalidCacheParam Indica si se debe invalidar la caché (opcional, por defecto es false).
|
|
329
|
-
* @returns Un Observable que emite un objeto de tipo SeguridadITParameter.
|
|
330
|
-
*/
|
|
331
|
-
getParameterSecurity(invalidCacheParam?: boolean): Observable<SeguridadITParameter>;
|
|
332
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SecurityService, never>;
|
|
333
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<SecurityService>;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
89
|
declare class NavbarDsxComponent implements OnInit {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
_alertaService: AlertaService;
|
|
90
|
+
private _parameterSecurityService;
|
|
91
|
+
private _alertaService;
|
|
340
92
|
logoWidth: i0.InputSignal<string>;
|
|
341
93
|
appVersion: i0.InputSignal<string>;
|
|
342
94
|
urlLogo: i0.InputSignal<string>;
|
|
@@ -406,7 +158,25 @@ interface EnvironmentConfig {
|
|
|
406
158
|
}
|
|
407
159
|
declare const ENVIRONMENT: InjectionToken<EnvironmentConfig>;
|
|
408
160
|
|
|
409
|
-
|
|
161
|
+
interface ParameterValue {
|
|
162
|
+
value: number;
|
|
163
|
+
}
|
|
164
|
+
interface ParameterSecurity {
|
|
165
|
+
parameterName: string;
|
|
166
|
+
parameterValues: ParameterValue[];
|
|
167
|
+
}
|
|
168
|
+
interface SeguridadITParameter {
|
|
169
|
+
sistemaId: number;
|
|
170
|
+
sistema: string;
|
|
171
|
+
parameterBase: string | null;
|
|
172
|
+
parameterSecurity: ParameterSecurity[];
|
|
173
|
+
}
|
|
174
|
+
interface MyParameterValues<T extends string = string> {
|
|
175
|
+
parameterName: T;
|
|
176
|
+
values: (string | number | boolean)[];
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
declare const INITIAL_PARAMETERS: InjectionToken<MyParameterValues<string>[]>;
|
|
410
180
|
|
|
411
181
|
declare const httpAuthorizeInterceptor: HttpInterceptorFn;
|
|
412
182
|
|
|
@@ -445,7 +215,7 @@ interface typeModel<T> {
|
|
|
445
215
|
interface T {
|
|
446
216
|
[key: string]: any;
|
|
447
217
|
}
|
|
448
|
-
type TipoFechaConversion = 'short' | 'zh';
|
|
218
|
+
type TipoFechaConversion = 'short' | 'zh' | 'iso';
|
|
449
219
|
interface FechasConversion {
|
|
450
220
|
nombre: string;
|
|
451
221
|
tipo: TipoFechaConversion;
|
|
@@ -463,6 +233,14 @@ type FieldConfig<T> = {
|
|
|
463
233
|
};
|
|
464
234
|
};
|
|
465
235
|
|
|
236
|
+
interface ResponseHttpModel {
|
|
237
|
+
isSuccess: boolean;
|
|
238
|
+
statusCode: number;
|
|
239
|
+
title: string;
|
|
240
|
+
statusMessage: string;
|
|
241
|
+
isAdmin: boolean;
|
|
242
|
+
}
|
|
243
|
+
|
|
466
244
|
declare class DsxAddToolsModule {
|
|
467
245
|
static ɵfac: i0.ɵɵFactoryDeclaration<DsxAddToolsModule, never>;
|
|
468
246
|
static ɵmod: i0.ɵɵNgModuleDeclaration<DsxAddToolsModule, never, [typeof JsonValuesDebujComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof JsonValuesDebujComponent, typeof i3.ReactiveFormsModule]>;
|
|
@@ -496,6 +274,124 @@ declare class TruncatePipe implements PipeTransform {
|
|
|
496
274
|
static ɵpipe: i0.ɵɵPipeDeclaration<TruncatePipe, "truncate", true>;
|
|
497
275
|
}
|
|
498
276
|
|
|
277
|
+
/**
|
|
278
|
+
* Configuración personalizable para las alertas visuales
|
|
279
|
+
*
|
|
280
|
+
* @property icono - Nombre del archivo de imagen ubicado en 'assets/dsxResource/'.
|
|
281
|
+
* Ejemplo: 'success-icon.png'. Por defecto usa 'icon/check02.png'.
|
|
282
|
+
*
|
|
283
|
+
* @property icon - Tipo de icono SweetAlert2 incorporado. Valores posibles:
|
|
284
|
+
* 'success' | 'error' | 'warning' | 'info' | 'question'.
|
|
285
|
+
* Por defecto: 'success'.
|
|
286
|
+
*
|
|
287
|
+
* @property showConfirmButton - Determina si se muestra el botón de confirmación.
|
|
288
|
+
* Cuando es true, desactiva el cierre automático.
|
|
289
|
+
* Por defecto: false.
|
|
290
|
+
*
|
|
291
|
+
* @property confirmButtonText - Texto personalizado para el botón de confirmación.
|
|
292
|
+
* Por defecto: 'Ok'.
|
|
293
|
+
*
|
|
294
|
+
* @property timer - Tiempo en milisegundos para el cierre automático de la alerta.
|
|
295
|
+
* Se ignora si showConfirmButton es true.
|
|
296
|
+
* Por defecto: 2000 (2 segundos).
|
|
297
|
+
*
|
|
298
|
+
* @property imageWidth - Ancho en píxeles para la imagen personalizada.
|
|
299
|
+
* Por defecto: 125.
|
|
300
|
+
*
|
|
301
|
+
* @property imageHeight - Alto en píxeles para la imagen personalizada.
|
|
302
|
+
* Por defecto: 125.
|
|
303
|
+
*
|
|
304
|
+
* @property showImage - Controla si se muestra la imagen personalizada.
|
|
305
|
+
* Cuando es false, solo se muestra el icono de SweetAlert2.
|
|
306
|
+
* Por defecto: true.
|
|
307
|
+
*
|
|
308
|
+
* @example
|
|
309
|
+
* // Ejemplo de configuración básica
|
|
310
|
+
* const options: AlertOptions = {
|
|
311
|
+
* icono: 'custom-icon.png',
|
|
312
|
+
* icon: 'warning',
|
|
313
|
+
* timer: 3000
|
|
314
|
+
* };
|
|
315
|
+
*
|
|
316
|
+
* @example
|
|
317
|
+
* // Ejemplo de alerta con botón de confirmación
|
|
318
|
+
* const confirmOptions: AlertOptions = {
|
|
319
|
+
* showConfirmButton: true,
|
|
320
|
+
* confirmButtonText: 'Aceptar',
|
|
321
|
+
* showImage: false
|
|
322
|
+
* };
|
|
323
|
+
*/
|
|
324
|
+
interface AlertOptions {
|
|
325
|
+
icono?: string;
|
|
326
|
+
icon?: SweetAlertIcon;
|
|
327
|
+
showConfirmButton?: boolean;
|
|
328
|
+
confirmButtonText?: string;
|
|
329
|
+
timer?: number;
|
|
330
|
+
imageWidth?: number;
|
|
331
|
+
imageHeight?: number;
|
|
332
|
+
showImage?: boolean;
|
|
333
|
+
}
|
|
334
|
+
declare class AlertaService {
|
|
335
|
+
private toastrService;
|
|
336
|
+
/**
|
|
337
|
+
* @param {number} toastrType - 1. Success 2. Info 3. Warning 4. Error
|
|
338
|
+
* @param {string} toastrTitle - Titulo de la alerta
|
|
339
|
+
* @param {string} toastrMessage - Mensaje de la alerta
|
|
340
|
+
* @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
|
|
341
|
+
* @param {number} toastrTimer - Tiempo de la alerta default 3000
|
|
342
|
+
* @returns - Retonar una alerta toastr
|
|
343
|
+
* */
|
|
344
|
+
toastrAlerts(toastrType: number, toastrTitle: string, toastrMessage: string, toastrAlign?: number, toastrTimer?: number): void;
|
|
345
|
+
private preloadImage;
|
|
346
|
+
alertConfirm(title: string, text: string, icono: string): Promise<boolean>;
|
|
347
|
+
alertaHtml(titleAlert: string, message: string, icono?: string, timer?: number): Promise<void>;
|
|
348
|
+
/**
|
|
349
|
+
* Muestra una alerta visual personalizada usando SweetAlert2 con múltiples opciones de configuración
|
|
350
|
+
*
|
|
351
|
+
* @param titleAlert Título principal de la alerta (requerido)
|
|
352
|
+
* @param messageHtml Mensaje en formato HTML (requerido)
|
|
353
|
+
* @param options Opciones configurables de la alerta (opcional)
|
|
354
|
+
*
|
|
355
|
+
* @returns Promise<SweetAlertResult> que se resuelve cuando el usuario interactúa con la alerta
|
|
356
|
+
* o cuando se cierra automáticamente. Puedes usar .then() para manejar la respuesta.
|
|
357
|
+
*
|
|
358
|
+
* @example
|
|
359
|
+
* // Alerta básica con icono de éxito y cierre automático
|
|
360
|
+
* alertaHtmlSuccess('Operación exitosa', 'Los datos se guardaron correctamente');
|
|
361
|
+
*
|
|
362
|
+
* @example
|
|
363
|
+
* // Alerta de error con imagen personalizada
|
|
364
|
+
* alertaHtmlSuccess('Error crítico', 'No se pudo conectar al servidor', {
|
|
365
|
+
* icono: 'error-icon.png',
|
|
366
|
+
* icon: 'error',
|
|
367
|
+
* timer: 5000
|
|
368
|
+
* });
|
|
369
|
+
*
|
|
370
|
+
* @example
|
|
371
|
+
* // Alerta de confirmación con botón
|
|
372
|
+
* alertaHtmlSuccess('Confirmar acción', '¿Está seguro de eliminar este registro?', {
|
|
373
|
+
* showConfirmButton: true,
|
|
374
|
+
* confirmButtonText: 'Sí, eliminar',
|
|
375
|
+
* icon: 'warning',
|
|
376
|
+
* showImage: false
|
|
377
|
+
* }).then((result) => {
|
|
378
|
+
* if (result.isConfirmed) {
|
|
379
|
+
* // Lógica cuando el usuario confirma
|
|
380
|
+
* }
|
|
381
|
+
* });
|
|
382
|
+
*/
|
|
383
|
+
alertaHtmlSuccess(titleAlert: string, messageHtml: string, options?: AlertOptions): Promise<SweetAlertResult>;
|
|
384
|
+
toastrHttpResponse(response: ResponseHttpModel): void;
|
|
385
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AlertaService, never>;
|
|
386
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AlertaService>;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
interface ModelToken {
|
|
390
|
+
token: string;
|
|
391
|
+
tokenRefresh: string;
|
|
392
|
+
refreshTokenExpiry: Date;
|
|
393
|
+
}
|
|
394
|
+
|
|
499
395
|
declare class AuthorizeService {
|
|
500
396
|
private environment;
|
|
501
397
|
_cookieService: CookieService;
|
|
@@ -570,6 +466,150 @@ declare class EndpointService<T> {
|
|
|
570
466
|
static ɵprov: i0.ɵɵInjectableDeclaration<EndpointService<any>>;
|
|
571
467
|
}
|
|
572
468
|
|
|
469
|
+
declare class ParameterValuesService<T extends string = string> {
|
|
470
|
+
/**
|
|
471
|
+
* Parámetros iniciales inyectados mediante INITIAL_PARAMETERS.
|
|
472
|
+
* Se usan para validar y mapear los parámetros recibidos de la API.
|
|
473
|
+
*/
|
|
474
|
+
private initialParameters;
|
|
475
|
+
/**
|
|
476
|
+
* Cache interno para optimizar la comparación de valores de parámetros.
|
|
477
|
+
* La clave es una combinación de nombre e índice, el valor es el resultado de la consulta.
|
|
478
|
+
*/
|
|
479
|
+
private parameterCache;
|
|
480
|
+
private alertedParams;
|
|
481
|
+
/**
|
|
482
|
+
* Servicio que contiene el método getParameterSecurity() para obtener los parámetros desde la API.
|
|
483
|
+
*/
|
|
484
|
+
private apiService;
|
|
485
|
+
/**
|
|
486
|
+
* Señal reactiva que contiene los parámetros cargados y permite actualizaciones automáticas.
|
|
487
|
+
*/
|
|
488
|
+
private _dataParameter;
|
|
489
|
+
/**
|
|
490
|
+
* Flag que indica si ya se cargaron los parámetros desde la API.
|
|
491
|
+
*/
|
|
492
|
+
private _loaded;
|
|
493
|
+
/**
|
|
494
|
+
* Inicializa los datos de parámetros usando los valores inyectados.
|
|
495
|
+
* @returns Array de parámetros iniciales tipados
|
|
496
|
+
*/
|
|
497
|
+
private initializeData;
|
|
498
|
+
/**
|
|
499
|
+
* Crea una instancia de MyParameterValues tipada y segura.
|
|
500
|
+
* @param parameterName Nombre del parámetro
|
|
501
|
+
* @param values Valores asociados al parámetro
|
|
502
|
+
* @returns Objeto MyParameterValues
|
|
503
|
+
*/
|
|
504
|
+
private createMyParameterValue;
|
|
505
|
+
/**
|
|
506
|
+
* Devuelve los parámetros actuales como un array de solo lectura.
|
|
507
|
+
*/
|
|
508
|
+
get dataParameter(): Readonly<MyParameterValues<T>[]>;
|
|
509
|
+
/**
|
|
510
|
+
* Setter privado para actualizar los parámetros.
|
|
511
|
+
* Solo puede ser usado dentro del servicio para mantener la integridad de los datos.
|
|
512
|
+
* @param values Array de parámetros a almacenar
|
|
513
|
+
*/
|
|
514
|
+
private setDataParameter;
|
|
515
|
+
/**
|
|
516
|
+
* Carga los parámetros desde la API.
|
|
517
|
+
* Si ya se cargaron y force=false, devuelve la copia en memoria.
|
|
518
|
+
* @param force Indica si se debe forzar la recarga desde la API (default: false)
|
|
519
|
+
* @returns Observable que emite los parámetros cargados como MyParameterValues[]
|
|
520
|
+
*/
|
|
521
|
+
loadParameters(force?: boolean): Observable<MyParameterValues<T>[]>;
|
|
522
|
+
/**
|
|
523
|
+
* Fuerza la recarga de los parámetros desde la API.
|
|
524
|
+
* @returns Observable que emite los parámetros actualizados
|
|
525
|
+
*/
|
|
526
|
+
refreshParameters(): Observable<MyParameterValues<T>[]>;
|
|
527
|
+
/**
|
|
528
|
+
* Crea una copia segura y mutable de los parámetros actuales.
|
|
529
|
+
* @returns Array de parámetros
|
|
530
|
+
*/
|
|
531
|
+
private createSafeCopy;
|
|
532
|
+
/**
|
|
533
|
+
* Mapea los parámetros recibidos de la API a objetos tipados y seguros.
|
|
534
|
+
* @param apiParameters Parámetros recibidos desde la API
|
|
535
|
+
* @returns Array de MyParameterValues
|
|
536
|
+
*/
|
|
537
|
+
private mapToMyParameterValues;
|
|
538
|
+
/**
|
|
539
|
+
* Convierte un parámetro de la API a un objeto tipado, validando el nombre.
|
|
540
|
+
* @param param Parámetro recibido de la API
|
|
541
|
+
* @returns Objeto MyParameterValues o null si no es válido
|
|
542
|
+
*/
|
|
543
|
+
private convertToTypedParameter;
|
|
544
|
+
/**
|
|
545
|
+
* Verifica si un nombre de parámetro es válido según los parámetros iniciales.
|
|
546
|
+
* @param name Nombre a validar
|
|
547
|
+
* @returns true si es válido
|
|
548
|
+
*/
|
|
549
|
+
private isValidParameterName;
|
|
550
|
+
/**
|
|
551
|
+
* Valida que los parámetros devueltos por la API coincidan con los iniciales.
|
|
552
|
+
* Muestra errores o advertencias en consola si existen diferencias.
|
|
553
|
+
* @param apiParameters Parámetros recibidos desde la API
|
|
554
|
+
*/
|
|
555
|
+
private validateParameters;
|
|
556
|
+
/**
|
|
557
|
+
* Obtiene un valor específico de un parámetro.
|
|
558
|
+
* Devuelve `defaultValue` si no existe o el índice es inválido.
|
|
559
|
+
* @param parameterName Nombre del parámetro
|
|
560
|
+
* @param index Índice del valor dentro del array (default: 0)
|
|
561
|
+
* @param defaultValue Valor por defecto si no existe
|
|
562
|
+
* @returns Valor del parámetro o defaultValue
|
|
563
|
+
*/
|
|
564
|
+
getValue<U = any>(parameterName: T, index?: number, defaultValue?: U | null): U;
|
|
565
|
+
/**
|
|
566
|
+
* Compara un valor específico con un valor esperado, usando cache para optimizar llamadas repetidas.
|
|
567
|
+
* @param parameterName Nombre del parámetro
|
|
568
|
+
* @param expectedValue Valor esperado
|
|
569
|
+
* @param index Índice del valor dentro del array (default: 0)
|
|
570
|
+
* @returns true si coincide, false en caso contrario
|
|
571
|
+
*/
|
|
572
|
+
isParameterValue<U = any>(parameterName: T, expectedValue: U, index?: number): boolean;
|
|
573
|
+
/**
|
|
574
|
+
* Limpia el cache interno de comparaciones de parámetros.
|
|
575
|
+
*/
|
|
576
|
+
clearParameterCache(): void;
|
|
577
|
+
/**
|
|
578
|
+
* Verifica si un parámetro tiene al menos un valor.
|
|
579
|
+
* @param parameterName Nombre del parámetro
|
|
580
|
+
* @returns true si tiene al menos un valor, false si no tiene
|
|
581
|
+
*/
|
|
582
|
+
hasAnyValue(parameterName: T): boolean;
|
|
583
|
+
/**
|
|
584
|
+
* Devuelve todos los valores de un parámetro.
|
|
585
|
+
* @param parameterName Nombre del parámetro
|
|
586
|
+
* @returns Array de valores
|
|
587
|
+
*/
|
|
588
|
+
getAllValues<U = any>(parameterName: T): U[];
|
|
589
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ParameterValuesService<any>, never>;
|
|
590
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ParameterValuesService<any>>;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
declare class SecurityService {
|
|
594
|
+
private http;
|
|
595
|
+
private environment;
|
|
596
|
+
private urlApi;
|
|
597
|
+
/**
|
|
598
|
+
* Método para obtener un nuevo token de acceso utilizando un refresh token.
|
|
599
|
+
* @param refreshToken El refresh token que se utilizará para obtener un nuevo token de acceso.
|
|
600
|
+
* @returns Un Observable que emite un objeto de tipo ModelToken.
|
|
601
|
+
*/
|
|
602
|
+
tokenRefresh(refreshToken: string): Observable<ModelToken>;
|
|
603
|
+
/**
|
|
604
|
+
* Método para obtener los parámetros de seguridad.
|
|
605
|
+
* @param invalidCacheParam Indica si se debe invalidar la caché (opcional, por defecto es false).
|
|
606
|
+
* @returns Un Observable que emite un objeto de tipo SeguridadITParameter.
|
|
607
|
+
*/
|
|
608
|
+
getParameterSecurity(invalidCacheParam?: boolean): Observable<SeguridadITParameter>;
|
|
609
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SecurityService, never>;
|
|
610
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SecurityService>;
|
|
611
|
+
}
|
|
612
|
+
|
|
573
613
|
declare class UtilityAddService {
|
|
574
614
|
private _serviceAlerta;
|
|
575
615
|
private environment;
|
|
@@ -624,14 +664,21 @@ declare class UtilityAddService {
|
|
|
624
664
|
*
|
|
625
665
|
* @template T - El tipo genérico del modelo a procesar.
|
|
626
666
|
* @param form - El formulario reactivo de Angular del que se obtendrán los valores.
|
|
627
|
-
* @param campos -
|
|
667
|
+
* @param campos - Uno o más objetos que especifican los campos de fecha y el tipo de conversión a aplicar. Cada objeto debe contener:
|
|
628
668
|
* - `nombre`: El nombre del campo de fecha en el modelo.
|
|
629
669
|
* - `tipo`: El tipo de conversión que se debe aplicar (por ejemplo, `'short'` o `'zh'`).
|
|
630
|
-
* @
|
|
631
|
-
* @
|
|
632
|
-
*
|
|
670
|
+
* @returns Un objeto del tipo `typeModel<T>` con los datos procesados y las conversiones de fecha aplicadas.
|
|
671
|
+
* @throws Error - Si el campo de fecha especificado no existe en los datos del formulario.
|
|
672
|
+
*
|
|
673
|
+
* @example
|
|
674
|
+
* // Procesar varios campos de fecha
|
|
675
|
+
* const precioValues = service.sanitizarModelo<ItemPrecioModel>(
|
|
676
|
+
* form,
|
|
677
|
+
* { nombre: 'fechaInicio', tipo: 'short' },
|
|
678
|
+
* { nombre: 'fechaFin', tipo: 'zh' }
|
|
679
|
+
* );
|
|
633
680
|
*/
|
|
634
|
-
sanitizarModelo<T>(form: any, campos: FechasConversion[]
|
|
681
|
+
sanitizarModelo<T>(form: any, ...campos: FechasConversion[]): typeModel<T>;
|
|
635
682
|
/**
|
|
636
683
|
* Convierte una fecha al formato especificado.
|
|
637
684
|
*
|
|
@@ -643,6 +690,26 @@ declare class UtilityAddService {
|
|
|
643
690
|
* @returns La fecha convertida como string según el tipo especificado.
|
|
644
691
|
* @throws Error - Si el tipo de conversión no es válido o soportado.
|
|
645
692
|
*/
|
|
693
|
+
/**
|
|
694
|
+
* Convierte una fecha al formato especificado.
|
|
695
|
+
*
|
|
696
|
+
* @param fecha - La fecha en formato string que se desea convertir.
|
|
697
|
+
* Debe estar en un formato reconocible por `Date` o en ISO 8601.
|
|
698
|
+
* @param tipo - El tipo de conversión a realizar. Actualmente soporta:
|
|
699
|
+
* - `'short'`: Convierte la fecha a un formato corto (YYYY-MM-DD).
|
|
700
|
+
* - `'zh'`: Convierte la fecha considerando la zona horaria configurada.
|
|
701
|
+
* - `'iso'`: Convierte la fecha a formato ISO 8601 (string).
|
|
702
|
+
* @returns La fecha convertida como string según el tipo especificado.
|
|
703
|
+
* @throws Error - Si el tipo de conversión no es válido o soportado.
|
|
704
|
+
*
|
|
705
|
+
* @example
|
|
706
|
+
* // Formato corto
|
|
707
|
+
* service.convertirFecha('2025-08-21', 'short'); // '2025-08-21'
|
|
708
|
+
* // Zona horaria
|
|
709
|
+
* service.convertirFecha('2025-08-21', 'zh'); // '2025-08-21T00:00:00-06:00' (ejemplo)
|
|
710
|
+
* // Formato ISO
|
|
711
|
+
* service.convertirFecha('2025-08-21', 'iso'); // '2025-08-21T00:00:00.000Z'
|
|
712
|
+
*/
|
|
646
713
|
private convertirFecha;
|
|
647
714
|
/**
|
|
648
715
|
* Maneja la respuesta de un archivo descargable
|
|
@@ -767,4 +834,4 @@ declare function nitValidator(control: AbstractControl): ValidationErrors | null
|
|
|
767
834
|
declare function cuiValidator(control: AbstractControl): ValidationErrors | null;
|
|
768
835
|
|
|
769
836
|
export { AlertaService, AppMessageErrorComponent, AuthorizeService, CACHE_KEYS, CacheService, DsxAddToolsModule, ENVIRONMENT, EndpointService, INITIAL_PARAMETERS, JsonHighlightPipe, JsonValuesDebujComponent, KpicardComponent, LoadingComponent, NavbarDsxComponent, OnlyRangoPatternDirective, ParameterValuesService, PrimeNgModule, SecurityService, SelectAllOnFocusDirective, TruncatePipe, UtilityAddService, atLeastOneFieldRequiredValidator, createInitialCache, createTypedCacheProvider, cuiValidator, dateMinMaxValidator, dateRangeValidator, httpAuthorizeInterceptor, nitValidator };
|
|
770
|
-
export type { Column, EnvironmentConfig, ExportColumn, FechasConversion, FieldConfig, FilterOption, InferCacheKeyType, InferCacheOptions, MyParameterValues,
|
|
837
|
+
export type { Column, EnvironmentConfig, ExportColumn, FechasConversion, FieldConfig, FilterOption, InferCacheKeyType, InferCacheOptions, MyParameterValues, ParameterSecurity, ParameterValue, ResponseHttpModel, SeguridadITParameter, T, TipoFechaConversion, typeModel };
|
|
Binary file
|