@pepperi-addons/ngx-lib 0.2.56 → 0.2.57-beta.1
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 +1 -1
- package/bundles/pepperi-addons-ngx-lib-form.umd.js +2 -0
- package/bundles/pepperi-addons-ngx-lib-form.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-image.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-list.umd.js +1 -1
- package/bundles/pepperi-addons-ngx-lib-slider.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib.umd.js +1 -1
- package/esm2015/form/form.component.js +2 -1
- package/esm2015/form/internal-carusel.component.js +2 -1
- package/esm2015/image/image.service.js +1 -1
- package/esm2015/slider/slider.component.js +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-form.js +2 -0
- package/fesm2015/pepperi-addons-ngx-lib-form.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-image.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-slider.js.map +1 -1
- package/package.json +1 -1
|
@@ -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: string = ''): 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'],\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\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 }\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,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T,UAAU;YAML,gBAAgB;;;kBAyBpB,KAAK;uBACL,KAAK;kBACL,KAAK;sBACL,KAAK;oBACL,KAAK;wBAEL,KAAK;uBACL,KAAK;uBACL,KAAK;yBACL,KAAK;sBAGL,KAAK;8BASL,KAAK;wBACL,KAAK;+BACL,KAAK;sBAGL,KAAK;mBAqBL,KAAK;kBACL,KAAK;wBACL,KAAK;yBAGL,KAAK;uBASL,KAAK;0BACL,KAAK;+BACL,KAAK;yBAEL,MAAM;2BAGN,MAAM;;;MC9DE,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'],\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\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 }\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","/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AAC;;YAPhD,SAAS,SAAC;gBACP,QAAQ,EAAE,WAAW;gBACrB,+9LAAqC;gBAErC,eAAe,EAAE,uBAAuB,CAAC,MAAM;;aAClD;;;YARQ,eAAe;YATpB,uBAAuB;YAFvB,cAAc;YANd,SAAS;YAFT,UAAU;YAML,gBAAgB;;;kBAyBpB,KAAK;uBACL,KAAK;kBACL,KAAK;sBACL,KAAK;oBACL,KAAK;wBAEL,KAAK;uBACL,KAAK;uBACL,KAAK;yBACL,KAAK;sBAGL,KAAK;8BASL,KAAK;wBACL,KAAK;+BACL,KAAK;sBAGL,KAAK;mBAqBL,KAAK;kBACL,KAAK;wBACL,KAAK;yBAGL,KAAK;uBASL,KAAK;0BACL,KAAK;+BACL,KAAK;yBAEL,MAAM;2BAGN,MAAM;;;MC9DE,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pepperi-addons-ngx-lib-slider.js","sources":["../../../projects/ngx-lib/slider/slider.component.ts","../../../projects/ngx-lib/slider/slider.module.ts","../../../projects/ngx-lib/slider/public-api.ts","../../../projects/ngx-lib/slider/pepperi-addons-ngx-lib-slider.ts"],"sourcesContent":["import {\n Component,\n OnDestroy,\n Input,\n Output,\n EventEmitter,\n Renderer2,\n ElementRef,\n OnInit,\n ViewChild,\n} from '@angular/core';\nimport { PepLayoutService, DEFAULT_HORIZONTAL_ALIGNMENT, PepHorizontalAlignment } from '@pepperi-addons/ngx-lib';\n\n/**\n * This is a slider component that support pepperi theme\n * style & state & sizes\n *\n * @export\n * @class PepSliderComponent\n * @implements {OnDestroy}\n */\n@Component({\n selector: 'pep-slider',\n templateUrl: './slider.component.html',\n styleUrls: ['./slider.component.scss'],\n})\nexport class PepSliderComponent implements OnInit {\n @Input() label = '';\n @Input() disabled = false;\n @Input() hint = '';\n\n private _background = '';\n @Input()\n set background(background: string) {\n if (!background) {\n background = '';\n }\n\n this._background = background;\n this.setBackground();\n }\n get background(): string {\n return this._background;\n }\n\n @Input() step = 1;\n @Input() minValue = NaN;\n @Input() maxValue = NaN;\n\n private _value
|
|
1
|
+
{"version":3,"file":"pepperi-addons-ngx-lib-slider.js","sources":["../../../projects/ngx-lib/slider/slider.component.ts","../../../projects/ngx-lib/slider/slider.module.ts","../../../projects/ngx-lib/slider/public-api.ts","../../../projects/ngx-lib/slider/pepperi-addons-ngx-lib-slider.ts"],"sourcesContent":["import {\n Component,\n OnDestroy,\n Input,\n Output,\n EventEmitter,\n Renderer2,\n ElementRef,\n OnInit,\n ViewChild,\n} from '@angular/core';\nimport { PepLayoutService, DEFAULT_HORIZONTAL_ALIGNMENT, PepHorizontalAlignment } from '@pepperi-addons/ngx-lib';\n\n/**\n * This is a slider component that support pepperi theme\n * style & state & sizes\n *\n * @export\n * @class PepSliderComponent\n * @implements {OnDestroy}\n */\n@Component({\n selector: 'pep-slider',\n templateUrl: './slider.component.html',\n styleUrls: ['./slider.component.scss'],\n})\nexport class PepSliderComponent implements OnInit {\n @Input() label = '';\n @Input() disabled = false;\n @Input() hint = '';\n\n private _background = '';\n @Input()\n set background(background: string) {\n if (!background) {\n background = '';\n }\n\n this._background = background;\n this.setBackground();\n }\n get background(): string {\n return this._background;\n }\n\n @Input() step = 1;\n @Input() minValue = NaN;\n @Input() maxValue = NaN;\n\n private _value = NaN;\n @Input()\n set value(value: number) {\n this._value = value;\n }\n get value(): number {\n return this._value;\n }\n\n @Output()\n valueChange: EventEmitter<number> = new EventEmitter<number>();\n\n @Output()\n inputChange: EventEmitter<number> = new EventEmitter<number>();\n\n xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n sliderWrapper: any = null;\n\n constructor(private renderer: Renderer2, private element: ElementRef, private pepLayoutService: PepLayoutService) { }\n\n private setBackground(): void {\n // Get the wrapper for set the background.\n if (!this.sliderWrapper) {\n this.sliderWrapper = this.element.nativeElement.querySelector('.mat-slider-wrapper');\n }\n\n if (this.sliderWrapper) {\n this.renderer.setStyle(this.sliderWrapper, 'background', this.background?.length > 0 ? this.background : '');\n\n if (this.background?.length > 0) {\n this.renderer.removeClass(this.sliderWrapper, 'background-color-dimmed');\n } else {\n this.renderer.addClass(this.sliderWrapper, 'background-color-dimmed');\n }\n }\n }\n\n ngOnInit(): void {\n this.xAlignment = this.pepLayoutService.isRtl() ? 'right' : 'left';\n this.setBackground();\n }\n\n onValueChange(event) {\n this.valueChange.emit(event.value);\n }\n\n onInputChange(event) {\n this.inputChange.emit(event.value);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { MatCommonModule } from '@angular/material/core';\nimport { MatSliderModule } from '@angular/material/slider';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\n\nimport { PepSliderComponent } from './slider.component';\n\n@NgModule({\n imports: [\n CommonModule,\n // Material modules\n MatCommonModule,\n MatSliderModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepFieldTitleModule,\n ],\n exports: [PepSliderComponent],\n declarations: [PepSliderComponent],\n})\nexport class PepSliderModule { }\n","/*\n * Public API Surface of ngx-lib/slider\n */\nexport * from './slider.module';\nexport * from './slider.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAaA;;;;;;;;MAaa,kBAAkB;IAyC3B,YAAoB,QAAmB,EAAU,OAAmB,EAAU,gBAAkC;QAA5F,aAAQ,GAAR,QAAQ,CAAW;QAAU,YAAO,GAAP,OAAO,CAAY;QAAU,qBAAgB,GAAhB,gBAAgB,CAAkB;QAxCvG,UAAK,GAAG,EAAE,CAAC;QACX,aAAQ,GAAG,KAAK,CAAC;QACjB,SAAI,GAAG,EAAE,CAAC;QAEX,gBAAW,GAAG,EAAE,CAAC;QAchB,SAAI,GAAG,CAAC,CAAC;QACT,aAAQ,GAAG,GAAG,CAAC;QACf,aAAQ,GAAG,GAAG,CAAC;QAEhB,WAAM,GAAG,GAAG,CAAC;QAUrB,gBAAW,GAAyB,IAAI,YAAY,EAAU,CAAC;QAG/D,gBAAW,GAAyB,IAAI,YAAY,EAAU,CAAC;QAE/D,eAAU,GAA2B,4BAA4B,CAAC;QAClE,kBAAa,GAAQ,IAAI,CAAC;KAE2F;IAnCrH,IACI,UAAU,CAAC,UAAkB;QAC7B,IAAI,CAAC,UAAU,EAAE;YACb,UAAU,GAAG,EAAE,CAAC;SACnB;QAED,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,aAAa,EAAE,CAAC;KACxB;IACD,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,WAAW,CAAC;KAC3B;IAOD,IACI,KAAK,CAAC,KAAa;QACnB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;KACvB;IACD,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,MAAM,CAAC;KACtB;IAaO,aAAa;;;QAEjB,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;YACrB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,aAAa,CA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