@pepperi/lib
Version:
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.0.1.
537 lines • 64.4 kB
JavaScript
import { Component, ViewChild, Input, Output, EventEmitter, ChangeDetectionStrategy, TemplateRef } from '@angular/core';
import { LAYOUT_TYPE, CustomizationService } from '@pepperi/lib';
import * as i0 from "@angular/core";
import * as i1 from "@pepperi/lib/dialog";
import * as i2 from "@pepperi/lib";
import * as i3 from "@angular/forms";
import * as i4 from "@angular/common";
import * as i5 from "@angular/material/form-field";
import * as i6 from "@angular/material/input";
import * as i7 from "@angular/material/button";
import * as i8 from "@angular/material/icon";
import * as i9 from "@pepperi/lib/icon";
import * as i10 from "@pepperi/lib/field-title";
import * as i11 from "@angular/material/dialog";
import * as i12 from "angular2-signaturepad";
import * as i13 from "@ngx-translate/core";
const _c0 = ["signaturePad"];
const _c1 = ["signaturePopupPad"];
function PepperiSignatureComponent_ng_template_2_ng_container_3_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementContainer(0);
} }
const _c2 = function (a0) { return { "right-alignment": a0 }; };
function PepperiSignatureComponent_ng_template_2_ng_template_4_button_0_Template(rf, ctx) { if (rf & 1) {
const _r16 = i0.ɵɵgetCurrentView();
i0.ɵɵelementStart(0, "button", 16);
i0.ɵɵlistener("click", function PepperiSignatureComponent_ng_template_2_ng_template_4_button_0_Template_button_click_0_listener($event) { i0.ɵɵrestoreView(_r16); const ctx_r15 = i0.ɵɵnextContext(3); return ctx_r15.deleteSignature($event); });
i0.ɵɵelementStart(1, "mat-icon");
i0.ɵɵelement(2, "pep-icon", 17);
i0.ɵɵelementEnd();
i0.ɵɵelementEnd();
} if (rf & 2) {
const ctx_r14 = i0.ɵɵnextContext(3);
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(1, _c2, ctx_r14.xAlignment == "2"));
} }
const _c3 = function (a0) { return [a0]; };
function PepperiSignatureComponent_ng_template_2_ng_template_4_Template(rf, ctx) { if (rf & 1) {
const _r18 = i0.ɵɵgetCurrentView();
i0.ɵɵtemplate(0, PepperiSignatureComponent_ng_template_2_ng_template_4_button_0_Template, 3, 3, "button", 13);
i0.ɵɵelementStart(1, "div", 14);
i0.ɵɵlistener("click", function PepperiSignatureComponent_ng_template_2_ng_template_4_Template_div_click_1_listener() { i0.ɵɵrestoreView(_r18); const ctx_r17 = i0.ɵɵnextContext(2); return ctx_r17.openSignModal(); });
i0.ɵɵelementStart(2, "img", 15);
i0.ɵɵlistener("error", function PepperiSignatureComponent_ng_template_2_ng_template_4_Template_img_error_2_listener($event) { i0.ɵɵrestoreView(_r18); const ctx_r19 = i0.ɵɵnextContext(2); return ctx_r19.errorHandler($event); });
i0.ɵɵelementEnd();
i0.ɵɵelementEnd();
} if (rf & 2) {
const ctx_r11 = i0.ɵɵnextContext(2);
i0.ɵɵproperty("ngIf", !ctx_r11.disabled);
i0.ɵɵadvance(2);
i0.ɵɵstyleProp("max-height", ctx_r11.fieldHeight);
i0.ɵɵproperty("src", ctx_r11.src, i0.ɵɵsanitizeUrl)("alt", ctx_r11.label)("ngClass", i0.ɵɵpureFunction1(6, _c3, "text-align-" + ctx_r11.xAlignment));
} }
function PepperiSignatureComponent_ng_template_2_ng_template_6_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementStart(0, "div", 18);
i0.ɵɵelement(1, "pep-icon", 19);
i0.ɵɵelementStart(2, "span", 20);
i0.ɵɵtext(3);
i0.ɵɵpipe(4, "translate");
i0.ɵɵelementEnd();
i0.ɵɵelementEnd();
} if (rf & 2) {
const ctx_r13 = i0.ɵɵnextContext(2);
i0.ɵɵadvance(3);
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(4, 1, ctx_r13.disabled ? "SignaturePad_MissingSignature" : "SignaturePad_PleaseSignUp"), " ");
} }
const _c4 = function (a0) { return { disable: a0 }; };
const _c5 = function (a0) { return { field: a0 }; };
function PepperiSignatureComponent_ng_template_2_Template(rf, ctx) { if (rf & 1) {
const _r21 = i0.ɵɵgetCurrentView();
i0.ɵɵelementStart(0, "mat-form-field", 5);
i0.ɵɵelementStart(1, "div", 6);
i0.ɵɵelementStart(2, "div", 7);
i0.ɵɵtemplate(3, PepperiSignatureComponent_ng_template_2_ng_container_3_Template, 1, 0, "ng-container", 8);
i0.ɵɵtemplate(4, PepperiSignatureComponent_ng_template_2_ng_template_4_Template, 3, 8, "ng-template", null, 9, i0.ɵɵtemplateRefExtractor);
i0.ɵɵtemplate(6, PepperiSignatureComponent_ng_template_2_ng_template_6_Template, 5, 3, "ng-template", null, 10, i0.ɵɵtemplateRefExtractor);
i0.ɵɵelementEnd();
i0.ɵɵelementStart(8, "input", 11);
i0.ɵɵlistener("click", function PepperiSignatureComponent_ng_template_2_Template_input_click_8_listener() { i0.ɵɵrestoreView(_r21); const ctx_r20 = i0.ɵɵnextContext(); return ctx_r20.openSignModal(); })("keypress", function PepperiSignatureComponent_ng_template_2_Template_input_keypress_8_listener($event) { i0.ɵɵrestoreView(_r21); const ctx_r22 = i0.ɵɵnextContext(); return ctx_r22.onKeyPress_OpenSignModal($event); });
i0.ɵɵelementEnd();
i0.ɵɵelementEnd();
i0.ɵɵelementStart(9, "mat-error");
i0.ɵɵelement(10, "span", 12);
i0.ɵɵpipe(11, "translate");
i0.ɵɵpipe(12, "translate");
i0.ɵɵpipe(13, "translate");
i0.ɵɵpipe(14, "translate");
i0.ɵɵelementEnd();
i0.ɵɵelementEnd();
} if (rf & 2) {
const _r10 = i0.ɵɵreference(5);
const _r12 = i0.ɵɵreference(7);
const ctx_r1 = i0.ɵɵnextContext();
i0.ɵɵproperty("formGroup", ctx_r1.form);
i0.ɵɵadvance(2);
i0.ɵɵstyleProp("height", ctx_r1.fieldHeight);
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(25, _c4, ctx_r1.disabled));
i0.ɵɵadvance(1);
i0.ɵɵproperty("ngIf", ctx_r1.src != "")("ngIfThen", _r10)("ngIfElse", _r12);
i0.ɵɵadvance(5);
i0.ɵɵproperty("id", ctx_r1.key)("formControlName", ctx_r1.key)("value", ctx_r1.src)("disabled", ctx_r1.disabled);
i0.ɵɵadvance(2);
i0.ɵɵproperty("title", ctx_r1.required && ctx_r1.src.length == 0 ? i0.ɵɵpipeBind2(11, 13, "Msg_Is_Required", i0.ɵɵpureFunction1(27, _c5, ctx_r1.label)) : i0.ɵɵpipeBind2(12, 16, "Msg_Is_Not_Valid", i0.ɵɵpureFunction1(29, _c5, ctx_r1.label)))("innerText", ctx_r1.required && ctx_r1.src.length == 0 ? i0.ɵɵpipeBind2(13, 19, "Msg_Is_Required", i0.ɵɵpureFunction1(31, _c5, ctx_r1.label)) : i0.ɵɵpipeBind2(14, 22, "Msg_Is_Not_Valid", i0.ɵɵpureFunction1(33, _c5, ctx_r1.label)));
} }
function PepperiSignatureComponent_ng_container_4_ng_container_3_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementContainer(0);
} }
const _c6 = function (a0, a1) { return { "one-row": a0, "stand-alone": a1 }; };
function PepperiSignatureComponent_ng_container_4_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementContainerStart(0);
i0.ɵɵelementStart(1, "div", 21);
i0.ɵɵelement(2, "pep-field-title", 22);
i0.ɵɵtemplate(3, PepperiSignatureComponent_ng_container_4_ng_container_3_Template, 1, 0, "ng-container", 23);
i0.ɵɵelementEnd();
i0.ɵɵelementContainerEnd();
} if (rf & 2) {
const ctx_r2 = i0.ɵɵnextContext();
const _r0 = i0.ɵɵreference(3);
i0.ɵɵadvance(1);
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(7, _c6, ctx_r2.rowSpan == 1, ctx_r2.standAlone));
i0.ɵɵadvance(1);
i0.ɵɵproperty("label", ctx_r2.label)("required", ctx_r2.required)("disabled", ctx_r2.disabled)("xAlignment", ctx_r2.xAlignment)("showTitle", ctx_r2.showTitle);
i0.ɵɵadvance(1);
i0.ɵɵproperty("ngTemplateOutlet", _r0);
} }
function PepperiSignatureComponent_ng_container_5_ng_container_1_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementContainer(0);
} }
function PepperiSignatureComponent_ng_container_5_ng_template_2_ng_container_1_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementContainer(0);
} }
const _c7 = function (a0) { return { "one-row": a0 }; };
function PepperiSignatureComponent_ng_container_5_ng_template_2_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementStart(0, "div", 21);
i0.ɵɵtemplate(1, PepperiSignatureComponent_ng_container_5_ng_template_2_ng_container_1_Template, 1, 0, "ng-container", 23);
i0.ɵɵelementEnd();
} if (rf & 2) {
const ctx_r26 = i0.ɵɵnextContext(2);
const _r0 = i0.ɵɵreference(3);
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(2, _c7, ctx_r26.rowSpan == 1));
i0.ɵɵadvance(1);
i0.ɵɵproperty("ngTemplateOutlet", _r0);
} }
function PepperiSignatureComponent_ng_container_5_ng_template_4_ng_container_1_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementContainer(0);
} }
const _c8 = function () { return { isTableView: false }; };
function PepperiSignatureComponent_ng_container_5_ng_template_4_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementStart(0, "div", 21);
i0.ɵɵtemplate(1, PepperiSignatureComponent_ng_container_5_ng_template_4_ng_container_1_Template, 1, 0, "ng-container", 26);
i0.ɵɵelementEnd();
} if (rf & 2) {
const ctx_r28 = i0.ɵɵnextContext(2);
const _r5 = i0.ɵɵreference(8);
i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(3, _c7, ctx_r28.rowSpan == 1));
i0.ɵɵadvance(1);
i0.ɵɵproperty("ngTemplateOutlet", _r5)("ngTemplateOutletContext", i0.ɵɵpureFunction0(5, _c8));
} }
function PepperiSignatureComponent_ng_container_5_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementContainerStart(0);
i0.ɵɵtemplate(1, PepperiSignatureComponent_ng_container_5_ng_container_1_Template, 1, 0, "ng-container", 8);
i0.ɵɵtemplate(2, PepperiSignatureComponent_ng_container_5_ng_template_2_Template, 2, 4, "ng-template", null, 24, i0.ɵɵtemplateRefExtractor);
i0.ɵɵtemplate(4, PepperiSignatureComponent_ng_container_5_ng_template_4_Template, 2, 6, "ng-template", null, 25, i0.ɵɵtemplateRefExtractor);
i0.ɵɵelementContainerEnd();
} if (rf & 2) {
const _r25 = i0.ɵɵreference(3);
const _r27 = i0.ɵɵreference(5);
const ctx_r3 = i0.ɵɵnextContext();
i0.ɵɵadvance(1);
i0.ɵɵproperty("ngIf", false && ctx_r3.isActive && !ctx_r3.disabled)("ngIfThen", _r25)("ngIfElse", _r27);
} }
function PepperiSignatureComponent_ng_container_6_ng_container_1_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementContainer(0);
} }
function PepperiSignatureComponent_ng_container_6_ng_template_2_ng_container_1_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementContainer(0);
} }
function PepperiSignatureComponent_ng_container_6_ng_template_2_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementStart(0, "div", 27);
i0.ɵɵtemplate(1, PepperiSignatureComponent_ng_container_6_ng_template_2_ng_container_1_Template, 1, 0, "ng-container", 23);
i0.ɵɵelementEnd();
} if (rf & 2) {
i0.ɵɵnextContext(2);
const _r0 = i0.ɵɵreference(3);
i0.ɵɵadvance(1);
i0.ɵɵproperty("ngTemplateOutlet", _r0);
} }
function PepperiSignatureComponent_ng_container_6_ng_template_4_ng_container_1_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementContainer(0);
} }
const _c9 = function () { return { isTableView: true }; };
function PepperiSignatureComponent_ng_container_6_ng_template_4_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementStart(0, "div", 27);
i0.ɵɵtemplate(1, PepperiSignatureComponent_ng_container_6_ng_template_4_ng_container_1_Template, 1, 0, "ng-container", 26);
i0.ɵɵelementEnd();
} if (rf & 2) {
i0.ɵɵnextContext(2);
const _r5 = i0.ɵɵreference(8);
i0.ɵɵadvance(1);
i0.ɵɵproperty("ngTemplateOutlet", _r5)("ngTemplateOutletContext", i0.ɵɵpureFunction0(2, _c9));
} }
function PepperiSignatureComponent_ng_container_6_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementContainerStart(0);
i0.ɵɵtemplate(1, PepperiSignatureComponent_ng_container_6_ng_container_1_Template, 1, 0, "ng-container", 8);
i0.ɵɵtemplate(2, PepperiSignatureComponent_ng_container_6_ng_template_2_Template, 2, 1, "ng-template", null, 24, i0.ɵɵtemplateRefExtractor);
i0.ɵɵtemplate(4, PepperiSignatureComponent_ng_container_6_ng_template_4_Template, 2, 3, "ng-template", null, 25, i0.ɵɵtemplateRefExtractor);
i0.ɵɵelementContainerEnd();
} if (rf & 2) {
const _r32 = i0.ɵɵreference(3);
const _r34 = i0.ɵɵreference(5);
const ctx_r4 = i0.ɵɵnextContext();
i0.ɵɵadvance(1);
i0.ɵɵproperty("ngIf", false && ctx_r4.isActive && !ctx_r4.disabled)("ngIfThen", _r32)("ngIfElse", _r34);
} }
function PepperiSignatureComponent_ng_template_7_ng_container_3_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementContainer(0);
} }
function PepperiSignatureComponent_ng_template_7_ng_template_4_img_1_Template(rf, ctx) { if (rf & 1) {
const _r47 = i0.ɵɵgetCurrentView();
i0.ɵɵelementStart(0, "img", 15);
i0.ɵɵlistener("error", function PepperiSignatureComponent_ng_template_7_ng_template_4_img_1_Template_img_error_0_listener($event) { i0.ɵɵrestoreView(_r47); const ctx_r46 = i0.ɵɵnextContext(3); return ctx_r46.errorHandler($event); });
i0.ɵɵelementEnd();
} if (rf & 2) {
const ctx_r44 = i0.ɵɵnextContext(3);
i0.ɵɵstyleProp("max-height", ctx_r44.fieldHeight);
i0.ɵɵproperty("src", ctx_r44.src, i0.ɵɵsanitizeUrl)("alt", ctx_r44.label)("ngClass", i0.ɵɵpureFunction1(5, _c3, "text-align-" + ctx_r44.xAlignment));
} }
function PepperiSignatureComponent_ng_template_7_ng_template_4_img_2_Template(rf, ctx) { if (rf & 1) {
const _r49 = i0.ɵɵgetCurrentView();
i0.ɵɵelementStart(0, "img", 32);
i0.ɵɵlistener("error", function PepperiSignatureComponent_ng_template_7_ng_template_4_img_2_Template_img_error_0_listener($event) { i0.ɵɵrestoreView(_r49); const ctx_r48 = i0.ɵɵnextContext(3); return ctx_r48.errorHandler($event); });
i0.ɵɵelementEnd();
} if (rf & 2) {
const ctx_r45 = i0.ɵɵnextContext(3);
i0.ɵɵstyleProp("max-height", ctx_r45.fieldHeight);
i0.ɵɵproperty("src", ctx_r45.src, i0.ɵɵsanitizeUrl)("alt", ctx_r45.label)("ngClass", i0.ɵɵpureFunction1(5, _c3, "text-align-" + ctx_r45.xAlignment));
} }
function PepperiSignatureComponent_ng_template_7_ng_template_4_Template(rf, ctx) { if (rf & 1) {
const _r51 = i0.ɵɵgetCurrentView();
i0.ɵɵelementStart(0, "div", 14);
i0.ɵɵlistener("click", function PepperiSignatureComponent_ng_template_7_ng_template_4_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r51); const ctx_r50 = i0.ɵɵnextContext(2); return ctx_r50.openSignModal(); });
i0.ɵɵtemplate(1, PepperiSignatureComponent_ng_template_7_ng_template_4_img_1_Template, 1, 7, "img", 30);
i0.ɵɵtemplate(2, PepperiSignatureComponent_ng_template_7_ng_template_4_img_2_Template, 1, 7, "img", 31);
i0.ɵɵelementEnd();
} if (rf & 2) {
const isTableView_r38 = i0.ɵɵnextContext().isTableView;
i0.ɵɵadvance(1);
i0.ɵɵproperty("ngIf", !isTableView_r38);
i0.ɵɵadvance(1);
i0.ɵɵproperty("ngIf", isTableView_r38);
} }
function PepperiSignatureComponent_ng_template_7_ng_template_6_Template(rf, ctx) { }
function PepperiSignatureComponent_ng_template_7_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementStart(0, "div", 28);
i0.ɵɵelementStart(1, "div", 6);
i0.ɵɵelementStart(2, "div", 29);
i0.ɵɵtemplate(3, PepperiSignatureComponent_ng_template_7_ng_container_3_Template, 1, 0, "ng-container", 8);
i0.ɵɵtemplate(4, PepperiSignatureComponent_ng_template_7_ng_template_4_Template, 3, 2, "ng-template", null, 9, i0.ɵɵtemplateRefExtractor);
i0.ɵɵtemplate(6, PepperiSignatureComponent_ng_template_7_ng_template_6_Template, 0, 0, "ng-template", null, 10, i0.ɵɵtemplateRefExtractor);
i0.ɵɵelementEnd();
i0.ɵɵelementEnd();
i0.ɵɵelementEnd();
} if (rf & 2) {
const _r40 = i0.ɵɵreference(5);
const _r42 = i0.ɵɵreference(7);
const ctx_r6 = i0.ɵɵnextContext();
i0.ɵɵadvance(3);
i0.ɵɵproperty("ngIf", ctx_r6.src != "")("ngIfThen", _r40)("ngIfElse", _r42);
} }
function PepperiSignatureComponent_ng_template_9_div_10_Template(rf, ctx) { if (rf & 1) {
const _r56 = i0.ɵɵgetCurrentView();
i0.ɵɵelementStart(0, "div", 41);
i0.ɵɵelementStart(1, "div", 42);
i0.ɵɵelementStart(2, "button", 43);
i0.ɵɵlistener("click", function PepperiSignatureComponent_ng_template_9_div_10_Template_button_click_2_listener($event) { i0.ɵɵrestoreView(_r56); const ctx_r55 = i0.ɵɵnextContext(2); return ctx_r55.saveSignModal($event); });
i0.ɵɵtext(3);
i0.ɵɵpipe(4, "translate");
i0.ɵɵelementEnd();
i0.ɵɵelementStart(5, "button", 44);
i0.ɵɵlistener("click", function PepperiSignatureComponent_ng_template_9_div_10_Template_button_click_5_listener() { i0.ɵɵrestoreView(_r56); const ctx_r57 = i0.ɵɵnextContext(2); return ctx_r57.clearSignModal(); });
i0.ɵɵtext(6);
i0.ɵɵpipe(7, "translate");
i0.ɵɵelementEnd();
i0.ɵɵelementEnd();
i0.ɵɵelementEnd();
} if (rf & 2) {
const ctx_r54 = i0.ɵɵnextContext(2);
i0.ɵɵadvance(2);
i0.ɵɵproperty("disabled", !ctx_r54.showActionBtn || ctx_r54.readonly || ctx_r54.disabled)("mat-dialog-close", ctx_r54.signatureURL);
i0.ɵɵadvance(1);
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(4, 5, "Done"), " ");
i0.ɵɵadvance(2);
i0.ɵɵproperty("disabled", !ctx_r54.showActionBtn || ctx_r54.readonly || ctx_r54.disabled);
i0.ɵɵadvance(1);
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(7, 7, "Clear"), " ");
} }
function PepperiSignatureComponent_ng_template_9_Template(rf, ctx) { if (rf & 1) {
const _r59 = i0.ɵɵgetCurrentView();
i0.ɵɵelementStart(0, "h2", 33);
i0.ɵɵelementStart(1, "span", 34);
i0.ɵɵtext(2);
i0.ɵɵpipe(3, "translate");
i0.ɵɵelementEnd();
i0.ɵɵelementStart(4, "button", 35);
i0.ɵɵelementStart(5, "mat-icon");
i0.ɵɵelement(6, "pep-icon", 36);
i0.ɵɵelementEnd();
i0.ɵɵelementEnd();
i0.ɵɵelementEnd();
i0.ɵɵelementStart(7, "div", 37);
i0.ɵɵelementStart(8, "signature-pad", 38, 39);
i0.ɵɵlistener("onBeginEvent", function PepperiSignatureComponent_ng_template_9_Template_signature_pad_onBeginEvent_8_listener() { i0.ɵɵrestoreView(_r59); const ctx_r58 = i0.ɵɵnextContext(); return ctx_r58.drawStart(); })("onEndEvent", function PepperiSignatureComponent_ng_template_9_Template_signature_pad_onEndEvent_8_listener() { i0.ɵɵrestoreView(_r59); const ctx_r60 = i0.ɵɵnextContext(); return ctx_r60.drawComplete(); });
i0.ɵɵelementEnd();
i0.ɵɵelementEnd();
i0.ɵɵtemplate(10, PepperiSignatureComponent_ng_template_9_div_10_Template, 8, 9, "div", 40);
} if (rf & 2) {
const ctx_r8 = i0.ɵɵnextContext();
i0.ɵɵadvance(2);
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 4, "SignaturePad_PleaseSignUpModalTitle"));
i0.ɵɵadvance(2);
i0.ɵɵproperty("mat-dialog-close", null);
i0.ɵɵadvance(4);
i0.ɵɵproperty("options", ctx_r8.signaturePadOptions);
i0.ɵɵadvance(2);
i0.ɵɵproperty("ngIf", ctx_r8.showActionBtn);
} }
export class PepperiSignatureComponent {
constructor(dialogService, customizationService, fileService, cd, renderer, element) {
this.dialogService = dialogService;
this.customizationService = customizationService;
this.fileService = fileService;
this.cd = cd;
this.renderer = renderer;
this.element = element;
this.key = '';
this.src = '';
this.label = '';
this.required = false;
this.disabled = false;
this.readonly = false;
this.xAlignment = '0';
this.rowSpan = 1;
this.signatureURL = '';
// @Input() inDialog = false;
this.controlType = 'signature';
this.form = null;
this.showTitle = true;
this.layoutType = LAYOUT_TYPE.PepperiForm;
this.isActive = false;
this.valueChanged = new EventEmitter();
this.LAYOUT_TYPE = LAYOUT_TYPE;
this.fieldHeight = '';
this.standAlone = false;
this.dataURI = null;
this.showActionBtn = true;
this.isVisibleModal = false;
this.acceptSignatureType = 'png';
this.signaturePadOptions = {
// passed through to szimek/signature_pad constructor
minWidth: 2,
canvasWidth: 500,
canvasHeight: 300,
penColor: 'rgb(151, 151, 151)'
};
}
ngOnInit() {
if (this.form === null) {
this.standAlone = true;
this.form = this.customizationService.getDefaultFromGroup(this.key, this.src, this.required, this.readonly, this.disabled);
this.renderer.addClass(this.element.nativeElement, CustomizationService.STAND_ALONE_FIELD_CLASS_NAME);
}
this.fieldHeight = this.customizationService.calculateFieldHeight(this.layoutType, this.rowSpan, this.standAlone);
}
ngOnChanges(changes) {
if (changes.src && changes.src.currentValue.length > 0) {
// Empty dataURI if there is change in the src.
this.dataURI = null;
// For clean the cache.
// this.src = this.src ? this.src + '?t=' + new Date().toTimeString() : '';
}
}
ngOnDestroy() {
if (this.valueChanged) {
this.valueChanged.unsubscribe();
}
}
drawComplete() {
// will be notified of szimek/signature_pad's onEnd event
}
drawStart() {
// will be notified of szimek/signature_pad's onBegin event
}
openSignModal() {
// If the signature is not empty open it in image viewer.
if (this.standAlone && this.dataURI) {
const fileStrArr = this.dataURI.fileStr.split(';');
if (fileStrArr.length === 2) {
const win = window.open('', '_blank');
const contentType = fileStrArr[0].split(':')[1];
const base64 = fileStrArr[1].split(',')[1];
const blob = this.fileService.convertFromb64toBlob(base64, contentType);
const url = URL.createObjectURL(blob);
win.location.href = url;
}
// signature allready exits
}
else {
this.signatureURL = this.src;
this.openSignatoreDlg(this.signatureURL);
}
}
openSignatoreDlg(src = '') {
this.showActionBtn = this.signatureURL && this.signatureURL !== '' ? false : true;
// const signatureData = new DialogData('', this.signaturePopupPad, DialogDataType.Template);
const dialogRef = this.dialogService.openDialog(this.signaturePopupPad);
dialogRef.afterOpened().subscribe(() => {
this.afterDialogOpened();
});
}
afterDialogOpened() {
if (this.signatureURL && this.signatureURL !== '') {
this.signaturePad.fromDataURL(this.signatureURL);
this.signaturePad.off();
}
}
clearSignModal() {
this.signatureURL = '';
this.signaturePad.clear();
this.signaturePad.on();
}
deleteSignature(event) {
this.signatureURL = '';
this.changeValue(this.signatureURL);
this.cd.detectChanges();
}
saveSignModal(event) {
if (!this.signaturePad.isEmpty()) {
this.signatureURL = this.signaturePad.toDataURL('image/png');
const fileValue = JSON.stringify({
acceptedExtensions: this.acceptSignatureType,
fileStr: this.signatureURL,
fileExt: this.acceptSignatureType
});
this.changeValue(fileValue);
}
else {
this.signatureURL = '';
this.changeValue(this.signatureURL);
}
}
errorHandler(event) {
this.signatureURL = this.src = ''; // this.blankImage;
}
changeValue(value, lastFocusedField = null) {
this.dataURI = value.length > 0 ? JSON.parse(value) : null;
this.src = this.standAlone && this.dataURI ? this.dataURI.fileStr : '';
this.customizationService.updateFormFieldValue(this.form, this.key, this.dataURI ? this.dataURI.fileExt : '');
this.valueChanged.emit({ apiName: this.key, value, controlType: this.controlType, lastFocusedField });
}
onKeyPress_OpenSignModal(event) {
const e = event;
if ([13, 32].indexOf(e.which) !== -1) {
this.openSignModal();
}
e.preventDefault();
}
}
PepperiSignatureComponent.ɵfac = function PepperiSignatureComponent_Factory(t) { return new (t || PepperiSignatureComponent)(i0.ɵɵdirectiveInject(i1.DialogService), i0.ɵɵdirectiveInject(i2.CustomizationService), i0.ɵɵdirectiveInject(i2.FileService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ElementRef)); };
PepperiSignatureComponent.ɵcmp = i0.ɵɵdefineComponent({ type: PepperiSignatureComponent, selectors: [["pep-signature"]], viewQuery: function PepperiSignatureComponent_Query(rf, ctx) { if (rf & 1) {
i0.ɵɵviewQuery(_c0, true);
i0.ɵɵviewQuery(_c1, true, TemplateRef);
} if (rf & 2) {
var _t;
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.signaturePad = _t.first);
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.signaturePopupPad = _t.first);
} }, inputs: { key: "key", src: "src", label: "label", required: "required", disabled: "disabled", readonly: "readonly", xAlignment: "xAlignment", rowSpan: "rowSpan", signatureURL: "signatureURL", form: "form", showTitle: "showTitle", layoutType: "layoutType", isActive: "isActive" }, outputs: { valueChanged: "valueChanged" }, features: [i0.ɵɵNgOnChangesFeature], decls: 11, vars: 4, consts: [[3, "formGroup"], ["pepperiTemplate", ""], [4, "ngIf"], ["pepperiReadonlyTemplate", ""], ["signaturePopupPad", ""], ["appearance", "outline", 3, "formGroup"], [1, "pepperi-file-wrapper"], [1, "pepperi-file", "body-sm", 3, "ngClass"], [4, "ngIf", "ngIfThen", "ngIfElse"], ["withImg", ""], ["noImg", ""], ["matInput", "", "type", "text", "autocomplete", "off", "readonly", "", 1, "hidden-input", "signature", 3, "id", "formControlName", "value", "disabled", "click", "keypress"], [1, "body-xs", 3, "title", "innerText"], ["mat-button", "", "class", "pepperi-button icon-button weak md delete", "tabindex", "-1", 3, "ngClass", "click", 4, "ngIf"], [1, "pepperi-file-preview", 3, "click"], [1, "pepperi-file-preview-img", 3, "src", "alt", "ngClass", "error"], ["mat-button", "", "tabindex", "-1", 1, "pepperi-button", "icon-button", "weak", "md", "delete", 3, "ngClass", "click"], ["name", "system_bin"], [1, "ellipsis", "pepperi-file-message"], ["name", "system_signature"], [1, "body-sm", "ellipsis"], [1, "pepperi-file-container", 3, "ngClass"], [3, "label", "required", "disabled", "xAlignment", "showTitle"], [4, "ngTemplateOutlet"], ["selectedBlock", ""], ["notSelectedBlock", ""], [4, "ngTemplateOutlet", "ngTemplateOutletContext"], [1, "pepperi-file-container", "one-row"], [1, "pepperi-file-container"], [1, "pepperi-file", "body-sm", "disable"], ["class", "pepperi-file-preview-img", 3, "src", "max-height", "alt", "ngClass", "error", 4, "ngIf"], ["class", "pepperi-report-file pepperi-file-preview-img", 3, "src", "max-height", "alt", "ngClass", "error", 4, "ngIf"], [1, "pepperi-report-file", "pepperi-file-preview-img", 3, "src", "alt", "ngClass", "error"], ["mat-dialog-title", "", 1, "pepperi-border-bottom"], [1, "pull-left", "flip", "ellipsis"], ["mat-button", "", 1, "pepperi-button", "icon-button", "md", "weak", "pull-right", "flip", 3, "mat-dialog-close"], ["name", "system_close"], ["mat-dialog-content", ""], [3, "options", "onBeginEvent", "onEndEvent"], ["signaturePad", ""], ["mat-dialog-actions", "", "class", " pepperi-border-top", 4, "ngIf"], ["mat-dialog-actions", "", 1, "pepperi-border-top"], [1, "spacing-element-negative"], ["mat-button", "", 1, "spacing-element", "pepperi-button", "md", "strong", "pull-right", "flip", 3, "disabled", "mat-dialog-close", "click"], ["mat-button", "", 1, "spacing-element", "pepperi-button", "md", "weak", "pull-right", "flip", 3, "disabled", "click"]], template: function PepperiSignatureComponent_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementContainerStart(0, 0);
i0.ɵɵelementContainerStart(1);
i0.ɵɵtemplate(2, PepperiSignatureComponent_ng_template_2_Template, 15, 35, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor);
i0.ɵɵtemplate(4, PepperiSignatureComponent_ng_container_4_Template, 4, 10, "ng-container", 2);
i0.ɵɵtemplate(5, PepperiSignatureComponent_ng_container_5_Template, 6, 3, "ng-container", 2);
i0.ɵɵtemplate(6, PepperiSignatureComponent_ng_container_6_Template, 6, 3, "ng-container", 2);
i0.ɵɵelementContainerEnd();
i0.ɵɵtemplate(7, PepperiSignatureComponent_ng_template_7_Template, 8, 3, "ng-template", null, 3, i0.ɵɵtemplateRefExtractor);
i0.ɵɵtemplate(9, PepperiSignatureComponent_ng_template_9_Template, 11, 6, "ng-template", null, 4, i0.ɵɵtemplateRefExtractor);
i0.ɵɵelementContainerEnd();
} if (rf & 2) {
i0.ɵɵproperty("formGroup", ctx.form);
i0.ɵɵadvance(4);
i0.ɵɵproperty("ngIf", ctx.layoutType === ctx.LAYOUT_TYPE.PepperiForm);
i0.ɵɵadvance(1);
i0.ɵɵproperty("ngIf", ctx.layoutType === ctx.LAYOUT_TYPE.PepperiCard);
i0.ɵɵadvance(1);
i0.ɵɵproperty("ngIf", ctx.layoutType === ctx.LAYOUT_TYPE.PepperiTable);
} }, directives: [i3.NgControlStatusGroup, i3.FormGroupDirective, i4.NgIf, i5.MatFormField, i4.NgClass, i6.MatInput, i3.DefaultValueAccessor, i3.NgControlStatus, i3.FormControlName, i5.MatError, i7.MatButton, i8.MatIcon, i9.PepperiIconComponent, i10.PepperiFieldTitleComponent, i4.NgTemplateOutlet, i11.MatDialogTitle, i11.MatDialogClose, i11.MatDialogContent, i12.SignaturePad, i11.MatDialogActions], pipes: [i13.TranslatePipe], styles: ["[_nghost-%COMP%]{display:block}signature-pad[_ngcontent-%COMP%]{display:-ms-grid;display:grid;height:inherit;width:inherit}"], changeDetection: 0 });
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(PepperiSignatureComponent, [{
type: Component,
args: [{
selector: 'pep-signature',
styleUrls: ['./signature.component.scss'],
templateUrl: './signature.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
}]
}], function () { return [{ type: i1.DialogService }, { type: i2.CustomizationService }, { type: i2.FileService }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: i0.ElementRef }]; }, { key: [{
type: Input
}], src: [{
type: Input
}], label: [{
type: Input
}], required: [{
type: Input
}], disabled: [{
type: Input
}], readonly: [{
type: Input
}], xAlignment: [{
type: Input
}], rowSpan: [{
type: Input
}], signatureURL: [{
type: Input
}], form: [{
type: Input
}], showTitle: [{
type: Input
}], layoutType: [{
type: Input
}], isActive: [{
type: Input
}], valueChanged: [{
type: Output
}], signaturePad: [{
type: ViewChild,
args: ['signaturePad']
}], signaturePopupPad: [{
type: ViewChild,
args: ['signaturePopupPad', { read: TemplateRef }]
}] }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2lnbmF0dXJlLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL3BlcHBlcmktbGliL3NpZ25hdHVyZS9zaWduYXR1cmUuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vcHJvamVjdHMvcGVwcGVyaS1saWIvc2lnbmF0dXJlL3NpZ25hdHVyZS5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0gsU0FBUyxFQUFxQixTQUFTLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxZQUFZLEVBQ3BFLHVCQUF1QixFQUFvQyxXQUFXLEVBQ3pFLE1BQU0sZUFBZSxDQUFDO0FBR3ZCLE9BQU8sRUFBZSxXQUFXLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSxjQUFjLENBQUM7Ozs7Ozs7Ozs7Ozs7Ozs7OztJQ0N0RCx3QkFBeUU7Ozs7O0lBRXJFLGtDQUdJO0lBSGlDLGlQQUFpQztJQUdsRSxnQ0FDSTtJQUFBLCtCQUNXO0lBQ2YsaUJBQVc7SUFDZixpQkFBUzs7O0lBTEwsK0VBQW9EOzs7OztJQUZ4RCw2R0FHSTtJQUtKLCtCQUNJO0lBRDhCLHVOQUF5QjtJQUN2RCwrQkFHSjtJQUZRLGtPQUE4QjtJQURsQyxpQkFH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