@jvsoft/utils 1.0.0-alpha.5 → 1.0.0-alpha.7

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.
Files changed (56) hide show
  1. package/README.md +5 -0
  2. package/directives/autocomplete-match-validator.directive.d.ts +10 -0
  3. package/directives/autocomplete.directive.d.ts +23 -0
  4. package/{src/pipes → directives}/index.d.ts +1 -1
  5. package/directives/public-api.d.ts +2 -0
  6. package/fesm2022/jvsoft-utils-directives.mjs +150 -0
  7. package/fesm2022/jvsoft-utils-directives.mjs.map +1 -0
  8. package/fesm2022/jvsoft-utils.mjs +270 -41
  9. package/fesm2022/jvsoft-utils.mjs.map +1 -1
  10. package/package.json +8 -16
  11. package/public-api.d.ts +5 -4
  12. package/src/functions/mat-form-controls/autocomplete.d.ts +21 -2
  13. package/src/pipes/display-with.pipe.d.ts +14 -0
  14. package/src/pipes/public-api.d.ts +1 -0
  15. package/fesm2022/jvsoft-utils-src-functions.mjs +0 -1707
  16. package/fesm2022/jvsoft-utils-src-functions.mjs.map +0 -1
  17. package/fesm2022/jvsoft-utils-src-interfaces.mjs +0 -6
  18. package/fesm2022/jvsoft-utils-src-interfaces.mjs.map +0 -1
  19. package/fesm2022/jvsoft-utils-src-pipes.mjs +0 -290
  20. package/fesm2022/jvsoft-utils-src-pipes.mjs.map +0 -1
  21. package/functions/base64.d.ts +0 -89
  22. package/functions/browser.d.ts +0 -1
  23. package/functions/crypto-js.d.ts +0 -2
  24. package/functions/date.d.ts +0 -3
  25. package/functions/dev-log.d.ts +0 -97
  26. package/functions/email.d.ts +0 -2
  27. package/functions/file.d.ts +0 -10
  28. package/functions/forms.d.ts +0 -23
  29. package/functions/http-client.d.ts +0 -2
  30. package/functions/index.d.ts +0 -1
  31. package/functions/local-storage.d.ts +0 -29
  32. package/functions/mat-form-controls/autocomplete.d.ts +0 -48
  33. package/functions/mat-form-controls/index.d.ts +0 -2
  34. package/functions/number.d.ts +0 -2
  35. package/functions/object-transformation.d.ts +0 -2
  36. package/functions/objects-arrays.d.ts +0 -63
  37. package/functions/public-api.d.ts +0 -17
  38. package/functions/string.d.ts +0 -23
  39. package/functions/sweetalert.d.ts +0 -5
  40. package/functions/utiles.d.ts +0 -1
  41. package/interfaces/datos.d.ts +0 -4
  42. package/interfaces/index.d.ts +0 -1
  43. package/interfaces/public-api.d.ts +0 -1
  44. package/pipes/data-en-lista.pipe.d.ts +0 -8
  45. package/pipes/date-diff-string.pipe.d.ts +0 -17
  46. package/pipes/filtro.pipe.d.ts +0 -18
  47. package/pipes/form-control-is-required.pipe.d.ts +0 -9
  48. package/pipes/index.d.ts +0 -1
  49. package/pipes/json-parse.pipe.d.ts +0 -7
  50. package/pipes/no-sanitize.pipe.d.ts +0 -10
  51. package/pipes/public-api.d.ts +0 -8
  52. package/pipes/tipo-valor-funcion.pipe.d.ts +0 -9
  53. package/pipes/zero-fill.pipe.d.ts +0 -8
  54. package/src/functions/index.d.ts +0 -5
  55. package/src/interfaces/index.d.ts +0 -5
  56. /package/{classes → src/classes}/data-model.d.ts +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"jvsoft-utils-src-pipes.mjs","sources":["../../../projects/utils/src/pipes/data-en-lista.pipe.ts","../../../projects/utils/src/pipes/date-diff-string.pipe.ts","../../../projects/utils/src/pipes/filtro.pipe.ts","../../../projects/utils/src/pipes/form-control-is-required.pipe.ts","../../../projects/utils/src/pipes/json-parse.pipe.ts","../../../projects/utils/src/pipes/no-sanitize.pipe.ts","../../../projects/utils/src/pipes/tipo-valor-funcion.pipe.ts","../../../projects/utils/src/pipes/zero-fill.pipe.ts","../../../projects/utils/src/pipes/jvsoft-utils-src-pipes.ts"],"sourcesContent":["import {Pipe, PipeTransform} from '@angular/core';\n\n@Pipe({\n name: 'dataEnLista',\n})\nexport class DataEnListaPipe implements PipeTransform {\n\n transform(coleccion: object[], idBuscar: string | string[], dato: any): any {\n if (coleccion) {\n if (Array.isArray(idBuscar)) {\n return coleccion.find(item => {\n const arrCoincide: any[] = [];\n idBuscar.forEach((campo: string, idx) => {\n // @ts-ignore\n arrCoincide.push((item[campo] == dato[idx]));\n });\n return arrCoincide.every(e => e === true);\n });\n }\n // @ts-ignore\n return coleccion.find(item => item[idBuscar] == dato);\n }\n return null;\n }\n\n // opcSelec(coleccion, idBuscar, formControl) {\n // \tif (coleccion) {\n // \t\tif (formControl.value == '') {\n // \t\t\treturn {cModuloNombre: '', cModuloPadreNombre: 'Todos', iModuloId: ''};\n // \t\t}\n // \t\treturn coleccion.find(item => item[idBuscar] == formControl.value);\n // \t}\n // \treturn null;\n // }\n\n}\n\nexport function dataEnLista(coleccion: object[], idBuscar: string | string[], dato: any): any {\n return new DataEnListaPipe().transform(coleccion, idBuscar, dato);\n}\n","import {Pipe, PipeTransform} from '@angular/core';\n\n@Pipe({\n\tname: 'dateDiffString',\n\tpure: true\n})\nexport class DateDiffStringPipe implements PipeTransform {\n\ttransform(startingDate: Date, endingDate: Date): any {\n\t\tlet startDate = new Date(startingDate);\n\t\t// user not pass endingDate then set current date as end date.\n\t\tif (!endingDate) {\n\t\t\tendingDate = new Date();\n\t\t}\n\t\tlet endDate = new Date(endingDate);\n\t\t// chack start date and end date and base on condication alter date.\n\t\tif (startDate > endDate) {\n\t\t\tconst swap = startDate;\n\t\t\tstartDate = endDate;\n\t\t\tendDate = swap;\n\t\t}\n\n\t\tconst disgregado = this.separarMilisegundos(endDate.getTime() - startDate.getTime());\n\t\t// console.log(disgregado);\n\t\tconst formatearATexto = (arrayToFill: string[], campo: any, texto: any, textoPlural = 's') => {\n\t\t\tif (campo > 0) {\n\t\t\t\tarrayToFill.push( campo + ' ' + texto + (campo > 1 ? textoPlural : '') );\n\t\t\t}\n\t\t\treturn arrayToFill;\n\t\t};\n\n\t\tlet arrDFinal: any[] = [];\n\t\tarrDFinal = formatearATexto(arrDFinal, disgregado.years, 'año');\n\t\tarrDFinal = formatearATexto(arrDFinal, disgregado.months, 'mes', 'es');\n\t\tarrDFinal = formatearATexto(arrDFinal, disgregado.weeks, 'semana');\n\t\tarrDFinal = formatearATexto(arrDFinal, disgregado.days, 'día');\n\t\tarrDFinal = formatearATexto(arrDFinal, disgregado.hours, 'hora');\n\t\tarrDFinal = formatearATexto(arrDFinal, disgregado.minutes, 'minuto');\n\t\tarrDFinal = formatearATexto(arrDFinal, disgregado.seconds, 'segundo');\n\t\tif (arrDFinal.length > 3) {\n\t\t\tarrDFinal.splice(3);\n\t\t\tarrDFinal.splice(-1, 0, 'y');\n\t\t} else {\n\t\t\tif (arrDFinal.length > 1) {\n\t\t\t\tarrDFinal.splice(-1, 0, 'y');\n\t\t\t}\n\t\t}\n\t\treturn arrDFinal.join(' ');\n\t}\n\n\tsepararMilisegundos(milisegundos: any): {\n\t\tyears: number,\n\t\tmonths: number,\n\t\tweeks: number,\n\t\tdays: number,\n\t\thours: number,\n\t\tminutes: number,\n\t\tseconds: number,\n\t} {\n\t\tconst todoEnSegundos = milisegundos / 1000;\n\t\tlet secsUsed = 0;\n\t\tconst years = Math.floor(todoEnSegundos / 31536000);\n\t\tif (years > 0) {\n\t\t\tsecsUsed += (years * 31536000);\n\t\t}\n\t\tconst months = Math.floor((todoEnSegundos - secsUsed) / 2628288);\n\t\tif (months > 0) {\n\t\t\tsecsUsed += (months * 2628288);\n\t\t}\n\t\tconst weeks = Math.floor((todoEnSegundos - secsUsed) / 604800);\n\t\tif (weeks > 0) {\n\t\t\tsecsUsed += (weeks * 604800);\n\t\t}\n\t\tconst days = Math.floor((todoEnSegundos - secsUsed) / 86400);\n\t\tif (days > 0) {\n\t\t\tsecsUsed += (days * 86400);\n\t\t}\n\t\tconst hours = Math.floor((todoEnSegundos - secsUsed) / 3600);\n\t\tif (hours > 0) {\n\t\t\tsecsUsed += (hours * 3600);\n\t\t}\n\t\tconst minutes = Math.floor((todoEnSegundos - secsUsed) / 60);\n\t\tif (minutes > 0) {\n\t\t\tsecsUsed += (minutes * 60);\n\t\t}\n\t\tconst seconds = Math.round(todoEnSegundos - secsUsed);\n\n\t\treturn {\n\t\t\tyears,\n\t\t\tmonths,\n\t\t\tweeks,\n\t\t\tdays,\n\t\t\thours,\n\t\t\tminutes,\n\t\t\tseconds,\n\t\t};\n\t}\n\n/*\n\ttransform(to: Date, from: Date, seconds = true, strict = false): string {\n\t\tif (typeof to == 'string') {\n\t\t\tto = new Date(to);\n\t\t}\n\t\tif (typeof from == 'string') {\n\t\t\tfrom = new Date(from);\n\t\t}\n\t\tconsole.log(typeof to, typeof from);\n\t\tconsole.log(to);\n\t\tconsole.log(from);\n\n\t\treturn strict ? formatDistanceStrict(from, to, {unit: 'minute', locale: es}) : formatDistance(from, to, {includeSeconds: seconds, locale: es});\n\t}\n\t*/\n}\n\nexport function dateDiffString(startingDate: Date, endingDate: Date){\n\treturn new DateDiffStringPipe().transform(startingDate, endingDate);\n}\n","import {Pipe, PipeTransform} from '@angular/core';\n\ninterface OpcionesBusqueda {\n texto: string;\n longitudMinima?: number;\n campo?: string | string[];\n mostrarObligado?: MostrarObligado;\n}\n\ninterface MostrarObligado {\n campo: string;\n items: any[];\n}\n\n@Pipe({\n name: 'filtro'\n})\nexport class FiltroPipe implements PipeTransform {\n\n transform(items: any[], opcionesBusqueda: OpcionesBusqueda): any[] {\n if (!items || !Array.isArray(items)) return [];\n if (!opcionesBusqueda.texto || opcionesBusqueda.texto.length < (opcionesBusqueda.longitudMinima ?? 1)) return items;\n\n const normalize = (() => {\n const from = 'ÃÀÁÄÂÈÉËÊÌÍÏÎÒÓÖÔÙÚÜÛãàáäâèéëêìíïîòóöôùúüûÑñÇç';\n const to = 'AAAAAEEEEIIIIOOOOUUUUaaaaaeeeeiiiioooouuuunncc';\n const mapping: Record<string, string> = {};\n\n for (let i = 0; i < from.length; i++) {\n mapping[from[i]] = to[i];\n }\n\n return (str: string): string => {\n return str.split('').map(c => mapping[c] || c).join('');\n };\n })();\n\n const textoNormalizado = normalize(opcionesBusqueda.texto.toLowerCase());\n\n return items.filter(item => {\n // 🔹 Manejo de `mostrarObligado`\n if (opcionesBusqueda.mostrarObligado) {\n const {campo, items: obligados} = opcionesBusqueda.mostrarObligado;\n if (obligados.includes(item[campo])) return true;\n }\n\n // 🔹 Manejo de `campo`\n if (opcionesBusqueda.campo) {\n if (Array.isArray(opcionesBusqueda.campo)) {\n return opcionesBusqueda.campo.some(campo => {\n const valor = item[campo] as string | undefined;\n return valor ? normalize(valor.toLowerCase()).includes(textoNormalizado):false;\n });\n }\n else {\n const valor = item[opcionesBusqueda.campo] as string | undefined;\n return valor ? normalize(valor.toLowerCase()).includes(textoNormalizado):false;\n }\n }\n\n return false;\n });\n }\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {AbstractControl, Validators} from '@angular/forms';\n\n@Pipe({\n name: 'formControlIsRequired'\n})\nexport class FormControlIsRequiredPipe implements PipeTransform {\n\n\ttransform(formControl: AbstractControl, ...args: unknown[]): any {\n\t\tif (!formControl) { return false; }\n\t\treturn formControl.hasValidator(Validators.required);\n\t}\n\n}\nexport function formControlIsRequired(formControl: AbstractControl) {\n return new FormControlIsRequiredPipe().transform(formControl);\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n\tname: 'jsonParse'\n})\nexport class JsonParsePipe implements PipeTransform {\n\n\ttransform(value: string, ...args: unknown[]): any {\n\t\tif (!value) { return []; }\n\t\ttry {\n\t\t\treturn JSON.parse(value);\n\t\t} catch (e) {\n\t\t\tconsole.warn('La cadena \"' + value + '\" no es JSON');\n\t\t\treturn [];\n\t\t}\n\t}\n\n}\n","import {Pipe, PipeTransform} from '@angular/core';\nimport {DomSanitizer, SafeHtml} from '@angular/platform-browser';\n\n@Pipe({ name: 'noSanitize' })\nexport class NoSanitizePipe implements PipeTransform {\n\tconstructor(private domSanitizer: DomSanitizer) {\n\n\t}\n\ttransform(html: string): SafeHtml {\n\t\treturn this.domSanitizer.bypassSecurityTrustHtml(html);\n\t}\n}\n","import {Pipe, PipeTransform} from '@angular/core';\n\nexport type TipoValorFuncion<T> = T | ((...param: any) => T);\n\n@Pipe({\n name: 'tipoValorFuncion',\n standalone: true, // Para usarlo en standalone components\n})\nexport class TipoValorFuncionPipe implements PipeTransform {\n transform<T>(datoParam: TipoValorFuncion<T>, defaultValue?: T, ...param: any[]): T | undefined {\n if (datoParam === undefined || datoParam === null) {\n return defaultValue;\n }\n if (typeof datoParam === 'function') {\n return (datoParam as (...args: any) => T)(...param);\n }\n return datoParam;\n }\n}\n\nexport function tipoValorFuncion<T>(datoParam: TipoValorFuncion<T>, defaultValue?: T, ...param: any[]): T | undefined {\n return new TipoValorFuncionPipe().transform(datoParam, defaultValue, ...param);\n}\n","import {Pipe, PipeTransform} from '@angular/core';\n\n@Pipe({\n\tname: 'zeroFill',\n})\nexport class ZeroFillPipe implements PipeTransform {\n\n\ttransform(value: unknown, digitos: number, ...args: unknown[]) {\n\t\tlet s = value + '';\n\t\twhile (s.length < digitos) {\n\t\t\ts = '0' + s;\n\t\t}\n\t\treturn s;\n\t}\n\n}\nexport function zeroFill(value: unknown, digitos: number, ...args: unknown[]) {\n\treturn new ZeroFillPipe().transform(value, digitos, args);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAKa,eAAe,CAAA;AAExB,IAAA,SAAS,CAAC,SAAmB,EAAE,QAA2B,EAAE,IAAS,EAAA;QACjE,IAAI,SAAS,EAAE;AACX,YAAA,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;AACzB,gBAAA,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,IAAG;oBACzB,MAAM,WAAW,GAAU,EAAE;oBAC7B,QAAQ,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,GAAG,KAAI;;AAEpC,wBAAA,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE;AAChD,oBAAA,CAAC,CAAC;AACF,oBAAA,OAAO,WAAW,CAAC,K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,CAAC;AAC1D;;AClBA;;AAEG;;;;"}
