@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, booleanAttribute, output, computed, Component, EventEmitter, HostListener, Output, Input, Directive, ViewChild, Optional, inject, Pipe, NgModule, ContentChildren, ViewChildren, Injectable, signal, ElementRef, HostBinding, effect, untracked, InjectionToken } from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, output, computed, Component, EventEmitter, HostListener, Output, Input, Directive, ViewChild, Optional, inject, Pipe, NgModule, ContentChildren, ViewChildren, Injectable, DestroyRef, signal, ElementRef, HostBinding, effect, untracked, InjectionToken } from '@angular/core';
|
|
3
3
|
import * as i3 from '@angular/material/dialog';
|
|
4
4
|
import { MatDialogModule } from '@angular/material/dialog';
|
|
5
5
|
import * as i4 from '@angular/material/icon';
|
|
@@ -11,7 +11,6 @@ import * as i5 from '@angular/material/core';
|
|
|
11
11
|
import { MatRipple, MatRippleModule, MatOptionModule } from '@angular/material/core';
|
|
12
12
|
import * as i6 from '@angular/material/divider';
|
|
13
13
|
import { MatDivider, MatDividerModule } from '@angular/material/divider';
|
|
14
|
-
import { __decorate } from 'tslib';
|
|
15
14
|
import { trigger, state, transition, style, animate } from '@angular/animations';
|
|
16
15
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
17
16
|
import * as i2$1 from '@angular/forms';
|
|
@@ -30,13 +29,12 @@ import * as i2 from '@angular/material/table';
|
|
|
30
29
|
import { MatColumnDef, MatTable, MatTableModule, MatTableDataSource, MatFooterRow, MatRow } from '@angular/material/table';
|
|
31
30
|
import * as i4$2 from '@angular/material/tooltip';
|
|
32
31
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
33
|
-
import {
|
|
34
|
-
import
|
|
32
|
+
import { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
|
|
33
|
+
import { addMinutes, format } from 'date-fns';
|
|
35
34
|
import { Subject, takeUntil, startWith, of, fromEvent, BehaviorSubject } from 'rxjs';
|
|
36
35
|
import { filter, map, take, switchMap, debounceTime, takeUntil as takeUntil$1, distinctUntilChanged } from 'rxjs/operators';
|
|
37
|
-
import shortHash from 'shorthash2';
|
|
38
36
|
import * as i4$1 from '@jvsoft/utils';
|
|
39
|
-
import { JvsPopoverDirective, JvsPopoverListenerDirective, DataModel as DataModel$1, generateRandomString, dataEnLista, tipoValorFuncion as tipoValorFuncion$1, getUniqueValues, establecerQuitarRequired, mostrarValorEnBusqueda, getFormValidationErrors } from '@jvsoft/utils';
|
|
37
|
+
import { JvsPopoverDirective, JvsPopoverListenerDirective, simpleHash, DataModel as DataModel$1, generateRandomString, dataEnLista, tipoValorFuncion as tipoValorFuncion$1, getUniqueValues, establecerQuitarRequired, mostrarValorEnBusqueda, getFormValidationErrors } from '@jvsoft/utils';
|
|
40
38
|
import * as i1$1 from '@angular/platform-browser';
|
|
41
39
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
42
40
|
import * as XLSX from 'xlsx';
|
|
@@ -45,7 +43,6 @@ import * as i2$3 from '@angular/cdk/overlay';
|
|
|
45
43
|
import * as i3$2 from '@angular/material/tree';
|
|
46
44
|
import { MatTreeModule } from '@angular/material/tree';
|
|
47
45
|
import { NestedTreeControl } from '@angular/cdk/tree';
|
|
48
|
-
import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
49
46
|
import * as i3$3 from '@angular/material/autocomplete';
|
|
50
47
|
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
51
48
|
import * as i4$3 from '@angular/material/datepicker';
|
|
@@ -969,18 +966,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
969
966
|
}]
|
|
970
967
|
}] });
|
|
971
968
|
|
|
972
|
-
|
|
973
|
-
let TablaMantenimientoComponent = class TablaMantenimientoComponent {
|
|
974
|
-
static { TablaMantenimientoComponent_1 = this; }
|
|
969
|
+
class TablaMantenimientoComponent {
|
|
975
970
|
fb;
|
|
976
971
|
overlay;
|
|
977
972
|
viewContainerRef;
|
|
978
973
|
tablaMantenimientoService;
|
|
979
974
|
cdRef;
|
|
980
975
|
static nextId = 0;
|
|
981
|
-
id = `jvs-tabla-mantenimiento-id-${
|
|
976
|
+
id = `jvs-tabla-mantenimiento-id-${TablaMantenimientoComponent.nextId++}`;
|
|
982
977
|
router = inject(Router);
|
|
983
978
|
route = inject(ActivatedRoute);
|
|
979
|
+
destroyRef = inject(DestroyRef);
|
|
984
980
|
get templateBotonesComunes() {
|
|
985
981
|
return this.tablaMantenimientoService.templateBotonesComunes;
|
|
986
982
|
}
|
|
@@ -1299,7 +1295,7 @@ let TablaMantenimientoComponent = class TablaMantenimientoComponent {
|
|
|
1299
1295
|
idTablaValor(data) {
|
|
1300
1296
|
if (data) {
|
|
1301
1297
|
if (this.idTabla.length < 1) {
|
|
1302
|
-
return
|
|
1298
|
+
return simpleHash(JSON.stringify({ data, claseFinal: undefined }));
|
|
1303
1299
|
}
|
|
1304
1300
|
return this.idTabla.map(d => data[d]).join('-');
|
|
1305
1301
|
}
|
|
@@ -1309,19 +1305,11 @@ let TablaMantenimientoComponent = class TablaMantenimientoComponent {
|
|
|
1309
1305
|
rowTooltip = (item) => '';
|
|
1310
1306
|
soloIconos = false;
|
|
1311
1307
|
ngOnInit() {
|
|
1312
|
-
this.router.events.pipe(filter(event => event instanceof NavigationEnd), startWith(null), map(() => this.getDeepestRoute(this.route)), map(route => route.snapshot.data),
|
|
1308
|
+
this.router.events.pipe(filter(event => event instanceof NavigationEnd), startWith(null), map(() => this.getDeepestRoute(this.route)), map(route => route.snapshot.data), takeUntilDestroyed(this.destroyRef)).subscribe(data => {
|
|
1313
1309
|
console.log(data);
|
|
1314
1310
|
this.derechosActuales = data['derechos'];
|
|
1315
1311
|
this.ignorarDerechos = data['ignorarDerechos'] ?? false;
|
|
1316
1312
|
});
|
|
1317
|
-
// this.sharedService.dataRutaActual$.pipe(untilDestroyed(this)).subscribe(datRouteData => {
|
|
1318
|
-
// if (datRouteData) {
|
|
1319
|
-
// this.derechosActuales = datRouteData['derechos'];
|
|
1320
|
-
// if (!this.ignorarDerechos) {
|
|
1321
|
-
// this.ignorarDerechos = datRouteData['ignorarDerechos'] ?? false;
|
|
1322
|
-
// }
|
|
1323
|
-
// }
|
|
1324
|
-
// });
|
|
1325
1313
|
this.paginacion.pageSize = this.pageSize;
|
|
1326
1314
|
this.paginacion.pageSizeOptions = this.pageSizeOptions;
|
|
1327
1315
|
this.actualizarCrud();
|
|
@@ -1344,9 +1332,9 @@ let TablaMantenimientoComponent = class TablaMantenimientoComponent {
|
|
|
1344
1332
|
}
|
|
1345
1333
|
else {
|
|
1346
1334
|
console.log('eLSE ID TABLA');
|
|
1347
|
-
const dataStr = Array.isArray(res) ? res.find((itm) =>
|
|
1335
|
+
const dataStr = Array.isArray(res) ? res.find((itm) => simpleHash(JSON.stringify({
|
|
1348
1336
|
...itm, claseFinal: undefined
|
|
1349
|
-
})) ==
|
|
1337
|
+
})) == simpleHash(JSON.stringify({ ...this.objSeleccionado, claseFinal: undefined }))) : null;
|
|
1350
1338
|
if (dataStr) {
|
|
1351
1339
|
this.objSeleccionado = dataStr;
|
|
1352
1340
|
}
|
|
@@ -1448,7 +1436,7 @@ let TablaMantenimientoComponent = class TablaMantenimientoComponent {
|
|
|
1448
1436
|
}
|
|
1449
1437
|
}
|
|
1450
1438
|
if (this.busquedaTipo() === 'simple') {
|
|
1451
|
-
this.cCampoBusqueda.valueChanges.pipe(
|
|
1439
|
+
this.cCampoBusqueda.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(value => this.onFilterChange(value ?? ''));
|
|
1452
1440
|
}
|
|
1453
1441
|
if (this.botonesCRUD === '-') {
|
|
1454
1442
|
this.botonesMenu.crud = [];
|
|
@@ -1661,7 +1649,7 @@ let TablaMantenimientoComponent = class TablaMantenimientoComponent {
|
|
|
1661
1649
|
if (objeto[columna.property]) {
|
|
1662
1650
|
fecha = new Date(objeto[columna.property].replace(/(\d{2}:\d{2}:\d{2}):\w{2}/, '$1'));
|
|
1663
1651
|
if (getBrowserName() == 'chrome') {
|
|
1664
|
-
fecha =
|
|
1652
|
+
fecha = addMinutes(new Date(objeto[columna.property]), 2);
|
|
1665
1653
|
}
|
|
1666
1654
|
}
|
|
1667
1655
|
acumulador[nColumn] = fecha;
|
|
@@ -1799,10 +1787,7 @@ let TablaMantenimientoComponent = class TablaMantenimientoComponent {
|
|
|
1799
1787
|
])
|
|
1800
1788
|
]),
|
|
1801
1789
|
] });
|
|
1802
|
-
}
|
|
1803
|
-
TablaMantenimientoComponent = TablaMantenimientoComponent_1 = __decorate([
|
|
1804
|
-
UntilDestroy({ checkProperties: true })
|
|
1805
|
-
], TablaMantenimientoComponent);
|
|
1790
|
+
}
|
|
1806
1791
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TablaMantenimientoComponent, decorators: [{
|
|
1807
1792
|
type: Component,
|
|
1808
1793
|
args: [{ selector: 'jvs-tabla-mantenimiento', standalone: true, imports: [
|
|
@@ -2220,7 +2205,7 @@ class ListaArbolComponent {
|
|
|
2220
2205
|
if (data) {
|
|
2221
2206
|
const idTablaVal = this._idTabla();
|
|
2222
2207
|
if (idTablaVal.length < 1) {
|
|
2223
|
-
return
|
|
2208
|
+
return simpleHash(JSON.stringify({ data, claseFinal: undefined }));
|
|
2224
2209
|
}
|
|
2225
2210
|
return idTablaVal.map(d => data[d]).join('-');
|
|
2226
2211
|
}
|
|
@@ -2479,7 +2464,7 @@ class FiltroBusquedaComponent {
|
|
|
2479
2464
|
destroy$ = new Subject();
|
|
2480
2465
|
sufixTemporal = '_temporal';
|
|
2481
2466
|
tipoValorFuncion = tipoValorFuncion$1;
|
|
2482
|
-
fechaActual =
|
|
2467
|
+
fechaActual = new Date();
|
|
2483
2468
|
constructor() {
|
|
2484
2469
|
this.inputParaEnviarAutocomplete.pipe(debounceTime(500), takeUntil$1(this.destroy$)).subscribe((param) => {
|
|
2485
2470
|
this.queryService?.cargar(this, [param.reqQuery], param.reqData, false, this.prefijoConsulta()).then((dRet) => {
|
|
@@ -2673,17 +2658,17 @@ class FiltroBusquedaComponent {
|
|
|
2673
2658
|
const meta = { campo: campo.campo, label: campo.label || '', value: null };
|
|
2674
2659
|
if (campo.dateRange) {
|
|
2675
2660
|
const [fIni, fFin] = campo.dateRange.campo;
|
|
2676
|
-
datosFiltro[fIni] = rawForm[fIni] ?
|
|
2677
|
-
datosFiltro[fFin] = rawForm[fFin] ?
|
|
2661
|
+
datosFiltro[fIni] = rawForm[fIni] ? format(rawForm[fIni], 'yyyyMMdd') : '';
|
|
2662
|
+
datosFiltro[fFin] = rawForm[fFin] ? format(rawForm[fFin], 'yyyyMMdd') : '';
|
|
2678
2663
|
if (rawForm[fIni] && rawForm[fFin]) {
|
|
2679
|
-
meta.value = `${
|
|
2664
|
+
meta.value = `${format(rawForm[fIni], 'dd/MM/yyyy')} - ${format(rawForm[fFin], 'dd/MM/yyyy')}`;
|
|
2680
2665
|
resumenItems.push(`${meta.label}: ${meta.value}`);
|
|
2681
2666
|
}
|
|
2682
2667
|
}
|
|
2683
2668
|
else if (campo.control === 'date') {
|
|
2684
2669
|
const val = rawForm[campo.campo];
|
|
2685
|
-
datosFiltro[campo.campo] = val ?
|
|
2686
|
-
meta.value = val ?
|
|
2670
|
+
datosFiltro[campo.campo] = val ? format(val, 'yyyyMMdd') : '';
|
|
2671
|
+
meta.value = val ? format(val, 'dd/MM/yyyy') : '';
|
|
2687
2672
|
if (meta.value)
|
|
2688
2673
|
resumenItems.push(`${meta.label}: ${meta.value}`);
|
|
2689
2674
|
}
|
|
@@ -2951,6 +2936,82 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2951
2936
|
}, template: "@if (isCargaCompleta()) {\n <div class=\"filtroBusqueda w-full\">\n <div class=\"border-none p-0 flex flex-col\">\n\n @if (dataOpcionesNuevo().length === 1) {\n <div class=\"flex-1 flex items-end max-sm:flex-col flex-wrap gap-2\">\n <ng-container [ngTemplateOutlet]=\"verOpcionesT\"></ng-container>\n </div>\n } @else if (dataOpcionesNuevo().length > 1) {\n <div class=\"flex-1 flex flex-col flex-wrap gap-2 border\">\n <mat-tab-group\n [selectedIndex]=\"tabActual()\"\n (selectedIndexChange)=\"getControlRaiz('opcion').setValue($event)\"\n class=\"flex-1 flex flex-wrap\"\n [mat-stretch-tabs]=\"false\"\n dynamicHeight\n mat-align-tabs=\"start\"\n >\n @for (item of dataOpcionesNuevo(); track $index) {\n <mat-tab [aria-label]=\"(tabActual() === $index) ? 'primary' : ''\">\n <ng-template mat-tab-label>\n @if (tabActual() === $index) {\n <mat-icon class=\"icon-xs\" svgIcon=\"roundVerified\"></mat-icon>\n }\n {{ item.label }}\n </ng-template>\n\n <div class=\"mx-2 mt-0 pt-0 flex flex-col items-end sm:flex-row flex-wrap gap-2\">\n <ng-container [ngTemplateOutlet]=\"verOpcionesT\"></ng-container>\n </div>\n </mat-tab>\n }\n </mat-tab-group>\n </div>\n }\n </div>\n </div>\n}\n\n<ng-template #verOpcionesT>\n @for (campo of dataOpcionesNuevo()[tabActual()]?.campos; track campo.campo) {\n <ng-container [ngTemplateOutletContext]=\"{controlData: campo}\" [ngTemplateOutlet]=\"controlesFormularioNuevo\"></ng-container>\n }\n <ng-container [ngTemplateOutlet]=\"botonFiltrar\"></ng-container>\n</ng-template>\n\n<ng-template #botonFiltrar>\n <button (click)=\"filtrarData()\"\n class=\"flex items-center justify-center bg-primary text-primary-contrast font-bold uppercase text-xs px-2 py-1 rounded shadow-md hover:shadow-lg outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150\"\n matRipple type=\"button\"\n [disabled]=\"!isCargaCompleta()\"\n >\n <mat-icon class=\"icon-xs\" svgIcon=\"roundFilterAlt\"></mat-icon> \n <span>Filtrar</span>\n </button>\n</ng-template>\n\n<ng-template #controlesFormularioNuevo let-controlData=\"controlData\">\n @switch (controlData.control) {\n @case ('controlAgrupado') {\n <ng-container [ngTemplateOutletContext]=\"{template: inputControlAgrupado, controlData: controlData}\" [ngTemplateOutlet]=\"contenedorInput\"></ng-container>\n }\n @case ('select') {\n <ng-container [ngTemplateOutletContext]=\"{template: inputSelect, controlData: controlData}\" [ngTemplateOutlet]=\"contenedorInput\"></ng-container>\n }\n @case ('autocomplete') {\n <ng-container [ngTemplateOutletContext]=\"{template: inputAutocomplete, controlData: controlData}\" [ngTemplateOutlet]=\"contenedorInput\"></ng-container>\n }\n @case ('date') {\n <ng-container [ngTemplateOutletContext]=\"{template: inputDate, controlData: controlData}\" [ngTemplateOutlet]=\"contenedorInput\"></ng-container>\n }\n @case ('date_range') {\n <ng-container [ngTemplateOutletContext]=\"{template: inputDateRange, controlData: controlData}\" [ngTemplateOutlet]=\"contenedorInput\"></ng-container>\n }\n @case ('checkbox') {\n <ng-container [ngTemplateOutletContext]=\"{template: inputCheckBox, controlData: controlData}\" [ngTemplateOutlet]=\"contenedorInput\"></ng-container>\n }\n @default {\n @if (controlData.control === 'text' || controlData.control === 'number') {\n <ng-container [ngTemplateOutletContext]=\"{template: inputTextNumber, controlData: controlData}\" [ngTemplateOutlet]=\"contenedorInput\"></ng-container>\n }\n }\n }\n</ng-template>\n\n<ng-template #contenedorInput let-template=\"template\" let-controlData=\"controlData\">\n <fieldset [class.flex-auto]=\"!controlData.cssClass\" [class]=\"controlData.cssClass\" class=\"appearance-none contenedorCampo relative\">\n <legend>\n <label [for]=\"controlData.campo\">{{ controlData.label }}@if(controlData.required){<span class=\"text-red-700 font-bold\"> *</span>}</label>\n </legend>\n <ng-container [ngTemplateOutletContext]=\"{controlData: controlData}\" [ngTemplateOutlet]=\"template\"></ng-container>\n </fieldset>\n</ng-template>\n\n<ng-template #inputSelect let-controlData=\"controlData\">\n <select [formControl]=\"getControl(controlData.campo)\"\n (change)=\"cambiarSeleccionNuevo(controlData, $event);\"\n [class]=\"controlData.select?.cssClass?.class\"\n [id]=\"controlData.campo\"\n [required]=\"controlData.required\"\n [class.border-b-red-700]=\"getControl(controlData.campo).invalid\"\n >\n @if (controlData.select?.textoCuandoNulo) {\n <option value=\"\">{{ controlData.select?.textoCuandoNulo }}</option>\n }\n @for (itemSelect of dataServidorSuscripcion[controlData.select?.data!] | async; track $index) {\n <option [class]=\"controlData.select?.cssClass?.option\" [value]=\"campoValorEval(controlData, itemSelect)\">\n {{ campoTextEval(controlData, itemSelect) }}\n </option>\n }\n </select>\n</ng-template>\n\n<ng-template #inputControlAgrupado let-controlData=\"controlData\">\n <div class=\"flex items-center campos-container\">\n @for (sub of controlData.controlAgrupado; track sub.campo) {\n @switch (sub.control) {\n @case ('select') {\n <ng-container [ngTemplateOutletContext]=\"{controlData: sub}\" [ngTemplateOutlet]=\"inputSelect\"></ng-container>\n }\n @case ('autocomplete') {\n <ng-container [ngTemplateOutletContext]=\"{controlData: sub}\" [ngTemplateOutlet]=\"inputAutocomplete\"></ng-container>\n }\n @case ('date') {\n <ng-container [ngTemplateOutletContext]=\"{controlData: sub}\" [ngTemplateOutlet]=\"inputDate\"></ng-container>\n }\n @case ('date_range') {\n <ng-container [ngTemplateOutletContext]=\"{controlData: sub}\" [ngTemplateOutlet]=\"inputDateRange\"></ng-container>\n }\n @case ('checkbox') {\n <ng-container [ngTemplateOutletContext]=\"{controlData: sub}\" [ngTemplateOutlet]=\"inputCheckBox\"></ng-container>\n }\n @default {\n @if (sub.control === 'text' || sub.control === 'number') {\n <ng-container [ngTemplateOutletContext]=\"{controlData: sub}\" [ngTemplateOutlet]=\"inputTextNumber\"></ng-container>\n }\n }\n }\n }\n </div>\n</ng-template>\n\n<ng-template #inputAutocomplete let-controlData=\"controlData\">\n <div class=\"flex items-center formcontrol-container\">\n <input [formControl]=\"getControl(controlData.campo + sufixTemporal)\"\n (input)=\"cambiarNuevo(controlData, $any($event.target).value)\"\n [matAutocomplete]=\"auto\"\n autocomplete=\"off\"\n [id]=\"controlData.campo\"\n placeholder=\"{{ controlData.autocomplete?.textoCuandoNulo ?? controlData.label }}\"\n [required]=\"controlData.required\"\n [class.border-b-red-700]=\"getControl(controlData.campo).invalid\"\n >\n <mat-autocomplete #auto=\"matAutocomplete\"\n (optionSelected)=\"cambiarSeleccionNuevo(controlData, $event)\"\n [panelWidth]=\"'auto'\"\n [displayWith]=\"getAutocompleteLabel.bind(this, controlData)\"\n >\n @for (itemSelect of filtrados[controlData.campo]; track $index) {\n <mat-option [class]=\"controlData.autocomplete?.cssClass?.option\" [value]=\"campoValorEval(controlData, itemSelect)\">\n @if (controlData.autocomplete?.optionInnerHtml) {\n <div [innerHTML]=\"controlData.autocomplete?.optionInnerHtml!(itemSelect)\"></div>\n } @else {\n {{ campoTextEval(controlData, itemSelect) }}\n }\n </mat-option>\n }\n </mat-autocomplete>\n\n <div class=\"flex items-center justify-start\">\n <button (click)=\"limpiarAutocomplete(controlData, $event)\" class=\"boton-circular-gris\"\n matRipple\n type=\"button\"\n >\n <mat-icon [svgIcon]=\"(getControl(controlData.campo).value ? 'roundCancel' : 'roundSearch')\" class=\"icon-2xs\"></mat-icon>\n </button>\n </div>\n </div>\n</ng-template>\n\n<ng-template #inputTextNumber let-controlData=\"controlData\">\n <input (keyup.enter)=\"controlData.keyUpEnter ? filtrarData() : null\"\n [formControl]=\"getControl(controlData.campo)\"\n [type]=\"controlData.control\"\n autocomplete=\"off\"\n [id]=\"controlData.campo\"\n placeholder=\"{{ controlData.label }}\"\n [required]=\"controlData.required\"\n [class.border-b-red-700]=\"getControl(controlData.campo).invalid\"\n >\n</ng-template>\n\n<ng-template #inputDate let-controlData=\"controlData\">\n <div class=\"flex items-center date-container\">\n <input (keyup.enter)=\"controlData.keyUpEnter ? filtrarData() : null\"\n [formControl]=\"getControl(controlData.campo)\"\n (dateChange)=\"cambiarSeleccionNuevo(controlData, $event)\"\n [matDatepicker]=\"i\"\n autocomplete=\"off\"\n [id]=\"controlData.campo\"\n placeholder=\"{{ controlData.label }}\"\n type=\"text\"\n [required]=\"controlData.required\"\n [class.border-b-red-700]=\"getControl(controlData.campo).invalid\"\n >\n <mat-datepicker-toggle [for]=\"i\" class=\"icon-xs\" matSuffix></mat-datepicker-toggle>\n <mat-datepicker #i></mat-datepicker>\n </div>\n</ng-template>\n\n<ng-template #inputDateRange let-controlData=\"controlData\">\n <div class=\"flex items-center daterange-container\">\n <mat-date-range-input [rangePicker]=\"i\">\n <input [formControl]=\"getControl(controlData.dateRange?.campo![0])\" matStartDate placeholder=\"Desde\">\n <input [formControl]=\"getControl(controlData.dateRange?.campo![1])\" matEndDate placeholder=\"Hasta\">\n </mat-date-range-input>\n <mat-datepicker-toggle [for]=\"i\" class=\"icon-xs\"></mat-datepicker-toggle>\n <mat-date-range-picker #i></mat-date-range-picker>\n </div>\n</ng-template>\n\n<ng-template #inputCheckBox let-controlData=\"controlData\">\n <input [formControl]=\"getControl(controlData.campo)\"\n [id]=\"controlData.campo\"\n [required]=\"controlData.required\"\n [class.border-b-red-700]=\"getControl(controlData.campo).invalid\"\n type=\"checkbox\"\n (change)=\"cambiarSeleccionNuevo(controlData, $event)\"\n >\n</ng-template>\n" }]
|
|
2952
2937
|
}], ctorParameters: () => [] });
|
|
2953
2938
|
|
|
2939
|
+
class AlertaComponent {
|
|
2940
|
+
// Inputs (Signals)
|
|
2941
|
+
tipo = input('info');
|
|
2942
|
+
titulo = input();
|
|
2943
|
+
mensaje = input();
|
|
2944
|
+
iconoManual = input(undefined, { alias: 'icono' });
|
|
2945
|
+
clasesManual = input({}, { alias: 'clases' });
|
|
2946
|
+
botonCerrar = input(false);
|
|
2947
|
+
botonAcepto = input(false);
|
|
2948
|
+
textoAcepto = input('Lo entiendo');
|
|
2949
|
+
// Outputs
|
|
2950
|
+
alCerrar = output();
|
|
2951
|
+
alAceptar = output();
|
|
2952
|
+
// Computed properties for default styles
|
|
2953
|
+
defaults = computed(() => {
|
|
2954
|
+
const t = this.tipo();
|
|
2955
|
+
switch (t) {
|
|
2956
|
+
case 'error':
|
|
2957
|
+
return {
|
|
2958
|
+
bg: 'bg-red-50',
|
|
2959
|
+
border: 'border-red-200',
|
|
2960
|
+
text: 'text-red-800',
|
|
2961
|
+
icon: 'roundError',
|
|
2962
|
+
iconColor: 'text-red-400'
|
|
2963
|
+
};
|
|
2964
|
+
case 'success':
|
|
2965
|
+
return {
|
|
2966
|
+
bg: 'bg-green-50',
|
|
2967
|
+
border: 'border-green-200',
|
|
2968
|
+
text: 'text-green-800',
|
|
2969
|
+
icon: 'roundCheckCircle',
|
|
2970
|
+
iconColor: 'text-green-400'
|
|
2971
|
+
};
|
|
2972
|
+
case 'warning':
|
|
2973
|
+
return {
|
|
2974
|
+
bg: 'bg-amber-50',
|
|
2975
|
+
border: 'border-amber-200',
|
|
2976
|
+
text: 'text-amber-800',
|
|
2977
|
+
icon: 'roundWarning',
|
|
2978
|
+
iconColor: 'text-amber-400'
|
|
2979
|
+
};
|
|
2980
|
+
case 'info':
|
|
2981
|
+
default:
|
|
2982
|
+
return {
|
|
2983
|
+
bg: 'bg-blue-50',
|
|
2984
|
+
border: 'border-blue-200',
|
|
2985
|
+
text: 'text-blue-800',
|
|
2986
|
+
icon: 'roundInfo',
|
|
2987
|
+
iconColor: 'text-blue-400'
|
|
2988
|
+
};
|
|
2989
|
+
}
|
|
2990
|
+
});
|
|
2991
|
+
// Final classes merged with manual overrides
|
|
2992
|
+
clasesContenedor = computed(() => {
|
|
2993
|
+
const d = this.defaults();
|
|
2994
|
+
const custom = this.clasesManual()?.contenedor || '';
|
|
2995
|
+
if (this.tipo() === 'custom')
|
|
2996
|
+
return custom;
|
|
2997
|
+
return `flex items-start gap-1 p-2 rounded-lg border ${d.bg} ${d.border} ${d.text} ${custom}`;
|
|
2998
|
+
});
|
|
2999
|
+
iconoFinal = computed(() => this.iconoManual() || this.defaults().icon);
|
|
3000
|
+
clasesIcono = computed(() => {
|
|
3001
|
+
const d = this.defaults();
|
|
3002
|
+
const custom = this.clasesManual()?.icono || '';
|
|
3003
|
+
return `shrink-0 ${d.iconColor} ${custom}`;
|
|
3004
|
+
});
|
|
3005
|
+
clasesTitulo = computed(() => `font-bold mb-1 ${this.clasesManual()?.titulo || ''}`);
|
|
3006
|
+
clasesMensaje = computed(() => `text-xs leading-relaxed ${this.clasesManual()?.mensaje || ''}`);
|
|
3007
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AlertaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3008
|
+
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: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
3009
|
+
}
|
|
3010
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AlertaComponent, decorators: [{
|
|
3011
|
+
type: Component,
|
|
3012
|
+
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"] }]
|
|
3013
|
+
}] });
|
|
3014
|
+
|
|
2954
3015
|
// export {};
|
|
2955
3016
|
// import './src/styles.scss';
|
|
2956
3017
|
|
|
@@ -2958,5 +3019,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2958
3019
|
* Generated bundle index. Do not edit.
|
|
2959
3020
|
*/
|
|
2960
3021
|
|
|
2961
|
-
export { DialogFlotanteComponent, FiltroBusquedaComponent, FiltroBusquedaService, ListaArbolComponent, LucesNavidadComponent, MatSuffixSearchButtonComponent, MenuComponent, ProgressBarComponent, QUERY_SERVICE_TOKEN, TablaMantenimientoComponent, TablaMantenimientoService };
|
|
3022
|
+
export { AlertaComponent, DialogFlotanteComponent, FiltroBusquedaComponent, FiltroBusquedaService, ListaArbolComponent, LucesNavidadComponent, MatSuffixSearchButtonComponent, MenuComponent, ProgressBarComponent, QUERY_SERVICE_TOKEN, TablaMantenimientoComponent, TablaMantenimientoService };
|
|
2962
3023
|
//# sourceMappingURL=jvsoft-components.mjs.map
|