@pepperi-addons/ngx-lib 0.3.9-beta.7 → 0.3.9
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/bundles/pepperi-addons-ngx-lib-date.umd.js +11 -3
- package/bundles/pepperi-addons-ngx-lib-date.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-draggable-items.umd.js +4 -2
- package/bundles/pepperi-addons-ngx-lib-draggable-items.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-files-uploader.umd.js +14 -3
- package/bundles/pepperi-addons-ngx-lib-files-uploader.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-form.umd.js +17 -8
- package/bundles/pepperi-addons-ngx-lib-form.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-icon.umd.js +40 -14
- package/bundles/pepperi-addons-ngx-lib-icon.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-image.umd.js +14 -8
- package/bundles/pepperi-addons-ngx-lib-image.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-link.umd.js +488 -0
- package/bundles/pepperi-addons-ngx-lib-link.umd.js.map +1 -0
- package/bundles/pepperi-addons-ngx-lib-list.umd.js +1 -1
- package/bundles/pepperi-addons-ngx-lib-profile-data-views-list.umd.js +14 -9
- package/bundles/pepperi-addons-ngx-lib-profile-data-views-list.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-search.umd.js +10 -3
- package/bundles/pepperi-addons-ngx-lib-search.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-select.umd.js +2 -3
- package/bundles/pepperi-addons-ngx-lib-select.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib.umd.js +25 -2
- package/bundles/pepperi-addons-ngx-lib.umd.js.map +1 -1
- package/core/customization/customization.model.d.ts +6 -0
- package/date/date.component.d.ts +1 -0
- package/date/pepperi-addons-ngx-lib-date.metadata.json +1 -1
- package/draggable-items/draggable-items.component.d.ts +2 -0
- package/draggable-items/pepperi-addons-ngx-lib-draggable-items.metadata.json +1 -1
- package/esm2015/core/common/services/utilities.service.js +4 -2
- package/esm2015/core/customization/customization.model.js +18 -2
- package/esm2015/date/date.component.js +12 -5
- package/esm2015/draggable-items/draggable-items.component.js +5 -3
- package/esm2015/files-uploader/files-uploader.component.js +15 -4
- package/esm2015/form/field-generator.component.js +2 -2
- package/esm2015/form/form.component.js +13 -5
- package/esm2015/form/form.module.js +3 -1
- package/esm2015/icon/icon-generated-all.model.js +2 -1
- package/esm2015/icon/icon-generated.model.js +5 -1
- package/esm2015/icon/icon.component.js +7 -20
- package/esm2015/icon/icon.module.js +3 -2
- package/esm2015/icon/icon.service.js +32 -0
- package/esm2015/icon/public-api.js +2 -1
- package/esm2015/image/image.component.js +15 -9
- package/esm2015/link/link.component.js +391 -0
- package/esm2015/link/link.module.js +51 -0
- package/esm2015/link/link.pipes.js +15 -0
- package/esm2015/link/pepperi-addons-ngx-lib-link.js +6 -0
- package/esm2015/link/public-api.js +6 -0
- package/esm2015/list/list-total.component.js +1 -1
- package/esm2015/profile-data-views-list/profile-data-view/profile-data-view.component.js +6 -2
- package/esm2015/profile-data-views-list/profile-data-views-card/profile-data-views-card.component.js +6 -6
- package/esm2015/profile-data-views-list/profile-data-views-list.component.js +5 -4
- package/esm2015/search/search.component.js +11 -4
- package/esm2015/select/select.component.js +3 -4
- package/fesm2015/pepperi-addons-ngx-lib-date.js +11 -4
- package/fesm2015/pepperi-addons-ngx-lib-date.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-draggable-items.js +4 -2
- package/fesm2015/pepperi-addons-ngx-lib-draggable-items.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-files-uploader.js +14 -3
- package/fesm2015/pepperi-addons-ngx-lib-files-uploader.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-form.js +15 -5
- package/fesm2015/pepperi-addons-ngx-lib-form.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-icon.js +38 -15
- package/fesm2015/pepperi-addons-ngx-lib-icon.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-image.js +14 -8
- package/fesm2015/pepperi-addons-ngx-lib-image.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-link.js +460 -0
- package/fesm2015/pepperi-addons-ngx-lib-link.js.map +1 -0
- package/fesm2015/pepperi-addons-ngx-lib-list.js +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-profile-data-views-list.js +14 -9
- package/fesm2015/pepperi-addons-ngx-lib-profile-data-views-list.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-search.js +10 -3
- package/fesm2015/pepperi-addons-ngx-lib-search.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-select.js +2 -3
- package/fesm2015/pepperi-addons-ngx-lib-select.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib.js +21 -3
- package/fesm2015/pepperi-addons-ngx-lib.js.map +1 -1
- package/files-uploader/files-uploader.component.d.ts +2 -0
- package/files-uploader/pepperi-addons-ngx-lib-files-uploader.metadata.json +1 -1
- package/form/pepperi-addons-ngx-lib-form.metadata.json +1 -1
- package/icon/icon-generated-all.model.d.ts +1 -0
- package/icon/icon-generated.model.d.ts +5 -1
- package/icon/icon.component.d.ts +3 -6
- package/icon/icon.service.d.ts +10 -0
- package/icon/pepperi-addons-ngx-lib-icon.metadata.json +1 -1
- package/icon/public-api.d.ts +1 -0
- package/image/image.component.d.ts +1 -0
- package/image/pepperi-addons-ngx-lib-image.metadata.json +1 -1
- package/link/link.component.d.ts +136 -0
- package/link/link.module.d.ts +5 -0
- package/link/link.pipes.d.ts +4 -0
- package/link/package.json +14 -0
- package/link/pepperi-addons-ngx-lib-link.d.ts +5 -0
- package/link/pepperi-addons-ngx-lib-link.metadata.json +1 -0
- package/link/public-api.d.ts +2 -0
- package/list/pepperi-addons-ngx-lib-list.metadata.json +1 -1
- package/package.json +1 -1
- package/pepperi-addons-ngx-lib.metadata.json +1 -1
- package/profile-data-views-list/pepperi-addons-ngx-lib-profile-data-views-list.metadata.json +1 -1
- package/profile-data-views-list/profile-data-view/profile-data-view.component.d.ts +1 -0
- package/profile-data-views-list/profile-data-views-list.component.d.ts +1 -1
- package/search/pepperi-addons-ngx-lib-search.metadata.json +1 -1
- package/search/search.component.d.ts +1 -0
- package/src/assets/i18n/en.ngx-lib.json +2 -1
- package/src/core/style/abstracts/functions.scss +10 -10
- package/src/core/style/abstracts/mixins.scss +96 -96
- package/src/core/style/base/base.scss +37 -15
- package/src/core/style/base/typography.scss +8 -0
- package/theming.scss +0 -15
|
@@ -151,6 +151,13 @@ class PepImageComponent {
|
|
|
151
151
|
});
|
|
152
152
|
this.form = this.customizationService.getDefaultFromGroup(pepField);
|
|
153
153
|
}
|
|
154
|
+
getOtherData() {
|
|
155
|
+
return {
|
|
156
|
+
imageSrc: this.srcLarge || this.src,
|
|
157
|
+
options: this.options,
|
|
158
|
+
title: this.label
|
|
159
|
+
};
|
|
160
|
+
}
|
|
154
161
|
ngOnChanges(changes) {
|
|
155
162
|
var _a, _b;
|
|
156
163
|
if (this.standAlone) {
|
|
@@ -207,6 +214,8 @@ class PepImageComponent {
|
|
|
207
214
|
this.src.indexOf('no-image') > -1) {
|
|
208
215
|
hasParentImage = false;
|
|
209
216
|
}
|
|
217
|
+
// Add the other data object for let the client open the image dialog eazy.
|
|
218
|
+
event.otherData = this.getOtherData();
|
|
210
219
|
this.elementClick.emit(event);
|
|
211
220
|
}
|
|
212
221
|
itemImageClick(event) {
|
|
@@ -225,16 +234,13 @@ class PepImageComponent {
|
|
|
225
234
|
// } else {
|
|
226
235
|
// this.imageService.openImageDialog(this.srcLarge || this.src, this.options, this.label);
|
|
227
236
|
// }
|
|
228
|
-
|
|
237
|
+
const eventToRaise = {
|
|
229
238
|
key: this.key,
|
|
230
239
|
controlType: this.controlType,
|
|
231
|
-
eventWhich: event.which
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
title: this.label
|
|
236
|
-
}
|
|
237
|
-
});
|
|
240
|
+
eventWhich: event.which
|
|
241
|
+
};
|
|
242
|
+
eventToRaise.otherData = this.getOtherData();
|
|
243
|
+
this.elementClick.emit(eventToRaise);
|
|
238
244
|
}
|
|
239
245
|
}
|
|
240
246
|
PepImageComponent.MENU_CLICKED = '[MenuClicked]';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pepperi-addons-ngx-lib-image.js","sources":["../../../projects/ngx-lib/image/image.service.ts","../../../projects/ngx-lib/image/image.component.ts","../../../projects/ngx-lib/image/image.module.ts","../../../projects/ngx-lib/image/public-api.ts","../../../projects/ngx-lib/image/pepperi-addons-ngx-lib-image.ts"],"sourcesContent":["import { Injectable, TemplateRef } from '@angular/core';\r\nimport {\r\n PepFileService,\r\n PepCustomizationService,\r\n IPepOption,\r\n} from '@pepperi-addons/ngx-lib';\r\nimport { PepDialogService } from '@pepperi-addons/ngx-lib/dialog';\r\nimport { PepImagesFilmstripComponent } from '@pepperi-addons/ngx-lib/images-filmstrip';\r\nimport { IPepFileChangeEvent } from '@pepperi-addons/ngx-lib/files-uploader';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class PepImageService {\r\n constructor(\r\n private dialogService: PepDialogService,\r\n private customizationService: PepCustomizationService,\r\n private fileService: PepFileService,\r\n ) { }\r\n\r\n openImageDialog(imageSrc: string, options: IPepOption[], title = ''): void {\r\n const arr = [imageSrc].concat(\r\n (options || []).map((opt) => opt.value)\r\n );\r\n const imagesValue = arr.join(';');\r\n\r\n // Show image in modal.\r\n const config = this.dialogService.getDialogConfig({}, 'inline');\r\n config.maxWidth = '75vw';\r\n config.height = '95vh';\r\n\r\n this.dialogService.openDialog(\r\n PepImagesFilmstripComponent,\r\n {\r\n currIndex: 0,\r\n key: new Date().getDate(),\r\n value: imagesValue,\r\n label: title,\r\n uid: '',\r\n showThumbnails: arr.length > 1,\r\n },\r\n config\r\n );\r\n }\r\n\r\n openFromURI(event: IPepFileChangeEvent) {\r\n if (event) {\r\n const fileStrArr = event.fileStr.split(';');\r\n if (fileStrArr.length === 2) {\r\n const win = window.open('', '_blank');\r\n const contentType = fileStrArr[0].split(':')[1];\r\n const base64 = fileStrArr[1].split(',')[1];\r\n const blob = this.fileService.convertFromb64toBlob(\r\n base64,\r\n contentType\r\n );\r\n const url = URL.createObjectURL(blob);\r\n win.location.href = url;\r\n }\r\n }\r\n }\r\n}\r\n","import {\n Component,\n OnInit,\n OnChanges,\n Input,\n Output,\n EventEmitter,\n ChangeDetectorRef,\n ChangeDetectionStrategy,\n ElementRef,\n OnDestroy,\n Renderer2,\n Optional,\n} from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { TranslateService } from '@ngx-translate/core';\nimport {\n PepFileService,\n PepLayoutType,\n PepCustomizationService,\n PepHorizontalAlignment,\n DEFAULT_HORIZONTAL_ALIGNMENT,\n IPepFieldClickEvent,\n IPepOption,\n PepImageField,\n} from '@pepperi-addons/ngx-lib';\n\nimport { pepIconNoImage2 } from '@pepperi-addons/ngx-lib/icon';\nimport { PepImageService } from './image.service';\nimport { IPepFileChangeEvent } from '@pepperi-addons/ngx-lib/files-uploader';\n\n@Component({\n selector: 'pep-image',\n templateUrl: './image.component.html',\n styleUrls: ['./image.component.scss', './image.component.theme.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PepImageComponent implements OnChanges, OnInit, OnDestroy {\n public static MENU_CLICKED = '[MenuClicked]';\n\n @Input() key = '';\n @Input() srcLarge = '';\n @Input() src = '';\n @Input() options: IPepOption[] = [];\n @Input() label = '';\n // @Input() type = 'image';\n @Input() mandatory = false;\n @Input() disabled = false;\n @Input() readonly = false;\n @Input() xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n\n private _rowSpan = 1;\n @Input()\n set rowSpan(value) {\n this._rowSpan = value;\n this.setFieldHeight();\n }\n get rowSpan(): number {\n return this._rowSpan;\n }\n\n @Input() indicatorsField: any = null;\n @Input() menuField: any = null;\n @Input() hasCampaignField: any = null;\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 = 'image';\n\n @Input() form: FormGroup = null;\n @Input() uid = '';\n @Input() showTitle = true;\n @Input() renderTitle = 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 @Input() sizeLimitMB = 5;\n @Input() acceptImagesType = 'bmp,jpg,jpeg,png,gif'; // \"image/bmp, image/jpg, image/jpeg, image/png, image/tif, image/tiff\";\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 constructor(\n private imageService: PepImageService,\n private customizationService: PepCustomizationService,\n private fileService: PepFileService,\n private renderer: Renderer2,\n private element: ElementRef,\n private translate: TranslateService\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 if (!this.renderTitle) {\n this.renderer.addClass(\n this.element.nativeElement,\n PepCustomizationService.STAND_ALONE_FIELD_NO_SPACING_CLASS_NAME\n );\n }\n }\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 PepImageField({\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 ngOnChanges(changes: any): void {\n if (this.standAlone) {\n this.setDefaultForm();\n }\n\n if (changes.src?.currentValue?.length > 0) {\n // Empty dataURI if there is change in the src.\n this.dataURI = null;\n }\n }\n\n ngOnDestroy(): void {\n //\n }\n\n errorHandler(event: any): void {\n event.target.src = this.fileService.getSvgAsImageSrc(\n pepIconNoImage2.data\n );\n event.target.title = this.translate.instant('IMAGE.NO_IMAGE');\n }\n\n onImageLoad(event: any): void {\n event.target.style.visibility = 'visible';\n event.target.title =\n event.target.title.length === 0\n ? this.translate.instant('IMAGE.CLICK_TO_ENLARGE')\n : event.target.title;\n }\n\n onMenuClick(event: any): void {\n this.elementClick.emit({\n key: this.key,\n value: PepImageComponent.MENU_CLICKED,\n controlType: this.controlType,\n eventWhich: event.which,\n });\n }\n\n onFileChanged(fileData: IPepFileChangeEvent): void {\n this.dataURI = fileData;\n this.src = this.srcLarge =\n this.standAlone && this.dataURI ? this.dataURI.fileStr : '';\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 objectIdIsNotEmpty(): boolean {\n return this.uid?.length > 0 && this.uid !== '0';\n }\n\n onFileClicked(event: IPepFieldClickEvent): void {\n let hasParentImage = true;\n if (\n // this.objectIdIsNotEmpty() &&\n this.src &&\n this.src.indexOf('no-image') > -1\n ) {\n hasParentImage = false;\n }\n\n this.elementClick.emit(event);\n }\n\n itemImageClick(event: any): void {\n let hasParentImage = true;\n const elemTarget = event.target || event.srcElement;\n const nextElement = elemTarget.nextElementSibling || null;\n const imageSRC = elemTarget.src || null;\n const nextElementSRC =\n nextElement && nextElement.src ? nextElement.src : null;\n\n if (\n (imageSRC && imageSRC.indexOf('no-image') > -1) ||\n (nextElementSRC && nextElementSRC.src.indexOf('no-image') > -1)\n ) {\n hasParentImage = false;\n }\n\n // this.openImageModal(hasParentImage);\n // if (this.dataURI) {\n // this.imageService.openFromURI(this.dataURI);\n // } else {\n // this.imageService.openImageDialog(this.srcLarge || this.src, this.options, this.label);\n // }\n\n this.elementClick.emit({\n key: this.key,\n controlType: this.controlType,\n eventWhich: event.which,\n otherData: {\n imageSrc: this.srcLarge || this.src,\n options: this.options,\n title: this.label\n }\n });\n }\n\n // openImageModal(hasParentImage: boolean): void {\n // if (this.dataURI) {\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 // const arr = [this.srcLarge || this.src].concat(\n // (this.options || []).map((opt) => opt.value)\n // );\n // const imagesValue = arr.join(';');\n\n // // Show image in modal.\n // const config = this.dialogService.getDialogConfig({}, 'inline');\n // config.maxWidth = '75vw';\n // config.height = '95vh';\n\n // this.dialogService.openDialog(\n // PepImagesFilmstripComponent,\n // {\n // currIndex: 0,\n // key: this.key,\n // value: imagesValue,\n // label: this.label,\n // uid: this.uid,\n // showThumbnails: arr.length > 1,\n // },\n // config\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';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\nimport {\n PepIconModule,\n PepIconRegistry,\n pepIconSystemMenu,\n pepIconSystemBolt,\n pepIconIndicatorDotPlaceholder,\n} from '@pepperi-addons/ngx-lib/icon';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\nimport { PepFilesUploaderModule } from '@pepperi-addons/ngx-lib/files-uploader';\nimport {\n PepImagesFilmstripModule,\n PepImagesFilmstripComponent,\n} from '@pepperi-addons/ngx-lib/images-filmstrip';\n\nimport { PepImageComponent } from './image.component';\nimport { PepImageService } from './image.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n // Material modules,\n MatCommonModule,\n MatFormFieldModule,\n MatIconModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepIconModule,\n PepFieldTitleModule,\n PepImagesFilmstripModule,\n PepFilesUploaderModule,\n ],\n exports: [PepImageComponent],\n declarations: [PepImageComponent],\n entryComponents: [PepImagesFilmstripComponent],\n providers: [PepImageService]\n})\nexport class PepImageModule {\n constructor(private pepIconRegistry: PepIconRegistry) {\n this.pepIconRegistry.registerIcons([\n pepIconSystemMenu,\n pepIconSystemBolt,\n pepIconIndicatorDotPlaceholder,\n ]);\n }\n}\n","/*\n * Public API Surface of ngx-lib/image\n */\nexport * from './image.module';\nexport * from './image.component';\nexport * from './image.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAaa,eAAe;IACxB,YACY,aAA+B,EAC/B,oBAA6C,EAC7C,WAA2B;QAF3B,kBAAa,GAAb,aAAa,CAAkB;QAC/B,yBAAoB,GAApB,oBAAoB,CAAyB;QAC7C,gBAAW,GAAX,WAAW,CAAgB;KAClC;IAEL,eAAe,CAAC,QAAgB,EAAE,OAAqB,EAAE,KAAK,GAAG,EAAE;QAC/D,MAAM,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,CACzB,CAAC,OAAO,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC,CAC1C,CAAC;QACF,MAAM,WAAW,GAAG,GAAG,CAAC,IAAI,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L,KAAK;8BASL,KAAK;wBACL,KAAK;+BACL,KAAK;sBAGL,KAAK;mBAqBL,KAAK;kBACL,KAAK;wBACL,KAAK;0BACL,KAAK;yBAGL,KAAK;uBASL,KAAK;0BACL,KAAK;+BACL,KAAK;yBAEL,MAAM;2BAGN,MAAM;;;MC/DE,cAAc;IACvB,YAAoB,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;QAChD,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC;YAC/B,iBAAiB;YACjB,iBAAiB;YACjB,8BAA8B;SACjC,CAAC,CAAC;KACN;;;YA3BJ,QAAQ,SAAC;gBACN,OAAO,EAAE;oBACL,YAAY;oBACZ,mBAAmB;;oBAEnB,eAAe;oBACf,kBAAkB;oBAClB,aAAa;;oBAEb,eAAe;oBACf,aAAa;oBACb,mBAAmB;oBACnB,wBAAwB;oBACxB,sBAAsB;iBACzB;gBACD,OAAO,EAAE,CAAC,iBAAiB,CAAC;gBAC5B,YAAY,EAAE,CAAC,iBAAiB,CAAC;gBACjC,eAAe,EAAE,CAAC,2BAA2B,CAAC;gBAC9C,SAAS,EAAE,CAAC,eAAe,CAAC;aAC/B;;;YAlCG,eAAe;;;ACXnB;;;;ACAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"pepperi-addons-ngx-lib-image.js","sources":["../../../projects/ngx-lib/image/image.service.ts","../../../projects/ngx-lib/image/image.component.ts","../../../projects/ngx-lib/image/image.module.ts","../../../projects/ngx-lib/image/public-api.ts","../../../projects/ngx-lib/image/pepperi-addons-ngx-lib-image.ts"],"sourcesContent":["import { Injectable, TemplateRef } from '@angular/core';\r\nimport {\r\n PepFileService,\r\n PepCustomizationService,\r\n IPepOption,\r\n} from '@pepperi-addons/ngx-lib';\r\nimport { PepDialogService } from '@pepperi-addons/ngx-lib/dialog';\r\nimport { PepImagesFilmstripComponent } from '@pepperi-addons/ngx-lib/images-filmstrip';\r\nimport { IPepFileChangeEvent } from '@pepperi-addons/ngx-lib/files-uploader';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class PepImageService {\r\n constructor(\r\n private dialogService: PepDialogService,\r\n private customizationService: PepCustomizationService,\r\n private fileService: PepFileService,\r\n ) { }\r\n\r\n openImageDialog(imageSrc: string, options: IPepOption[], title = ''): void {\r\n const arr = [imageSrc].concat(\r\n (options || []).map((opt) => opt.value)\r\n );\r\n const imagesValue = arr.join(';');\r\n\r\n // Show image in modal.\r\n const config = this.dialogService.getDialogConfig({}, 'inline');\r\n config.maxWidth = '75vw';\r\n config.height = '95vh';\r\n\r\n this.dialogService.openDialog(\r\n PepImagesFilmstripComponent,\r\n {\r\n currIndex: 0,\r\n key: new Date().getDate(),\r\n value: imagesValue,\r\n label: title,\r\n uid: '',\r\n showThumbnails: arr.length > 1,\r\n },\r\n config\r\n );\r\n }\r\n\r\n openFromURI(event: IPepFileChangeEvent) {\r\n if (event) {\r\n const fileStrArr = event.fileStr.split(';');\r\n if (fileStrArr.length === 2) {\r\n const win = window.open('', '_blank');\r\n const contentType = fileStrArr[0].split(':')[1];\r\n const base64 = fileStrArr[1].split(',')[1];\r\n const blob = this.fileService.convertFromb64toBlob(\r\n base64,\r\n contentType\r\n );\r\n const url = URL.createObjectURL(blob);\r\n win.location.href = url;\r\n }\r\n }\r\n }\r\n}\r\n","import {\n Component,\n OnInit,\n OnChanges,\n Input,\n Output,\n EventEmitter,\n ChangeDetectorRef,\n ChangeDetectionStrategy,\n ElementRef,\n OnDestroy,\n Renderer2,\n Optional,\n} from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { TranslateService } from '@ngx-translate/core';\nimport {\n PepFileService,\n PepLayoutType,\n PepCustomizationService,\n PepHorizontalAlignment,\n DEFAULT_HORIZONTAL_ALIGNMENT,\n IPepFieldClickEvent,\n IPepOption,\n PepImageField,\n} from '@pepperi-addons/ngx-lib';\n\nimport { pepIconNoImage2 } from '@pepperi-addons/ngx-lib/icon';\nimport { PepImageService } from './image.service';\nimport { IPepFileChangeEvent } from '@pepperi-addons/ngx-lib/files-uploader';\n\n@Component({\n selector: 'pep-image',\n templateUrl: './image.component.html',\n styleUrls: ['./image.component.scss', './image.component.theme.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PepImageComponent implements OnChanges, OnInit, OnDestroy {\n public static MENU_CLICKED = '[MenuClicked]';\n\n @Input() key = '';\n @Input() srcLarge = '';\n @Input() src = '';\n @Input() options: IPepOption[] = [];\n @Input() label = '';\n // @Input() type = 'image';\n @Input() mandatory = false;\n @Input() disabled = false;\n @Input() readonly = false;\n @Input() xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n\n private _rowSpan = 1;\n @Input()\n set rowSpan(value) {\n this._rowSpan = value;\n this.setFieldHeight();\n }\n get rowSpan(): number {\n return this._rowSpan;\n }\n\n @Input() indicatorsField: any = null;\n @Input() menuField: any = null;\n @Input() hasCampaignField: any = null;\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 = 'image';\n\n @Input() form: FormGroup = null;\n @Input() uid = '';\n @Input() showTitle = true;\n @Input() renderTitle = 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 @Input() sizeLimitMB = 5;\n @Input() acceptImagesType = 'bmp,jpg,jpeg,png,gif'; // \"image/bmp, image/jpg, image/jpeg, image/png, image/tif, image/tiff\";\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 constructor(\n private imageService: PepImageService,\n private customizationService: PepCustomizationService,\n private fileService: PepFileService,\n private renderer: Renderer2,\n private element: ElementRef,\n private translate: TranslateService\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 if (!this.renderTitle) {\n this.renderer.addClass(\n this.element.nativeElement,\n PepCustomizationService.STAND_ALONE_FIELD_NO_SPACING_CLASS_NAME\n );\n }\n }\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 PepImageField({\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 private getOtherData() {\n return {\n imageSrc: this.srcLarge || this.src,\n options: this.options,\n title: this.label\n };\n }\n\n ngOnChanges(changes: any): void {\n if (this.standAlone) {\n this.setDefaultForm();\n }\n\n if (changes.src?.currentValue?.length > 0) {\n // Empty dataURI if there is change in the src.\n this.dataURI = null;\n }\n }\n\n ngOnDestroy(): void {\n //\n }\n\n errorHandler(event: any): void {\n event.target.src = this.fileService.getSvgAsImageSrc(\n pepIconNoImage2.data\n );\n event.target.title = this.translate.instant('IMAGE.NO_IMAGE');\n }\n\n onImageLoad(event: any): void {\n event.target.style.visibility = 'visible';\n event.target.title =\n event.target.title.length === 0\n ? this.translate.instant('IMAGE.CLICK_TO_ENLARGE')\n : event.target.title;\n }\n\n onMenuClick(event: any): void {\n this.elementClick.emit({\n key: this.key,\n value: PepImageComponent.MENU_CLICKED,\n controlType: this.controlType,\n eventWhich: event.which,\n });\n }\n\n onFileChanged(fileData: IPepFileChangeEvent): void {\n this.dataURI = fileData;\n this.src = this.srcLarge =\n this.standAlone && this.dataURI ? this.dataURI.fileStr : '';\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 objectIdIsNotEmpty(): boolean {\n return this.uid?.length > 0 && this.uid !== '0';\n }\n\n onFileClicked(event: IPepFieldClickEvent): void {\n let hasParentImage = true;\n if (\n // this.objectIdIsNotEmpty() &&\n this.src &&\n this.src.indexOf('no-image') > -1\n ) {\n hasParentImage = false;\n }\n\n // Add the other data object for let the client open the image dialog eazy.\n event.otherData = this.getOtherData();\n\n this.elementClick.emit(event);\n }\n\n itemImageClick(event: any): void {\n let hasParentImage = true;\n const elemTarget = event.target || event.srcElement;\n const nextElement = elemTarget.nextElementSibling || null;\n const imageSRC = elemTarget.src || null;\n const nextElementSRC =\n nextElement && nextElement.src ? nextElement.src : null;\n\n if (\n (imageSRC && imageSRC.indexOf('no-image') > -1) ||\n (nextElementSRC && nextElementSRC.src.indexOf('no-image') > -1)\n ) {\n hasParentImage = false;\n }\n\n // this.openImageModal(hasParentImage);\n // if (this.dataURI) {\n // this.imageService.openFromURI(this.dataURI);\n // } else {\n // this.imageService.openImageDialog(this.srcLarge || this.src, this.options, this.label);\n // }\n const eventToRaise: IPepFieldClickEvent = {\n key: this.key,\n controlType: this.controlType,\n eventWhich: event.which\n };\n eventToRaise.otherData = this.getOtherData();\n this.elementClick.emit(eventToRaise);\n }\n\n // openImageModal(hasParentImage: boolean): void {\n // if (this.dataURI) {\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 // const arr = [this.srcLarge || this.src].concat(\n // (this.options || []).map((opt) => opt.value)\n // );\n // const imagesValue = arr.join(';');\n\n // // Show image in modal.\n // const config = this.dialogService.getDialogConfig({}, 'inline');\n // config.maxWidth = '75vw';\n // config.height = '95vh';\n\n // this.dialogService.openDialog(\n // PepImagesFilmstripComponent,\n // {\n // currIndex: 0,\n // key: this.key,\n // value: imagesValue,\n // label: this.label,\n // uid: this.uid,\n // showThumbnails: arr.length > 1,\n // },\n // config\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';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\nimport {\n PepIconModule,\n PepIconRegistry,\n pepIconSystemMenu,\n pepIconSystemBolt,\n pepIconIndicatorDotPlaceholder,\n} from '@pepperi-addons/ngx-lib/icon';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\nimport { PepFilesUploaderModule } from '@pepperi-addons/ngx-lib/files-uploader';\nimport {\n PepImagesFilmstripModule,\n PepImagesFilmstripComponent,\n} from '@pepperi-addons/ngx-lib/images-filmstrip';\n\nimport { PepImageComponent } from './image.component';\nimport { PepImageService } from './image.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n // Material modules,\n MatCommonModule,\n MatFormFieldModule,\n MatIconModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepIconModule,\n PepFieldTitleModule,\n PepImagesFilmstripModule,\n PepFilesUploaderModule,\n ],\n exports: [PepImageComponent],\n declarations: [PepImageComponent],\n entryComponents: [PepImagesFilmstripComponent],\n providers: [PepImageService]\n})\nexport class PepImageModule {\n constructor(private pepIconRegistry: PepIconRegistry) {\n this.pepIconRegistry.registerIcons([\n pepIconSystemMenu,\n pepIconSystemBolt,\n pepIconIndicatorDotPlaceholder,\n ]);\n }\n}\n","/*\n * Public API Surface of ngx-lib/image\n */\nexport * from './image.module';\nexport * from './image.component';\nexport * from './image.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAaa,eAAe;IACxB,YACY,aAA+B,EAC/B,oBAA6C,EAC7C,WAA2B;QAF3B,kBAAa,GAAb,aAAa,CAAkB;QAC/B,yBAAoB,GAApB,oBAAoB,CAAyB;QAC7C,gBAAW,GAAX,WAAW,CAAgB;KAClC;IAEL,eAAe,CAAC,QAAgB,EAAE,OAAqB,EAAE,KAAK,GAAG,EAAE;QAC/D,MAAM,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,CACzB,CAAC,OAAO,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC,CAC1C,CAAC;QACF,MAAM,WAAW,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;QAGlC,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QAChE,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC;QACzB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;QAEvB,IAAI,CAAC,aAAa,CAAC,UAAU,CACzB,2BAA2B,EAC3B;YACI,SAAS,EAAE,CAAC;YACZ,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;YACzB,KAAK,EAAE,WAAW;YAClB,KAAK,EAAE,KAAK;YACZ,GAAG,EAAE,EAAE;YACP,cAAc,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC;SACjC,EACD,MAAM,CACT,CAAC;KACL;IAED,WAAW,CAAC,KAA0B;QAClC,IAAI,KAAK,EAAE;YACP,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,C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Y;oBACZ,mBAAmB;;oBAEnB,eAAe;oBACf,kBAAkB;oBAClB,aAAa;;oBAEb,eAAe;oBACf,aAAa;oBACb,mBAAmB;oBACnB,wBAAwB;oBACxB,sBAAsB;iBACzB;gBACD,OAAO,EAAE,CAAC,iBAAiB,CAAC;gBAC5B,YAAY,EAAE,CAAC,iBAAiB,CAAC;gBACjC,eAAe,EAAE,CAAC,2BAA2B,CAAC;gBAC9C,SAAS,EAAE,CAAC,eAAe,CAAC;aAC/B;;;YAlCG,eAAe;;;ACXnB;;;;ACAA;;;;;;"}
|
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
import { Pipe, EventEmitter, Component, ChangeDetectionStrategy, Renderer2, ElementRef, HostBinding, Input, Output, ViewChild, NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
+
import { MatCommonModule } from '@angular/material/core';
|
|
5
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
6
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
7
|
+
import { MatInputModule } from '@angular/material/input';
|
|
8
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
9
|
+
import { DEFAULT_HORIZONTAL_ALIGNMENT, PepTextboxField, PepCustomizationService, PepUtilitiesService, PepNgxLibModule } from '@pepperi-addons/ngx-lib';
|
|
10
|
+
import { pepIconSystemEdit, PepIconModule, PepIconRegistry } from '@pepperi-addons/ngx-lib/icon';
|
|
11
|
+
import { PepTextboxIconModule } from '@pepperi-addons/ngx-lib/textbox-icon';
|
|
12
|
+
import { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';
|
|
13
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
14
|
+
|
|
15
|
+
class IsUrlPipe {
|
|
16
|
+
transform(value) {
|
|
17
|
+
// const regex = /^((ht|f)tp(s?):\/\/)?([w]{3}[\.])?/;
|
|
18
|
+
const regex = /^((http(s?)|ftp)\:\/\/)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)(.*)/;
|
|
19
|
+
//console.log(`pipe - value - ${value} is valid url - ${regex.test(value)}`);
|
|
20
|
+
return regex.test(value);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
IsUrlPipe.decorators = [
|
|
24
|
+
{ type: Pipe, args: [{
|
|
25
|
+
name: 'isUrl'
|
|
26
|
+
},] }
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* This is a text box input component that can be use to
|
|
31
|
+
*
|
|
32
|
+
* @export
|
|
33
|
+
* @class PepTextboxComponent
|
|
34
|
+
* @implements {OnChanges}
|
|
35
|
+
* @implements {OnInit}
|
|
36
|
+
* @implements {OnDestroy}
|
|
37
|
+
*/
|
|
38
|
+
class PepLinkComponent {
|
|
39
|
+
constructor(fb, customizationService, renderer, element, translate, utilitiesService, isUrlPipe) {
|
|
40
|
+
this.fb = fb;
|
|
41
|
+
this.customizationService = customizationService;
|
|
42
|
+
this.renderer = renderer;
|
|
43
|
+
this.element = element;
|
|
44
|
+
this.translate = translate;
|
|
45
|
+
this.utilitiesService = utilitiesService;
|
|
46
|
+
this.isUrlPipe = isUrlPipe;
|
|
47
|
+
this.dataQa = '';
|
|
48
|
+
this._key = '';
|
|
49
|
+
this._value = '';
|
|
50
|
+
this._formattedValue = null;
|
|
51
|
+
/**
|
|
52
|
+
* The title of the textbox.
|
|
53
|
+
*
|
|
54
|
+
* @memberof PepTextboxComponent
|
|
55
|
+
*/
|
|
56
|
+
this.label = '';
|
|
57
|
+
/**
|
|
58
|
+
* The placeholder (relevant only for children - if parent isn't null).
|
|
59
|
+
*
|
|
60
|
+
* @memberof PepTextboxComponent
|
|
61
|
+
*/
|
|
62
|
+
this.placeholder = '';
|
|
63
|
+
/**
|
|
64
|
+
* The type of the textbox.
|
|
65
|
+
*
|
|
66
|
+
* @type {PepTextboxFieldType}
|
|
67
|
+
* @memberof PepTextboxComponent
|
|
68
|
+
*/
|
|
69
|
+
this.type = 'text';
|
|
70
|
+
/**
|
|
71
|
+
* If the textbox is mandatory
|
|
72
|
+
*
|
|
73
|
+
* @memberof PepTextboxComponent
|
|
74
|
+
*/
|
|
75
|
+
this.mandatory = false;
|
|
76
|
+
// TODO: Check if should remove disabled and keep only readonly.
|
|
77
|
+
/**
|
|
78
|
+
* If the textbox is disabled.
|
|
79
|
+
*
|
|
80
|
+
* @memberof PepTextboxComponent
|
|
81
|
+
*/
|
|
82
|
+
this.disabled = false;
|
|
83
|
+
/**
|
|
84
|
+
* If the textbox is readonly
|
|
85
|
+
*
|
|
86
|
+
* @memberof PepTextboxComponent
|
|
87
|
+
*/
|
|
88
|
+
this.readonly = false;
|
|
89
|
+
this.textColor = '';
|
|
90
|
+
this.xAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;
|
|
91
|
+
this.rowSpan = 1;
|
|
92
|
+
// @Input() lastFocusField: any;
|
|
93
|
+
this.minValue = NaN;
|
|
94
|
+
this.maxValue = NaN;
|
|
95
|
+
this._visible = true;
|
|
96
|
+
this.form = null;
|
|
97
|
+
this.isActive = false;
|
|
98
|
+
this.showTitle = true;
|
|
99
|
+
this.renderTitle = true;
|
|
100
|
+
this.renderError = true;
|
|
101
|
+
this.renderSymbol = true;
|
|
102
|
+
this.layoutType = 'form';
|
|
103
|
+
this.parentFieldKey = null;
|
|
104
|
+
/**
|
|
105
|
+
* The value change event.
|
|
106
|
+
*
|
|
107
|
+
* @type {EventEmitter<string>}
|
|
108
|
+
* @memberof PepTextboxComponent
|
|
109
|
+
*/
|
|
110
|
+
this.valueChange = new EventEmitter();
|
|
111
|
+
this.formValidationChange = new EventEmitter();
|
|
112
|
+
this.elementClick = new EventEmitter();
|
|
113
|
+
this._calculateFormattedValue = true;
|
|
114
|
+
this.controlType = 'link';
|
|
115
|
+
this.standAlone = false;
|
|
116
|
+
this.isInEditMode = false;
|
|
117
|
+
this.isUrl = false;
|
|
118
|
+
this.isInFocus = false;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The text box key
|
|
122
|
+
*
|
|
123
|
+
* @memberof PepTextboxComponent
|
|
124
|
+
*/
|
|
125
|
+
set key(value) {
|
|
126
|
+
this._key = value;
|
|
127
|
+
this.dataQa = value;
|
|
128
|
+
}
|
|
129
|
+
get key() {
|
|
130
|
+
return this._key;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The value of the text box.
|
|
134
|
+
*
|
|
135
|
+
* @memberof PepTextboxComponent
|
|
136
|
+
*/
|
|
137
|
+
set value(value) {
|
|
138
|
+
if (!value) {
|
|
139
|
+
value = '';
|
|
140
|
+
}
|
|
141
|
+
this._value = value;
|
|
142
|
+
if (this._calculateFormattedValue) {
|
|
143
|
+
this.setFormattedValue(value);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
get value() {
|
|
147
|
+
return this._value;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* The formatted value.
|
|
151
|
+
*
|
|
152
|
+
* @memberof PepTextboxComponent
|
|
153
|
+
*/
|
|
154
|
+
set formattedValue(value) {
|
|
155
|
+
if (!value) {
|
|
156
|
+
value = '';
|
|
157
|
+
}
|
|
158
|
+
if (this._calculateFormattedValue) {
|
|
159
|
+
this._calculateFormattedValue = false;
|
|
160
|
+
}
|
|
161
|
+
this.setFormattedValue(value);
|
|
162
|
+
}
|
|
163
|
+
get formattedValue() {
|
|
164
|
+
return this._formattedValue;
|
|
165
|
+
}
|
|
166
|
+
set visible(visible) {
|
|
167
|
+
this._visible = visible;
|
|
168
|
+
if (visible) {
|
|
169
|
+
this.renderer.removeClass(this.element.nativeElement, 'hidden-element');
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
this.renderer.addClass(this.element.nativeElement, 'hidden-element');
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
get visible() {
|
|
176
|
+
return this._visible;
|
|
177
|
+
}
|
|
178
|
+
get calculateFormattedValue() {
|
|
179
|
+
return this._calculateFormattedValue;
|
|
180
|
+
}
|
|
181
|
+
setFormattedValue(value) {
|
|
182
|
+
if (this._calculateFormattedValue) {
|
|
183
|
+
this._formattedValue = this.isNumberType()
|
|
184
|
+
? this.utilitiesService.formatNumber(value)
|
|
185
|
+
: value;
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
this._formattedValue = value;
|
|
189
|
+
}
|
|
190
|
+
this.updateFormFieldValue();
|
|
191
|
+
}
|
|
192
|
+
updateFormFieldValue() {
|
|
193
|
+
this.customizationService.updateFormFieldValue(this.form, this.key, this.formattedValue, this.parentFieldKey);
|
|
194
|
+
}
|
|
195
|
+
get displayValue() {
|
|
196
|
+
let res = '';
|
|
197
|
+
if (this.type == 'link') {
|
|
198
|
+
res = this.formattedValue;
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
res = this.isInFocus ? this.value : this.formattedValue;
|
|
202
|
+
}
|
|
203
|
+
return res;
|
|
204
|
+
}
|
|
205
|
+
setDefaultForm() {
|
|
206
|
+
const pepField = new PepTextboxField({
|
|
207
|
+
key: this.key,
|
|
208
|
+
value: this.value,
|
|
209
|
+
mandatory: this.mandatory,
|
|
210
|
+
readonly: this.readonly,
|
|
211
|
+
disabled: this.disabled,
|
|
212
|
+
maxFieldCharacters: this.maxFieldCharacters,
|
|
213
|
+
type: this.type,
|
|
214
|
+
minValue: this.minValue,
|
|
215
|
+
maxValue: this.maxValue,
|
|
216
|
+
});
|
|
217
|
+
this.form = this.customizationService.getDefaultFromGroup(pepField, this.renderError);
|
|
218
|
+
}
|
|
219
|
+
ngOnInit() {
|
|
220
|
+
if (this.form === null) {
|
|
221
|
+
this.standAlone = true;
|
|
222
|
+
this.minValue =
|
|
223
|
+
isNaN(this.minValue) && !isNaN(this.maxValue)
|
|
224
|
+
? 0
|
|
225
|
+
: this.minValue;
|
|
226
|
+
this.maxValue =
|
|
227
|
+
isNaN(this.maxValue) && !isNaN(this.minValue)
|
|
228
|
+
? 99999
|
|
229
|
+
: this.maxValue;
|
|
230
|
+
this.setDefaultForm();
|
|
231
|
+
this.renderer.addClass(this.element.nativeElement, PepCustomizationService.STAND_ALONE_FIELD_CLASS_NAME);
|
|
232
|
+
if (!this.renderTitle) {
|
|
233
|
+
this.renderer.addClass(this.element.nativeElement, PepCustomizationService.STAND_ALONE_FIELD_NO_SPACING_CLASS_NAME);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
this.readonly = this.type === 'duration' ? true : this.readonly; // Hack until we develop Timer UI for editing Duration field
|
|
237
|
+
this.updateFormFieldValue();
|
|
238
|
+
}
|
|
239
|
+
ngOnChanges(changes) {
|
|
240
|
+
if (this.standAlone) {
|
|
241
|
+
this.setDefaultForm();
|
|
242
|
+
}
|
|
243
|
+
this.readonly = this.type === 'duration' ? true : this.readonly; // Hack until we develop Timer UI for editing Duration field
|
|
244
|
+
}
|
|
245
|
+
ngOnDestroy() {
|
|
246
|
+
//
|
|
247
|
+
}
|
|
248
|
+
onFocus(event) {
|
|
249
|
+
this.isInFocus = true;
|
|
250
|
+
// select the value in focus (DI-18246 improvement)
|
|
251
|
+
setTimeout(() => {
|
|
252
|
+
const eventTarget = event.target || event.srcElement;
|
|
253
|
+
if (eventTarget) {
|
|
254
|
+
eventTarget.select();
|
|
255
|
+
}
|
|
256
|
+
}, 0);
|
|
257
|
+
}
|
|
258
|
+
isNumberType() {
|
|
259
|
+
return (this.type === 'percentage' ||
|
|
260
|
+
this.type === 'currency' ||
|
|
261
|
+
this.type === 'int' ||
|
|
262
|
+
this.type === 'real');
|
|
263
|
+
}
|
|
264
|
+
isValueValid(value) {
|
|
265
|
+
let res = false;
|
|
266
|
+
if (this.isNumberType()) {
|
|
267
|
+
if (value === '') {
|
|
268
|
+
res = this.mandatory ? false : true;
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
const numberValue = this.utilitiesService.coerceNumberProperty(value);
|
|
272
|
+
res =
|
|
273
|
+
numberValue >= this.minValue &&
|
|
274
|
+
numberValue <= this.maxValue;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
// TODO: Maybe need to check other types.
|
|
279
|
+
res = true;
|
|
280
|
+
}
|
|
281
|
+
return res;
|
|
282
|
+
}
|
|
283
|
+
isDifferentValue(value) {
|
|
284
|
+
let res = false;
|
|
285
|
+
if (this.isNumberType()) {
|
|
286
|
+
if (this.value === '' || value === '') {
|
|
287
|
+
res = true;
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
const currentValue = this.utilitiesService.coerceNumberProperty(this.value);
|
|
291
|
+
const newValue = this.utilitiesService.coerceNumberProperty(value);
|
|
292
|
+
res = currentValue !== newValue;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
res = true;
|
|
297
|
+
}
|
|
298
|
+
return res;
|
|
299
|
+
}
|
|
300
|
+
onChange(e) {
|
|
301
|
+
const value = e.target ? e.target.value : e;
|
|
302
|
+
this.valueChange.emit(value);
|
|
303
|
+
}
|
|
304
|
+
onBlur(e) {
|
|
305
|
+
this.isInFocus = false;
|
|
306
|
+
const value = e.target ? e.target.value : e;
|
|
307
|
+
if (value !== this.value && this.isDifferentValue(value)) {
|
|
308
|
+
// If renderError is false and the new value is not valid.
|
|
309
|
+
if (!this.renderError && !this.isValueValid(value)) {
|
|
310
|
+
this.renderer.setProperty(this.input.nativeElement, 'value', this.value);
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
this.value = value;
|
|
314
|
+
// If the user is setting the formatted value then set the value till the user format it and return it back.
|
|
315
|
+
if (!this._calculateFormattedValue) {
|
|
316
|
+
this._formattedValue = value;
|
|
317
|
+
}
|
|
318
|
+
this.valueChange.emit(value);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
if (this.isInEditMode) {
|
|
322
|
+
this.isInEditMode = false;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
onClick() {
|
|
326
|
+
const output = {
|
|
327
|
+
key: this.key,
|
|
328
|
+
value: this.value,
|
|
329
|
+
controlType: this.controlType
|
|
330
|
+
};
|
|
331
|
+
this.elementClick.emit(output);
|
|
332
|
+
}
|
|
333
|
+
anchorClicked() {
|
|
334
|
+
const currentValue = this.value;
|
|
335
|
+
if (currentValue.trim().length > 0) {
|
|
336
|
+
switch (this.type) {
|
|
337
|
+
case 'email':
|
|
338
|
+
window.open('mailto:' + currentValue, 'email');
|
|
339
|
+
break;
|
|
340
|
+
case 'phone':
|
|
341
|
+
window.open('tel:' + currentValue, 'tel');
|
|
342
|
+
break;
|
|
343
|
+
case 'link':
|
|
344
|
+
const output = {
|
|
345
|
+
key: this.key,
|
|
346
|
+
value: this.value,
|
|
347
|
+
controlType: this.controlType
|
|
348
|
+
};
|
|
349
|
+
this.elementClick.emit(output);
|
|
350
|
+
if (this.isUrlPipe.transform(currentValue)) {
|
|
351
|
+
window.open(currentValue);
|
|
352
|
+
}
|
|
353
|
+
break;
|
|
354
|
+
default:
|
|
355
|
+
break;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
cardTemplateClicked(event) {
|
|
360
|
+
this.isInEditMode = true;
|
|
361
|
+
setTimeout(() => {
|
|
362
|
+
this.input.nativeElement.focus();
|
|
363
|
+
}, 0);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
PepLinkComponent.decorators = [
|
|
367
|
+
{ type: Component, args: [{
|
|
368
|
+
selector: 'pep-link',
|
|
369
|
+
template: "<ng-container [formGroup]=\"form\">\n <ng-template #pepTemplate let-isFormView=\"isFormView\" let-hasParent=\"hasParent\">\n <pep-field-title *ngIf=\"renderTitle && isFormView && !hasParent\" [label]=\"label\" [mandatory]=\"mandatory\"\n [disabled]=\"disabled\" [maxFieldCharacters]=\"maxFieldCharacters\" [xAlignment]=\"xAlignment\"\n [showTitle]=\"showTitle\" [inputLength]=\"value.length\">\n </pep-field-title>\n <mat-form-field appearance=\"outline\">\n <input #input pepTextboxValidation [id]=\"key\" [name]=\"key\" class=\" body-sm \" matInput autocomplete=\"off\"\n maxlength=\"{{ maxFieldCharacters > 0 ? maxFieldCharacters : 99999 }}\"\n [placeholder]=\"hasParent && !disabled ? placeholder : ''\"\n [ngStyle]=\"{ color: textColor, 'text-align': xAlignment == 'center' ? 'center' : xAlignment == 'right' ? 'right' : 'left' }\"\n title=\"{{ formattedValue }}\" [formControlName]=\"key\" [type]=\"type\" [value]=\"displayValue\"\n (keyup.enter)=\"$event?.currentTarget?.blur()\" (focus)=\"onFocus($event)\" (blur)=\"onBlur($event)\"\n (change)=\"onChange($event)\" [ngClass]=\"{'disable-hidden': disabled && formattedValue?.length > 0}\" />\n\n <span *ngIf=\"disabled && formattedValue?.length > 0\" class=\"dis-grid\">\n <a href=\"javascript:void(0)\" (click)=\"anchorClicked()\" [id]=\"key\" [name]=\"key\"\n class=\"color-link body-sm \">\n {{formattedValue}}</a>\n </span>\n <mat-error *ngIf=\"renderError\">\n <ng-container *ngIf=\"mandatory && input.value.length == 0 then requiredError else otherError\">\n </ng-container>\n <ng-template #requiredError>\n <span class=\"body-xs\" [title]=\"('MESSAGES.ERROR_IS_REQUIRED' | translate: { field: label })\"\n [innerText]=\"('MESSAGES.ERROR_IS_REQUIRED' | translate: { field: label })\">\n </span>\n </ng-template>\n <ng-template #otherError>\n <span class=\"body-xs\" [title]=\"(input.value | pepToNumber) > this.maxValue || (input.value | pepToNumber) < this.minValue ?\n ('MESSAGES.ERROR_RANGE_IS_NOT_VALID' | translate: { min: minValue, max: maxValue }) :\n ('MESSAGES.ERROR_IS_NOT_VALID' | translate: { field: label })\" [innerText]=\"(input.value | pepToNumber) > this.maxValue || (input.value | pepToNumber) < this.minValue ?\n ('MESSAGES.ERROR_RANGE_IS_NOT_VALID' | translate: { min: minValue, max: maxValue }) :\n ('MESSAGES.ERROR_IS_NOT_VALID' | translate: { field: label })\">\n </span>\n </ng-template>\n </mat-error>\n\n <pep-textbox-icon *ngIf=\"renderSymbol && isFormView && xAlignment == 'right'\" matPrefix [value]=\"value\"\n [label]=\"label\" [type]=\"type\" [disabled]=\"disabled\">\n </pep-textbox-icon>\n <pep-textbox-icon *ngIf=\"renderSymbol && isFormView && (xAlignment == 'left')\" matSuffix [value]=\"value\"\n [label]=\"label\" [type]=\"type\" [disabled]=\"disabled\">\n </pep-textbox-icon>\n </mat-form-field>\n </ng-template>\n\n <ng-container *ngIf=\"layoutType === 'form'\">\n <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: true, hasParent: false }\">\n </ng-container>\n <ng-container *ngIf=\"parentFieldKey; then groupedBlock; else regularBlock\"></ng-container>\n <ng-template #regularBlock>\n <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: true, hasParent: false }\">\n </ng-container>\n </ng-template>\n <ng-template #groupedBlock>\n <ng-container [formGroupName]=\"parentFieldKey\">\n <mat-form-field appearance=\"outline\">\n <input pepTextboxValidation [id]=\"key\" [name]=\"key\" class=\" body-sm \" matInput autocomplete=\"off\"\n [placeholder]=\"!disabled ? placeholder : ''\" title=\"{{ formattedValue }}\"\n [formControlName]=\"key\" [value]=\"value\" (blur)=\"onBlur($event)\" (change)=\"onChange($event)\"\n (keyup.enter)=\"$event?.currentTarget?.blur()\" (focus)=\"onFocus($event)\" />\n </mat-form-field>\n </ng-container>\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"layoutType === 'card'\">\n <ng-container *ngIf=\"isInEditMode; then editBlock; else readOnlyBlock\"></ng-container>\n <ng-template #editBlock>\n <div [ngClass]=\"{'one-row': rowSpan === 1}\">\n <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: false, hasParent: false }\">\n </ng-container>\n </div>\n </ng-template>\n <ng-template #readOnlyBlock>\n <div class=\"pep-card-input card-flex-container\" [ngStyle]=\"{ color: textColor }\"\n [class]=\"'text-align-' + xAlignment\" [ngClass]=\"{'one-row': rowSpan === 1,\n 'multi-rows': rowSpan > 1,\n 'pep-button weak': isActive && !disabled}\"\n (click)=\"!disabled ? cardTemplateClicked($event) : ''\">\n <span *ngIf=\"showTitle && label != ''\" class=\"body-xs title\" title=\"{{ label }}\">{{ label\n }} </span>\n <span [id]=\"key\" title=\"{{ formattedValue }}\" class=\"body-sm value\"\n [ngClass]=\"{'multi-rows-text': rowSpan > 1}\" [ngStyle]=\"{ '-webkit-line-clamp': rowSpan }\">{{\n formattedValue }}</span>\n <button *ngIf=\"isActive && !disabled\" class=\"pep-button weak card-edit-button\" mat-button>\n <mat-icon>\n <pep-icon name=\"system_edit\">\n </pep-icon>\n </mat-icon>\n </button>\n </div>\n </ng-template>\n\n </ng-container>\n\n <ng-container *ngIf=\"layoutType === 'table'\">\n <ng-container *ngIf=\"isActive && !disabled; then selectedBlock; else notSelectedBlock\"></ng-container>\n <ng-template #selectedBlock>\n <ng-container *ngTemplateOutlet=\"pepTemplate; context: { isFormView: false, hasParent: false }\">\n </ng-container>\n </ng-template>\n <ng-template #notSelectedBlock>\n <ng-container *ngIf=\"formattedValue?.length > 0; then notEmptyBlock; else emptyBlock\"></ng-container>\n <ng-template #notEmptyBlock>\n <ng-container [ngSwitch]=\"type\">\n <ng-container *ngSwitchCase=\"'link'\">\n <a *ngIf=\"formattedValue != null && (value ? value : formattedValue) | isUrl\" [id]=\"key\"\n class=\"color-link body-sm pep-report-input\"\n [ngClass]=\"{'disable': (disabled && value === '')}\" title=\"{{ formattedValue }}\"\n target=\"_blank\" href=\"{{ value ? value : formattedValue }}\" (click)=\"onClick()\">{{\n formattedValue }}</a>\n <a *ngIf=\"formattedValue != null && !((value ? value : formattedValue) | isUrl)\" [id]=\"key\"\n class=\"color-link body-sm pep-report-input\"\n [ngClass]=\"{'disable': (disabled && value === '')}\" title=\"{{ formattedValue }}\"\n href=\"javascript:void(0)\" (click)=\"onClick()\">{{\n formattedValue }}</a>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <span [id]=\"key\" class=\"body-sm pep-report-input\" [ngClass]=\"{'readonly': disabled}\"\n title=\"{{ formattedValue }}\" [ngStyle]=\"{ color: textColor }\">{{ formattedValue }}</span>\n </ng-container>\n </ng-container>\n </ng-template>\n <ng-template #emptyBlock>\n <span [id]=\"key\"> </span>\n </ng-template>\n </ng-template>\n </ng-container>\n\n</ng-container>",
|
|
370
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
371
|
+
styles: [":host{height:inherit;display:grid}:host>*{align-self:center;align-items:baseline}.disable-hidden{display:none}.dis-grid{display:grid}.multi-rows-text{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal!important}"]
|
|
372
|
+
},] }
|
|
373
|
+
];
|
|
374
|
+
PepLinkComponent.ctorParameters = () => [
|
|
375
|
+
{ type: FormBuilder },
|
|
376
|
+
{ type: PepCustomizationService },
|
|
377
|
+
{ type: Renderer2 },
|
|
378
|
+
{ type: ElementRef },
|
|
379
|
+
{ type: TranslateService },
|
|
380
|
+
{ type: PepUtilitiesService },
|
|
381
|
+
{ type: IsUrlPipe }
|
|
382
|
+
];
|
|
383
|
+
PepLinkComponent.propDecorators = {
|
|
384
|
+
dataQa: [{ type: HostBinding, args: ['attr.data-qa',] }],
|
|
385
|
+
key: [{ type: Input }],
|
|
386
|
+
value: [{ type: Input }],
|
|
387
|
+
formattedValue: [{ type: Input }],
|
|
388
|
+
label: [{ type: Input }],
|
|
389
|
+
placeholder: [{ type: Input }],
|
|
390
|
+
type: [{ type: Input }],
|
|
391
|
+
mandatory: [{ type: Input }],
|
|
392
|
+
disabled: [{ type: Input }],
|
|
393
|
+
readonly: [{ type: Input }],
|
|
394
|
+
maxFieldCharacters: [{ type: Input }],
|
|
395
|
+
textColor: [{ type: Input }],
|
|
396
|
+
xAlignment: [{ type: Input }],
|
|
397
|
+
rowSpan: [{ type: Input }],
|
|
398
|
+
minValue: [{ type: Input }],
|
|
399
|
+
maxValue: [{ type: Input }],
|
|
400
|
+
visible: [{ type: Input }],
|
|
401
|
+
form: [{ type: Input }],
|
|
402
|
+
isActive: [{ type: Input }],
|
|
403
|
+
showTitle: [{ type: Input }],
|
|
404
|
+
renderTitle: [{ type: Input }],
|
|
405
|
+
renderError: [{ type: Input }],
|
|
406
|
+
renderSymbol: [{ type: Input }],
|
|
407
|
+
layoutType: [{ type: Input }],
|
|
408
|
+
parentFieldKey: [{ type: Input }],
|
|
409
|
+
valueChange: [{ type: Output }],
|
|
410
|
+
formValidationChange: [{ type: Output }],
|
|
411
|
+
elementClick: [{ type: Output }],
|
|
412
|
+
input: [{ type: ViewChild, args: ['input',] }]
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
class PepLinkModule {
|
|
416
|
+
constructor(pepIconRegistry) {
|
|
417
|
+
this.pepIconRegistry = pepIconRegistry;
|
|
418
|
+
this.pepIconRegistry.registerIcons([pepIconSystemEdit]);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
PepLinkModule.decorators = [
|
|
422
|
+
{ type: NgModule, args: [{
|
|
423
|
+
imports: [
|
|
424
|
+
CommonModule,
|
|
425
|
+
ReactiveFormsModule,
|
|
426
|
+
// Material modules,
|
|
427
|
+
MatCommonModule,
|
|
428
|
+
MatButtonModule,
|
|
429
|
+
MatFormFieldModule,
|
|
430
|
+
MatInputModule,
|
|
431
|
+
MatIconModule,
|
|
432
|
+
// ngx-lib modules
|
|
433
|
+
PepNgxLibModule,
|
|
434
|
+
PepIconModule,
|
|
435
|
+
PepFieldTitleModule,
|
|
436
|
+
PepTextboxIconModule,
|
|
437
|
+
],
|
|
438
|
+
exports: [PepLinkComponent],
|
|
439
|
+
declarations: [
|
|
440
|
+
PepLinkComponent,
|
|
441
|
+
// PepTextboxValidationDirective,
|
|
442
|
+
IsUrlPipe
|
|
443
|
+
],
|
|
444
|
+
providers: [IsUrlPipe]
|
|
445
|
+
},] }
|
|
446
|
+
];
|
|
447
|
+
PepLinkModule.ctorParameters = () => [
|
|
448
|
+
{ type: PepIconRegistry }
|
|
449
|
+
];
|
|
450
|
+
|
|
451
|
+
/*
|
|
452
|
+
* Public API Surface of ngx-lib/link
|
|
453
|
+
*/
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Generated bundle index. Do not edit.
|
|
457
|
+
*/
|
|
458
|
+
|
|
459
|
+
export { PepLinkComponent, PepLinkModule, IsUrlPipe as ɵa };
|
|
460
|
+
//# sourceMappingURL=pepperi-addons-ngx-lib-link.js.map
|