@@ -1,89 +0,0 @@
1
- /**
2
- * Codifica un string a base64 (método legacy)
3
- * @param val - String a codificar
4
- * @returns String codificado en base64
5
- * @deprecated Use encodeBase64String() en su lugar
6
- */
7
- export declare function b64Encode(val: string): string;
8
- /**
9
- * Decodifica un string desde base64 (método legacy)
10
- * @param val - String en base64 a decodificar
11
- * @returns String decodificado
12
- * @deprecated Use decodeBase64String() en su lugar
13
- */
14
- export declare function b64Decode(val: string): string;
15
- /**
16
- * Codificar string a Base64 (UTF-8 seguro)
17
- * @param str - String a codificar
18
- * @returns String codificado en base64
19
- *
20
- * @example
21
- * ```typescript
22
- * const encoded = encodeBase64String('Hola Mundo ñ');
23
- * // encoded: "SG9sYSBNdW5kbyDDsQ=="
24
- * ```
25
- */
26
- export declare function encodeBase64String(str: string): string;
27
- /**
28
- * Decodificar Base64 a string (UTF-8 seguro)
29
- * @param b64 - String en base64 a decodificar
30
- * @returns String decodificado
31
- *
32
- * @example
33
- * ```typescript
34
- * const decoded = decodeBase64String('SG9sYSBNdW5kbyDDsQ==');
35
- * // decoded: "Hola Mundo ñ"
36
- * ```
37
- */
38
- export declare function decodeBase64String(b64: string): string;
39
- /**
40
- * Codificar un objeto a base64 (UTF-8 seguro)
41
- * @param obj - Objeto a codificar
42
- * @returns String codificado en base64
43
- *
44
- * @example
45
- * ```typescript
46
- * const obj = { nombre: 'Juan', edad: 25 };
47
- * const encoded = encodeBase64Object(obj);
48
- * ```
49
- */
50
- export declare function encodeBase64Object(obj: any): string;
51
- /**
52
- * Decodificar un base64 y obtener el objeto original
53
- * @param b64 - String en base64 a decodificar
54
- * @returns Objeto decodificado
55
- *
56
- * @example
57
- * ```typescript
58
- * const obj = decodeBase64Object<{ nombre: string, edad: number }>(encoded);
59
- * // obj: { nombre: 'Juan', edad: 25 }
60
- * ```
61
- */
62
- export declare function decodeBase64Object<T = any>(b64: string): T;
63
- /**
64
- * Codificar archivo a Base64 (retorna solo el contenido, sin "data:...")
65
- * @param file - Archivo o Blob a codificar
66
- * @returns Promise con el string en base64
67
- *
68
- * @example
69
- * ```typescript
70
- * const file = event.target.files[0];
71
- * const base64 = await encodeBase64File(file);
72
- * // base64: "iVBORw0KGgoAAAANSUhEUgAA..."
73
- * ```
74
- */
75
- export declare function encodeBase64File(file: File | Blob): Promise<string>;
76
- /**
77
- * Decodificar Base64 a Blob (para reconstruir archivos en Angular)
78
- * @param b64 - String en base64
79
- * @param mimeType - Tipo MIME del archivo (opcional)
80
- * @returns Blob con el contenido decodificado
81
- *
82
- * @example
83
- * ```typescript
84
- * const blob = decodeBase64ToBlob(base64String, 'image/png');
85
- * const url = URL.createObjectURL(blob);
86
- * // Usar url para mostrar imagen o descargar
87
- * ```
88
- */
89
- export declare function decodeBase64ToBlob(b64: string, mimeType?: string): Blob;
@@ -1 +0,0 @@
1
- export declare function getBrowserName(): "edge" | "opera" | "chrome" | "ie" | "firefox" | "safari" | "other";
@@ -1,2 +0,0 @@
1
- export declare function encriptar(text: string): string;
2
- export declare function desencriptar(ciphertext: string): string;
@@ -1,3 +0,0 @@
1
- export declare function formatearFechaFormato(val: string, format?: string): string;
2
- export declare function formatearFecha(val: string, hora?: string): string | Date;
3
- export declare function formatearFechaCadena(fecha: string): Date;
@@ -1,97 +0,0 @@
1
- /**
2
- * Configura el modo de producción para las utilidades de logging
3
- * @param production - true si está en modo producción, false para desarrollo
4
- *
5
- * @example
6
- * ```typescript
7
- * import { setProductionMode } from '@jvsoft/utils';
8
- * import { environment } from './environments/environment';
9
- *
10
- * setProductionMode(environment.production);
11
- * ```
12
- */
13
- export declare function setProductionMode(production: boolean): void;
14
- /**
15
- * Obtiene el estado actual del modo de producción
16
- * @returns true si está en modo producción, false en desarrollo
17
- */
18
- export declare function isProduction(): boolean;
19
- /**
20
- * Muestra mensajes de log solo en modo desarrollo
21
- * @param args - Argumentos a mostrar en consola
22
- *
23
- * @example
24
- * ```typescript
25
- * devLog('Usuario cargado:', usuario);
26
- * devLog('Estado:', { activo: true, rol: 'admin' });
27
- * ```
28
- */
29
- export declare function devLog(...args: any[]): void;
30
- /**
31
- * Muestra advertencias solo en modo desarrollo
32
- * @param args - Argumentos a mostrar como advertencia
33
- *
34
- * @example
35
- * ```typescript
36
- * devWarn('Función deprecada, usar nuevaFuncion() en su lugar');
37
- * ```
38
- */
39
- export declare function devWarn(...args: any[]): void;
40
- /**
41
- * Muestra errores en consola (siempre, incluso en producción)
42
- * @param args - Argumentos a mostrar como error
43
- *
44
- * @example
45
- * ```typescript
46
- * devError('Error al cargar datos:', error);
47
- * ```
48
- */
49
- export declare function devError(...args: any[]): void;
50
- /**
51
- * Crea un grupo de logs solo en modo desarrollo
52
- * @param label - Etiqueta del grupo
53
- * @param collapsed - Si el grupo debe estar colapsado por defecto
54
- *
55
- * @example
56
- * ```typescript
57
- * devGroup('Datos del usuario');
58
- * devLog('Nombre:', usuario.nombre);
59
- * devLog('Email:', usuario.email);
60
- * devGroupEnd();
61
- * ```
62
- */
63
- export declare function devGroup(label: string, collapsed?: boolean): void;
64
- /**
65
- * Cierra el grupo de logs actual
66
- */
67
- export declare function devGroupEnd(): void;
68
- /**
69
- * Muestra una tabla en consola solo en modo desarrollo
70
- * @param data - Datos a mostrar en formato tabla
71
- *
72
- * @example
73
- * ```typescript
74
- * devTable([
75
- * { nombre: 'Juan', edad: 25 },
76
- * { nombre: 'María', edad: 30 }
77
- * ]);
78
- * ```
79
- */
80
- export declare function devTable(data: any): void;
81
- /**
82
- * Inicia un temporizador solo en modo desarrollo
83
- * @param label - Etiqueta del temporizador
84
- *
85
- * @example
86
- * ```typescript
87
- * devTime('carga-datos');
88
- * // ... código a medir
89
- * devTimeEnd('carga-datos'); // Muestra: carga-datos: 123.45ms
90
- * ```
91
- */
92
- export declare function devTime(label: string): void;
93
- /**
94
- * Finaliza un temporizador y muestra el tiempo transcurrido
95
- * @param label - Etiqueta del temporizador
96
- */
97
- export declare function devTimeEnd(label: string): void;
@@ -1,2 +0,0 @@
1
- export declare function maskEmail(email: string): string;
2
- export declare function isEmail(email: string): boolean;
@@ -1,10 +0,0 @@
1
- export declare function obtenerMimeType(nombreArchivo: string): string | null;
2
- export declare function sanitizarNombreArchivo(nombre: string, reemplazo?: string): string;
3
- export declare function getDataArchivoFromPath(value: string, conTimeStamp?: boolean): {
4
- nombre: string;
5
- extension?: string;
6
- d?: any;
7
- fechaSubida: any;
8
- };
9
- export declare function convertirBytes(valor: number, unidadSalida?: string | null, incluirUnidad?: boolean): string | number | null;
10
- export declare function downLoadFileStream(data: any, type: string, nombreArchivo?: string): void;
@@ -1,23 +0,0 @@
1
- import { AbstractControl, FormControl, FormGroup } from '@angular/forms';
2
- import { BehaviorSubject } from 'rxjs';
3
- export declare function establecerQuitarRequired(formulario: FormGroup, establecer?: any[], quitar?: any[], camposDisabled?: string[] | 'todos'): void;
4
- export declare function getFormValidationErrors(form: FormGroup): {
5
- control: string;
6
- error: string;
7
- value: any;
8
- }[];
9
- export declare function mensajesErrorFormControl(control: AbstractControl | null): string;
10
- export declare function toFormData<T extends Record<string, any>>(formValue: T): FormData;
11
- export declare function markAsTouchedWithoutEmitEvent(control: AbstractControl): void;
12
- export interface SetControlDesdeListaConfig<T, V = any> {
13
- lista$: BehaviorSubject<T[]>;
14
- formControl?: FormControl<V>;
15
- formGroup?: FormGroup;
16
- controlName?: string;
17
- idProp?: keyof T;
18
- idValor?: any;
19
- selector?: (item: T) => V;
20
- usarPrimeraOpcion?: boolean;
21
- }
22
- export declare function setControlDesdeLista<T, V = any>(config: SetControlDesdeListaConfig<T, V>): void;
23
- export declare function transformarFechasPorNombreDeCampo<T extends Record<string, any>>(formValue: T): T;
@@ -1,2 +0,0 @@
1
- import { HttpErrorResponse } from '@angular/common/http';
2
- export declare function mensajesDeError(error: HttpErrorResponse, toast?: boolean): void;
@@ -1 +0,0 @@
1
- export * from './public-api';
@@ -1,29 +0,0 @@
1
- export interface JwtTokenResponse {
2
- access_token: string;
3
- expires_in: number;
4
- token_type: string;
5
- user: any;
6
- }
7
- export interface DataSessionStorage {
8
- tokenStringKey?: string;
9
- changePasswordKey?: string;
10
- logoUrl?: string;
11
- logoLogin?: string;
12
- backgroundLogin?: string;
13
- favicon?: string;
14
- darkMode?: string;
15
- serverTimestamp?: string;
16
- apiDataKey?: string;
17
- }
18
- export declare let localStorageKeys: DataSessionStorage;
19
- export declare function inicializarVariablesSessionStorage(datSesion: DataSessionStorage): void;
20
- export declare function setJwtTokenData(data: string): void;
21
- export declare function jwtTokenData(key?: string): JwtTokenResponse | null;
22
- export declare function jwtToken(key?: string): string;
23
- export declare function jwtTokenExpiracion(key?: string): number | null;
24
- export declare function jwtTokenExpiracionFaltante(): number;
25
- export declare function setCambiarPwd(accion?: boolean): void;
26
- export declare function getCambiarPwd(): boolean | null;
27
- export declare function delLocalStorage(keyElim?: string[]): void;
28
- export declare function getLocalStorage(key: string | undefined): string | null;
29
- export declare function setLocalStorage(key: string, value?: string): void;
@@ -1,48 +0,0 @@
1
- import { AbstractControl } from '@angular/forms';
2
- export declare function mostrarValorEnBusqueda(campos: any, idxSel: any): string;
3
- export declare function changeSelectData(objThis: any, dataFiltro: {
4
- formControl: AbstractControl;
5
- data: any[];
6
- campoBuscar: string | string[];
7
- variableResultado: string;
8
- }): void;
9
- export declare function changeSelect(control: any, formControl: AbstractControl, tipo: any, campoBuscar: any, campoFiltro?: null): void;
10
- export declare function changeSelectDataApi(objThis: any, dataFiltro: {
11
- tipoReq: string;
12
- campoId?: string;
13
- minLength?: number;
14
- dataExtra?: any;
15
- dataExtraVariable?: any;
16
- anonimo?: boolean;
17
- queryService: any;
18
- formControl: AbstractControl;
19
- variableResultado?: string;
20
- }): void;
21
- export declare function changeSelectApi(control: any, queryService: any, formControl: AbstractControl, tipo: any, dataExtra?: {}, dataExtraVariable?: any[] | null, minLength?: number, anonimo?: boolean): void;
22
- /**
23
- * Comprueba si un valor es una Promesa
24
- * @param valor - Valor a verificar
25
- * @returns true si es una Promise
26
- */
27
- export declare function esPromise(valor: any): boolean;
28
- /**
29
- * Selecciona todo el texto de un input
30
- * @param event - Evento del input
31
- */
32
- export declare function seleccionarTextoInput(event: any): void;
33
- /**
34
- * Función genérica para vincular un FormControl con datos desde API o Promise.
35
- * Preparada para migrar a signals en el futuro.
36
- */
37
- export declare function changeSelectReformateado(config: {
38
- objThis: any;
39
- tipoReq: string;
40
- formControl: AbstractControl;
41
- queryService: any;
42
- campoId?: string;
43
- minLength?: number;
44
- dataExtra?: any;
45
- dataExtraVariable?: any[];
46
- anonimo?: boolean;
47
- variableResultado?: string;
48
- }): void;
@@ -1,2 +0,0 @@
1
- export * from './autocomplete';
2
- export declare function seleccionarTextoInput(event: any): void;
@@ -1,2 +0,0 @@
1
- export declare function roundToDecimal(number: number, decimal: number): number;
2
- export declare function numberToWords(num: number): string;
@@ -1,2 +0,0 @@
1
- export declare function objectPropertiesToType(formFields: Record<string, any>): Record<string, any>;
2
- export declare function objectPropertiesBoolean(formFields: Record<string, any>, retorno?: 'boolean' | 'bit'): Record<string, any>;
@@ -1,63 +0,0 @@
1
- export declare function deepMerge(source: any, target: any): any;
2
- export declare function deepClone(obj: any): any;
3
- /**
4
- * Busca un elemento en un array o jerarquía de objetos según un campo y valor especificado.
5
- *
6
- * @returns El elemento encontrado o undefined si no existe.
7
- */
8
- export declare function buscarPorCampo<T>(datosFn: {
9
- items: T[];
10
- campo: keyof T;
11
- valor: any;
12
- campoHijo?: string;
13
- }): T | undefined;
14
- export declare function sumarPropiedades(item: Record<string, any>, campos: string[]): number;
15
- export declare function esNumero(value: any): boolean;
16
- export declare function sumarObjetos(arrayObjetos: any[], campos: string[]): Record<string, number>;
17
- export declare function getUniqueValues(array: any[]): any[];
18
- export declare function getUniqueValuesByProperty<T>(objetos: T[], campo: string): T[];
19
- export declare function ordenarArray(array: any[], numeros?: boolean, sentido?: 'ASC' | 'DESC'): any[];
20
- export declare function ordenarPorPropiedad(objData: any, propiedad: string, /**@deprecated*/ numeros?: boolean): {
21
- [x: string]: {};
22
- }[];
23
- export declare function ordenarPorPropiedades<T>(arr: T[], options: {
24
- propiedades: (keyof T)[];
25
- direcciones?: ('asc' | 'desc' | '')[];
26
- }): T[];
27
- export declare function groupBy<T extends Record<string, any>, K extends keyof T>(array: T[], key: K | ((obj: T) => string)): Record<string, T[]>;
28
- export declare function nestGroupsBy(arr: any, properties: any): any;
29
- /**
30
- * Obtiene un valor de un objeto usando una ruta de propiedad anidada.
31
- *
32
- * @param obj - Objeto de entrada.
33
- * @param path - Ruta en formato punto (ej: "cliente.orden").
34
- * @returns El valor encontrado o undefined si no existe.
35
- */
36
- export declare function getValueByPath(obj: any, path: string): any;
37
- /**
38
- * Retorna el valor máximo del campo especificado (incluso anidado) en un arreglo de objetos.
39
- *
40
- * @param data - Lista de objetos a procesar.
41
- * @param campo - Nombre del campo a evaluar, puede ser anidado (ej. "campo.orden").
42
- * @param incrementar - Si es true, retorna el valor máximo + 1. Por defecto es true.
43
- * @returns El valor máximo encontrado, posiblemente incrementado.
44
- */
45
- export declare function obtenerUltimoOrden(data: any[], campo: string, incrementar?: boolean): number;
46
- /**
47
- * Elimina una o varias columnas específicas (por índice) de una tabla representada como array de arrays.
48
- *
49
- * @param data - Array de filas (cada fila debe ser un array).
50
- * @param columnIndex - Índice o lista de índices de las columnas a eliminar.
51
- * @returns Nuevo array con las columnas eliminadas.
52
- */
53
- export declare function eliminarColumnaPorIndex<T extends unknown[][]>(data: T, columnIndex: number | number[]): T;
54
- export declare function eliminarDuplicados<T extends object>(array: T[], claves?: (keyof T)[]): T[];
55
- export declare function eliminarElementos<T extends object>(origen: T[], elementosAEliminar: T[], claves?: (keyof T)[]): T[];
56
- /**
57
- * Filtra datos localmente según un valor de búsqueda
58
- * @param data - Array de datos a filtrar
59
- * @param value - Valor de búsqueda
60
- * @param campoBuscar - Campo(s) por el cual buscar
61
- * @returns Array filtrado
62
- */
63
- export declare function filtrarDatosLocal(data: any[], value: any, campoBuscar: string | string[]): any[];
@@ -1,17 +0,0 @@
1
- export * from './mat-form-controls';
2
- export * from './base64';
3
- export * from './browser';
4
- export * from './crypto-js';
5
- export * from './date';
6
- export * from './dev-log';
7
- export * from './email';
8
- export * from './file';
9
- export * from './forms';
10
- export * from './http-client';
11
- export * from './local-storage';
12
- export * from './number';
13
- export * from './object-transformation';
14
- export * from './objects-arrays';
15
- export * from './string';
16
- export * from './sweetalert';
17
- export * from './utiles';
@@ -1,23 +0,0 @@
1
- export declare function generateRandomString(length: number): string;
2
- /**
3
- * Obtiene el host (hostname) de una URL o cadena host[:port].
4
- * Opcionalmente puede devolver también el puerto si está presente.
5
- *
6
- * - Acepta inputs como:
7
- * 'https://example.com/path', 'example.com:3000', 'localhost', 'http://[::1]:4200'
8
- * - Usa la API URL cuando es posible (más robusta) y cae a un regex de respaldo.
9
- *
10
- * @param url Cadena que representa una URL o host
11
- * @param options
12
- * @param options.includePort Si es true, incluye":puerto" cuando exista (por defecto false)
13
- * @param options.includeProtocol Incluye "http://" o "https://" según corresponda (por defecto false)
14
- */
15
- export declare function obtenerHostDesdeUrl(url: string | null | undefined, options?: {
16
- includePort?: boolean;
17
- includeProtocol?: boolean;
18
- }): string | null;
19
- /** @deprecated Alias compatible (deprecated) — preferir usar `obtenerHostDesdeUrl`. */
20
- export declare const extraerDominio: (url: string | null | undefined, options?: {
21
- includePort?: boolean;
22
- includeProtocol?: boolean;
23
- }) => string | null;
@@ -1,5 +0,0 @@
1
- import { SweetAlertOptions, SweetAlertResult } from 'sweetalert2';
2
- export declare function mensajeAlerta(tipo: 'success' | 'error' | 'info' | 'warning' | 'question', titulo: string, mensaje: string, opciones?: SweetAlertOptions): Promise<SweetAlertResult<any>>;
3
- export declare function mensajeTimer(tipo: 'success' | 'error' | 'info' | 'warning' | 'question', titulo: string, mensaje: string, milisegundos?: number, showLoading?: boolean, opciones?: SweetAlertOptions): Promise<SweetAlertResult<any>>;
4
- export declare function mensajeConfirmacion(tipo: 'success' | 'error' | 'info' | 'warning' | 'question', titulo: any, mensaje: any, opciones?: SweetAlertOptions): Promise<SweetAlertResult<Awaited<any>>>;
5
- export declare function mensajeToast(tipo: 'success' | 'error' | 'info' | 'warning' | 'question', titulo: string, mensaje: string, opciones?: SweetAlertOptions): Promise<SweetAlertResult<any>>;
@@ -1 +0,0 @@
1
- export declare function verificarRUC(ruc: string): boolean;
@@ -1,4 +0,0 @@
1
- import { BehaviorSubject } from 'rxjs';
2
- export interface DataServidor {
3
- [key: string]: BehaviorSubject<any>;
4
- }
@@ -1 +0,0 @@
1
- export * from './public-api';
@@ -1 +0,0 @@
1
- export * from './datos';
@@ -1,8 +0,0 @@
1
- import { PipeTransform } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class DataEnListaPipe implements PipeTransform {
4
- transform(coleccion: object[], idBuscar: string | string[], dato: any): any;
5
- static ɵfac: i0.ɵɵFactoryDeclaration<DataEnListaPipe, never>;
6
- static ɵpipe: i0.ɵɵPipeDeclaration<DataEnListaPipe, "dataEnLista", true>;
7
- }
8
- export declare function dataEnLista(coleccion: object[], idBuscar: string | string[], dato: any): any;
@@ -1,17 +0,0 @@
1
- import { PipeTransform } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class DateDiffStringPipe implements PipeTransform {
4
- transform(startingDate: Date, endingDate: Date): any;
5
- separarMilisegundos(milisegundos: any): {
6
- years: number;
7
- months: number;
8
- weeks: number;
9
- days: number;
10
- hours: number;
11
- minutes: number;
12
- seconds: number;
13
- };
14
- static ɵfac: i0.ɵɵFactoryDeclaration<DateDiffStringPipe, never>;
15
- static ɵpipe: i0.ɵɵPipeDeclaration<DateDiffStringPipe, "dateDiffString", true>;
16
- }
17
- export declare function dateDiffString(startingDate: Date, endingDate: Date): any;
@@ -1,18 +0,0 @@
1
- import { PipeTransform } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- interface OpcionesBusqueda {
4
- texto: string;
5
- longitudMinima?: number;
6
- campo?: string | string[];
7
- mostrarObligado?: MostrarObligado;
8
- }
9
- interface MostrarObligado {
10
- campo: string;
11
- items: any[];
12
- }
13
- export declare class FiltroPipe implements PipeTransform {
14
- transform(items: any[], opcionesBusqueda: OpcionesBusqueda): any[];
15
- static ɵfac: i0.ɵɵFactoryDeclaration<FiltroPipe, never>;
16
- static ɵpipe: i0.ɵɵPipeDeclaration<FiltroPipe, "filtro", true>;
17
- }
18
- export {};
@@ -1,9 +0,0 @@
1
- import { PipeTransform } from '@angular/core';
2
- import { AbstractControl } from '@angular/forms';
3
- import * as i0 from "@angular/core";
4
- export declare class FormControlIsRequiredPipe implements PipeTransform {
5
- transform(formControl: AbstractControl, ...args: unknown[]): any;
6
- static ɵfac: i0.ɵɵFactoryDeclaration<FormControlIsRequiredPipe, never>;
7
- static ɵpipe: i0.ɵɵPipeDeclaration<FormControlIsRequiredPipe, "formControlIsRequired", true>;
8
- }
9
- export declare function formControlIsRequired(formControl: AbstractControl): any;
package/pipes/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './public-api';
@@ -1,7 +0,0 @@
1
- import { PipeTransform } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class JsonParsePipe implements PipeTransform {
4
- transform(value: string, ...args: unknown[]): any;
5
- static ɵfac: i0.ɵɵFactoryDeclaration<JsonParsePipe, never>;
6
- static ɵpipe: i0.ɵɵPipeDeclaration<JsonParsePipe, "jsonParse", true>;
7
- }
@@ -1,10 +0,0 @@
1
- import { PipeTransform } from '@angular/core';
2
- import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
3
- import * as i0 from "@angular/core";
4
- export declare class NoSanitizePipe implements PipeTransform {
5
- private domSanitizer;
6
- constructor(domSanitizer: DomSanitizer);
7
- transform(html: string): SafeHtml;
8
- static ɵfac: i0.ɵɵFactoryDeclaration<NoSanitizePipe, never>;
9
- static ɵpipe: i0.ɵɵPipeDeclaration<NoSanitizePipe, "noSanitize", true>;
10
- }
@@ -1,8 +0,0 @@
1
- export * from './data-en-lista.pipe';
2
- export * from './date-diff-string.pipe';
3
- export * from './filtro.pipe';
4
- export * from './form-control-is-required.pipe';
5
- export * from './json-parse.pipe';
6
- export * from './no-sanitize.pipe';
7
- export * from './tipo-valor-funcion.pipe';
8
- export * from './zero-fill.pipe';
@@ -1,9 +0,0 @@
1
- import { PipeTransform } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export type TipoValorFuncion<T> = T | ((...param: any) => T);
4
- export declare class TipoValorFuncionPipe implements PipeTransform {
5
- transform<T>(datoParam: TipoValorFuncion<T>, defaultValue?: T, ...param: any[]): T | undefined;
6
- static ɵfac: i0.ɵɵFactoryDeclaration<TipoValorFuncionPipe, never>;
7
- static ɵpipe: i0.ɵɵPipeDeclaration<TipoValorFuncionPipe, "tipoValorFuncion", true>;
8
- }
9
- export declare function tipoValorFuncion<T>(datoParam: TipoValorFuncion<T>, defaultValue?: T, ...param: any[]): T | undefined;
@@ -1,8 +0,0 @@
1
- import { PipeTransform } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class ZeroFillPipe implements PipeTransform {
4
- transform(value: unknown, digitos: number, ...args: unknown[]): string;
5
- static ɵfac: i0.ɵɵFactoryDeclaration<ZeroFillPipe, never>;
6
- static ɵpipe: i0.ɵɵPipeDeclaration<ZeroFillPipe, "zeroFill", true>;
7
- }
8
- export declare function zeroFill(value: unknown, digitos: number, ...args: unknown[]): string;
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@jvsoft/utils/src/functions" />
5
- export * from './public-api';
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@jvsoft/utils/src/interfaces" />
5
- export * from './public-api';