@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.
@@ -1,10 +1,9 @@
1
- import { __decorate } from 'tslib';
2
1
  import { trigger, state, transition, style, animate } from '@angular/animations';
3
2
  import { TemplatePortal } from '@angular/cdk/portal';
4
3
  import * as i1 from '@angular/common';
5
4
  import { CommonModule, DecimalPipe } from '@angular/common';
6
5
  import * as i0 from '@angular/core';
7
- import { EventEmitter, HostListener, Output, Input, Directive, ViewChild, Optional, Component, inject, Pipe, NgModule, ContentChildren, ViewChildren, Injectable, input, signal, ElementRef, HostBinding } from '@angular/core';
6
+ import { EventEmitter, HostListener, Output, Input, Directive, ViewChild, Optional, Component, inject, Pipe, NgModule, ContentChildren, ViewChildren, Injectable, DestroyRef, input, signal, ElementRef, HostBinding } from '@angular/core';
8
7
  import * as i1$2 from '@angular/forms';
9
8
  import { Validators, FormControl, FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms';
10
9
  import * as i14 from '@angular/material/badge';
@@ -27,13 +26,12 @@ import * as i2 from '@angular/material/table';
27
26
  import { MatColumnDef, MatTable, MatTableModule, MatTableDataSource, MatFooterRow, MatRow } from '@angular/material/table';
28
27
  import * as i4$1 from '@angular/material/tooltip';
29
28
  import { MatTooltipModule } from '@angular/material/tooltip';
30
- import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
31
- import moment from 'moment';
29
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
30
+ import { addMinutes } from 'date-fns';
32
31
  import { Subject, takeUntil, startWith, of, fromEvent } from 'rxjs';
33
32
  import { filter, map, take } from 'rxjs/operators';
34
- import shortHash from 'shorthash2';
35
33
  import * as i4 from '@jvsoft/utils';
36
- import { JvsPopoverDirective, JvsPopoverListenerDirective } from '@jvsoft/utils';
34
+ import { JvsPopoverDirective, JvsPopoverListenerDirective, simpleHash } from '@jvsoft/utils';
37
35
  import * as i1$1 from '@angular/platform-browser';
38
36
  import { DomSanitizer } from '@angular/platform-browser';
39
37
  import * as XLSX from 'xlsx';
@@ -871,18 +869,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
871
869
  }]
872
870
  }] });
873
871
 
