@jvsoft/components 1.0.0-alpha.11 → 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/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 +21 -36
- package/fesm2022/jvsoft-components.mjs.map +1 -1
- package/package.json +19 -21
- 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
|
}
|