@pepperi-addons/ngx-lib 0.2.40 → 0.2.44
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/address/address.component.d.ts +3 -0
- package/address/pepperi-addons-ngx-lib-address.metadata.json +1 -1
- package/attachment/attachment.component.d.ts +3 -0
- package/attachment/pepperi-addons-ngx-lib-attachment.metadata.json +1 -1
- package/bundles/pepperi-addons-ngx-lib-address.umd.js +18 -0
- package/bundles/pepperi-addons-ngx-lib-address.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-attachment.umd.js +18 -0
- package/bundles/pepperi-addons-ngx-lib-attachment.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-button.umd.js +3 -3
- package/bundles/pepperi-addons-ngx-lib-button.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-checkbox.umd.js +1 -1
- package/bundles/pepperi-addons-ngx-lib-color.umd.js +27 -11
- package/bundles/pepperi-addons-ngx-lib-color.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-dialog.umd.js +1 -1
- package/bundles/pepperi-addons-ngx-lib-dialog.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-field-title.umd.js +3 -1
- package/bundles/pepperi-addons-ngx-lib-field-title.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-form.umd.js +1 -1
- package/bundles/pepperi-addons-ngx-lib-form.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-separator.umd.js +19 -1
- package/bundles/pepperi-addons-ngx-lib-separator.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-signature.umd.js +18 -0
- package/bundles/pepperi-addons-ngx-lib-signature.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-slider.umd.js +136 -0
- package/bundles/pepperi-addons-ngx-lib-slider.umd.js.map +1 -0
- package/checkbox/pepperi-addons-ngx-lib-checkbox.metadata.json +1 -1
- package/color/color-picker.component.d.ts +9 -3
- package/color/color-picker.component.theme.scss +2 -10
- package/color/pepperi-addons-ngx-lib-color.metadata.json +1 -1
- package/esm2015/address/address.component.js +15 -1
- package/esm2015/attachment/attachment.component.js +15 -1
- package/esm2015/button/button.component.js +4 -4
- package/esm2015/checkbox/checkbox.component.js +1 -1
- package/esm2015/color/color-picker.component.js +49 -8
- package/esm2015/color/color.module.js +3 -1
- package/esm2015/dialog/dialog.service.js +2 -2
- package/esm2015/field-title/field-title.component.js +4 -2
- package/esm2015/form/field-generator.component.js +2 -2
- package/esm2015/separator/separator.component.js +16 -2
- package/esm2015/signature/signature.component.js +15 -1
- package/esm2015/slider/pepperi-addons-ngx-lib-slider.js +5 -0
- package/esm2015/slider/public-api.js +6 -0
- package/esm2015/slider/slider.component.js +87 -0
- package/esm2015/slider/slider.module.js +25 -0
- package/fesm2015/pepperi-addons-ngx-lib-address.js +14 -0
- package/fesm2015/pepperi-addons-ngx-lib-address.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-attachment.js +14 -0
- package/fesm2015/pepperi-addons-ngx-lib-attachment.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-button.js +3 -3
- package/fesm2015/pepperi-addons-ngx-lib-button.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-checkbox.js +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-color.js +50 -7
- package/fesm2015/pepperi-addons-ngx-lib-color.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-dialog.js +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-dialog.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-field-title.js +3 -1
- package/fesm2015/pepperi-addons-ngx-lib-field-title.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-form.js +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-form.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-separator.js +15 -1
- package/fesm2015/pepperi-addons-ngx-lib-separator.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-signature.js +14 -0
- package/fesm2015/pepperi-addons-ngx-lib-signature.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-slider.js +120 -0
- package/fesm2015/pepperi-addons-ngx-lib-slider.js.map +1 -0
- package/field-title/field-title.component.d.ts +1 -0
- package/field-title/pepperi-addons-ngx-lib-field-title.metadata.json +1 -1
- package/form/pepperi-addons-ngx-lib-form.metadata.json +1 -1
- package/package.json +1 -1
- package/separator/pepperi-addons-ngx-lib-separator.metadata.json +1 -1
- package/separator/separator.component.d.ts +3 -0
- package/signature/pepperi-addons-ngx-lib-signature.metadata.json +1 -1
- package/signature/signature.component.d.ts +3 -0
- package/slider/package.json +11 -0
- package/slider/pepperi-addons-ngx-lib-slider.d.ts +4 -0
- package/slider/pepperi-addons-ngx-lib-slider.metadata.json +1 -0
- package/slider/public-api.d.ts +2 -0
- package/slider/slider.component.d.ts +34 -0
- package/slider/slider.component.theme.scss +65 -0
- package/slider/slider.module.d.ts +2 -0
- package/theming.scss +3 -0
|
@@ -12,8 +12,21 @@ class PepSeparatorComponent {
|
|
|
12
12
|
this.controlType = 'separator';
|
|
13
13
|
this.form = null;
|
|
14
14
|
this.layoutType = 'form';
|
|
15
|
+
this._visible = true;
|
|
15
16
|
this.standAlone = false;
|
|
16
17
|
}
|
|
18
|
+
set visible(visible) {
|
|
19
|
+
this._visible = visible;
|
|
20
|
+
if (visible) {
|
|
21
|
+
this.renderer.removeClass(this.element.nativeElement, 'hidden-element');
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
this.renderer.addClass(this.element.nativeElement, 'hidden-element');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
get visible() {
|
|
28
|
+
return this._visible;
|
|
29
|
+
}
|
|
17
30
|
ngOnInit() {
|
|
18
31
|
if (this.form === null) {
|
|
19
32
|
this.standAlone = true;
|
|
@@ -38,7 +51,8 @@ PepSeparatorComponent.propDecorators = {
|
|
|
38
51
|
label: [{ type: Input }],
|
|
39
52
|
xAlignment: [{ type: Input }],
|
|
40
53
|
form: [{ type: Input }],
|
|
41
|
-
layoutType: [{ type: Input }]
|
|
54
|
+
layoutType: [{ type: Input }],
|
|
55
|
+
visible: [{ type: Input }]
|
|
42
56
|
};
|
|
43
57
|
|
|
44
58
|
class PepSeparatorModule {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pepperi-addons-ngx-lib-separator.js","sources":["../../../projects/ngx-lib/separator/separator.component.ts","../../../projects/ngx-lib/separator/separator.module.ts","../../../projects/ngx-lib/separator/public-api.ts","../../../projects/ngx-lib/separator/pepperi-addons-ngx-lib-separator.ts"],"sourcesContent":["import {\n Component,\n Input,\n OnInit,\n ChangeDetectionStrategy,\n Renderer2,\n ElementRef,\n} from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport {\n PepLayoutType,\n PepCustomizationService,\n PepHorizontalAlignment,\n DEFAULT_HORIZONTAL_ALIGNMENT,\n} from '@pepperi-addons/ngx-lib';\n\n@Component({\n selector: 'pep-separator',\n templateUrl: './separator.component.html',\n styleUrls: ['./separator.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PepSeparatorComponent implements OnInit {\n @Input() key = '';\n @Input() label = '';\n @Input() xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n\n controlType = 'separator';\n\n @Input() form: FormGroup = null;\n @Input() layoutType: PepLayoutType = 'form';\n\n standAlone = false;\n\n constructor(private renderer: Renderer2, private element: ElementRef) {}\n\n ngOnInit(): void {\n if (this.form === null) {\n this.standAlone = true;\n\n this.renderer.addClass(\n this.element.nativeElement,\n PepCustomizationService.STAND_ALONE_FIELD_CLASS_NAME\n );\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { PepSeparatorComponent } from './separator.component';\n\n@NgModule({\n imports: [CommonModule],\n exports: [PepSeparatorComponent],\n declarations: [PepSeparatorComponent],\n})\nexport class PepSeparatorModule {}\n","/*\n * Public API Surface of ngx-lib/separator\n */\nexport * from './separator.module';\nexport * from './separator.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAsBa,qBAAqB;
|
|
1
|
+
{"version":3,"file":"pepperi-addons-ngx-lib-separator.js","sources":["../../../projects/ngx-lib/separator/separator.component.ts","../../../projects/ngx-lib/separator/separator.module.ts","../../../projects/ngx-lib/separator/public-api.ts","../../../projects/ngx-lib/separator/pepperi-addons-ngx-lib-separator.ts"],"sourcesContent":["import {\n Component,\n Input,\n OnInit,\n ChangeDetectionStrategy,\n Renderer2,\n ElementRef,\n} from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport {\n PepLayoutType,\n PepCustomizationService,\n PepHorizontalAlignment,\n DEFAULT_HORIZONTAL_ALIGNMENT,\n} from '@pepperi-addons/ngx-lib';\n\n@Component({\n selector: 'pep-separator',\n templateUrl: './separator.component.html',\n styleUrls: ['./separator.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PepSeparatorComponent implements OnInit {\n @Input() key = '';\n @Input() label = '';\n @Input() xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n\n controlType = 'separator';\n\n @Input() form: FormGroup = null;\n @Input() layoutType: PepLayoutType = 'form';\n\n private _visible = true;\n @Input()\n set visible(visible: boolean) {\n this._visible = visible;\n if (visible) {\n this.renderer.removeClass(\n this.element.nativeElement,\n 'hidden-element'\n );\n } else {\n this.renderer.addClass(\n this.element.nativeElement,\n 'hidden-element'\n );\n }\n }\n get visible(): boolean {\n return this._visible;\n }\n\n standAlone = false;\n\n constructor(private renderer: Renderer2, private element: ElementRef) { }\n\n ngOnInit(): void {\n if (this.form === null) {\n this.standAlone = true;\n\n this.renderer.addClass(\n this.element.nativeElement,\n PepCustomizationService.STAND_ALONE_FIELD_CLASS_NAME\n );\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { PepSeparatorComponent } from './separator.component';\n\n@NgModule({\n imports: [CommonModule],\n exports: [PepSeparatorComponent],\n declarations: [PepSeparatorComponent],\n})\nexport class PepSeparatorModule {}\n","/*\n * Public API Surface of ngx-lib/separator\n */\nexport * from './separator.module';\nexport * from './separator.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAsBa,qBAAqB;IAgC9B,YAAoB,QAAmB,EAAU,OAAmB;QAAhD,aAAQ,GAAR,QAAQ,CAAW;QAAU,YAAO,GAAP,OAAO,CAAY;QA/B3D,QAAG,GAAG,EAAE,CAAC;QACT,UAAK,GAAG,EAAE,CAAC;QACX,eAAU,GAA2B,4BAA4B,CAAC;QAE3E,gBAAW,GAAG,WAAW,CAAC;QAEjB,SAAI,GAAc,IAAI,CAAC;QACvB,eAAU,GAAkB,MAAM,CAAC;QAEpC,aAAQ,GAAG,IAAI,CAAC;QAoBxB,eAAU,GAAG,KAAK,CAAC;KAEsD;IArBzE,IACI,OAAO,CAAC,OAAgB;QACxB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,OAAO,EAAE;YACT,IAAI,CAAC,QAAQ,CAAC,WAAW,CACrB,IAAI,CAAC,OAAO,CAAC,aAAa,EAC1B,gBAAgB,CACnB,CAAC;SACL;aAAM;YACH,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAClB,IAAI,CAAC,OAAO,CAAC,aAAa,EAC1B,gBAAgB,CACnB,CAAC;SACL;KACJ;IACD,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC;KACxB;IAMD,QAAQ;QACJ,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,EAAE;YACpB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;YAEvB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAClB,IAAI,CAAC,OAAO,CAAC,aAAa,EAC1B,uBAAuB,CAAC,4BAA4B,CACvD,CAAC;SACL;KACJ;;;YAjDJ,SAAS,SAAC;gBACP,QAAQ,EAAE,eAAe;gBACzB,4uBAAyC;gBAEzC,eAAe,EAAE,uBAAuB,CAAC,MAAM;;aAClD;;;YAhBG,SAAS;YACT,UAAU;;;kBAiBT,KAAK;oBACL,KAAK;yBACL,KAAK;mBAIL,KAAK;yBACL,KAAK;sBAGL,KAAK;;;MCvBG,kBAAkB;;;YAL9B,QAAQ,SAAC;gBACN,OAAO,EAAE,CAAC,YAAY,CAAC;gBACvB,OAAO,EAAE,CAAC,qBAAqB,CAAC;gBAChC,YAAY,EAAE,CAAC,qBAAqB,CAAC;aACxC;;;ACTD;;;;ACAA;;;;;;"}
|
|
@@ -32,6 +32,7 @@ class PepSignatureComponent {
|
|
|
32
32
|
this._rowSpan = 1;
|
|
33
33
|
this.signatureURL = '';
|
|
34
34
|
// @Input() inDialog = false;
|
|
35
|
+
this._visible = true;
|
|
35
36
|
this.controlType = 'signature';
|
|
36
37
|
this.form = null;
|
|
37
38
|
this.showTitle = true;
|
|
@@ -59,6 +60,18 @@ class PepSignatureComponent {
|
|
|
59
60
|
get rowSpan() {
|
|
60
61
|
return this._rowSpan;
|
|
61
62
|
}
|
|
63
|
+
set visible(visible) {
|
|
64
|
+
this._visible = visible;
|
|
65
|
+
if (visible) {
|
|
66
|
+
this.renderer.removeClass(this.element.nativeElement, 'hidden-element');
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
this.renderer.addClass(this.element.nativeElement, 'hidden-element');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
get visible() {
|
|
73
|
+
return this._visible;
|
|
74
|
+
}
|
|
62
75
|
set layoutType(value) {
|
|
63
76
|
this._layoutType = value;
|
|
64
77
|
this.setFieldHeight();
|
|
@@ -214,6 +227,7 @@ PepSignatureComponent.propDecorators = {
|
|
|
214
227
|
xAlignment: [{ type: Input }],
|
|
215
228
|
rowSpan: [{ type: Input }],
|
|
216
229
|
signatureURL: [{ type: Input }],
|
|
230
|
+
visible: [{ type: Input }],
|
|
217
231
|
form: [{ type: Input }],
|
|
218
232
|
showTitle: [{ type: Input }],
|
|
219
233
|
layoutType: [{ type: Input }],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pepperi-addons-ngx-lib-signature.js","sources":["../../../projects/ngx-lib/signature/signature.component.ts","../../../projects/ngx-lib/signature/signature.module.ts","../../../projects/ngx-lib/signature/public-api.ts","../../../projects/ngx-lib/signature/pepperi-addons-ngx-lib-signature.ts"],"sourcesContent":["import {\n Component,\n OnInit,\n OnDestroy,\n ViewChild,\n Input,\n Output,\n EventEmitter,\n ChangeDetectorRef,\n ChangeDetectionStrategy,\n OnChanges,\n ElementRef,\n Renderer2,\n TemplateRef,\n} from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { SignaturePad } from 'ngx-signaturepad/signature-pad';\nimport {\n PepFileService,\n PepLayoutType,\n PepCustomizationService,\n PepHorizontalAlignment,\n DEFAULT_HORIZONTAL_ALIGNMENT,\n PepSignatureField,\n} from '@pepperi-addons/ngx-lib';\nimport { PepDialogService } from '@pepperi-addons/ngx-lib/dialog';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Component({\n selector: 'pep-signature',\n styleUrls: ['./signature.component.scss'],\n templateUrl: './signature.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PepSignatureComponent implements OnInit, OnChanges, OnDestroy {\n @Input() key = '';\n @Input() src = '';\n @Input() label = '';\n @Input() mandatory = false;\n @Input() disabled = false;\n @Input() readonly = false;\n @Input() xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n\n private _rowSpan = 1;\n @Input()\n set rowSpan(value) {\n this._rowSpan = value;\n this.setFieldHeight();\n }\n get rowSpan(): number {\n return this._rowSpan;\n }\n\n @Input() signatureURL = '';\n // @Input() inDialog = false;\n\n controlType = 'signature';\n\n @Input() form: FormGroup = null;\n @Input() showTitle = true;\n\n private _layoutType: PepLayoutType = 'form';\n @Input()\n set layoutType(value: PepLayoutType) {\n this._layoutType = value;\n this.setFieldHeight();\n }\n get layoutType(): PepLayoutType {\n return this._layoutType;\n }\n\n @Input() isActive = false;\n\n @Output()\n fileChange: EventEmitter<any> = new EventEmitter<any>();\n\n @ViewChild('signaturePad') signaturePad: SignaturePad;\n @ViewChild('signaturePopupPad', { read: TemplateRef })\n signaturePopupPad: TemplateRef<any>;\n dialogRef: MatDialogRef<any>;\n\n fieldHeight = '';\n standAlone = false;\n dataURI = null;\n showActionBtn = true;\n\n public isVisibleModal = false;\n acceptSignatureType = 'png';\n\n public signaturePadOptions: any = {\n // passed through to szimek/signature_pad constructor\n minWidth: 2,\n canvasWidth: 500,\n canvasHeight: 300,\n penColor: 'rgb(151, 151, 151)',\n };\n\n constructor(\n private dialogService: PepDialogService,\n private customizationService: PepCustomizationService,\n private fileService: PepFileService,\n private cd: ChangeDetectorRef,\n private renderer: Renderer2,\n private element: ElementRef\n ) { }\n\n private setFieldHeight(): void {\n this.fieldHeight = this.customizationService.calculateFieldHeight(\n this.layoutType,\n this.rowSpan,\n this.standAlone\n );\n }\n\n private setDefaultForm(): void {\n const pepField = new PepSignatureField({\n key: this.key,\n value: this.src,\n mandatory: this.mandatory,\n readonly: this.readonly,\n disabled: this.disabled,\n });\n this.form = this.customizationService.getDefaultFromGroup(pepField);\n }\n\n ngOnInit(): void {\n if (this.form === null) {\n this.standAlone = true;\n this.setFieldHeight();\n this.setDefaultForm();\n\n this.renderer.addClass(\n this.element.nativeElement,\n PepCustomizationService.STAND_ALONE_FIELD_CLASS_NAME\n );\n }\n }\n\n ngOnChanges(changes: any): void {\n if (this.standAlone) {\n this.setDefaultForm();\n }\n\n if (changes.src && changes.src.currentValue.length > 0) {\n // Empty dataURI if there is change in the src.\n this.dataURI = null;\n\n // For clean the cache.\n // this.src = this.src ? this.src + '?t=' + new Date().toTimeString() : '';\n }\n }\n\n ngOnDestroy(): void {\n //\n }\n\n drawComplete(): void {\n // will be notified of szimek/signature_pad's onEnd event\n }\n\n drawStart(): void {\n // will be notified of szimek/signature_pad's onBegin event\n }\n\n openSignModal(): void {\n // If the signature is not empty open it in image viewer.\n if (this.standAlone && this.dataURI) {\n const fileStrArr = this.dataURI.fileStr.split(';');\n\n if (fileStrArr.length === 2) {\n const win = window.open('', '_blank');\n const contentType = fileStrArr[0].split(':')[1];\n const base64 = fileStrArr[1].split(',')[1];\n const blob = this.fileService.convertFromb64toBlob(\n base64,\n contentType\n );\n const url = URL.createObjectURL(blob);\n win.location.href = url;\n }\n // signature allready exits\n } else {\n this.signatureURL = this.src;\n this.openSignatoreDlg(this.signatureURL);\n }\n }\n\n openSignatoreDlg(src = ''): void {\n this.showActionBtn =\n this.signatureURL && this.signatureURL !== '' ? false : true;\n\n this.dialogRef = this.dialogService.openDialog(this.signaturePopupPad);\n this.dialogRef.afterOpened().subscribe(() => {\n this.afterDialogOpened();\n });\n }\n\n afterDialogOpened(): void {\n if (this.signatureURL && this.signatureURL !== '') {\n this.signaturePad.fromDataURL(this.signatureURL);\n this.signaturePad.off();\n }\n }\n\n clearSignModal(): void {\n this.signatureURL = '';\n this.signaturePad.clear();\n this.signaturePad.on();\n }\n\n deleteSignature(event: any): void {\n this.signatureURL = '';\n this.changeValue(this.signatureURL);\n this.cd.detectChanges();\n }\n\n saveSignModal(event: any): void {\n if (!this.signaturePad.isEmpty()) {\n this.signatureURL = this.signaturePad.toDataURL('image/png');\n const fileValue = {\n acceptedExtensions: this.acceptSignatureType,\n fileStr: this.signatureURL,\n fileExt: this.acceptSignatureType,\n };\n this.changeValue(fileValue);\n } else {\n this.signatureURL = '';\n this.changeValue(this.signatureURL);\n }\n\n this.dialogRef.close(this.signatureURL);\n }\n\n errorHandler(event: any): void {\n this.signatureURL = this.src = ''; // this.blankImage;\n }\n\n changeValue(fileData: any): void {\n this.dataURI = fileData;\n this.src = this.standAlone && this.dataURI ? this.dataURI.fileStr : '';\n this.customizationService.updateFormFieldValue(\n this.form,\n this.key,\n this.dataURI ? this.dataURI.fileExt : ''\n );\n // this.valueChange.emit({\n // key: this.key,\n // value,\n // });\n\n this.fileChange.emit(fileData);\n // this.fileChange.emit(value.length > 0 ? JSON.parse(value) : value);\n }\n\n onKeyPress_OpenSignModal(event: any): void {\n const e = event as KeyboardEvent;\n\n if ([13, 32].indexOf(e.which) !== -1) {\n this.openSignModal();\n }\n e.preventDefault();\n }\n}","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { MatCommonModule } from '@angular/material/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatDialogModule } from '@angular/material/dialog';\n\nimport { SignaturePadModule } from 'ngx-signaturepad';\n\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\nimport {\n PepIconModule,\n PepIconRegistry,\n pepIconSystemBin,\n pepIconSystemSignature,\n pepIconSystemClose,\n} from '@pepperi-addons/ngx-lib/icon';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\nimport { PepFilesUploaderModule } from '@pepperi-addons/ngx-lib/files-uploader';\nimport { PepDialogModule } from '@pepperi-addons/ngx-lib/dialog';\n\nimport { PepSignatureComponent } from './signature.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n // Material modules\n MatCommonModule,\n MatButtonModule,\n MatFormFieldModule,\n MatInputModule,\n MatIconModule,\n MatDialogModule,\n // External modules\n SignaturePadModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepIconModule,\n PepFieldTitleModule,\n PepFilesUploaderModule,\n PepDialogModule,\n ],\n exports: [PepSignatureComponent],\n declarations: [PepSignatureComponent],\n})\nexport class PepSignatureModule {\n constructor(private pepIconRegistry: PepIconRegistry) {\n this.pepIconRegistry.registerIcons([\n pepIconSystemBin,\n pepIconSystemSignature,\n pepIconSystemClose,\n ]);\n }\n}\n","/*\n * Public API Surface of ngx-lib/signature\n */\nexport * from './signature.module';\nexport * from './signature.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;MAkCa,qBAAqB;IA+D9B,YACY,aAA+B,EAC/B,oBAA6C,EAC7C,WAA2B,EAC3B,EAAqB,EACrB,QAAmB,EACnB,OAAmB;QALnB,kBAAa,GAAb,aAAa,CAAkB;QAC/B,yBAAoB,GAApB,oBAAoB,CAAyB;QAC7C,gBAAW,GAAX,WAAW,CAAgB;QAC3B,OAAE,GAAF,EAAE,CAAmB;QACrB,aAAQ,GAAR,QAAQ,CAAW;QACnB,YAAO,GAAP,OAAO,CAAY;QApEtB,QAAG,GAAG,EAAE,CAAC;QACT,QAAG,GAAG,EAAE,CAAC;QACT,UAAK,GAAG,EAAE,CAAC;QACX,cAAS,GAAG,KAAK,CAAC;QAClB,aAAQ,GAAG,KAAK,CAAC;QACjB,aAAQ,GAAG,KAAK,CAAC;QACjB,eAAU,GAA2B,4BAA4B,CAAC;QAEnE,aAAQ,GAAG,CAAC,CAAC;QAUZ,iBAAY,GAAG,EAAE,CAAC;;QAG3B,gBAAW,GAAG,WAAW,CAAC;QAEjB,SAAI,GAAc,IAAI,CAAC;QACvB,cAAS,GAAG,IAAI,CAAC;QAElB,gBAAW,GAAkB,MAAM,CAAC;QAUnC,aAAQ,GAAG,KAAK,CAAC;QAG1B,eAAU,GAAsB,IAAI,YAAY,EAAO,CAAC;QAOxD,gBAAW,GAAG,EAAE,CAAC;QACjB,eAAU,GAAG,KAAK,CAAC;QACnB,YAAO,GAAG,IAAI,CAAC;QACf,kBAAa,GAAG,IAAI,CAAC;QAEd,mBAAc,GAAG,KAAK,CAAC;QAC9B,wBAAmB,GAAG,KAAK,CAAC;QAErB,wBAAmB,GAAQ;;YAE9B,QAAQ,EAAE,CAAC;YACX,WAAW,EAAE,GAAG;YAChB,YAAY,EAAE,GAAG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AAK;uBACL,KAAK;uBACL,KAAK;yBACL,KAAK;sBAGL,KAAK;2BASL,KAAK;mBAKL,KAAK;wBACL,KAAK;yBAGL,KAAK;uBASL,KAAK;yBAEL,MAAM;2BAGN,SAAS,SAAC,cAAc;gCACxB,SAAS,SAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;;;MC3B5C,kBAAkB;IAC3B,YAAoB,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;QAChD,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC;YAC/B,gBAAgB;YAChB,sBAAsB;YACtB,kBAAkB;SACrB,CAAC,CAAC;KACN;;;YA9BJ,QAAQ,SAAC;gBACN,OAAO,EAAE;oBACL,YAAY;oBACZ,mBAAmB;;oBAEnB,eAAe;oBACf,eAAe;oBACf,kBAAkB;oBAClB,cAAc;oBACd,aAAa;oBACb,eAAe;;oBAEf,kBAAkB;;oBAElB,eAAe;oBACf,aAAa;oBACb,mBAAmB;oBACnB,sBAAsB;oBACtB,eAAe;iBAClB;gBACD,OAAO,EAAE,CAAC,qBAAqB,CAAC;gBAChC,YAAY,EAAE,CAAC,qBAAqB,CAAC;aACxC;;;YAjCG,eAAe;;;AChBnB;;;;ACAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"pepperi-addons-ngx-lib-signature.js","sources":["../../../projects/ngx-lib/signature/signature.component.ts","../../../projects/ngx-lib/signature/signature.module.ts","../../../projects/ngx-lib/signature/public-api.ts","../../../projects/ngx-lib/signature/pepperi-addons-ngx-lib-signature.ts"],"sourcesContent":["import {\n Component,\n OnInit,\n OnDestroy,\n ViewChild,\n Input,\n Output,\n EventEmitter,\n ChangeDetectorRef,\n ChangeDetectionStrategy,\n OnChanges,\n ElementRef,\n Renderer2,\n TemplateRef,\n} from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { SignaturePad } from 'ngx-signaturepad/signature-pad';\nimport {\n PepFileService,\n PepLayoutType,\n PepCustomizationService,\n PepHorizontalAlignment,\n DEFAULT_HORIZONTAL_ALIGNMENT,\n PepSignatureField,\n} from '@pepperi-addons/ngx-lib';\nimport { PepDialogService } from '@pepperi-addons/ngx-lib/dialog';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Component({\n selector: 'pep-signature',\n styleUrls: ['./signature.component.scss'],\n templateUrl: './signature.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PepSignatureComponent implements OnInit, OnChanges, OnDestroy {\n @Input() key = '';\n @Input() src = '';\n @Input() label = '';\n @Input() mandatory = false;\n @Input() disabled = false;\n @Input() readonly = false;\n @Input() xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n\n private _rowSpan = 1;\n @Input()\n set rowSpan(value) {\n this._rowSpan = value;\n this.setFieldHeight();\n }\n get rowSpan(): number {\n return this._rowSpan;\n }\n\n @Input() signatureURL = '';\n // @Input() inDialog = false;\n\n private _visible = true;\n @Input()\n set visible(visible: boolean) {\n this._visible = visible;\n if (visible) {\n this.renderer.removeClass(\n this.element.nativeElement,\n 'hidden-element'\n );\n } else {\n this.renderer.addClass(\n this.element.nativeElement,\n 'hidden-element'\n );\n }\n }\n get visible(): boolean {\n return this._visible;\n }\n\n controlType = 'signature';\n\n @Input() form: FormGroup = null;\n @Input() showTitle = true;\n\n private _layoutType: PepLayoutType = 'form';\n @Input()\n set layoutType(value: PepLayoutType) {\n this._layoutType = value;\n this.setFieldHeight();\n }\n get layoutType(): PepLayoutType {\n return this._layoutType;\n }\n\n @Input() isActive = false;\n\n @Output()\n fileChange: EventEmitter<any> = new EventEmitter<any>();\n\n @ViewChild('signaturePad') signaturePad: SignaturePad;\n @ViewChild('signaturePopupPad', { read: TemplateRef })\n signaturePopupPad: TemplateRef<any>;\n dialogRef: MatDialogRef<any>;\n\n fieldHeight = '';\n standAlone = false;\n dataURI = null;\n showActionBtn = true;\n\n public isVisibleModal = false;\n acceptSignatureType = 'png';\n\n public signaturePadOptions: any = {\n // passed through to szimek/signature_pad constructor\n minWidth: 2,\n canvasWidth: 500,\n canvasHeight: 300,\n penColor: 'rgb(151, 151, 151)',\n };\n\n constructor(\n private dialogService: PepDialogService,\n private customizationService: PepCustomizationService,\n private fileService: PepFileService,\n private cd: ChangeDetectorRef,\n private renderer: Renderer2,\n private element: ElementRef\n ) { }\n\n private setFieldHeight(): void {\n this.fieldHeight = this.customizationService.calculateFieldHeight(\n this.layoutType,\n this.rowSpan,\n this.standAlone\n );\n }\n\n private setDefaultForm(): void {\n const pepField = new PepSignatureField({\n key: this.key,\n value: this.src,\n mandatory: this.mandatory,\n readonly: this.readonly,\n disabled: this.disabled,\n });\n this.form = this.customizationService.getDefaultFromGroup(pepField);\n }\n\n ngOnInit(): void {\n if (this.form === null) {\n this.standAlone = true;\n this.setFieldHeight();\n this.setDefaultForm();\n\n this.renderer.addClass(\n this.element.nativeElement,\n PepCustomizationService.STAND_ALONE_FIELD_CLASS_NAME\n );\n }\n }\n\n ngOnChanges(changes: any): void {\n if (this.standAlone) {\n this.setDefaultForm();\n }\n\n if (changes.src && changes.src.currentValue.length > 0) {\n // Empty dataURI if there is change in the src.\n this.dataURI = null;\n\n // For clean the cache.\n // this.src = this.src ? this.src + '?t=' + new Date().toTimeString() : '';\n }\n }\n\n ngOnDestroy(): void {\n //\n }\n\n drawComplete(): void {\n // will be notified of szimek/signature_pad's onEnd event\n }\n\n drawStart(): void {\n // will be notified of szimek/signature_pad's onBegin event\n }\n\n openSignModal(): void {\n // If the signature is not empty open it in image viewer.\n if (this.standAlone && this.dataURI) {\n const fileStrArr = this.dataURI.fileStr.split(';');\n\n if (fileStrArr.length === 2) {\n const win = window.open('', '_blank');\n const contentType = fileStrArr[0].split(':')[1];\n const base64 = fileStrArr[1].split(',')[1];\n const blob = this.fileService.convertFromb64toBlob(\n base64,\n contentType\n );\n const url = URL.createObjectURL(blob);\n win.location.href = url;\n }\n // signature allready exits\n } else {\n this.signatureURL = this.src;\n this.openSignatoreDlg(this.signatureURL);\n }\n }\n\n openSignatoreDlg(src = ''): void {\n this.showActionBtn =\n this.signatureURL && this.signatureURL !== '' ? false : true;\n\n this.dialogRef = this.dialogService.openDialog(this.signaturePopupPad);\n this.dialogRef.afterOpened().subscribe(() => {\n this.afterDialogOpened();\n });\n }\n\n afterDialogOpened(): void {\n if (this.signatureURL && this.signatureURL !== '') {\n this.signaturePad.fromDataURL(this.signatureURL);\n this.signaturePad.off();\n }\n }\n\n clearSignModal(): void {\n this.signatureURL = '';\n this.signaturePad.clear();\n this.signaturePad.on();\n }\n\n deleteSignature(event: any): void {\n this.signatureURL = '';\n this.changeValue(this.signatureURL);\n this.cd.detectChanges();\n }\n\n saveSignModal(event: any): void {\n if (!this.signaturePad.isEmpty()) {\n this.signatureURL = this.signaturePad.toDataURL('image/png');\n const fileValue = {\n acceptedExtensions: this.acceptSignatureType,\n fileStr: this.signatureURL,\n fileExt: this.acceptSignatureType,\n };\n this.changeValue(fileValue);\n } else {\n this.signatureURL = '';\n this.changeValue(this.signatureURL);\n }\n\n this.dialogRef.close(this.signatureURL);\n }\n\n errorHandler(event: any): void {\n this.signatureURL = this.src = ''; // this.blankImage;\n }\n\n changeValue(fileData: any): void {\n this.dataURI = fileData;\n this.src = this.standAlone && this.dataURI ? this.dataURI.fileStr : '';\n this.customizationService.updateFormFieldValue(\n this.form,\n this.key,\n this.dataURI ? this.dataURI.fileExt : ''\n );\n // this.valueChange.emit({\n // key: this.key,\n // value,\n // });\n\n this.fileChange.emit(fileData);\n // this.fileChange.emit(value.length > 0 ? JSON.parse(value) : value);\n }\n\n onKeyPress_OpenSignModal(event: any): void {\n const e = event as KeyboardEvent;\n\n if ([13, 32].indexOf(e.which) !== -1) {\n this.openSignModal();\n }\n e.preventDefault();\n }\n}","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { MatCommonModule } from '@angular/material/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatDialogModule } from '@angular/material/dialog';\n\nimport { SignaturePadModule } from 'ngx-signaturepad';\n\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\nimport {\n PepIconModule,\n PepIconRegistry,\n pepIconSystemBin,\n pepIconSystemSignature,\n pepIconSystemClose,\n} from '@pepperi-addons/ngx-lib/icon';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\nimport { PepFilesUploaderModule } from '@pepperi-addons/ngx-lib/files-uploader';\nimport { PepDialogModule } from '@pepperi-addons/ngx-lib/dialog';\n\nimport { PepSignatureComponent } from './signature.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n // Material modules\n MatCommonModule,\n MatButtonModule,\n MatFormFieldModule,\n MatInputModule,\n MatIconModule,\n MatDialogModule,\n // External modules\n SignaturePadModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepIconModule,\n PepFieldTitleModule,\n PepFilesUploaderModule,\n PepDialogModule,\n ],\n exports: [PepSignatureComponent],\n declarations: [PepSignatureComponent],\n})\nexport class PepSignatureModule {\n constructor(private pepIconRegistry: PepIconRegistry) {\n this.pepIconRegistry.registerIcons([\n pepIconSystemBin,\n pepIconSystemSignature,\n pepIconSystemClose,\n ]);\n }\n}\n","/*\n * Public API Surface of ngx-lib/signature\n */\nexport * from './signature.module';\nexport * from './signature.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;MAkCa,qBAAqB;IAmF9B,YACY,aAA+B,EAC/B,oBAA6C,EAC7C,WAA2B,EAC3B,EAAqB,EACrB,QAAmB,EACnB,OAAmB;QALnB,kBAAa,GAAb,aAAa,CAAkB;QAC/B,yBAAoB,GAApB,oBAAoB,CAAyB;QAC7C,gBAAW,GAAX,WAAW,CAAgB;QAC3B,OAAE,GAAF,EAAE,CAAmB;Q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K;wBACL,KAAK;uBACL,KAAK;uBACL,KAAK;yBACL,KAAK;sBAGL,KAAK;2BASL,KAAK;sBAIL,KAAK;mBAqBL,KAAK;wBACL,KAAK;yBAGL,KAAK;uBASL,KAAK;yBAEL,MAAM;2BAGN,SAAS,SAAC,cAAc;gCACxB,SAAS,SAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;;;MC/C5C,kBAAkB;IAC3B,YAAoB,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;QAChD,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC;YAC/B,gBAAgB;YAChB,sBAAsB;YACtB,kBAAkB;SACrB,CAAC,CAAC;KACN;;;YA9BJ,QAAQ,SAAC;gBACN,OAAO,EAAE;oBACL,YAAY;oBACZ,mBAAmB;;oBAEnB,eAAe;oBACf,eAAe;oBACf,kBAAkB;oBAClB,cAAc;oBACd,aAAa;oBACb,eAAe;;oBAEf,kBAAkB;;oBAElB,eAAe;oBACf,aAAa;oBACb,mBAAmB;oBACnB,sBAAsB;oBACtB,eAAe;iBAClB;gBACD,OAAO,EAAE,CAAC,qBAAqB,CAAC;gBAChC,YAAY,EAAE,CAAC,qBAAqB,CAAC;aACxC;;;YAjCG,eAAe;;;AChBnB;;;;ACAA;;;;;;"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { EventEmitter, Component, Renderer2, ElementRef, Input, Output, NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { MatCommonModule } from '@angular/material/core';
|
|
4
|
+
import { MatSliderModule } from '@angular/material/slider';
|
|
5
|
+
import { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';
|
|
6
|
+
import { DEFAULT_HORIZONTAL_ALIGNMENT, PepLayoutService, PepNgxLibModule } from '@pepperi-addons/ngx-lib';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This is a slider component that support pepperi theme
|
|
10
|
+
* style & state & sizes
|
|
11
|
+
*
|
|
12
|
+
* @export
|
|
13
|
+
* @class PepSliderComponent
|
|
14
|
+
* @implements {OnDestroy}
|
|
15
|
+
*/
|
|
16
|
+
class PepSliderComponent {
|
|
17
|
+
constructor(renderer, element, pepLayoutService) {
|
|
18
|
+
this.renderer = renderer;
|
|
19
|
+
this.element = element;
|
|
20
|
+
this.pepLayoutService = pepLayoutService;
|
|
21
|
+
this.label = '';
|
|
22
|
+
this.disabled = false;
|
|
23
|
+
this.hint = '';
|
|
24
|
+
this._background = null;
|
|
25
|
+
this.step = 1;
|
|
26
|
+
this.minValue = NaN;
|
|
27
|
+
this.maxValue = NaN;
|
|
28
|
+
this._value = null;
|
|
29
|
+
this.valueChange = new EventEmitter();
|
|
30
|
+
this.xAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;
|
|
31
|
+
this.sliderWrapper = null;
|
|
32
|
+
}
|
|
33
|
+
set background(background) {
|
|
34
|
+
if (!background) {
|
|
35
|
+
background = '';
|
|
36
|
+
}
|
|
37
|
+
this._background = background;
|
|
38
|
+
this.setBackground();
|
|
39
|
+
}
|
|
40
|
+
get background() {
|
|
41
|
+
return this._background;
|
|
42
|
+
}
|
|
43
|
+
set value(value) {
|
|
44
|
+
if (!value) {
|
|
45
|
+
value = '';
|
|
46
|
+
}
|
|
47
|
+
this._value = value;
|
|
48
|
+
}
|
|
49
|
+
get value() {
|
|
50
|
+
return this._value;
|
|
51
|
+
}
|
|
52
|
+
setBackground() {
|
|
53
|
+
// Get the wrapper for set the background.
|
|
54
|
+
if (!this.sliderWrapper) {
|
|
55
|
+
this.sliderWrapper = this.element.nativeElement.querySelector('.mat-slider-wrapper');
|
|
56
|
+
}
|
|
57
|
+
if (this.sliderWrapper) {
|
|
58
|
+
this.renderer.setStyle(this.sliderWrapper, 'background', this.background.length > 0 ? this.background : '#ccc');
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
ngOnInit() {
|
|
62
|
+
this.xAlignment = this.pepLayoutService.isRtl() ? 'right' : 'left';
|
|
63
|
+
this.setBackground();
|
|
64
|
+
}
|
|
65
|
+
onValueChange(event) {
|
|
66
|
+
this.valueChange.emit(event.value);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
PepSliderComponent.decorators = [
|
|
70
|
+
{ type: Component, args: [{
|
|
71
|
+
selector: 'pep-slider',
|
|
72
|
+
template: "<div class=\"pep-slider-container\">\n <pep-field-title [label]=\"label\" [disabled]=\"disabled\" [hint]=\"hint\" [xAlignment]=\"xAlignment\">\n </pep-field-title>\n <mat-slider [min]=\"minValue\" [max]=\"maxValue\" [step]=\"step\" [value]=\"value\" [disabled]=\"disabled\" [title]=\"value\"\n (change)=\"onValueChange($event)\">\n </mat-slider>\n</div>",
|
|
73
|
+
styles: [""]
|
|
74
|
+
},] }
|
|
75
|
+
];
|
|
76
|
+
PepSliderComponent.ctorParameters = () => [
|
|
77
|
+
{ type: Renderer2 },
|
|
78
|
+
{ type: ElementRef },
|
|
79
|
+
{ type: PepLayoutService }
|
|
80
|
+
];
|
|
81
|
+
PepSliderComponent.propDecorators = {
|
|
82
|
+
label: [{ type: Input }],
|
|
83
|
+
disabled: [{ type: Input }],
|
|
84
|
+
hint: [{ type: Input }],
|
|
85
|
+
background: [{ type: Input }],
|
|
86
|
+
step: [{ type: Input }],
|
|
87
|
+
minValue: [{ type: Input }],
|
|
88
|
+
maxValue: [{ type: Input }],
|
|
89
|
+
value: [{ type: Input }],
|
|
90
|
+
valueChange: [{ type: Output }]
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
class PepSliderModule {
|
|
94
|
+
}
|
|
95
|
+
PepSliderModule.decorators = [
|
|
96
|
+
{ type: NgModule, args: [{
|
|
97
|
+
imports: [
|
|
98
|
+
CommonModule,
|
|
99
|
+
// Material modules
|
|
100
|
+
MatCommonModule,
|
|
101
|
+
MatSliderModule,
|
|
102
|
+
// ngx-lib modules
|
|
103
|
+
PepNgxLibModule,
|
|
104
|
+
PepFieldTitleModule,
|
|
105
|
+
],
|
|
106
|
+
exports: [PepSliderComponent],
|
|
107
|
+
declarations: [PepSliderComponent],
|
|
108
|
+
},] }
|
|
109
|
+
];
|
|
110
|
+
|
|
111
|
+
/*
|
|
112
|
+
* Public API Surface of ngx-lib/slider
|
|
113
|
+
*/
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Generated bundle index. Do not edit.
|
|
117
|
+
*/
|
|
118
|
+
|
|
119
|
+
export { PepSliderComponent, PepSliderModule };
|
|
120
|
+
//# sourceMappingURL=pepperi-addons-ngx-lib-slider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pepperi-addons-ngx-lib-slider.js","sources":["../../../projects/ngx-lib/slider/slider.component.ts","../../../projects/ngx-lib/slider/slider.module.ts","../../../projects/ngx-lib/slider/public-api.ts","../../../projects/ngx-lib/slider/pepperi-addons-ngx-lib-slider.ts"],"sourcesContent":["import {\n Component,\n OnDestroy,\n Input,\n Output,\n EventEmitter,\n Renderer2,\n ElementRef,\n OnInit,\n ViewChild,\n} from '@angular/core';\nimport { PepLayoutService, DEFAULT_HORIZONTAL_ALIGNMENT, PepHorizontalAlignment } from '@pepperi-addons/ngx-lib';\n\n/**\n * This is a slider component that support pepperi theme\n * style & state & sizes\n *\n * @export\n * @class PepSliderComponent\n * @implements {OnDestroy}\n */\n@Component({\n selector: 'pep-slider',\n templateUrl: './slider.component.html',\n styleUrls: ['./slider.component.scss'],\n})\nexport class PepSliderComponent implements OnInit {\n @Input() label = '';\n @Input() disabled = false;\n @Input() hint = '';\n\n private _background = null;\n @Input()\n set background(background: string) {\n if (!background) {\n background = '';\n }\n\n this._background = background;\n this.setBackground();\n }\n get background(): string {\n return this._background;\n }\n\n @Input() step: number = 1;\n @Input() minValue = NaN;\n @Input() maxValue = NaN;\n\n private _value = null;\n @Input()\n set value(value: string) {\n if (!value) {\n value = '';\n }\n\n this._value = value;\n }\n get value(): string {\n return this._value;\n }\n\n @Output()\n valueChange: EventEmitter<string> = new EventEmitter<string>();\n\n xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n sliderWrapper: any = null;\n\n constructor(private renderer: Renderer2, private element: ElementRef, private pepLayoutService: PepLayoutService) { }\n\n private setBackground(): void {\n // Get the wrapper for set the background.\n if (!this.sliderWrapper) {\n this.sliderWrapper = this.element.nativeElement.querySelector('.mat-slider-wrapper');\n }\n\n if (this.sliderWrapper) {\n this.renderer.setStyle(this.sliderWrapper, 'background', this.background.length > 0 ? this.background : '#ccc');\n }\n }\n\n ngOnInit(): void {\n this.xAlignment = this.pepLayoutService.isRtl() ? 'right' : 'left';\n this.setBackground();\n }\n\n onValueChange(event) {\n this.valueChange.emit(event.value);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { MatCommonModule } from '@angular/material/core';\nimport { MatSliderModule } from '@angular/material/slider';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\n\nimport { PepSliderComponent } from './slider.component';\n\n@NgModule({\n imports: [\n CommonModule,\n // Material modules\n MatCommonModule,\n MatSliderModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepFieldTitleModule,\n ],\n exports: [PepSliderComponent],\n declarations: [PepSliderComponent],\n})\nexport class PepSliderModule { }\n","/*\n * Public API Surface of ngx-lib/slider\n */\nexport * from './slider.module';\nexport * from './slider.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAaA;;;;;;;;MAaa,kBAAkB;IA0C3B,YAAoB,QAAmB,EAAU,OAAmB,EAAU,gBAAkC;QAA5F,aAAQ,GAAR,QAAQ,CAAW;QAAU,YAAO,GAAP,OAAO,CAAY;QAAU,qBAAgB,GAAhB,gBAAgB,CAAkB;QAzCvG,UAAK,GAAG,EAAE,CAAC;QACX,aAAQ,GAAG,KAAK,CAAC;QACjB,SAAI,GAAG,EAAE,CAAC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AAC;KACxB;IAED,aAAa,CAAC,KAAK;QACf,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KACtC;;;YAnEJ,SAAS,SAAC;gBACP,QAAQ,EAAE,YAAY;gBACtB,gYAAsC;;aAEzC;;;YAnBG,SAAS;YACT,UAAU;YAIL,gBAAgB;;;oBAgBpB,KAAK;uBACL,KAAK;mBACL,KAAK;yBAGL,KAAK;mBAaL,KAAK;uBACL,KAAK;uBACL,KAAK;oBAGL,KAAK;0BAYL,MAAM;;;MCvCE,eAAe;;;YAb3B,QAAQ,SAAC;gBACN,OAAO,EAAE;oBACL,YAAY;;oBAEZ,eAAe;oBACf,eAAe;;oBAEf,eAAe;oBACf,mBAAmB;iBACtB;gBACD,OAAO,EAAE,CAAC,kBAAkB,CAAC;gBAC7B,YAAY,EAAE,CAAC,kBAAkB,CAAC;aACrC;;;ACtBD;;;;ACAA;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"PepFieldTitleModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":15,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":17,"character":8},{"__symbolic":"reference","module":"@angular/material/core","name":"MatCommonModule","line":19,"character":8},{"__symbolic":"reference","module":"@angular/material/icon","name":"MatIconModule","line":20,"character":8},{"__symbolic":"reference","module":"@angular/material/form-field","name":"MatFormFieldModule","line":21,"character":8},{"__symbolic":"reference","module":"@pepperi-addons/ngx-lib/icon","name":"PepIconModule","line":23,"character":8}],"exports":[{"__symbolic":"reference","name":"PepFieldTitleComponent"}],"declarations":[{"__symbolic":"reference","name":"PepFieldTitleComponent"}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@pepperi-addons/ngx-lib/icon","name":"PepIconRegistry","line":29,"character":41}]}]}},"PepFieldTitleComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":6,"character":1},"arguments":[{"selector":"pep-field-title","template":"<div class=\"mat-form-title\" [ngClass]=\"{disable: disabled}\" [ngStyle]=\"{'text-align': xAlignment }\">\n <ng-container *ngIf=\"xAlignment == 'right' then rightTemplate else leftTemplate\">\n </ng-container>\n <ng-template #rightTemplate>\n <ng-container *ngTemplateOutlet=\"
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"PepFieldTitleModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":15,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":17,"character":8},{"__symbolic":"reference","module":"@angular/material/core","name":"MatCommonModule","line":19,"character":8},{"__symbolic":"reference","module":"@angular/material/icon","name":"MatIconModule","line":20,"character":8},{"__symbolic":"reference","module":"@angular/material/form-field","name":"MatFormFieldModule","line":21,"character":8},{"__symbolic":"reference","module":"@pepperi-addons/ngx-lib/icon","name":"PepIconModule","line":23,"character":8}],"exports":[{"__symbolic":"reference","name":"PepFieldTitleComponent"}],"declarations":[{"__symbolic":"reference","name":"PepFieldTitleComponent"}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@pepperi-addons/ngx-lib/icon","name":"PepIconRegistry","line":29,"character":41}]}]}},"PepFieldTitleComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":6,"character":1},"arguments":[{"selector":"pep-field-title","template":"<div class=\"mat-form-title\" [ngClass]=\"{disable: disabled}\" [ngStyle]=\"{'text-align': xAlignment }\">\n <ng-container *ngIf=\"xAlignment == 'right' then rightTemplate else leftTemplate\">\n </ng-container>\n <ng-template #rightTemplate>\n <ng-container *ngTemplateOutlet=\"hintTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"titleTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"requiredTemplate\"></ng-container>\n </ng-template>\n <ng-template #leftTemplate>\n <ng-container *ngTemplateOutlet=\"requiredTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"titleTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"hintTemplate\"></ng-container>\n </ng-template>\n\n <ng-template #requiredTemplate>\n <mat-icon *ngIf=\"mandatory\" class=\"pep-spacing-element\">\n <pep-icon name=\"system_must\"></pep-icon>\n </mat-icon>\n <!-- For the grid template () -->\n <span *ngIf=\"!mandatory\"></span>\n </ng-template>\n <ng-template #titleTemplate>\n <mat-label *ngIf=\"showTitle\" [title]=\"label\" class=\"body-xs\">\n {{ label }}\n </mat-label>\n <!-- For the grid template () -->\n <span *ngIf=\"!showTitle\"></span>\n </ng-template>\n <ng-template #hintTemplate>\n <ng-container *ngIf=\"hint?.length > 0 then hintTextTemplate else maxCharactersTemplate\">\n </ng-container>\n <ng-template #hintTextTemplate>\n <span class=\"body-xs\">\n {{ hint }}\n </span>\n </ng-template>\n <ng-template #maxCharactersTemplate>\n <span *ngIf=\"maxFieldCharacters > 0\" class=\"body-xs\">\n {{ inputLength || 0 }}/{{ maxFieldCharacters }}\n </span>\n <!-- For the grid template () -->\n <span *ngIf=\"maxFieldCharacters === 0\"></span>\n </ng-template>\n </ng-template>\n</div>","styles":[":host{display:grid;width:inherit}"]}]}],"members":{"label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":12,"character":5}}]}],"mandatory":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":5}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":5}}]}],"maxFieldCharacters":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":5}}]}],"hint":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":16,"character":5}}]}],"xAlignment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":5}}]}],"showTitle":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":19,"character":5}}]}],"inputLength":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":20,"character":5}}]}]}}},"origins":{"PepFieldTitleModule":"./field-title.module","PepFieldTitleComponent":"./field-title.component"},"importAs":"@pepperi-addons/ngx-lib/field-title"}
|