@jvsoft/firma 1.0.0-alpha.13

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.
@@ -0,0 +1,38 @@
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
+ import { ColumnaTabla, DataServidor, OpcionSeleccionada } from '@jvsoft/components/tabla-mantenimiento';
3
+ import { MatDialogRef } from '@angular/material/dialog';
4
+ import { FormGroup } from '@angular/forms';
5
+ import * as i0 from "@angular/core";
6
+ export declare class ArchivosFirmantesComponent implements OnInit {
7
+ datosDialogRecibidos: {
8
+ esDialog: boolean;
9
+ permitirEliminar: boolean;
10
+ iArchivoId: string;
11
+ cArchivoKey: string;
12
+ };
13
+ private dialogActual;
14
+ private readonly firmaQuery;
15
+ private readonly dialog;
16
+ private readonly fb;
17
+ dataServidorSuscripcion: DataServidor;
18
+ seleccionados: any;
19
+ matDialogRefActual: MatDialogRef<any>;
20
+ btnGuardarClick: EventEmitter<any>;
21
+ btnCerrarClick: EventEmitter<any>;
22
+ columnasPrincipal: ColumnaTabla<any>[];
23
+ frmFiltro: FormGroup;
24
+ frmRegistro: FormGroup;
25
+ get esDialog(): boolean;
26
+ get permitirEliminar(): boolean;
27
+ constructor(datosDialogRecibidos: {
28
+ esDialog: boolean;
29
+ permitirEliminar: boolean;
30
+ iArchivoId: string;
31
+ cArchivoKey: string;
32
+ }, dialogActual: MatDialogRef<ArchivosFirmantesComponent>);
33
+ ngOnInit(): void;
34
+ cargarLista(): void;
35
+ opcMenu(v: OpcionSeleccionada): void;
36
+ static ɵfac: i0.ɵɵFactoryDeclaration<ArchivosFirmantesComponent, [{ optional: true; }, { optional: true; }]>;
37
+ static ɵcmp: i0.ɵɵComponentDeclaration<ArchivosFirmantesComponent, "jvs-archivos-firmantes", never, { "matDialogRefActual": { "alias": "matDialogRefActual"; "required": false; }; }, { "btnGuardarClick": "btnGuardarClick"; "btnCerrarClick": "btnCerrarClick"; }, never, never, true, never>;
38
+ }
@@ -0,0 +1,29 @@
1
+ import { FormControl } from '@angular/forms';
2
+ import { MatDialogRef } from '@angular/material/dialog';
3
+ import { BehaviorSubject } from 'rxjs';
4
+ import { ParametrosFirmaElectronicaDialog } from '../models/types';
5
+ import * as i0 from "@angular/core";
6
+ export declare class DialogFirmaElectronicaComponent {
7
+ datosDialogRecibidos: ParametrosFirmaElectronicaDialog;
8
+ dialogActualRef: MatDialogRef<DialogFirmaElectronicaComponent>;
9
+ private readonly firmaQuery;
10
+ private readonly firmaService;
11
+ private readonly fb;
12
+ _lstFirma: BehaviorSubject<any[]>;
13
+ fcCargos: FormControl<string | null>;
14
+ frmFirma: import("@angular/forms").FormGroup<{
15
+ iPersId: FormControl<string | null>;
16
+ iTipoFirmaId: FormControl<string | null>;
17
+ iMotFirmaId: FormControl<string | null>;
18
+ iEstablecimientoId: FormControl<string | null>;
19
+ iDepenId: FormControl<string | null>;
20
+ iCargoId: FormControl<string | null>;
21
+ iArchivoId: FormControl<string | null>;
22
+ }>;
23
+ get dataExtraGuardarFirmante(): object;
24
+ constructor(datosDialogRecibidos: ParametrosFirmaElectronicaDialog, dialogActualRef: MatDialogRef<DialogFirmaElectronicaComponent>);
25
+ cerrarDialogActual(): void;
26
+ aplicarFirmaElectronica(): void;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<DialogFirmaElectronicaComponent, [{ optional: true; }, { optional: true; }]>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<DialogFirmaElectronicaComponent, "jvs-firma-electronica", never, {}, {}, never, never, true, never>;
29
+ }
@@ -0,0 +1,28 @@
1
+ import { DocumentoFirma, ModuloFirma } from '../models/types';
2
+ import * as i0 from "@angular/core";
3
+ export declare class DialogFirmaElectronicaService {
4
+ private readonly firmaService;
5
+ private readonly firmaUsuario;
6
+ private readonly firmaConfig;
7
+ private readonly dialog;
8
+ private readonly toastr;
9
+ private readonly fb;
10
+ campoFirmaEval: string;
11
+ documentoFirma: DocumentoFirma | null;
12
+ frmFirma: import("@angular/forms").FormGroup<{
13
+ iPersId: import("@angular/forms").FormControl<string | null>;
14
+ iTipoFirmaId: import("@angular/forms").FormControl<number | null>;
15
+ iMotFirmaId: import("@angular/forms").FormControl<string | null>;
16
+ iEstablecimientoId: import("@angular/forms").FormControl<string | null>;
17
+ iDepenId: import("@angular/forms").FormControl<string | null>;
18
+ iCargoId: import("@angular/forms").FormControl<string | null>;
19
+ iArchivoId: import("@angular/forms").FormControl<string | null>;
20
+ }>;
21
+ firmarPorTipo(tipo: any, archivo: any, tiposModulos?: {
22
+ digital?: ModuloFirma;
23
+ electronica?: ModuloFirma;
24
+ }, dataExtraGuardarFirmante?: any): void;
25
+ private _emitirDocumentoFirma;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<DialogFirmaElectronicaService, never>;
27
+ static ɵprov: i0.ɵɵInjectableDeclaration<DialogFirmaElectronicaService>;
28
+ }
@@ -0,0 +1,363 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, inject, signal, Injectable, Optional, Inject, Component, EventEmitter, Output, Input } from '@angular/core';
3
+ import { Subject, BehaviorSubject } from 'rxjs';
4
+ import * as i2 from '@angular/common';
5
+ import { CommonModule } from '@angular/common';
6
+ import * as i3 from '@angular/material/form-field';
7
+ import { MatFormFieldModule } from '@angular/material/form-field';
8
+ import * as i4 from '@angular/material/icon';
9
+ import { MatIconModule } from '@angular/material/icon';
10
+ import * as i5 from '@angular/material/core';
11
+ import { MatOptionModule, MatRippleModule } from '@angular/material/core';
12
+ import * as i6 from '@angular/material/select';
13
+ import { MatSelectModule } from '@angular/material/select';
14
+ import * as i7 from '@angular/forms';
15
+ import { FormBuilder, FormControl, Validators, ReactiveFormsModule } from '@angular/forms';
16
+ import * as i1 from '@angular/material/dialog';
17
+ import { MAT_DIALOG_DATA, MatDialog } from '@angular/material/dialog';
18
+ import { DialogFlotanteComponent } from '@jvsoft/components/dialog-flotante';
19
+ import { mensajeAlerta, encodeBase64Object } from '@jvsoft/utils';
20
+ import { ToastrService } from 'ngx-toastr';
21
+ import { TablaMantenimientoComponent } from '@jvsoft/components/tabla-mantenimiento';
22
+
23
+ const JVS_FIRMA_PROGRESS = new InjectionToken('JVS_FIRMA_PROGRESS');
24
+ const JVS_FIRMA_HTTP = new InjectionToken('JVS_FIRMA_HTTP');
25
+ const JVS_FIRMA_QUERY = new InjectionToken('JVS_FIRMA_QUERY');
26
+ const JVS_FIRMA_USUARIO = new InjectionToken('JVS_FIRMA_USUARIO');
27
+ const JVS_FIRMA_CONFIG = new InjectionToken('JVS_FIRMA_CONFIG');
28
+
29
+ class FirmaService {
30
+ overlayService = inject(JVS_FIRMA_PROGRESS);
31
+ _campoFirmaEval = signal(null);
32
+ campoFirmaEval = this._campoFirmaEval.asReadonly();
33
+ _documentoFirma = signal(null);
34
+ documentoFirma = this._documentoFirma.asReadonly();
35
+ _estadoFirma = signal(null);
36
+ estadoFirma = this._estadoFirma.asReadonly();
37
+ _firmando = signal(null);
38
+ firmando = this._firmando.asReadonly();
39
+ _firmaEvento = new Subject();
40
+ firmaEvento$ = this._firmaEvento.asObservable();
41
+ constructor() {
42
+ window.addEventListener('signatureInit', () => this.interfazYSuscripciones('iniciado'));
43
+ window.addEventListener('signatureOk', () => this.interfazYSuscripciones('ok'));
44
+ window.addEventListener('signatureCancel', () => this.interfazYSuscripciones('error'));
45
+ }
46
+ setCampoFirma(val) { this._campoFirmaEval.set(val); }
47
+ setDocumentoFirma(doc) { this._documentoFirma.set(doc); }
48
+ resetEstado() { this._estadoFirma.set(null); }
49
+ interfazYSuscripciones(estado, config = {}) {
50
+ this._estadoFirma.set(estado);
51
+ this._firmaEvento.next({ estado, documento: this._documentoFirma(), campo: this._campoFirmaEval() });
52
+ switch (estado) {
53
+ case 'iniciado':
54
+ this._firmando.set(1);
55
+ this.overlayService.show({ mensaje: 'Firmando...', ...config });
56
+ break;
57
+ case 'ok':
58
+ this._firmando.set(0);
59
+ this.overlayService.hide({ mensaje: 'Firma Exitosa!', fondoStyle: 'rgba(56,100,40,0.7)', ...config });
60
+ break;
61
+ case 'error':
62
+ this._firmando.set(0);
63
+ this.overlayService.hide({ mensaje: 'Error: Hubo un error en el proceso', fondoStyle: 'rgba(231, 166, 166, 0.7)', ...config });
64
+ break;
65
+ }
66
+ }
67
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FirmaService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
68
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FirmaService, providedIn: 'root' });
69
+ }
70
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FirmaService, decorators: [{
71
+ type: Injectable,
72
+ args: [{ providedIn: 'root' }]
73
+ }], ctorParameters: () => [] });
74
+
75
+ class FirmaPeruService {
76
+ http = inject(JVS_FIRMA_HTTP);
77
+ validarDocumento(data) {
78
+ return this.http.validarDocumento(data);
79
+ }
80
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FirmaPeruService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
81
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FirmaPeruService, providedIn: 'root' });
82
+ }
83
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FirmaPeruService, decorators: [{
84
+ type: Injectable,
85
+ args: [{ providedIn: 'root' }]
86
+ }] });
87
+
88
+ class DialogFirmaElectronicaComponent {
89
+ datosDialogRecibidos;
90
+ dialogActualRef;
91
+ firmaQuery = inject(JVS_FIRMA_QUERY);
92
+ firmaService = inject(FirmaService);
93
+ fb = inject(FormBuilder);
94
+ _lstFirma = new BehaviorSubject([]);
95
+ fcCargos = new FormControl('', [Validators.required]);
96
+ frmFirma = this.fb.group({
97
+ iPersId: ['', [Validators.required]],
98
+ iTipoFirmaId: ['', [Validators.required]],
99
+ iMotFirmaId: ['', [Validators.required]],
100
+ iEstablecimientoId: ['', [Validators.required]],
101
+ iDepenId: ['', [Validators.required]],
102
+ iCargoId: ['', [Validators.required]],
103
+ iArchivoId: ['', [Validators.required]],
104
+ });
105
+ get dataExtraGuardarFirmante() {
106
+ return this.datosDialogRecibidos?.dataExtraGuardarFirmante ?? {};
107
+ }
108
+ constructor(datosDialogRecibidos, dialogActualRef) {
109
+ this.datosDialogRecibidos = datosDialogRecibidos;
110
+ this.dialogActualRef = dialogActualRef;
111
+ if (datosDialogRecibidos?.iCredEntId) {
112
+ let reqRes;
113
+ switch (datosDialogRecibidos.tipo) {
114
+ case 'tramite':
115
+ reqRes = 'tram.firmarComo';
116
+ break;
117
+ case 'tareos':
118
+ reqRes = 'bud.firmarComo';
119
+ break;
120
+ default:
121
+ reqRes = datosDialogRecibidos.tipo;
122
+ break;
123
+ }
124
+ this.firmaQuery.cargar(this, [reqRes], { iCredEntId: datosDialogRecibidos.iCredEntId }).then(dRet => {
125
+ if (dRet[reqRes]?.length > 0) {
126
+ this._lstFirma.next(dRet[reqRes]);
127
+ this.frmFirma.reset(this.datosDialogRecibidos);
128
+ }
129
+ else {
130
+ mensajeAlerta('error', 'Error', 'La credencial no tiene los datos requeridos para ejecutar esta acción.');
131
+ this.cerrarDialogActual();
132
+ this.firmaService.interfazYSuscripciones('error');
133
+ }
134
+ });
135
+ }
136
+ else {
137
+ this.cerrarDialogActual();
138
+ }
139
+ this.fcCargos.valueChanges.subscribe((val) => {
140
+ if (val)
141
+ this.frmFirma.patchValue(val);
142
+ });
143
+ }
144
+ cerrarDialogActual() {
145
+ this.dialogActualRef?.close();
146
+ }
147
+ aplicarFirmaElectronica() {
148
+ if (this.frmFirma.valid) {
149
+ this.firmaQuery.guardarDatos('mantenimiento#archivos_firmantes', { ...this.frmFirma.value, ...this.dataExtraGuardarFirmante }, 'grl', 'toastr').then(dRet => {
150
+ if (dRet) {
151
+ this.cerrarDialogActual();
152
+ this.firmaService.interfazYSuscripciones('ok');
153
+ }
154
+ }).catch(() => {
155
+ this.firmaService.interfazYSuscripciones('error');
156
+ });
157
+ }
158
+ }
159
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DialogFirmaElectronicaComponent, deps: [{ token: MAT_DIALOG_DATA, optional: true }, { token: i1.MatDialogRef, optional: true }], target: i0.ɵɵFactoryTarget.Component });
160
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DialogFirmaElectronicaComponent, isStandalone: true, selector: "jvs-firma-electronica", ngImport: i0, template: "<div jvsDialogFlotante sinTitulo btnCerrar [matDialogRefActual]=\"dialogActualRef\">\n\n <div class=\"p-1 py-2 min-w-[400px]\" cuerpo>\n <div class=\"w-full flex flex-col sm:flex-row items-center flex-wrap sm:gap-2\">\n <mat-form-field class=\"flex-1 w-full\">\n <mat-label>Seleccione Firma</mat-label>\n <mat-select [formControl]=\"fcCargos\" [required]=\"true\" panelClass=\"selectDetalles\">\n <mat-select-trigger>\n <ng-container *ngTemplateOutlet=\"vistaOpcion; context:{objMostrar: fcCargos.value}\"></ng-container>\n </mat-select-trigger>\n <mat-option *ngFor=\"let item of (_lstFirma.asObservable() | async)\" [value]=\"item\">\n <ng-container *ngTemplateOutlet=\"vistaOpcion; context:{objMostrar: item}\"></ng-container>\n </mat-option>\n <ng-template #vistaOpcion let-objSeleccionado=\"objMostrar\">\n <div class=\"flex flex-col sm:flex-row items-center flex-wrap text-2xs mt-2\">\n <div class=\"flex flex-col sm:flex-row items-center flex-wrap\">\n <div class=\"flex-grow w-full text-red-900 font-bold\">{{objSeleccionado?.cPersNombreLargo}}</div>\n </div>\n <div class=\"flex flex-col sm:flex-row flex-wrap sm:gap-2\">\n <div class=\"flex-1 w-full flex-col\">\n <div class=\"w-full text-indigo-900 font-bold\">Establecimiento: </div>\n <div class=\"italic w-full\">{{objSeleccionado?.cEstablecimientoNombreLargo}}</div>\n </div>\n <div class=\"flex-1 w-full flex-col\">\n <div class=\"w-full text-indigo-900 font-bold\">Cargo: </div>\n <div class=\"italic w-full\">{{objSeleccionado?.cCargoNombre}}</div>\n </div>\n </div>\n <div class=\"flex flex-col sm:flex-row items-center flex-wrap\">\n <div class=\"flex-1 w-full\">\n <span class=\"text-indigo-900 font-bold\">Dependencia: </span>\n <span class=\"italic\">{{objSeleccionado?.cDepenNombre}}</span>\n </div>\n </div>\n </div>\n </ng-template>\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n\n <ng-container pieDerecha class=\"pb-2\">\n <button matRipple class=\"boton-dialog-flotante boton-dialog-flotante-red\" type=\"button\" (click)=\"aplicarFirmaElectronica()\">\n <mat-icon class=\"icon-xs\" svgIcon=\"fa5sFileSignature\"></mat-icon>\n <span>Aplicar Firma</span>\n </button>\n </ng-container>\n\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "component", type: DialogFlotanteComponent, selector: "[jvsDialogFlotante]", inputs: ["cssClases", "sinTitulo", "sinBarraDeAccion", "btnCerrarBarra", "iconoTitulo", "matDialogRefActual", "btnGuardar", "btnCerrar"], outputs: ["btnGuardarClick", "btnCerrarClick"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatRippleModule }, { kind: "directive", type: i5.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i6.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i6.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
161
+ }
162
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DialogFirmaElectronicaComponent, decorators: [{
163
+ type: Component,
164
+ args: [{ selector: 'jvs-firma-electronica', standalone: true, imports: [
165
+ CommonModule, DialogFlotanteComponent, MatFormFieldModule, MatIconModule,
166
+ MatOptionModule, MatRippleModule, MatSelectModule, ReactiveFormsModule,
167
+ ], template: "<div jvsDialogFlotante sinTitulo btnCerrar [matDialogRefActual]=\"dialogActualRef\">\n\n <div class=\"p-1 py-2 min-w-[400px]\" cuerpo>\n <div class=\"w-full flex flex-col sm:flex-row items-center flex-wrap sm:gap-2\">\n <mat-form-field class=\"flex-1 w-full\">\n <mat-label>Seleccione Firma</mat-label>\n <mat-select [formControl]=\"fcCargos\" [required]=\"true\" panelClass=\"selectDetalles\">\n <mat-select-trigger>\n <ng-container *ngTemplateOutlet=\"vistaOpcion; context:{objMostrar: fcCargos.value}\"></ng-container>\n </mat-select-trigger>\n <mat-option *ngFor=\"let item of (_lstFirma.asObservable() | async)\" [value]=\"item\">\n <ng-container *ngTemplateOutlet=\"vistaOpcion; context:{objMostrar: item}\"></ng-container>\n </mat-option>\n <ng-template #vistaOpcion let-objSeleccionado=\"objMostrar\">\n <div class=\"flex flex-col sm:flex-row items-center flex-wrap text-2xs mt-2\">\n <div class=\"flex flex-col sm:flex-row items-center flex-wrap\">\n <div class=\"flex-grow w-full text-red-900 font-bold\">{{objSeleccionado?.cPersNombreLargo}}</div>\n </div>\n <div class=\"flex flex-col sm:flex-row flex-wrap sm:gap-2\">\n <div class=\"flex-1 w-full flex-col\">\n <div class=\"w-full text-indigo-900 font-bold\">Establecimiento: </div>\n <div class=\"italic w-full\">{{objSeleccionado?.cEstablecimientoNombreLargo}}</div>\n </div>\n <div class=\"flex-1 w-full flex-col\">\n <div class=\"w-full text-indigo-900 font-bold\">Cargo: </div>\n <div class=\"italic w-full\">{{objSeleccionado?.cCargoNombre}}</div>\n </div>\n </div>\n <div class=\"flex flex-col sm:flex-row items-center flex-wrap\">\n <div class=\"flex-1 w-full\">\n <span class=\"text-indigo-900 font-bold\">Dependencia: </span>\n <span class=\"italic\">{{objSeleccionado?.cDepenNombre}}</span>\n </div>\n </div>\n </div>\n </ng-template>\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n\n <ng-container pieDerecha class=\"pb-2\">\n <button matRipple class=\"boton-dialog-flotante boton-dialog-flotante-red\" type=\"button\" (click)=\"aplicarFirmaElectronica()\">\n <mat-icon class=\"icon-xs\" svgIcon=\"fa5sFileSignature\"></mat-icon>\n <span>Aplicar Firma</span>\n </button>\n </ng-container>\n\n</div>\n" }]
168
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
169
+ type: Optional
170
+ }, {
171
+ type: Inject,
172
+ args: [MAT_DIALOG_DATA]
173
+ }] }, { type: i1.MatDialogRef, decorators: [{
174
+ type: Optional
175
+ }] }] });
176
+
177
+ class DialogFirmaElectronicaService {
178
+ firmaService = inject(FirmaService);
179
+ firmaUsuario = inject(JVS_FIRMA_USUARIO);
180
+ firmaConfig = inject(JVS_FIRMA_CONFIG);
181
+ dialog = inject(MatDialog);
182
+ toastr = inject(ToastrService);
183
+ fb = inject(FormBuilder);
184
+ campoFirmaEval = '';
185
+ documentoFirma = null;
186
+ frmFirma = this.fb.group({
187
+ iPersId: ['', [Validators.required]],
188
+ iTipoFirmaId: [0, [Validators.required]],
189
+ iMotFirmaId: ['', [Validators.required]],
190
+ iEstablecimientoId: ['', [Validators.required]],
191
+ iDepenId: ['', [Validators.required]],
192
+ iCargoId: ['', [Validators.required]],
193
+ iArchivoId: ['', [Validators.required]],
194
+ });
195
+ firmarPorTipo(tipo, archivo, tiposModulos = {}, dataExtraGuardarFirmante = {}) {
196
+ this.firmaService.setCampoFirma(this.campoFirmaEval);
197
+ this._emitirDocumentoFirma();
198
+ const { digital = 'tramite', electronica = 'tramite' } = tiposModulos;
199
+ if (this.firmaUsuario.getMismoPassword() && tipo.iTipoFirmaId == 2) {
200
+ mensajeAlerta('info', 'Cambiar Contraseña', 'Para esta accion es necesario establecer una contraseña diferente a la inicial.').then(dRet => {
201
+ if (dRet.isConfirmed)
202
+ this.firmaUsuario.cambiarPassword();
203
+ });
204
+ }
205
+ if (tipo.iTipoFirmaId == 1) {
206
+ if (archivo.cArchivoData) {
207
+ this.toastr.error('El documento actual solo puede ser firmado electrónicamente', 'Error de Firma');
208
+ return;
209
+ }
210
+ const keyFirma = digital === 'tramite' ? 'tram' : digital;
211
+ const urlFirmaPeru = this.firmaConfig.urlFirmaPeru || (this.firmaConfig.backendUrl + '/firma-peru/firmar');
212
+ if (!urlFirmaPeru) {
213
+ this.toastr.error('Tiene que especificar configuración de Firma en variables de entorno. Contacte con soporte de TI', 'Configuración Faltante');
214
+ return;
215
+ }
216
+ const dataTokenFirma = {
217
+ ...archivo.keyFirma,
218
+ modulo: keyFirma,
219
+ motivoFirma: { iMotFirmaId: tipo.iMotFirmaId, cMotFirmaNombre: tipo.cMotFirmaNombre },
220
+ };
221
+ let paramToken = encodeBase64Object(dataTokenFirma);
222
+ if (digital !== 'tramite') {
223
+ paramToken = `${keyFirma}|${archivo.keyFirmaTramite}|${tipo.iMotFirmaId}`;
224
+ }
225
+ const param = encodeBase64Object({ param_url: urlFirmaPeru, param_token: paramToken, document_extension: 'pdf' });
226
+ // @ts-ignore
227
+ startSignature('48596', param);
228
+ }
229
+ else if (tipo.iTipoFirmaId == 2) {
230
+ this.firmaService.interfazYSuscripciones('iniciado');
231
+ this.frmFirma.reset({ iTipoFirmaId: 2, iMotFirmaId: tipo?.iMotFirmaId, iArchivoId: archivo.id });
232
+ this.firmaUsuario.habilitarAccionFirma().then(val => {
233
+ if (val.isConfirmed) {
234
+ const dialogOpc = {
235
+ panelClass: 'dialogMantenimientoNuevo',
236
+ disableClose: true,
237
+ data: {
238
+ tipo: electronica,
239
+ dataExtraGuardarFirmante,
240
+ iCredEntId: val?.value,
241
+ iTipoFirmaId: '2',
242
+ iMotFirmaId: tipo?.iMotFirmaId,
243
+ iArchivoId: archivo.id,
244
+ },
245
+ };
246
+ const dialogRef = this.dialog.open(DialogFirmaElectronicaComponent, dialogOpc);
247
+ dialogRef.afterClosed().subscribe(v => {
248
+ if (v === 'Cerrado GDLG') {
249
+ this.firmaService.interfazYSuscripciones('error', { mensaje: 'Accion Cancelada', fondoStyle: 'rgba(166,208,231,0.7)' });
250
+ }
251
+ });
252
+ }
253
+ }).catch(err => {
254
+ this.firmaService.interfazYSuscripciones('error', { mensaje: err });
255
+ });
256
+ }
257
+ }
258
+ _emitirDocumentoFirma() {
259
+ if (this.documentoFirma) {
260
+ this.firmaService.setDocumentoFirma({
261
+ ...this.documentoFirma,
262
+ identificador: this.campoFirmaEval,
263
+ });
264
+ }
265
+ }
266
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DialogFirmaElectronicaService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
267
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DialogFirmaElectronicaService, providedIn: 'root' });
268
+ }
269
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DialogFirmaElectronicaService, decorators: [{
270
+ type: Injectable,
271
+ args: [{ providedIn: 'root' }]
272
+ }] });
273
+
274
+ class ArchivosFirmantesComponent {
275
+ datosDialogRecibidos;
276
+ dialogActual;
277
+ firmaQuery = inject(JVS_FIRMA_QUERY);
278
+ dialog = inject(MatDialog);
279
+ fb = inject(FormBuilder);
280
+ dataServidorSuscripcion = {};
281
+ seleccionados = { archivos_firmantes: null };
282
+ matDialogRefActual;
283
+ btnGuardarClick = new EventEmitter();
284
+ btnCerrarClick = new EventEmitter();
285
+ columnasPrincipal = [
286
+ { label: '#', property: 'numeracion_automatica', type: 'numeracion_automatica' },
287
+ { label: 'Documento', property: 'cPersDocumento', type: 'text', cssClasses: ['font-bold'] },
288
+ { label: 'Nombre', property: 'cPersLargoNombre', type: 'text', cssClasses: ['font-bold'] },
289
+ { label: 'Tipo Firma', property: 'cTipoFirmaNombre', type: 'text' },
290
+ { label: 'Motivo Firma', property: 'cMotFirmaNombre', type: 'text' },
291
+ { label: 'Dependencia', property: 'cDepenNombre', type: 'text' },
292
+ { label: 'Cargo', property: 'cCargoNombre', type: 'text' },
293
+ { label: 'Fecha', property: 'dtArchivoFirmanteCreado', type: 'estiloEstablecido', propertyTemplate: 'campoFechaHora' },
294
+ ];
295
+ frmFiltro = this.fb.group({ iArchivoId: [''], cArchivoKey: [''] });
296
+ frmRegistro = this.fb.group({
297
+ iTareoId: ['', [Validators.required]],
298
+ cArchivoRuta: ['', [Validators.required]],
299
+ cArchivoNombre: ['', [Validators.required]],
300
+ });
301
+ get esDialog() { return this.datosDialogRecibidos?.esDialog !== false; }
302
+ get permitirEliminar() { return this.datosDialogRecibidos?.permitirEliminar; }
303
+ constructor(datosDialogRecibidos, dialogActual) {
304
+ this.datosDialogRecibidos = datosDialogRecibidos;
305
+ this.dialogActual = dialogActual;
306
+ }
307
+ ngOnInit() {
308
+ if (this.datosDialogRecibidos) {
309
+ this.frmFiltro.patchValue(this.datosDialogRecibidos);
310
+ this.cargarLista();
311
+ }
312
+ }
313
+ cargarLista() {
314
+ this.firmaQuery.cargar(this, ['grl.archivos_firmantes'], this.frmFiltro.value).then();
315
+ }
316
+ opcMenu(v) {
317
+ switch (v.seccion) {
318
+ case 'archivos_firmantes':
319
+ switch (v.tipo) {
320
+ case 'ver':
321
+ this.seleccionados.archivos_firmantes = this.seleccionados.archivos_firmantes === v.item ? null : v.item;
322
+ break;
323
+ case 'eliminar':
324
+ this.firmaQuery.eliminarDatosAsync('mantenimiento#archivos_firmantes', {
325
+ id: this.seleccionados.archivos_firmantes.iArchivoFirmanteId,
326
+ }, null, 'grl').then(dElm => {
327
+ if (dElm) {
328
+ this.seleccionados.archivos_firmantes = null;
329
+ this.cargarLista();
330
+ }
331
+ });
332
+ break;
333
+ }
334
+ break;
335
+ }
336
+ }
337
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ArchivosFirmantesComponent, deps: [{ token: MAT_DIALOG_DATA, optional: true }, { token: i1.MatDialogRef, optional: true }], target: i0.ɵɵFactoryTarget.Component });
338
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ArchivosFirmantesComponent, isStandalone: true, selector: "jvs-archivos-firmantes", inputs: { matDialogRefActual: "matDialogRefActual" }, outputs: { btnGuardarClick: "btnGuardarClick", btnCerrarClick: "btnCerrarClick" }, ngImport: i0, template: "<ng-container *ngIf=\"!esDialog\" [ngTemplateOutlet]=\"cuerpoPrincipal\"></ng-container>\n\n<div *ngIf=\"esDialog\">\n <form jvsDialogFlotante btnCerrar=\"CANCELAR\" class=\"frm-registro\"\n (ngSubmit)=\"opcMenu({ seccion: 'archivos', tipo: 'guardar' })\" [formGroup]=\"frmRegistro\">\n <ng-container titulo>Firmas Archivo</ng-container>\n <div cuerpo>\n <div class=\"frm-registro-fila\">\n <ng-container *ngTemplateOutlet=\"cuerpoPrincipal; context:{}\"></ng-container>\n </div>\n </div>\n </form>\n</div>\n\n<ng-template #cuerpoPrincipal>\n <jvs-tabla-mantenimiento\n class=\"w-full\"\n botonesCRUD=\"D\"\n [readOnly]=\"!permitirEliminar\"\n [objThis]=\"this\"\n nombreColeccion=\"archivos_firmantes\"\n [dataSuscription]=\"dataServidorSuscripcion['grl.archivos_firmantes']\"\n [idTabla]=\"['iArchivoFirmanteId']\"\n [columnasTabla]=\"columnasPrincipal\"\n (opcionSelecionada)=\"opcMenu($event)\"\n (accionRecargar)=\"cargarLista()\"\n [paginador]=\"false\"\n [exportarExcel]=\"false\"\n ></jvs-tabla-mantenimiento>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: DialogFlotanteComponent, selector: "[jvsDialogFlotante]", inputs: ["cssClases", "sinTitulo", "sinBarraDeAccion", "btnCerrarBarra", "iconoTitulo", "matDialogRefActual", "btnGuardar", "btnCerrar"], outputs: ["btnGuardarClick", "btnCerrarClick"] }, { kind: "component", type: TablaMantenimientoComponent, selector: "jvs-tabla-mantenimiento", inputs: ["dataSuscription", "objThis", "nombreColeccion", "ctrlBusquedaValue", "ctrlBusquedaPlaceholder", "filtroCampos", "paginador", "esTabla", "readOnly", "filaExtraHeader", "filaFooter", "botonesCRUD", "objBotonesCRUD", "classSeleccionado", "classAnulado", "campoAnulado", "campoAnuladoMensaje", "selectionModel", "filaExtraTemplate", "exportarExcel", "busquedaCompacta", "alturaFull", "pageSize", "pageSizeOptions", "derechosActuales", "mostrarBotonOrden", "ctrlBusqueda", "leyenda", "idTabla", "columnasTabla", "botonesMenu", "condicionesClaseFila", "rowTooltip", "soloIconos"], outputs: ["dblclickItem", "opcionSelecionada", "opcBusqueda", "accionRecargar", "selectionModelChange", "dataSourceChange", "resultados"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i7.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i7.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i7.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
339
+ }
340
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ArchivosFirmantesComponent, decorators: [{
341
+ type: Component,
342
+ args: [{ selector: 'jvs-archivos-firmantes', standalone: true, imports: [CommonModule, DialogFlotanteComponent, TablaMantenimientoComponent, ReactiveFormsModule], template: "<ng-container *ngIf=\"!esDialog\" [ngTemplateOutlet]=\"cuerpoPrincipal\"></ng-container>\n\n<div *ngIf=\"esDialog\">\n <form jvsDialogFlotante btnCerrar=\"CANCELAR\" class=\"frm-registro\"\n (ngSubmit)=\"opcMenu({ seccion: 'archivos', tipo: 'guardar' })\" [formGroup]=\"frmRegistro\">\n <ng-container titulo>Firmas Archivo</ng-container>\n <div cuerpo>\n <div class=\"frm-registro-fila\">\n <ng-container *ngTemplateOutlet=\"cuerpoPrincipal; context:{}\"></ng-container>\n </div>\n </div>\n </form>\n</div>\n\n<ng-template #cuerpoPrincipal>\n <jvs-tabla-mantenimiento\n class=\"w-full\"\n botonesCRUD=\"D\"\n [readOnly]=\"!permitirEliminar\"\n [objThis]=\"this\"\n nombreColeccion=\"archivos_firmantes\"\n [dataSuscription]=\"dataServidorSuscripcion['grl.archivos_firmantes']\"\n [idTabla]=\"['iArchivoFirmanteId']\"\n [columnasTabla]=\"columnasPrincipal\"\n (opcionSelecionada)=\"opcMenu($event)\"\n (accionRecargar)=\"cargarLista()\"\n [paginador]=\"false\"\n [exportarExcel]=\"false\"\n ></jvs-tabla-mantenimiento>\n</ng-template>\n" }]
343
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
344
+ type: Optional
345
+ }, {
346
+ type: Inject,
347
+ args: [MAT_DIALOG_DATA]
348
+ }] }, { type: i1.MatDialogRef, decorators: [{
349
+ type: Optional
350
+ }] }], propDecorators: { matDialogRefActual: [{
351
+ type: Input
352
+ }], btnGuardarClick: [{
353
+ type: Output
354
+ }], btnCerrarClick: [{
355
+ type: Output
356
+ }] } });
357
+
358
+ /**
359
+ * Generated bundle index. Do not edit.
360
+ */
361
+
362
+ export { ArchivosFirmantesComponent, DialogFirmaElectronicaComponent, DialogFirmaElectronicaService, FirmaPeruService, FirmaService, JVS_FIRMA_CONFIG, JVS_FIRMA_HTTP, JVS_FIRMA_PROGRESS, JVS_FIRMA_QUERY, JVS_FIRMA_USUARIO };
363
+ //# sourceMappingURL=jvsoft-firma.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jvsoft-firma.mjs","sources":["../../../projects/firma/models/tokens.ts","../../../projects/firma/firma.service.ts","../../../projects/firma/firma-peru/firma-peru.service.ts","../../../projects/firma/dialog-firma-electronica/dialog-firma-electronica.component.ts","../../../projects/firma/dialog-firma-electronica/dialog-firma-electronica.component.html","../../../projects/firma/dialog-firma-electronica/dialog-firma-electronica.service.ts","../../../projects/firma/archivos-firmantes/archivos-firmantes.component.ts","../../../projects/firma/archivos-firmantes/archivos-firmantes.component.html","../../../projects/firma/jvsoft-firma.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport interface FirmaProgressConfig {\n mensaje?: string;\n fondoStyle?: string;\n [key: string]: any;\n}\n\nexport interface FirmaProgressAdapter {\n show(config?: FirmaProgressConfig): void;\n hide(config?: FirmaProgressConfig): void;\n}\n\nexport interface FirmaHttpAdapter {\n validarDocumento(data: { cArchivoKey: string }): Promise<any>;\n}\n\nexport interface FirmaQueryAdapter {\n cargar(ctx: any, tipos: string[], params?: any): Promise<any>;\n guardarDatos(tipo: string, data: any, modulo?: string, feedback?: string): Promise<any>;\n eliminarDatosAsync(tipo: string, data: any, msg?: any, modulo?: string): Promise<any>;\n}\n\nexport interface FirmaUsuarioAdapter {\n habilitarAccionFirma(): Promise<{ isConfirmed: boolean; value?: string }>;\n getMismoPassword(): boolean;\n cambiarPassword(): void;\n}\n\nexport interface FirmaConfigAdapter {\n urlFirmaPeru: string;\n backendUrl: string;\n}\n\nexport const JVS_FIRMA_PROGRESS = new InjectionToken<FirmaProgressAdapter>('JVS_FIRMA_PROGRESS');\nexport const JVS_FIRMA_HTTP = new InjectionToken<FirmaHttpAdapter>('JVS_FIRMA_HTTP');\nexport const JVS_FIRMA_QUERY = new InjectionToken<FirmaQueryAdapter>('JVS_FIRMA_QUERY');\nexport const JVS_FIRMA_USUARIO = new InjectionToken<FirmaUsuarioAdapter>('JVS_FIRMA_USUARIO');\nexport const JVS_FIRMA_CONFIG = new InjectionToken<FirmaConfigAdapter>('JVS_FIRMA_CONFIG');\n","import {inject, Injectable, signal} from '@angular/core';\nimport {Subject} from 'rxjs';\nimport {DocumentoFirma, EstadosFirma, FirmaEvento} from './models/types';\nimport {FirmaProgressConfig, JVS_FIRMA_PROGRESS} from './models/tokens';\n\n@Injectable({ providedIn: 'root' })\nexport class FirmaService {\n private overlayService = inject(JVS_FIRMA_PROGRESS);\n\n private _campoFirmaEval = signal<string | null>(null);\n readonly campoFirmaEval = this._campoFirmaEval.asReadonly();\n\n private _documentoFirma = signal<DocumentoFirma | null>(null);\n readonly documentoFirma = this._documentoFirma.asReadonly();\n\n private _estadoFirma = signal<EstadosFirma | null>(null);\n readonly estadoFirma = this._estadoFirma.asReadonly();\n\n private _firmando = signal<0 | 1 | null>(null);\n readonly firmando = this._firmando.asReadonly();\n\n private readonly _firmaEvento = new Subject<FirmaEvento>();\n readonly firmaEvento$ = this._firmaEvento.asObservable();\n\n constructor() {\n window.addEventListener('signatureInit', () => this.interfazYSuscripciones('iniciado'));\n window.addEventListener('signatureOk', () => this.interfazYSuscripciones('ok'));\n window.addEventListener('signatureCancel', () => this.interfazYSuscripciones('error'));\n }\n\n setCampoFirma(val: string | null) { this._campoFirmaEval.set(val); }\n setDocumentoFirma(doc: DocumentoFirma) { this._documentoFirma.set(doc); }\n resetEstado() { this._estadoFirma.set(null); }\n\n interfazYSuscripciones(estado: EstadosFirma, config: FirmaProgressConfig = {}) {\n this._estadoFirma.set(estado);\n this._firmaEvento.next({ estado, documento: this._documentoFirma(), campo: this._campoFirmaEval() });\n switch (estado) {\n case 'iniciado':\n this._firmando.set(1);\n this.overlayService.show({ mensaje: 'Firmando...', ...config });\n break;\n case 'ok':\n this._firmando.set(0);\n this.overlayService.hide({ mensaje: 'Firma Exitosa!', fondoStyle: 'rgba(56,100,40,0.7)', ...config });\n break;\n case 'error':\n this._firmando.set(0);\n this.overlayService.hide({ mensaje: 'Error: Hubo un error en el proceso', fondoStyle: 'rgba(231, 166, 166, 0.7)', ...config });\n break;\n }\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { JVS_FIRMA_HTTP } from '../models/tokens';\n\n@Injectable({ providedIn: 'root' })\nexport class FirmaPeruService {\n private http = inject(JVS_FIRMA_HTTP);\n\n validarDocumento(data: { cArchivoKey: string }): Promise<any> {\n return this.http.validarDocumento(data);\n }\n}\n","import { Component, inject, Inject, Optional } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatOptionModule, MatRippleModule } from '@angular/material/core';\nimport { MatSelectModule } from '@angular/material/select';\nimport { FormBuilder, FormControl, ReactiveFormsModule, Validators } from '@angular/forms';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { BehaviorSubject } from 'rxjs';\nimport { DialogFlotanteComponent } from '@jvsoft/components/dialog-flotante';\nimport { mensajeAlerta } from '@jvsoft/utils';\nimport { FirmaService } from '../firma.service';\nimport { JVS_FIRMA_QUERY } from '../models/tokens';\nimport { ParametrosFirmaElectronicaDialog } from '../models/types';\n\n@Component({\n selector: 'jvs-firma-electronica',\n standalone: true,\n imports: [\n CommonModule, DialogFlotanteComponent, MatFormFieldModule, MatIconModule,\n MatOptionModule, MatRippleModule, MatSelectModule, ReactiveFormsModule,\n ],\n templateUrl: './dialog-firma-electronica.component.html',\n})\nexport class DialogFirmaElectronicaComponent {\n private readonly firmaQuery = inject(JVS_FIRMA_QUERY);\n private readonly firmaService = inject(FirmaService);\n private readonly fb = inject(FormBuilder);\n\n _lstFirma = new BehaviorSubject<any[]>([]);\n\n fcCargos = new FormControl('', [Validators.required]);\n frmFirma = this.fb.group({\n iPersId: ['', [Validators.required]],\n iTipoFirmaId: ['', [Validators.required]],\n iMotFirmaId: ['', [Validators.required]],\n iEstablecimientoId: ['', [Validators.required]],\n iDepenId: ['', [Validators.required]],\n iCargoId: ['', [Validators.required]],\n iArchivoId: ['', [Validators.required]],\n });\n\n get dataExtraGuardarFirmante() {\n return this.datosDialogRecibidos?.dataExtraGuardarFirmante ?? {};\n }\n\n constructor(\n @Optional() @Inject(MAT_DIALOG_DATA) public datosDialogRecibidos: ParametrosFirmaElectronicaDialog,\n @Optional() public dialogActualRef: MatDialogRef<DialogFirmaElectronicaComponent>,\n ) {\n if (datosDialogRecibidos?.iCredEntId) {\n let reqRes: string;\n switch (datosDialogRecibidos.tipo) {\n case 'tramite': reqRes = 'tram.firmarComo'; break;\n case 'tareos': reqRes = 'bud.firmarComo'; break;\n default: reqRes = datosDialogRecibidos.tipo; break;\n }\n this.firmaQuery.cargar(this, [reqRes], { iCredEntId: datosDialogRecibidos.iCredEntId }).then(dRet => {\n if (dRet[reqRes]?.length > 0) {\n this._lstFirma.next(dRet[reqRes]);\n this.frmFirma.reset(this.datosDialogRecibidos);\n } else {\n mensajeAlerta('error', 'Error', 'La credencial no tiene los datos requeridos para ejecutar esta acción.');\n this.cerrarDialogActual();\n this.firmaService.interfazYSuscripciones('error');\n }\n });\n } else {\n this.cerrarDialogActual();\n }\n\n this.fcCargos.valueChanges.subscribe((val: any) => {\n if (val) this.frmFirma.patchValue(val);\n });\n }\n\n cerrarDialogActual() {\n this.dialogActualRef?.close();\n }\n\n aplicarFirmaElectronica() {\n if (this.frmFirma.valid) {\n this.firmaQuery.guardarDatos(\n 'mantenimiento#archivos_firmantes',\n { ...this.frmFirma.value, ...this.dataExtraGuardarFirmante },\n 'grl', 'toastr'\n ).then(dRet => {\n if (dRet) {\n this.cerrarDialogActual();\n this.firmaService.interfazYSuscripciones('ok');\n }\n }).catch(() => {\n this.firmaService.interfazYSuscripciones('error');\n });\n }\n }\n}\n","<div jvsDialogFlotante sinTitulo btnCerrar [matDialogRefActual]=\"dialogActualRef\">\n\n <div class=\"p-1 py-2 min-w-[400px]\" cuerpo>\n <div class=\"w-full flex flex-col sm:flex-row items-center flex-wrap sm:gap-2\">\n <mat-form-field class=\"flex-1 w-full\">\n <mat-label>Seleccione Firma</mat-label>\n <mat-select [formControl]=\"fcCargos\" [required]=\"true\" panelClass=\"selectDetalles\">\n <mat-select-trigger>\n <ng-container *ngTemplateOutlet=\"vistaOpcion; context:{objMostrar: fcCargos.value}\"></ng-container>\n </mat-select-trigger>\n <mat-option *ngFor=\"let item of (_lstFirma.asObservable() | async)\" [value]=\"item\">\n <ng-container *ngTemplateOutlet=\"vistaOpcion; context:{objMostrar: item}\"></ng-container>\n </mat-option>\n <ng-template #vistaOpcion let-objSeleccionado=\"objMostrar\">\n <div class=\"flex flex-col sm:flex-row items-center flex-wrap text-2xs mt-2\">\n <div class=\"flex flex-col sm:flex-row items-center flex-wrap\">\n <div class=\"flex-grow w-full text-red-900 font-bold\">{{objSeleccionado?.cPersNombreLargo}}</div>\n </div>\n <div class=\"flex flex-col sm:flex-row flex-wrap sm:gap-2\">\n <div class=\"flex-1 w-full flex-col\">\n <div class=\"w-full text-indigo-900 font-bold\">Establecimiento: </div>\n <div class=\"italic w-full\">{{objSeleccionado?.cEstablecimientoNombreLargo}}</div>\n </div>\n <div class=\"flex-1 w-full flex-col\">\n <div class=\"w-full text-indigo-900 font-bold\">Cargo: </div>\n <div class=\"italic w-full\">{{objSeleccionado?.cCargoNombre}}</div>\n </div>\n </div>\n <div class=\"flex flex-col sm:flex-row items-center flex-wrap\">\n <div class=\"flex-1 w-full\">\n <span class=\"text-indigo-900 font-bold\">Dependencia: </span>\n <span class=\"italic\">{{objSeleccionado?.cDepenNombre}}</span>\n </div>\n </div>\n </div>\n </ng-template>\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n\n <ng-container pieDerecha class=\"pb-2\">\n <button matRipple class=\"boton-dialog-flotante boton-dialog-flotante-red\" type=\"button\" (click)=\"aplicarFirmaElectronica()\">\n <mat-icon class=\"icon-xs\" svgIcon=\"fa5sFileSignature\"></mat-icon>\n <span>Aplicar Firma</span>\n </button>\n </ng-container>\n\n</div>\n","import { inject, Injectable } from '@angular/core';\nimport { FormBuilder, Validators } from '@angular/forms';\nimport { MatDialog, MatDialogConfig } from '@angular/material/dialog';\nimport { ToastrService } from 'ngx-toastr';\nimport { encodeBase64Object, mensajeAlerta } from '@jvsoft/utils';\nimport { FirmaService } from '../firma.service';\nimport { JVS_FIRMA_CONFIG, JVS_FIRMA_USUARIO } from '../models/tokens';\nimport { DocumentoFirma, ModuloFirma, ParametrosFirmaElectronicaDialog } from '../models/types';\nimport { DialogFirmaElectronicaComponent } from './dialog-firma-electronica.component';\n\n@Injectable({ providedIn: 'root' })\nexport class DialogFirmaElectronicaService {\n private readonly firmaService = inject(FirmaService);\n private readonly firmaUsuario = inject(JVS_FIRMA_USUARIO);\n private readonly firmaConfig = inject(JVS_FIRMA_CONFIG);\n private readonly dialog = inject(MatDialog);\n private readonly toastr = inject(ToastrService);\n private readonly fb = inject(FormBuilder);\n\n campoFirmaEval = '';\n documentoFirma: DocumentoFirma | null = null;\n\n frmFirma = this.fb.group({\n iPersId: ['', [Validators.required]],\n iTipoFirmaId: [0, [Validators.required]],\n iMotFirmaId: ['', [Validators.required]],\n iEstablecimientoId: ['', [Validators.required]],\n iDepenId: ['', [Validators.required]],\n iCargoId: ['', [Validators.required]],\n iArchivoId: ['', [Validators.required]],\n });\n\n firmarPorTipo(tipo: any, archivo: any, tiposModulos: { digital?: ModuloFirma; electronica?: ModuloFirma } = {}, dataExtraGuardarFirmante: any = {}) {\n this.firmaService.setCampoFirma(this.campoFirmaEval);\n this._emitirDocumentoFirma();\n\n const { digital = 'tramite', electronica = 'tramite' } = tiposModulos;\n\n if (this.firmaUsuario.getMismoPassword() && tipo.iTipoFirmaId == 2) {\n mensajeAlerta('info', 'Cambiar Contraseña', 'Para esta accion es necesario establecer una contraseña diferente a la inicial.').then(dRet => {\n if (dRet.isConfirmed) this.firmaUsuario.cambiarPassword();\n });\n }\n\n if (tipo.iTipoFirmaId == 1) {\n if (archivo.cArchivoData) {\n this.toastr.error('El documento actual solo puede ser firmado electrónicamente', 'Error de Firma');\n return;\n }\n const keyFirma = digital === 'tramite' ? 'tram' : digital;\n const urlFirmaPeru = this.firmaConfig.urlFirmaPeru || (this.firmaConfig.backendUrl + '/firma-peru/firmar');\n\n if (!urlFirmaPeru) {\n this.toastr.error('Tiene que especificar configuración de Firma en variables de entorno. Contacte con soporte de TI', 'Configuración Faltante');\n return;\n }\n\n const dataTokenFirma = {\n ...archivo.keyFirma,\n modulo: keyFirma,\n motivoFirma: { iMotFirmaId: tipo.iMotFirmaId, cMotFirmaNombre: tipo.cMotFirmaNombre },\n };\n\n let paramToken = encodeBase64Object(dataTokenFirma);\n if (digital !== 'tramite') {\n paramToken = `${keyFirma}|${archivo.keyFirmaTramite}|${tipo.iMotFirmaId}`;\n }\n\n const param = encodeBase64Object({ param_url: urlFirmaPeru, param_token: paramToken, document_extension: 'pdf' });\n // @ts-ignore\n startSignature('48596', param);\n }\n else if (tipo.iTipoFirmaId == 2) {\n this.firmaService.interfazYSuscripciones('iniciado');\n this.frmFirma.reset({ iTipoFirmaId: 2, iMotFirmaId: tipo?.iMotFirmaId, iArchivoId: archivo.id });\n\n this.firmaUsuario.habilitarAccionFirma().then(val => {\n if (val.isConfirmed) {\n const dialogOpc: MatDialogConfig = {\n panelClass: 'dialogMantenimientoNuevo',\n disableClose: true,\n data: {\n tipo: electronica,\n dataExtraGuardarFirmante,\n iCredEntId: val?.value,\n iTipoFirmaId: '2',\n iMotFirmaId: tipo?.iMotFirmaId,\n iArchivoId: archivo.id,\n } as ParametrosFirmaElectronicaDialog,\n };\n const dialogRef = this.dialog.open(DialogFirmaElectronicaComponent, dialogOpc);\n dialogRef.afterClosed().subscribe(v => {\n if (v === 'Cerrado GDLG') {\n this.firmaService.interfazYSuscripciones('error', { mensaje: 'Accion Cancelada', fondoStyle: 'rgba(166,208,231,0.7)' });\n }\n });\n }\n }).catch(err => {\n this.firmaService.interfazYSuscripciones('error', { mensaje: err });\n });\n }\n }\n\n private _emitirDocumentoFirma() {\n if (this.documentoFirma) {\n this.firmaService.setDocumentoFirma({\n ...this.documentoFirma,\n identificador: this.campoFirmaEval,\n });\n }\n }\n}\n","import { Component, EventEmitter, inject, Inject, Input, OnInit, Optional, Output } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ColumnaTabla, DataServidor, OpcionSeleccionada, TablaMantenimientoComponent } from '@jvsoft/components/tabla-mantenimiento';\nimport { MAT_DIALOG_DATA, MatDialog, MatDialogConfig, MatDialogRef } from '@angular/material/dialog';\nimport { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';\nimport { DialogFlotanteComponent } from '@jvsoft/components/dialog-flotante';\nimport { JVS_FIRMA_QUERY } from '../models/tokens';\n\n@Component({\n selector: 'jvs-archivos-firmantes',\n standalone: true,\n imports: [CommonModule, DialogFlotanteComponent, TablaMantenimientoComponent, ReactiveFormsModule],\n templateUrl: './archivos-firmantes.component.html',\n})\nexport class ArchivosFirmantesComponent implements OnInit {\n private readonly firmaQuery = inject(JVS_FIRMA_QUERY);\n private readonly dialog = inject(MatDialog);\n private readonly fb = inject(FormBuilder);\n\n dataServidorSuscripcion: DataServidor = {};\n seleccionados: any = { archivos_firmantes: null };\n\n @Input() matDialogRefActual!: MatDialogRef<any>;\n @Output() btnGuardarClick = new EventEmitter<any>();\n @Output() btnCerrarClick = new EventEmitter<any>();\n\n columnasPrincipal: ColumnaTabla<any>[] = [\n { label: '#', property: 'numeracion_automatica', type: 'numeracion_automatica' },\n { label: 'Documento', property: 'cPersDocumento', type: 'text', cssClasses: ['font-bold'] },\n { label: 'Nombre', property: 'cPersLargoNombre', type: 'text', cssClasses: ['font-bold'] },\n { label: 'Tipo Firma', property: 'cTipoFirmaNombre', type: 'text' },\n { label: 'Motivo Firma', property: 'cMotFirmaNombre', type: 'text' },\n { label: 'Dependencia', property: 'cDepenNombre', type: 'text' },\n { label: 'Cargo', property: 'cCargoNombre', type: 'text' },\n { label: 'Fecha', property: 'dtArchivoFirmanteCreado', type: 'estiloEstablecido', propertyTemplate: 'campoFechaHora' },\n ];\n\n frmFiltro: FormGroup = this.fb.group({ iArchivoId: [''], cArchivoKey: [''] });\n frmRegistro: FormGroup = this.fb.group({\n iTareoId: ['', [Validators.required]],\n cArchivoRuta: ['', [Validators.required]],\n cArchivoNombre: ['', [Validators.required]],\n });\n\n get esDialog() { return this.datosDialogRecibidos?.esDialog !== false; }\n get permitirEliminar() { return this.datosDialogRecibidos?.permitirEliminar; }\n\n constructor(\n @Optional() @Inject(MAT_DIALOG_DATA) public datosDialogRecibidos: {\n esDialog: boolean;\n permitirEliminar: boolean;\n iArchivoId: string;\n cArchivoKey: string;\n },\n @Optional() private dialogActual: MatDialogRef<ArchivosFirmantesComponent>,\n ) {}\n\n ngOnInit(): void {\n if (this.datosDialogRecibidos) {\n this.frmFiltro.patchValue(this.datosDialogRecibidos);\n this.cargarLista();\n }\n }\n\n cargarLista() {\n this.firmaQuery.cargar(this, ['grl.archivos_firmantes'], this.frmFiltro.value).then();\n }\n\n opcMenu(v: OpcionSeleccionada) {\n switch (v.seccion) {\n case 'archivos_firmantes':\n switch (v.tipo) {\n case 'ver':\n this.seleccionados.archivos_firmantes = this.seleccionados.archivos_firmantes === v.item ? null : v.item;\n break;\n case 'eliminar':\n this.firmaQuery.eliminarDatosAsync('mantenimiento#archivos_firmantes', {\n id: this.seleccionados.archivos_firmantes.iArchivoFirmanteId,\n }, null, 'grl').then(dElm => {\n if (dElm) {\n this.seleccionados.archivos_firmantes = null;\n this.cargarLista();\n }\n });\n break;\n }\n break;\n }\n }\n}\n","<ng-container *ngIf=\"!esDialog\" [ngTemplateOutlet]=\"cuerpoPrincipal\"></ng-container>\n\n<div *ngIf=\"esDialog\">\n <form jvsDialogFlotante btnCerrar=\"CANCELAR\" class=\"frm-registro\"\n (ngSubmit)=\"opcMenu({ seccion: 'archivos', tipo: 'guardar' })\" [formGroup]=\"frmRegistro\">\n <ng-container titulo>Firmas Archivo</ng-container>\n <div cuerpo>\n <div class=\"frm-registro-fila\">\n <ng-container *ngTemplateOutlet=\"cuerpoPrincipal; context:{}\"></ng-container>\n </div>\n </div>\n </form>\n</div>\n\n<ng-template #cuerpoPrincipal>\n <jvs-tabla-mantenimiento\n class=\"w-full\"\n botonesCRUD=\"D\"\n [readOnly]=\"!permitirEliminar\"\n [objThis]=\"this\"\n nombreColeccion=\"archivos_firmantes\"\n [dataSuscription]=\"dataServidorSuscripcion['grl.archivos_firmantes']\"\n [idTabla]=\"['iArchivoFirmanteId']\"\n [columnasTabla]=\"columnasPrincipal\"\n (opcionSelecionada)=\"opcMenu($event)\"\n (accionRecargar)=\"cargarLista()\"\n [paginador]=\"false\"\n [exportarExcel]=\"false\"\n ></jvs-tabla-mantenimiento>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;MAkCa,kBAAkB,GAAG,IAAI,cAAc,CAAuB,oBAAoB;MAClF,cAAc,GAAG,IAAI,cAAc,CAAmB,gBAAgB;MACtE,eAAe,GAAG,IAAI,cAAc,CAAoB,iBAAiB;MACzE,iBAAiB,GAAG,IAAI,cAAc,CAAsB,mBAAmB;MAC/E,gBAAgB,GAAG,IAAI,cAAc,CAAqB,kBAAkB;;MChC5E,YAAY,CAAA;AACb,IAAA,cAAc,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAE3C,IAAA,eAAe,GAAG,MAAM,CAAgB,IAAI,CAAC;AAC5C,IAAA,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE;AAEnD,IAAA,eAAe,GAAG,MAAM,CAAwB,IAAI,CAAC;AACpD,IAAA,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE;AAEnD,IAAA,YAAY,GAAG,MAAM,CAAsB,IAAI,CAAC;AAC/C,IAAA,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE;AAE7C,IAAA,SAAS,GAAG,MAAM,CAAe,IAAI,CAAC;AACrC,IAAA,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE;AAE9B,IAAA,YAAY,GAAG,IAAI,OAAO,EAAe;AACjD,IAAA,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE;AAExD,I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A,SAAA,EAAA,SAAA,EAAA,eAAA,EAAA,aAAA,EAAA,sBAAA,EAAA,YAAA,EAAA,YAAA,CAAA,EAAA,OAAA,EAAA,CAAA,cAAA,EAAA,mBAAA,EAAA,aAAA,EAAA,gBAAA,EAAA,sBAAA,EAAA,kBAAA,EAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,mBAAmB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,EAAA,CAAA,aAAA,EAAA,QAAA,EAAA,8CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,sGAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,EAAA,CAAA,kBAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,WAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAGxF,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBANtC,SAAS;+BACI,wBAAwB,EAAA,UAAA,EACtB,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,mBAAmB,CAAC,EAAA,QAAA,EAAA,8qCAAA,EAAA;;0BAqC7F;;0BAAY,MAAM;2BAAC,eAAe;;0BAMlC;yCAhCI,kBAAkB,EAAA,CAAA;sBAA1B;gBACS,eAAe,EAAA,CAAA;sBAAxB;gBACS,cAAc,EAAA,CAAA;sBAAvB;;;AExBL;;AAEG;;;;"}
@@ -0,0 +1,9 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class FirmaPeruService {
3
+ private http;
4
+ validarDocumento(data: {
5
+ cArchivoKey: string;
6
+ }): Promise<any>;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<FirmaPeruService, never>;
8
+ static ɵprov: i0.ɵɵInjectableDeclaration<FirmaPeruService>;
9
+ }
@@ -0,0 +1,23 @@
1
+ import { DocumentoFirma, EstadosFirma, FirmaEvento } from './models/types';
2
+ import { FirmaProgressConfig } from './models/tokens';
3
+ import * as i0 from "@angular/core";
4
+ export declare class FirmaService {
5
+ private overlayService;
6
+ private _campoFirmaEval;
7
+ readonly campoFirmaEval: import("@angular/core").Signal<string | null>;
8
+ private _documentoFirma;
9
+ readonly documentoFirma: import("@angular/core").Signal<DocumentoFirma | null>;
10
+ private _estadoFirma;
11
+ readonly estadoFirma: import("@angular/core").Signal<EstadosFirma | null>;
12
+ private _firmando;
13
+ readonly firmando: import("@angular/core").Signal<0 | 1 | null>;
14
+ private readonly _firmaEvento;
15
+ readonly firmaEvento$: import("rxjs").Observable<FirmaEvento>;
16
+ constructor();
17
+ setCampoFirma(val: string | null): void;
18
+ setDocumentoFirma(doc: DocumentoFirma): void;
19
+ resetEstado(): void;
20
+ interfazYSuscripciones(estado: EstadosFirma, config?: FirmaProgressConfig): void;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<FirmaService, never>;
22
+ static ɵprov: i0.ɵɵInjectableDeclaration<FirmaService>;
23
+ }
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@jvsoft/firma" />
5
+ export * from './public-api';
@@ -0,0 +1,37 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export interface FirmaProgressConfig {
3
+ mensaje?: string;
4
+ fondoStyle?: string;
5
+ [key: string]: any;
6
+ }
7
+ export interface FirmaProgressAdapter {
8
+ show(config?: FirmaProgressConfig): void;
9
+ hide(config?: FirmaProgressConfig): void;
10
+ }
11
+ export interface FirmaHttpAdapter {
12
+ validarDocumento(data: {
13
+ cArchivoKey: string;
14
+ }): Promise<any>;
15
+ }
16
+ export interface FirmaQueryAdapter {
17
+ cargar(ctx: any, tipos: string[], params?: any): Promise<any>;
18
+ guardarDatos(tipo: string, data: any, modulo?: string, feedback?: string): Promise<any>;
19
+ eliminarDatosAsync(tipo: string, data: any, msg?: any, modulo?: string): Promise<any>;
20
+ }
21
+ export interface FirmaUsuarioAdapter {
22
+ habilitarAccionFirma(): Promise<{
23
+ isConfirmed: boolean;
24
+ value?: string;
25
+ }>;
26
+ getMismoPassword(): boolean;
27
+ cambiarPassword(): void;
28
+ }
29
+ export interface FirmaConfigAdapter {
30
+ urlFirmaPeru: string;
31
+ backendUrl: string;
32
+ }
33
+ export declare const JVS_FIRMA_PROGRESS: InjectionToken<FirmaProgressAdapter>;
34
+ export declare const JVS_FIRMA_HTTP: InjectionToken<FirmaHttpAdapter>;
35
+ export declare const JVS_FIRMA_QUERY: InjectionToken<FirmaQueryAdapter>;
36
+ export declare const JVS_FIRMA_USUARIO: InjectionToken<FirmaUsuarioAdapter>;
37
+ export declare const JVS_FIRMA_CONFIG: InjectionToken<FirmaConfigAdapter>;
@@ -0,0 +1,24 @@
1
+ export type EstadosFirma = 'iniciado' | 'ok' | 'error';
2
+ export type ModuloFirma = 'tramite' | 'tareos' | string;
3
+ export interface DocumentoFirma {
4
+ identificador: string;
5
+ idDocumento?: number;
6
+ idArchivo?: number;
7
+ tipoDocumento?: string;
8
+ nombre?: string;
9
+ extra?: Record<string, any>;
10
+ [key: string]: any;
11
+ }
12
+ export interface FirmaEvento {
13
+ estado: EstadosFirma;
14
+ documento: DocumentoFirma | null;
15
+ campo: string | null;
16
+ }
17
+ export interface ParametrosFirmaElectronicaDialog {
18
+ tipo: ModuloFirma;
19
+ dataExtraGuardarFirmante: object;
20
+ iCredEntId: string;
21
+ iTipoFirmaId: string;
22
+ iMotFirmaId: string;
23
+ iArchivoId: string;
24
+ }
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@jvsoft/firma",
3
+ "version": "1.0.0-alpha.13",
4
+ "description": "JVSOFT Firma Digital y Electrónica",
5
+ "publishConfig": {
6
+ "tag": "alpha",
7
+ "access": "public"
8
+ },
9
+ "peerDependencies": {
10
+ "@angular/common": ">=17.1.0",
11
+ "@angular/core": ">=17.1.0",
12
+ "@angular/forms": ">=17.1.0",
13
+ "@angular/material": ">=17.1.0",
14
+ "@jvsoft/components": "1.0.0-alpha.13",
15
+ "@jvsoft/utils": "1.0.0-alpha.13",
16
+ "ngx-toastr": ">=17.0.0",
17
+ "rxjs": ">=7.8.0"
18
+ },
19
+ "dependencies": {
20
+ "tslib": "^2.3.0"
21
+ },
22
+ "sideEffects": false,
23
+ "module": "fesm2022/jvsoft-firma.mjs",
24
+ "typings": "index.d.ts",
25
+ "exports": {
26
+ "./package.json": {
27
+ "default": "./package.json"
28
+ },
29
+ ".": {
30
+ "types": "./index.d.ts",
31
+ "default": "./fesm2022/jvsoft-firma.mjs"
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,7 @@
1
+ export * from './models/tokens';
2
+ export * from './models/types';
3
+ export * from './firma.service';
4
+ export * from './firma-peru/firma-peru.service';
5
+ export * from './dialog-firma-electronica/dialog-firma-electronica.component';
6
+ export * from './dialog-firma-electronica/dialog-firma-electronica.service';
7
+ export * from './archivos-firmantes/archivos-firmantes.component';