@pepperi-addons/ngx-lib 0.2.38 → 0.2.42
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-checkbox.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-icon.umd.js +30 -0
- package/bundles/pepperi-addons-ngx-lib-icon.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 +116 -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/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 +2 -2
- package/esm2015/field-title/field-title.component.js +4 -2
- package/esm2015/form/field-generator.component.js +2 -2
- package/esm2015/icon/icon-generated-all.model.js +6 -1
- package/esm2015/icon/icon-generated.model.js +21 -1
- 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 +71 -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-checkbox.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-icon.js +26 -1
- package/fesm2015/pepperi-addons-ngx-lib-icon.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 +104 -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/icon/icon-generated-all.model.d.ts +5 -0
- package/icon/icon-generated.model.d.ts +21 -1
- package/icon/pepperi-addons-ngx-lib-icon.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 +30 -0
- package/slider/slider.component.theme.scss +65 -0
- package/slider/slider.module.d.ts +2 -0
- package/src/core/style/components/select.scss +2 -1
- package/src/core/style/components/textarea.scss +4 -0
- package/theming.scss +3 -0
|
@@ -15,6 +15,9 @@ export declare class PepAddressComponent implements OnChanges, OnInit, OnDestroy
|
|
|
15
15
|
groupFields: Array<any>;
|
|
16
16
|
form: FormGroup;
|
|
17
17
|
layoutType: PepLayoutType;
|
|
18
|
+
private _visible;
|
|
19
|
+
set visible(visible: boolean);
|
|
20
|
+
get visible(): boolean;
|
|
18
21
|
addressValueChange: EventEmitter<IPepFieldValueChangeEvent>;
|
|
19
22
|
constructor(element: ElementRef, renderer: Renderer2);
|
|
20
23
|
ngOnInit(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"PepAddressModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":14,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":16,"character":8},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":17,"character":8},{"__symbolic":"reference","module":"@angular/material/core","name":"MatCommonModule","line":19,"character":8},{"__symbolic":"reference","module":"@angular/material/form-field","name":"MatFormFieldModule","line":20,"character":8},{"__symbolic":"reference","module":"@pepperi-addons/ngx-lib","name":"PepNgxLibModule","line":22,"character":8},{"__symbolic":"reference","module":"@pepperi-addons/ngx-lib/textbox","name":"PepTextboxModule","line":23,"character":8},{"__symbolic":"reference","module":"@pepperi-addons/ngx-lib/select","name":"PepSelectModule","line":24,"character":8},{"__symbolic":"reference","module":"@pepperi-addons/ngx-lib/field-title","name":"PepFieldTitleModule","line":25,"character":8}],"exports":[{"__symbolic":"reference","name":"PepAddressComponent"}],"declarations":[{"__symbolic":"reference","name":"PepAddressComponent"}]}]}],"members":{}},"PepAddressComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":20,"character":1},"arguments":[{"selector":"pep-address","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":24,"character":21},"member":"OnPush"},"template":"<ng-container [formGroup]=\"form\">\n <ng-container *ngIf=\"layoutType === 'form'\">\n <pep-field-title [label]=\"label\" [mandatory]=\"mandatory\" [disabled]=\"disabled\" class=\"header\">\n </pep-field-title>\n <div [formGroupName]=\"key\" [id]=\"key\" class=\"pep-address-container\"\n dir=\"{{ xAlignment === 'right' ? 'rtl' : 'ltr' }}\">\n <div [ngSwitch]=\"groupField.controlType\" *ngFor=\"let groupField of groupFields; let i = index\"\n class=\"pep-address-field columns-{{ groupField.colSpan }}\">\n <pep-textbox *ngSwitchCase=\"'textbox'\" [layoutType]=\"layoutType\" title=\"{{ groupField.formattedValue }}\"\n [form]=\"form\" [key]=\"groupField.key\" [value]=\"groupField.value\"\n [formattedValue]=\"groupField.formattedValue\" [label]=\"groupField.label\"\n [placeholder]=\"groupField.placeholder\" [type]=\"groupField.type\" [mandatory]=\"groupField.mandatory\"\n [disabled]=\"groupField.disabled\" [readonly]=\"groupField.readonly\"\n [xAlignment]=\"groupField.xAlignment\" [rowSpan]=\"groupField.rowSpan\" [parentFieldKey]=\"key\"\n (valueChange)=\"onValueChange($event, groupField.key)\">\n </pep-textbox>\n\n <pep-select *ngSwitchCase=\"'select'\" [layoutType]=\"layoutType\" title=\"{{ groupField.formattedValue }}\"\n [form]=\"form\" [key]=\"groupField.key\" [value]=\"groupField.value\" [label]=\"groupField.label\"\n [type]=\"groupField.type\" [mandatory]=\"groupField.mandatory\" [disabled]=\"groupField.disabled\"\n [readonly]=\"groupField.readonly\" [xAlignment]=\"groupField.xAlignment\" [rowSpan]=\"groupField.rowSpan\"\n [options]=\"groupField.options\" [parentFieldKey]=\"key\"\n (valueChange)=\"onValueChange($event, groupField.key)\">\n </pep-select>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"layoutType === 'card'\">\n <div class=\"pep-card-input \" title=\"{{ label }} {{ formattedValue }}\"\n [ngClass]=\"['text-align-' + xAlignment]\">\n <span *ngIf=\"label != ''\" class=\"body-xs title\">{{ label }} </span>\n <ng-container *ngFor=\"let groupField of groupFields; let i = index\">\n <span *ngIf=\"groupField?.formattedValue != ''\" class=\"body-sm\">{{ groupField.formattedValue\n }}, </span>\n </ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"layoutType === 'table'\">\n <div class=\"pep-card-input \" title=\"{{ formattedValue }}\" [ngClass]=\"['text-align-' + xAlignment]\">\n <ng-container *ngFor=\"let groupField of groupFields; let i = index\">\n <span *ngIf=\"groupField?.formattedValue != ''\" class=\"body-sm\">{{ groupField.formattedValue\n }}, </span>\n </ng-container>\n </div>\n </ng-container>\n</ng-container>","styles":[".header{grid-column:1/span 3}.pep-address-container{padding:.875rem .75rem;padding:.875rem var(--pep-spacing-md,.75rem);border-radius:.25rem;border-radius:var(--pep-border-radius-md,.25rem);display:-ms-grid;display:grid;grid-template-columns:repeat(3,1fr);grid-column-gap:.75rem;grid-column-gap:var(--pep-spacing-md,.75rem);grid-row-gap:.75rem;grid-row-gap:var(--pep-spacing-md,.75rem)}.pep-address-container .columns-2{grid-column:1/span 2}.pep-address-container .columns-3{grid-column:1/span 3}"]}]}],"members":{"key":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":27,"character":5}}]}],"formattedValue":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":29,"character":5}}]}],"label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":30,"character":5}}]}],"mandatory":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":31,"character":5}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":32,"character":5}}]}],"readonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":33,"character":5}}]}],"xAlignment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":34,"character":5}}]}],"rowSpan":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":5}}]}],"groupFields":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":5}}]}],"form":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":38,"character":5}}]}],"layoutType":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":39,"character":5}}]}],"addressValueChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"PepAddressModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":14,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":16,"character":8},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":17,"character":8},{"__symbolic":"reference","module":"@angular/material/core","name":"MatCommonModule","line":19,"character":8},{"__symbolic":"reference","module":"@angular/material/form-field","name":"MatFormFieldModule","line":20,"character":8},{"__symbolic":"reference","module":"@pepperi-addons/ngx-lib","name":"PepNgxLibModule","line":22,"character":8},{"__symbolic":"reference","module":"@pepperi-addons/ngx-lib/textbox","name":"PepTextboxModule","line":23,"character":8},{"__symbolic":"reference","module":"@pepperi-addons/ngx-lib/select","name":"PepSelectModule","line":24,"character":8},{"__symbolic":"reference","module":"@pepperi-addons/ngx-lib/field-title","name":"PepFieldTitleModule","line":25,"character":8}],"exports":[{"__symbolic":"reference","name":"PepAddressComponent"}],"declarations":[{"__symbolic":"reference","name":"PepAddressComponent"}]}]}],"members":{}},"PepAddressComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":20,"character":1},"arguments":[{"selector":"pep-address","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":24,"character":21},"member":"OnPush"},"template":"<ng-container [formGroup]=\"form\">\n <ng-container *ngIf=\"layoutType === 'form'\">\n <pep-field-title [label]=\"label\" [mandatory]=\"mandatory\" [disabled]=\"disabled\" class=\"header\">\n </pep-field-title>\n <div [formGroupName]=\"key\" [id]=\"key\" class=\"pep-address-container\"\n dir=\"{{ xAlignment === 'right' ? 'rtl' : 'ltr' }}\">\n <div [ngSwitch]=\"groupField.controlType\" *ngFor=\"let groupField of groupFields; let i = index\"\n class=\"pep-address-field columns-{{ groupField.colSpan }}\">\n <pep-textbox *ngSwitchCase=\"'textbox'\" [layoutType]=\"layoutType\" title=\"{{ groupField.formattedValue }}\"\n [form]=\"form\" [key]=\"groupField.key\" [value]=\"groupField.value\"\n [formattedValue]=\"groupField.formattedValue\" [label]=\"groupField.label\"\n [placeholder]=\"groupField.placeholder\" [type]=\"groupField.type\" [mandatory]=\"groupField.mandatory\"\n [disabled]=\"groupField.disabled\" [readonly]=\"groupField.readonly\"\n [xAlignment]=\"groupField.xAlignment\" [rowSpan]=\"groupField.rowSpan\" [parentFieldKey]=\"key\"\n (valueChange)=\"onValueChange($event, groupField.key)\">\n </pep-textbox>\n\n <pep-select *ngSwitchCase=\"'select'\" [layoutType]=\"layoutType\" title=\"{{ groupField.formattedValue }}\"\n [form]=\"form\" [key]=\"groupField.key\" [value]=\"groupField.value\" [label]=\"groupField.label\"\n [type]=\"groupField.type\" [mandatory]=\"groupField.mandatory\" [disabled]=\"groupField.disabled\"\n [readonly]=\"groupField.readonly\" [xAlignment]=\"groupField.xAlignment\" [rowSpan]=\"groupField.rowSpan\"\n [options]=\"groupField.options\" [parentFieldKey]=\"key\"\n (valueChange)=\"onValueChange($event, groupField.key)\">\n </pep-select>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"layoutType === 'card'\">\n <div class=\"pep-card-input \" title=\"{{ label }} {{ formattedValue }}\"\n [ngClass]=\"['text-align-' + xAlignment]\">\n <span *ngIf=\"label != ''\" class=\"body-xs title\">{{ label }} </span>\n <ng-container *ngFor=\"let groupField of groupFields; let i = index\">\n <span *ngIf=\"groupField?.formattedValue != ''\" class=\"body-sm\">{{ groupField.formattedValue\n }}, </span>\n </ng-container>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"layoutType === 'table'\">\n <div class=\"pep-card-input \" title=\"{{ formattedValue }}\" [ngClass]=\"['text-align-' + xAlignment]\">\n <ng-container *ngFor=\"let groupField of groupFields; let i = index\">\n <span *ngIf=\"groupField?.formattedValue != ''\" class=\"body-sm\">{{ groupField.formattedValue\n }}, </span>\n </ng-container>\n </div>\n </ng-container>\n</ng-container>","styles":[".header{grid-column:1/span 3}.pep-address-container{padding:.875rem .75rem;padding:.875rem var(--pep-spacing-md,.75rem);border-radius:.25rem;border-radius:var(--pep-border-radius-md,.25rem);display:-ms-grid;display:grid;grid-template-columns:repeat(3,1fr);grid-column-gap:.75rem;grid-column-gap:var(--pep-spacing-md,.75rem);grid-row-gap:.75rem;grid-row-gap:var(--pep-spacing-md,.75rem)}.pep-address-container .columns-2{grid-column:1/span 2}.pep-address-container .columns-3{grid-column:1/span 3}"]}]}],"members":{"key":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":27,"character":5}}]}],"formattedValue":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":29,"character":5}}]}],"label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":30,"character":5}}]}],"mandatory":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":31,"character":5}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":32,"character":5}}]}],"readonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":33,"character":5}}]}],"xAlignment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":34,"character":5}}]}],"rowSpan":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":5}}]}],"groupFields":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":5}}]}],"form":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":38,"character":5}}]}],"layoutType":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":39,"character":5}}]}],"visible":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":42,"character":5}}]}],"addressValueChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":61,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":64,"character":33},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":64,"character":63}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"onValueChange":[{"__symbolic":"method"}]}}},"origins":{"PepAddressModule":"./address.module","PepAddressComponent":"./address.component"},"importAs":"@pepperi-addons/ngx-lib/address"}
|
|
@@ -54,6 +54,9 @@ export declare class PepAttachmentComponent implements OnInit, OnChanges, OnDest
|
|
|
54
54
|
private _rowSpan;
|
|
55
55
|
set rowSpan(value: number);
|
|
56
56
|
get rowSpan(): number;
|
|
57
|
+
private _visible;
|
|
58
|
+
set visible(visible: boolean);
|
|
59
|
+
get visible(): boolean;
|
|
57
60
|
controlType: string;
|
|
58
61
|
form: FormGroup;
|
|
59
62
|
showTitle: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"PepAttachmentModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":13,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":15,"character":8},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":16,"character":8},{"__symbolic":"reference","module":"@angular/material/core","name":"MatCommonModule","line":18,"character":8},{"__symbolic":"reference","module":"@angular/material/form-field","name":"MatFormFieldModule","line":19,"character":8},{"__symbolic":"reference","module":"@pepperi-addons/ngx-lib","name":"PepNgxLibModule","line":21,"character":8},{"__symbolic":"reference","module":"@pepperi-addons/ngx-lib/field-title","name":"PepFieldTitleModule","line":22,"character":8},{"__symbolic":"reference","module":"@pepperi-addons/ngx-lib/files-uploader","name":"PepFilesUploaderModule","line":23,"character":8}],"exports":[{"__symbolic":"reference","name":"PepAttachmentComponent"}],"declarations":[{"__symbolic":"reference","name":"PepAttachmentComponent"}]}]}],"members":{}},"PepAttachmentComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":23,"character":1},"arguments":[{"selector":"pep-attachment","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":27,"character":21},"member":"OnPush"},"template":"<ng-template #pepTemplate>\n <pep-files-uploader [key]=\"key\" [src]=\"src\" [label]=\"label\" [mandatory]=\"mandatory\" [disabled]=\"disabled\"\n [xAlignment]=\"xAlignment\" [rowSpan]=\"rowSpan\" [fieldHeight]=\"fieldHeight\" [controlType]=\"controlType\"\n [form]=\"form\" [layoutType]=\"layoutType\" [standAlone]=\"standAlone\" (fileChange)=\"onFileChanged($event)\"\n (elementClick)=\"onFileClicked($event)\" [acceptedExtensions]=\"acceptAttachmentType\">\n </pep-files-uploader>\n</ng-template>\n\n<ng-template #pepReadonlyTemplate>\n <ng-container *ngIf=\"src?.length > 0; then notEmptyBlock; else emptyBlock\"></ng-container>\n <ng-template #notEmptyBlock>\n <div class=\"pep-file-container\">\n <a [id]=\"key\" class=\"color-link body-sm pep-card-input \" *ngIf=\"src != null\" title=\"{{ src }}\"\n target=\"_blank\" href=\"{{ src }}\">{{ src }}</a>\n </div>\n </ng-template>\n <ng-template #emptyBlock>\n <span> </span>\n </ng-template>\n</ng-template>\n\n<ng-container *ngIf=\"layoutType === 'form'\">\n <div class=\"pep-file-container\" [ngClass]=\"{ 'one-row': rowSpan == 1, 'stand-alone': standAlone }\">\n <pep-field-title [label]=\"label\" [mandatory]=\"mandatory\" [disabled]=\"disabled\" [xAlignment]=\"xAlignment\"\n [showTitle]=\"showTitle\">\n </pep-field-title>\n <ng-container *ngTemplateOutlet=\"pepTemplate\"></ng-container>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"layoutType === 'card'\">\n <ng-container *ngIf=\"false && isActive && !disabled; then selectedBlock; else notSelectedBlock\"></ng-container>\n <ng-template #selectedBlock>\n <div class=\"pep-file-container\" [ngClass]=\"{ 'one-row': rowSpan == 1, 'stand-alone': standAlone}\">\n <ng-container *ngTemplateOutlet=\"pepTemplate\"></ng-container>\n </div>\n </ng-template>\n <ng-template #notSelectedBlock>\n <ng-container *ngTemplateOutlet=\"pepReadonlyTemplate\"></ng-container>\n </ng-template>\n</ng-container>\n\n\n<ng-container *ngIf=\"layoutType === 'table'\">\n <ng-container *ngIf=\"false && isActive && !disabled; then selectedBlock; else notSelectedBlock\"></ng-container>\n <ng-template #selectedBlock>\n <div class=\"pep-file-container one-row\">\n <ng-container *ngTemplateOutlet=\"pepTemplate\"></ng-container>\n </div>\n </ng-template>\n <ng-template #notSelectedBlock>\n <ng-container *ngTemplateOutlet=\"pepReadonlyTemplate\"></ng-container>\n </ng-template>\n</ng-container>","styles":[":host{display:block}"]}]}],"members":{"key":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":5}}]}],"src":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":43,"character":5}}]}],"label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":64,"character":5}}]}],"mandatory":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":71,"character":5}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":78,"character":5}}]}],"readonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":85,"character":5}}]}],"xAlignment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":93,"character":5}}]}],"rowSpan":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":96,"character":5}}]}],"form":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"PepAttachmentModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":13,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":15,"character":8},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":16,"character":8},{"__symbolic":"reference","module":"@angular/material/core","name":"MatCommonModule","line":18,"character":8},{"__symbolic":"reference","module":"@angular/material/form-field","name":"MatFormFieldModule","line":19,"character":8},{"__symbolic":"reference","module":"@pepperi-addons/ngx-lib","name":"PepNgxLibModule","line":21,"character":8},{"__symbolic":"reference","module":"@pepperi-addons/ngx-lib/field-title","name":"PepFieldTitleModule","line":22,"character":8},{"__symbolic":"reference","module":"@pepperi-addons/ngx-lib/files-uploader","name":"PepFilesUploaderModule","line":23,"character":8}],"exports":[{"__symbolic":"reference","name":"PepAttachmentComponent"}],"declarations":[{"__symbolic":"reference","name":"PepAttachmentComponent"}]}]}],"members":{}},"PepAttachmentComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":23,"character":1},"arguments":[{"selector":"pep-attachment","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":27,"character":21},"member":"OnPush"},"template":"<ng-template #pepTemplate>\n <pep-files-uploader [key]=\"key\" [src]=\"src\" [label]=\"label\" [mandatory]=\"mandatory\" [disabled]=\"disabled\"\n [xAlignment]=\"xAlignment\" [rowSpan]=\"rowSpan\" [fieldHeight]=\"fieldHeight\" [controlType]=\"controlType\"\n [form]=\"form\" [layoutType]=\"layoutType\" [standAlone]=\"standAlone\" (fileChange)=\"onFileChanged($event)\"\n (elementClick)=\"onFileClicked($event)\" [acceptedExtensions]=\"acceptAttachmentType\">\n </pep-files-uploader>\n</ng-template>\n\n<ng-template #pepReadonlyTemplate>\n <ng-container *ngIf=\"src?.length > 0; then notEmptyBlock; else emptyBlock\"></ng-container>\n <ng-template #notEmptyBlock>\n <div class=\"pep-file-container\">\n <a [id]=\"key\" class=\"color-link body-sm pep-card-input \" *ngIf=\"src != null\" title=\"{{ src }}\"\n target=\"_blank\" href=\"{{ src }}\">{{ src }}</a>\n </div>\n </ng-template>\n <ng-template #emptyBlock>\n <span> </span>\n </ng-template>\n</ng-template>\n\n<ng-container *ngIf=\"layoutType === 'form'\">\n <div class=\"pep-file-container\" [ngClass]=\"{ 'one-row': rowSpan == 1, 'stand-alone': standAlone }\">\n <pep-field-title [label]=\"label\" [mandatory]=\"mandatory\" [disabled]=\"disabled\" [xAlignment]=\"xAlignment\"\n [showTitle]=\"showTitle\">\n </pep-field-title>\n <ng-container *ngTemplateOutlet=\"pepTemplate\"></ng-container>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"layoutType === 'card'\">\n <ng-container *ngIf=\"false && isActive && !disabled; then selectedBlock; else notSelectedBlock\"></ng-container>\n <ng-template #selectedBlock>\n <div class=\"pep-file-container\" [ngClass]=\"{ 'one-row': rowSpan == 1, 'stand-alone': standAlone}\">\n <ng-container *ngTemplateOutlet=\"pepTemplate\"></ng-container>\n </div>\n </ng-template>\n <ng-template #notSelectedBlock>\n <ng-container *ngTemplateOutlet=\"pepReadonlyTemplate\"></ng-container>\n </ng-template>\n</ng-container>\n\n\n<ng-container *ngIf=\"layoutType === 'table'\">\n <ng-container *ngIf=\"false && isActive && !disabled; then selectedBlock; else notSelectedBlock\"></ng-container>\n <ng-template #selectedBlock>\n <div class=\"pep-file-container one-row\">\n <ng-container *ngTemplateOutlet=\"pepTemplate\"></ng-container>\n </div>\n </ng-template>\n <ng-template #notSelectedBlock>\n <ng-container *ngTemplateOutlet=\"pepReadonlyTemplate\"></ng-container>\n </ng-template>\n</ng-container>","styles":[":host{display:block}"]}]}],"members":{"key":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":5}}]}],"src":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":43,"character":5}}]}],"label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":64,"character":5}}]}],"mandatory":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":71,"character":5}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":78,"character":5}}]}],"readonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":85,"character":5}}]}],"xAlignment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":93,"character":5}}]}],"rowSpan":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":96,"character":5}}]}],"visible":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":106,"character":5}}]}],"form":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":127,"character":5}}]}],"showTitle":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":128,"character":5}}]}],"layoutType":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":131,"character":5}}]}],"isActive":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":140,"character":5}}]}],"fileChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":142,"character":5}}]}],"elementClick":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":145,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@pepperi-addons/ngx-lib","name":"PepCustomizationService","line":156,"character":38},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":157,"character":26},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":158,"character":24},{"__symbolic":"reference","module":"@pepperi-addons/ngx-lib","name":"PepFileService","line":159,"character":29}]}],"setFieldHeight":[{"__symbolic":"method"}],"setDefaultForm":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"onFileChanged":[{"__symbolic":"method"}],"onFileClicked":[{"__symbolic":"method"}]}}},"origins":{"PepAttachmentModule":"./attachment.module","PepAttachmentComponent":"./attachment.component"},"importAs":"@pepperi-addons/ngx-lib/attachment"}
|
|
@@ -19,8 +19,25 @@
|
|
|
19
19
|
this.rowSpan = 1;
|
|
20
20
|
this.form = null;
|
|
21
21
|
this.layoutType = 'form';
|
|
22
|
+
this._visible = true;
|
|
22
23
|
this.addressValueChange = new core.EventEmitter();
|
|
23
24
|
}
|
|
25
|
+
Object.defineProperty(PepAddressComponent.prototype, "visible", {
|
|
26
|
+
get: function () {
|
|
27
|
+
return this._visible;
|
|
28
|
+
},
|
|
29
|
+
set: function (visible) {
|
|
30
|
+
this._visible = visible;
|
|
31
|
+
if (visible) {
|
|
32
|
+
this.renderer.removeClass(this.element.nativeElement, 'hidden-element');
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
this.renderer.addClass(this.element.nativeElement, 'hidden-element');
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
enumerable: false,
|
|
39
|
+
configurable: true
|
|
40
|
+
});
|
|
24
41
|
PepAddressComponent.prototype.ngOnInit = function () {
|
|
25
42
|
this.renderer.addClass(this.element.nativeElement, 'pep-grouped-field');
|
|
26
43
|
};
|
|
@@ -83,6 +100,7 @@
|
|
|
83
100
|
groupFields: [{ type: core.Input }],
|
|
84
101
|
form: [{ type: core.Input }],
|
|
85
102
|
layoutType: [{ type: core.Input }],
|
|
103
|
+
visible: [{ type: core.Input }],
|
|
86
104
|
addressValueChange: [{ type: core.Output }]
|
|
87
105
|
};
|
|
88
106
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pepperi-addons-ngx-lib-address.umd.js","sources":["../../../projects/ngx-lib/address/address.component.ts","../../../projects/ngx-lib/address/address.module.ts","../../../projects/ngx-lib/address/public-api.ts","../../../projects/ngx-lib/address/pepperi-addons-ngx-lib-address.ts"],"sourcesContent":["import {\n Component,\n OnInit,\n OnChanges,\n Input,\n Output,\n EventEmitter,\n ChangeDetectionStrategy,\n OnDestroy,\n Renderer2,\n ElementRef,\n} from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport {\n PepLayoutType,\n PepHorizontalAlignment,\n DEFAULT_HORIZONTAL_ALIGNMENT,\n IPepFieldValueChangeEvent,\n} from '@pepperi-addons/ngx-lib';\n\n@Component({\n selector: 'pep-address',\n templateUrl: './address.component.html',\n styleUrls: ['./address.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PepAddressComponent implements OnChanges, OnInit, OnDestroy {\n @Input() key = '';\n // @Input() value = '';\n @Input() formattedValue = '';\n @Input() label = '';\n @Input() mandatory = false;\n @Input() disabled = false;\n @Input() readonly = false;\n @Input() xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n @Input() rowSpan = 1;\n @Input() groupFields: Array<any>;\n\n @Input() form: FormGroup = null;\n @Input() layoutType: PepLayoutType = 'form';\n\n @Output()\n addressValueChange: EventEmitter<IPepFieldValueChangeEvent> = new EventEmitter<IPepFieldValueChangeEvent>();\n\n constructor(private element: ElementRef, private renderer: Renderer2) {}\n\n ngOnInit(): void {\n this.renderer.addClass(this.element.nativeElement, 'pep-grouped-field');\n }\n\n ngOnChanges(changes): void {\n //\n }\n\n ngOnDestroy(): void {\n //\n }\n\n // Not in use anymore comment in 16.55.\n // onBlur(e: any, key: string): void {\n // const value = e.target ? e.target.value : e;\n // this.changeValue({ key, value }, e.relatedTarget);\n // }\n\n onValueChange(value: string, key: string): void {\n // if (e.target) {\n // const input = e.target ? e.target.value : e;\n // this.changeValue({ key, value: input.value });\n // } else {\n // this.changeValue(e);\n // }\n\n const currentGroupField = this.groupFields.find((gf) => gf.key === key);\n\n if (currentGroupField && currentGroupField.value !== value) {\n // Set the value in the form controls\n if (this.form) {\n const formCtrl = this.form.get(this.key);\n\n if (formCtrl) {\n formCtrl.get(key).setValue(value);\n }\n }\n\n this.addressValueChange.emit({\n key: key,\n value: value,\n });\n }\n }\n\n // changeValue(field: any): void {\n // const currentGroupField = this.groupFields.filter(\n // (groupField) => groupField.key === field.key\n // )[0];\n\n // if (currentGroupField.value !== field.value) {\n // // Set the value in the form controls\n // if (this.form) {\n // const formCtrl = this.form.get(this.key);\n\n // if (formCtrl) {\n // formCtrl.get(field.key).setValue(field.value);\n // }\n // }\n\n // this.valueChange.emit({\n // key: field.key,\n // value: field.value,\n // });\n // }\n // }\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 { MatFormFieldModule } from '@angular/material/form-field';\n\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\nimport { PepTextboxModule } from '@pepperi-addons/ngx-lib/textbox';\nimport { PepSelectModule } from '@pepperi-addons/ngx-lib/select';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\n\nimport { PepAddressComponent } from './address.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n // Material modules\n MatCommonModule,\n MatFormFieldModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepTextboxModule,\n PepSelectModule,\n PepFieldTitleModule,\n ],\n exports: [PepAddressComponent],\n declarations: [PepAddressComponent],\n})\nexport class PepAddressModule {}\n","/*\n * Public API Surface of ngx-lib/address\n */\nexport * from './address.module';\nexport * from './address.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["DEFAULT_HORIZONTAL_ALIGNMENT","EventEmitter","Component","ChangeDetectionStrategy","ElementRef","Renderer2","Input","Output","NgModule","CommonModule","ReactiveFormsModule","MatCommonModule","MatFormFieldModule","PepNgxLibModule","PepTextboxModule","PepSelectModule","PepFieldTitleModule"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"pepperi-addons-ngx-lib-address.umd.js","sources":["../../../projects/ngx-lib/address/address.component.ts","../../../projects/ngx-lib/address/address.module.ts","../../../projects/ngx-lib/address/public-api.ts","../../../projects/ngx-lib/address/pepperi-addons-ngx-lib-address.ts"],"sourcesContent":["import {\n Component,\n OnInit,\n OnChanges,\n Input,\n Output,\n EventEmitter,\n ChangeDetectionStrategy,\n OnDestroy,\n Renderer2,\n ElementRef,\n} from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport {\n PepLayoutType,\n PepHorizontalAlignment,\n DEFAULT_HORIZONTAL_ALIGNMENT,\n IPepFieldValueChangeEvent,\n} from '@pepperi-addons/ngx-lib';\n\n@Component({\n selector: 'pep-address',\n templateUrl: './address.component.html',\n styleUrls: ['./address.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PepAddressComponent implements OnChanges, OnInit, OnDestroy {\n @Input() key = '';\n // @Input() value = '';\n @Input() formattedValue = '';\n @Input() label = '';\n @Input() mandatory = false;\n @Input() disabled = false;\n @Input() readonly = false;\n @Input() xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n @Input() rowSpan = 1;\n @Input() groupFields: Array<any>;\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 @Output()\n addressValueChange: EventEmitter<IPepFieldValueChangeEvent> = new EventEmitter<IPepFieldValueChangeEvent>();\n\n constructor(private element: ElementRef, private renderer: Renderer2) { }\n\n ngOnInit(): void {\n this.renderer.addClass(this.element.nativeElement, 'pep-grouped-field');\n }\n\n ngOnChanges(changes): void {\n //\n }\n\n ngOnDestroy(): void {\n //\n }\n\n // Not in use anymore comment in 16.55.\n // onBlur(e: any, key: string): void {\n // const value = e.target ? e.target.value : e;\n // this.changeValue({ key, value }, e.relatedTarget);\n // }\n\n onValueChange(value: string, key: string): void {\n // if (e.target) {\n // const input = e.target ? e.target.value : e;\n // this.changeValue({ key, value: input.value });\n // } else {\n // this.changeValue(e);\n // }\n\n const currentGroupField = this.groupFields.find((gf) => gf.key === key);\n\n if (currentGroupField && currentGroupField.value !== value) {\n // Set the value in the form controls\n if (this.form) {\n const formCtrl = this.form.get(this.key);\n\n if (formCtrl) {\n formCtrl.get(key).setValue(value);\n }\n }\n\n this.addressValueChange.emit({\n key: key,\n value: value,\n });\n }\n }\n\n // changeValue(field: any): void {\n // const currentGroupField = this.groupFields.filter(\n // (groupField) => groupField.key === field.key\n // )[0];\n\n // if (currentGroupField.value !== field.value) {\n // // Set the value in the form controls\n // if (this.form) {\n // const formCtrl = this.form.get(this.key);\n\n // if (formCtrl) {\n // formCtrl.get(field.key).setValue(field.value);\n // }\n // }\n\n // this.valueChange.emit({\n // key: field.key,\n // value: field.value,\n // });\n // }\n // }\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 { MatFormFieldModule } from '@angular/material/form-field';\n\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\nimport { PepTextboxModule } from '@pepperi-addons/ngx-lib/textbox';\nimport { PepSelectModule } from '@pepperi-addons/ngx-lib/select';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\n\nimport { PepAddressComponent } from './address.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n // Material modules\n MatCommonModule,\n MatFormFieldModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepTextboxModule,\n PepSelectModule,\n PepFieldTitleModule,\n ],\n exports: [PepAddressComponent],\n declarations: [PepAddressComponent],\n})\nexport class PepAddressModule {}\n","/*\n * Public API Surface of ngx-lib/address\n */\nexport * from './address.module';\nexport * from './address.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["DEFAULT_HORIZONTAL_ALIGNMENT","EventEmitter","Component","ChangeDetectionStrategy","ElementRef","Renderer2","Input","Output","NgModule","CommonModule","ReactiveFormsModule","MatCommonModule","MatFormFieldModule","PepNgxLibModule","PepTextboxModule","PepSelectModule","PepFieldTitleModule"],"mappings":";;;;;;;QAgEI,6BAAoB,OAAmB,EAAU,QAAmB;YAAhD,YAAO,GAAP,OAAO,CAAY;YAAU,aAAQ,GAAR,QAAQ,CAAW;YArC3D,QAAG,GAAG,EAAE,CAAC;;YAET,mBAAc,GAAG,EAA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E;oBACX,IAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;oBAEzC,IAAI,QAAQ,EAAE;wBACV,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;qBACrC;iBACJ;gBAED,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC;oBACzB,GAAG,EAAE,GAAG;oBACR,KAAK,EAAE,KAAK;iBACf,CAAC,CAAC;aACN;SACJ;;;;gBAzFJC,cAAS,SAAC;oBACP,QAAQ,EAAE,aAAa;oBACvB,wlGAAuC;oBAEvC,eAAe,EAAEC,4BAAuB,CAAC,MAAM;;iBAClD;;;gBAfGC,eAAU;gBADVC,cAAS;;;sBAkBRC,UAAK;iCAELA,UAAK;wBACLA,UAAK;4BACLA,UAAK;2BACLA,UAAK;2BACLA,UAAK;6BACLA,UAAK;0BACLA,UAAK;8BACLA,UAAK;uBAELA,UAAK;6BACLA,UAAK;0BAGLA,UAAK;qCAmBLC,WAAM;;;;QC/BX;;;;;gBAhBCC,aAAQ,SAAC;oBACN,OAAO,EAAE;wBACLC,mBAAY;wBACZC,yBAAmB;;wBAEnBC,sBAAe;wBACfC,4BAAkB;;wBAElBC,sBAAe;wBACfC,wBAAgB;wBAChBC,sBAAe;wBACfC,8BAAmB;qBACtB;oBACD,OAAO,EAAE,CAAC,mBAAmB,CAAC;oBAC9B,YAAY,EAAE,CAAC,mBAAmB,CAAC;iBACtC;;;IC7BD;;;;ICAA;;;;;;;;;;;;;"}
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
*/
|
|
50
50
|
this.xAlignment = ngxLib.DEFAULT_HORIZONTAL_ALIGNMENT;
|
|
51
51
|
this._rowSpan = 1;
|
|
52
|
+
this._visible = true;
|
|
52
53
|
this.controlType = 'attachment';
|
|
53
54
|
this.form = null;
|
|
54
55
|
this.showTitle = true;
|
|
@@ -94,6 +95,22 @@
|
|
|
94
95
|
enumerable: false,
|
|
95
96
|
configurable: true
|
|
96
97
|
});
|
|
98
|
+
Object.defineProperty(PepAttachmentComponent.prototype, "visible", {
|
|
99
|
+
get: function () {
|
|
100
|
+
return this._visible;
|
|
101
|
+
},
|
|
102
|
+
set: function (visible) {
|
|
103
|
+
this._visible = visible;
|
|
104
|
+
if (visible) {
|
|
105
|
+
this.renderer.removeClass(this.element.nativeElement, 'hidden-element');
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
this.renderer.addClass(this.element.nativeElement, 'hidden-element');
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
enumerable: false,
|
|
112
|
+
configurable: true
|
|
113
|
+
});
|
|
97
114
|
Object.defineProperty(PepAttachmentComponent.prototype, "layoutType", {
|
|
98
115
|
get: function () {
|
|
99
116
|
return this._layoutType;
|
|
@@ -197,6 +214,7 @@
|
|
|
197
214
|
readonly: [{ type: core.Input }],
|
|
198
215
|
xAlignment: [{ type: core.Input }],
|
|
199
216
|
rowSpan: [{ type: core.Input }],
|
|
217
|
+
visible: [{ type: core.Input }],
|
|
200
218
|
form: [{ type: core.Input }],
|
|
201
219
|
showTitle: [{ type: core.Input }],
|
|
202
220
|
layoutType: [{ type: core.Input }],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pepperi-addons-ngx-lib-attachment.umd.js","sources":["../../../projects/ngx-lib/attachment/attachment.component.ts","../../../projects/ngx-lib/attachment/attachment.module.ts","../../../projects/ngx-lib/attachment/public-api.ts","../../../projects/ngx-lib/attachment/pepperi-addons-ngx-lib-attachment.ts"],"sourcesContent":["import {\n Component,\n OnInit,\n OnChanges,\n Input,\n Output,\n EventEmitter,\n ChangeDetectionStrategy,\n ElementRef,\n Renderer2,\n OnDestroy,\n} from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport {\n PepFileService,\n PepCustomizationService,\n PepLayoutType,\n PepHorizontalAlignment,\n DEFAULT_HORIZONTAL_ALIGNMENT,\n IPepFieldClickEvent,\n PepAttachmentField,\n} from '@pepperi-addons/ngx-lib';\n\n@Component({\n selector: 'pep-attachment',\n templateUrl: './attachment.component.html',\n styleUrls: ['./attachment.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PepAttachmentComponent implements OnInit, OnChanges, OnDestroy {\n /**\n * The attachment key.\n *\n * @memberof PepAttachmentComponent\n */\n @Input() key = '';\n\n private _src = '';\n /**\n * The src of the attachment.\n *\n * @memberof PepAttachmentComponent\n */\n @Input()\n set src(value: string) {\n if (!value) {\n value = '';\n }\n\n this._src = value;\n if (this._src.length > 0) {\n // Empty dataURI.\n this.dataURI = null;\n }\n }\n get src(): string {\n return this._src;\n }\n\n /**\n * The title of the attachment.\n *\n * @memberof PepAttachmentComponent\n */\n @Input() label = '';\n\n /**\n * If the attachment is mandatory\n *\n * @memberof PepAttachmentComponent\n */\n @Input() mandatory = false;\n\n /**\n * If the attachment is disabled\n *\n * @memberof PepAttachmentComponent\n */\n @Input() disabled = false;\n\n /**\n * If the attachment is readonly\n *\n * @memberof PepAttachmentComponent\n */\n @Input() readonly = false;\n\n /**\n * The horizontal alignment of the attachment\n *\n * @type {PepHorizontalAlignment}\n * @memberof PepAttachmentComponent\n */\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 controlType = 'attachment';\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 @Output()\n elementClick: EventEmitter<IPepFieldClickEvent> = new EventEmitter<IPepFieldClickEvent>();\n\n fieldHeight = '';\n standAlone = false;\n dataURI = null;\n\n acceptAttachmentType =\n 'application/pdf,application/json,text/csv,text/csv-schema,application/msword,application/vnd.ms-excel,text/plain,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document,image/bmp,image/jpg, image/jpeg, image/png, image/tif, image/tiff, txt, json';\n\n constructor(\n private customizationService: PepCustomizationService,\n private renderer: Renderer2,\n public element: ElementRef,\n private fileService: PepFileService\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 PepAttachmentField({\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 ngOnDestroy(): void {\n //\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 // Moved to src input\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 }\n\n onFileChanged(fileData: any): void {\n // const tmp = value.length > 0 ? JSON.parse(value) : null;\n // set this.dataURI after this.src cause it initialize in the src setter.\n this.src = fileData ? fileData.fileStr : '';\n this.dataURI = fileData;\n\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 onFileClicked(event: IPepFieldClickEvent): void {\n if (this.dataURI != null) {\n const fileStrArr = this.dataURI.fileStr.split(';');\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 } else {\n if (this.fileService.isValidUrl(this.src)) {\n const win = window.open('', '_blank');\n win.location.href = this.src;\n }\n }\n\n this.elementClick.emit(event);\n }\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 { MatFormFieldModule } from '@angular/material/form-field';\n\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\nimport { PepFilesUploaderModule } from '@pepperi-addons/ngx-lib/files-uploader';\n\nimport { PepAttachmentComponent } from './attachment.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n // Material modules\n MatCommonModule,\n MatFormFieldModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepFieldTitleModule,\n PepFilesUploaderModule,\n ],\n exports: [PepAttachmentComponent],\n declarations: [PepAttachmentComponent],\n})\nexport class PepAttachmentModule {}\n","/*\n * Public API Surface of ngx-lib/attachment\n */\nexport * from './attachment.module';\nexport * from './attachment.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["DEFAULT_HORIZONTAL_ALIGNMENT","EventEmitter","PepAttachmentField","PepCustomizationService","Component","ChangeDetectionStrategy","Renderer2","ElementRef","PepFileService","Input","Output","NgModule","CommonModule","ReactiveFormsModule","MatCommonModule","MatFormFieldModule","PepNgxLibModule","PepFieldTitleModule","PepFilesUploaderModule"],"mappings":";;;;;;;QAuII,gCACY,oBAA6C,EAC7C,QAAmB,EACpB,OAAmB,EAClB,WAA2B;YAH3B,yBAAoB,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,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;oBACvC,IAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;oBACtC,GAAG,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC;iBAChC;aACJ;YAED,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACjC;;;;gBAhNJC,cAAS,SAAC;oBACP,QAAQ,EAAE,gBAAgB;oBAC1B,okFAA0C;oBAE1C,eAAe,EAAEC,4BAAuB,CAAC,MAAM;;iBAClD;;;gBAbGF,8BAAuB;gBANvBG,cAAS;gBADTC,eAAU;gBAMVC,qBAAc;;;sBAqBbC,UAAK;sBAQLA,UAAK;wBAqBLA,UAAK;4BAOLA,UAAK;2BAOLA,UAAK;2BAOLA,UAAK;6BAQLA,UAAK;0BAGLA,UAAK;uBAWLA,UAAK;4BACLA,UAAK;6BAGLA,UAAK;2BASLA,UAAK;6BAELC,WAAM;+BAGNA,WAAM;;;;QCjGX;;;;;gBAfCC,aAAQ,SAAC;oBACN,OAAO,EAAE;wBACLC,mBAAY;wBACZC,yBAAmB;;wBAEnBC,sBAAe;wBACfC,4BAAkB;;wBAElBC,sBAAe;wBACfC,8BAAmB;wBACnBC,oCAAsB;qBACzB;oBACD,OAAO,EAAE,CAAC,sBAAsB,CAAC;oBACjC,YAAY,EAAE,CAAC,sBAAsB,CAAC;iBACzC;;;IC3BD;;;;ICAA;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"pepperi-addons-ngx-lib-attachment.umd.js","sources":["../../../projects/ngx-lib/attachment/attachment.component.ts","../../../projects/ngx-lib/attachment/attachment.module.ts","../../../projects/ngx-lib/attachment/public-api.ts","../../../projects/ngx-lib/attachment/pepperi-addons-ngx-lib-attachment.ts"],"sourcesContent":["import {\n Component,\n OnInit,\n OnChanges,\n Input,\n Output,\n EventEmitter,\n ChangeDetectionStrategy,\n ElementRef,\n Renderer2,\n OnDestroy,\n} from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport {\n PepFileService,\n PepCustomizationService,\n PepLayoutType,\n PepHorizontalAlignment,\n DEFAULT_HORIZONTAL_ALIGNMENT,\n IPepFieldClickEvent,\n PepAttachmentField,\n} from '@pepperi-addons/ngx-lib';\n\n@Component({\n selector: 'pep-attachment',\n templateUrl: './attachment.component.html',\n styleUrls: ['./attachment.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PepAttachmentComponent implements OnInit, OnChanges, OnDestroy {\n /**\n * The attachment key.\n *\n * @memberof PepAttachmentComponent\n */\n @Input() key = '';\n\n private _src = '';\n /**\n * The src of the attachment.\n *\n * @memberof PepAttachmentComponent\n */\n @Input()\n set src(value: string) {\n if (!value) {\n value = '';\n }\n\n this._src = value;\n if (this._src.length > 0) {\n // Empty dataURI.\n this.dataURI = null;\n }\n }\n get src(): string {\n return this._src;\n }\n\n /**\n * The title of the attachment.\n *\n * @memberof PepAttachmentComponent\n */\n @Input() label = '';\n\n /**\n * If the attachment is mandatory\n *\n * @memberof PepAttachmentComponent\n */\n @Input() mandatory = false;\n\n /**\n * If the attachment is disabled\n *\n * @memberof PepAttachmentComponent\n */\n @Input() disabled = false;\n\n /**\n * If the attachment is readonly\n *\n * @memberof PepAttachmentComponent\n */\n @Input() readonly = false;\n\n /**\n * The horizontal alignment of the attachment\n *\n * @type {PepHorizontalAlignment}\n * @memberof PepAttachmentComponent\n */\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 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 = 'attachment';\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 @Output()\n elementClick: EventEmitter<IPepFieldClickEvent> = new EventEmitter<IPepFieldClickEvent>();\n\n fieldHeight = '';\n standAlone = false;\n dataURI = null;\n\n acceptAttachmentType =\n 'application/pdf,application/json,text/csv,text/csv-schema,application/msword,application/vnd.ms-excel,text/plain,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document,image/bmp,image/jpg, image/jpeg, image/png, image/tif, image/tiff, txt, json';\n\n constructor(\n private customizationService: PepCustomizationService,\n private renderer: Renderer2,\n public element: ElementRef,\n private fileService: PepFileService\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 PepAttachmentField({\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 ngOnDestroy(): void {\n //\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 // Moved to src input\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 }\n\n onFileChanged(fileData: any): void {\n // const tmp = value.length > 0 ? JSON.parse(value) : null;\n // set this.dataURI after this.src cause it initialize in the src setter.\n this.src = fileData ? fileData.fileStr : '';\n this.dataURI = fileData;\n\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 onFileClicked(event: IPepFieldClickEvent): void {\n if (this.dataURI != null) {\n const fileStrArr = this.dataURI.fileStr.split(';');\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 } else {\n if (this.fileService.isValidUrl(this.src)) {\n const win = window.open('', '_blank');\n win.location.href = this.src;\n }\n }\n\n this.elementClick.emit(event);\n }\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 { MatFormFieldModule } from '@angular/material/form-field';\n\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\nimport { PepFilesUploaderModule } from '@pepperi-addons/ngx-lib/files-uploader';\n\nimport { PepAttachmentComponent } from './attachment.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n // Material modules\n MatCommonModule,\n MatFormFieldModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepFieldTitleModule,\n PepFilesUploaderModule,\n ],\n exports: [PepAttachmentComponent],\n declarations: [PepAttachmentComponent],\n})\nexport class PepAttachmentModule {}\n","/*\n * Public API Surface of ngx-lib/attachment\n */\nexport * from './attachment.module';\nexport * from './attachment.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["DEFAULT_HORIZONTAL_ALIGNMENT","EventEmitter","PepAttachmentField","PepCustomizationService","Component","ChangeDetectionStrategy","Renderer2","ElementRef","PepFileService","Input","Output","NgModule","CommonModule","ReactiveFormsModule","MatCommonModule","MatFormFieldModule","PepNgxLibModule","PepFieldTitleModule","PepFilesUploaderModule"],"mappings":";;;;;;;QA2JI,gCACY,oBAA6C,EAC7C,QAAmB,EACpB,OAAmB,EAClB,WAA2B;YAH3B,yBAAoB,GAApB,oBAAoB,CAAyB;YAC7C,aAAQ,GAAR,QAAQ,CAAW;YACpB,YAAO,GAAP,OAAO,CAAY;YAClB,gBAAW,GAAX,WAAW,CAAgB;;;;;;YA5H9B,QAAG,GAAG,EAAE,CAAC;YAEV,SAAI,GAAG,EAAE,CAAC;;;;;;YA2BT,UAAK,GAAG,EAAE,CAAC;;;;;;YAOX,cAAS,GAAG,KAAK,CAAC;;;;;;YAOlB,aAAQ,GAAG,KAAK,CAAC;;;;;;YAOjB,aAAQ,GAAG,KAAK,CAAC;;;;;;;YAQjB,eAAU,GAA2BA,mCAA4B,CAAC;YAEnE,aAAQ,GAAG,CAAC,CAAC;YAUb,aAAQ,GAAG,IAAI,CAAC;YAoBxB,gBAAW,GAAG,YAAY,CAAC;YAElB,SAAI,GAAc,IAAI,CAAC;YACvB,cAAS,GAAG,IAAI,CAAC;YAElB,gBAAW,GAAkB,MAAM,CAAC;YAUnC,aAAQ,GAAG,KAAK,CAAC;YAG1B,eAAU,GAAsB,IAAIC,iBAAY,EAAO,CAAC;YAGxD,iBAAY,GAAsC,IAAIA,iBAAY,EAAuB,CAAC;YAE1F,gBAAW,GAAG,EAAE,CAAC;YACjB,eAAU,GAAG,KAAK,CAAC;YACnB,YAAO,GAAG,IAAI,CAAC;YAEf,yBAAoB,GAChB,yUAAyU,CAAC;SAOzU;QArHL,sBACI,uCAAG;iBAWP;gBACI,OAAO,IAAI,CAAC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sBAqBbC,UAAK;sBAQLA,UAAK;wBAqBLA,UAAK;4BAOLA,UAAK;2BAOLA,UAAK;2BAOLA,UAAK;6BAQLA,UAAK;0BAGLA,UAAK;0BAULA,UAAK;uBAqBLA,UAAK;4BACLA,UAAK;6BAGLA,UAAK;2BASLA,UAAK;6BAELC,WAAM;+BAGNA,WAAM;;;;QCrHX;;;;;gBAfCC,aAAQ,SAAC;oBACN,OAAO,EAAE;wBACLC,mBAAY;wBACZC,yBAAmB;;wBAEnBC,sBAAe;wBACfC,4BAAkB;;wBAElBC,sBAAe;wBACfC,8BAAmB;wBACnBC,oCAAsB;qBACzB;oBACD,OAAO,EAAE,CAAC,sBAAsB,CAAC;oBACjC,YAAY,EAAE,CAAC,sBAAsB,CAAC;iBACzC;;;IC3BD;;;;ICAA;;;;;;;;;;;;;"}
|
|
@@ -97,9 +97,9 @@
|
|
|
97
97
|
configurable: true
|
|
98
98
|
});
|
|
99
99
|
PepButtonComponent.prototype.ngOnDestroy = function () {
|
|
100
|
-
if (this.buttonClick) {
|
|
101
|
-
|
|
102
|
-
}
|
|
100
|
+
// if (this.buttonClick) {
|
|
101
|
+
// this.buttonClick.unsubscribe();
|
|
102
|
+
// }
|
|
103
103
|
};
|
|
104
104
|
/**
|
|
105
105
|
* The button click
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pepperi-addons-ngx-lib-button.umd.js","sources":["../../../projects/ngx-lib/button/button.model.ts","../../../projects/ngx-lib/button/button.component.ts","../../../projects/ngx-lib/button/button.module.ts","../../../projects/ngx-lib/button/public-api.ts","../../../projects/ngx-lib/button/pepperi-addons-ngx-lib-button.ts"],"sourcesContent":["export class PepButton {\n key: string;\n value?: string;\n classNames?: string;\n disabled?: boolean;\n iconName?: string;\n iconPosition?: 'start' | 'end';\n callback?: (action: IPepButtonClickEvent) => void;\n\n constructor(data: Partial<PepButton>) {\n Object.assign(this, data);\n }\n}\n\nexport interface IPepButtonClickEvent {\n source: PepButton;\n event?: Event;\n}\n","import {\n Component,\n OnDestroy,\n Input,\n Output,\n EventEmitter,\n Renderer2,\n ElementRef,\n} from '@angular/core';\nimport {\n PepStyleType,\n PepStyleStateType,\n PepSizeType,\n} from '@pepperi-addons/ngx-lib';\nimport { PepIconType } from '@pepperi-addons/ngx-lib/icon';\nimport { PepButton, IPepButtonClickEvent } from './button.model';\n\n/**\n * This is a button component that support pepperi theme\n * style & state & sizes\n *\n * @export\n * @class PepButtonComponent\n * @implements {OnDestroy}\n */\n@Component({\n selector: 'pep-button',\n templateUrl: './button.component.html',\n styleUrls: ['./button.component.scss'],\n})\nexport class PepButtonComponent implements OnDestroy {\n /**\n * The button key\n *\n * @type {string}\n * @memberof PepButtonComponent\n */\n @Input() key: string;\n\n /**\n * The text on the button.\n *\n * @type {string}\n * @memberof PepButtonComponent\n */\n @Input() value: string;\n\n /**\n * The style of the button.\n *\n * @type {PepStyleType}\n * @memberof PepButtonComponent\n */\n @Input() styleType: PepStyleType = 'weak';\n\n /**\n * The style state of the button.\n *\n * @type {PepStyleStateType}\n * @memberof PepButtonComponent\n */\n @Input() styleStateType: PepStyleStateType = 'system';\n\n /**\n * The size of the button.\n *\n * @type {PepSizeType}\n * @memberof PepButtonComponent\n */\n @Input() sizeType: PepSizeType = 'md';\n\n /**\n * Class names that should be on the button element tag like classNames=\"class1 class2\"\n *\n * @memberof PepButtonComponent\n */\n @Input() classNames = '';\n\n /**\n * If the button is disable or not.\n *\n * @type {boolean}\n * @memberof PepButtonComponent\n */\n @Input() disabled = false;\n\n /**\n * The icon name to show on the button. look in (@link icon -> All icons)\n *\n * @type {PepIconType} See {@link PepIconType}\n * @memberof PepButtonComponent\n */\n @Input() iconName: PepIconType;\n\n /**\n * The icon position.\n *\n * @type {('start' | 'end')}\n * @memberof PepButtonComponent\n */\n @Input() iconPosition: 'start' | 'end' = 'end';\n\n private _visible = true;\n /**\n * If the button is visible or not.\n *\n * @memberof PepButtonComponent\n */\n @Input()\n set visible(visible: boolean) {\n if (visible !== undefined) {\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 }\n get visible(): boolean {\n return this._visible;\n }\n\n /**\n * The button click event.\n *\n * @type {EventEmitter<IPepButtonClickEvent>}\n * @memberof PepButtonComponent\n */\n @Output()\n buttonClick: EventEmitter<IPepButtonClickEvent> = new EventEmitter<IPepButtonClickEvent>();\n\n constructor(private renderer: Renderer2, private element: ElementRef) { }\n\n ngOnDestroy(): void {\n if (this.buttonClick) {\n
|
|
1
|
+
{"version":3,"file":"pepperi-addons-ngx-lib-button.umd.js","sources":["../../../projects/ngx-lib/button/button.model.ts","../../../projects/ngx-lib/button/button.component.ts","../../../projects/ngx-lib/button/button.module.ts","../../../projects/ngx-lib/button/public-api.ts","../../../projects/ngx-lib/button/pepperi-addons-ngx-lib-button.ts"],"sourcesContent":["export class PepButton {\n key: string;\n value?: string;\n classNames?: string;\n disabled?: boolean;\n iconName?: string;\n iconPosition?: 'start' | 'end';\n callback?: (action: IPepButtonClickEvent) => void;\n\n constructor(data: Partial<PepButton>) {\n Object.assign(this, data);\n }\n}\n\nexport interface IPepButtonClickEvent {\n source: PepButton;\n event?: Event;\n}\n","import {\n Component,\n OnDestroy,\n Input,\n Output,\n EventEmitter,\n Renderer2,\n ElementRef,\n} from '@angular/core';\nimport {\n PepStyleType,\n PepStyleStateType,\n PepSizeType,\n} from '@pepperi-addons/ngx-lib';\nimport { PepIconType } from '@pepperi-addons/ngx-lib/icon';\nimport { PepButton, IPepButtonClickEvent } from './button.model';\n\n/**\n * This is a button component that support pepperi theme\n * style & state & sizes\n *\n * @export\n * @class PepButtonComponent\n * @implements {OnDestroy}\n */\n@Component({\n selector: 'pep-button',\n templateUrl: './button.component.html',\n styleUrls: ['./button.component.scss'],\n})\nexport class PepButtonComponent implements OnDestroy {\n /**\n * The button key\n *\n * @type {string}\n * @memberof PepButtonComponent\n */\n @Input() key: string;\n\n /**\n * The text on the button.\n *\n * @type {string}\n * @memberof PepButtonComponent\n */\n @Input() value: string;\n\n /**\n * The style of the button.\n *\n * @type {PepStyleType}\n * @memberof PepButtonComponent\n */\n @Input() styleType: PepStyleType = 'weak';\n\n /**\n * The style state of the button.\n *\n * @type {PepStyleStateType}\n * @memberof PepButtonComponent\n */\n @Input() styleStateType: PepStyleStateType = 'system';\n\n /**\n * The size of the button.\n *\n * @type {PepSizeType}\n * @memberof PepButtonComponent\n */\n @Input() sizeType: PepSizeType = 'md';\n\n /**\n * Class names that should be on the button element tag like classNames=\"class1 class2\"\n *\n * @memberof PepButtonComponent\n */\n @Input() classNames = '';\n\n /**\n * If the button is disable or not.\n *\n * @type {boolean}\n * @memberof PepButtonComponent\n */\n @Input() disabled = false;\n\n /**\n * The icon name to show on the button. look in (@link icon -> All icons)\n *\n * @type {PepIconType} See {@link PepIconType}\n * @memberof PepButtonComponent\n */\n @Input() iconName: PepIconType;\n\n /**\n * The icon position.\n *\n * @type {('start' | 'end')}\n * @memberof PepButtonComponent\n */\n @Input() iconPosition: 'start' | 'end' = 'end';\n\n private _visible = true;\n /**\n * If the button is visible or not.\n *\n * @memberof PepButtonComponent\n */\n @Input()\n set visible(visible: boolean) {\n if (visible !== undefined) {\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 }\n get visible(): boolean {\n return this._visible;\n }\n\n /**\n * The button click event.\n *\n * @type {EventEmitter<IPepButtonClickEvent>}\n * @memberof PepButtonComponent\n */\n @Output()\n buttonClick: EventEmitter<IPepButtonClickEvent> = new EventEmitter<IPepButtonClickEvent>();\n\n constructor(private renderer: Renderer2, private element: ElementRef) { }\n\n ngOnDestroy(): void {\n // if (this.buttonClick) {\n // this.buttonClick.unsubscribe();\n // }\n }\n\n /**\n * The button click\n */\n onButtonClicked(event: Event): void {\n const button = new PepButton({\n key: this.key,\n value: this.value,\n });\n\n const buttonClick = {\n source: button,\n event,\n };\n\n this.buttonClick.emit(buttonClick);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { MatCommonModule } from '@angular/material/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { PepIconModule } from '@pepperi-addons/ngx-lib/icon';\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\n\nimport { PepButtonComponent } from './button.component';\n\n@NgModule({\n imports: [\n CommonModule,\n // Material modules\n MatCommonModule,\n MatButtonModule,\n MatIconModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepIconModule,\n ],\n exports: [PepButtonComponent],\n declarations: [PepButtonComponent],\n})\nexport class PepButtonModule {}\n","/*\n * Public API Surface of ngx-lib/button\n */\nexport * from './button.module';\nexport * from './button.component';\nexport * from './button.model';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["EventEmitter","Component","Renderer2","ElementRef","Input","Output","NgModule","CommonModule","MatCommonModule","MatButtonModule","MatIconModule","PepNgxLibModule","PepIconModule"],"mappings":";;;;;;;QASI,mBAAY,IAAwB;YAChC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SAC7B;wBACJ;KAAA;;ICKD;;;;;;;;;QAyHI,4BAAoB,QAAmB,EAAU,OAAmB;YAAhD,aAAQ,GAAR,QAAQ,CAAW;YAAU,YAAO,GAAP,OAAO,CAAY;;;;;;;YArF3D,cAAS,GAAiB,MAAM,CAAC;;;;;;;YAQjC,mBAAc,GAAsB,QAAQ,CAAC;;;;;;;YAQ7C,aAAQ,GAAgB,IAAI,CAAC;;;;;;YAO7B,eAAU,GAAG,EAAE,CAAC;;;;;;;YAQhB,aAAQ,GAAG,KAAK,CAAC;;;;;;;YAgBjB,iBAAY,GAAoB,KAAK,CAAC;YAEvC,aAAQ,GAAG,I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C,sBAAe;wBACfC,sBAAe;wBACfC,kBAAa;;wBAEbC,sBAAe;wBACfC,oBAAa;qBAChB;oBACD,OAAO,EAAE,CAAC,kBAAkB,CAAC;oBAC7B,YAAY,EAAE,CAAC,kBAAkB,CAAC;iBACrC;;;ICxBD;;;;ICAA;;;;;;;;;;;;;;"}
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
PepCheckboxComponent.decorators = [
|
|
133
133
|
{ type: core.Component, args: [{
|
|
134
134
|
selector: 'pep-checkbox',
|
|
135
|
-
template: "<ng-container [formGroup]=\"form\">\n <ng-template #pepTemplate>\n <div class=\"pep-checkbox-container pep-input\" [ngClass]=\"{\n 'disable': disabled,\n 'pep-report-checkbox': layoutType === 'table' && !isActive,\n 'pep-card-checkbox': layoutType === 'card',\n 'one-row': rowSpan === 1,\n 'no-title': label.length == 0,\n 'right-alignment pull-right flip': xAlignment == 'right',\n 'center-alignment': xAlignment == 'center'\n }\" dir=\"{{ xAlignment == 'right' ? 'rtl' : 'ltr' }}\">\n <!--\n This is cause a bug that when click on the pep-input area and after on the checkbox\n the value is updated only for the second time.\n (click)=\"toggleChecked($event)\" \n -->\n <ng-container *ngIf=\"type == 'booleanText'; then booleanTextTemplate; else regularTemplate\"></ng-container>\n <ng-template #booleanTextTemplate>\n <div class=\"mat-checkbox-layout body-sm\" (click)=\"toggleChecked($event)\"\n [title]=\"(label.length > 0 ? label + ': ' : '') + (value ? ('CHECKBOX.TRUE' | translate) : ('CHECKBOX.FALSE' | translate))\">\n <button [id]=\"key\" class=\"emoji-icon pull-left flip\">\n {{ value ? additionalValueObject?.CheckedText : additionalValueObject?.UncheckedText }}\n </button>\n <span *ngIf=\"label.length > 0 && layoutType !== 'table'\" class=\"mat-checkbox-label emoji-title\">{{\n label }}</span>\n </div>\n </ng-template>\n <ng-template #regularTemplate>\n <mat-checkbox [name]=\"key\" class=\"body-sm
|
|
135
|
+
template: "<ng-container [formGroup]=\"form\">\n <ng-template #pepTemplate>\n <div class=\"pep-checkbox-container pep-input\" [ngClass]=\"{\n 'disable': disabled,\n 'pep-report-checkbox': layoutType === 'table' && !isActive,\n 'pep-card-checkbox': layoutType === 'card',\n 'one-row': rowSpan === 1,\n 'no-title': label.length == 0,\n 'right-alignment pull-right flip': xAlignment == 'right',\n 'center-alignment': xAlignment == 'center'\n }\" dir=\"{{ xAlignment == 'right' ? 'rtl' : 'ltr' }}\">\n <!--\n This is cause a bug that when click on the pep-input area and after on the checkbox\n the value is updated only for the second time.\n (click)=\"toggleChecked($event)\" \n -->\n <ng-container *ngIf=\"type == 'booleanText'; then booleanTextTemplate; else regularTemplate\"></ng-container>\n <ng-template #booleanTextTemplate>\n <div class=\"mat-checkbox-layout body-sm\" (click)=\"toggleChecked($event)\"\n [title]=\"(label.length > 0 ? label + ': ' : '') + (value ? ('CHECKBOX.TRUE' | translate) : ('CHECKBOX.FALSE' | translate))\">\n <button [id]=\"key\" class=\"emoji-icon pull-left flip\">\n {{ value ? additionalValueObject?.CheckedText : additionalValueObject?.UncheckedText }}\n </button>\n <span *ngIf=\"label.length > 0 && layoutType !== 'table'\" class=\"mat-checkbox-label emoji-title\">{{\n label }}</span>\n </div>\n </ng-template>\n <ng-template #regularTemplate>\n <mat-checkbox [name]=\"key\" class=\"body-sm\" type=\"checkbox\" (change)=\"onMaterialChange($event)\"\n [title]=\"(label.length > 0 ? label + ': ' : '') + (value ? ('CHECKBOX.TRUE' | translate) : ('CHECKBOX.FALSE' | translate))\"\n [checked]=\"value\" [disabled]=\"disabled\">\n <span *ngIf=\"label.length > 0 && layoutType !== 'table'\">{{ label }}</span>\n </mat-checkbox>\n </ng-template>\n </div>\n </ng-template>\n\n <ng-container *ngIf=\"layoutType === 'form'\">\n <pep-field-title *ngIf=\"renderTitle\" [label]=\"label\" [mandatory]=\"mandatory\" [disabled]=\"disabled\"\n [xAlignment]=\"xAlignment\" [showTitle]=\"false\">\n </pep-field-title>\n <ng-container *ngTemplateOutlet=\"pepTemplate\"></ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"layoutType === 'card'\">\n <ng-container *ngTemplateOutlet=\"pepTemplate\"></ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"layoutType === 'table'\">\n <ng-container *ngIf=\"key === 'ItemHasActiveCampaign'; then itemCampaignBlock; else checkboxBlock\">\n </ng-container>\n <ng-template #itemCampaignBlock>\n <ng-container *ngIf=\"value; then trueTemplate; else falseTemplate\">\n </ng-container>\n <ng-template #trueTemplate>\n <mat-icon class=\"has-active-campaign\" title=\"{{ 'CHECKBOX.TRUE' | translate }}\">\n <pep-icon name=\"system_bolt\">\n </pep-icon>\n </mat-icon>\n </ng-template>\n <ng-template #falseTemplate>\n <span> </span>\n </ng-template>\n </ng-template>\n <ng-template #checkboxBlock>\n <ng-container *ngTemplateOutlet=\"pepTemplate\"></ng-container>\n </ng-template>\n </ng-container>\n</ng-container>",
|
|
136
136
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
137
137
|
styles: [":host{height:inherit;display:grid}:host>*{align-self:center}"]
|
|
138
138
|
},] }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pepperi-addons-ngx-lib-checkbox.umd.js","sources":["../../../projects/ngx-lib/checkbox/checkbox.component.ts","../../../projects/ngx-lib/checkbox/checkbox.module.ts","../../../projects/ngx-lib/checkbox/public-api.ts","../../../projects/ngx-lib/checkbox/pepperi-addons-ngx-lib-checkbox.ts"],"sourcesContent":["import {\n Component,\n OnInit,\n Input,\n Output,\n EventEmitter,\n ChangeDetectionStrategy,\n OnDestroy,\n Renderer2,\n ElementRef,\n Optional,\n OnChanges,\n} from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { MatCheckboxChange } from '@angular/material/checkbox';\nimport { TranslateService } from '@ngx-translate/core';\nimport {\n PepCustomizationService,\n PepLayoutType,\n PepHorizontalAlignment,\n DEFAULT_HORIZONTAL_ALIGNMENT,\n PepCheckboxFieldType,\n PepCheckboxField,\n} from '@pepperi-addons/ngx-lib';\n\n@Component({\n selector: 'pep-checkbox',\n templateUrl: './checkbox.component.html',\n styleUrls: ['./checkbox.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PepCheckboxComponent implements OnInit, OnChanges, OnDestroy {\n @Input() key = '';\n @Input() value: boolean = false;\n @Input() label = '';\n\n private _type: PepCheckboxFieldType = 'checkbox'; // || 'booleanText'\n @Input()\n set type(value: PepCheckboxFieldType) {\n this._type = value;\n this.setAdditionalValueObject();\n }\n get type(): PepCheckboxFieldType {\n return this._type;\n }\n\n @Input() mandatory = false;\n @Input() disabled = false;\n @Input() readonly = false;\n @Input() xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n @Input() rowSpan = 1;\n\n private _additionalValue: any = undefined;\n @Input()\n set additionalValue(value: any) {\n this._additionalValue = value;\n this.setAdditionalValueObject();\n }\n get additionalValue(): any {\n return this._additionalValue;\n }\n\n controlType = 'checkbox';\n\n @Input() form: FormGroup = null;\n @Input() isActive = false;\n @Input() showTitle = true;\n @Input() renderTitle = true;\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 @Output()\n valueChange: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n standAlone = false;\n\n additionalValueObject: any;\n public jsonLib = JSON;\n\n constructor(\n private renderer: Renderer2,\n private customizationService: PepCustomizationService,\n private element: ElementRef,\n private translate: TranslateService\n ) { }\n\n private setAdditionalValueObject() {\n if (this.additionalValue && this.type === 'booleanText') {\n try {\n if (typeof this.additionalValue === 'string') {\n this.additionalValueObject = JSON.parse(\n this.additionalValue\n );\n } else {\n this.additionalValueObject = this.additionalValue;\n }\n } catch {\n this.additionalValueObject = {\n CheckedText: this.translate.instant('CHECKBOX.TRUE'),\n UncheckedText: this.translate.instant('CHECKBOX.FALSE'),\n };\n }\n }\n }\n\n private setDefaultForm(): void {\n const pepField = new PepCheckboxField({\n key: this.key,\n value: this.value,\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.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\n ngOnDestroy(): void {\n //\n }\n\n onMaterialChange(e: MatCheckboxChange): void {\n this.changeValue(e.checked);\n }\n\n toggleChecked(event: Event): void {\n if (!this.disabled) {\n const isChecked: boolean =\n this.value ? true : false;\n const newValue = !isChecked;\n this.value = newValue;\n this.changeValue(newValue);\n }\n }\n\n changeValue(value: any): void {\n this.customizationService.updateFormFieldValue(\n this.form,\n this.key,\n value\n );\n this.valueChange.emit(value);\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 { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\nimport {\n PepIconModule,\n PepIconRegistry,\n pepIconSystemBolt,\n} from '@pepperi-addons/ngx-lib/icon';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\n\nimport { PepCheckboxComponent } from './checkbox.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n // Material modules\n MatCommonModule,\n MatFormFieldModule,\n MatCheckboxModule,\n MatIconModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepIconModule,\n PepFieldTitleModule,\n ],\n exports: [PepCheckboxComponent],\n declarations: [PepCheckboxComponent],\n})\nexport class PepCheckboxModule {\n constructor(private pepIconRegistry: PepIconRegistry) {\n this.pepIconRegistry.registerIcons([pepIconSystemBolt]);\n }\n}\n","/*\n * Public API Surface of ngx-lib/checkbox\n */\nexport * from './checkbox.module';\nexport * from './checkbox.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["DEFAULT_HORIZONTAL_ALIGNMENT","EventEmitter","PepCheckboxField","PepCustomizationService","Component","ChangeDetectionStrategy","Renderer2","ElementRef","TranslateService","Input","Output","pepIconSystemBolt","NgModule","CommonModule","ReactiveFormsModule","MatCommonModule","MatFormFieldModule","MatCheckboxModule","MatIconModule","PepNgxLibModule","PepIconModule","PepFieldTitleModule","PepIconRegistry"],"mappings":";;;;;;;QAkGI,8BACY,QAAmB,EACnB,oBAA6C,EAC7C,OAAmB,EACnB,SAA2B;YAH3B,aAAQ,GAAR,QAAQ,CAAW;YACnB,yBAAoB,GAApB,oBAAoB,CAAyB;YAC7C,YAAO,GAAP,OAAO,CAAY;YACnB,cAAS,GAAT,SAAS,CAAkB;YAtE9B,QAAG,GAAG,EAAE,CAAC;YACT,UAAK,GAAY,KAAK,CAAC;YACvB,UAAK,GAAG,EAAE,CAAC;YAEZ,UAAK,GAAyB,UAAU,CAAC;YAUxC,cAAS,GAAG,KAAK,CAAC;YAClB,aAAQ,GAAG,KAAK,CAAC;YACjB,aAAQ,GAAG,KAAK,CAAC;YACjB,eAAU,GAA2BA,mCAA4B,CAAC;YAClE,YAAO,GAAG,CAAC,CAAC;YAEb,qBAAgB,GAAQ,SAAS,CAAC;YAU1C,gBAAW,GAAG,UAAU,CAAC;YAEhB,SAAI,GAAc,IAAI,CAAC;YACvB,aAAQ,GAAG,KAAK,CAAC;YACjB,cAAS,GAAG,IAAI,CAAC;YACjB,gBAAW,GAAG,IAAI,CAAC;YACnB,eAAU,GAAkB,MAAM,CAAC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AAC,oBAAoB,CAAC;iBACvC;;;gBAvBGC,oBAAe;;;ICZnB;;;;ICAA;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"pepperi-addons-ngx-lib-checkbox.umd.js","sources":["../../../projects/ngx-lib/checkbox/checkbox.component.ts","../../../projects/ngx-lib/checkbox/checkbox.module.ts","../../../projects/ngx-lib/checkbox/public-api.ts","../../../projects/ngx-lib/checkbox/pepperi-addons-ngx-lib-checkbox.ts"],"sourcesContent":["import {\n Component,\n OnInit,\n Input,\n Output,\n EventEmitter,\n ChangeDetectionStrategy,\n OnDestroy,\n Renderer2,\n ElementRef,\n Optional,\n OnChanges,\n} from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { MatCheckboxChange } from '@angular/material/checkbox';\nimport { TranslateService } from '@ngx-translate/core';\nimport {\n PepCustomizationService,\n PepLayoutType,\n PepHorizontalAlignment,\n DEFAULT_HORIZONTAL_ALIGNMENT,\n PepCheckboxFieldType,\n PepCheckboxField,\n} from '@pepperi-addons/ngx-lib';\n\n@Component({\n selector: 'pep-checkbox',\n templateUrl: './checkbox.component.html',\n styleUrls: ['./checkbox.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PepCheckboxComponent implements OnInit, OnChanges, OnDestroy {\n @Input() key = '';\n @Input() value: boolean = false;\n @Input() label = '';\n\n private _type: PepCheckboxFieldType = 'checkbox'; // || 'booleanText'\n @Input()\n set type(value: PepCheckboxFieldType) {\n this._type = value;\n this.setAdditionalValueObject();\n }\n get type(): PepCheckboxFieldType {\n return this._type;\n }\n\n @Input() mandatory = false;\n @Input() disabled = false;\n @Input() readonly = false;\n @Input() xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n @Input() rowSpan = 1;\n\n private _additionalValue: any = undefined;\n @Input()\n set additionalValue(value: any) {\n this._additionalValue = value;\n this.setAdditionalValueObject();\n }\n get additionalValue(): any {\n return this._additionalValue;\n }\n\n controlType = 'checkbox';\n\n @Input() form: FormGroup = null;\n @Input() isActive = false;\n @Input() showTitle = true;\n @Input() renderTitle = true;\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 @Output()\n valueChange: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n standAlone = false;\n\n additionalValueObject: any;\n public jsonLib = JSON;\n\n constructor(\n private renderer: Renderer2,\n private customizationService: PepCustomizationService,\n private element: ElementRef,\n private translate: TranslateService\n ) { }\n\n private setAdditionalValueObject() {\n if (this.additionalValue && this.type === 'booleanText') {\n try {\n if (typeof this.additionalValue === 'string') {\n this.additionalValueObject = JSON.parse(\n this.additionalValue\n );\n } else {\n this.additionalValueObject = this.additionalValue;\n }\n } catch {\n this.additionalValueObject = {\n CheckedText: this.translate.instant('CHECKBOX.TRUE'),\n UncheckedText: this.translate.instant('CHECKBOX.FALSE'),\n };\n }\n }\n }\n\n private setDefaultForm(): void {\n const pepField = new PepCheckboxField({\n key: this.key,\n value: this.value,\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.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\n ngOnDestroy(): void {\n //\n }\n\n onMaterialChange(e: MatCheckboxChange): void {\n this.changeValue(e.checked);\n }\n\n toggleChecked(event: Event): void {\n if (!this.disabled) {\n const isChecked: boolean =\n this.value ? true : false;\n const newValue = !isChecked;\n this.value = newValue;\n this.changeValue(newValue);\n }\n }\n\n changeValue(value: any): void {\n this.customizationService.updateFormFieldValue(\n this.form,\n this.key,\n value\n );\n this.valueChange.emit(value);\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 { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\nimport {\n PepIconModule,\n PepIconRegistry,\n pepIconSystemBolt,\n} from '@pepperi-addons/ngx-lib/icon';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\n\nimport { PepCheckboxComponent } from './checkbox.component';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n // Material modules\n MatCommonModule,\n MatFormFieldModule,\n MatCheckboxModule,\n MatIconModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepIconModule,\n PepFieldTitleModule,\n ],\n exports: [PepCheckboxComponent],\n declarations: [PepCheckboxComponent],\n})\nexport class PepCheckboxModule {\n constructor(private pepIconRegistry: PepIconRegistry) {\n this.pepIconRegistry.registerIcons([pepIconSystemBolt]);\n }\n}\n","/*\n * Public API Surface of ngx-lib/checkbox\n */\nexport * from './checkbox.module';\nexport * from './checkbox.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["DEFAULT_HORIZONTAL_ALIGNMENT","EventEmitter","PepCheckboxField","PepCustomizationService","Component","ChangeDetectionStrategy","Renderer2","ElementRef","TranslateService","Input","Output","pepIconSystemBolt","NgModule","CommonModule","ReactiveFormsModule","MatCommonModule","MatFormFieldModule","MatCheckboxModule","MatIconModule","PepNgxLibModule","PepIconModule","PepFieldTitleModule","PepIconRegistry"],"mappings":";;;;;;;QAkGI,8BACY,QAAmB,EACnB,oBAA6C,EAC7C,OAAmB,EACnB,S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BAAgB;;;sBAiBpBC,UAAK;wBACLA,UAAK;wBACLA,UAAK;uBAGLA,UAAK;4BASLA,UAAK;2BACLA,UAAK;2BACLA,UAAK;6BACLA,UAAK;0BACLA,UAAK;kCAGLA,UAAK;uBAWLA,UAAK;2BACLA,UAAK;4BACLA,UAAK;8BACLA,UAAK;6BACLA,UAAK;0BAGLA,UAAK;8BAmBLC,WAAM;;;;QCrDP,2BAAoB,eAAgC;YAAhC,oBAAe,GAAf,eAAe,CAAiB;YAChD,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,CAACC,sBAAiB,CAAC,CAAC,CAAC;SAC3D;;;;gBApBJC,aAAQ,SAAC;oBACN,OAAO,EAAE;wBACLC,mBAAY;wBACZC,yBAAmB;;wBAEnBC,sBAAe;wBACfC,4BAAkB;wBAClBC,0BAAiB;wBACjBC,oBAAa;;wBAEbC,sBAAe;wBACfC,kBAAa;wBACbC,8BAAmB;qBACtB;oBACD,OAAO,EAAE,CAAC,oBAAoB,CAAC;oBAC/B,YAAY,EAAE,CAAC,oBAAoB,CAAC;iBACvC;;;gBAvBGC,oBAAe;;;ICZnB;;;;ICAA;;;;;;;;;;;;;"}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
this.mandatory = false;
|
|
11
11
|
this.disabled = false;
|
|
12
12
|
this.maxFieldCharacters = 0;
|
|
13
|
+
this.hint = '';
|
|
13
14
|
this.xAlignment = ngxLib.DEFAULT_HORIZONTAL_ALIGNMENT;
|
|
14
15
|
this.showTitle = true;
|
|
15
16
|
this.inputLength = 0;
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
PepFieldTitleComponent.decorators = [
|
|
20
21
|
{ type: core.Component, args: [{
|
|
21
22
|
selector: 'pep-field-title',
|
|
22
|
-
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=\"
|
|
23
|
+
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>",
|
|
23
24
|
styles: [":host{display:grid;width:inherit}"]
|
|
24
25
|
},] }
|
|
25
26
|
];
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
mandatory: [{ type: core.Input }],
|
|
29
30
|
disabled: [{ type: core.Input }],
|
|
30
31
|
maxFieldCharacters: [{ type: core.Input }],
|
|
32
|
+
hint: [{ type: core.Input }],
|
|
31
33
|
xAlignment: [{ type: core.Input }],
|
|
32
34
|
showTitle: [{ type: core.Input }],
|
|
33
35
|
inputLength: [{ type: core.Input }]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pepperi-addons-ngx-lib-field-title.umd.js","sources":["../../../projects/ngx-lib/field-title/field-title.component.ts","../../../projects/ngx-lib/field-title/field-title.module.ts","../../../projects/ngx-lib/field-title/public-api.ts","../../../projects/ngx-lib/field-title/pepperi-addons-ngx-lib-field-title.ts"],"sourcesContent":["import { Component, Input } from '@angular/core';\nimport {\n PepHorizontalAlignment,\n DEFAULT_HORIZONTAL_ALIGNMENT,\n} from '@pepperi-addons/ngx-lib';\n\n@Component({\n selector: 'pep-field-title',\n templateUrl: './field-title.component.html',\n styleUrls: ['./field-title.component.scss'],\n})\nexport class PepFieldTitleComponent {\n @Input() label = '';\n @Input() mandatory = false;\n @Input() disabled = false;\n @Input() maxFieldCharacters = 0;\n @Input() xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n\n @Input() showTitle = true;\n @Input() inputLength = 0;\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { MatCommonModule } from '@angular/material/core';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatFormFieldModule } from '@angular/material/form-field';\n\nimport {\n PepIconModule,\n PepIconRegistry,\n pepIconSystemMust,\n} from '@pepperi-addons/ngx-lib/icon';\n\nimport { PepFieldTitleComponent } from './field-title.component';\n\n@NgModule({\n imports: [\n CommonModule,\n // Material modules,\n MatCommonModule,\n MatIconModule,\n MatFormFieldModule,\n // ngx-lib modules\n PepIconModule,\n ],\n exports: [PepFieldTitleComponent],\n declarations: [PepFieldTitleComponent],\n})\nexport class PepFieldTitleModule {\n constructor(private pepIconRegistry: PepIconRegistry) {\n this.pepIconRegistry.registerIcons([pepIconSystemMust]);\n }\n}\n","/*\n * Public API Surface of ngx-lib/field-title\n */\nexport * from './field-title.module';\nexport * from './field-title.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["DEFAULT_HORIZONTAL_ALIGNMENT","Component","Input","pepIconSystemMust","NgModule","CommonModule","MatCommonModule","MatIconModule","MatFormFieldModule","PepIconModule","PepIconRegistry"],"mappings":";;;;;;;QAMA;YAMa,UAAK,GAAG,EAAE,CAAC;YACX,cAAS,GAAG,KAAK,CAAC;YAClB,aAAQ,GAAG,KAAK,CAAC;YACjB,uBAAkB,GAAG,CAAC,CAAC;YACvB,eAAU,GAA2BA,mCAA4B,CAAC;YAElE,cAAS,GAAG,IAAI,CAAC;YACjB,gBAAW,GAAG,CAAC,CAAC;SAC5B;;;;
|
|
1
|
+
{"version":3,"file":"pepperi-addons-ngx-lib-field-title.umd.js","sources":["../../../projects/ngx-lib/field-title/field-title.component.ts","../../../projects/ngx-lib/field-title/field-title.module.ts","../../../projects/ngx-lib/field-title/public-api.ts","../../../projects/ngx-lib/field-title/pepperi-addons-ngx-lib-field-title.ts"],"sourcesContent":["import { Component, Input } from '@angular/core';\nimport {\n PepHorizontalAlignment,\n DEFAULT_HORIZONTAL_ALIGNMENT,\n} from '@pepperi-addons/ngx-lib';\n\n@Component({\n selector: 'pep-field-title',\n templateUrl: './field-title.component.html',\n styleUrls: ['./field-title.component.scss'],\n})\nexport class PepFieldTitleComponent {\n @Input() label = '';\n @Input() mandatory = false;\n @Input() disabled = false;\n @Input() maxFieldCharacters = 0;\n @Input() hint = '';\n @Input() xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n\n @Input() showTitle = true;\n @Input() inputLength = 0;\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { MatCommonModule } from '@angular/material/core';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatFormFieldModule } from '@angular/material/form-field';\n\nimport {\n PepIconModule,\n PepIconRegistry,\n pepIconSystemMust,\n} from '@pepperi-addons/ngx-lib/icon';\n\nimport { PepFieldTitleComponent } from './field-title.component';\n\n@NgModule({\n imports: [\n CommonModule,\n // Material modules,\n MatCommonModule,\n MatIconModule,\n MatFormFieldModule,\n // ngx-lib modules\n PepIconModule,\n ],\n exports: [PepFieldTitleComponent],\n declarations: [PepFieldTitleComponent],\n})\nexport class PepFieldTitleModule {\n constructor(private pepIconRegistry: PepIconRegistry) {\n this.pepIconRegistry.registerIcons([pepIconSystemMust]);\n }\n}\n","/*\n * Public API Surface of ngx-lib/field-title\n */\nexport * from './field-title.module';\nexport * from './field-title.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["DEFAULT_HORIZONTAL_ALIGNMENT","Component","Input","pepIconSystemMust","NgModule","CommonModule","MatCommonModule","MatIconModule","MatFormFieldModule","PepIconModule","PepIconRegistry"],"mappings":";;;;;;;QAMA;YAMa,UAAK,GAAG,EAAE,CAAC;YACX,cAAS,GAAG,KAAK,CAAC;YAClB,aAAQ,GAAG,KAAK,CAAC;YACjB,uBAAkB,GAAG,CAAC,CAAC;YACvB,SAAI,GAAG,EAAE,CAAC;YACV,eAAU,GAA2BA,mCAA4B,CAAC;YAElE,cAAS,GAAG,IAAI,CAAC;YACjB,gBAAW,GAAG,CAAC,CAAC;SAC5B;;;;gBAfAC,cAAS,SAAC;oBACP,QAAQ,EAAE,iBAAiB;oBAC3B,i/DAA2C;;iBAE9C;;;wBAEIC,UAAK;4BACLA,UAAK;2BACLA,UAAK;qCACLA,UAAK;uBACLA,UAAK;6BACLA,UAAK;4BAELA,UAAK;8BACLA,UAAK;;;;QCSN,6BAAoB,eAAgC;YAAhC,oBAAe,GAAf,eAAe,CAAiB;YAChD,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,CAACC,sBAAiB,CAAC,CAAC,CAAC;SAC3D;;;;gBAhBJC,aAAQ,SAAC;oBACN,OAAO,EAAE;wBACLC,mBAAY;;wBAEZC,sBAAe;wBACfC,oBAAa;wBACbC,4BAAkB;;wBAElBC,kBAAa;qBAChB;oBACD,OAAO,EAAE,CAAC,sBAAsB,CAAC;oBACjC,YAAY,EAAE,CAAC,sBAAsB,CAAC;iBACzC;;;gBAlBGC,oBAAe;;;ICTnB;;;;ICAA;;;;;;;;;;;;;"}
|
|
@@ -1737,7 +1737,7 @@
|
|
|
1737
1737
|
PepFieldGeneratorComponent.decorators = [
|
|
1738
1738
|
{ type: core.Component, args: [{
|
|
1739
1739
|
selector: 'pep-field-generator',
|
|
1740
|
-
template: "<ng-container [ngSwitch]=\"field.controlType\" [formGroup]=\"form\">\n\n <pep-address *ngSwitchCase=\"'address'\" [form]=\"form\" [key]=\"field.key\" [formattedValue]=\"field.formattedValue\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [groupFields]=\"field.groupFields\"\n [layoutType]=\"layoutType\" (addressValueChange)=\"onAddressValueChanged($event, field)\">\n </pep-address>\n\n <pep-attachment *ngSwitchCase=\"'attachment'\" [form]=\"form\" [key]=\"field.key\" [src]=\"field.value\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [isActive]=\"isActive\" [showTitle]=\"showTitle\"\n [layoutType]=\"layoutType\" (elementClick)=\"onClick($event)\"
|
|
1740
|
+
template: "<ng-container [ngSwitch]=\"field.controlType\" [formGroup]=\"form\">\n\n <pep-address *ngSwitchCase=\"'address'\" [form]=\"form\" [key]=\"field.key\" [formattedValue]=\"field.formattedValue\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [groupFields]=\"field.groupFields\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (addressValueChange)=\"onAddressValueChanged($event, field)\">\n </pep-address>\n\n <pep-attachment *ngSwitchCase=\"'attachment'\" [form]=\"form\" [key]=\"field.key\" [src]=\"field.value\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [isActive]=\"isActive\" [showTitle]=\"showTitle\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (elementClick)=\"onClick($event)\"\n (fileChange)=\"onFileChanged($event, field)\">\n </pep-attachment>\n\n <pep-checkbox *ngSwitchCase=\"'checkbox'\" [form]=\"form\" [key]=\"field.key\"\n [value]=\"(field.value | lowercase) == 'true' || field.value == '1' ? true : false\" [label]=\"field.label\"\n [type]=\"field.type\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [additionalValue]=\"field.additionalValue\"\n [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [visible]=\"field.visible\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\">\n </pep-checkbox>\n\n <pep-date *ngSwitchCase=\"'date'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [formattedValue]=\"field.formattedValue\" [label]=\"field.label\" [type]=\"field.type\" [mandatory]=\"field.mandatory\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [textColor]=\"field.textColor\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [minValue]=\"field.minValue\"\n [maxValue]=\"field.maxValue\" [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [visible]=\"field.visible\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\">\n </pep-date>\n\n <pep-images-filmstrip *ngSwitchCase=\"'images'\" [uid]=\"uid\" [form]=\"form\" [key]=\"field.key\" [label]=\"field.label\"\n [showTitle]=\"showTitle\" [rowSpan]=\"field.rowSpan\" [value]=\"field.value\" [layoutType]=\"layoutType\">\n </pep-images-filmstrip>\n\n <pep-image *ngSwitchCase=\"'image'\" [uid]=\"uid\" [form]=\"form\" [key]=\"field.key\" [src]=\"field.formattedValue\"\n [srcLarge]=\"field.value\" [options]=\"field.options\" [label]=\"field.label\" [mandatory]=\"field.mandatory\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\"\n [rowSpan]=\"field.rowSpan\" [indicatorsField]=\"field.indicatorsField\" [menuField]=\"field.menuField\"\n [hasCampaignField]=\"field.hasCampaignField\" [sizeLimitMB]=\"field.sizeLimitMB\" [isActive]=\"isActive\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (elementClick)=\"onClick($event)\"\n (fileChange)=\"onFileChanged($event, field)\">\n </pep-image>\n\n <pep-quantity-selector *ngSwitchCase=\"'qs'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [formattedValue]=\"field.formattedValue\" [label]=\"field.label\" [type]=\"field.type\" [mandatory]=\"field.mandatory\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [textColor]=\"field.textColor\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [allowDecimal]=\"field.allowDecimal\"\n [additionalValue]=\"field.additionalValue\" [notificationInfo]=\"field.notificationInfo\" [isActive]=\"isActive\"\n [layoutType]=\"layoutType\" [showTitle]=\"showTitle\" [visible]=\"field.visible\"\n (valueChange)=\"onValueChanged($event, field)\" (formValidationChange)=\"onFormValidationChanged($event)\"\n (elementClick)=\"onClick($event)\">\n </pep-quantity-selector>\n\n <pep-rich-html-textarea *ngSwitchCase=\"'richhtmltextarea'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [label]=\"field.label\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [maxFieldCharacters]=\"field.maxFieldCharacters\" [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\"\n [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [visible]=\"field.visible\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\">\n </pep-rich-html-textarea>\n\n <pep-select *ngSwitchCase=\"'select'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\" [label]=\"field.label\"\n [type]=\"field.type\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [options]=\"field.options\" [showTitle]=\"showTitle\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (valueChange)=\"onValueChanged($event, field)\"\n (formValidationChange)=\"onFormValidationChanged($event)\" [isActive]=\"isActive\">\n </pep-select>\n\n <pep-separator *ngSwitchCase=\"'separator'\" [form]=\"form\" [key]=\"field.key\" [label]=\"field.label\"\n [xAlignment]=\"field.xAlignment\" [layoutType]=\"layoutType\" [visible]=\"field.visible\">\n </pep-separator>\n\n <pep-signature *ngSwitchCase=\"'signature'\" [form]=\"form\" [key]=\"field.key\" [src]=\"field.value\" [label]=\"field.label\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [xAlignment]=\"field.xAlignment\" [rowSpan]=\"field.rowSpan\" [isActive]=\"isActive\" [layoutType]=\"layoutType\"\n [visible]=\"field.visible\" (fileChange)=\"onFileChanged($event, field)\">\n </pep-signature>\n\n <pep-textarea *ngSwitchCase=\"'textarea'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\" [label]=\"field.label\"\n [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [maxFieldCharacters]=\"field.maxFieldCharacters\" [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\"\n [rowSpan]=\"field.rowSpan\" [showTitle]=\"showTitle\" [layoutType]=\"layoutType\" [visible]=\"field.visible\"\n (valueChange)=\"onValueChanged($event, field)\" [isActive]=\"isActive\">\n </pep-textarea>\n\n <pep-textbox *ngSwitchCase=\"'textbox'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [formattedValue]=\"field.formattedValue\" [label]=\"field.label\" [placeholder]=\"field.placeholder\"\n [type]=\"field.type\" [mandatory]=\"field.mandatory\" [disabled]=\"field.disabled\" [readonly]=\"field.readonly\"\n [maxFieldCharacters]=\"field.maxFieldCharacters\" [textColor]=\"field.textColor\" [xAlignment]=\"field.xAlignment\"\n [rowSpan]=\"field.rowSpan\" [showTitle]=\"showTitle\" [layoutType]=\"layoutType\"\n (valueChange)=\"onValueChanged($event, field)\" (formValidationChange)=\"onFormValidationChanged($event)\"\n [isActive]=\"isActive\" [visible]=\"field.visible\">\n </pep-textbox>\n\n <pep-indicators *ngSwitchCase=\"'indicators'\" [key]=\"field.key\" [value]=\"field.value\" [layoutType]=\"layoutType\">\n </pep-indicators>\n <pep-internal-button *ngSwitchCase=\"'button'\" [form]=\"form\" [key]=\"field.key\" [value]=\"field.value\"\n [formattedValue]=\"field.formattedValue\" [label]=\"field.label\"\n [referenceObjectInternalType]=\"field.referenceObjectInternalType\" [type]=\"field.type\"\n [disabled]=\"field.disabled\" [readonly]=\"field.readonly\" [xAlignment]=\"field.xAlignment\"\n [layoutType]=\"layoutType\" [visible]=\"field.visible\" (elementClick)=\"onClick($event)\"\n (valueChange)=\"onValueChanged($event, field)\">\n </pep-internal-button>\n <pep-internal-menu *ngSwitchCase=\"'menu'\" [key]=\"field.key\" [label]=\"field.label\" [disabled]=\"field.disabled\"\n [xAlignment]=\"field.xAlignment\" [options]=\"field.options\" [layoutType]=\"layoutType\"\n (elementClick)=\"onClick($event)\">\n </pep-internal-menu>\n <pep-internal-page *ngSwitchCase=\"'internalPage'\" [field]=\"field\" [layoutType]=\"layoutType\"\n (childClick)=\"onChildClick($event)\" (childChange)=\"onChildChanged($event)\">\n </pep-internal-page>\n\n <ng-container *ngSwitchCase=\"'placeholder'\">\n </ng-container>\n</ng-container>",
|
|
1741
1741
|
encapsulation: core.ViewEncapsulation.Emulated,
|
|
1742
1742
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
1743
1743
|
styles: [":host{width:100%;height:100%}"]
|