@jvsoft/components 1.0.0-alpha.10 → 1.0.0-alpha.12
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/alerta/README.md +102 -0
- package/alerta/alerta.component.d.ts +29 -0
- package/alerta/index.d.ts +5 -0
- package/alerta/public-api.d.ts +1 -0
- package/fesm2022/jvsoft-components-alerta.mjs +88 -0
- package/fesm2022/jvsoft-components-alerta.mjs.map +1 -0
- package/fesm2022/jvsoft-components-filtro-busqueda.mjs +7 -7
- package/fesm2022/jvsoft-components-filtro-busqueda.mjs.map +1 -1
- package/fesm2022/jvsoft-components-lista-arbol.mjs +2 -3
- package/fesm2022/jvsoft-components-lista-arbol.mjs.map +1 -1
- package/fesm2022/jvsoft-components-tabla-mantenimiento.mjs +14 -28
- package/fesm2022/jvsoft-components-tabla-mantenimiento.mjs.map +1 -1
- package/fesm2022/jvsoft-components.mjs +98 -37
- package/fesm2022/jvsoft-components.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/package.json +21 -19
- package/src/styles/base.scss +6 -9
- package/src/tailwind/colors.js +66 -0
- package/src/tailwind/index.js +11 -0
- package/src/tailwind/plugins/jvs-buttons.js +32 -0
- package/src/tailwind/plugins/jvs-grid.js +69 -0
- package/src/tailwind/plugins/jvs-icons.js +36 -0
- package/tabla-mantenimiento/tabla-mantenimiento.component.d.ts +1 -0
package/alerta/README.md
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Alerta Component
|
|
2
|
+
|
|
3
|
+
El `AlertaComponent` (selector: `jvs-alerta`) es un componente moderno y versátil para mostrar mensajes informativos, de error, éxito o advertencia. Está construido usando **Angular 19 Signals** y es **Standalone**.
|
|
4
|
+
|
|
5
|
+
## 📦 Características
|
|
6
|
+
|
|
7
|
+
- **Moderno**: Utiliza Signals para una reactividad eficiente y sintaxis de control flow de Angular.
|
|
8
|
+
- **Standalone**: Sin dependencias de módulos, fácil de importar.
|
|
9
|
+
- **Altamente Personalizable**: Permite sobreescribir clases de Tailwind para cada parte del componente, iconos y contenido.
|
|
10
|
+
- **Premium por Defecto**: Viene con estilos predefinidos elegantes y bordes redondeados (`rounded-xl`).
|
|
11
|
+
|
|
12
|
+
## 🚀 Uso Básico
|
|
13
|
+
|
|
14
|
+
Importa el componente en tu componente standalone:
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { AlertaComponent } from '@jvsoft/components/alerta';
|
|
18
|
+
|
|
19
|
+
@Component({
|
|
20
|
+
imports: [AlertaComponent, ...],
|
|
21
|
+
// ...
|
|
22
|
+
})
|
|
23
|
+
export class MiComponente {}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Uso en la plantilla:
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
<jvs-alerta
|
|
30
|
+
tipo="success"
|
|
31
|
+
titulo="Operación Exitosa"
|
|
32
|
+
mensaje="Los datos se han guardado correctamente."
|
|
33
|
+
></jvs-alerta>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## 🛠 API
|
|
37
|
+
|
|
38
|
+
### Inputs (Signals)
|
|
39
|
+
|
|
40
|
+
| Input | Tipo | Default | Descripción |
|
|
41
|
+
|-------|------|---------|-------------|
|
|
42
|
+
| `tipo` | `AlertaTipo` | `'info'` | Define el estilo visual. Valores: `'info' \| 'error' \| 'success' \| 'warning' \| 'custom'`. |
|
|
43
|
+
| `titulo` | `string` | `undefined` | Texto resaltado en la parte superior. |
|
|
44
|
+
| `mensaje` | `string` | `undefined` | Texto descriptivo del mensaje. |
|
|
45
|
+
| `icono` | `string` | `undefined` | Sobreescribe el icono SVG por defecto. |
|
|
46
|
+
| `clases` | `AlertaClases` | `{}` | Objeto para personalización granular de CSS (ver abajo). |
|
|
47
|
+
| `botonCerrar` | `boolean` | `false` | Muestra un botón "X" para cerrar la alerta. |
|
|
48
|
+
| `botonAcepto` | `boolean` | `false` | Muestra un botón de acción "Aceptar". |
|
|
49
|
+
| `textoAcepto` | `string` | `'Lo entiendo'` | Etiqueta del botón de acción. |
|
|
50
|
+
|
|
51
|
+
### Outputs
|
|
52
|
+
|
|
53
|
+
| Output | Evento | Descripción |
|
|
54
|
+
|--------|--------|-------------|
|
|
55
|
+
| `alCerrar` | `void` | Se emite al hacer clic en el botón de cerrar. |
|
|
56
|
+
| `alAceptar` | `void` | Se emite al hacer clic en el botón de acción "Aceptar". |
|
|
57
|
+
|
|
58
|
+
### Interfaz `AlertaClases`
|
|
59
|
+
|
|
60
|
+
Permite inyectar clases de Tailwind adicionales en partes específicas:
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
interface AlertaClases {
|
|
64
|
+
contenedor?: string; // Div principal
|
|
65
|
+
icono?: string; // Contenedor del icono
|
|
66
|
+
titulo?: string; // Título h4
|
|
67
|
+
mensaje?: string; // Div del mensaje
|
|
68
|
+
acciones?: string; // Contenedor del botón de acción
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## 🎨 Ejemplos de Personalización
|
|
73
|
+
|
|
74
|
+
### 1. Personalización de Clases
|
|
75
|
+
Si usas `tipo="custom"`, los estilos por defecto se omiten y puedes definirlos totalmente:
|
|
76
|
+
|
|
77
|
+
```html
|
|
78
|
+
<jvs-alerta
|
|
79
|
+
tipo="custom"
|
|
80
|
+
[clases]="{
|
|
81
|
+
contenedor: 'bg-indigo-600 text-white rounded-lg p-6',
|
|
82
|
+
icono: 'text-indigo-200 shadow-sm'
|
|
83
|
+
}"
|
|
84
|
+
icono="roundAutoAwesome"
|
|
85
|
+
mensaje="Este es un mensaje totalmente personalizado."
|
|
86
|
+
></jvs-alerta>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### 2. Uso con Content Projection
|
|
90
|
+
En lugar del input `mensaje`, puedes proyectar cualquier HTML:
|
|
91
|
+
|
|
92
|
+
```html
|
|
93
|
+
<jvs-alerta tipo="warning" titulo="Atención Requerida">
|
|
94
|
+
<div class="flex flex-col gap-2">
|
|
95
|
+
<p>Por favor revise los siguientes puntos:</p>
|
|
96
|
+
<ul class="list-disc ml-4">
|
|
97
|
+
<li>Paso 1: Verificar firma</li>
|
|
98
|
+
<li>Paso 2: Adjuntar anexos</li>
|
|
99
|
+
</ul>
|
|
100
|
+
</div>
|
|
101
|
+
</jvs-alerta>
|
|
102
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export interface AlertaClases {
|
|
3
|
+
contenedor?: string;
|
|
4
|
+
icono?: string;
|
|
5
|
+
titulo?: string;
|
|
6
|
+
mensaje?: string;
|
|
7
|
+
acciones?: string;
|
|
8
|
+
}
|
|
9
|
+
export type AlertaTipo = 'info' | 'error' | 'success' | 'warning' | 'custom';
|
|
10
|
+
export declare class AlertaComponent {
|
|
11
|
+
tipo: import("@angular/core").InputSignal<AlertaTipo>;
|
|
12
|
+
titulo: import("@angular/core").InputSignal<string | undefined>;
|
|
13
|
+
mensaje: import("@angular/core").InputSignal<string | undefined>;
|
|
14
|
+
iconoManual: import("@angular/core").InputSignal<string | undefined>;
|
|
15
|
+
clasesManual: import("@angular/core").InputSignal<AlertaClases>;
|
|
16
|
+
botonCerrar: import("@angular/core").InputSignal<boolean>;
|
|
17
|
+
botonAcepto: import("@angular/core").InputSignal<boolean>;
|
|
18
|
+
textoAcepto: import("@angular/core").InputSignal<string>;
|
|
19
|
+
alCerrar: import("@angular/core").OutputEmitterRef<void>;
|
|
20
|
+
alAceptar: import("@angular/core").OutputEmitterRef<void>;
|
|
21
|
+
private defaults;
|
|
22
|
+
clasesContenedor: import("@angular/core").Signal<string>;
|
|
23
|
+
iconoFinal: import("@angular/core").Signal<string>;
|
|
24
|
+
clasesIcono: import("@angular/core").Signal<string>;
|
|
25
|
+
clasesTitulo: import("@angular/core").Signal<string>;
|
|
26
|
+
clasesMensaje: import("@angular/core").Signal<string>;
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AlertaComponent, never>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AlertaComponent, "jvs-alerta", never, { "tipo": { "alias": "tipo"; "required": false; "isSignal": true; }; "titulo": { "alias": "titulo"; "required": false; "isSignal": true; }; "mensaje": { "alias": "mensaje"; "required": false; "isSignal": true; }; "iconoManual": { "alias": "icono"; "required": false; "isSignal": true; }; "clasesManual": { "alias": "clases"; "required": false; "isSignal": true; }; "botonCerrar": { "alias": "botonCerrar"; "required": false; "isSignal": true; }; "botonAcepto": { "alias": "botonAcepto"; "required": false; "isSignal": true; }; "textoAcepto": { "alias": "textoAcepto"; "required": false; "isSignal": true; }; }, { "alCerrar": "alCerrar"; "alAceptar": "alAceptar"; }, never, ["*"], true, never>;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './alerta.component';
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, output, computed, Component } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import * as i1 from '@angular/material/icon';
|
|
5
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
6
|
+
|
|
7
|
+
class AlertaComponent {
|
|
8
|
+
// Inputs (Signals)
|
|
9
|
+
tipo = input('info');
|
|
10
|
+
titulo = input();
|
|
11
|
+
mensaje = input();
|
|
12
|
+
iconoManual = input(undefined, { alias: 'icono' });
|
|
13
|
+
clasesManual = input({}, { alias: 'clases' });
|
|
14
|
+
botonCerrar = input(false);
|
|
15
|
+
botonAcepto = input(false);
|
|
16
|
+
textoAcepto = input('Lo entiendo');
|
|
17
|
+
// Outputs
|
|
18
|
+
alCerrar = output();
|
|
19
|
+
alAceptar = output();
|
|
20
|
+
// Computed properties for default styles
|
|
21
|
+
defaults = computed(() => {
|
|
22
|
+
const t = this.tipo();
|
|
23
|
+
switch (t) {
|
|
24
|
+
case 'error':
|
|
25
|
+
return {
|
|
26
|
+
bg: 'bg-red-50',
|
|
27
|
+
border: 'border-red-200',
|
|
28
|
+
text: 'text-red-800',
|
|
29
|
+
icon: 'roundError',
|
|
30
|
+
iconColor: 'text-red-400'
|
|
31
|
+
};
|
|
32
|
+
case 'success':
|
|
33
|
+
return {
|
|
34
|
+
bg: 'bg-green-50',
|
|
35
|
+
border: 'border-green-200',
|
|
36
|
+
text: 'text-green-800',
|
|
37
|
+
icon: 'roundCheckCircle',
|
|
38
|
+
iconColor: 'text-green-400'
|
|
39
|
+
};
|
|
40
|
+
case 'warning':
|
|
41
|
+
return {
|
|
42
|
+
bg: 'bg-amber-50',
|
|
43
|
+
border: 'border-amber-200',
|
|
44
|
+
text: 'text-amber-800',
|
|
45
|
+
icon: 'roundWarning',
|
|
46
|
+
iconColor: 'text-amber-400'
|
|
47
|
+
};
|
|
48
|
+
case 'info':
|
|
49
|
+
default:
|
|
50
|
+
return {
|
|
51
|
+
bg: 'bg-blue-50',
|
|
52
|
+
border: 'border-blue-200',
|
|
53
|
+
text: 'text-blue-800',
|
|
54
|
+
icon: 'roundInfo',
|
|
55
|
+
iconColor: 'text-blue-400'
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
// Final classes merged with manual overrides
|
|
60
|
+
clasesContenedor = computed(() => {
|
|
61
|
+
const d = this.defaults();
|
|
62
|
+
const custom = this.clasesManual()?.contenedor || '';
|
|
63
|
+
if (this.tipo() === 'custom')
|
|
64
|
+
return custom;
|
|
65
|
+
return `flex items-start gap-1 p-2 rounded-lg border ${d.bg} ${d.border} ${d.text} ${custom}`;
|
|
66
|
+
});
|
|
67
|
+
iconoFinal = computed(() => this.iconoManual() || this.defaults().icon);
|
|
68
|
+
clasesIcono = computed(() => {
|
|
69
|
+
const d = this.defaults();
|
|
70
|
+
const custom = this.clasesManual()?.icono || '';
|
|
71
|
+
return `shrink-0 ${d.iconColor} ${custom}`;
|
|
72
|
+
});
|
|
73
|
+
clasesTitulo = computed(() => `font-bold mb-1 ${this.clasesManual()?.titulo || ''}`);
|
|
74
|
+
clasesMensaje = computed(() => `text-xs leading-relaxed ${this.clasesManual()?.mensaje || ''}`);
|
|
75
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AlertaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
76
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: AlertaComponent, isStandalone: true, selector: "jvs-alerta", inputs: { tipo: { classPropertyName: "tipo", publicName: "tipo", isSignal: true, isRequired: false, transformFunction: null }, titulo: { classPropertyName: "titulo", publicName: "titulo", isSignal: true, isRequired: false, transformFunction: null }, mensaje: { classPropertyName: "mensaje", publicName: "mensaje", isSignal: true, isRequired: false, transformFunction: null }, iconoManual: { classPropertyName: "iconoManual", publicName: "icono", isSignal: true, isRequired: false, transformFunction: null }, clasesManual: { classPropertyName: "clasesManual", publicName: "clases", isSignal: true, isRequired: false, transformFunction: null }, botonCerrar: { classPropertyName: "botonCerrar", publicName: "botonCerrar", isSignal: true, isRequired: false, transformFunction: null }, botonAcepto: { classPropertyName: "botonAcepto", publicName: "botonAcepto", isSignal: true, isRequired: false, transformFunction: null }, textoAcepto: { classPropertyName: "textoAcepto", publicName: "textoAcepto", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { alCerrar: "alCerrar", alAceptar: "alAceptar" }, ngImport: i0, template: "<div [class]=\"clasesContenedor()\">\n <!-- Icono -->\n <div [class]=\"clasesIcono()\">\n <mat-icon [svgIcon]=\"iconoFinal()\"></mat-icon>\n </div>\n\n <!-- Contenido -->\n <div class=\"flex-grow min-w-0\">\n @if (titulo()) {\n <h4 [class]=\"clasesTitulo()\">{{ titulo() }}</h4>\n }\n\n <div [class]=\"clasesMensaje()\">\n @if (mensaje()) {\n {{ mensaje() }}\n } @else {\n <ng-content></ng-content>\n }\n </div>\n\n <!-- Acciones -->\n @if (botonAcepto()) {\n <div [class]=\"'mt-4 flex ' + (clasesManual().acciones || '')\">\n <button\n type=\"button\"\n (click)=\"alAceptar.emit()\"\n class=\"px-4 py-2 bg-white border border-current rounded-lg font-bold text-xs hover:bg-opacity-10 transition-colors\"\n >\n {{ textoAcepto() }}\n </button>\n </div>\n }\n </div>\n\n <!-- Bot\u00F3n Cerrar -->\n @if (botonCerrar()) {\n <button\n type=\"button\"\n (click)=\"alCerrar.emit()\"\n class=\"shrink-0 hover:bg-black/5 p-1 rounded-md transition-colors\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"h-4 w-4 opacity-50\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n }\n</div>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
77
|
+
}
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AlertaComponent, decorators: [{
|
|
79
|
+
type: Component,
|
|
80
|
+
args: [{ selector: 'jvs-alerta', standalone: true, imports: [CommonModule, MatIconModule], template: "<div [class]=\"clasesContenedor()\">\n <!-- Icono -->\n <div [class]=\"clasesIcono()\">\n <mat-icon [svgIcon]=\"iconoFinal()\"></mat-icon>\n </div>\n\n <!-- Contenido -->\n <div class=\"flex-grow min-w-0\">\n @if (titulo()) {\n <h4 [class]=\"clasesTitulo()\">{{ titulo() }}</h4>\n }\n\n <div [class]=\"clasesMensaje()\">\n @if (mensaje()) {\n {{ mensaje() }}\n } @else {\n <ng-content></ng-content>\n }\n </div>\n\n <!-- Acciones -->\n @if (botonAcepto()) {\n <div [class]=\"'mt-4 flex ' + (clasesManual().acciones || '')\">\n <button\n type=\"button\"\n (click)=\"alAceptar.emit()\"\n class=\"px-4 py-2 bg-white border border-current rounded-lg font-bold text-xs hover:bg-opacity-10 transition-colors\"\n >\n {{ textoAcepto() }}\n </button>\n </div>\n }\n </div>\n\n <!-- Bot\u00F3n Cerrar -->\n @if (botonCerrar()) {\n <button\n type=\"button\"\n (click)=\"alCerrar.emit()\"\n class=\"shrink-0 hover:bg-black/5 p-1 rounded-md transition-colors\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"h-4 w-4 opacity-50\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n }\n</div>\n", styles: [":host{display:block}\n"] }]
|
|
81
|
+
}] });
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Generated bundle index. Do not edit.
|
|
85
|
+
*/
|
|
86
|
+
|
|
87
|
+
export { AlertaComponent };
|
|
88
|
+
//# sourceMappingURL=jvsoft-components-alerta.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jvsoft-components-alerta.mjs","sources":["../../../projects/components/alerta/alerta.component.ts","../../../projects/components/alerta/alerta.component.html","../../../projects/components/alerta/jvsoft-components-alerta.ts"],"sourcesContent":["import {Component, computed, input, output} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {MatIconModule} from '@angular/material/icon';\n\nexport interface AlertaClases {\n contenedor?: string;\n icono?: string;\n titulo?: string;\n mensaje?: string;\n acciones?: string;\n}\n\nexport type AlertaTipo = 'info' | 'error' | 'success' | 'warning' | 'custom';\n\n@Component({\n selector: 'jvs-alerta',\n standalone: true,\n imports: [CommonModule, MatIconModule],\n templateUrl: './alerta.component.html',\n styles: [`\n :host { display: block; }\n `]\n})\nexport class AlertaComponent {\n // Inputs (Signals)\n tipo = input<AlertaTipo>('info');\n titulo = input<string>();\n mensaje = input<string>();\n iconoManual = input<string>(undefined, { alias: 'icono' });\n clasesManual = input<AlertaClases>({}, { alias: 'clases' });\n\n botonCerrar = input<boolean>(false);\n botonAcepto = input<boolean>(false);\n textoAcepto = input<string>('Lo entiendo');\n\n // Outputs\n alCerrar = output<void>();\n alAceptar = output<void>();\n\n // Computed properties for default styles\n private defaults = computed(() => {\n const t = this.tipo();\n switch (t) {\n case 'error':\n return {\n bg: 'bg-red-50',\n border: 'border-red-200',\n text: 'text-red-800',\n icon: 'roundError',\n iconColor: 'text-red-400'\n };\n case 'success':\n return {\n bg: 'bg-green-50',\n border: 'border-green-200',\n text: 'text-green-800',\n icon: 'roundCheckCircle',\n iconColor: 'text-green-400'\n };\n case 'warning':\n return {\n bg: 'bg-amber-50',\n border: 'border-amber-200',\n text: 'text-amber-800',\n icon: 'roundWarning',\n iconColor: 'text-amber-400'\n };\n case 'info':\n default:\n return {\n bg: 'bg-blue-50',\n border: 'border-blue-200',\n text: 'text-blue-800',\n icon: 'roundInfo',\n iconColor: 'text-blue-400'\n };\n }\n });\n\n // Final classes merged with manual overrides\n clasesContenedor = computed(() => {\n const d = this.defaults();\n const custom = this.clasesManual()?.contenedor || '';\n if (this.tipo() === 'custom') return custom;\n return `flex items-start gap-1 p-2 rounded-lg border ${d.bg} ${d.border} ${d.text} ${custom}`;\n });\n\n iconoFinal = computed(() => this.iconoManual() || this.defaults().icon);\n\n clasesIcono = computed(() => {\n const d = this.defaults();\n const custom = this.clasesManual()?.icono || '';\n return `shrink-0 ${d.iconColor} ${custom}`;\n });\n\n clasesTitulo = computed(() => `font-bold mb-1 ${this.clasesManual()?.titulo || ''}`);\n clasesMensaje = computed(() => `text-xs leading-relaxed ${this.clasesManual()?.mensaje || ''}`);\n}\n","<div [class]=\"clasesContenedor()\">\n <!-- Icono -->\n <div [class]=\"clasesIcono()\">\n <mat-icon [svgIcon]=\"iconoFinal()\"></mat-icon>\n </div>\n\n <!-- Contenido -->\n <div class=\"flex-grow min-w-0\">\n @if (titulo()) {\n <h4 [class]=\"clasesTitulo()\">{{ titulo() }}</h4>\n }\n\n <div [class]=\"clasesMensaje()\">\n @if (mensaje()) {\n {{ mensaje() }}\n } @else {\n <ng-content></ng-content>\n }\n </div>\n\n <!-- Acciones -->\n @if (botonAcepto()) {\n <div [class]=\"'mt-4 flex ' + (clasesManual().acciones || '')\">\n <button\n type=\"button\"\n (click)=\"alAceptar.emit()\"\n class=\"px-4 py-2 bg-white border border-current rounded-lg font-bold text-xs hover:bg-opacity-10 transition-colors\"\n >\n {{ textoAcepto() }}\n </button>\n </div>\n }\n </div>\n\n <!-- Botón Cerrar -->\n @if (botonCerrar()) {\n <button\n type=\"button\"\n (click)=\"alCerrar.emit()\"\n class=\"shrink-0 hover:bg-black/5 p-1 rounded-md transition-colors\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"h-4 w-4 opacity-50\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAuBa,eAAe,CAAA;;AAExB,IAAA,IAAI,GAAG,KAAK,CAAa,MAAM,CAAC;IAChC,MAAM,GAAG,KAAK,EAAU;IACxB,OAAO,GAAG,KAAK,EAAU;IACzB,WAAW,GAAG,KAAK,CAAS,SAAS,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IAC1D,YAAY,GAAG,KAAK,CAAe,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAE3D,IAAA,WAAW,GAAG,KAAK,CAAU,KAAK,CAAC;AACnC,IAAA,WAAW,GAAG,KAAK,CAAU,KAAK,CAAC;AACnC,IAAA,WAAW,GAAG,KAAK,CAAS,aAAa,CAAC;;IAG1C,QAAQ,GAAG,MAAM,EAAQ;IACzB,SAAS,GA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EAAA,IAAA,EAAA,YAAY,8BAAE,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,SAAA,EAAA,SAAA,EAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAM5B,eAAe,EAAA,UAAA,EAAA,CAAA;kBAT3B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,cACV,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,qlDAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;;AEjB1C;;AAEG;;;;"}
|
|
@@ -3,7 +3,7 @@ import { signal, computed, Injectable, InjectionToken, inject, input, output, Co
|
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import { Subject, BehaviorSubject } from 'rxjs';
|
|
6
|
-
import
|
|
6
|
+
import { format } from 'date-fns';
|
|
7
7
|
import * as i2 from '@angular/forms';
|
|
8
8
|
import { FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
9
9
|
import * as i3 from '@angular/material/autocomplete';
|
|
@@ -180,7 +180,7 @@ class FiltroBusquedaComponent {
|
|
|
180
180
|
destroy$ = new Subject();
|
|
181
181
|
sufixTemporal = '_temporal';
|
|
182
182
|
tipoValorFuncion = tipoValorFuncion;
|
|
183
|
-
fechaActual =
|
|
183
|
+
fechaActual = new Date();
|
|
184
184
|
constructor() {
|
|
185
185
|
this.inputParaEnviarAutocomplete.pipe(debounceTime(500), takeUntil(this.destroy$)).subscribe((param) => {
|
|
186
186
|
this.queryService?.cargar(this, [param.reqQuery], param.reqData, false, this.prefijoConsulta()).then((dRet) => {
|
|
@@ -374,17 +374,17 @@ class FiltroBusquedaComponent {
|
|
|
374
374
|
const meta = { campo: campo.campo, label: campo.label || '', value: null };
|
|
375
375
|
if (campo.dateRange) {
|
|
376
376
|
const [fIni, fFin] = campo.dateRange.campo;
|
|
377
|
-
datosFiltro[fIni] = rawForm[fIni] ?
|
|
378
|
-
datosFiltro[fFin] = rawForm[fFin] ?
|
|
377
|
+
datosFiltro[fIni] = rawForm[fIni] ? format(rawForm[fIni], 'yyyyMMdd') : '';
|
|
378
|
+
datosFiltro[fFin] = rawForm[fFin] ? format(rawForm[fFin], 'yyyyMMdd') : '';
|
|
379
379
|
if (rawForm[fIni] && rawForm[fFin]) {
|
|
380
|
-
meta.value = `${
|
|
380
|
+
meta.value = `${format(rawForm[fIni], 'dd/MM/yyyy')} - ${format(rawForm[fFin], 'dd/MM/yyyy')}`;
|
|
381
381
|
resumenItems.push(`${meta.label}: ${meta.value}`);
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
else if (campo.control === 'date') {
|
|
385
385
|
const val = rawForm[campo.campo];
|
|
386
|
-
datosFiltro[campo.campo] = val ?
|
|
387
|
-
meta.value = val ?
|
|
386
|
+
datosFiltro[campo.campo] = val ? format(val, 'yyyyMMdd') : '';
|
|
387
|
+
meta.value = val ? format(val, 'dd/MM/yyyy') : '';
|
|
388
388
|
if (meta.value)
|
|
389
389
|
resumenItems.push(`${meta.label}: ${meta.value}`);
|
|
390
390
|
}
|