@pepperi-addons/ngx-lib 0.3.10 → 0.3.11-beta.11
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-dialog.umd.js +4 -1
- package/bundles/pepperi-addons-ngx-lib-dialog.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-link.umd.js +0 -2
- package/bundles/pepperi-addons-ngx-lib-link.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-snack-bar.umd.js +200 -0
- package/bundles/pepperi-addons-ngx-lib-snack-bar.umd.js.map +1 -0
- package/bundles/pepperi-addons-ngx-lib.umd.js +49 -9
- package/bundles/pepperi-addons-ngx-lib.umd.js.map +1 -1
- package/core/common/services/addon.service.d.ts +5 -1
- package/esm2015/core/common/services/addon.service.js +40 -7
- package/esm2015/dialog/dialog.service.js +5 -2
- package/esm2015/link/link.pipes.js +1 -3
- package/esm2015/snack-bar/default-snack-bar.component.js +28 -0
- package/esm2015/snack-bar/pepperi-addons-ngx-lib-snack-bar.js +6 -0
- package/esm2015/snack-bar/public-api.js +8 -0
- package/esm2015/snack-bar/snack-bar.component.js +24 -0
- package/esm2015/snack-bar/snack-bar.model.js +7 -0
- package/esm2015/snack-bar/snack-bar.module.js +42 -0
- package/esm2015/snack-bar/snack-bar.service.js +63 -0
- package/fesm2015/pepperi-addons-ngx-lib-dialog.js +4 -1
- package/fesm2015/pepperi-addons-ngx-lib-dialog.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-link.js +0 -2
- package/fesm2015/pepperi-addons-ngx-lib-link.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-snack-bar.js +164 -0
- package/fesm2015/pepperi-addons-ngx-lib-snack-bar.js.map +1 -0
- package/fesm2015/pepperi-addons-ngx-lib.js +39 -6
- package/fesm2015/pepperi-addons-ngx-lib.js.map +1 -1
- package/package.json +1 -1
- package/pepperi-addons-ngx-lib.metadata.json +1 -1
- package/snack-bar/default-snack-bar.component.d.ts +10 -0
- package/snack-bar/package.json +15 -0
- package/snack-bar/pepperi-addons-ngx-lib-snack-bar.d.ts +5 -0
- package/snack-bar/pepperi-addons-ngx-lib-snack-bar.metadata.json +1 -0
- package/snack-bar/public-api.d.ts +4 -0
- package/snack-bar/snack-bar.component.d.ts +8 -0
- package/snack-bar/snack-bar.component.theme.scss +5 -0
- package/snack-bar/snack-bar.model.d.ts +8 -0
- package/snack-bar/snack-bar.module.d.ts +5 -0
- package/snack-bar/snack-bar.service.d.ts +21 -0
- package/src/core/style/abstracts/variables.scss +4 -0
- package/src/core/style/base/base.scss +19 -0
|
@@ -129,7 +129,10 @@
|
|
|
129
129
|
dialogConfig.autoFocus = false;
|
|
130
130
|
dialogConfig.direction = this.layoutService.isRtl() ? 'rtl' : 'ltr';
|
|
131
131
|
dialogConfig.disableClose = (_a = options.disableClose) !== null && _a !== void 0 ? _a : true;
|
|
132
|
-
dialogConfig.panelClass = ['pep-dialog'
|
|
132
|
+
dialogConfig.panelClass = ['pep-dialog'];
|
|
133
|
+
if (options.panelClass) {
|
|
134
|
+
dialogConfig.panelClass.push(options.panelClass);
|
|
135
|
+
}
|
|
133
136
|
if (size === 'inline') {
|
|
134
137
|
dialogConfig.height = options.height || 'auto';
|
|
135
138
|
dialogConfig.maxWidth = options.maxWidth || '100vw';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pepperi-addons-ngx-lib-dialog.umd.js","sources":["../../../projects/ngx-lib/dialog/dialog.model.ts","../../../projects/ngx-lib/dialog/default-dialog.component.ts","../../../projects/ngx-lib/dialog/dialog.component.ts","../../../projects/ngx-lib/dialog/dialog.service.ts","../../../projects/ngx-lib/dialog/dialog.module.ts","../../../projects/ngx-lib/dialog/public-api.ts","../../../projects/ngx-lib/dialog/pepperi-addons-ngx-lib-dialog.ts"],"sourcesContent":["export type PepDialogSizeType =\n | 'inline'\n | 'small'\n | 'regular'\n | 'large'\n | 'full-screen';\n\nexport type PepDialogActionsType =\n | 'close'\n | 'cancel-continue'\n | 'cancel-ok'\n | 'cancel-delete'\n | 'custom';\n\nexport class PepDialogActionButton {\n title = '';\n className = '';\n callback: () => void;\n\n constructor(title = '', className = '', callback: () => void = null) {\n this.title = title;\n this.className = className;\n this.callback = callback;\n }\n}\n\nexport class PepDialogData {\n title: string;\n actionsType: PepDialogActionsType;\n content: any;\n showClose: boolean;\n showHeader: boolean;\n showFooter: boolean;\n actionButtons: Array<PepDialogActionButton>;\n\n constructor(options: {\n title?: string;\n actionsType?: PepDialogActionsType;\n content?: any;\n contentDisabled?: boolean;\n showClose?: boolean;\n showHeader?: boolean;\n showFooter?: boolean;\n actionButtons?: Array<PepDialogActionButton>;\n }) {\n this.title = options.title || '';\n this.actionsType = options.actionsType || 'close';\n this.content = options.content || '';\n this.showClose = options.showClose ?? true;\n this.showHeader = options.showHeader ?? true;\n this.showFooter = options.showFooter ?? true;\n this.actionButtons = options.actionButtons ?? null;\n }\n}\n","import { Component, Inject, ViewEncapsulation } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { PepDialogData, PepDialogActionButton } from './dialog.model';\n\n@Component({\n templateUrl: './default-dialog.component.html',\n styleUrls: ['./default-dialog.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class PepDefaultDialogComponent {\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: PepDialogData,\n public dialogRef: MatDialogRef<any>\n ) {}\n\n onActionButtonClicked(button: PepDialogActionButton): void {\n this.dialogRef.close(true);\n this.dialogRef.afterClosed().subscribe((isActionButtonClicked) => {\n if (isActionButtonClicked && button?.callback) {\n button.callback();\n }\n });\n }\n}\n","import { Component, Input } from '@angular/core';\n\n@Component({\n selector: 'pep-dialog',\n styleUrls: ['./dialog.component.scss', './dialog.component.theme.scss'],\n templateUrl: './dialog.component.html',\n})\nexport class PepDialogComponent {\n @Input() title: string;\n @Input() showClose = true;\n @Input() showHeader = true;\n @Input() showFooter = true;\n}\n","import { Injectable, TemplateRef } from '@angular/core';\nimport {\n MatDialog,\n MatDialogConfig,\n MatDialogRef,\n} from '@angular/material/dialog';\nimport { PepLayoutService } from '@pepperi-addons/ngx-lib';\nimport { Overlay } from '@angular/cdk/overlay';\nimport { ComponentType } from '@angular/cdk/portal';\nimport { PepDialogSizeType, PepDialogData } from './dialog.model';\nimport { PepDefaultDialogComponent } from './default-dialog.component';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PepDialogService {\n constructor(\n private dialog: MatDialog,\n private layoutService: PepLayoutService,\n private overlay: Overlay\n ) { }\n\n private fixConfigIfNeeded(data: PepDialogData, config: MatDialogConfig) {\n if (config.disableClose) {\n if (\n (((data.showClose !== undefined && !data.showClose) || (data.showHeader !== undefined && !data.showHeader)) && (data.showFooter !== undefined && !data.showFooter)) ||\n (data.actionsType === 'custom' &&\n (data.actionButtons === null ||\n data.actionButtons.length === 0))\n ) {\n config.disableClose = false;\n }\n }\n }\n\n getDialogConfig(\n options: {\n disableClose?: boolean;\n height?: string;\n minWidth?: string;\n maxWidth?: string;\n maxHeight?: string;\n panelClass?: string;\n } = {},\n size: PepDialogSizeType = 'regular'\n ): MatDialogConfig {\n const dialogConfig = new MatDialogConfig();\n\n dialogConfig.autoFocus = false;\n dialogConfig.direction = this.layoutService.isRtl() ? 'rtl' : 'ltr';\n dialogConfig.disableClose = options.disableClose ?? true;\n dialogConfig.panelClass = ['pep-dialog', options.panelClass || ''];\n\n if (size === 'inline') {\n dialogConfig.height = options.height || 'auto';\n dialogConfig.maxWidth = options.maxWidth || '100vw';\n dialogConfig.maxHeight = options.maxHeight || '100vh';\n dialogConfig.minWidth = options.minWidth || '300px';\n }\n\n dialogConfig.panelClass.push(size);\n\n dialogConfig.scrollStrategy = this.overlay.scrollStrategies.noop();\n // dialogConfig.scrollStrategy = this.overlay.scrollStrategies.block();\n\n return dialogConfig;\n }\n\n openDefaultDialog(\n data: PepDialogData,\n config: MatDialogConfig = null\n ): MatDialogRef<PepDefaultDialogComponent> {\n if (!config) {\n config = this.getDialogConfig();\n }\n this.fixConfigIfNeeded(data, config);\n\n config.data = data;\n const dialogRef = this.dialog.open(PepDefaultDialogComponent, config);\n return dialogRef;\n }\n\n openDialog<T>(\n componentOrTemplateRef: ComponentType<T> | TemplateRef<T>,\n data: any = {},\n config: MatDialogConfig = null\n ): MatDialogRef<T> {\n if (!config) {\n config = this.getDialogConfig();\n }\n this.fixConfigIfNeeded(data, config);\n\n config.data = data;\n const dialogRef = this.dialog.open(componentOrTemplateRef, config);\n return dialogRef;\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 { MatDialogModule } from '@angular/material/dialog';\n\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\nimport {\n PepIconModule,\n PepIconRegistry,\n pepIconSystemClose,\n} from '@pepperi-addons/ngx-lib/icon';\n\nimport { PepDefaultDialogComponent } from './default-dialog.component';\nimport { PepDialogComponent } from './dialog.component';\nimport { PepDialogService } from './dialog.service';\n\n@NgModule({\n imports: [\n CommonModule,\n // Material modules,\n MatCommonModule,\n MatButtonModule,\n MatIconModule,\n MatDialogModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepIconModule,\n ],\n exports: [PepDialogComponent],\n declarations: [PepDefaultDialogComponent, PepDialogComponent],\n entryComponents: [PepDefaultDialogComponent],\n providers: [PepDialogService]\n})\nexport class PepDialogModule {\n constructor(private pepIconRegistry: PepIconRegistry) {\n this.pepIconRegistry.registerIcons([pepIconSystemClose]);\n }\n}\n","/*\n * Public API Surface of ngx-lib/dialog\n */\nexport * from './dialog.module';\nexport * from './dialog.model';\nexport * from './dialog.component';\nexport * from './dialog.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {PepDefaultDialogComponent as ɵa} from './default-dialog.component';"],"names":["Component","ViewEncapsulation","Inject","MAT_DIALOG_DATA","MatDialogRef","Input","MatDialogConfig","Injectable","MatDialog","PepLayoutService","Overlay","pepIconSystemClose","NgModule","CommonModule","MatCommonModule","MatButtonModule","MatIconModule","MatDialogModule","PepNgxLibModule","PepIconModule","PepIconRegistry"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAmBI,+BAAY,KAAU,EAAE,SAAc,EAAE,QAA2B;YAAvD,sBAAA,EAAA,UAAU;YAAE,0BAAA,EAAA,cAAc;YAAE,yBAAA,EAAA,eAA2B;YAJnE,UAAK,GAAG,EAAE,CAAC;YACX,cAAS,GAAG,EAAE,CAAC;YAIX,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;YAC3B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;SAC5B;oCACJ;KAAA,IAAA;;QAWG,uBAAY,OASX;;YACG,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;YACjC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC;YAClD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;YACrC,IAAI,CAAC,SAAS,GAAG,MAAA,OAAO,CAAC,SAAS,mCAAI,IAAI,CAAC;YAC3C,IAAI,CAAC,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,IAAI,CAAC;YAC7C,IAAI,CAAC,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,IAAI,CAAC;YAC7C,IAAI,CAAC,aAAa,GAAG,MAAA,OAAO,CAAC,aAAa,mCAAI,IAAI,CAAC;SACtD;4BACJ;KAAA;;;QC3CG,mCACoC,IAAmB,EAC5C,SAA4B;YADH,SAAI,GAAJ,IAAI,CAAe;YAC5C,cAAS,GAAT,SAAS,CAAmB;SACnC;QAEJ,yDAAqB,GAArB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BAAgB,CAAC;iBAChC;;;gBAxBGC,oBAAe;;;ICXnB;;;;ICAA;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"pepperi-addons-ngx-lib-dialog.umd.js","sources":["../../../projects/ngx-lib/dialog/dialog.model.ts","../../../projects/ngx-lib/dialog/default-dialog.component.ts","../../../projects/ngx-lib/dialog/dialog.component.ts","../../../projects/ngx-lib/dialog/dialog.service.ts","../../../projects/ngx-lib/dialog/dialog.module.ts","../../../projects/ngx-lib/dialog/public-api.ts","../../../projects/ngx-lib/dialog/pepperi-addons-ngx-lib-dialog.ts"],"sourcesContent":["export type PepDialogSizeType =\n | 'inline'\n | 'small'\n | 'regular'\n | 'large'\n | 'full-screen';\n\nexport type PepDialogActionsType =\n | 'close'\n | 'cancel-continue'\n | 'cancel-ok'\n | 'cancel-delete'\n | 'custom';\n\nexport class PepDialogActionButton {\n title = '';\n className = '';\n callback: () => void;\n\n constructor(title = '', className = '', callback: () => void = null) {\n this.title = title;\n this.className = className;\n this.callback = callback;\n }\n}\n\nexport class PepDialogData {\n title: string;\n actionsType: PepDialogActionsType;\n content: any;\n showClose: boolean;\n showHeader: boolean;\n showFooter: boolean;\n actionButtons: Array<PepDialogActionButton>;\n\n constructor(options: {\n title?: string;\n actionsType?: PepDialogActionsType;\n content?: any;\n contentDisabled?: boolean;\n showClose?: boolean;\n showHeader?: boolean;\n showFooter?: boolean;\n actionButtons?: Array<PepDialogActionButton>;\n }) {\n this.title = options.title || '';\n this.actionsType = options.actionsType || 'close';\n this.content = options.content || '';\n this.showClose = options.showClose ?? true;\n this.showHeader = options.showHeader ?? true;\n this.showFooter = options.showFooter ?? true;\n this.actionButtons = options.actionButtons ?? null;\n }\n}\n","import { Component, Inject, ViewEncapsulation } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { PepDialogData, PepDialogActionButton } from './dialog.model';\n\n@Component({\n templateUrl: './default-dialog.component.html',\n styleUrls: ['./default-dialog.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class PepDefaultDialogComponent {\n constructor(\n @Inject(MAT_DIALOG_DATA) public data: PepDialogData,\n public dialogRef: MatDialogRef<any>\n ) {}\n\n onActionButtonClicked(button: PepDialogActionButton): void {\n this.dialogRef.close(true);\n this.dialogRef.afterClosed().subscribe((isActionButtonClicked) => {\n if (isActionButtonClicked && button?.callback) {\n button.callback();\n }\n });\n }\n}\n","import { Component, Input } from '@angular/core';\n\n@Component({\n selector: 'pep-dialog',\n styleUrls: ['./dialog.component.scss', './dialog.component.theme.scss'],\n templateUrl: './dialog.component.html',\n})\nexport class PepDialogComponent {\n @Input() title: string;\n @Input() showClose = true;\n @Input() showHeader = true;\n @Input() showFooter = true;\n}\n","import { Injectable, TemplateRef } from '@angular/core';\nimport {\n MatDialog,\n MatDialogConfig,\n MatDialogRef,\n} from '@angular/material/dialog';\nimport { PepLayoutService } from '@pepperi-addons/ngx-lib';\nimport { Overlay } from '@angular/cdk/overlay';\nimport { ComponentType } from '@angular/cdk/portal';\nimport { PepDialogSizeType, PepDialogData } from './dialog.model';\nimport { PepDefaultDialogComponent } from './default-dialog.component';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PepDialogService {\n constructor(\n private dialog: MatDialog,\n private layoutService: PepLayoutService,\n private overlay: Overlay\n ) { }\n\n private fixConfigIfNeeded(data: PepDialogData, config: MatDialogConfig) {\n if (config.disableClose) {\n if (\n (((data.showClose !== undefined && !data.showClose) || (data.showHeader !== undefined && !data.showHeader)) && (data.showFooter !== undefined && !data.showFooter)) ||\n (data.actionsType === 'custom' &&\n (data.actionButtons === null ||\n data.actionButtons.length === 0))\n ) {\n config.disableClose = false;\n }\n }\n }\n\n getDialogConfig(\n options: {\n disableClose?: boolean;\n height?: string;\n minWidth?: string;\n maxWidth?: string;\n maxHeight?: string;\n panelClass?: string;\n } = {},\n size: PepDialogSizeType = 'regular'\n ): MatDialogConfig {\n const dialogConfig = new MatDialogConfig();\n\n dialogConfig.autoFocus = false;\n dialogConfig.direction = this.layoutService.isRtl() ? 'rtl' : 'ltr';\n dialogConfig.disableClose = options.disableClose ?? true;\n \n dialogConfig.panelClass = ['pep-dialog'];\n if (options.panelClass) {\n dialogConfig.panelClass.push(options.panelClass);\n }\n\n if (size === 'inline') {\n dialogConfig.height = options.height || 'auto';\n dialogConfig.maxWidth = options.maxWidth || '100vw';\n dialogConfig.maxHeight = options.maxHeight || '100vh';\n dialogConfig.minWidth = options.minWidth || '300px';\n }\n\n dialogConfig.panelClass.push(size);\n\n dialogConfig.scrollStrategy = this.overlay.scrollStrategies.noop();\n // dialogConfig.scrollStrategy = this.overlay.scrollStrategies.block();\n\n return dialogConfig;\n }\n\n openDefaultDialog(\n data: PepDialogData,\n config: MatDialogConfig = null\n ): MatDialogRef<PepDefaultDialogComponent> {\n if (!config) {\n config = this.getDialogConfig();\n }\n this.fixConfigIfNeeded(data, config);\n\n config.data = data;\n const dialogRef = this.dialog.open(PepDefaultDialogComponent, config);\n return dialogRef;\n }\n\n openDialog<T>(\n componentOrTemplateRef: ComponentType<T> | TemplateRef<T>,\n data: any = {},\n config: MatDialogConfig = null\n ): MatDialogRef<T> {\n if (!config) {\n config = this.getDialogConfig();\n }\n this.fixConfigIfNeeded(data, config);\n\n config.data = data;\n const dialogRef = this.dialog.open(componentOrTemplateRef, config);\n return dialogRef;\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 { MatDialogModule } from '@angular/material/dialog';\n\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\nimport {\n PepIconModule,\n PepIconRegistry,\n pepIconSystemClose,\n} from '@pepperi-addons/ngx-lib/icon';\n\nimport { PepDefaultDialogComponent } from './default-dialog.component';\nimport { PepDialogComponent } from './dialog.component';\nimport { PepDialogService } from './dialog.service';\n\n@NgModule({\n imports: [\n CommonModule,\n // Material modules,\n MatCommonModule,\n MatButtonModule,\n MatIconModule,\n MatDialogModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepIconModule,\n ],\n exports: [PepDialogComponent],\n declarations: [PepDefaultDialogComponent, PepDialogComponent],\n entryComponents: [PepDefaultDialogComponent],\n providers: [PepDialogService]\n})\nexport class PepDialogModule {\n constructor(private pepIconRegistry: PepIconRegistry) {\n this.pepIconRegistry.registerIcons([pepIconSystemClose]);\n }\n}\n","/*\n * Public API Surface of ngx-lib/dialog\n */\nexport * from './dialog.module';\nexport * from './dialog.model';\nexport * from './dialog.component';\nexport * from './dialog.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {PepDefaultDialogComponent as ɵa} from './default-dialog.component';"],"names":["Component","ViewEncapsulation","Inject","MAT_DIALOG_DATA","MatDialogRef","Input","MatDialogConfig","Injectable","MatDialog","PepLayoutService","Overlay","pepIconSystemClose","NgModule","CommonModule","MatCommonModule","MatButtonModule","MatIconModule","MatDialogModule","PepNgxLibModule","PepIconModule","PepIconRegistry"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAmBI,+BAAY,KAAU,EAAE,SAAc,EAAE,QAA2B;YAAvD,sBAAA,EAAA,UAAU;YAAE,0BAAA,EAAA,cAAc;YAAE,yBAAA,EAAA,eAA2B;YAJnE,UAAK,GAAG,EAAE,CAAC;YACX,cAAS,GAAG,EAAE,CAAC;YAIX,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;YAC3B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;SAC5B;oCACJ;KAAA,IAAA;;QAWG,uBAAY,OASX;;YACG,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;YACjC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC;YAClD,IAAI,CAAC,OA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;;;;gBAvFJC,aAAU,SAAC;oBACR,UAAU,EAAE,MAAM;iBACrB;;;gBAZGC,YAAS;gBAIJC,mBAAgB;gBAChBC,UAAO;;;;QC8BZ,yBAAoB,eAAgC;YAAhC,oBAAe,GAAf,eAAe,CAAiB;YAChD,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,CAACC,uBAAkB,CAAC,CAAC,CAAC;SAC5D;;;;gBApBJC,WAAQ,SAAC;oBACN,OAAO,EAAE;wBACLC,mBAAY;;wBAEZC,oBAAe;wBACfC,sBAAe;wBACfC,oBAAa;wBACbC,kBAAe;;wBAEfC,kBAAe;wBACfC,kBAAa;qBAChB;oBACD,OAAO,EAAE,CAAC,kBAAkB,CAAC;oBAC7B,YAAY,EAAE,CAAC,yBAAyB,EAAE,kBAAkB,CAAC;oBAC7D,eAAe,EAAE,CAAC,yBAAyB,CAAC;oBAC5C,SAAS,EAAE,CAAC,gBAAgB,CAAC;iBAChC;;;gBAxBGC,oBAAe;;;ICXnB;;;;ICAA;;;;;;;;;;;;;;;;;"}
|
|
@@ -8,9 +8,7 @@
|
|
|
8
8
|
function IsUrlPipe() {
|
|
9
9
|
}
|
|
10
10
|
IsUrlPipe.prototype.transform = function (value) {
|
|
11
|
-
// const regex = /^((ht|f)tp(s?):\/\/)?([w]{3}[\.])?/;
|
|
12
11
|
var regex = /^((http(s?)|ftp)\:\/\/)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)(.*)/;
|
|
13
|
-
//console.log(`pipe - value - ${value} is valid url - ${regex.test(value)}`);
|
|
14
12
|
return regex.test(value);
|
|
15
13
|
};
|
|
16
14
|
return IsUrlPipe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pepperi-addons-ngx-lib-link.umd.js","sources":["../../../projects/ngx-lib/link/link.pipes.ts","../../../projects/ngx-lib/link/link.component.ts","../../../projects/ngx-lib/link/link.module.ts","../../../projects/ngx-lib/link/public-api.ts","../../../projects/ngx-lib/link/pepperi-addons-ngx-lib-link.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'isUrl'\n})\nexport class IsUrlPipe implements PipeTransform {\n transform(value: string): boolean {\n // const regex = /^((ht|f)tp(s?):\\/\\/)?([w]{3}[\\.])?/;\n const regex = /^((http(s?)|ftp)\\:\\/\\/)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)(.*)/;\n //console.log(`pipe - value - ${value} is valid url - ${regex.test(value)}`);\n return regex.test(value);\n }\n}","import {\n Component,\n OnInit,\n OnChanges,\n Input,\n Output,\n EventEmitter,\n ChangeDetectionStrategy,\n ElementRef,\n ViewChild,\n Renderer2,\n OnDestroy,\n ChangeDetectorRef,\n HostBinding,\n} from '@angular/core';\nimport { FormGroup, FormBuilder } from '@angular/forms';\nimport { TranslateService } from '@ngx-translate/core';\nimport {\n PepLayoutType,\n PepCustomizationService,\n PepHorizontalAlignment,\n DEFAULT_HORIZONTAL_ALIGNMENT,\n PepTextboxFieldType,\n PepTextboxField,\n PepFieldBase,\n PepUtilitiesService,\n IPepFieldClickEvent,\n} from '@pepperi-addons/ngx-lib';\nimport { IsUrlPipe } from './link.pipes';\n\n/**\n * This is a text box input component that can be use to\n *\n * @export\n * @class PepTextboxComponent\n * @implements {OnChanges}\n * @implements {OnInit}\n * @implements {OnDestroy}\n */\n@Component({\n selector: 'pep-link',\n templateUrl: './link.component.html',\n styleUrls: ['./link.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PepLinkComponent implements OnChanges, OnInit, OnDestroy {\n\n @HostBinding('attr.data-qa') dataQa = '';\n\n private _key = '';\n /**\n * The text box key\n *\n * @memberof PepTextboxComponent\n */\n @Input()\n set key(value) {\n this._key = value;\n this.dataQa = value;\n }\n get key(): string {\n return this._key;\n }\n\n private _value = '';\n /**\n * The value of the text box.\n *\n * @memberof PepTextboxComponent\n */\n @Input()\n set value(value: string) {\n if (!value) {\n value = '';\n }\n\n this._value = value;\n\n if (this._calculateFormattedValue) {\n this.setFormattedValue(value);\n }\n }\n get value(): string {\n return this._value;\n }\n\n private _formattedValue = null;\n /**\n * The formatted value.\n *\n * @memberof PepTextboxComponent\n */\n @Input()\n set formattedValue(value: string) {\n if (!value) {\n value = '';\n }\n\n if (this._calculateFormattedValue) {\n this._calculateFormattedValue = false;\n }\n\n this.setFormattedValue(value);\n }\n get formattedValue(): string {\n return this._formattedValue;\n }\n\n /**\n * The title of the textbox.\n *\n * @memberof PepTextboxComponent\n */\n @Input() label = '';\n\n /**\n * The placeholder (relevant only for children - if parent isn't null).\n *\n * @memberof PepTextboxComponent\n */\n @Input() placeholder = '';\n\n /**\n * The type of the textbox.\n *\n * @type {PepTextboxFieldType}\n * @memberof PepTextboxComponent\n */\n @Input() type: PepTextboxFieldType = 'text';\n\n /**\n * If the textbox is mandatory\n *\n * @memberof PepTextboxComponent\n */\n @Input() mandatory = false;\n\n // TODO: Check if should remove disabled and keep only readonly.\n /**\n * If the textbox is disabled.\n *\n * @memberof PepTextboxComponent\n */\n @Input() disabled = false;\n\n /**\n * If the textbox is readonly\n *\n * @memberof PepTextboxComponent\n */\n @Input() readonly = false;\n @Input() maxFieldCharacters: number;\n @Input() textColor = '';\n @Input() xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n @Input() rowSpan = 1;\n // @Input() lastFocusField: any;\n @Input() minValue = NaN;\n @Input() maxValue = NaN;\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 @Input() form: FormGroup = null;\n @Input() isActive = false;\n @Input() showTitle = true;\n @Input() renderTitle = true;\n @Input() renderError = true;\n @Input() renderSymbol = true;\n @Input() layoutType: PepLayoutType = 'form';\n @Input() parentFieldKey: string = null;\n\n /**\n * The value change event.\n *\n * @type {EventEmitter<string>}\n * @memberof PepTextboxComponent\n */\n @Output()\n valueChange: EventEmitter<string> = new EventEmitter<string>();\n\n @Output()\n formValidationChange: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n @Output()\n elementClick: EventEmitter<IPepFieldClickEvent> = new EventEmitter<IPepFieldClickEvent>();\n\n @ViewChild('input') input: ElementRef;\n\n private _calculateFormattedValue = true;\n get calculateFormattedValue(): boolean {\n return this._calculateFormattedValue;\n }\n\n controlType = 'link';\n\n standAlone = false;\n isInEditMode = false;\n isInFocus: boolean;\n isUrl = false;\n\n constructor(\n public fb: FormBuilder,\n private customizationService: PepCustomizationService,\n private renderer: Renderer2,\n private element: ElementRef,\n private translate: TranslateService,\n private utilitiesService: PepUtilitiesService,\n private isUrlPipe: IsUrlPipe\n ) {\n this.isInFocus = false;\n }\n\n private setFormattedValue(value: string) {\n if (this._calculateFormattedValue) {\n this._formattedValue = this.isNumberType()\n ? this.utilitiesService.formatNumber(value)\n : value;\n } else {\n this._formattedValue = value;\n }\n\n this.updateFormFieldValue();\n }\n\n private updateFormFieldValue() {\n this.customizationService.updateFormFieldValue(\n this.form,\n this.key,\n this.formattedValue,\n this.parentFieldKey\n );\n }\n\n get displayValue(): string {\n let res = '';\n\n if (this.type == 'link') {\n res = this.formattedValue;\n } else {\n res = this.isInFocus ? this.value : this.formattedValue;\n }\n\n return res;\n }\n\n private setDefaultForm(): void {\n const pepField = new PepTextboxField({\n key: this.key,\n value: this.value,\n mandatory: this.mandatory,\n readonly: this.readonly,\n disabled: this.disabled,\n maxFieldCharacters: this.maxFieldCharacters,\n type: this.type,\n minValue: this.minValue,\n maxValue: this.maxValue,\n });\n this.form = this.customizationService.getDefaultFromGroup(\n pepField,\n this.renderError\n );\n }\n\n ngOnInit(): void {\n if (this.form === null) {\n this.standAlone = true;\n\n this.minValue =\n isNaN(this.minValue) && !isNaN(this.maxValue)\n ? 0\n : this.minValue;\n this.maxValue =\n isNaN(this.maxValue) && !isNaN(this.minValue)\n ? 99999\n : this.maxValue;\n\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 this.readonly = this.type === 'duration' ? true : this.readonly; // Hack until we develop Timer UI for editing Duration field\n\n this.updateFormFieldValue();\n }\n\n ngOnChanges(changes: any): void {\n if (this.standAlone) {\n this.setDefaultForm();\n }\n\n this.readonly = this.type === 'duration' ? true : this.readonly; // Hack until we develop Timer UI for editing Duration field\n }\n\n ngOnDestroy(): void {\n //\n }\n\n onFocus(event: any): void {\n this.isInFocus = true;\n\n // select the value in focus (DI-18246 improvement)\n setTimeout(() => {\n const eventTarget = event.target || event.srcElement;\n if (eventTarget) {\n eventTarget.select();\n }\n }, 0);\n }\n\n isNumberType(): boolean {\n return (\n this.type === 'percentage' ||\n this.type === 'currency' ||\n this.type === 'int' ||\n this.type === 'real'\n );\n }\n\n isValueValid(value: string): boolean {\n let res = false;\n\n if (this.isNumberType()) {\n if (value === '') {\n res = this.mandatory ? false : true;\n } else {\n const numberValue = this.utilitiesService.coerceNumberProperty(\n value\n );\n res =\n numberValue >= this.minValue &&\n numberValue <= this.maxValue;\n }\n } else {\n // TODO: Maybe need to check other types.\n res = true;\n }\n\n return res;\n }\n\n isDifferentValue(value: string): boolean {\n let res = false;\n\n if (this.isNumberType()) {\n if (this.value === '' || value === '') {\n res = true;\n } else {\n const currentValue = this.utilitiesService.coerceNumberProperty(\n this.value\n );\n const newValue = this.utilitiesService.coerceNumberProperty(\n value\n );\n\n res = currentValue !== newValue;\n }\n } else {\n res = true;\n }\n\n return res;\n }\n\n onChange(e: any): void {\n const value = e.target ? e.target.value : e;\n\n this.valueChange.emit(value);\n }\n\n onBlur(e: any): void {\n this.isInFocus = false;\n const value = e.target ? e.target.value : e;\n if (value !== this.value && this.isDifferentValue(value)) {\n // If renderError is false and the new value is not valid.\n if (!this.renderError && !this.isValueValid(value)) {\n this.renderer.setProperty(\n this.input.nativeElement,\n 'value',\n this.value\n );\n } else {\n this.value = value;\n\n // If the user is setting the formatted value then set the value till the user format it and return it back.\n if (!this._calculateFormattedValue) {\n this._formattedValue = value;\n }\n\n this.valueChange.emit(value);\n }\n }\n\n if (this.isInEditMode) {\n this.isInEditMode = false;\n }\n }\n\n onClick() {\n const output: IPepFieldClickEvent = {\n key: this.key,\n value: this.value,\n controlType: this.controlType\n }\n this.elementClick.emit(output);\n }\n\n anchorClicked(): void {\n const currentValue = this.value;\n if (currentValue.trim().length > 0) {\n switch (this.type) {\n case 'email':\n window.open('mailto:' + currentValue, 'email');\n break;\n case 'phone':\n window.open('tel:' + currentValue, 'tel');\n break;\n case 'link':\n const output: IPepFieldClickEvent = {\n key: this.key,\n value: this.value,\n controlType: this.controlType\n }\n this.elementClick.emit(output);\n if (this.isUrlPipe.transform(currentValue)) {\n window.open(currentValue);\n }\n break;\n default:\n break;\n }\n }\n }\n\n cardTemplateClicked(event: any): void {\n this.isInEditMode = true;\n\n setTimeout(() => {\n this.input.nativeElement.focus();\n }, 0);\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 { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\nimport {\n PepIconModule,\n PepIconRegistry,\n pepIconSystemEdit,\n} from '@pepperi-addons/ngx-lib/icon';\nimport { PepTextboxIconModule } from '@pepperi-addons/ngx-lib/textbox-icon';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\n\nimport { PepLinkComponent } from './link.component';\n//import { PepTextboxValidationDirective } from './textbox-validation.directive';\n\nimport { IsUrlPipe } from './link.pipes';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n // Material modules,\n MatCommonModule,\n MatButtonModule,\n MatFormFieldModule,\n MatInputModule,\n MatIconModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepIconModule,\n PepFieldTitleModule,\n PepTextboxIconModule,\n ],\n exports: [PepLinkComponent],\n declarations: [\n PepLinkComponent,\n // PepTextboxValidationDirective,\n IsUrlPipe\n ],\n providers: [IsUrlPipe]\n})\nexport class PepLinkModule {\n constructor(private pepIconRegistry: PepIconRegistry) {\n this.pepIconRegistry.registerIcons([pepIconSystemEdit]);\n }\n}\n","/*\n * Public API Surface of ngx-lib/link\n */\nexport * from './link.module';\nexport * from './link.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {IsUrlPipe as ɵa} from './link.pipes';"],"names":["Pipe","DEFAULT_HORIZONTAL_ALIGNMENT","EventEmitter","PepTextboxField","PepCustomizationService","Component","ChangeDetectionStrategy","FormBuilder","Renderer2","ElementRef","TranslateService","PepUtilitiesService","HostBinding","Input","Output","ViewChild","pepIconSystemEdit","NgModule","CommonModule","ReactiveFormsModule","MatCommonModule","MatButtonModule","MatFormFieldModule","MatInputModule","MatIconModule","PepNgxLibModule","PepIconModule","PepFieldTitleModule","PepTextboxIconModule","PepIconRegistry"],"mappings":";;;;;;;QAKA;;QACI,6BAAS,GAAT,UAAU,KAAa;;YAEnB,IAAM,KAAK,GAAG,sGAAsG,CAAC;;YAErH,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC5B;;;;gBATJA,SAAI,SAAC;oBACF,IAAI,EAAE,OAAO;iBAChB;;;IC0BD;;;;;;;;;;QA2LI,0BACW,EAAe,EACd,oBAA6C,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sBAAe;wBACfC,sBAAe;wBACfC,4BAAkB;wBAClBC,oBAAc;wBACdC,oBAAa;;wBAEbC,sBAAe;wBACfC,kBAAa;wBACbC,8BAAmB;wBACnBC,gCAAoB;qBACvB;oBACD,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,YAAY,EAAE;wBACV,gBAAgB;;wBAEhB,SAAS;qBACZ;oBACD,SAAS,EAAE,CAAC,SAAS,CAAC;iBACzB;;;gBAlCGC,oBAAe;;;ICbnB;;;;ICAA;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"pepperi-addons-ngx-lib-link.umd.js","sources":["../../../projects/ngx-lib/link/link.pipes.ts","../../../projects/ngx-lib/link/link.component.ts","../../../projects/ngx-lib/link/link.module.ts","../../../projects/ngx-lib/link/public-api.ts","../../../projects/ngx-lib/link/pepperi-addons-ngx-lib-link.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'isUrl'\n})\nexport class IsUrlPipe implements PipeTransform {\n transform(value: string): boolean {\n const regex = /^((http(s?)|ftp)\\:\\/\\/)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)(.*)/;\n \n return regex.test(value);\n }\n}","import {\n Component,\n OnInit,\n OnChanges,\n Input,\n Output,\n EventEmitter,\n ChangeDetectionStrategy,\n ElementRef,\n ViewChild,\n Renderer2,\n OnDestroy,\n ChangeDetectorRef,\n HostBinding,\n} from '@angular/core';\nimport { FormGroup, FormBuilder } from '@angular/forms';\nimport { TranslateService } from '@ngx-translate/core';\nimport {\n PepLayoutType,\n PepCustomizationService,\n PepHorizontalAlignment,\n DEFAULT_HORIZONTAL_ALIGNMENT,\n PepTextboxFieldType,\n PepTextboxField,\n PepFieldBase,\n PepUtilitiesService,\n IPepFieldClickEvent,\n} from '@pepperi-addons/ngx-lib';\nimport { IsUrlPipe } from './link.pipes';\n\n/**\n * This is a text box input component that can be use to\n *\n * @export\n * @class PepTextboxComponent\n * @implements {OnChanges}\n * @implements {OnInit}\n * @implements {OnDestroy}\n */\n@Component({\n selector: 'pep-link',\n templateUrl: './link.component.html',\n styleUrls: ['./link.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PepLinkComponent implements OnChanges, OnInit, OnDestroy {\n\n @HostBinding('attr.data-qa') dataQa = '';\n\n private _key = '';\n /**\n * The text box key\n *\n * @memberof PepTextboxComponent\n */\n @Input()\n set key(value) {\n this._key = value;\n this.dataQa = value;\n }\n get key(): string {\n return this._key;\n }\n\n private _value = '';\n /**\n * The value of the text box.\n *\n * @memberof PepTextboxComponent\n */\n @Input()\n set value(value: string) {\n if (!value) {\n value = '';\n }\n\n this._value = value;\n\n if (this._calculateFormattedValue) {\n this.setFormattedValue(value);\n }\n }\n get value(): string {\n return this._value;\n }\n\n private _formattedValue = null;\n /**\n * The formatted value.\n *\n * @memberof PepTextboxComponent\n */\n @Input()\n set formattedValue(value: string) {\n if (!value) {\n value = '';\n }\n\n if (this._calculateFormattedValue) {\n this._calculateFormattedValue = false;\n }\n\n this.setFormattedValue(value);\n }\n get formattedValue(): string {\n return this._formattedValue;\n }\n\n /**\n * The title of the textbox.\n *\n * @memberof PepTextboxComponent\n */\n @Input() label = '';\n\n /**\n * The placeholder (relevant only for children - if parent isn't null).\n *\n * @memberof PepTextboxComponent\n */\n @Input() placeholder = '';\n\n /**\n * The type of the textbox.\n *\n * @type {PepTextboxFieldType}\n * @memberof PepTextboxComponent\n */\n @Input() type: PepTextboxFieldType = 'text';\n\n /**\n * If the textbox is mandatory\n *\n * @memberof PepTextboxComponent\n */\n @Input() mandatory = false;\n\n // TODO: Check if should remove disabled and keep only readonly.\n /**\n * If the textbox is disabled.\n *\n * @memberof PepTextboxComponent\n */\n @Input() disabled = false;\n\n /**\n * If the textbox is readonly\n *\n * @memberof PepTextboxComponent\n */\n @Input() readonly = false;\n @Input() maxFieldCharacters: number;\n @Input() textColor = '';\n @Input() xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n @Input() rowSpan = 1;\n // @Input() lastFocusField: any;\n @Input() minValue = NaN;\n @Input() maxValue = NaN;\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 @Input() form: FormGroup = null;\n @Input() isActive = false;\n @Input() showTitle = true;\n @Input() renderTitle = true;\n @Input() renderError = true;\n @Input() renderSymbol = true;\n @Input() layoutType: PepLayoutType = 'form';\n @Input() parentFieldKey: string = null;\n\n /**\n * The value change event.\n *\n * @type {EventEmitter<string>}\n * @memberof PepTextboxComponent\n */\n @Output()\n valueChange: EventEmitter<string> = new EventEmitter<string>();\n\n @Output()\n formValidationChange: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n @Output()\n elementClick: EventEmitter<IPepFieldClickEvent> = new EventEmitter<IPepFieldClickEvent>();\n\n @ViewChild('input') input: ElementRef;\n\n private _calculateFormattedValue = true;\n get calculateFormattedValue(): boolean {\n return this._calculateFormattedValue;\n }\n\n controlType = 'link';\n\n standAlone = false;\n isInEditMode = false;\n isInFocus: boolean;\n isUrl = false;\n\n constructor(\n public fb: FormBuilder,\n private customizationService: PepCustomizationService,\n private renderer: Renderer2,\n private element: ElementRef,\n private translate: TranslateService,\n private utilitiesService: PepUtilitiesService,\n private isUrlPipe: IsUrlPipe\n ) {\n this.isInFocus = false;\n }\n\n private setFormattedValue(value: string) {\n if (this._calculateFormattedValue) {\n this._formattedValue = this.isNumberType()\n ? this.utilitiesService.formatNumber(value)\n : value;\n } else {\n this._formattedValue = value;\n }\n\n this.updateFormFieldValue();\n }\n\n private updateFormFieldValue() {\n this.customizationService.updateFormFieldValue(\n this.form,\n this.key,\n this.formattedValue,\n this.parentFieldKey\n );\n }\n\n get displayValue(): string {\n let res = '';\n\n if (this.type == 'link') {\n res = this.formattedValue;\n } else {\n res = this.isInFocus ? this.value : this.formattedValue;\n }\n\n return res;\n }\n\n private setDefaultForm(): void {\n const pepField = new PepTextboxField({\n key: this.key,\n value: this.value,\n mandatory: this.mandatory,\n readonly: this.readonly,\n disabled: this.disabled,\n maxFieldCharacters: this.maxFieldCharacters,\n type: this.type,\n minValue: this.minValue,\n maxValue: this.maxValue,\n });\n this.form = this.customizationService.getDefaultFromGroup(\n pepField,\n this.renderError\n );\n }\n\n ngOnInit(): void {\n if (this.form === null) {\n this.standAlone = true;\n\n this.minValue =\n isNaN(this.minValue) && !isNaN(this.maxValue)\n ? 0\n : this.minValue;\n this.maxValue =\n isNaN(this.maxValue) && !isNaN(this.minValue)\n ? 99999\n : this.maxValue;\n\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 this.readonly = this.type === 'duration' ? true : this.readonly; // Hack until we develop Timer UI for editing Duration field\n\n this.updateFormFieldValue();\n }\n\n ngOnChanges(changes: any): void {\n if (this.standAlone) {\n this.setDefaultForm();\n }\n\n this.readonly = this.type === 'duration' ? true : this.readonly; // Hack until we develop Timer UI for editing Duration field\n }\n\n ngOnDestroy(): void {\n //\n }\n\n onFocus(event: any): void {\n this.isInFocus = true;\n\n // select the value in focus (DI-18246 improvement)\n setTimeout(() => {\n const eventTarget = event.target || event.srcElement;\n if (eventTarget) {\n eventTarget.select();\n }\n }, 0);\n }\n\n isNumberType(): boolean {\n return (\n this.type === 'percentage' ||\n this.type === 'currency' ||\n this.type === 'int' ||\n this.type === 'real'\n );\n }\n\n isValueValid(value: string): boolean {\n let res = false;\n\n if (this.isNumberType()) {\n if (value === '') {\n res = this.mandatory ? false : true;\n } else {\n const numberValue = this.utilitiesService.coerceNumberProperty(\n value\n );\n res =\n numberValue >= this.minValue &&\n numberValue <= this.maxValue;\n }\n } else {\n // TODO: Maybe need to check other types.\n res = true;\n }\n\n return res;\n }\n\n isDifferentValue(value: string): boolean {\n let res = false;\n\n if (this.isNumberType()) {\n if (this.value === '' || value === '') {\n res = true;\n } else {\n const currentValue = this.utilitiesService.coerceNumberProperty(\n this.value\n );\n const newValue = this.utilitiesService.coerceNumberProperty(\n value\n );\n\n res = currentValue !== newValue;\n }\n } else {\n res = true;\n }\n\n return res;\n }\n\n onChange(e: any): void {\n const value = e.target ? e.target.value : e;\n\n this.valueChange.emit(value);\n }\n\n onBlur(e: any): void {\n this.isInFocus = false;\n const value = e.target ? e.target.value : e;\n if (value !== this.value && this.isDifferentValue(value)) {\n // If renderError is false and the new value is not valid.\n if (!this.renderError && !this.isValueValid(value)) {\n this.renderer.setProperty(\n this.input.nativeElement,\n 'value',\n this.value\n );\n } else {\n this.value = value;\n\n // If the user is setting the formatted value then set the value till the user format it and return it back.\n if (!this._calculateFormattedValue) {\n this._formattedValue = value;\n }\n\n this.valueChange.emit(value);\n }\n }\n\n if (this.isInEditMode) {\n this.isInEditMode = false;\n }\n }\n\n onClick() {\n const output: IPepFieldClickEvent = {\n key: this.key,\n value: this.value,\n controlType: this.controlType\n }\n this.elementClick.emit(output);\n }\n\n anchorClicked(): void {\n const currentValue = this.value;\n if (currentValue.trim().length > 0) {\n switch (this.type) {\n case 'email':\n window.open('mailto:' + currentValue, 'email');\n break;\n case 'phone':\n window.open('tel:' + currentValue, 'tel');\n break;\n case 'link':\n const output: IPepFieldClickEvent = {\n key: this.key,\n value: this.value,\n controlType: this.controlType\n }\n this.elementClick.emit(output);\n if (this.isUrlPipe.transform(currentValue)) {\n window.open(currentValue);\n }\n break;\n default:\n break;\n }\n }\n }\n\n cardTemplateClicked(event: any): void {\n this.isInEditMode = true;\n\n setTimeout(() => {\n this.input.nativeElement.focus();\n }, 0);\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 { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\nimport {\n PepIconModule,\n PepIconRegistry,\n pepIconSystemEdit,\n} from '@pepperi-addons/ngx-lib/icon';\nimport { PepTextboxIconModule } from '@pepperi-addons/ngx-lib/textbox-icon';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\n\nimport { PepLinkComponent } from './link.component';\n//import { PepTextboxValidationDirective } from './textbox-validation.directive';\n\nimport { IsUrlPipe } from './link.pipes';\n\n@NgModule({\n imports: [\n CommonModule,\n ReactiveFormsModule,\n // Material modules,\n MatCommonModule,\n MatButtonModule,\n MatFormFieldModule,\n MatInputModule,\n MatIconModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepIconModule,\n PepFieldTitleModule,\n PepTextboxIconModule,\n ],\n exports: [PepLinkComponent],\n declarations: [\n PepLinkComponent,\n // PepTextboxValidationDirective,\n IsUrlPipe\n ],\n providers: [IsUrlPipe]\n})\nexport class PepLinkModule {\n constructor(private pepIconRegistry: PepIconRegistry) {\n this.pepIconRegistry.registerIcons([pepIconSystemEdit]);\n }\n}\n","/*\n * Public API Surface of ngx-lib/link\n */\nexport * from './link.module';\nexport * from './link.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {IsUrlPipe as ɵa} from './link.pipes';"],"names":["Pipe","DEFAULT_HORIZONTAL_ALIGNMENT","EventEmitter","PepTextboxField","PepCustomizationService","Component","ChangeDetectionStrategy","FormBuilder","Renderer2","ElementRef","TranslateService","PepUtilitiesService","HostBinding","Input","Output","ViewChild","pepIconSystemEdit","NgModule","CommonModule","ReactiveFormsModule","MatCommonModule","MatButtonModule","MatFormFieldModule","MatInputModule","MatIconModule","PepNgxLibModule","PepIconModule","PepFieldTitleModule","PepTextboxIconModule","PepIconRegistry"],"mappings":";;;;;;;QAKA;;QACI,6BAAS,GAAT,UAAU,KAAa;YACnB,IAAM,KAAK,GAAG,sGAAsG,CAAC;YAErH,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC5B;;;;gBARJA,SAAI,SAAC;oBACF,IAAI,EAAE,OAAO;iBAChB;;;IC0BD;;;;;;;;;;QA2LI,0BACW,EAAe,EACd,oBAA6C,EAC7C,QAAmB,EACnB,OAAmB,EACnB,SAA2B,EAC3B,gBAAqC,EACrC,SAAoB;YANrB,OAAE,GAAF,EAAE,CAAa;YACd,yBAAoB,GAApB,oBAAoB,CAAyB;YAC7C,aAAQ,GAAR,QAAQ,CAAW;YACnB,YAAO,GAAP,OAAO,CAAY;YACnB,cAAS,GAAT,SAAS,CAAkB;YAC3B,qBAAgB,GAAhB,gBAAgB,CAAqB;YACrC,cAAS,GAAT,SAAS,CAAW;YAjLH,WAAM,GAAG,EAAE,CAAC;YAEjC,SAAI,GAAG,EAAE,CAAC;YAeV,WAAM,GAAG,EAAE,CAAC;YAsBZ,oBAAe,GAAG,IAAI,CAAC;;;;;;YA2BtB,UAAK,GAAG,EAAE,CAAC;;;;;;YAOX,gBAAW,GAAG,EAAE,CAAC;;;;;;;YAQjB,SAAI,GAAwB,MAAM,CAAC;;;;;;YAOnC,cAAS,GAAG,KAAK,CAAC;;;;;;;YAQlB,aAAQ,GAAG,KAAK,CAAC;;;;;;YAOjB,aAAQ,GAAG,KAAK,CAAC;YAEjB,cAAS,GAAG,EAAE,CAAC;YACf,eAAU,GAA2BC,mCAA4B,CAAC;YAClE,YAAO,GAAG,CAAC,CAAC;;YAEZ,aAAQ,GAAG,GAAG,CAAC;YACf,aAAQ,GAAG,GAAG,CAAC;YAEhB,aAAQ,GAAG,IAAI,CAA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LA,UAAK;4BACLA,UAAK;8BACLA,UAAK;8BACLA,UAAK;+BACLA,UAAK;6BACLA,UAAK;iCACLA,UAAK;8BAQLC,WAAM;uCAGNA,WAAM;+BAGNA,WAAM;wBAGNC,cAAS,SAAC,OAAO;;;;QC1JlB,uBAAoB,eAAgC;YAAhC,oBAAe,GAAf,eAAe,CAAiB;YAChD,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,CAACC,sBAAiB,CAAC,CAAC,CAAC;SAC3D;;;;gBA3BJC,aAAQ,SAAC;oBACN,OAAO,EAAE;wBACLC,mBAAY;wBACZC,yBAAmB;;wBAEnBC,sBAAe;wBACfC,sBAAe;wBACfC,4BAAkB;wBAClBC,oBAAc;wBACdC,oBAAa;;wBAEbC,sBAAe;wBACfC,kBAAa;wBACbC,8BAAmB;wBACnBC,gCAAoB;qBACvB;oBACD,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,YAAY,EAAE;wBACV,gBAAgB;;wBAEhB,SAAS;qBACZ;oBACD,SAAS,EAAE,CAAC,SAAS,CAAC;iBACzB;;;gBAlCGC,oBAAe;;;ICbnB;;;;ICAA;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/material/core'), require('@angular/material/button'), require('@angular/material/icon'), require('@angular/material/snack-bar'), require('@pepperi-addons/ngx-lib'), require('@pepperi-addons/ngx-lib/button'), require('@pepperi-addons/ngx-lib/icon')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@pepperi-addons/ngx-lib/snack-bar', ['exports', '@angular/core', '@angular/common', '@angular/material/core', '@angular/material/button', '@angular/material/icon', '@angular/material/snack-bar', '@pepperi-addons/ngx-lib', '@pepperi-addons/ngx-lib/button', '@pepperi-addons/ngx-lib/icon'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['pepperi-addons'] = global['pepperi-addons'] || {}, global['pepperi-addons']['ngx-lib'] = global['pepperi-addons']['ngx-lib'] || {}, global['pepperi-addons']['ngx-lib']['snack-bar'] = {}), global.ng.core, global.ng.common, global.ng.material.core, global.ng.material.button, global.ng.material.icon, global.ng.material.snackBar, global['pepperi-addons']['ngx-lib'], global['pepperi-addons']['ngx-lib'].button, global['pepperi-addons']['ngx-lib'].icon));
|
|
5
|
+
}(this, (function (exports, i0, common, core, button, icon$1, i1, i2, button$1, icon) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () {
|
|
17
|
+
return e[k];
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
n['default'] = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
28
|
+
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
29
|
+
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
30
|
+
|
|
31
|
+
var PepSnackBarData = /** @class */ (function () {
|
|
32
|
+
function PepSnackBarData(options) {
|
|
33
|
+
this.title = options.title || '';
|
|
34
|
+
this.content = options.content || '';
|
|
35
|
+
}
|
|
36
|
+
return PepSnackBarData;
|
|
37
|
+
}());
|
|
38
|
+
|
|
39
|
+
var PepDefaultSnackBarComponent = /** @class */ (function () {
|
|
40
|
+
function PepDefaultSnackBarComponent(data, snackBarRef) {
|
|
41
|
+
this.data = data;
|
|
42
|
+
this.snackBarRef = snackBarRef;
|
|
43
|
+
this.closeClick = new i0.EventEmitter();
|
|
44
|
+
}
|
|
45
|
+
PepDefaultSnackBarComponent.prototype.onCloseClicked = function (event) {
|
|
46
|
+
this.snackBarRef.dismiss();
|
|
47
|
+
};
|
|
48
|
+
return PepDefaultSnackBarComponent;
|
|
49
|
+
}());
|
|
50
|
+
PepDefaultSnackBarComponent.decorators = [
|
|
51
|
+
{ type: i0.Component, args: [{
|
|
52
|
+
template: "<pep-snack-bar [title]=\"data?.title\" (closeClick)=\"onCloseClicked($event)\">\n <div pep-snack-bar-content [innerHtml]=\"data?.content | pepSafeHtml\"></div>\n</pep-snack-bar>",
|
|
53
|
+
encapsulation: i0.ViewEncapsulation.None,
|
|
54
|
+
styles: [""]
|
|
55
|
+
},] }
|
|
56
|
+
];
|
|
57
|
+
PepDefaultSnackBarComponent.ctorParameters = function () { return [
|
|
58
|
+
{ type: PepSnackBarData, decorators: [{ type: i0.Inject, args: [i1.MAT_SNACK_BAR_DATA,] }] },
|
|
59
|
+
{ type: i1.MatSnackBarRef }
|
|
60
|
+
]; };
|
|
61
|
+
PepDefaultSnackBarComponent.propDecorators = {
|
|
62
|
+
closeClick: [{ type: i0.Output }]
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
var PepSnackBarComponent = /** @class */ (function () {
|
|
66
|
+
function PepSnackBarComponent() {
|
|
67
|
+
this.closeClick = new i0.EventEmitter();
|
|
68
|
+
//
|
|
69
|
+
}
|
|
70
|
+
PepSnackBarComponent.prototype.onCloseClicked = function (event) {
|
|
71
|
+
this.closeClick.emit();
|
|
72
|
+
};
|
|
73
|
+
return PepSnackBarComponent;
|
|
74
|
+
}());
|
|
75
|
+
PepSnackBarComponent.decorators = [
|
|
76
|
+
{ type: i0.Component, args: [{
|
|
77
|
+
selector: 'pep-snack-bar',
|
|
78
|
+
template: "<div class=\"snack-bar-container\">\n <div mat-snack-bar-title class=\"snack-bar-header-container pep-border-bottom\">\n <label class=\"body-md ellipsis\">{{title}}</label>\n <pep-button sizeType=\"xs\" classNames=\"round-corners\" iconName=\"system_close\" iconPosition=\"end\" (buttonClick)=\"onCloseClicked($event)\"></pep-button>\n </div>\n <div mat-snack-bar-content>\n <ng-content select=\"[pep-snack-bar-content]\"></ng-content>\n </div>\n</div>",
|
|
79
|
+
styles: [".snack-bar-container{width:22rem;padding:1rem;padding:var(--pep-spacing-lg,1rem)}.snack-bar-container .snack-bar-header-container{display:flex;flex-direction:row;justify-content:space-between;height:2rem;margin-bottom:.5rem;margin-bottom:var(--pep-spacing-sm,.5rem)}.snack-bar-container .snack-bar-header-container ::ng-deep .round-corners{border-radius:1.5rem}.snack-bar-container .snack-bar-content{max-height:50vh;overflow:auto}", ""]
|
|
80
|
+
},] }
|
|
81
|
+
];
|
|
82
|
+
PepSnackBarComponent.ctorParameters = function () { return []; };
|
|
83
|
+
PepSnackBarComponent.propDecorators = {
|
|
84
|
+
title: [{ type: i0.Input }],
|
|
85
|
+
message: [{ type: i0.Input }],
|
|
86
|
+
closeClick: [{ type: i0.Output }]
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
var PepSnackBarService = /** @class */ (function () {
|
|
90
|
+
function PepSnackBarService(snackBar, layoutService) {
|
|
91
|
+
this.snackBar = snackBar;
|
|
92
|
+
this.layoutService = layoutService;
|
|
93
|
+
}
|
|
94
|
+
PepSnackBarService.prototype.getSnackBarConfig = function (options) {
|
|
95
|
+
if (options === void 0) { options = {}; }
|
|
96
|
+
var snackBarConfig = new i1.MatSnackBarConfig();
|
|
97
|
+
snackBarConfig.announcementMessage = options.announcementMessage;
|
|
98
|
+
snackBarConfig.direction = this.layoutService.isRtl() ? 'rtl' : 'ltr';
|
|
99
|
+
if (options.duration >= 0) {
|
|
100
|
+
snackBarConfig.duration = options.duration;
|
|
101
|
+
}
|
|
102
|
+
snackBarConfig.panelClass = ['pep-snack-bar'];
|
|
103
|
+
if (options.panelClass) {
|
|
104
|
+
snackBarConfig.panelClass.push(options.panelClass);
|
|
105
|
+
}
|
|
106
|
+
snackBarConfig.horizontalPosition = options.horizontalPosition || 'end';
|
|
107
|
+
snackBarConfig.verticalPosition = options.verticalPosition || 'bottom';
|
|
108
|
+
return snackBarConfig;
|
|
109
|
+
};
|
|
110
|
+
PepSnackBarService.prototype.openDefaultSnackBar = function (data, config) {
|
|
111
|
+
if (config === void 0) { config = null; }
|
|
112
|
+
if (!config) {
|
|
113
|
+
config = this.getSnackBarConfig();
|
|
114
|
+
}
|
|
115
|
+
config.data = data;
|
|
116
|
+
var snackBarRef = this.snackBar.openFromComponent(PepDefaultSnackBarComponent, config);
|
|
117
|
+
return snackBarRef;
|
|
118
|
+
};
|
|
119
|
+
PepSnackBarService.prototype.openSnackBarFromComponent = function (component, data, config) {
|
|
120
|
+
if (data === void 0) { data = {}; }
|
|
121
|
+
if (config === void 0) { config = null; }
|
|
122
|
+
if (!config) {
|
|
123
|
+
config = this.getSnackBarConfig();
|
|
124
|
+
}
|
|
125
|
+
config.data = data;
|
|
126
|
+
var snackBarRef = this.snackBar.openFromComponent(component, config);
|
|
127
|
+
return snackBarRef;
|
|
128
|
+
};
|
|
129
|
+
PepSnackBarService.prototype.openSnackBarFromTemplate = function (template, data, config) {
|
|
130
|
+
if (data === void 0) { data = {}; }
|
|
131
|
+
if (config === void 0) { config = null; }
|
|
132
|
+
if (!config) {
|
|
133
|
+
config = this.getSnackBarConfig();
|
|
134
|
+
}
|
|
135
|
+
config.data = data;
|
|
136
|
+
var snackBarRef = this.snackBar.openFromTemplate(template, config);
|
|
137
|
+
return snackBarRef;
|
|
138
|
+
};
|
|
139
|
+
return PepSnackBarService;
|
|
140
|
+
}());
|
|
141
|
+
PepSnackBarService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function PepSnackBarService_Factory() { return new PepSnackBarService(i0__namespace.ɵɵinject(i1__namespace.MatSnackBar), i0__namespace.ɵɵinject(i2__namespace.PepLayoutService)); }, token: PepSnackBarService, providedIn: "root" });
|
|
142
|
+
PepSnackBarService.decorators = [
|
|
143
|
+
{ type: i0.Injectable, args: [{
|
|
144
|
+
providedIn: 'root',
|
|
145
|
+
},] }
|
|
146
|
+
];
|
|
147
|
+
PepSnackBarService.ctorParameters = function () { return [
|
|
148
|
+
{ type: i1.MatSnackBar },
|
|
149
|
+
{ type: i2.PepLayoutService }
|
|
150
|
+
]; };
|
|
151
|
+
|
|
152
|
+
var PepSnackBarModule = /** @class */ (function () {
|
|
153
|
+
function PepSnackBarModule(pepIconRegistry) {
|
|
154
|
+
this.pepIconRegistry = pepIconRegistry;
|
|
155
|
+
this.pepIconRegistry.registerIcons([icon.pepIconSystemClose]);
|
|
156
|
+
}
|
|
157
|
+
return PepSnackBarModule;
|
|
158
|
+
}());
|
|
159
|
+
PepSnackBarModule.decorators = [
|
|
160
|
+
{ type: i0.NgModule, args: [{
|
|
161
|
+
imports: [
|
|
162
|
+
common.CommonModule,
|
|
163
|
+
// Material modules,
|
|
164
|
+
core.MatCommonModule,
|
|
165
|
+
button.MatButtonModule,
|
|
166
|
+
icon$1.MatIconModule,
|
|
167
|
+
i1.MatSnackBarModule,
|
|
168
|
+
// ngx-lib modules
|
|
169
|
+
i2.PepNgxLibModule,
|
|
170
|
+
button$1.PepButtonModule,
|
|
171
|
+
icon.PepIconModule,
|
|
172
|
+
],
|
|
173
|
+
exports: [PepSnackBarComponent],
|
|
174
|
+
declarations: [PepDefaultSnackBarComponent, PepSnackBarComponent],
|
|
175
|
+
entryComponents: [PepDefaultSnackBarComponent],
|
|
176
|
+
providers: [PepSnackBarService]
|
|
177
|
+
},] }
|
|
178
|
+
];
|
|
179
|
+
PepSnackBarModule.ctorParameters = function () { return [
|
|
180
|
+
{ type: icon.PepIconRegistry }
|
|
181
|
+
]; };
|
|
182
|
+
|
|
183
|
+
/*
|
|
184
|
+
* Public API Surface of ngx-lib/snack-bar
|
|
185
|
+
*/
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Generated bundle index. Do not edit.
|
|
189
|
+
*/
|
|
190
|
+
|
|
191
|
+
exports.PepSnackBarComponent = PepSnackBarComponent;
|
|
192
|
+
exports.PepSnackBarData = PepSnackBarData;
|
|
193
|
+
exports.PepSnackBarModule = PepSnackBarModule;
|
|
194
|
+
exports.PepSnackBarService = PepSnackBarService;
|
|
195
|
+
exports.ɵa = PepDefaultSnackBarComponent;
|
|
196
|
+
|
|
197
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
198
|
+
|
|
199
|
+
})));
|
|
200
|
+
//# sourceMappingURL=pepperi-addons-ngx-lib-snack-bar.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pepperi-addons-ngx-lib-snack-bar.umd.js","sources":["../../../projects/ngx-lib/snack-bar/snack-bar.model.ts","../../../projects/ngx-lib/snack-bar/default-snack-bar.component.ts","../../../projects/ngx-lib/snack-bar/snack-bar.component.ts","../../../projects/ngx-lib/snack-bar/snack-bar.service.ts","../../../projects/ngx-lib/snack-bar/snack-bar.module.ts","../../../projects/ngx-lib/snack-bar/public-api.ts","../../../projects/ngx-lib/snack-bar/pepperi-addons-ngx-lib-snack-bar.ts"],"sourcesContent":["export class PepSnackBarData {\n title: string;\n content: any;\n\n constructor(options: {\n title?: string;\n content?: any;\n }) {\n this.title = options.title || '';\n this.content = options.content || '';\n }\n}\n","import { Component, EventEmitter, Inject, Output, ViewEncapsulation } from '@angular/core';\nimport { MatSnackBarRef, MAT_SNACK_BAR_DATA } from '@angular/material/snack-bar';\nimport { PepSnackBarData } from './snack-bar.model';\n\n@Component({\n templateUrl: './default-snack-bar.component.html',\n styleUrls: ['./default-snack-bar.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class PepDefaultSnackBarComponent {\n @Output()\n closeClick: EventEmitter<void> = new EventEmitter<void>();\n \n constructor(\n @Inject(MAT_SNACK_BAR_DATA) public data: PepSnackBarData,\n public snackBarRef: MatSnackBarRef<PepDefaultSnackBarComponent>\n ) {}\n\n onCloseClicked(event): void {\n this.snackBarRef.dismiss();\n }\n\n}\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\n\n@Component({\n selector: 'pep-snack-bar',\n styleUrls: ['./snack-bar.component.scss', './snack-bar.component.theme.scss'],\n templateUrl: './snack-bar.component.html',\n})\nexport class PepSnackBarComponent {\n @Input() title: string;\n @Input() message: string;\n\n @Output()\n closeClick: EventEmitter<void> = new EventEmitter<void>();\n \n constructor() {\n //\n }\n\n onCloseClicked(event: any): void {\n this.closeClick.emit();\n }\n}\n","import { EmbeddedViewRef, Injectable, TemplateRef } from '@angular/core';\nimport { PepLayoutService } from '@pepperi-addons/ngx-lib';\nimport { ComponentType } from '@angular/cdk/portal';\nimport { PepDefaultSnackBarComponent } from './default-snack-bar.component';\nimport { MatSnackBar, MatSnackBarConfig, MatSnackBarHorizontalPosition, MatSnackBarRef, MatSnackBarVerticalPosition } from '@angular/material/snack-bar';\nimport { PepSnackBarData } from './snack-bar.model';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PepSnackBarService {\n constructor(\n private snackBar: MatSnackBar,\n private layoutService: PepLayoutService\n ) { }\n\n getSnackBarConfig(\n options: {\n announcementMessage?: string; \n duration?: number;\n panelClass?: string;\n horizontalPosition?: MatSnackBarHorizontalPosition;\n verticalPosition?: MatSnackBarVerticalPosition \n } = {}\n ): MatSnackBarConfig {\n const snackBarConfig = new MatSnackBarConfig();\n\n snackBarConfig.announcementMessage = options.announcementMessage;\n snackBarConfig.direction = this.layoutService.isRtl() ? 'rtl' : 'ltr';\n \n if (options.duration >= 0) {\n snackBarConfig.duration = options.duration;\n }\n\n snackBarConfig.panelClass = ['pep-snack-bar'];\n if (options.panelClass) {\n snackBarConfig.panelClass.push(options.panelClass);\n }\n\n snackBarConfig.horizontalPosition = options.horizontalPosition || 'end';\n snackBarConfig.verticalPosition = options.verticalPosition || 'bottom'\n\n return snackBarConfig;\n }\n\n openDefaultSnackBar(\n data: PepSnackBarData,\n config: MatSnackBarConfig = null\n ): MatSnackBarRef<PepDefaultSnackBarComponent> {\n if (!config) {\n config = this.getSnackBarConfig();\n }\n\n config.data = data;\n const snackBarRef = this.snackBar.openFromComponent(PepDefaultSnackBarComponent, config);\n return snackBarRef;\n }\n\n openSnackBarFromComponent<T>(\n component: ComponentType<T>,\n data: any = {},\n config: MatSnackBarConfig = null\n ): MatSnackBarRef<T> {\n if (!config) {\n config = this.getSnackBarConfig();\n }\n\n config.data = data;\n const snackBarRef = this.snackBar.openFromComponent(component, config);\n return snackBarRef;\n }\n\n openSnackBarFromTemplate<T>(\n template: TemplateRef<any>,\n data: any = {},\n config: MatSnackBarConfig = null\n ): MatSnackBarRef<EmbeddedViewRef<any>> {\n if (!config) {\n config = this.getSnackBarConfig();\n }\n\n config.data = data;\n const snackBarRef = this.snackBar.openFromTemplate(template, config);\n return snackBarRef;\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 { MatSnackBarModule } from '@angular/material/snack-bar';\n\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\nimport { PepButtonModule } from '@pepperi-addons/ngx-lib/button';\nimport {\n PepIconModule,\n PepIconRegistry,\n pepIconSystemClose,\n} from '@pepperi-addons/ngx-lib/icon';\n\nimport { PepDefaultSnackBarComponent } from './default-snack-bar.component';\nimport { PepSnackBarComponent } from './snack-bar.component';\nimport { PepSnackBarService } from './snack-bar.service';\n\n@NgModule({\n imports: [\n CommonModule,\n // Material modules,\n MatCommonModule,\n MatButtonModule,\n MatIconModule,\n MatSnackBarModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepButtonModule,\n PepIconModule,\n ],\n exports: [PepSnackBarComponent],\n declarations: [PepDefaultSnackBarComponent, PepSnackBarComponent],\n entryComponents: [PepDefaultSnackBarComponent],\n providers: [PepSnackBarService]\n})\nexport class PepSnackBarModule {\n constructor(private pepIconRegistry: PepIconRegistry) {\n this.pepIconRegistry.registerIcons([pepIconSystemClose]);\n }\n}\n","/*\n * Public API Surface of ngx-lib/snack-bar\n */\nexport * from './snack-bar.module';\nexport * from './snack-bar.model';\nexport * from './snack-bar.component';\nexport * from './snack-bar.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {PepDefaultSnackBarComponent as ɵa} from './default-snack-bar.component';"],"names":["EventEmitter","Component","ViewEncapsulation","Inject","MAT_SNACK_BAR_DATA","MatSnackBarRef","Output","Input","MatSnackBarConfig","Injectable","MatSnackBar","PepLayoutService","pepIconSystemClose","NgModule","CommonModule","MatCommonModule","MatButtonModule","MatIconModule","MatSnackBarModule","PepNgxLibModule","PepButtonModule","PepIconModule","PepIconRegistry"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAII,yBAAY,OAGX;YACG,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;YACjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;SACxC;8BACJ;KAAA;;;QCEG,qCACuC,IAAqB,EACjD,WAAwD;YAD5B,SAAI,GAAJ,IAAI,CAAiB;YACjD,gBAAW,GAAX,WAAW,CAA6C;YAJnE,eAAU,GAAuB,IAAIA,eAAY,EAAQ,CAAC;SAKtD;QAEJ,oDAAc,GAAd,UAAe,KAAK;YAChB,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;SAC9B;;;;gBAhBJC,YAAS,SAAC;oBACP,gMAAiD;oBAEjD,aAAa,EAAEC,oBAAiB,CAAC,IAAI;;iBACxC;;;gBANQ,eAAe,uBAYfC,SAAM,SAACC,qBAAkB;gBAbzBC,iBAAc;;;6BASlBC,SAAM;;;;QCIP;YAFA,eAAU,GAAuB,IAAIN,eAAY,EAAQ,CAAC;;SAIzD;QAED,6CAAc,GAAd,UAAe,KAAU;YACrB,IAAI,CAAC,UAAU,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C,oBAAoB,CAAC;oBAC/B,YAAY,EAAE,CAAC,2BAA2B,EAAE,oBAAoB,CAAC;oBACjE,eAAe,EAAE,CAAC,2BAA2B,CAAC;oBAC9C,SAAS,EAAE,CAAC,kBAAkB,CAAC;iBAClC;;;gBAzBGC,oBAAe;;;ICZnB;;;;ICAA;;;;;;;;;;;;;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/common/http'), require('@angular/forms'), require('rxjs'), require('rxjs/operators'), require('@ngx-translate/core'), require('@angular/platform-browser'), require('@angular/cdk/coercion'), require('ngx-translate-multi-http-loader')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@pepperi-addons/ngx-lib', ['exports', '@angular/core', '@angular/common', '@angular/common/http', '@angular/forms', 'rxjs', 'rxjs/operators', '@ngx-translate/core', '@angular/platform-browser', '@angular/cdk/coercion', 'ngx-translate-multi-http-loader'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['pepperi-addons'] = global['pepperi-addons'] || {}, global['pepperi-addons']['ngx-lib'] = {}), global.ng.core, global.ng.common, global.ng.common.http, global.ng.forms, global.rxjs, global.rxjs.operators, global.translate, global.ng.platformBrowser, global.ng.cdk.coercion, global['ngx-translate-multi-http-loader']));
|
|
5
|
-
}(this, (function (exports, i0, i1$1, i3, i3$1, rxjs, operators, i1, platformBrowser, coercion, ngxTranslateMultiHttpLoader) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/common/http'), require('@angular/forms'), require('rxjs'), require('rxjs/operators'), require('@ngx-translate/core'), require('@angular/platform-browser'), require('@angular/cdk/coercion'), require('@angular/router'), require('ngx-translate-multi-http-loader')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@pepperi-addons/ngx-lib', ['exports', '@angular/core', '@angular/common', '@angular/common/http', '@angular/forms', 'rxjs', 'rxjs/operators', '@ngx-translate/core', '@angular/platform-browser', '@angular/cdk/coercion', '@angular/router', 'ngx-translate-multi-http-loader'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['pepperi-addons'] = global['pepperi-addons'] || {}, global['pepperi-addons']['ngx-lib'] = {}), global.ng.core, global.ng.common, global.ng.common.http, global.ng.forms, global.rxjs, global.rxjs.operators, global.translate, global.ng.platformBrowser, global.ng.cdk.coercion, global.ng.router, global['ngx-translate-multi-http-loader']));
|
|
5
|
+
}(this, (function (exports, i0, i1$1, i3, i3$1, rxjs, operators, i1, platformBrowser, coercion, i6, ngxTranslateMultiHttpLoader) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
|
30
30
|
var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
|
|
31
31
|
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
32
|
+
var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
|
|
32
33
|
|
|
33
34
|
// import { ToastrService } from 'ngx-toastr';
|
|
34
35
|
var PepErrorInterceptor = /** @class */ (function () {
|
|
@@ -2605,19 +2606,28 @@
|
|
|
2605
2606
|
This service is the webapp api for addon usege.
|
|
2606
2607
|
*/
|
|
2607
2608
|
var PepAddonService = /** @class */ (function () {
|
|
2608
|
-
function PepAddonService(sessionService, httpService, loaderService, translateService, fileService) {
|
|
2609
|
+
function PepAddonService(sessionService, httpService, loaderService, translateService, fileService, route) {
|
|
2609
2610
|
this.sessionService = sessionService;
|
|
2610
2611
|
this.httpService = httpService;
|
|
2611
2612
|
this.loaderService = loaderService;
|
|
2612
2613
|
this.translateService = translateService;
|
|
2613
2614
|
this.fileService = fileService;
|
|
2615
|
+
this.route = route;
|
|
2614
2616
|
this.ADDON_ASSETS_PATH_KEY = 'AddonAssetsPath';
|
|
2615
2617
|
this.ADDONS_DICTIONARY_ASSETS_PATH_KEY = 'AddonsDictionaryAssetsPath';
|
|
2616
2618
|
this.ADDON_API_RELATIVE_PATH = '/addons/api';
|
|
2617
2619
|
this.ADDON_API_ASYNC_RELATIVE_PATH = this.ADDON_API_RELATIVE_PATH + "/async";
|
|
2618
2620
|
//
|
|
2619
2621
|
}
|
|
2622
|
+
Object.defineProperty(PepAddonService.prototype, "devServer", {
|
|
2623
|
+
get: function () {
|
|
2624
|
+
return this.route.snapshot.queryParamMap.get('devServer') === 'true';
|
|
2625
|
+
},
|
|
2626
|
+
enumerable: false,
|
|
2627
|
+
configurable: true
|
|
2628
|
+
});
|
|
2620
2629
|
PepAddonService.prototype.getAddonBaseRelativePath = function (isAsync) {
|
|
2630
|
+
if (isAsync === void 0) { isAsync = false; }
|
|
2621
2631
|
return isAsync
|
|
2622
2632
|
? this.ADDON_API_ASYNC_RELATIVE_PATH
|
|
2623
2633
|
: this.ADDON_API_RELATIVE_PATH;
|
|
@@ -2644,16 +2654,45 @@
|
|
|
2644
2654
|
return this.sessionService.setObject(this.ADDON_ASSETS_PATH_KEY, path);
|
|
2645
2655
|
}
|
|
2646
2656
|
};
|
|
2657
|
+
PepAddonService.prototype.getServerBaseUrl = function (addonUUID, fileName, isAsync, localhostPort) {
|
|
2658
|
+
if (fileName === void 0) { fileName = ''; }
|
|
2659
|
+
if (isAsync === void 0) { isAsync = false; }
|
|
2660
|
+
if (localhostPort === void 0) { localhostPort = 4500; }
|
|
2661
|
+
var fileToAdd = fileName.length > 0 ? "/" + fileName : '';
|
|
2662
|
+
// For devServer run server on localhost.
|
|
2663
|
+
if (this.devServer) {
|
|
2664
|
+
return "http://localhost:" + localhostPort + fileToAdd;
|
|
2665
|
+
}
|
|
2666
|
+
else {
|
|
2667
|
+
var baseUrl = this.sessionService.getPapiBaseUrl();
|
|
2668
|
+
return "" + baseUrl + this.getAddonBaseRelativePath(isAsync) + "/" + addonUUID + fileToAdd;
|
|
2669
|
+
}
|
|
2670
|
+
};
|
|
2647
2671
|
PepAddonService.prototype.getAddonApiCall = function (addonUUID, fileName, functionName, httpOptions, isAsync) {
|
|
2648
2672
|
if (httpOptions === void 0) { httpOptions = {}; }
|
|
2649
2673
|
if (isAsync === void 0) { isAsync = false; }
|
|
2650
|
-
return this.httpService.getPapiApiCall(
|
|
2674
|
+
// return this.httpService.getPapiApiCall(
|
|
2675
|
+
// `${this.getAddonBaseRelativePath(
|
|
2676
|
+
// isAsync
|
|
2677
|
+
// )}/${addonUUID}/${fileName}/${functionName}`,
|
|
2678
|
+
// httpOptions
|
|
2679
|
+
// );
|
|
2680
|
+
var papiBaseUrl = this.getServerBaseUrl(addonUUID, fileName, isAsync);
|
|
2681
|
+
return this.httpService.getHttpCall(papiBaseUrl + "/" + functionName, httpOptions);
|
|
2651
2682
|
};
|
|
2652
2683
|
PepAddonService.prototype.postAddonApiCall = function (addonUUID, fileName, functionName, body, httpOptions, isAsync) {
|
|
2653
2684
|
if (body === void 0) { body = {}; }
|
|
2654
2685
|
if (httpOptions === void 0) { httpOptions = {}; }
|
|
2655
2686
|
if (isAsync === void 0) { isAsync = false; }
|
|
2656
|
-
return this.httpService.postPapiApiCall(
|
|
2687
|
+
// return this.httpService.postPapiApiCall(
|
|
2688
|
+
// `${this.getAddonBaseRelativePath(
|
|
2689
|
+
// isAsync
|
|
2690
|
+
// )}/${addonUUID}/${fileName}/${functionName}`,
|
|
2691
|
+
// body,
|
|
2692
|
+
// httpOptions
|
|
2693
|
+
// );
|
|
2694
|
+
var papiBaseUrl = this.getServerBaseUrl(addonUUID, fileName, isAsync);
|
|
2695
|
+
return this.httpService.postHttpCall(papiBaseUrl + "/" + functionName, body, httpOptions);
|
|
2657
2696
|
};
|
|
2658
2697
|
// TODO: need to chek this if the loader is working.
|
|
2659
2698
|
PepAddonService.prototype.fetch = function (input, init) {
|
|
@@ -2714,7 +2753,7 @@
|
|
|
2714
2753
|
};
|
|
2715
2754
|
return PepAddonService;
|
|
2716
2755
|
}());
|
|
2717
|
-
PepAddonService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function PepAddonService_Factory() { return new PepAddonService(i0__namespace.ɵɵinject(PepSessionService), i0__namespace.ɵɵinject(PepHttpService), i0__namespace.ɵɵinject(PepLoaderService), i0__namespace.ɵɵinject(PepTranslateService), i0__namespace.ɵɵinject(PepFileService)); }, token: PepAddonService, providedIn: "root" });
|
|
2756
|
+
PepAddonService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function PepAddonService_Factory() { return new PepAddonService(i0__namespace.ɵɵinject(PepSessionService), i0__namespace.ɵɵinject(PepHttpService), i0__namespace.ɵɵinject(PepLoaderService), i0__namespace.ɵɵinject(PepTranslateService), i0__namespace.ɵɵinject(PepFileService), i0__namespace.ɵɵinject(i6__namespace.ActivatedRoute)); }, token: PepAddonService, providedIn: "root" });
|
|
2718
2757
|
PepAddonService.decorators = [
|
|
2719
2758
|
{ type: i0.Injectable, args: [{
|
|
2720
2759
|
providedIn: 'root',
|
|
@@ -2725,7 +2764,8 @@
|
|
|
2725
2764
|
{ type: PepHttpService },
|
|
2726
2765
|
{ type: PepLoaderService },
|
|
2727
2766
|
{ type: PepTranslateService },
|
|
2728
|
-
{ type: PepFileService }
|
|
2767
|
+
{ type: PepFileService },
|
|
2768
|
+
{ type: i6.ActivatedRoute }
|
|
2729
2769
|
]; };
|
|
2730
2770
|
|
|
2731
2771
|
var PepColorService = /** @class */ (function () {
|