874
- var TablaMantenimientoComponent_1;
875
- let TablaMantenimientoComponent = class TablaMantenimientoComponent {
876
- static { TablaMantenimientoComponent_1 = this; }
872
+ class TablaMantenimientoComponent {
877
873
  fb;
878
874
  overlay;
879
875
  viewContainerRef;
880
876
  tablaMantenimientoService;
881
877
  cdRef;
882
878
  static nextId = 0;
883
- id = `jvs-tabla-mantenimiento-id-${TablaMantenimientoComponent_1.nextId++}`;
879
+ id = `jvs-tabla-mantenimiento-id-${TablaMantenimientoComponent.nextId++}`;
884
880
  router = inject(Router);
885
881
  route = inject(ActivatedRoute);
882
+ destroyRef = inject(DestroyRef);
886
883
  get templateBotonesComunes() {
887
884
  return this.tablaMantenimientoService.templateBotonesComunes;
888
885
  }
@@ -1201,7 +1198,7 @@ let TablaMantenimientoComponent = class TablaMantenimientoComponent {
1201
1198
  idTablaValor(data) {
1202
1199
  if (data) {
1203
1200
  if (this.idTabla.length < 1) {
1204
- return shortHash(JSON.stringify({ data, claseFinal: undefined }));
1201
+ return simpleHash(JSON.stringify({ data, claseFinal: undefined }));
1205
1202
  }
1206
1203
  return this.idTabla.map(d => data[d]).join('-');
1207
1204
  }
@@ -1211,19 +1208,11 @@ let TablaMantenimientoComponent = class TablaMantenimientoComponent {
1211
1208
  rowTooltip = (item) => '';
1212
1209
  soloIconos = false;
1213
1210
  ngOnInit() {
1214
- this.router.events.pipe(filter(event => event instanceof NavigationEnd), startWith(null), map(() => this.getDeepestRoute(this.route)), map(route => route.snapshot.data), untilDestroyed(this)).subscribe(data => {
1211
+ 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 => {
1215
1212
  console.log(data);
1216
1213
  this.derechosActuales = data['derechos'];
1217
1214
  this.ignorarDerechos = data['ignorarDerechos'] ?? false;
1218
1215
  });
1219
- // this.sharedService.dataRutaActual$.pipe(untilDestroyed(this)).subscribe(datRouteData => {
1220
- // if (datRouteData) {
1221
- // this.derechosActuales = datRouteData['derechos'];
1222
- // if (!this.ignorarDerechos) {
1223
- // this.ignorarDerechos = datRouteData['ignorarDerechos'] ?? false;
1224
- // }
1225
- // }
1226
- // });
1227
1216
  this.paginacion.pageSize = this.pageSize;
1228
1217
  this.paginacion.pageSizeOptions = this.pageSizeOptions;
1229
1218
  this.actualizarCrud();
@@ -1246,9 +1235,9 @@ let TablaMantenimientoComponent = class TablaMantenimientoComponent {
1246
1235
  }
1247
1236
  else {
1248
1237
  console.log('eLSE ID TABLA');
1249
- const dataStr = Array.isArray(res) ? res.find((itm) => shortHash(JSON.stringify({
1238
+ const dataStr = Array.isArray(res) ? res.find((itm) => simpleHash(JSON.stringify({
1250
1239
  ...itm, claseFinal: undefined
1251
- })) == shortHash(JSON.stringify({ ...this.objSeleccionado, claseFinal: undefined }))) : null;
1240
+ })) == simpleHash(JSON.stringify({ ...this.objSeleccionado, claseFinal: undefined }))) : null;
1252
1241
  if (dataStr) {
1253
1242
  this.objSeleccionado = dataStr;
1254
1243
  }
@@ -1350,7 +1339,7 @@ let TablaMantenimientoComponent = class TablaMantenimientoComponent {
1350
1339
  }
1351
1340
  }
1352
1341
  if (this.busquedaTipo() === 'simple') {
1353
- this.cCampoBusqueda.valueChanges.pipe(untilDestroyed(this)).subscribe(value => this.onFilterChange(value ?? ''));
1342
+ this.cCampoBusqueda.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(value => this.onFilterChange(value ?? ''));
1354
1343
  }
1355
1344
  if (this.botonesCRUD === '-') {
1356
1345
  this.botonesMenu.crud = [];
@@ -1563,7 +1552,7 @@ let TablaMantenimientoComponent = class TablaMantenimientoComponent {
1563
1552
  if (objeto[columna.property]) {
1564
1553
  fecha = new Date(objeto[columna.property].replace(/(\d{2}:\d{2}:\d{2}):\w{2}/, '$1'));
1565
1554
  if (getBrowserName() == 'chrome') {
1566
- fecha = moment(objeto[columna.property], true).add(2, 'minutes').toDate();
1555
+ fecha = addMinutes(new Date(objeto[columna.property]), 2);
1567
1556
  }
1568
1557
  }
1569
1558
  acumulador[nColumn] = fecha;
@@ -1701,10 +1690,7 @@ let TablaMantenimientoComponent = class TablaMantenimientoComponent {
1701
1690
  ])
1702
1691
  ]),
1703
1692
  ] });
1704
- };
1705
- TablaMantenimientoComponent = TablaMantenimientoComponent_1 = __decorate([
1706
- UntilDestroy({ checkProperties: true })
1707
- ], TablaMantenimientoComponent);
1693
+ }
1708
1694
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TablaMantenimientoComponent, decorators: [{
1709
1695
  type: Component,
1710
1696
  args: [{ selector: 'jvs-tabla-mantenimiento', standalone: true, imports: [