@fad-producto-portal/ng-fad-signature-fea 0.0.0-watch
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/README.md +24 -0
- package/assets/images/fad-signature-fea/document-approval-list/activeApprove.png +0 -0
- package/assets/images/fad-signature-fea/document-approval-list/activeReject.png +0 -0
- package/assets/images/fad-signature-fea/document-approval-list/inactiveApprove.png +0 -0
- package/assets/images/fad-signature-fea/document-approval-list/inactiveReject.png +0 -0
- package/assets/images/fad-signature-fea/generic-error-fea/error.svg +41 -0
- package/assets/images/fad-signature-fea/signature-summary/rejected.svg +20 -0
- package/assets/images/fad-signature-fea/signature-summary/send.svg +11 -0
- package/assets/images/fad-signature-fea/upload-e-signature/check-off.svg +20 -0
- package/assets/images/fad-signature-fea/upload-e-signature/check-on.svg +12 -0
- package/assets/images/fad-signature-fea/upload-e-signature/file.svg +1 -0
- package/assets/images/fad-signature-fea/upload-e-signature/upload.svg +1 -0
- package/esm2022/fad-producto-portal-ng-fad-signature-fea.mjs +5 -0
- package/esm2022/lib/components/document-approval-list/document-approval-list.component.mjs +191 -0
- package/esm2022/lib/components/generic-error-fea/generic-error-fea.component.mjs +28 -0
- package/esm2022/lib/components/pdf-viewer-fea/pdf-viewer-fea.component.mjs +79 -0
- package/esm2022/lib/components/signature-summary/signature-summary.component.mjs +95 -0
- package/esm2022/lib/components/upload-e-signature/upload-e-signature.component.mjs +252 -0
- package/esm2022/lib/components/validate-rfc/validate-rfc.component.mjs +112 -0
- package/esm2022/lib/components/validate-signature/validate-signature.component.mjs +76 -0
- package/esm2022/lib/constants/configuration/document-approval-list/document-approval-lis-tconfiguration.const.mjs +18 -0
- package/esm2022/lib/constants/configuration/document-approval-list/index.mjs +2 -0
- package/esm2022/lib/constants/configuration/generic-error-fea/configuration-generic-error-fea.const.mjs +15 -0
- package/esm2022/lib/constants/configuration/generic-error-fea/index.mjs +2 -0
- package/esm2022/lib/constants/configuration/index.mjs +7 -0
- package/esm2022/lib/constants/configuration/pdf-viewer-fea/index.mjs +2 -0
- package/esm2022/lib/constants/configuration/pdf-viewer-fea/pdf-viewer-fea-configuration.const.mjs +17 -0
- package/esm2022/lib/constants/configuration/signature-summary/signature-summary-configuration.const.mjs +18 -0
- package/esm2022/lib/constants/configuration/upload-e-signature/configuration-upload-e-signature.const.mjs +93 -0
- package/esm2022/lib/constants/configuration/upload-e-signature/index.mjs +2 -0
- package/esm2022/lib/constants/configuration/validate-rfc/configuration-validate-rfc.const.mjs +18 -0
- package/esm2022/lib/constants/configuration/validate-rfc/index.mjs +2 -0
- package/esm2022/lib/constants/configuration/validate-signature/index.mjs +2 -0
- package/esm2022/lib/constants/configuration/validate-signature/validate-signature.const.mjs +15 -0
- package/esm2022/lib/constants/errors/document-approval-list/document-approval-list-error-code.mjs +7 -0
- package/esm2022/lib/constants/errors/document-approval-list/document-approval-list-error-description.mjs +13 -0
- package/esm2022/lib/constants/errors/document-approval-list/index.mjs +3 -0
- package/esm2022/lib/constants/errors/generic-error-fea/generic-error-fea-error-code.mjs +4 -0
- package/esm2022/lib/constants/errors/generic-error-fea/generic-error-fea-error-description.mjs +7 -0
- package/esm2022/lib/constants/errors/generic-error-fea/index.mjs +3 -0
- package/esm2022/lib/constants/errors/index.mjs +6 -0
- package/esm2022/lib/constants/errors/upload-e-signature/index.mjs +3 -0
- package/esm2022/lib/constants/errors/upload-e-signature/upload-e-signature-error-code.mjs +13 -0
- package/esm2022/lib/constants/errors/upload-e-signature/upload-e-signature-error-description.mjs +25 -0
- package/esm2022/lib/constants/errors/validate-rfc/index.mjs +3 -0
- package/esm2022/lib/constants/errors/validate-rfc/validate-rfc-error-code.mjs +8 -0
- package/esm2022/lib/constants/errors/validate-rfc/validate-rfc-error-description.mjs +15 -0
- package/esm2022/lib/constants/errors/validate-signature/index.mjs +3 -0
- package/esm2022/lib/constants/errors/validate-signature/validate-signature-error-code.mjs +8 -0
- package/esm2022/lib/constants/errors/validate-signature/validate-signature-error-description.mjs +15 -0
- package/esm2022/lib/constants/index.mjs +3 -0
- package/esm2022/lib/models/components/document-approval-list/document-approval-fea.interface.mjs +2 -0
- package/esm2022/lib/models/components/document-approval-list/index.mjs +2 -0
- package/esm2022/lib/models/components/index.mjs +3 -0
- package/esm2022/lib/models/components/upload-e-signature/certificate.interface.mjs +2 -0
- package/esm2022/lib/models/components/upload-e-signature/index.mjs +3 -0
- package/esm2022/lib/models/components/upload-e-signature/upload-e-signature-complete.interface.mjs +2 -0
- package/esm2022/lib/models/configuration/document-approval-list/document-approval-list.interface.mjs +2 -0
- package/esm2022/lib/models/configuration/document-approval-list/index.mjs +2 -0
- package/esm2022/lib/models/configuration/generic-error-fea/generic-error-fea-configuration.interface.mjs +2 -0
- package/esm2022/lib/models/configuration/generic-error-fea/index.mjs +2 -0
- package/esm2022/lib/models/configuration/index.mjs +9 -0
- package/esm2022/lib/models/configuration/pdf-viewer-fea/index.mjs +2 -0
- package/esm2022/lib/models/configuration/pdf-viewer-fea/pdf-viewer-fea.interface.mjs +2 -0
- package/esm2022/lib/models/configuration/signature-summary/index.mjs +2 -0
- package/esm2022/lib/models/configuration/signature-summary/signature-summary.interface.mjs +2 -0
- package/esm2022/lib/models/configuration/upload-e-signature/index.mjs +2 -0
- package/esm2022/lib/models/configuration/upload-e-signature/upload-e-signature-configuration.interface.mjs +2 -0
- package/esm2022/lib/models/configuration/validate-rfc/index.mjs +2 -0
- package/esm2022/lib/models/configuration/validate-rfc/validate-rfc-configuration.interface.mjs +2 -0
- package/esm2022/lib/models/configuration/validate-signature/index.mjs +2 -0
- package/esm2022/lib/models/configuration/validate-signature/validate-signature-configuration.interface.mjs +2 -0
- package/esm2022/lib/models/customization/index.mjs +3 -0
- package/esm2022/lib/models/customization/legends/document-approval-list/document-approval-list-legends.interface.mjs +2 -0
- package/esm2022/lib/models/customization/legends/document-approval-list/index.mjs +2 -0
- package/esm2022/lib/models/customization/legends/generic-error-fea/generic-error-fea-legends.interface.mjs +2 -0
- package/esm2022/lib/models/customization/legends/generic-error-fea/index.mjs +2 -0
- package/esm2022/lib/models/customization/legends/index.mjs +9 -0
- package/esm2022/lib/models/customization/legends/pdf-viewer-fea/index.mjs +2 -0
- package/esm2022/lib/models/customization/legends/pdf-viewer-fea/pdf-viewer-fea-legends.interface.mjs +2 -0
- package/esm2022/lib/models/customization/legends/signature-summary/index.mjs +2 -0
- package/esm2022/lib/models/customization/legends/signature-summary/signature-summary-legends.interface.mjs +2 -0
- package/esm2022/lib/models/customization/legends/upload-e-signature/index.mjs +2 -0
- package/esm2022/lib/models/customization/legends/upload-e-signature/upload-e-signature-legends.interface.mjs +2 -0
- package/esm2022/lib/models/customization/legends/validate-rfc/index.mjs +2 -0
- package/esm2022/lib/models/customization/legends/validate-rfc/validate-rfc-legends.interface.mjs +2 -0
- package/esm2022/lib/models/customization/legends/validate-signature/index.mjs +2 -0
- package/esm2022/lib/models/customization/legends/validate-signature/validate-signature-legends.interface.mjs +2 -0
- package/esm2022/lib/models/customization/style/document-approval-list/document-approval-list-style.interface.mjs +2 -0
- package/esm2022/lib/models/customization/style/document-approval-list/index.mjs +2 -0
- package/esm2022/lib/models/customization/style/generic-error-fea/generic-error-fea-style.interface.mjs +2 -0
- package/esm2022/lib/models/customization/style/generic-error-fea/index.mjs +2 -0
- package/esm2022/lib/models/customization/style/index.mjs +9 -0
- package/esm2022/lib/models/customization/style/pdf-viewer-fea/index.mjs +2 -0
- package/esm2022/lib/models/customization/style/pdf-viewer-fea/pdf-viewer-fea-style.interface.mjs +2 -0
- package/esm2022/lib/models/customization/style/signature-summary/index.mjs +2 -0
- package/esm2022/lib/models/customization/style/signature-summary/signature-summary-style.interface.mjs +2 -0
- package/esm2022/lib/models/customization/style/upload-e-signature/index.mjs +2 -0
- package/esm2022/lib/models/customization/style/upload-e-signature/upload-e-signature-style.interface.mjs +2 -0
- package/esm2022/lib/models/customization/style/validate-rfc/index.mjs +2 -0
- package/esm2022/lib/models/customization/style/validate-rfc/validate-rfc-style.interface.mjs +2 -0
- package/esm2022/lib/models/customization/style/validate-signature/index.mjs +2 -0
- package/esm2022/lib/models/customization/style/validate-signature/validate-signature-style.interface.mjs +2 -0
- package/esm2022/lib/models/index.mjs +6 -0
- package/esm2022/lib/models/path-dependencies/document-approval-list/document-approval-list-dependencies.interface.mjs +2 -0
- package/esm2022/lib/models/path-dependencies/document-approval-list/index.mjs +2 -0
- package/esm2022/lib/models/path-dependencies/generic-error-fea/generic-error-fea-dependencies.interface.mjs +2 -0
- package/esm2022/lib/models/path-dependencies/generic-error-fea/index.mjs +2 -0
- package/esm2022/lib/models/path-dependencies/index.mjs +9 -0
- package/esm2022/lib/models/path-dependencies/pdf-viewer-fea/index.mjs +2 -0
- package/esm2022/lib/models/path-dependencies/pdf-viewer-fea/pdf-viewer-fea-dependencies.interface.mjs +2 -0
- package/esm2022/lib/models/path-dependencies/signature-summary/index.mjs +2 -0
- package/esm2022/lib/models/path-dependencies/signature-summary/signature-summary-dependencies.interface.mjs +2 -0
- package/esm2022/lib/models/path-dependencies/upload-e-signature/index.mjs +2 -0
- package/esm2022/lib/models/path-dependencies/upload-e-signature/upload-e-signature-dependencies.interface.mjs +2 -0
- package/esm2022/lib/models/path-dependencies/validate-rfc/index.mjs +2 -0
- package/esm2022/lib/models/path-dependencies/validate-rfc/validate-rfc-dependencies.interface.mjs +2 -0
- package/esm2022/lib/models/path-dependencies/validate-signature/index.mjs +2 -0
- package/esm2022/lib/models/path-dependencies/validate-signature/validate-signature-dependencies.interface.mjs +2 -0
- package/esm2022/lib/ng-fad-signature-fea.module.mjs +71 -0
- package/esm2022/public-api.mjs +17 -0
- package/fesm2022/fad-producto-portal-ng-fad-signature-fea.mjs +1158 -0
- package/fesm2022/fad-producto-portal-ng-fad-signature-fea.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/document-approval-list/document-approval-list.component.d.ts +48 -0
- package/lib/components/generic-error-fea/generic-error-fea.component.d.ts +13 -0
- package/lib/components/pdf-viewer-fea/pdf-viewer-fea.component.d.ts +28 -0
- package/lib/components/signature-summary/signature-summary.component.d.ts +27 -0
- package/lib/components/upload-e-signature/upload-e-signature.component.d.ts +52 -0
- package/lib/components/validate-rfc/validate-rfc.component.d.ts +32 -0
- package/lib/components/validate-signature/validate-signature.component.d.ts +22 -0
- package/lib/constants/configuration/document-approval-list/document-approval-lis-tconfiguration.const.d.ts +2 -0
- package/lib/constants/configuration/document-approval-list/index.d.ts +1 -0
- package/lib/constants/configuration/generic-error-fea/configuration-generic-error-fea.const.d.ts +2 -0
- package/lib/constants/configuration/generic-error-fea/index.d.ts +1 -0
- package/lib/constants/configuration/index.d.ts +6 -0
- package/lib/constants/configuration/pdf-viewer-fea/index.d.ts +1 -0
- package/lib/constants/configuration/pdf-viewer-fea/pdf-viewer-fea-configuration.const.d.ts +2 -0
- package/lib/constants/configuration/signature-summary/signature-summary-configuration.const.d.ts +2 -0
- package/lib/constants/configuration/upload-e-signature/configuration-upload-e-signature.const.d.ts +2 -0
- package/lib/constants/configuration/upload-e-signature/index.d.ts +1 -0
- package/lib/constants/configuration/validate-rfc/configuration-validate-rfc.const.d.ts +2 -0
- package/lib/constants/configuration/validate-rfc/index.d.ts +1 -0
- package/lib/constants/configuration/validate-signature/index.d.ts +1 -0
- package/lib/constants/configuration/validate-signature/validate-signature.const.d.ts +2 -0
- package/lib/constants/errors/document-approval-list/document-approval-list-error-code.d.ts +5 -0
- package/lib/constants/errors/document-approval-list/document-approval-list-error-description.d.ts +2 -0
- package/lib/constants/errors/document-approval-list/index.d.ts +2 -0
- package/lib/constants/errors/generic-error-fea/generic-error-fea-error-code.d.ts +2 -0
- package/lib/constants/errors/generic-error-fea/generic-error-fea-error-description.d.ts +2 -0
- package/lib/constants/errors/generic-error-fea/index.d.ts +2 -0
- package/lib/constants/errors/index.d.ts +5 -0
- package/lib/constants/errors/upload-e-signature/index.d.ts +2 -0
- package/lib/constants/errors/upload-e-signature/upload-e-signature-error-code.d.ts +11 -0
- package/lib/constants/errors/upload-e-signature/upload-e-signature-error-description.d.ts +2 -0
- package/lib/constants/errors/validate-rfc/index.d.ts +2 -0
- package/lib/constants/errors/validate-rfc/validate-rfc-error-code.d.ts +6 -0
- package/lib/constants/errors/validate-rfc/validate-rfc-error-description.d.ts +2 -0
- package/lib/constants/errors/validate-signature/index.d.ts +2 -0
- package/lib/constants/errors/validate-signature/validate-signature-error-code.d.ts +6 -0
- package/lib/constants/errors/validate-signature/validate-signature-error-description.d.ts +2 -0
- package/lib/constants/index.d.ts +2 -0
- package/lib/models/components/document-approval-list/document-approval-fea.interface.d.ts +8 -0
- package/lib/models/components/document-approval-list/index.d.ts +1 -0
- package/lib/models/components/index.d.ts +2 -0
- package/lib/models/components/upload-e-signature/certificate.interface.d.ts +5 -0
- package/lib/models/components/upload-e-signature/index.d.ts +2 -0
- package/lib/models/components/upload-e-signature/upload-e-signature-complete.interface.d.ts +4 -0
- package/lib/models/configuration/document-approval-list/document-approval-list.interface.d.ts +8 -0
- package/lib/models/configuration/document-approval-list/index.d.ts +1 -0
- package/lib/models/configuration/generic-error-fea/generic-error-fea-configuration.interface.d.ts +5 -0
- package/lib/models/configuration/generic-error-fea/index.d.ts +1 -0
- package/lib/models/configuration/index.d.ts +8 -0
- package/lib/models/configuration/pdf-viewer-fea/index.d.ts +1 -0
- package/lib/models/configuration/pdf-viewer-fea/pdf-viewer-fea.interface.d.ts +9 -0
- package/lib/models/configuration/signature-summary/index.d.ts +1 -0
- package/lib/models/configuration/signature-summary/signature-summary.interface.d.ts +6 -0
- package/lib/models/configuration/upload-e-signature/index.d.ts +1 -0
- package/lib/models/configuration/upload-e-signature/upload-e-signature-configuration.interface.d.ts +14 -0
- package/lib/models/configuration/validate-rfc/index.d.ts +1 -0
- package/lib/models/configuration/validate-rfc/validate-rfc-configuration.interface.d.ts +9 -0
- package/lib/models/configuration/validate-signature/index.d.ts +1 -0
- package/lib/models/configuration/validate-signature/validate-signature-configuration.interface.d.ts +9 -0
- package/lib/models/customization/index.d.ts +2 -0
- package/lib/models/customization/legends/document-approval-list/document-approval-list-legends.interface.d.ts +8 -0
- package/lib/models/customization/legends/document-approval-list/index.d.ts +1 -0
- package/lib/models/customization/legends/generic-error-fea/generic-error-fea-legends.interface.d.ts +5 -0
- package/lib/models/customization/legends/generic-error-fea/index.d.ts +1 -0
- package/lib/models/customization/legends/index.d.ts +8 -0
- package/lib/models/customization/legends/pdf-viewer-fea/index.d.ts +1 -0
- package/lib/models/customization/legends/pdf-viewer-fea/pdf-viewer-fea-legends.interface.d.ts +3 -0
- package/lib/models/customization/legends/signature-summary/index.d.ts +1 -0
- package/lib/models/customization/legends/signature-summary/signature-summary-legends.interface.d.ts +8 -0
- package/lib/models/customization/legends/upload-e-signature/index.d.ts +1 -0
- package/lib/models/customization/legends/upload-e-signature/upload-e-signature-legends.interface.d.ts +54 -0
- package/lib/models/customization/legends/validate-rfc/index.d.ts +1 -0
- package/lib/models/customization/legends/validate-rfc/validate-rfc-legends.interface.d.ts +6 -0
- package/lib/models/customization/legends/validate-signature/index.d.ts +1 -0
- package/lib/models/customization/legends/validate-signature/validate-signature-legends.interface.d.ts +3 -0
- package/lib/models/customization/style/document-approval-list/document-approval-list-style.interface.d.ts +2 -0
- package/lib/models/customization/style/document-approval-list/index.d.ts +1 -0
- package/lib/models/customization/style/generic-error-fea/generic-error-fea-style.interface.d.ts +2 -0
- package/lib/models/customization/style/generic-error-fea/index.d.ts +1 -0
- package/lib/models/customization/style/index.d.ts +8 -0
- package/lib/models/customization/style/pdf-viewer-fea/index.d.ts +1 -0
- package/lib/models/customization/style/pdf-viewer-fea/pdf-viewer-fea-style.interface.d.ts +2 -0
- package/lib/models/customization/style/signature-summary/index.d.ts +1 -0
- package/lib/models/customization/style/signature-summary/signature-summary-style.interface.d.ts +2 -0
- package/lib/models/customization/style/upload-e-signature/index.d.ts +1 -0
- package/lib/models/customization/style/upload-e-signature/upload-e-signature-style.interface.d.ts +22 -0
- package/lib/models/customization/style/validate-rfc/index.d.ts +1 -0
- package/lib/models/customization/style/validate-rfc/validate-rfc-style.interface.d.ts +2 -0
- package/lib/models/customization/style/validate-signature/index.d.ts +1 -0
- package/lib/models/customization/style/validate-signature/validate-signature-style.interface.d.ts +2 -0
- package/lib/models/index.d.ts +5 -0
- package/lib/models/path-dependencies/document-approval-list/document-approval-list-dependencies.interface.d.ts +9 -0
- package/lib/models/path-dependencies/document-approval-list/index.d.ts +1 -0
- package/lib/models/path-dependencies/generic-error-fea/generic-error-fea-dependencies.interface.d.ts +6 -0
- package/lib/models/path-dependencies/generic-error-fea/index.d.ts +1 -0
- package/lib/models/path-dependencies/index.d.ts +8 -0
- package/lib/models/path-dependencies/pdf-viewer-fea/index.d.ts +1 -0
- package/lib/models/path-dependencies/pdf-viewer-fea/pdf-viewer-fea-dependencies.interface.d.ts +9 -0
- package/lib/models/path-dependencies/signature-summary/index.d.ts +1 -0
- package/lib/models/path-dependencies/signature-summary/signature-summary-dependencies.interface.d.ts +7 -0
- package/lib/models/path-dependencies/upload-e-signature/index.d.ts +1 -0
- package/lib/models/path-dependencies/upload-e-signature/upload-e-signature-dependencies.interface.d.ts +9 -0
- package/lib/models/path-dependencies/validate-rfc/index.d.ts +1 -0
- package/lib/models/path-dependencies/validate-rfc/validate-rfc-dependencies.interface.d.ts +4 -0
- package/lib/models/path-dependencies/validate-signature/index.d.ts +1 -0
- package/lib/models/path-dependencies/validate-signature/validate-signature-dependencies.interface.d.ts +4 -0
- package/lib/ng-fad-signature-fea.module.d.ts +18 -0
- package/package.json +31 -0
- package/public-api.d.ts +10 -0
|
@@ -0,0 +1,1158 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, Input, ViewChild, EventEmitter, Output, NgModule } from '@angular/core';
|
|
3
|
+
import * as i3 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i1$1 from '@angular/forms';
|
|
6
|
+
import { Validators, ReactiveFormsModule } from '@angular/forms';
|
|
7
|
+
import * as i5 from '@fad-producto-portal/ng-fad-shared';
|
|
8
|
+
import { ResponseError, SharedUtils, NgFadSharedModule } from '@fad-producto-portal/ng-fad-shared';
|
|
9
|
+
import * as i4 from '@fad-producto/ng-fad-image-inline';
|
|
10
|
+
import { NgFadImageInlineModule } from '@fad-producto/ng-fad-image-inline';
|
|
11
|
+
import * as i2 from '@fad-producto-portal/ng-fad-viewer';
|
|
12
|
+
import { GeneralPdfViewerComponent, NgFadViewerModule } from '@fad-producto-portal/ng-fad-viewer';
|
|
13
|
+
import * as i1 from '@fad-producto/ng-fad-pdf-reader';
|
|
14
|
+
import { NgFadPdfReaderService } from '@fad-producto/ng-fad-pdf-reader';
|
|
15
|
+
import { Utils } from '@fad-producto-portal/fad-common/utils/utils';
|
|
16
|
+
import { Configuration } from '@fad-producto-portal/fad-common/models/core';
|
|
17
|
+
import { finalize } from 'rxjs';
|
|
18
|
+
import * as i2$1 from '@angular/router';
|
|
19
|
+
import * as i2$2 from '@fad-producto-portal/ng-fad-services';
|
|
20
|
+
|
|
21
|
+
const DOCUMENT_APPROVAL_LIST_DEFAULT = {
|
|
22
|
+
customization: {
|
|
23
|
+
moduleCustomization: {
|
|
24
|
+
style: {},
|
|
25
|
+
legends: {
|
|
26
|
+
sendTo: 'Enviado por',
|
|
27
|
+
seeDocument: 'Ver documento',
|
|
28
|
+
hideDocument: 'Ocultar documento',
|
|
29
|
+
download: 'Descargar',
|
|
30
|
+
pages: 'Páginas'
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
pathDependencies: {
|
|
35
|
+
imageDirectory: 'assets/images/fad-signature-fea/document-approval-list/',
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const GENERIC_ERROR_FEA_CONFIGURATION_DEFAULT = {
|
|
40
|
+
customization: {
|
|
41
|
+
moduleCustomization: {
|
|
42
|
+
style: {},
|
|
43
|
+
legends: {
|
|
44
|
+
title: 'Aviso',
|
|
45
|
+
instruction: 'No existe un documento que corresponda a este URL (la dirección web). Si copiaste y pegaste la dirección, es posible que hayas cometido un error. Asegúrate de que no sobren o falten caracteres e intenta nuevamente.'
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
pathDependencies: {
|
|
50
|
+
imageDirectory: 'assets/images/fad-signature-fea/generic-error-fea/',
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const UPLOAD_E_SIGNATURE_CONFIGURATION_DEFAULT = {
|
|
55
|
+
services: {
|
|
56
|
+
reject: { loader: true, error: true },
|
|
57
|
+
sign: { loader: true, error: true }
|
|
58
|
+
},
|
|
59
|
+
credentials: {
|
|
60
|
+
key: 'JJQUfgm0i5MJ70NI',
|
|
61
|
+
iv: 'uxQKO3FiCiht0uVU'
|
|
62
|
+
},
|
|
63
|
+
customization: {
|
|
64
|
+
moduleCustomization: {
|
|
65
|
+
style: {
|
|
66
|
+
documents: {
|
|
67
|
+
backgroundColor: '#f5f5f5',
|
|
68
|
+
borderRadius: '15px'
|
|
69
|
+
},
|
|
70
|
+
upload: {
|
|
71
|
+
backgroundColor: '#f4f6fa',
|
|
72
|
+
borderRadius: '10px',
|
|
73
|
+
border: '2px dashed var(--fad-portal-common-legends-tertiary)',
|
|
74
|
+
button: {
|
|
75
|
+
backgroundColor: '#e3e7f0',
|
|
76
|
+
borderRadius: '50px',
|
|
77
|
+
hover: '#cbd7f5'
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
file: {
|
|
81
|
+
borderRadius: '10px',
|
|
82
|
+
img: {
|
|
83
|
+
backgroundColor: '#f5f5f5'
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
legends: {
|
|
88
|
+
documents: {
|
|
89
|
+
pages: {
|
|
90
|
+
singular: 'Página',
|
|
91
|
+
plural: 'Páginas'
|
|
92
|
+
},
|
|
93
|
+
status: {
|
|
94
|
+
approved: 'Aprobado',
|
|
95
|
+
rejected: 'Rechazado'
|
|
96
|
+
},
|
|
97
|
+
title: {
|
|
98
|
+
plural: 'Documentos para enviar (#TOTAL_DOCS)',
|
|
99
|
+
singular: 'Documento #STATUS_DOC para firma',
|
|
100
|
+
approved: 'aprobado',
|
|
101
|
+
rejected: 'rechazado'
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
eSignature: {
|
|
105
|
+
cer: {
|
|
106
|
+
instruction: 'Selecciona o arrastra el archivo .CER',
|
|
107
|
+
label: 'Certificado .CER',
|
|
108
|
+
upload: 'Subir .CER'
|
|
109
|
+
},
|
|
110
|
+
key: {
|
|
111
|
+
instruction: 'Selecciona o arrastra el archivo .KEY',
|
|
112
|
+
label: 'Llave privada .KEY',
|
|
113
|
+
upload: 'Subir .KEY'
|
|
114
|
+
},
|
|
115
|
+
password: {
|
|
116
|
+
hide: 'OCULTAR',
|
|
117
|
+
label: 'Ingresa la contraseña de tu e.firma',
|
|
118
|
+
show: 'MOSTRAR'
|
|
119
|
+
},
|
|
120
|
+
title: 'Ingresa tu e.firma para firmar los documentos',
|
|
121
|
+
upload: 'Seleccionar otro archivo'
|
|
122
|
+
},
|
|
123
|
+
sign: {
|
|
124
|
+
button: {
|
|
125
|
+
reject: {
|
|
126
|
+
plural: 'Rechazar documentos',
|
|
127
|
+
singular: 'Rechazar documento'
|
|
128
|
+
},
|
|
129
|
+
sign: {
|
|
130
|
+
plural: 'Firmar documentos',
|
|
131
|
+
singular: 'Firmar documento'
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
validate: {
|
|
135
|
+
plural: 'Valido que he leído y he aceptado firmar los documentos',
|
|
136
|
+
singular: 'Valido que he leído y he aceptado firmar el documento'
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
pathDependencies: {
|
|
143
|
+
imageDirectory: 'assets/images/fad-signature-fea/upload-e-signature/',
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const SIGNATURE_FEA_CONFIGURATION_DEFAULT = {
|
|
148
|
+
maxCharacters: 13,
|
|
149
|
+
regexRFC: '^[A-ZÑ&]{3,4}[0-9]{6}[A-V1-9][A-Z1-9][0-9A]$',
|
|
150
|
+
customization: {
|
|
151
|
+
moduleCustomization: {
|
|
152
|
+
style: {},
|
|
153
|
+
legends: {
|
|
154
|
+
title: 'Código de validación',
|
|
155
|
+
description: 'Ingresa tu RFC para comenzar la firma',
|
|
156
|
+
buttonLegend: 'Validar'
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
pathDependencies: {
|
|
161
|
+
imageDirectory: 'assets/images/fad-signature-fea/validate-rfc/',
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
const VALIDATE_SIGNATURE_CONFIGURATION_DEFAULT = {
|
|
166
|
+
services: {
|
|
167
|
+
signerStatusFea: { loader: true, error: true }
|
|
168
|
+
},
|
|
169
|
+
customization: {
|
|
170
|
+
moduleCustomization: {
|
|
171
|
+
style: {},
|
|
172
|
+
legends: {}
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
pathDependencies: {
|
|
176
|
+
imageDirectory: 'assets/images/fad-signature-fea/validate-signature/',
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
const PDF_VIEWER_FEA_DEFAULT = {
|
|
181
|
+
pdfMini: {
|
|
182
|
+
configuration: {
|
|
183
|
+
scrollIntoView: true
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
customization: {
|
|
187
|
+
moduleCustomization: {
|
|
188
|
+
style: {},
|
|
189
|
+
legends: {}
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
pathDependencies: {
|
|
193
|
+
imageDirectory: 'assets/images/fad-signature-fea/pdf-viewer-fea/',
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
var DocumentApprovalListErrorCode;
|
|
198
|
+
(function (DocumentApprovalListErrorCode) {
|
|
199
|
+
DocumentApprovalListErrorCode[DocumentApprovalListErrorCode["SERVICE"] = -1] = "SERVICE";
|
|
200
|
+
DocumentApprovalListErrorCode[DocumentApprovalListErrorCode["HTTP"] = -2] = "HTTP";
|
|
201
|
+
DocumentApprovalListErrorCode[DocumentApprovalListErrorCode["ERROR_PDF"] = -3] = "ERROR_PDF";
|
|
202
|
+
})(DocumentApprovalListErrorCode || (DocumentApprovalListErrorCode = {}));
|
|
203
|
+
|
|
204
|
+
const getDocumentApprovalListErrorDescription = (code) => {
|
|
205
|
+
switch (code) {
|
|
206
|
+
case -1:
|
|
207
|
+
return "Service error";
|
|
208
|
+
case -2:
|
|
209
|
+
return "HTTP error";
|
|
210
|
+
case -3:
|
|
211
|
+
return "PDF error";
|
|
212
|
+
default:
|
|
213
|
+
return 'Unknown error';
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
var GenericErrorFeaErrorCode;
|
|
218
|
+
(function (GenericErrorFeaErrorCode) {
|
|
219
|
+
})(GenericErrorFeaErrorCode || (GenericErrorFeaErrorCode = {}));
|
|
220
|
+
|
|
221
|
+
const getGenericErrorFeaErrorDescription = (code) => {
|
|
222
|
+
switch (code) {
|
|
223
|
+
default:
|
|
224
|
+
return 'Unknown error';
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
var UploadESignatureErrorCode;
|
|
229
|
+
(function (UploadESignatureErrorCode) {
|
|
230
|
+
UploadESignatureErrorCode[UploadESignatureErrorCode["SERVICE"] = -1] = "SERVICE";
|
|
231
|
+
UploadESignatureErrorCode[UploadESignatureErrorCode["HTTP"] = -2] = "HTTP";
|
|
232
|
+
UploadESignatureErrorCode[UploadESignatureErrorCode["NO_DOCUMENTS"] = -3] = "NO_DOCUMENTS";
|
|
233
|
+
UploadESignatureErrorCode[UploadESignatureErrorCode["FORMAT_CER"] = -4] = "FORMAT_CER";
|
|
234
|
+
UploadESignatureErrorCode[UploadESignatureErrorCode["FORMAT_KEY"] = -5] = "FORMAT_KEY";
|
|
235
|
+
UploadESignatureErrorCode[UploadESignatureErrorCode["MULTIPLE_FILES"] = -6] = "MULTIPLE_FILES";
|
|
236
|
+
UploadESignatureErrorCode[UploadESignatureErrorCode["ERROR_BASE_64"] = -7] = "ERROR_BASE_64";
|
|
237
|
+
UploadESignatureErrorCode[UploadESignatureErrorCode["NO_SIGNER_ID"] = -8] = "NO_SIGNER_ID";
|
|
238
|
+
UploadESignatureErrorCode[UploadESignatureErrorCode["NO_RFC"] = -9] = "NO_RFC";
|
|
239
|
+
})(UploadESignatureErrorCode || (UploadESignatureErrorCode = {}));
|
|
240
|
+
|
|
241
|
+
const getUploadESignatureErrorDescription = (code) => {
|
|
242
|
+
switch (code) {
|
|
243
|
+
case -1:
|
|
244
|
+
return "Service error";
|
|
245
|
+
case -2:
|
|
246
|
+
return "HTTP error";
|
|
247
|
+
case -3:
|
|
248
|
+
return "Los documentos a procesar son requeridos";
|
|
249
|
+
case -4:
|
|
250
|
+
return "El formato del archivo seleccionado no es .cer";
|
|
251
|
+
case -5:
|
|
252
|
+
return "El formato del archivo seleccionado no es .key";
|
|
253
|
+
case -6:
|
|
254
|
+
return "Solo puedes seleccionar un archivo";
|
|
255
|
+
case -7:
|
|
256
|
+
return "Error al convertir el archivo a base 64";
|
|
257
|
+
case -8:
|
|
258
|
+
return "El ID del firmante es requerido";
|
|
259
|
+
case -9:
|
|
260
|
+
return "El RFC del firmante es requerido";
|
|
261
|
+
default:
|
|
262
|
+
return 'Unknown error';
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
var ValidateRFCErrorCode;
|
|
267
|
+
(function (ValidateRFCErrorCode) {
|
|
268
|
+
ValidateRFCErrorCode[ValidateRFCErrorCode["SERVICE"] = -1] = "SERVICE";
|
|
269
|
+
ValidateRFCErrorCode[ValidateRFCErrorCode["HTTP"] = -2] = "HTTP";
|
|
270
|
+
ValidateRFCErrorCode[ValidateRFCErrorCode["REQUISITION_ID"] = -3] = "REQUISITION_ID";
|
|
271
|
+
ValidateRFCErrorCode[ValidateRFCErrorCode["SIGNER_ID"] = -4] = "SIGNER_ID";
|
|
272
|
+
})(ValidateRFCErrorCode || (ValidateRFCErrorCode = {}));
|
|
273
|
+
|
|
274
|
+
const getValidateRFCErrorDescription = (code) => {
|
|
275
|
+
switch (code) {
|
|
276
|
+
case -1:
|
|
277
|
+
return "Service error";
|
|
278
|
+
case -2:
|
|
279
|
+
return "HTTP error";
|
|
280
|
+
case -3:
|
|
281
|
+
return "There is not requisitionId";
|
|
282
|
+
case -4:
|
|
283
|
+
return "There is not signerId";
|
|
284
|
+
default:
|
|
285
|
+
return 'Unknown error';
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
var ValidateSignatureErrorCode;
|
|
290
|
+
(function (ValidateSignatureErrorCode) {
|
|
291
|
+
ValidateSignatureErrorCode[ValidateSignatureErrorCode["SERVICE"] = -1] = "SERVICE";
|
|
292
|
+
ValidateSignatureErrorCode[ValidateSignatureErrorCode["HTTP"] = -2] = "HTTP";
|
|
293
|
+
ValidateSignatureErrorCode[ValidateSignatureErrorCode["NO_REQUISITION_ID"] = -3] = "NO_REQUISITION_ID";
|
|
294
|
+
ValidateSignatureErrorCode[ValidateSignatureErrorCode["NO_SIGNER_ID"] = -4] = "NO_SIGNER_ID";
|
|
295
|
+
})(ValidateSignatureErrorCode || (ValidateSignatureErrorCode = {}));
|
|
296
|
+
|
|
297
|
+
const getValidateSignatureErrorDescription = (code) => {
|
|
298
|
+
switch (code) {
|
|
299
|
+
case -1:
|
|
300
|
+
return "Service error";
|
|
301
|
+
case -2:
|
|
302
|
+
return "HTTP error";
|
|
303
|
+
case -2:
|
|
304
|
+
return "Requisition ID is required";
|
|
305
|
+
case -3:
|
|
306
|
+
return "Signer ID is required";
|
|
307
|
+
default:
|
|
308
|
+
return 'Unknown error';
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
class PdfViewerFeaComponent {
|
|
313
|
+
constructor(pdfService, cdr) {
|
|
314
|
+
this.pdfService = pdfService;
|
|
315
|
+
this.cdr = cdr;
|
|
316
|
+
this.pages = [];
|
|
317
|
+
this.page = 1;
|
|
318
|
+
this.miniViewConfig = { scrollIntoView: false };
|
|
319
|
+
this.height = 1000;
|
|
320
|
+
}
|
|
321
|
+
ngOnInit() {
|
|
322
|
+
if (this.file) {
|
|
323
|
+
this.initializePdf(this.file);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
initializePdf(pdfBase64) {
|
|
327
|
+
this.pdfService.initialize(pdfBase64, `pdf-${this.index}`);
|
|
328
|
+
this.pdfService.pages.subscribe((res) => {
|
|
329
|
+
if (res) {
|
|
330
|
+
this.pages = [...this.pages, res];
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
onPageChange(page) {
|
|
335
|
+
this.page = page;
|
|
336
|
+
}
|
|
337
|
+
scrollToPage(page) {
|
|
338
|
+
this.generalPdfViewerComponent.scrollToPage(page);
|
|
339
|
+
}
|
|
340
|
+
onLoadPage(data) {
|
|
341
|
+
if (data.page === 1) {
|
|
342
|
+
const containerElement = document.getElementById(this.id);
|
|
343
|
+
if (!containerElement) {
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
const observer = new MutationObserver(() => {
|
|
347
|
+
const viewerElement = containerElement.querySelector(`#fad-viewer-page-v1-1`);
|
|
348
|
+
if (viewerElement) {
|
|
349
|
+
observer.disconnect();
|
|
350
|
+
const newHeight = viewerElement.clientHeight;
|
|
351
|
+
if (this.height !== newHeight) {
|
|
352
|
+
this.height = newHeight;
|
|
353
|
+
this.cdr.detectChanges();
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
observer.observe(containerElement, { childList: true, subtree: true });
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
setCustomizationStyle(targetElement = document.documentElement) {
|
|
361
|
+
this.configuration = Utils.mergeConfiguration(new Configuration(), PDF_VIEWER_FEA_DEFAULT, this.configuration);
|
|
362
|
+
}
|
|
363
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PdfViewerFeaComponent, deps: [{ token: i1.NgFadPdfReaderService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
364
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PdfViewerFeaComponent, selector: "ng-fad-signature-fea-pdf-viewer-fea", inputs: { configuration: "configuration", file: "file", index: "index", id: "id" }, providers: [NgFadPdfReaderService], viewQueries: [{ propertyName: "generalPdfViewerComponent", first: true, predicate: GeneralPdfViewerComponent, descendants: true }], ngImport: i0, template: "<div class=\"pdf-viewer\" [id]=\"id\" [style.height.px]=\"height\">\r\n <ng-fad-viewer-general-pdf-viewer\r\n [pages]=\"pages\"\r\n (onpagechange)=\"onPageChange($event)\"\r\n (onloadpage)=\"onLoadPage($event)\">\r\n \r\n <ng-fad-viewer-pdf-mini-view\r\n miniView\r\n [configuration]=\"miniViewConfig\"\r\n [pages]=\"pages\"\r\n [page]=\"page\"\r\n (onpagechange)=\"scrollToPage($event)\"\r\n >\r\n </ng-fad-viewer-pdf-mini-view>\r\n \r\n </ng-fad-viewer-general-pdf-viewer>\r\n</div>", styles: [""], dependencies: [{ kind: "component", type: i2.GeneralPdfViewerComponent, selector: "ng-fad-viewer-general-pdf-viewer", inputs: ["configuration", "onerror", "pages"], outputs: ["onpagechange", "onloadpage"] }, { kind: "component", type: i2.PdfMiniViewComponent, selector: "ng-fad-viewer-pdf-mini-view", inputs: ["configuration", "pages", "page"], outputs: ["onpagechange"] }] }); }
|
|
365
|
+
}
|
|
366
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PdfViewerFeaComponent, decorators: [{
|
|
367
|
+
type: Component,
|
|
368
|
+
args: [{ selector: 'ng-fad-signature-fea-pdf-viewer-fea', providers: [NgFadPdfReaderService], template: "<div class=\"pdf-viewer\" [id]=\"id\" [style.height.px]=\"height\">\r\n <ng-fad-viewer-general-pdf-viewer\r\n [pages]=\"pages\"\r\n (onpagechange)=\"onPageChange($event)\"\r\n (onloadpage)=\"onLoadPage($event)\">\r\n \r\n <ng-fad-viewer-pdf-mini-view\r\n miniView\r\n [configuration]=\"miniViewConfig\"\r\n [pages]=\"pages\"\r\n [page]=\"page\"\r\n (onpagechange)=\"scrollToPage($event)\"\r\n >\r\n </ng-fad-viewer-pdf-mini-view>\r\n \r\n </ng-fad-viewer-general-pdf-viewer>\r\n</div>" }]
|
|
369
|
+
}], ctorParameters: function () { return [{ type: i1.NgFadPdfReaderService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { configuration: [{
|
|
370
|
+
type: Input
|
|
371
|
+
}], file: [{
|
|
372
|
+
type: Input
|
|
373
|
+
}], index: [{
|
|
374
|
+
type: Input
|
|
375
|
+
}], id: [{
|
|
376
|
+
type: Input
|
|
377
|
+
}], generalPdfViewerComponent: [{
|
|
378
|
+
type: ViewChild,
|
|
379
|
+
args: [GeneralPdfViewerComponent]
|
|
380
|
+
}] } });
|
|
381
|
+
|
|
382
|
+
class ValidateRfcComponent {
|
|
383
|
+
constructor(fb, hostContext, route, fadService) {
|
|
384
|
+
this.fb = fb;
|
|
385
|
+
this.hostContext = hostContext;
|
|
386
|
+
this.route = route;
|
|
387
|
+
this.fadService = fadService;
|
|
388
|
+
this.requisitionId = '';
|
|
389
|
+
this.signerId = '';
|
|
390
|
+
this.onerror = new EventEmitter();
|
|
391
|
+
this.oncomplete = new EventEmitter();
|
|
392
|
+
this.onloader = new EventEmitter();
|
|
393
|
+
this.showComponent = true;
|
|
394
|
+
}
|
|
395
|
+
ngOnInit() {
|
|
396
|
+
this.setCustomizationStyle(this.hostContext.nativeElement);
|
|
397
|
+
this.showComponent = this.validateData();
|
|
398
|
+
this.initializeForm();
|
|
399
|
+
}
|
|
400
|
+
initializeForm() {
|
|
401
|
+
const maxCharacters = this.configuration?.maxCharacters || 13;
|
|
402
|
+
const rfcRegex = new RegExp(this.configuration?.regexRFC);
|
|
403
|
+
this.validationForm = this.fb.group({
|
|
404
|
+
code: ['', [
|
|
405
|
+
Validators.required,
|
|
406
|
+
Validators.minLength(maxCharacters),
|
|
407
|
+
Validators.maxLength(maxCharacters),
|
|
408
|
+
Validators.pattern(rfcRegex)
|
|
409
|
+
]]
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
onSubmit() {
|
|
413
|
+
this.validateRFC();
|
|
414
|
+
}
|
|
415
|
+
setCustomizationStyle(targetElement = document.documentElement) {
|
|
416
|
+
this.configuration = Utils.mergeConfiguration(new Configuration(), SIGNATURE_FEA_CONFIGURATION_DEFAULT, this.configuration);
|
|
417
|
+
}
|
|
418
|
+
validateData() {
|
|
419
|
+
if (!this.requisitionId) {
|
|
420
|
+
this.onerror.emit(new ResponseError(ValidateRFCErrorCode.REQUISITION_ID, getValidateRFCErrorDescription(ValidateRFCErrorCode.REQUISITION_ID), 'ng-fad-portal-signature-fea-validate-rfc'));
|
|
421
|
+
return false;
|
|
422
|
+
}
|
|
423
|
+
if (!this.signerId) {
|
|
424
|
+
this.onerror.emit(new ResponseError(ValidateRFCErrorCode.SIGNER_ID, getValidateRFCErrorDescription(ValidateRFCErrorCode.SIGNER_ID), 'ng-fad-portal-signature-fea-validate-rfc'));
|
|
425
|
+
return false;
|
|
426
|
+
}
|
|
427
|
+
return true;
|
|
428
|
+
}
|
|
429
|
+
validateRFC() {
|
|
430
|
+
if (this.validationForm.valid) {
|
|
431
|
+
console.error("Validar rfc ");
|
|
432
|
+
const validateReq = {
|
|
433
|
+
requisitionId: this.requisitionId,
|
|
434
|
+
signerId: this.signerId,
|
|
435
|
+
rfc: this.codeControl?.value
|
|
436
|
+
};
|
|
437
|
+
this.fadService.validateRfc(validateReq)
|
|
438
|
+
.pipe(finalize(() => this.onloader.emit(false)))
|
|
439
|
+
.subscribe({
|
|
440
|
+
next: (response) => {
|
|
441
|
+
if (response.success) {
|
|
442
|
+
this.oncomplete.emit(response);
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
this.onerror.emit(new ResponseError(ValidateRFCErrorCode.SERVICE, response.error, 'ng-fad-portal-signature-fea-validate-rfc'));
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
error: (error) => {
|
|
449
|
+
this.onerror.emit(new ResponseError(ValidateRFCErrorCode.HTTP, error.error, 'ng-fad-portal-signature-fea-validate-rfc'));
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
onInputChange(event) {
|
|
455
|
+
const inputValue = event.target.value;
|
|
456
|
+
this.validationForm.controls['code'].setValue(inputValue.toUpperCase(), { emitEvent: false });
|
|
457
|
+
}
|
|
458
|
+
get codeControl() {
|
|
459
|
+
return this.validationForm.get('code') ?? null;
|
|
460
|
+
}
|
|
461
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ValidateRfcComponent, deps: [{ token: i1$1.FormBuilder }, { token: i0.ElementRef }, { token: i2$1.ActivatedRoute }, { token: i2$2.FadService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
462
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ValidateRfcComponent, selector: "ng-fad-signature-fea-validate-rfc", inputs: { requisitionId: "requisitionId", signerId: "signerId", configuration: "configuration" }, outputs: { onerror: "onerror", oncomplete: "oncomplete", onloader: "onloader" }, ngImport: i0, template: "\r\n <div class=\"validation-container fad-container\" *ngIf=\"showComponent\">\r\n <div class=\"title\">{{ configuration.customization?.moduleCustomization?.legends?.title }}</div>\r\n <div class=\"fad-portal-subtitle\">{{ configuration.customization?.moduleCustomization?.legends?.description }}</div>\r\n <form [formGroup]=\"validationForm\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"fad-portal-container-input\">\r\n <input id=\"code\" type=\"text\" formControlName=\"code\" (input)=\"onInputChange($event)\" maxlength=\"{{ configuration.maxCharacters || 13 }}\" />\r\n </div>\r\n <ng-fad-portal-shared-form-errors \r\n [formData]=\"codeControl!\" \r\n [configuration]=\"configuration.formErrors?.configuration!\">\r\n </ng-fad-portal-shared-form-errors>\r\n \r\n <button type=\"submit\" class=\"fad-portal-primary\" [disabled]=\"validationForm.invalid\">\r\n {{ configuration.customization?.moduleCustomization?.legends?.buttonLegend }}\r\n </button>\r\n </form>\r\n </div>\r\n\r\n\r\n", styles: [".validation-container{width:100%;display:flex;flex-direction:column;align-items:start;row-gap:var(--fad-portal-common-separation-md)}@media (max-width: 992px){.validation-container{width:100%;align-items:center}}.validation-container .title{font-family:var(--fad-portal-common-title-font-family);font-size:var(--fad-portal-common-title-font-size)}.validation-container form{display:flex;flex-direction:column;width:100%}.validation-container form .fad-portal-container-input{display:flex;flex-direction:column;row-gap:var(--fad-portal-common-separation-xs)}.validation-container form .error-message{color:var(--fad-portal-common-error-color)}.validation-container form button{margin-top:var(--fad-portal-common-separation-md);cursor:pointer}.validation-container form button:disabled{cursor:auto}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i5.FormErrorsComponent, selector: "ng-fad-portal-shared-form-errors", inputs: ["configuration", "formData"], outputs: ["onerror"] }] }); }
|
|
463
|
+
}
|
|
464
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ValidateRfcComponent, decorators: [{
|
|
465
|
+
type: Component,
|
|
466
|
+
args: [{ selector: 'ng-fad-signature-fea-validate-rfc', template: "\r\n <div class=\"validation-container fad-container\" *ngIf=\"showComponent\">\r\n <div class=\"title\">{{ configuration.customization?.moduleCustomization?.legends?.title }}</div>\r\n <div class=\"fad-portal-subtitle\">{{ configuration.customization?.moduleCustomization?.legends?.description }}</div>\r\n <form [formGroup]=\"validationForm\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"fad-portal-container-input\">\r\n <input id=\"code\" type=\"text\" formControlName=\"code\" (input)=\"onInputChange($event)\" maxlength=\"{{ configuration.maxCharacters || 13 }}\" />\r\n </div>\r\n <ng-fad-portal-shared-form-errors \r\n [formData]=\"codeControl!\" \r\n [configuration]=\"configuration.formErrors?.configuration!\">\r\n </ng-fad-portal-shared-form-errors>\r\n \r\n <button type=\"submit\" class=\"fad-portal-primary\" [disabled]=\"validationForm.invalid\">\r\n {{ configuration.customization?.moduleCustomization?.legends?.buttonLegend }}\r\n </button>\r\n </form>\r\n </div>\r\n\r\n\r\n", styles: [".validation-container{width:100%;display:flex;flex-direction:column;align-items:start;row-gap:var(--fad-portal-common-separation-md)}@media (max-width: 992px){.validation-container{width:100%;align-items:center}}.validation-container .title{font-family:var(--fad-portal-common-title-font-family);font-size:var(--fad-portal-common-title-font-size)}.validation-container form{display:flex;flex-direction:column;width:100%}.validation-container form .fad-portal-container-input{display:flex;flex-direction:column;row-gap:var(--fad-portal-common-separation-xs)}.validation-container form .error-message{color:var(--fad-portal-common-error-color)}.validation-container form button{margin-top:var(--fad-portal-common-separation-md);cursor:pointer}.validation-container form button:disabled{cursor:auto}\n"] }]
|
|
467
|
+
}], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: i0.ElementRef }, { type: i2$1.ActivatedRoute }, { type: i2$2.FadService }]; }, propDecorators: { requisitionId: [{
|
|
468
|
+
type: Input
|
|
469
|
+
}], signerId: [{
|
|
470
|
+
type: Input
|
|
471
|
+
}], configuration: [{
|
|
472
|
+
type: Input
|
|
473
|
+
}], onerror: [{
|
|
474
|
+
type: Output
|
|
475
|
+
}], oncomplete: [{
|
|
476
|
+
type: Output
|
|
477
|
+
}], onloader: [{
|
|
478
|
+
type: Output
|
|
479
|
+
}] } });
|
|
480
|
+
|
|
481
|
+
class DocumentApprovalListComponent {
|
|
482
|
+
constructor(hostContext, fad, cdr, pdfService) {
|
|
483
|
+
this.hostContext = hostContext;
|
|
484
|
+
this.fad = fad;
|
|
485
|
+
this.cdr = cdr;
|
|
486
|
+
this.pdfService = pdfService;
|
|
487
|
+
this.onloader = new EventEmitter();
|
|
488
|
+
this.onevent = new EventEmitter();
|
|
489
|
+
this.onerror = new EventEmitter();
|
|
490
|
+
this.pagesMap = new Map();
|
|
491
|
+
this.requisitionsFea = [];
|
|
492
|
+
this.documentsApprovalList = [];
|
|
493
|
+
this.approveAll = false;
|
|
494
|
+
this.images = {
|
|
495
|
+
inactive: {
|
|
496
|
+
reject: '',
|
|
497
|
+
approve: ''
|
|
498
|
+
},
|
|
499
|
+
active: {
|
|
500
|
+
reject: '',
|
|
501
|
+
approve: ''
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
ngOnInit() {
|
|
506
|
+
console.log(this.configuration, this.rfc);
|
|
507
|
+
this.setCustomizationStyle(this.hostContext.nativeElement);
|
|
508
|
+
if (this.configuration?.pathDependencies?.imageDirectory) {
|
|
509
|
+
this.images.inactive.reject = this.configuration.pathDependencies?.images?.inactiveReject ?? `${this.configuration.pathDependencies.imageDirectory}/inactiveReject.png`;
|
|
510
|
+
this.images.inactive.approve = this.configuration.pathDependencies?.images?.inactiveApprove ?? `${this.configuration.pathDependencies.imageDirectory}/inactiveApprove.png`;
|
|
511
|
+
this.images.active.reject = this.configuration.pathDependencies?.images?.activeReject ?? `${this.configuration.pathDependencies.imageDirectory}/activeReject.png`;
|
|
512
|
+
this.images.active.approve = this.configuration.pathDependencies?.images?.activeApprove ?? `${this.configuration.pathDependencies.imageDirectory}/activeApprove.png`;
|
|
513
|
+
this.cdr.detectChanges();
|
|
514
|
+
}
|
|
515
|
+
this.getRequisitionsRfc();
|
|
516
|
+
}
|
|
517
|
+
getRequisitionsRfc() {
|
|
518
|
+
this.onloader.emit(true);
|
|
519
|
+
this.fad.getRequisitionsRfc(this.rfc)
|
|
520
|
+
.pipe(finalize(() => this.onloader.emit(false)))
|
|
521
|
+
.subscribe({
|
|
522
|
+
next: (res) => {
|
|
523
|
+
if (res.success) {
|
|
524
|
+
this.requisitionsFea = res.data.requisitions;
|
|
525
|
+
this.documentsApprovalList = this.requisitionsFea.flatMap(requisition => requisition.documents.map(doc => ({
|
|
526
|
+
doc: doc,
|
|
527
|
+
id: doc.documentId,
|
|
528
|
+
idRequisition: requisition.requisitionId,
|
|
529
|
+
approved: undefined,
|
|
530
|
+
isVisible: false
|
|
531
|
+
})));
|
|
532
|
+
if (this.documentsApprovalList.length === 1) {
|
|
533
|
+
this.loadSingleDocument(this.documentsApprovalList[0]);
|
|
534
|
+
}
|
|
535
|
+
this.cdr.detectChanges();
|
|
536
|
+
}
|
|
537
|
+
else {
|
|
538
|
+
this.onerror.emit(new ResponseError(DocumentApprovalListErrorCode.SERVICE, getDocumentApprovalListErrorDescription(DocumentApprovalListErrorCode.SERVICE), 'ng-fad-portal-signature-fea-document-approval-list'));
|
|
539
|
+
}
|
|
540
|
+
},
|
|
541
|
+
error: (error) => {
|
|
542
|
+
this.onerror.emit(new ResponseError(DocumentApprovalListErrorCode.HTTP, getDocumentApprovalListErrorDescription(DocumentApprovalListErrorCode.HTTP), 'ng-fad-portal-signature-fea-document-approval-list'));
|
|
543
|
+
}
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
loadSingleDocument(singleDocument) {
|
|
547
|
+
singleDocument.isVisible = true;
|
|
548
|
+
this.fad.getDocumentFea(singleDocument.id, { loader: true, error: true })
|
|
549
|
+
.pipe(finalize(() => this.onloader.emit(false)))
|
|
550
|
+
.subscribe({
|
|
551
|
+
next: (res) => {
|
|
552
|
+
if (singleDocument.doc) {
|
|
553
|
+
singleDocument.doc.file = "data:application/pdf;base64," + res.data.file;
|
|
554
|
+
this.cdr.detectChanges();
|
|
555
|
+
}
|
|
556
|
+
},
|
|
557
|
+
error: () => {
|
|
558
|
+
this.onerror.emit(new ResponseError(DocumentApprovalListErrorCode.ERROR_PDF, getDocumentApprovalListErrorDescription(DocumentApprovalListErrorCode.ERROR_PDF), 'ng-fad-portal-signature-fea-document-approval-list'));
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
toggleApproval(document) {
|
|
563
|
+
document.approved = document.approved === true ? undefined : true;
|
|
564
|
+
this.updateApproveAllState();
|
|
565
|
+
}
|
|
566
|
+
toggleRejection(document) {
|
|
567
|
+
document.approved = document.approved === false ? undefined : false;
|
|
568
|
+
this.updateApproveAllState();
|
|
569
|
+
}
|
|
570
|
+
updateApproveAllState() {
|
|
571
|
+
this.approveAll = this.documentsApprovalList.every(doc => doc.approved === true);
|
|
572
|
+
}
|
|
573
|
+
approveAllDocuments() {
|
|
574
|
+
this.approveAll = !this.approveAll;
|
|
575
|
+
this.documentsApprovalList.forEach(doc => doc.approved = this.approveAll ? true : undefined);
|
|
576
|
+
}
|
|
577
|
+
getApprovedCount() {
|
|
578
|
+
return this.documentsApprovalList.filter(doc => doc.approved === true).length;
|
|
579
|
+
}
|
|
580
|
+
getRejectedCount() {
|
|
581
|
+
return this.documentsApprovalList.filter(doc => doc.approved === false).length;
|
|
582
|
+
}
|
|
583
|
+
emitApprovedDocuments() {
|
|
584
|
+
const approvedDocuments = this.documentsApprovalList.filter(doc => doc.approved !== undefined);
|
|
585
|
+
console.log(approvedDocuments);
|
|
586
|
+
this.onevent.emit(approvedDocuments);
|
|
587
|
+
}
|
|
588
|
+
seeDocumentFea(document) {
|
|
589
|
+
document.isVisible = !document.isVisible;
|
|
590
|
+
if (document.isVisible && !document.doc?.file) {
|
|
591
|
+
this.onloader.emit(true);
|
|
592
|
+
this.fad.getDocumentFea(document.id, { loader: true, error: true })
|
|
593
|
+
.pipe(finalize(() => this.onloader.emit(false)))
|
|
594
|
+
.subscribe({
|
|
595
|
+
next: (res) => {
|
|
596
|
+
if (document.doc) {
|
|
597
|
+
document.doc.file = "data:application/pdf;base64," + res.data.file;
|
|
598
|
+
}
|
|
599
|
+
else {
|
|
600
|
+
this.onerror.emit(new ResponseError(DocumentApprovalListErrorCode.SERVICE, getDocumentApprovalListErrorDescription(DocumentApprovalListErrorCode.SERVICE), 'ng-fad-portal-signature-fea-document-approval-list'));
|
|
601
|
+
}
|
|
602
|
+
},
|
|
603
|
+
error: () => {
|
|
604
|
+
this.onerror.emit(new ResponseError(DocumentApprovalListErrorCode.HTTP, getDocumentApprovalListErrorDescription(DocumentApprovalListErrorCode.HTTP), 'ng-fad-portal-signature-fea-document-approval-list'));
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
downloadDocumentFea(document) {
|
|
610
|
+
this.onloader.emit(true);
|
|
611
|
+
this.fad.getDocumentFea(document.id)
|
|
612
|
+
.pipe(finalize(() => this.onloader.emit(false)))
|
|
613
|
+
.subscribe({
|
|
614
|
+
next: async (res) => {
|
|
615
|
+
if (res.success && res.data.file) {
|
|
616
|
+
const byteCharacters = atob(res.data.file);
|
|
617
|
+
const byteNumbers = new Array(byteCharacters.length).fill(0).map((_, i) => byteCharacters.charCodeAt(i));
|
|
618
|
+
const byteArray = new Uint8Array(byteNumbers);
|
|
619
|
+
const blob = new Blob([byteArray], { type: 'application/pdf' });
|
|
620
|
+
await SharedUtils.downloadFile(blob, document.doc?.name).then(res => {
|
|
621
|
+
}).catch(error => {
|
|
622
|
+
this.onerror.emit(new ResponseError(DocumentApprovalListErrorCode.ERROR_PDF, getDocumentApprovalListErrorDescription(DocumentApprovalListErrorCode.ERROR_PDF), 'ng-fad-portal-signature-fea-document-approval-list'));
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
else {
|
|
626
|
+
this.onerror.emit(new ResponseError(DocumentApprovalListErrorCode.SERVICE, getDocumentApprovalListErrorDescription(DocumentApprovalListErrorCode.SERVICE), 'ng-fad-portal-signature-fea-document-approval-list'));
|
|
627
|
+
}
|
|
628
|
+
},
|
|
629
|
+
error: (error) => {
|
|
630
|
+
this.onerror.emit(new ResponseError(DocumentApprovalListErrorCode.HTTP, getDocumentApprovalListErrorDescription(DocumentApprovalListErrorCode.HTTP), 'ng-fad-portal-signature-fea-document-approval-list'));
|
|
631
|
+
}
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
getDocumentId(id) {
|
|
635
|
+
return "pdf" + id.replace(/-/g, '');
|
|
636
|
+
}
|
|
637
|
+
setCustomizationStyle(targetElement = document.documentElement) {
|
|
638
|
+
this.configuration = Utils.mergeConfiguration(new Configuration(), DOCUMENT_APPROVAL_LIST_DEFAULT, this.configuration);
|
|
639
|
+
}
|
|
640
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DocumentApprovalListComponent, deps: [{ token: i0.ElementRef }, { token: i2$2.FadService }, { token: i0.ChangeDetectorRef }, { token: i1.NgFadPdfReaderService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
641
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DocumentApprovalListComponent, selector: "ng-fad-signature-fea-document-approval-list", inputs: { configuration: "configuration", rfc: "rfc" }, outputs: { onloader: "onloader", onevent: "onevent", onerror: "onerror" }, providers: [NgFadPdfReaderService], ngImport: i0, template: "\n <ng-container *ngFor=\"let requisition of requisitionsFea\">\n <div class=\"fad-portal-content\" >\n <div class=\"header\" >\n <div>\n <div class=\"fad-portal-title\">\n {{ requisition.name }} ({{requisition.documents.length}})\n </div>\n <div class=\"info\">\n {{configuration.customization?.moduleCustomization?.legends?.sendTo}} Alfredo Villanueva {{ requisition.sendBy }}\n </div>\n <div class=\"info\">\n {{ requisition.sendByEmail }}\n </div>\n </div>\n <div class=\"requisition-id\">\n <div class=\"fad-portal-content-bold\">ID {{ requisition.requisitionId }}</div>\n </div>\n </div>\n <div class=\"documents-container\">\n <ng-container *ngFor=\"let document of documentsApprovalList; let i = index\">\n <ng-container *ngIf=\"document.idRequisition === requisition.requisitionId\" >\n <div class=\"document\" >\n <div class=\"information\" >\n <div class=\"document-name fad-portal-content-bold\" >\n {{ document.doc?.name }}\n </div>\n <div class=\"validate\">\n \n <ng-fad-image-inline \n [src]=\"document.approved === false ? images.active.reject : images.inactive.reject\"\n (click)=\"toggleRejection(document)\">\n </ng-fad-image-inline>\n \n \n <ng-fad-image-inline \n [src]=\"document.approved === true ? images.active.approve : images.inactive.approve\"\n (click)=\"toggleApproval(document)\">\n </ng-fad-image-inline>\n </div>\n \n </div>\n <div class=\"actions\">\n <div>\n <div class=\"fad-portal-content-bold\" (click)=\"seeDocumentFea(document)\">\n {{ document.isVisible ? 'Ocultar documento' : 'Ver documento' }}\n </div>\n <div class=\"fad-portal-content-bold\" (click)=\"downloadDocumentFea(document)\">{{configuration.customization?.moduleCustomization?.legends?.download}}</div>\n </div>\n <div>\n {{ document.doc?.pages }} {{configuration.customization?.moduleCustomization?.legends?.pages}}\n </div>\n </div>\n \n <ng-fad-signature-fea-pdf-viewer-fea\n *ngIf=\"document.isVisible && document.doc?.file\"\n [file]=\"document.doc?.file\"\n [index]=\"i\"\n [id]=\"getDocumentId(document.id!)\"\n >\n </ng-fad-signature-fea-pdf-viewer-fea>\n \n </div>\n </ng-container>\n </ng-container>\n \n </div>\n \n </div>\n </ng-container>\n <div class=\"fad-portal-content selector-document\">\n <div class=\"document-status-bar\">\n \n <div *ngIf=\"getApprovedCount() === 0 && getRejectedCount() === 0\" class=\"document-status-message \">\n Aprueba los documentos para firmarlos con tu e.firma\n </div>\n \n \n <div *ngIf=\"getApprovedCount() > 0 || getRejectedCount() > 0\" class=\"document-status-content\">\n <div class=\"approve-all\">\n <ng-fad-image-inline \n [src]=\"approveAll ? images.active.approve : images.inactive.approve\"\n (click)=\"approveAllDocuments()\">\n </ng-fad-image-inline>\n <span (click)=\"approveAllDocuments()\">Aprobar todos los documentos ({{ documentsApprovalList.length }})</span>\n </div>\n \n \n <div class=\"document-counts\">\n <span *ngIf=\"getApprovedCount() > 0 && getRejectedCount() === 0\" class=\"fad-portal-informative-bold\">\n {{ getApprovedCount() }} documentos aprobados\n </span>\n <span *ngIf=\"getRejectedCount() > 0 && getApprovedCount() === 0\" class=\"fad-portal-informative-bold\">\n {{ getRejectedCount() }} documentos rechazados\n </span>\n \n <ng-container *ngIf=\"getApprovedCount() > 0 && getRejectedCount() > 0\" >\n <span class=\"fad-portal-informative-bold\">\n {{ getApprovedCount() }} documentos aprobados\n </span>\n <span class=\"fad-portal-informative-bold\">\n {{ getRejectedCount() }} documentos rechazados\n </span>\n </ng-container>\n </div>\n \n \n <button class=\"fad-portal-primary\" (click)=\"emitApprovedDocuments()\">Continuar</button>\n </div>\n </div>\n </div>\n \n\n", styles: [":host{box-sizing:border-box}:host .fad-portal-content{display:flex;flex-direction:column;justify-content:center;width:100%;box-sizing:border-box;margin-top:var(--fad-portal-common-separation-lg)}:host .fad-portal-content .header{display:flex;align-items:center;justify-content:space-between;width:100%;background-color:#f5f5f5;border-radius:var(--fad-portal-common-input-border-radius);padding:var(--fad-portal-common-separation-md);overflow:hidden;box-sizing:border-box}:host .fad-portal-content .header div:nth-child(1){display:flex;flex-direction:column;row-gap:var(--fad-portal-common-separation-xs)}:host .fad-portal-content .header .info{color:var(--fad-portal-common-tertiary-color)}@media (max-width: 992px){:host .fad-portal-content .header{flex-direction:column;align-items:start;justify-content:center;row-gap:var(--fad-portal-common-separation-xs);margin-bottom:var(--fad-portal-common-separation-md)}}:host .fad-portal-content .documents-container{box-sizing:border-box}:host .fad-portal-content .documents-container .document{display:flex;align-items:center;flex-direction:column;width:100%;margin-top:var(--fad-portal-common-separation-md);border-radius:var(--fad-portal-common-input-border-radius);border:1px solid #f5f5f5}:host .fad-portal-content .documents-container .document .information{padding:var(--fad-portal-common-separation-md);display:flex;align-items:center;justify-content:space-between;width:100%}:host .fad-portal-content .documents-container .document .information .validate{padding-left:var(--fad-portal-common-separation-md);padding-right:var(--fad-portal-common-separation-md);display:flex;column-gap:var(--fad-portal-common-separation-md)}:host .fad-portal-content .documents-container .document .information .document-name{padding-left:var(--fad-portal-common-separation-md);padding-right:var(--fad-portal-common-separation-md)}:host .fad-portal-content .documents-container .document .actions{display:flex;align-items:center;justify-content:space-between;width:100%;background-color:#f5f5f5;padding:var(--fad-portal-common-separation-md);box-sizing:border-box;border-radius:var(--fad-portal-common-input-border-radius);border-top-left-radius:0;border-top-right-radius:0}:host .fad-portal-content .documents-container .document .actions div:nth-child(1){display:flex;align-items:center;gap:var(--fad-portal-common-separation-md)}:host .fad-portal-content .documents-container .document .actions div:nth-child(1) div{color:var(--fad-portal-common-primary-color)!important;cursor:pointer}:host .selector-document{width:100%;background-color:var(--fad-portal-common-tertiary-color);color:#fff;padding:var(--fad-portal-common-separation-md);margin-top:var(--fad-portal-common-separation-md);display:flex;align-items:center;justify-content:space-between;border-radius:var(--fad-portal-common-input-border-radius);box-sizing:border-box}:host .selector-document .document-status-message{display:flex;align-items:center;justify-content:center;width:100%;gap:var(--fad-portal-common-separation-md)}:host .selector-document .document-status-bar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;width:100%;font-size:14px;box-sizing:border-box}:host .selector-document .document-status-bar .document-status-content{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;width:100%;font-size:14px;box-sizing:border-box}:host .selector-document .document-status-bar .approve-all{display:flex;align-items:center;gap:10px;cursor:pointer;box-sizing:border-box}:host .selector-document .document-status-bar .approve-all span{cursor:pointer;-webkit-user-select:none;user-select:none}:host .selector-document .document-status-bar .document-counts{display:flex;flex-direction:column;gap:var(--fad-portal-common-separation-xs);box-sizing:border-box}:host .selector-document .document-status-bar .document-counts span{color:#fff}:host .selector-document .document-status-bar .fad-portal-primary{min-width:0px;width:50%}@media (max-width: 992px){:host .selector-document .document-status-bar .fad-portal-primary{width:100%;margin-top:var(--fad-portal-common-separation-md)}}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.NgFadImageInlineComponent, selector: "ng-fad-image-inline", inputs: ["src"] }, { kind: "component", type: PdfViewerFeaComponent, selector: "ng-fad-signature-fea-pdf-viewer-fea", inputs: ["configuration", "file", "index", "id"] }] }); }
|
|
642
|
+
}
|
|
643
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DocumentApprovalListComponent, decorators: [{
|
|
644
|
+
type: Component,
|
|
645
|
+
args: [{ selector: 'ng-fad-signature-fea-document-approval-list', providers: [NgFadPdfReaderService], template: "\n <ng-container *ngFor=\"let requisition of requisitionsFea\">\n <div class=\"fad-portal-content\" >\n <div class=\"header\" >\n <div>\n <div class=\"fad-portal-title\">\n {{ requisition.name }} ({{requisition.documents.length}})\n </div>\n <div class=\"info\">\n {{configuration.customization?.moduleCustomization?.legends?.sendTo}} Alfredo Villanueva {{ requisition.sendBy }}\n </div>\n <div class=\"info\">\n {{ requisition.sendByEmail }}\n </div>\n </div>\n <div class=\"requisition-id\">\n <div class=\"fad-portal-content-bold\">ID {{ requisition.requisitionId }}</div>\n </div>\n </div>\n <div class=\"documents-container\">\n <ng-container *ngFor=\"let document of documentsApprovalList; let i = index\">\n <ng-container *ngIf=\"document.idRequisition === requisition.requisitionId\" >\n <div class=\"document\" >\n <div class=\"information\" >\n <div class=\"document-name fad-portal-content-bold\" >\n {{ document.doc?.name }}\n </div>\n <div class=\"validate\">\n \n <ng-fad-image-inline \n [src]=\"document.approved === false ? images.active.reject : images.inactive.reject\"\n (click)=\"toggleRejection(document)\">\n </ng-fad-image-inline>\n \n \n <ng-fad-image-inline \n [src]=\"document.approved === true ? images.active.approve : images.inactive.approve\"\n (click)=\"toggleApproval(document)\">\n </ng-fad-image-inline>\n </div>\n \n </div>\n <div class=\"actions\">\n <div>\n <div class=\"fad-portal-content-bold\" (click)=\"seeDocumentFea(document)\">\n {{ document.isVisible ? 'Ocultar documento' : 'Ver documento' }}\n </div>\n <div class=\"fad-portal-content-bold\" (click)=\"downloadDocumentFea(document)\">{{configuration.customization?.moduleCustomization?.legends?.download}}</div>\n </div>\n <div>\n {{ document.doc?.pages }} {{configuration.customization?.moduleCustomization?.legends?.pages}}\n </div>\n </div>\n \n <ng-fad-signature-fea-pdf-viewer-fea\n *ngIf=\"document.isVisible && document.doc?.file\"\n [file]=\"document.doc?.file\"\n [index]=\"i\"\n [id]=\"getDocumentId(document.id!)\"\n >\n </ng-fad-signature-fea-pdf-viewer-fea>\n \n </div>\n </ng-container>\n </ng-container>\n \n </div>\n \n </div>\n </ng-container>\n <div class=\"fad-portal-content selector-document\">\n <div class=\"document-status-bar\">\n \n <div *ngIf=\"getApprovedCount() === 0 && getRejectedCount() === 0\" class=\"document-status-message \">\n Aprueba los documentos para firmarlos con tu e.firma\n </div>\n \n \n <div *ngIf=\"getApprovedCount() > 0 || getRejectedCount() > 0\" class=\"document-status-content\">\n <div class=\"approve-all\">\n <ng-fad-image-inline \n [src]=\"approveAll ? images.active.approve : images.inactive.approve\"\n (click)=\"approveAllDocuments()\">\n </ng-fad-image-inline>\n <span (click)=\"approveAllDocuments()\">Aprobar todos los documentos ({{ documentsApprovalList.length }})</span>\n </div>\n \n \n <div class=\"document-counts\">\n <span *ngIf=\"getApprovedCount() > 0 && getRejectedCount() === 0\" class=\"fad-portal-informative-bold\">\n {{ getApprovedCount() }} documentos aprobados\n </span>\n <span *ngIf=\"getRejectedCount() > 0 && getApprovedCount() === 0\" class=\"fad-portal-informative-bold\">\n {{ getRejectedCount() }} documentos rechazados\n </span>\n \n <ng-container *ngIf=\"getApprovedCount() > 0 && getRejectedCount() > 0\" >\n <span class=\"fad-portal-informative-bold\">\n {{ getApprovedCount() }} documentos aprobados\n </span>\n <span class=\"fad-portal-informative-bold\">\n {{ getRejectedCount() }} documentos rechazados\n </span>\n </ng-container>\n </div>\n \n \n <button class=\"fad-portal-primary\" (click)=\"emitApprovedDocuments()\">Continuar</button>\n </div>\n </div>\n </div>\n \n\n", styles: [":host{box-sizing:border-box}:host .fad-portal-content{display:flex;flex-direction:column;justify-content:center;width:100%;box-sizing:border-box;margin-top:var(--fad-portal-common-separation-lg)}:host .fad-portal-content .header{display:flex;align-items:center;justify-content:space-between;width:100%;background-color:#f5f5f5;border-radius:var(--fad-portal-common-input-border-radius);padding:var(--fad-portal-common-separation-md);overflow:hidden;box-sizing:border-box}:host .fad-portal-content .header div:nth-child(1){display:flex;flex-direction:column;row-gap:var(--fad-portal-common-separation-xs)}:host .fad-portal-content .header .info{color:var(--fad-portal-common-tertiary-color)}@media (max-width: 992px){:host .fad-portal-content .header{flex-direction:column;align-items:start;justify-content:center;row-gap:var(--fad-portal-common-separation-xs);margin-bottom:var(--fad-portal-common-separation-md)}}:host .fad-portal-content .documents-container{box-sizing:border-box}:host .fad-portal-content .documents-container .document{display:flex;align-items:center;flex-direction:column;width:100%;margin-top:var(--fad-portal-common-separation-md);border-radius:var(--fad-portal-common-input-border-radius);border:1px solid #f5f5f5}:host .fad-portal-content .documents-container .document .information{padding:var(--fad-portal-common-separation-md);display:flex;align-items:center;justify-content:space-between;width:100%}:host .fad-portal-content .documents-container .document .information .validate{padding-left:var(--fad-portal-common-separation-md);padding-right:var(--fad-portal-common-separation-md);display:flex;column-gap:var(--fad-portal-common-separation-md)}:host .fad-portal-content .documents-container .document .information .document-name{padding-left:var(--fad-portal-common-separation-md);padding-right:var(--fad-portal-common-separation-md)}:host .fad-portal-content .documents-container .document .actions{display:flex;align-items:center;justify-content:space-between;width:100%;background-color:#f5f5f5;padding:var(--fad-portal-common-separation-md);box-sizing:border-box;border-radius:var(--fad-portal-common-input-border-radius);border-top-left-radius:0;border-top-right-radius:0}:host .fad-portal-content .documents-container .document .actions div:nth-child(1){display:flex;align-items:center;gap:var(--fad-portal-common-separation-md)}:host .fad-portal-content .documents-container .document .actions div:nth-child(1) div{color:var(--fad-portal-common-primary-color)!important;cursor:pointer}:host .selector-document{width:100%;background-color:var(--fad-portal-common-tertiary-color);color:#fff;padding:var(--fad-portal-common-separation-md);margin-top:var(--fad-portal-common-separation-md);display:flex;align-items:center;justify-content:space-between;border-radius:var(--fad-portal-common-input-border-radius);box-sizing:border-box}:host .selector-document .document-status-message{display:flex;align-items:center;justify-content:center;width:100%;gap:var(--fad-portal-common-separation-md)}:host .selector-document .document-status-bar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;width:100%;font-size:14px;box-sizing:border-box}:host .selector-document .document-status-bar .document-status-content{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;width:100%;font-size:14px;box-sizing:border-box}:host .selector-document .document-status-bar .approve-all{display:flex;align-items:center;gap:10px;cursor:pointer;box-sizing:border-box}:host .selector-document .document-status-bar .approve-all span{cursor:pointer;-webkit-user-select:none;user-select:none}:host .selector-document .document-status-bar .document-counts{display:flex;flex-direction:column;gap:var(--fad-portal-common-separation-xs);box-sizing:border-box}:host .selector-document .document-status-bar .document-counts span{color:#fff}:host .selector-document .document-status-bar .fad-portal-primary{min-width:0px;width:50%}@media (max-width: 992px){:host .selector-document .document-status-bar .fad-portal-primary{width:100%;margin-top:var(--fad-portal-common-separation-md)}}\n"] }]
|
|
646
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i2$2.FadService }, { type: i0.ChangeDetectorRef }, { type: i1.NgFadPdfReaderService }]; }, propDecorators: { configuration: [{
|
|
647
|
+
type: Input
|
|
648
|
+
}], rfc: [{
|
|
649
|
+
type: Input
|
|
650
|
+
}], onloader: [{
|
|
651
|
+
type: Output
|
|
652
|
+
}], onevent: [{
|
|
653
|
+
type: Output
|
|
654
|
+
}], onerror: [{
|
|
655
|
+
type: Output
|
|
656
|
+
}] } });
|
|
657
|
+
|
|
658
|
+
class UploadESignatureComponent {
|
|
659
|
+
constructor(hostContext, fb, fad, mifiel) {
|
|
660
|
+
this.hostContext = hostContext;
|
|
661
|
+
this.fb = fb;
|
|
662
|
+
this.fad = fad;
|
|
663
|
+
this.mifiel = mifiel;
|
|
664
|
+
this.documents = [];
|
|
665
|
+
this.onerror = new EventEmitter();
|
|
666
|
+
this.onloader = new EventEmitter();
|
|
667
|
+
this.oncomplete = new EventEmitter();
|
|
668
|
+
this.formatCerList = ['cer'];
|
|
669
|
+
this.formatKeyList = ['key'];
|
|
670
|
+
this.passwordInputType = 'password';
|
|
671
|
+
this.isValidated = false;
|
|
672
|
+
this.showComponent = true;
|
|
673
|
+
}
|
|
674
|
+
ngOnInit() {
|
|
675
|
+
this.setCustomizationStyle(this.hostContext.nativeElement);
|
|
676
|
+
this.uploadImg = this.configuration.pathDependencies?.images?.upload || `${this.configuration.pathDependencies?.imageDirectory}upload.svg`;
|
|
677
|
+
this.checkOnImg = this.configuration.pathDependencies?.images?.checkOn || `${this.configuration.pathDependencies?.imageDirectory}check-on.svg`;
|
|
678
|
+
this.checkOffImg = this.configuration.pathDependencies?.images?.checkOff || `${this.configuration.pathDependencies?.imageDirectory}check-off.svg`;
|
|
679
|
+
this.fileImg = this.configuration.pathDependencies?.images?.file || `${this.configuration.pathDependencies?.imageDirectory}file.svg`;
|
|
680
|
+
this.showComponent = this.validateData();
|
|
681
|
+
if (this.showComponent) {
|
|
682
|
+
this.documentPluralTitle = this.configuration.customization?.moduleCustomization?.legends?.documents?.title?.plural?.replace('#TOTAL_DOCS', this.documents?.length.toString()); // poner longitud
|
|
683
|
+
if (this.documents?.length === 1) {
|
|
684
|
+
const status = this.documents[0].approved ? this.configuration.customization?.moduleCustomization?.legends?.documents?.title?.approved : this.configuration.customization?.moduleCustomization?.legends?.documents?.title?.rejected;
|
|
685
|
+
this.documentSingularTitle = this.configuration.customization?.moduleCustomization?.legends?.documents?.title?.singular?.replace('#STATUS_DOC', status); // poner longitud
|
|
686
|
+
}
|
|
687
|
+
this.initForm();
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
validateData() {
|
|
691
|
+
if (!this.documents || this.documents.length < 1) {
|
|
692
|
+
this.onerror.emit(new ResponseError(UploadESignatureErrorCode.NO_DOCUMENTS, getUploadESignatureErrorDescription(UploadESignatureErrorCode.NO_DOCUMENTS), 'ng-fad-signature-fea-upload-e-signature'));
|
|
693
|
+
return false;
|
|
694
|
+
}
|
|
695
|
+
if (!this.signerId) {
|
|
696
|
+
this.onerror.emit(new ResponseError(UploadESignatureErrorCode.NO_SIGNER_ID, getUploadESignatureErrorDescription(UploadESignatureErrorCode.NO_SIGNER_ID), 'ng-fad-signature-fea-upload-e-signature'));
|
|
697
|
+
return false;
|
|
698
|
+
}
|
|
699
|
+
if (!this.rfc) {
|
|
700
|
+
this.onerror.emit(new ResponseError(UploadESignatureErrorCode.NO_RFC, getUploadESignatureErrorDescription(UploadESignatureErrorCode.NO_RFC), 'ng-fad-signature-fea-upload-e-signature'));
|
|
701
|
+
return false;
|
|
702
|
+
}
|
|
703
|
+
return true;
|
|
704
|
+
}
|
|
705
|
+
initForm() {
|
|
706
|
+
this.form = this.fb.group({
|
|
707
|
+
cer: [null, [Validators.required]],
|
|
708
|
+
key: [null, [Validators.required]],
|
|
709
|
+
password: [null, [Validators.required]]
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
get cer() {
|
|
713
|
+
return this.form.get('cer');
|
|
714
|
+
}
|
|
715
|
+
get key() {
|
|
716
|
+
return this.form.get('key');
|
|
717
|
+
}
|
|
718
|
+
get password() {
|
|
719
|
+
return this.form.get('password');
|
|
720
|
+
}
|
|
721
|
+
openFilePicker(fileInput) {
|
|
722
|
+
fileInput.click();
|
|
723
|
+
}
|
|
724
|
+
onFileChange(event, type) {
|
|
725
|
+
const file = event.target.files[0];
|
|
726
|
+
if (!file)
|
|
727
|
+
return;
|
|
728
|
+
if (event.target.files.length > 1) {
|
|
729
|
+
this.onerror.emit(new ResponseError(UploadESignatureErrorCode.MULTIPLE_FILES, getUploadESignatureErrorDescription(UploadESignatureErrorCode.MULTIPLE_FILES), 'ng-fad-signature-fea-upload-e-signature'));
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
if (type === 'cer' && !/\.cer$/.test(file.name)) {
|
|
733
|
+
this.onerror.emit(new ResponseError(UploadESignatureErrorCode.FORMAT_CER, getUploadESignatureErrorDescription(UploadESignatureErrorCode.FORMAT_CER), 'ng-fad-signature-fea-upload-e-signature'));
|
|
734
|
+
return;
|
|
735
|
+
}
|
|
736
|
+
if (type === 'key' && !/\.key$/.test(file.name)) {
|
|
737
|
+
this.onerror.emit(new ResponseError(UploadESignatureErrorCode.FORMAT_KEY, getUploadESignatureErrorDescription(UploadESignatureErrorCode.FORMAT_KEY), 'ng-fad-signature-fea-upload-e-signature'));
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
type === 'cer' ? this.cer?.setValue(file) : this.key?.setValue(file);
|
|
741
|
+
}
|
|
742
|
+
onfiledropped(files, type) {
|
|
743
|
+
const file = files[0];
|
|
744
|
+
type === 'cer' ? this.cer?.setValue(file) : this.key?.setValue(file);
|
|
745
|
+
}
|
|
746
|
+
onerrorDirective(event, type) {
|
|
747
|
+
if (event.code === -1)
|
|
748
|
+
this.onerror.emit(new ResponseError(UploadESignatureErrorCode.MULTIPLE_FILES, getUploadESignatureErrorDescription(UploadESignatureErrorCode.MULTIPLE_FILES), 'ng-fad-signature-fea-upload-e-signature'));
|
|
749
|
+
if (event.code === -2 && type === 'cer')
|
|
750
|
+
this.onerror.emit(new ResponseError(UploadESignatureErrorCode.FORMAT_CER, getUploadESignatureErrorDescription(UploadESignatureErrorCode.FORMAT_CER), 'ng-fad-signature-fea-upload-e-signature'));
|
|
751
|
+
if (event.code === -2 && type === 'key')
|
|
752
|
+
this.onerror.emit(new ResponseError(UploadESignatureErrorCode.FORMAT_KEY, getUploadESignatureErrorDescription(UploadESignatureErrorCode.FORMAT_KEY), 'ng-fad-signature-fea-upload-e-signature'));
|
|
753
|
+
}
|
|
754
|
+
changePaswordInputType() {
|
|
755
|
+
this.passwordInputType = this.passwordInputType === 'text' ? 'password' : 'text';
|
|
756
|
+
}
|
|
757
|
+
savePassword(value) {
|
|
758
|
+
const inputElement = value.target;
|
|
759
|
+
this.password?.setValue(inputElement.value);
|
|
760
|
+
}
|
|
761
|
+
allIsRejected() {
|
|
762
|
+
return this.documents.every(doc => doc.approved === false);
|
|
763
|
+
}
|
|
764
|
+
async signDocuments() {
|
|
765
|
+
let canContinue = true;
|
|
766
|
+
const rejectedDocuments = this.documents.filter((doc) => !doc.approved);
|
|
767
|
+
if (rejectedDocuments.length > 0) {
|
|
768
|
+
canContinue = await this.rejectDocuments(true);
|
|
769
|
+
}
|
|
770
|
+
if (!canContinue)
|
|
771
|
+
return;
|
|
772
|
+
this.onloader.emit(true);
|
|
773
|
+
const cer = await this.getBase64File(this.cer?.value);
|
|
774
|
+
this.onloader.emit(false);
|
|
775
|
+
if (!cer)
|
|
776
|
+
return;
|
|
777
|
+
this.onloader.emit(true);
|
|
778
|
+
const key = await this.getBase64File(this.key?.value);
|
|
779
|
+
this.onloader.emit(false);
|
|
780
|
+
if (!key)
|
|
781
|
+
return;
|
|
782
|
+
const aprrovedDocuments = this.documents.filter((doc) => doc.approved);
|
|
783
|
+
const body = {
|
|
784
|
+
cer: cer.split(',')[1],
|
|
785
|
+
key: key.split(',')[1],
|
|
786
|
+
password: this.password?.value,
|
|
787
|
+
documents: aprrovedDocuments,
|
|
788
|
+
signerId: this.rfc
|
|
789
|
+
};
|
|
790
|
+
this.onloader.emit(true);
|
|
791
|
+
this.fad.signFea(body, this.configuration.credentials?.key, this.configuration.credentials?.iv, this.configuration.services?.reject).pipe(finalize(() => {
|
|
792
|
+
this.onloader.emit(false);
|
|
793
|
+
})).subscribe({
|
|
794
|
+
next: (res) => {
|
|
795
|
+
if (res.success) {
|
|
796
|
+
const certificate = this.mifiel.parseCertificate(body.cer);
|
|
797
|
+
const data = {
|
|
798
|
+
cer: certificate
|
|
799
|
+
};
|
|
800
|
+
this.oncomplete.emit(data);
|
|
801
|
+
}
|
|
802
|
+
else {
|
|
803
|
+
this.onerror.emit(new ResponseError(UploadESignatureErrorCode.SERVICE, res.error, 'ng-fad-signature-fea-upload-e-signature'));
|
|
804
|
+
;
|
|
805
|
+
}
|
|
806
|
+
},
|
|
807
|
+
error: (error) => {
|
|
808
|
+
this.onerror.emit(new ResponseError(UploadESignatureErrorCode.HTTP, error.error, 'ng-fad-signature-fea-upload-e-signature'));
|
|
809
|
+
;
|
|
810
|
+
},
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
rejectDocuments(fromSign = false) {
|
|
814
|
+
return new Promise((resolve, reject) => {
|
|
815
|
+
const rejectedDocuments = this.documents.filter((doc) => !doc.approved);
|
|
816
|
+
const body = {
|
|
817
|
+
cer: '',
|
|
818
|
+
key: '',
|
|
819
|
+
password: '',
|
|
820
|
+
documents: rejectedDocuments.map(res => {
|
|
821
|
+
return {
|
|
822
|
+
id: res.id,
|
|
823
|
+
idRequisition: res.idRequisition,
|
|
824
|
+
};
|
|
825
|
+
}),
|
|
826
|
+
signerId: this.signerId
|
|
827
|
+
};
|
|
828
|
+
this.onloader.emit(true);
|
|
829
|
+
this.fad.rejectFea(body, this.configuration.credentials?.key, this.configuration.credentials?.iv, this.configuration.services?.reject).pipe(finalize(() => {
|
|
830
|
+
this.onloader.emit(false);
|
|
831
|
+
})).subscribe({
|
|
832
|
+
next: (res) => {
|
|
833
|
+
if (res.success) {
|
|
834
|
+
if (!fromSign)
|
|
835
|
+
this.oncomplete.emit(null);
|
|
836
|
+
resolve(true);
|
|
837
|
+
}
|
|
838
|
+
else {
|
|
839
|
+
this.onerror.emit(new ResponseError(UploadESignatureErrorCode.SERVICE, res.error, 'ng-fad-signature-fea-upload-e-signature'));
|
|
840
|
+
reject(null);
|
|
841
|
+
}
|
|
842
|
+
},
|
|
843
|
+
error: (error) => {
|
|
844
|
+
this.onerror.emit(new ResponseError(UploadESignatureErrorCode.HTTP, error.error, 'ng-fad-signature-fea-upload-e-signature'));
|
|
845
|
+
reject(null);
|
|
846
|
+
},
|
|
847
|
+
});
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
async onRejectDocument() {
|
|
851
|
+
await this.rejectDocuments();
|
|
852
|
+
}
|
|
853
|
+
async getBase64File(file) {
|
|
854
|
+
const data = await SharedUtils.fileToBase64(file).then(base64 => base64).catch(error => null);
|
|
855
|
+
if (data)
|
|
856
|
+
return data;
|
|
857
|
+
else {
|
|
858
|
+
this.onerror.emit(new ResponseError(UploadESignatureErrorCode.ERROR_BASE_64, getUploadESignatureErrorDescription(UploadESignatureErrorCode.ERROR_BASE_64), 'ng-fad-signature-fea-upload-e-signature'));
|
|
859
|
+
return null;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
setCustomizationStyle(targetElement = document.documentElement) {
|
|
863
|
+
this.configuration = Utils.mergeConfiguration(new Configuration(), UPLOAD_E_SIGNATURE_CONFIGURATION_DEFAULT, this.configuration);
|
|
864
|
+
Utils.setVariableCss('--fad-signature-fea-e-signature-documents-background-color', this.configuration.customization?.moduleCustomization?.style?.documents?.backgroundColor, { targetElement });
|
|
865
|
+
Utils.setVariableCss('--fad-signature-fea-e-signature-documents-border-radius', this.configuration.customization?.moduleCustomization?.style?.documents?.borderRadius, { targetElement });
|
|
866
|
+
Utils.setVariableCss('--fad-signature-fea-e-signature-upload-background-color', this.configuration.customization?.moduleCustomization?.style?.upload?.backgroundColor, { targetElement });
|
|
867
|
+
Utils.setVariableCss('--fad-signature-fea-e-signature-upload-border', this.configuration.customization?.moduleCustomization?.style?.upload?.border, { targetElement });
|
|
868
|
+
Utils.setVariableCss('--fad-signature-fea-e-signature-upload-border-radius', this.configuration.customization?.moduleCustomization?.style?.upload?.borderRadius, { targetElement });
|
|
869
|
+
Utils.setVariableCss('--fad-signature-fea-e-signature-upload-button-background-color', this.configuration.customization?.moduleCustomization?.style?.upload?.button?.backgroundColor, { targetElement });
|
|
870
|
+
Utils.setVariableCss('--fad-signature-fea-e-signature-upload-button-border-radius', this.configuration.customization?.moduleCustomization?.style?.upload?.button?.borderRadius, { targetElement });
|
|
871
|
+
Utils.setVariableCss('--fad-signature-fea-e-signature-upload-button-hover', this.configuration.customization?.moduleCustomization?.style?.upload?.button?.hover, { targetElement });
|
|
872
|
+
Utils.setVariableCss('--fad-signature-fea-e-signature-file-border-radius', this.configuration.customization?.moduleCustomization?.style?.file?.borderRadius, { targetElement });
|
|
873
|
+
Utils.setVariableCss('--fad-signature-fea-e-signature-file-img-background-color', this.configuration.customization?.moduleCustomization?.style?.file?.img?.backgroundColor, { targetElement });
|
|
874
|
+
}
|
|
875
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UploadESignatureComponent, deps: [{ token: i0.ElementRef }, { token: i1$1.FormBuilder }, { token: i2$2.FadService }, { token: i2$2.MifielService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
876
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: UploadESignatureComponent, selector: "ng-fad-signature-fea-upload-e-signature", inputs: { configuration: "configuration", documents: "documents", signerId: "signerId", rfc: "rfc" }, outputs: { onerror: "onerror", onloader: "onloader", oncomplete: "oncomplete" }, ngImport: i0, template: "<ng-container *ngIf=\"showComponent\">\r\n <div>\r\n <div *ngIf=\"documents.length > 1\" class=\"fad-portal-title-bold\">{{ documentPluralTitle }}</div>\r\n <div *ngIf=\"documents.length === 1\" class=\"fad-portal-title-bold\">{{ documentSingularTitle }}</div>\r\n\r\n <div class=\"container-document fad-portal-content\">\r\n <div *ngFor=\"let i of documents\" class=\"document\">\r\n <div>{{ i.doc.name }}</div>\r\n <div class=\"status fad-portal-content-bold\">{{ i.approved ? configuration.customization?.moduleCustomization?.legends?.documents?.status?.approved : configuration.customization?.moduleCustomization?.legends?.documents?.status?.rejected }}</div>\r\n <div class=\"pages\">{{ i.doc.pages }} {{ i.doc.pages > 1 ? configuration.customization?.moduleCustomization?.legends?.documents?.pages?.plural : configuration.customization?.moduleCustomization?.legends?.documents?.pages?.singular }}</div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <ng-container *ngIf=\"!allIsRejected()\">\r\n <div class=\"fad-portal-title-bold\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.title }}</div>\r\n\r\n <div>\r\n <div class=\"container-instruction-file\">\r\n <div class=\"fad-portal-content\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.cer?.label }}</div>\r\n <div *ngIf=\"cer?.value\" class=\"fad-portal-content select-file\" (click)=\"openFilePicker(fileCerInput)\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.upload }}</div>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"!cer?.value\"\r\n class=\"container-upload\"\r\n (click)=\"openFilePicker(fileCerInput)\"\r\n dragDropDocument\r\n [formatList]=\"formatCerList\"\r\n [acceptMultipleFiles]=\"false\"\r\n (onfiledropped)=\"onfiledropped($event, 'cer')\"\r\n (onerror)=\"onerrorDirective($event, 'cer')\">\r\n <div class=\"fad-portal-content instruction\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.cer?.instruction }}</div>\r\n <div class=\"fad-portal-content-bold upload-btn\">\r\n <ng-fad-image-inline [src]=\"uploadImg\"></ng-fad-image-inline>\r\n <span>{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.cer?.upload }}</span>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"cer?.value\" class=\"container-file\">\r\n <div class=\"document-img\">\r\n <img [src]=\"fileImg\" alt=\"\">\r\n </div>\r\n <div class=\"fad-portal-content\">{{ cer?.value.name }}</div>\r\n </div>\r\n\r\n <input type=\"file\" accept=\".cer\" #fileCerInput style=\"display: none\" (change)=\"onFileChange($event, 'cer')\">\r\n </div>\r\n\r\n <div>\r\n <div class=\"container-instruction-file\">\r\n <div class=\"fad-portal-content\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.key?.label }}</div>\r\n <div *ngIf=\"key?.value\" class=\"fad-portal-content select-file\" (click)=\"openFilePicker(fileKeyInput)\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.upload }}</div>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"!key?.value\"\r\n class=\"container-upload\"\r\n (click)=\"openFilePicker(fileKeyInput)\"\r\n dragDropDocument\r\n [formatList]=\"formatKeyList\"\r\n [acceptMultipleFiles]=\"false\"\r\n (onfiledropped)=\"onfiledropped($event, 'key')\"\r\n (onerror)=\"onerrorDirective($event, 'key')\">\r\n\r\n <div class=\"fad-portal-content instruction\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.key?.instruction }}</div>\r\n <div class=\"fad-portal-content-bold upload-btn\">\r\n <ng-fad-image-inline [src]=\"uploadImg\"></ng-fad-image-inline>\r\n <span>{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.key?.upload }}</span>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"key?.value\" class=\"container-file\">\r\n <div class=\"document-img\">\r\n <img [src]=\"fileImg\" alt=\"\">\r\n </div>\r\n <div class=\"fad-portal-content\">{{ key?.value.name }}</div>\r\n </div>\r\n\r\n <input type=\"file\" accept=\".key\" #fileKeyInput style=\"display: none\" (change)=\"onFileChange($event, 'key')\">\r\n </div>\r\n\r\n <div class=\"fad-portal-container-input\">\r\n <label class=\"fad-portal-content\" for=\"\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.password?.label }}</label>\r\n <div class=\"input-password\">\r\n <input [type]=\"passwordInputType\" (input)=\"savePassword($event)\">\r\n <div class=\"fad-portal-content-bold password-show\">\r\n <div *ngIf=\"passwordInputType === 'text'\" (click)=\"changePaswordInputType()\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.password?.hide }}</div>\r\n <div *ngIf=\"passwordInputType === 'password'\" (click)=\"changePaswordInputType()\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.password?.show }}</div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </ng-container>\r\n\r\n <div></div>\r\n\r\n <div class=\"fad-portal-content container-confirm\">\r\n <div *ngIf=\"!allIsRejected()\" (click)=\"isValidated = !isValidated\">\r\n <div>\r\n <ng-fad-image-inline *ngIf=\"isValidated\" [src]=\"checkOnImg\"></ng-fad-image-inline>\r\n <ng-fad-image-inline *ngIf=\"!isValidated\" [src]=\"checkOffImg\"></ng-fad-image-inline>\r\n </div>\r\n <div *ngIf=\"documents.length === 1\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.validate?.singular }}</div>\r\n <div *ngIf=\"documents.length > 1\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.validate?.plural }}</div>\r\n </div>\r\n\r\n <div></div>\r\n\r\n <div class=\"action\">\r\n <button type=\"button\" *ngIf=\"documents.length === 1 && !allIsRejected()\" class=\"fad-portal-primary\" [disabled]=\"!form.valid || !isValidated\" (click)=\"signDocuments()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.sign?.singular }}</button>\r\n <button type=\"button\" *ngIf=\"documents.length > 1 && !allIsRejected()\" class=\"fad-portal-primary\" [disabled]=\"!form.valid || !isValidated\" (click)=\"signDocuments()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.sign?.plural }}</button>\r\n <button type=\"button\" *ngIf=\"documents.length === 1 && allIsRejected()\" class=\"fad-portal-primary\" (click)=\"onRejectDocument()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.reject?.singular }}</button>\r\n <button type=\"button\" *ngIf=\"documents.length > 1 && allIsRejected()\" class=\"fad-portal-primary\" (click)=\"onRejectDocument()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.reject?.plural }}</button>\r\n </div>\r\n </div>\r\n</ng-container>\r\n", styles: [":host{display:flex;flex-direction:column;gap:var(--fad-portal-common-separation-md)}:host .container-document{display:flex;flex-direction:column;width:100%;background-color:var(--fad-signature-fea-e-signature-documents-background-color);border-radius:var(--fad-signature-fea-e-signature-documents-border-radius);padding:var(--fad-portal-common-separation-md);box-sizing:border-box;margin-top:var(--fad-portal-common-separation-xs)}:host .container-document .document{display:flex;gap:var(--fad-portal-common-separation-md);justify-content:space-between;border-bottom:1px solid var(--fad-portal-common-border-color);padding:var(--fad-portal-common-separation-md) 0}:host .container-document .document>div{flex:1}:host .container-document .document .status{text-align:center}:host .container-document .document .pages{text-align:end;color:var(--fad-portal-common-legends-secondary)}:host .document:only-child{border-bottom:none!important}:host .container-instruction-file{display:flex;gap:var(--fad-portal-common-separation-md);justify-content:space-between}:host .container-instruction-file .select-file{color:var(--fad-portal-common-primary-color);cursor:pointer}:host .container-upload{width:100%;box-sizing:border-box;border-radius:var(--fad-signature-fea-e-signature-upload-border-radius);border:var(--fad-signature-fea-e-signature-upload-border);padding:var(--fad-portal-common-separation-md);margin-top:var(--fad-portal-common-separation-xs);display:flex;flex-direction:column;gap:var(--fad-portal-common-separation-xs);align-items:center;justify-content:center;text-align:center;background-color:var(--fad-signature-fea-e-signature-upload-background-color)}:host .container-upload .instruction{color:var(--fad-portal-common-legends-secondary)}:host .container-upload .upload-btn{max-width:90%;width:300px;box-sizing:border-box;background-color:var(--fad-signature-fea-e-signature-upload-button-background-color);border-radius:var(--fad-signature-fea-e-signature-upload-button-border-radius);color:var(--fad-portal-common-legends-tertiary);padding:var(--fad-portal-common-separation-xs);cursor:pointer;transition:all .2s ease-out;display:flex;align-items:center;justify-content:center;text-align:center;gap:var(--fad-portal-common-separation-xs)}:host .container-upload .upload-btn:hover{background-color:var(--fad-signature-fea-e-signature-upload-button-hover)}:host .container-file{display:flex;gap:var(--fad-portal-common-separation-md);align-items:center;padding:var(--fad-portal-common-separation-md);border:2px solid var(--fad-portal-common-successful-color);height:71px;border-radius:var(--fad-signature-fea-e-signature-file-border-radius);margin-top:var(--fad-portal-common-separation-xs)}:host .container-file .fad-portal-content{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .container-file .document-img{background-color:var(--fad-signature-fea-e-signature-file-img-background-color);width:40px;height:40px;border-radius:100%;display:flex;align-items:center;justify-content:center}:host .container-file .document-img img{width:60%;max-width:100%;max-height:100%}:host .fad-portal-container-input .input-password{position:relative}:host .fad-portal-container-input .input-password input{padding-right:100px}:host .fad-portal-container-input .input-password .password-show{position:absolute;right:10px;top:50%;transform:translateY(-50%);color:var(--fad-portal-common-legends-secondary);cursor:pointer}:host .container-confirm{display:flex;justify-content:space-between;align-items:center;gap:var(--fad-portal-common-separation-xs)}:host .container-confirm>div:first-child{display:flex;gap:var(--fad-portal-common-separation-xs)}:host .container-confirm>div:first-child>div:first-child{width:25px;height:25px}:host .container-confirm .action{max-width:80%;width:400px}:host .container-confirm ng-fad-image-inline{cursor:pointer}@media (max-width: 992px){:host .container-document .document{flex-direction:column;gap:var(--fad-portal-common-separation-xs)}:host .container-document .document .status,:host .container-document .document .pages{text-align:start!important}:host .container-confirm{flex-direction:column}:host .container-confirm .action{max-width:100%;width:100%!important}}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.DragDropDocumentDirective, selector: "[dragDropDocument]", inputs: ["formatList", "acceptMultipleFiles"], outputs: ["onfiledropped", "onerror"] }, { kind: "component", type: i4.NgFadImageInlineComponent, selector: "ng-fad-image-inline", inputs: ["src"] }] }); }
|
|
877
|
+
}
|
|
878
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UploadESignatureComponent, decorators: [{
|
|
879
|
+
type: Component,
|
|
880
|
+
args: [{ selector: 'ng-fad-signature-fea-upload-e-signature', template: "<ng-container *ngIf=\"showComponent\">\r\n <div>\r\n <div *ngIf=\"documents.length > 1\" class=\"fad-portal-title-bold\">{{ documentPluralTitle }}</div>\r\n <div *ngIf=\"documents.length === 1\" class=\"fad-portal-title-bold\">{{ documentSingularTitle }}</div>\r\n\r\n <div class=\"container-document fad-portal-content\">\r\n <div *ngFor=\"let i of documents\" class=\"document\">\r\n <div>{{ i.doc.name }}</div>\r\n <div class=\"status fad-portal-content-bold\">{{ i.approved ? configuration.customization?.moduleCustomization?.legends?.documents?.status?.approved : configuration.customization?.moduleCustomization?.legends?.documents?.status?.rejected }}</div>\r\n <div class=\"pages\">{{ i.doc.pages }} {{ i.doc.pages > 1 ? configuration.customization?.moduleCustomization?.legends?.documents?.pages?.plural : configuration.customization?.moduleCustomization?.legends?.documents?.pages?.singular }}</div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <ng-container *ngIf=\"!allIsRejected()\">\r\n <div class=\"fad-portal-title-bold\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.title }}</div>\r\n\r\n <div>\r\n <div class=\"container-instruction-file\">\r\n <div class=\"fad-portal-content\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.cer?.label }}</div>\r\n <div *ngIf=\"cer?.value\" class=\"fad-portal-content select-file\" (click)=\"openFilePicker(fileCerInput)\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.upload }}</div>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"!cer?.value\"\r\n class=\"container-upload\"\r\n (click)=\"openFilePicker(fileCerInput)\"\r\n dragDropDocument\r\n [formatList]=\"formatCerList\"\r\n [acceptMultipleFiles]=\"false\"\r\n (onfiledropped)=\"onfiledropped($event, 'cer')\"\r\n (onerror)=\"onerrorDirective($event, 'cer')\">\r\n <div class=\"fad-portal-content instruction\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.cer?.instruction }}</div>\r\n <div class=\"fad-portal-content-bold upload-btn\">\r\n <ng-fad-image-inline [src]=\"uploadImg\"></ng-fad-image-inline>\r\n <span>{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.cer?.upload }}</span>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"cer?.value\" class=\"container-file\">\r\n <div class=\"document-img\">\r\n <img [src]=\"fileImg\" alt=\"\">\r\n </div>\r\n <div class=\"fad-portal-content\">{{ cer?.value.name }}</div>\r\n </div>\r\n\r\n <input type=\"file\" accept=\".cer\" #fileCerInput style=\"display: none\" (change)=\"onFileChange($event, 'cer')\">\r\n </div>\r\n\r\n <div>\r\n <div class=\"container-instruction-file\">\r\n <div class=\"fad-portal-content\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.key?.label }}</div>\r\n <div *ngIf=\"key?.value\" class=\"fad-portal-content select-file\" (click)=\"openFilePicker(fileKeyInput)\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.upload }}</div>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"!key?.value\"\r\n class=\"container-upload\"\r\n (click)=\"openFilePicker(fileKeyInput)\"\r\n dragDropDocument\r\n [formatList]=\"formatKeyList\"\r\n [acceptMultipleFiles]=\"false\"\r\n (onfiledropped)=\"onfiledropped($event, 'key')\"\r\n (onerror)=\"onerrorDirective($event, 'key')\">\r\n\r\n <div class=\"fad-portal-content instruction\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.key?.instruction }}</div>\r\n <div class=\"fad-portal-content-bold upload-btn\">\r\n <ng-fad-image-inline [src]=\"uploadImg\"></ng-fad-image-inline>\r\n <span>{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.key?.upload }}</span>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"key?.value\" class=\"container-file\">\r\n <div class=\"document-img\">\r\n <img [src]=\"fileImg\" alt=\"\">\r\n </div>\r\n <div class=\"fad-portal-content\">{{ key?.value.name }}</div>\r\n </div>\r\n\r\n <input type=\"file\" accept=\".key\" #fileKeyInput style=\"display: none\" (change)=\"onFileChange($event, 'key')\">\r\n </div>\r\n\r\n <div class=\"fad-portal-container-input\">\r\n <label class=\"fad-portal-content\" for=\"\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.password?.label }}</label>\r\n <div class=\"input-password\">\r\n <input [type]=\"passwordInputType\" (input)=\"savePassword($event)\">\r\n <div class=\"fad-portal-content-bold password-show\">\r\n <div *ngIf=\"passwordInputType === 'text'\" (click)=\"changePaswordInputType()\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.password?.hide }}</div>\r\n <div *ngIf=\"passwordInputType === 'password'\" (click)=\"changePaswordInputType()\">{{ configuration.customization?.moduleCustomization?.legends?.eSignature?.password?.show }}</div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </ng-container>\r\n\r\n <div></div>\r\n\r\n <div class=\"fad-portal-content container-confirm\">\r\n <div *ngIf=\"!allIsRejected()\" (click)=\"isValidated = !isValidated\">\r\n <div>\r\n <ng-fad-image-inline *ngIf=\"isValidated\" [src]=\"checkOnImg\"></ng-fad-image-inline>\r\n <ng-fad-image-inline *ngIf=\"!isValidated\" [src]=\"checkOffImg\"></ng-fad-image-inline>\r\n </div>\r\n <div *ngIf=\"documents.length === 1\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.validate?.singular }}</div>\r\n <div *ngIf=\"documents.length > 1\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.validate?.plural }}</div>\r\n </div>\r\n\r\n <div></div>\r\n\r\n <div class=\"action\">\r\n <button type=\"button\" *ngIf=\"documents.length === 1 && !allIsRejected()\" class=\"fad-portal-primary\" [disabled]=\"!form.valid || !isValidated\" (click)=\"signDocuments()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.sign?.singular }}</button>\r\n <button type=\"button\" *ngIf=\"documents.length > 1 && !allIsRejected()\" class=\"fad-portal-primary\" [disabled]=\"!form.valid || !isValidated\" (click)=\"signDocuments()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.sign?.plural }}</button>\r\n <button type=\"button\" *ngIf=\"documents.length === 1 && allIsRejected()\" class=\"fad-portal-primary\" (click)=\"onRejectDocument()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.reject?.singular }}</button>\r\n <button type=\"button\" *ngIf=\"documents.length > 1 && allIsRejected()\" class=\"fad-portal-primary\" (click)=\"onRejectDocument()\">{{ configuration.customization?.moduleCustomization?.legends?.sign?.button?.reject?.plural }}</button>\r\n </div>\r\n </div>\r\n</ng-container>\r\n", styles: [":host{display:flex;flex-direction:column;gap:var(--fad-portal-common-separation-md)}:host .container-document{display:flex;flex-direction:column;width:100%;background-color:var(--fad-signature-fea-e-signature-documents-background-color);border-radius:var(--fad-signature-fea-e-signature-documents-border-radius);padding:var(--fad-portal-common-separation-md);box-sizing:border-box;margin-top:var(--fad-portal-common-separation-xs)}:host .container-document .document{display:flex;gap:var(--fad-portal-common-separation-md);justify-content:space-between;border-bottom:1px solid var(--fad-portal-common-border-color);padding:var(--fad-portal-common-separation-md) 0}:host .container-document .document>div{flex:1}:host .container-document .document .status{text-align:center}:host .container-document .document .pages{text-align:end;color:var(--fad-portal-common-legends-secondary)}:host .document:only-child{border-bottom:none!important}:host .container-instruction-file{display:flex;gap:var(--fad-portal-common-separation-md);justify-content:space-between}:host .container-instruction-file .select-file{color:var(--fad-portal-common-primary-color);cursor:pointer}:host .container-upload{width:100%;box-sizing:border-box;border-radius:var(--fad-signature-fea-e-signature-upload-border-radius);border:var(--fad-signature-fea-e-signature-upload-border);padding:var(--fad-portal-common-separation-md);margin-top:var(--fad-portal-common-separation-xs);display:flex;flex-direction:column;gap:var(--fad-portal-common-separation-xs);align-items:center;justify-content:center;text-align:center;background-color:var(--fad-signature-fea-e-signature-upload-background-color)}:host .container-upload .instruction{color:var(--fad-portal-common-legends-secondary)}:host .container-upload .upload-btn{max-width:90%;width:300px;box-sizing:border-box;background-color:var(--fad-signature-fea-e-signature-upload-button-background-color);border-radius:var(--fad-signature-fea-e-signature-upload-button-border-radius);color:var(--fad-portal-common-legends-tertiary);padding:var(--fad-portal-common-separation-xs);cursor:pointer;transition:all .2s ease-out;display:flex;align-items:center;justify-content:center;text-align:center;gap:var(--fad-portal-common-separation-xs)}:host .container-upload .upload-btn:hover{background-color:var(--fad-signature-fea-e-signature-upload-button-hover)}:host .container-file{display:flex;gap:var(--fad-portal-common-separation-md);align-items:center;padding:var(--fad-portal-common-separation-md);border:2px solid var(--fad-portal-common-successful-color);height:71px;border-radius:var(--fad-signature-fea-e-signature-file-border-radius);margin-top:var(--fad-portal-common-separation-xs)}:host .container-file .fad-portal-content{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .container-file .document-img{background-color:var(--fad-signature-fea-e-signature-file-img-background-color);width:40px;height:40px;border-radius:100%;display:flex;align-items:center;justify-content:center}:host .container-file .document-img img{width:60%;max-width:100%;max-height:100%}:host .fad-portal-container-input .input-password{position:relative}:host .fad-portal-container-input .input-password input{padding-right:100px}:host .fad-portal-container-input .input-password .password-show{position:absolute;right:10px;top:50%;transform:translateY(-50%);color:var(--fad-portal-common-legends-secondary);cursor:pointer}:host .container-confirm{display:flex;justify-content:space-between;align-items:center;gap:var(--fad-portal-common-separation-xs)}:host .container-confirm>div:first-child{display:flex;gap:var(--fad-portal-common-separation-xs)}:host .container-confirm>div:first-child>div:first-child{width:25px;height:25px}:host .container-confirm .action{max-width:80%;width:400px}:host .container-confirm ng-fad-image-inline{cursor:pointer}@media (max-width: 992px){:host .container-document .document{flex-direction:column;gap:var(--fad-portal-common-separation-xs)}:host .container-document .document .status,:host .container-document .document .pages{text-align:start!important}:host .container-confirm{flex-direction:column}:host .container-confirm .action{max-width:100%;width:100%!important}}\n"] }]
|
|
881
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$1.FormBuilder }, { type: i2$2.FadService }, { type: i2$2.MifielService }]; }, propDecorators: { configuration: [{
|
|
882
|
+
type: Input
|
|
883
|
+
}], documents: [{
|
|
884
|
+
type: Input
|
|
885
|
+
}], signerId: [{
|
|
886
|
+
type: Input
|
|
887
|
+
}], rfc: [{
|
|
888
|
+
type: Input
|
|
889
|
+
}], onerror: [{
|
|
890
|
+
type: Output
|
|
891
|
+
}], onloader: [{
|
|
892
|
+
type: Output
|
|
893
|
+
}], oncomplete: [{
|
|
894
|
+
type: Output
|
|
895
|
+
}] } });
|
|
896
|
+
|
|
897
|
+
class GenericErrorFeaComponent {
|
|
898
|
+
ngOnInit() {
|
|
899
|
+
this.setCustomizationStyle();
|
|
900
|
+
this.errorIgm = this.configuration.pathDependencies?.images?.error || `${this.configuration.pathDependencies?.imageDirectory}error.svg`;
|
|
901
|
+
}
|
|
902
|
+
setCustomizationStyle(targetElement = document.documentElement) {
|
|
903
|
+
this.configuration = Utils.mergeConfiguration(new Configuration(), GENERIC_ERROR_FEA_CONFIGURATION_DEFAULT, this.configuration);
|
|
904
|
+
}
|
|
905
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GenericErrorFeaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
906
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: GenericErrorFeaComponent, selector: "ng-fad-signature-fea-generic-error-fea", inputs: { configuration: "configuration", title: "title", instruction: "instruction" }, ngImport: i0, template: "<ng-fad-image-inline [src]=\"errorIgm\"></ng-fad-image-inline>\r\n<div class=\"fad-portal-title-bold\">{{ title ? title : configuration.customization?.moduleCustomization?.legends?.title }}</div>\r\n<div class=\"fad-portal-content\">{{ instruction ? instruction : configuration.customization?.moduleCustomization?.legends?.instruction }}</div>\r\n", styles: [":host{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:var(--fad-portal-common-separation-md)}\n"], dependencies: [{ kind: "component", type: i4.NgFadImageInlineComponent, selector: "ng-fad-image-inline", inputs: ["src"] }] }); }
|
|
907
|
+
}
|
|
908
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GenericErrorFeaComponent, decorators: [{
|
|
909
|
+
type: Component,
|
|
910
|
+
args: [{ selector: 'ng-fad-signature-fea-generic-error-fea', template: "<ng-fad-image-inline [src]=\"errorIgm\"></ng-fad-image-inline>\r\n<div class=\"fad-portal-title-bold\">{{ title ? title : configuration.customization?.moduleCustomization?.legends?.title }}</div>\r\n<div class=\"fad-portal-content\">{{ instruction ? instruction : configuration.customization?.moduleCustomization?.legends?.instruction }}</div>\r\n", styles: [":host{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:var(--fad-portal-common-separation-md)}\n"] }]
|
|
911
|
+
}], propDecorators: { configuration: [{
|
|
912
|
+
type: Input
|
|
913
|
+
}], title: [{
|
|
914
|
+
type: Input
|
|
915
|
+
}], instruction: [{
|
|
916
|
+
type: Input
|
|
917
|
+
}] } });
|
|
918
|
+
|
|
919
|
+
class ValidateSignatureComponent {
|
|
920
|
+
constructor(fad) {
|
|
921
|
+
this.fad = fad;
|
|
922
|
+
this.onloader = new EventEmitter();
|
|
923
|
+
this.onerror = new EventEmitter();
|
|
924
|
+
this.oncomplete = new EventEmitter();
|
|
925
|
+
this.onsigned = new EventEmitter();
|
|
926
|
+
}
|
|
927
|
+
ngOnInit() {
|
|
928
|
+
this.setCustomizationStyle();
|
|
929
|
+
const canContinue = this.validateData();
|
|
930
|
+
if (canContinue)
|
|
931
|
+
this.getSignerStatusFea();
|
|
932
|
+
}
|
|
933
|
+
validateData() {
|
|
934
|
+
if (!this.requisitionId) {
|
|
935
|
+
this.onerror.emit(new ResponseError(ValidateSignatureErrorCode.NO_REQUISITION_ID, getValidateSignatureErrorDescription(ValidateSignatureErrorCode.NO_REQUISITION_ID), 'ng-fad-signature-fea-validate-signature'));
|
|
936
|
+
return false;
|
|
937
|
+
}
|
|
938
|
+
if (!this.signerId) {
|
|
939
|
+
this.onerror.emit(new ResponseError(ValidateSignatureErrorCode.NO_SIGNER_ID, getValidateSignatureErrorDescription(ValidateSignatureErrorCode.NO_SIGNER_ID), 'ng-fad-signature-fea-validate-signature'));
|
|
940
|
+
return false;
|
|
941
|
+
}
|
|
942
|
+
return true;
|
|
943
|
+
}
|
|
944
|
+
getSignerStatusFea() {
|
|
945
|
+
this.onloader.emit(true);
|
|
946
|
+
this.fad.getSignerStatusFea(this.requisitionId, this.signerId, this.configuration.services?.signerStatusFea)
|
|
947
|
+
.pipe(finalize(() => this.onloader.emit(false)))
|
|
948
|
+
.subscribe({
|
|
949
|
+
next: (res) => {
|
|
950
|
+
if (res.success) {
|
|
951
|
+
res.data === 'COMPLETED' ? this.onsigned.emit(res.data) : this.oncomplete.emit(res.data);
|
|
952
|
+
}
|
|
953
|
+
else {
|
|
954
|
+
this.onerror.emit(new ResponseError(ValidateSignatureErrorCode.SERVICE, res.error, 'ng-fad-signature-fea-validate-signature'));
|
|
955
|
+
}
|
|
956
|
+
},
|
|
957
|
+
error: (error) => {
|
|
958
|
+
this.onerror.emit(new ResponseError(ValidateSignatureErrorCode.HTTP, error.error, 'ng-fad-signature-fea-validate-signature'));
|
|
959
|
+
}
|
|
960
|
+
});
|
|
961
|
+
}
|
|
962
|
+
setCustomizationStyle(targetElement = document.documentElement) {
|
|
963
|
+
this.configuration = Utils.mergeConfiguration(new Configuration(), VALIDATE_SIGNATURE_CONFIGURATION_DEFAULT, this.configuration);
|
|
964
|
+
}
|
|
965
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ValidateSignatureComponent, deps: [{ token: i2$2.FadService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
966
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ValidateSignatureComponent, selector: "ng-fad-signature-fea-validate-signature", inputs: { configuration: "configuration", signerId: "signerId", requisitionId: "requisitionId" }, outputs: { onloader: "onloader", onerror: "onerror", oncomplete: "oncomplete", onsigned: "onsigned" }, ngImport: i0, template: "", styles: [""] }); }
|
|
967
|
+
}
|
|
968
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ValidateSignatureComponent, decorators: [{
|
|
969
|
+
type: Component,
|
|
970
|
+
args: [{ selector: 'ng-fad-signature-fea-validate-signature', template: "" }]
|
|
971
|
+
}], ctorParameters: function () { return [{ type: i2$2.FadService }]; }, propDecorators: { configuration: [{
|
|
972
|
+
type: Input
|
|
973
|
+
}], signerId: [{
|
|
974
|
+
type: Input
|
|
975
|
+
}], requisitionId: [{
|
|
976
|
+
type: Input
|
|
977
|
+
}], onloader: [{
|
|
978
|
+
type: Output
|
|
979
|
+
}], onerror: [{
|
|
980
|
+
type: Output
|
|
981
|
+
}], oncomplete: [{
|
|
982
|
+
type: Output
|
|
983
|
+
}], onsigned: [{
|
|
984
|
+
type: Output
|
|
985
|
+
}] } });
|
|
986
|
+
|
|
987
|
+
const SIGNATURE_SUMMARY_DEFAULT = {
|
|
988
|
+
dateFormat: 'es-MX',
|
|
989
|
+
customization: {
|
|
990
|
+
moduleCustomization: {
|
|
991
|
+
style: {},
|
|
992
|
+
legends: {
|
|
993
|
+
signed: "Documentos firmados",
|
|
994
|
+
rejected: "Documentos rechazados",
|
|
995
|
+
legend: "Te hemos enviado el resumen del proceso y el documento firmado a tu correo electrónico",
|
|
996
|
+
documentRejected: "Documento rechazado"
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
},
|
|
1000
|
+
pathDependencies: {
|
|
1001
|
+
imageDirectory: 'assets/images/fad-signature-fea/signature-summary/',
|
|
1002
|
+
}
|
|
1003
|
+
};
|
|
1004
|
+
|
|
1005
|
+
class SignatureSummaryComponent {
|
|
1006
|
+
constructor(hostContext) {
|
|
1007
|
+
this.hostContext = hostContext;
|
|
1008
|
+
this.oncomplete = new EventEmitter();
|
|
1009
|
+
this.images = {
|
|
1010
|
+
reject: '',
|
|
1011
|
+
send: ''
|
|
1012
|
+
};
|
|
1013
|
+
this.signedCount = 0;
|
|
1014
|
+
this.rejectedCount = 0;
|
|
1015
|
+
this.isAllDocumentsRejected = true;
|
|
1016
|
+
this.currentDate = '';
|
|
1017
|
+
this.id = '';
|
|
1018
|
+
this.pdfsName = '';
|
|
1019
|
+
}
|
|
1020
|
+
ngOnInit() {
|
|
1021
|
+
console.log(this.documentRequest);
|
|
1022
|
+
this.setCustomizationStyle(this.hostContext.nativeElement);
|
|
1023
|
+
if (this.configuration?.pathDependencies?.imageDirectory) {
|
|
1024
|
+
this.images.reject = this.configuration.pathDependencies?.images?.reject ?? `${this.configuration.pathDependencies.imageDirectory}/rejected.svg`;
|
|
1025
|
+
this.images.send = this.configuration.pathDependencies?.images?.send ?? `${this.configuration.pathDependencies.imageDirectory}/send.svg`;
|
|
1026
|
+
}
|
|
1027
|
+
this.updateDocumentCounts();
|
|
1028
|
+
this.getPdfNames();
|
|
1029
|
+
this.setCurrentDate();
|
|
1030
|
+
}
|
|
1031
|
+
setCurrentDate() {
|
|
1032
|
+
const now = new Date();
|
|
1033
|
+
let hours = now.getHours();
|
|
1034
|
+
const minutes = now.getMinutes();
|
|
1035
|
+
const amPm = hours >= 12 ? 'PM' : 'AM';
|
|
1036
|
+
hours = hours % 12 || 12;
|
|
1037
|
+
const formattedMinutes = minutes < 10 ? '0' + minutes : minutes;
|
|
1038
|
+
this.currentDate = `${now.toLocaleDateString(this.configuration.dateFormat)} | ${hours}:${formattedMinutes} ${amPm}`;
|
|
1039
|
+
}
|
|
1040
|
+
updateDocumentCounts() {
|
|
1041
|
+
// Contar documentos firmados (approved: true)
|
|
1042
|
+
this.documentRequest.forEach((doc) => {
|
|
1043
|
+
this.id = doc.id;
|
|
1044
|
+
if (doc.approved) {
|
|
1045
|
+
this.signedCount += 1;
|
|
1046
|
+
}
|
|
1047
|
+
else {
|
|
1048
|
+
this.rejectedCount += 1;
|
|
1049
|
+
}
|
|
1050
|
+
});
|
|
1051
|
+
console.log(this.documentRequest, this.signedCount, this.rejectedCount);
|
|
1052
|
+
if (this.signedCount > 0) {
|
|
1053
|
+
this.isAllDocumentsRejected = false;
|
|
1054
|
+
}
|
|
1055
|
+
else {
|
|
1056
|
+
this.isAllDocumentsRejected = true;
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
getPdfNames() {
|
|
1060
|
+
let currentFlag = '';
|
|
1061
|
+
let previewFlag = '';
|
|
1062
|
+
this.documentRequest.forEach((doc) => {
|
|
1063
|
+
if (this.pdfsName === '') {
|
|
1064
|
+
this.pdfsName = doc.doc?.name.replace('.pdf', '');
|
|
1065
|
+
currentFlag = doc.idRequisition;
|
|
1066
|
+
previewFlag = doc.idRequisition;
|
|
1067
|
+
}
|
|
1068
|
+
currentFlag = doc.idRequisition;
|
|
1069
|
+
if (currentFlag !== previewFlag) {
|
|
1070
|
+
this.pdfsName += ',' + doc.doc?.name.replace('.pdf', '');
|
|
1071
|
+
currentFlag = doc.idRequisition;
|
|
1072
|
+
previewFlag = doc.idRequisition;
|
|
1073
|
+
}
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
setCustomizationStyle(targetElement = document.documentElement) {
|
|
1077
|
+
this.configuration = Utils.mergeConfiguration(new Configuration(), SIGNATURE_SUMMARY_DEFAULT, this.configuration);
|
|
1078
|
+
}
|
|
1079
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SignatureSummaryComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1080
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SignatureSummaryComponent, selector: "ng-fad-signature-fea-signature-summary", inputs: { documentRequest: "documentRequest", configuration: "configuration" }, outputs: { oncomplete: "oncomplete" }, ngImport: i0, template: "<div class=\"fad-portal-content\">\n \n <ng-container *ngIf=\"!isAllDocumentsRejected\" >\n <ng-fad-image-inline\n [src]=\"images.send\"\n >\n </ng-fad-image-inline>\n <div class=\"fad-portal-title-bold\">\n {{pdfsName}}\n </div>\n <div class=\"fad-portal-content-bold date\">{{ currentDate }}</div>\n <div class=\"summary\">\n <div class=\"fad-portal-content-bold signeds\">\n <div>{{configuration.customization?.moduleCustomization?.legends?.signed}}</div>\n <div>{{signedCount}}</div>\n </div>\n <div class=\"line\">\n\n </div>\n <div class=\"fad-portal-content-bold rejecteds\">\n <div>{{configuration.customization?.moduleCustomization?.legends?.rejected}}</div>\n <div>{{rejectedCount}}</div>\n </div>\n </div>\n <div class=\"legends\">\n {{configuration.customization?.moduleCustomization?.legends?.legend}}\n </div>\n </ng-container>\n <ng-container *ngIf=\"isAllDocumentsRejected\" >\n <ng-fad-image-inline\n [src]=\"images.reject\"\n >\n </ng-fad-image-inline>\n <div class=\"document-rejected\"> {{configuration.customization?.moduleCustomization?.legends?.documentRejected}} </div>\n <div class=\"fad-portal-title-bold title-document\">\n {{pdfsName}}\n </div>\n <div class=\"id-requisition\">\n ID {{id}} | {{ currentDate }}\n </div>\n </ng-container>\n \n</div>", styles: [".fad-portal-content{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;row-gap:var(--fad-portal-common-separation-sm)}.fad-portal-content .fad-portal-title{margin-top:var(--fad-portal-common-separation-sm);margin-bottom:var(--fad-portal-common-separation-sm)}.fad-portal-content .date{color:#aaa}.fad-portal-content .summary{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;row-gap:var(--fad-portal-common-separation-sm);margin-bottom:var(--fad-portal-common-separation-xs)}.fad-portal-content .summary .signeds,.fad-portal-content .summary .rejecteds{width:100%;display:flex;justify-content:space-between}.fad-portal-content .summary .line{width:100%;border:1px solid var(--fad-portal-common-border-color)}.fad-portal-content .legends{text-align:center}.fad-portal-content .document-rejected{color:#aaa;margin-bottom:var(--fad-portal-common-separation-sm)}.fad-portal-content .id-requisition{color:#aaa;margin-top:var(--fad-portal-common-separation-sm)}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.NgFadImageInlineComponent, selector: "ng-fad-image-inline", inputs: ["src"] }] }); }
|
|
1081
|
+
}
|
|
1082
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SignatureSummaryComponent, decorators: [{
|
|
1083
|
+
type: Component,
|
|
1084
|
+
args: [{ selector: 'ng-fad-signature-fea-signature-summary', template: "<div class=\"fad-portal-content\">\n \n <ng-container *ngIf=\"!isAllDocumentsRejected\" >\n <ng-fad-image-inline\n [src]=\"images.send\"\n >\n </ng-fad-image-inline>\n <div class=\"fad-portal-title-bold\">\n {{pdfsName}}\n </div>\n <div class=\"fad-portal-content-bold date\">{{ currentDate }}</div>\n <div class=\"summary\">\n <div class=\"fad-portal-content-bold signeds\">\n <div>{{configuration.customization?.moduleCustomization?.legends?.signed}}</div>\n <div>{{signedCount}}</div>\n </div>\n <div class=\"line\">\n\n </div>\n <div class=\"fad-portal-content-bold rejecteds\">\n <div>{{configuration.customization?.moduleCustomization?.legends?.rejected}}</div>\n <div>{{rejectedCount}}</div>\n </div>\n </div>\n <div class=\"legends\">\n {{configuration.customization?.moduleCustomization?.legends?.legend}}\n </div>\n </ng-container>\n <ng-container *ngIf=\"isAllDocumentsRejected\" >\n <ng-fad-image-inline\n [src]=\"images.reject\"\n >\n </ng-fad-image-inline>\n <div class=\"document-rejected\"> {{configuration.customization?.moduleCustomization?.legends?.documentRejected}} </div>\n <div class=\"fad-portal-title-bold title-document\">\n {{pdfsName}}\n </div>\n <div class=\"id-requisition\">\n ID {{id}} | {{ currentDate }}\n </div>\n </ng-container>\n \n</div>", styles: [".fad-portal-content{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;row-gap:var(--fad-portal-common-separation-sm)}.fad-portal-content .fad-portal-title{margin-top:var(--fad-portal-common-separation-sm);margin-bottom:var(--fad-portal-common-separation-sm)}.fad-portal-content .date{color:#aaa}.fad-portal-content .summary{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;row-gap:var(--fad-portal-common-separation-sm);margin-bottom:var(--fad-portal-common-separation-xs)}.fad-portal-content .summary .signeds,.fad-portal-content .summary .rejecteds{width:100%;display:flex;justify-content:space-between}.fad-portal-content .summary .line{width:100%;border:1px solid var(--fad-portal-common-border-color)}.fad-portal-content .legends{text-align:center}.fad-portal-content .document-rejected{color:#aaa;margin-bottom:var(--fad-portal-common-separation-sm)}.fad-portal-content .id-requisition{color:#aaa;margin-top:var(--fad-portal-common-separation-sm)}\n"] }]
|
|
1085
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { documentRequest: [{
|
|
1086
|
+
type: Input
|
|
1087
|
+
}], configuration: [{
|
|
1088
|
+
type: Input
|
|
1089
|
+
}], oncomplete: [{
|
|
1090
|
+
type: Output
|
|
1091
|
+
}] } });
|
|
1092
|
+
|
|
1093
|
+
class NgFadSignatureFeaModule {
|
|
1094
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgFadSignatureFeaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1095
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgFadSignatureFeaModule, declarations: [ValidateRfcComponent,
|
|
1096
|
+
DocumentApprovalListComponent,
|
|
1097
|
+
UploadESignatureComponent,
|
|
1098
|
+
PdfViewerFeaComponent,
|
|
1099
|
+
GenericErrorFeaComponent,
|
|
1100
|
+
ValidateSignatureComponent,
|
|
1101
|
+
SignatureSummaryComponent], imports: [CommonModule,
|
|
1102
|
+
ReactiveFormsModule,
|
|
1103
|
+
NgFadSharedModule,
|
|
1104
|
+
NgFadImageInlineModule,
|
|
1105
|
+
NgFadViewerModule], exports: [ValidateRfcComponent,
|
|
1106
|
+
DocumentApprovalListComponent,
|
|
1107
|
+
UploadESignatureComponent,
|
|
1108
|
+
PdfViewerFeaComponent,
|
|
1109
|
+
GenericErrorFeaComponent,
|
|
1110
|
+
ValidateSignatureComponent,
|
|
1111
|
+
SignatureSummaryComponent] }); }
|
|
1112
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgFadSignatureFeaModule, imports: [CommonModule,
|
|
1113
|
+
ReactiveFormsModule,
|
|
1114
|
+
NgFadSharedModule,
|
|
1115
|
+
NgFadImageInlineModule,
|
|
1116
|
+
NgFadViewerModule] }); }
|
|
1117
|
+
}
|
|
1118
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgFadSignatureFeaModule, decorators: [{
|
|
1119
|
+
type: NgModule,
|
|
1120
|
+
args: [{
|
|
1121
|
+
declarations: [
|
|
1122
|
+
ValidateRfcComponent,
|
|
1123
|
+
DocumentApprovalListComponent,
|
|
1124
|
+
UploadESignatureComponent,
|
|
1125
|
+
PdfViewerFeaComponent,
|
|
1126
|
+
GenericErrorFeaComponent,
|
|
1127
|
+
ValidateSignatureComponent,
|
|
1128
|
+
SignatureSummaryComponent
|
|
1129
|
+
],
|
|
1130
|
+
imports: [
|
|
1131
|
+
CommonModule,
|
|
1132
|
+
ReactiveFormsModule,
|
|
1133
|
+
NgFadSharedModule,
|
|
1134
|
+
NgFadImageInlineModule,
|
|
1135
|
+
NgFadViewerModule,
|
|
1136
|
+
],
|
|
1137
|
+
exports: [
|
|
1138
|
+
ValidateRfcComponent,
|
|
1139
|
+
DocumentApprovalListComponent,
|
|
1140
|
+
UploadESignatureComponent,
|
|
1141
|
+
PdfViewerFeaComponent,
|
|
1142
|
+
GenericErrorFeaComponent,
|
|
1143
|
+
ValidateSignatureComponent,
|
|
1144
|
+
SignatureSummaryComponent
|
|
1145
|
+
]
|
|
1146
|
+
}]
|
|
1147
|
+
}] });
|
|
1148
|
+
|
|
1149
|
+
/*
|
|
1150
|
+
* Public API Surface of ng-fad-signature-fea
|
|
1151
|
+
*/
|
|
1152
|
+
|
|
1153
|
+
/**
|
|
1154
|
+
* Generated bundle index. Do not edit.
|
|
1155
|
+
*/
|
|
1156
|
+
|
|
1157
|
+
export { DOCUMENT_APPROVAL_LIST_DEFAULT, DocumentApprovalListComponent, DocumentApprovalListErrorCode, GENERIC_ERROR_FEA_CONFIGURATION_DEFAULT, GenericErrorFeaComponent, GenericErrorFeaErrorCode, NgFadSignatureFeaModule, PDF_VIEWER_FEA_DEFAULT, PdfViewerFeaComponent, SIGNATURE_FEA_CONFIGURATION_DEFAULT, SignatureSummaryComponent, UPLOAD_E_SIGNATURE_CONFIGURATION_DEFAULT, UploadESignatureComponent, UploadESignatureErrorCode, VALIDATE_SIGNATURE_CONFIGURATION_DEFAULT, ValidateRFCErrorCode, ValidateRfcComponent, ValidateSignatureComponent, ValidateSignatureErrorCode, getDocumentApprovalListErrorDescription, getGenericErrorFeaErrorDescription, getUploadESignatureErrorDescription, getValidateRFCErrorDescription, getValidateSignatureErrorDescription };
|
|
1158
|
+
//# sourceMappingURL=fad-producto-portal-ng-fad-signature-fea.mjs.map
|