@sd-angular/core 0.0.876 → 0.0.880

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.
Files changed (38) hide show
  1. package/assets/scss/core/toastr.scss +44 -36
  2. package/badge/sd-angular-core-badge.metadata.json +1 -1
  3. package/bundles/sd-angular-core-badge.umd.js +1 -1
  4. package/bundles/sd-angular-core-badge.umd.min.js +1 -1
  5. package/bundles/sd-angular-core-badge.umd.min.js.map +1 -1
  6. package/bundles/sd-angular-core-grid-material.umd.js +2 -2
  7. package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
  8. package/bundles/sd-angular-core-grid-material.umd.min.js +1 -1
  9. package/bundles/sd-angular-core-grid-material.umd.min.js.map +1 -1
  10. package/bundles/sd-angular-core-notify.umd.js +3 -0
  11. package/bundles/sd-angular-core-notify.umd.js.map +1 -1
  12. package/bundles/sd-angular-core-notify.umd.min.js +1 -1
  13. package/bundles/sd-angular-core-notify.umd.min.js.map +1 -1
  14. package/bundles/sd-angular-core-tab-router.umd.js +49 -28
  15. package/bundles/sd-angular-core-tab-router.umd.js.map +1 -1
  16. package/bundles/sd-angular-core-tab-router.umd.min.js +2 -2
  17. package/bundles/sd-angular-core-tab-router.umd.min.js.map +1 -1
  18. package/bundles/sd-angular-core-upload-excel.umd.js.map +1 -1
  19. package/bundles/sd-angular-core-upload-excel.umd.min.js.map +1 -1
  20. package/esm2015/badge/src/lib/badge.component.js +1 -1
  21. package/esm2015/grid-material/src/lib/grid-material.component.js +3 -3
  22. package/esm2015/notify/src/lib/notify.service.js +4 -1
  23. package/esm2015/tab-router/src/lib/components/tab-router-outlet/tab-router-outlet.component.js +18 -19
  24. package/esm2015/upload-excel/src/lib/upload-excel.component.js +1 -1
  25. package/fesm2015/sd-angular-core-badge.js +1 -1
  26. package/fesm2015/sd-angular-core-grid-material.js +2 -2
  27. package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
  28. package/fesm2015/sd-angular-core-notify.js +3 -0
  29. package/fesm2015/sd-angular-core-notify.js.map +1 -1
  30. package/fesm2015/sd-angular-core-tab-router.js +17 -18
  31. package/fesm2015/sd-angular-core-tab-router.js.map +1 -1
  32. package/fesm2015/sd-angular-core-upload-excel.js.map +1 -1
  33. package/grid-material/sd-angular-core-grid-material.metadata.json +1 -1
  34. package/package.json +1 -1
  35. package/{sd-angular-core-0.0.876.tgz → sd-angular-core-0.0.880.tgz} +0 -0
  36. package/tab-router/sd-angular-core-tab-router.metadata.json +1 -1
  37. package/tab-router/src/lib/components/tab-router-outlet/tab-router-outlet.component.d.ts +2 -3
  38. package/upload-excel/src/lib/upload-excel.component.d.ts +3 -3
@@ -89,6 +89,7 @@
89
89
  _this.toastr.success(content, title, {
90
90
  enableHtml: true,
91
91
  timeOut: delay || 3000,
92
+ closeButton: true,
92
93
  });
93
94
  },
94
95
  warning: function (message, delay, title) {
@@ -101,6 +102,7 @@
101
102
  _this.toastr.warning(content, title, {
102
103
  enableHtml: true,
103
104
  timeOut: delay || 3000,
105
+ closeButton: true,
104
106
  });
105
107
  },
106
108
  error: function (message, delay, title) {
@@ -113,6 +115,7 @@
113
115
  _this.toastr.error(content, title, {
114
116
  enableHtml: true,
115
117
  timeOut: delay || 3000,
118
+ closeButton: true,
116
119
  });
117
120
  },
118
121
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sd-angular-core-notify.umd.js","sources":["../../../../projects/sd-core/notify/src/lib/components/dialog-confirm/dialog-confirm.component.ts","../../../../projects/sd-core/notify/src/lib/notify.service.ts","../../../../projects/sd-core/notify/src/lib/notify.module.ts","../../../../projects/sd-core/notify/src/public-api.ts","../../../../projects/sd-core/notify/sd-angular-core-notify.ts"],"sourcesContent":["import { Component, Inject } from \"@angular/core\";\r\nimport { MatDialogRef, MAT_DIALOG_DATA } from \"@angular/material/dialog\";\r\n\r\nexport interface DialogData {\r\n icon?: string;\r\n title?: string;\r\n message?: string;\r\n yesTitle?: string;\r\n noTitle?: string;\r\n yesButtonColor?: string;\r\n noButtonColor?: string;\r\n input?: {\r\n placeholder?: string;\r\n minlength?: number;\r\n maxlength?: number;\r\n required?: boolean;\r\n };\r\n}\r\n\r\n@Component({\r\n selector: \"sd-dialog-confirm\",\r\n templateUrl: \"dialog-confirm.component.html\",\r\n styleUrls: [\"./dialog-confirm.component.css\"],\r\n})\r\nexport class DialogConfirmComponent {\r\n value: string;\r\n isString = false;\r\n constructor(\r\n public dialogRef: MatDialogRef<DialogConfirmComponent>,\r\n @Inject(MAT_DIALOG_DATA) public data: DialogData\r\n ) {\r\n this.isString = typeof this.data?.message === \"string\";\r\n }\r\n}\r\n","import { Injectable } from \"@angular/core\";\r\nimport { MatDialog } from \"@angular/material/dialog\";\r\nimport { DialogConfirmComponent } from \"./components/dialog-confirm/dialog-confirm.component\";\r\nimport { ToastrService } from \"ngx-toastr\";\r\nimport { SdTranslateService } from \"@sd-angular/core/translate\";\r\n\r\n@Injectable()\r\nexport class SdNotifyService {\r\n constructor(\r\n private dialog: MatDialog,\r\n private toastr: ToastrService,\r\n private translateService: SdTranslateService\r\n ) {}\r\n\r\n alert = {\r\n info: (\r\n message?: string,\r\n title?: string,\r\n yesTitle?: string,\r\n icon?: string\r\n ) => {\r\n this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n icon: icon || \"info\",\r\n title: title || this.translate(\"Notice\"),\r\n message: message || \"Done!\",\r\n yesTitle: yesTitle || this.translate(\"Ok\"),\r\n },\r\n });\r\n },\r\n success: (\r\n message?: string,\r\n title?: string,\r\n yesTitle?: string,\r\n icon?: string\r\n ) => {\r\n this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n icon: icon || \"done\",\r\n title: title || this.translate(\"Success\"),\r\n message: message || \"Done!\",\r\n yesTitle: yesTitle || this.translate(\"Ok\"),\r\n },\r\n });\r\n },\r\n warning: (\r\n message?: string,\r\n title?: string,\r\n yesTitle?: string,\r\n icon?: string\r\n ) => {\r\n this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n icon: icon || \"warning\",\r\n title: title || this.translate(\"Warning\"),\r\n message: message || \"Something went wrong!\",\r\n yesTitle: yesTitle || this.translate(\"Ok\"),\r\n },\r\n });\r\n },\r\n error: (\r\n message?: string,\r\n title?: string,\r\n yesTitle?: string,\r\n icon?: string\r\n ) => {\r\n this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n icon: icon || \"error\",\r\n title: title || this.translate(\"Error\"),\r\n message: message || \"Something went wrong!\",\r\n yesTitle: yesTitle || this.translate(\"Ok\"),\r\n },\r\n });\r\n },\r\n };\r\n\r\n notify = {\r\n success: (message?: string, delay?: number, title?: string) => {\r\n // tslint:disable-next-line: max-line-length\r\n // const style = `border-radius: 5px; margin: 0; padding: 12px; z-index: 99999; top: 5px; right: 5px; display: none; position: fixed;color: #4F8A10; background-color: #DFF2BF`;\r\n // tslint:disable-next-line: max-line-length\r\n // const html = `<div id=\"${this.notifyId}\" style=\"${style}\"><i class=\"fa fa-check\"></i> ${message || this.translate('Success')}</div>`;\r\n // this.showNotify(html, delay);\r\n const content = message || this.translate(\"Success\");\r\n this.toastr.success(content, title, {\r\n enableHtml: true,\r\n timeOut: delay || 3000,\r\n });\r\n },\r\n warning: (message?: string, delay?: number, title?: string) => {\r\n // tslint:disable-next-line: max-line-length\r\n // const style = `border-radius: 5px; margin: 0; padding: 12px; z-index: 99999; top: 5px; right: 5px; display: none; position: fixed;color: #9F6000; background-color: #FEEFB3`;\r\n // tslint:disable-next-line: max-line-length\r\n // const html = `<div id=\"${this.notifyId}\" style=\"${style}\"><i class=\"fa fa-exclamation-triangle\"></i> ${message || this.translate('Warning')}</div>`;\r\n // this.showNotify(html, delay);\r\n const content = message || this.translate(\"Warning\");\r\n this.toastr.warning(content, title, {\r\n enableHtml: true,\r\n timeOut: delay || 3000,\r\n });\r\n },\r\n error: (message?: string, delay?: number, title?: string) => {\r\n // tslint:disable-next-line: max-line-length\r\n // const style = `border-radius: 5px; margin: 0; padding: 12px; z-index: 99999; top: 5px; right: 5px; display: none; position: fixed;color: #D8000C; background-color: #FFD2D2`;\r\n // tslint:disable-next-line: max-line-length\r\n // const html = `<div id=\"${this.notifyId}\" style=\"${style}\"><i class=\"fa fa-times\"></i> ${message || this.translate('Error')}</div>`;\r\n // this.showNotify(html, delay);\r\n const content = message || this.translate(\"Error\");\r\n this.toastr.error(content, title, {\r\n enableHtml: true,\r\n timeOut: delay || 3000,\r\n });\r\n },\r\n };\r\n\r\n handle = {\r\n error: (err: any) => {\r\n if (typeof err === \"string\") {\r\n this.notify.warning(err);\r\n } else if (typeof err === \"object\") {\r\n let message =\r\n err?.error ||\r\n err?.message ||\r\n err?.ExceptionMessage ||\r\n err?.Message ||\r\n \"Unknown error\";\r\n if (typeof err.json === \"function\") {\r\n err = err.json();\r\n if (err) {\r\n message =\r\n err?.error ||\r\n err?.message ||\r\n err?.ExceptionMessage ||\r\n err?.Message ||\r\n \"Unknown error\";\r\n }\r\n }\r\n this.notify.warning(message);\r\n } else {\r\n this.notify.warning(\"Unknown error\");\r\n }\r\n },\r\n };\r\n\r\n confirm = (\r\n message: string,\r\n option: {\r\n title?: string;\r\n yesTitle?: string;\r\n noTitle?: string;\r\n yesButtonColor?: string;\r\n noButtonColor?: string;\r\n } = {}\r\n ) => {\r\n const dialogRef = this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n title: option?.title || this.translate(\"Confirm\"),\r\n message,\r\n yesTitle: option?.yesTitle || this.translate(\"Yes\"),\r\n noTitle: option?.noTitle || this.translate(\"No\"),\r\n noButtonColor: option?.noButtonColor || \"secondary\",\r\n yesButtonColor: option?.yesButtonColor || \"primary\",\r\n },\r\n });\r\n return new Promise((resolve, reject) => {\r\n dialogRef.afterClosed().subscribe((result) => {\r\n if (result) {\r\n if (result === \"ACCEPT\") {\r\n resolve(null);\r\n } else if (result === \"CANCEL\") {\r\n reject(result);\r\n } else {\r\n resolve(null);\r\n }\r\n }\r\n });\r\n });\r\n };\r\n\r\n confirmDelete = () => this.confirm(this.translate(\"Delete record(s)\"));\r\n\r\n confirmApprove = () => this.confirm(this.translate(\"Approve record(s)\"));\r\n\r\n confirmWithInput = (\r\n title: string,\r\n option: {\r\n message?: string;\r\n yesTitle?: string;\r\n noTitle?: string;\r\n required?: boolean;\r\n maxlength?: number;\r\n yesButtonColor?: string;\r\n noButtonColor?: string;\r\n } = {}\r\n ): Promise<string> => {\r\n const dialogRef = this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n title: title || this.translate(\"Confirm\"),\r\n message: option?.message,\r\n yesTitle: option?.yesTitle || this.translate(\"Yes\"),\r\n noTitle: option?.noTitle || this.translate(\"No\"),\r\n noButtonColor: option?.noButtonColor || \"secondary\",\r\n yesButtonColor: option?.yesButtonColor || \"primary\",\r\n input: {\r\n maxlength: option?.maxlength || 255,\r\n required: option?.required,\r\n },\r\n },\r\n });\r\n return new Promise((resolve, reject) => {\r\n dialogRef.afterClosed().subscribe((result) => {\r\n if (result) {\r\n if (result === \"ACCEPT\") {\r\n resolve(result);\r\n } else if (result === \"CANCEL\") {\r\n reject(result);\r\n } else {\r\n resolve(result);\r\n }\r\n }\r\n });\r\n });\r\n };\r\n\r\n private translate = (value: string): string => {\r\n return this.translateService.translate(value);\r\n };\r\n}\r\n","import { NgModule } from \"@angular/core\";\r\nimport { CommonModule } from \"@angular/common\";\r\nimport { MatDialogModule } from \"@angular/material/dialog\";\r\nimport { MatIconModule } from \"@angular/material/icon\";\r\nimport { MatButtonModule } from \"@angular/material/button\";\r\nimport { MatFormFieldModule } from \"@angular/material/form-field\";\r\nimport { MatInputModule } from \"@angular/material/input\";\r\nimport { FormsModule } from \"@angular/forms\";\r\nimport { ToastrService, ToastrModule } from \"ngx-toastr\";\r\nimport { SdButtonModule } from \"@sd-angular/core/button\";\r\n\r\nimport { SdNotifyService } from \"./notify.service\";\r\nimport { DialogConfirmComponent } from \"./components/dialog-confirm/dialog-confirm.component\";\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n MatFormFieldModule,\r\n MatInputModule,\r\n MatIconModule,\r\n MatButtonModule,\r\n MatDialogModule,\r\n ToastrModule.forRoot(),\r\n\r\n SdButtonModule,\r\n ],\r\n declarations: [DialogConfirmComponent],\r\n entryComponents: [DialogConfirmComponent],\r\n exports: [],\r\n providers: [SdNotifyService],\r\n})\r\nexport class SdNotifyModule {}\r\n","/*\r\n * Public API Surface of superdev-angular-core\r\n */\r\n\r\nexport { SdNotifyModule } from './lib/notify.module';\r\nexport * from './lib/notify.service';\r\nexport * from './lib/components/dialog-confirm/dialog-confirm.component';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["Component","MatDialogRef","Inject","MAT_DIALOG_DATA","Injectable","MatDialog","ToastrService","SdTranslateService","NgModule","CommonModule","FormsModule","MatFormFieldModule","MatInputModule","MatIconModule","MatButtonModule","MatDialogModule","ToastrModule","SdButtonModule"],"mappings":";;;;;;;QA2BE,gCACS,SAA+C,EACtB,IAAgB;;YADzC,cAAS,GAAT,SAAS,CAAsC;YACtB,SAAI,GAAJ,IAAI,CAAY;YAHlD,aAAQ,GAAG,KAAK,CAAC;YAKf,IAAI,CAAC,QAAQ,GAAG,cAAO,IAAI,CAAC,IAAI,0CAAE,OAAO,CAAA,KAAK,QAAQ,CAAC;SACxD;;;;gBAbFA,cAAS,SAAC;oBACT,QAAQ,EAAE,mBAAmB;oBAC7B,m+CAA4C;;iBAE7C;;;gBAtBQC,mBAAY;gDA4BhBC,WAAM,SAACC,sBAAe;;;;QCrBzB,yBACU,MAAiB,EACjB,MAAqB,EACrB,gBAAoC;YAH9C,iBAII;YAHM,WAAM,GAAN,MAAM,CAAW;YACjB,WAAM,GAAN,MAAM,CAAe;YACrB,qBAAgB,GAAhB,gBAAgB,CAAoB;YAG9C,UAAK,GAAG;gBACN,IAAI,EAAE,UACJ,OAAgB,EAChB,KAAc,E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O,CAAC,MAAM,CAAC,CAAC;6BACjB;yBACF;qBACF,CAAC,CAAC;iBACJ,CAAC,CAAC;aACJ,CAAC;YAEM,cAAS,GAAG,UAAC,KAAa;gBAChC,OAAO,KAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;aAC/C,CAAC;SA7NE;;;;gBANLC,eAAU;;;gBALFC,gBAAS;gBAETC,uBAAa;gBACbC,4BAAkB;;;;QC4B3B;;;;;gBAlBCC,aAAQ,SAAC;oBACR,OAAO,EAAE;wBACPC,mBAAY;wBACZC,iBAAW;wBACXC,4BAAkB;wBAClBC,oBAAc;wBACdC,kBAAa;wBACbC,sBAAe;wBACfC,sBAAe;wBACfC,sBAAY,CAAC,OAAO,EAAE;wBAEtBC,uBAAc;qBACf;oBACD,YAAY,EAAE,CAAC,sBAAsB,CAAC;oBACtC,eAAe,EAAE,CAAC,sBAAsB,CAAC;oBACzC,OAAO,EAAE,EAAE;oBACX,SAAS,EAAE,CAAC,eAAe,CAAC;iBAC7B;;;IC/BD;;;;ICAA;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"sd-angular-core-notify.umd.js","sources":["../../../../projects/sd-core/notify/src/lib/components/dialog-confirm/dialog-confirm.component.ts","../../../../projects/sd-core/notify/src/lib/notify.service.ts","../../../../projects/sd-core/notify/src/lib/notify.module.ts","../../../../projects/sd-core/notify/src/public-api.ts","../../../../projects/sd-core/notify/sd-angular-core-notify.ts"],"sourcesContent":["import { Component, Inject } from \"@angular/core\";\r\nimport { MatDialogRef, MAT_DIALOG_DATA } from \"@angular/material/dialog\";\r\n\r\nexport interface DialogData {\r\n icon?: string;\r\n title?: string;\r\n message?: string;\r\n yesTitle?: string;\r\n noTitle?: string;\r\n yesButtonColor?: string;\r\n noButtonColor?: string;\r\n input?: {\r\n placeholder?: string;\r\n minlength?: number;\r\n maxlength?: number;\r\n required?: boolean;\r\n };\r\n}\r\n\r\n@Component({\r\n selector: \"sd-dialog-confirm\",\r\n templateUrl: \"dialog-confirm.component.html\",\r\n styleUrls: [\"./dialog-confirm.component.css\"],\r\n})\r\nexport class DialogConfirmComponent {\r\n value: string;\r\n isString = false;\r\n constructor(\r\n public dialogRef: MatDialogRef<DialogConfirmComponent>,\r\n @Inject(MAT_DIALOG_DATA) public data: DialogData\r\n ) {\r\n this.isString = typeof this.data?.message === \"string\";\r\n }\r\n}\r\n","import { Injectable } from \"@angular/core\";\r\nimport { MatDialog } from \"@angular/material/dialog\";\r\nimport { DialogConfirmComponent } from \"./components/dialog-confirm/dialog-confirm.component\";\r\nimport { ToastrService } from \"ngx-toastr\";\r\nimport { SdTranslateService } from \"@sd-angular/core/translate\";\r\n\r\n@Injectable()\r\nexport class SdNotifyService {\r\n constructor(\r\n private dialog: MatDialog,\r\n private toastr: ToastrService,\r\n private translateService: SdTranslateService\r\n ) {}\r\n\r\n alert = {\r\n info: (\r\n message?: string,\r\n title?: string,\r\n yesTitle?: string,\r\n icon?: string\r\n ) => {\r\n this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n icon: icon || \"info\",\r\n title: title || this.translate(\"Notice\"),\r\n message: message || \"Done!\",\r\n yesTitle: yesTitle || this.translate(\"Ok\"),\r\n },\r\n });\r\n },\r\n success: (\r\n message?: string,\r\n title?: string,\r\n yesTitle?: string,\r\n icon?: string\r\n ) => {\r\n this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n icon: icon || \"done\",\r\n title: title || this.translate(\"Success\"),\r\n message: message || \"Done!\",\r\n yesTitle: yesTitle || this.translate(\"Ok\"),\r\n },\r\n });\r\n },\r\n warning: (\r\n message?: string,\r\n title?: string,\r\n yesTitle?: string,\r\n icon?: string\r\n ) => {\r\n this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n icon: icon || \"warning\",\r\n title: title || this.translate(\"Warning\"),\r\n message: message || \"Something went wrong!\",\r\n yesTitle: yesTitle || this.translate(\"Ok\"),\r\n },\r\n });\r\n },\r\n error: (\r\n message?: string,\r\n title?: string,\r\n yesTitle?: string,\r\n icon?: string\r\n ) => {\r\n this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n icon: icon || \"error\",\r\n title: title || this.translate(\"Error\"),\r\n message: message || \"Something went wrong!\",\r\n yesTitle: yesTitle || this.translate(\"Ok\"),\r\n },\r\n });\r\n },\r\n };\r\n\r\n notify = {\r\n success: (message?: string, delay?: number, title?: string) => {\r\n // tslint:disable-next-line: max-line-length\r\n // const style = `border-radius: 5px; margin: 0; padding: 12px; z-index: 99999; top: 5px; right: 5px; display: none; position: fixed;color: #4F8A10; background-color: #DFF2BF`;\r\n // tslint:disable-next-line: max-line-length\r\n // const html = `<div id=\"${this.notifyId}\" style=\"${style}\"><i class=\"fa fa-check\"></i> ${message || this.translate('Success')}</div>`;\r\n // this.showNotify(html, delay);\r\n const content = message || this.translate(\"Success\");\r\n this.toastr.success(content, title, {\r\n enableHtml: true,\r\n timeOut: delay || 3000,\r\n closeButton: true,\r\n });\r\n },\r\n warning: (message?: string, delay?: number, title?: string) => {\r\n // tslint:disable-next-line: max-line-length\r\n // const style = `border-radius: 5px; margin: 0; padding: 12px; z-index: 99999; top: 5px; right: 5px; display: none; position: fixed;color: #9F6000; background-color: #FEEFB3`;\r\n // tslint:disable-next-line: max-line-length\r\n // const html = `<div id=\"${this.notifyId}\" style=\"${style}\"><i class=\"fa fa-exclamation-triangle\"></i> ${message || this.translate('Warning')}</div>`;\r\n // this.showNotify(html, delay);\r\n const content = message || this.translate(\"Warning\");\r\n this.toastr.warning(content, title, {\r\n enableHtml: true,\r\n timeOut: delay || 3000,\r\n closeButton: true,\r\n });\r\n },\r\n error: (message?: string, delay?: number, title?: string) => {\r\n // tslint:disable-next-line: max-line-length\r\n // const style = `border-radius: 5px; margin: 0; padding: 12px; z-index: 99999; top: 5px; right: 5px; display: none; position: fixed;color: #D8000C; background-color: #FFD2D2`;\r\n // tslint:disable-next-line: max-line-length\r\n // const html = `<div id=\"${this.notifyId}\" style=\"${style}\"><i class=\"fa fa-times\"></i> ${message || this.translate('Error')}</div>`;\r\n // this.showNotify(html, delay);\r\n const content = message || this.translate(\"Error\");\r\n this.toastr.error(content, title, {\r\n enableHtml: true,\r\n timeOut: delay || 3000,\r\n closeButton: true,\r\n });\r\n },\r\n };\r\n\r\n handle = {\r\n error: (err: any) => {\r\n if (typeof err === \"string\") {\r\n this.notify.warning(err);\r\n } else if (typeof err === \"object\") {\r\n let message =\r\n err?.error ||\r\n err?.message ||\r\n err?.ExceptionMessage ||\r\n err?.Message ||\r\n \"Unknown error\";\r\n if (typeof err.json === \"function\") {\r\n err = err.json();\r\n if (err) {\r\n message =\r\n err?.error ||\r\n err?.message ||\r\n err?.ExceptionMessage ||\r\n err?.Message ||\r\n \"Unknown error\";\r\n }\r\n }\r\n this.notify.warning(message);\r\n } else {\r\n this.notify.warning(\"Unknown error\");\r\n }\r\n },\r\n };\r\n\r\n confirm = (\r\n message: string,\r\n option: {\r\n title?: string;\r\n yesTitle?: string;\r\n noTitle?: string;\r\n yesButtonColor?: string;\r\n noButtonColor?: string;\r\n } = {}\r\n ) => {\r\n const dialogRef = this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n title: option?.title || this.translate(\"Confirm\"),\r\n message,\r\n yesTitle: option?.yesTitle || this.translate(\"Yes\"),\r\n noTitle: option?.noTitle || this.translate(\"No\"),\r\n noButtonColor: option?.noButtonColor || \"secondary\",\r\n yesButtonColor: option?.yesButtonColor || \"primary\",\r\n },\r\n });\r\n return new Promise((resolve, reject) => {\r\n dialogRef.afterClosed().subscribe((result) => {\r\n if (result) {\r\n if (result === \"ACCEPT\") {\r\n resolve(null);\r\n } else if (result === \"CANCEL\") {\r\n reject(result);\r\n } else {\r\n resolve(null);\r\n }\r\n }\r\n });\r\n });\r\n };\r\n\r\n confirmDelete = () => this.confirm(this.translate(\"Delete record(s)\"));\r\n\r\n confirmApprove = () => this.confirm(this.translate(\"Approve record(s)\"));\r\n\r\n confirmWithInput = (\r\n title: string,\r\n option: {\r\n message?: string;\r\n yesTitle?: string;\r\n noTitle?: string;\r\n required?: boolean;\r\n maxlength?: number;\r\n yesButtonColor?: string;\r\n noButtonColor?: string;\r\n } = {}\r\n ): Promise<string> => {\r\n const dialogRef = this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n title: title || this.translate(\"Confirm\"),\r\n message: option?.message,\r\n yesTitle: option?.yesTitle || this.translate(\"Yes\"),\r\n noTitle: option?.noTitle || this.translate(\"No\"),\r\n noButtonColor: option?.noButtonColor || \"secondary\",\r\n yesButtonColor: option?.yesButtonColor || \"primary\",\r\n input: {\r\n maxlength: option?.maxlength || 255,\r\n required: option?.required,\r\n },\r\n },\r\n });\r\n return new Promise((resolve, reject) => {\r\n dialogRef.afterClosed().subscribe((result) => {\r\n if (result) {\r\n if (result === \"ACCEPT\") {\r\n resolve(result);\r\n } else if (result === \"CANCEL\") {\r\n reject(result);\r\n } else {\r\n resolve(result);\r\n }\r\n }\r\n });\r\n });\r\n };\r\n\r\n private translate = (value: string): string => {\r\n return this.translateService.translate(value);\r\n };\r\n}\r\n","import { NgModule } from \"@angular/core\";\r\nimport { CommonModule } from \"@angular/common\";\r\nimport { MatDialogModule } from \"@angular/material/dialog\";\r\nimport { MatIconModule } from \"@angular/material/icon\";\r\nimport { MatButtonModule } from \"@angular/material/button\";\r\nimport { MatFormFieldModule } from \"@angular/material/form-field\";\r\nimport { MatInputModule } from \"@angular/material/input\";\r\nimport { FormsModule } from \"@angular/forms\";\r\nimport { ToastrService, ToastrModule } from \"ngx-toastr\";\r\nimport { SdButtonModule } from \"@sd-angular/core/button\";\r\n\r\nimport { SdNotifyService } from \"./notify.service\";\r\nimport { DialogConfirmComponent } from \"./components/dialog-confirm/dialog-confirm.component\";\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n MatFormFieldModule,\r\n MatInputModule,\r\n MatIconModule,\r\n MatButtonModule,\r\n MatDialogModule,\r\n ToastrModule.forRoot(),\r\n\r\n SdButtonModule,\r\n ],\r\n declarations: [DialogConfirmComponent],\r\n entryComponents: [DialogConfirmComponent],\r\n exports: [],\r\n providers: [SdNotifyService],\r\n})\r\nexport class SdNotifyModule {}\r\n","/*\r\n * Public API Surface of superdev-angular-core\r\n */\r\n\r\nexport { SdNotifyModule } from './lib/notify.module';\r\nexport * from './lib/notify.service';\r\nexport * from './lib/components/dialog-confirm/dialog-confirm.component';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["Component","MatDialogRef","Inject","MAT_DIALOG_DATA","Injectable","MatDialog","ToastrService","SdTranslateService","NgModule","CommonModule","FormsModule","MatFormFieldModule","MatInputModule","MatIconModule","MatButtonModule","MatDialogModule","ToastrModule","SdButtonModule"],"mappings":";;;;;;;QA2BE,gCACS,SAA+C,EACtB,IAAgB;;YADzC,cAAS,GAAT,SAAS,CAAsC;YACtB,SAAI,GAAJ,IAAI,CAAY;YAHlD,aAAQ,GAAG,KAAK,CAAC;YAKf,IAAI,CAAC,QAAQ,GAAG,cAAO,IAAI,CAAC,IAAI,0CAAE,OAAO,CAAA,KAAK,QAAQ,CAAC;SACxD;;;;gBAbFA,cAAS,SAAC;oBACT,QAAQ,EAAE,mBAAmB;oBAC7B,m+CAA4C;;iBAE7C;;;gBAtBQC,mBAAY;gDA4BhBC,WAAM,SAACC,sBAAe;;;;QCrBzB,yBACU,MAAiB,EACjB,MAAqB,EACrB,gBAAoC;YAH9C,iBAII;YAHM,WAAM,GAAN,MAAM,CAAW;YACjB,WAAM,GAAN,MAAM,CAAe;YACrB,qBAAgB,GAAhB,gBAAgB,CAAoB;YAG9C,UAAK,GAAG;gBACN,IAAI,EAAE,UACJ,OAAgB,EAChB,KAAc,EACd,QAAiB,EACjB,IAAa;oBAEb,KAAI,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,EAAE;wBACvC,KAAK,EAAE,O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;6BACjB;yBACF;qBACF,CAAC,CAAC;iBACJ,CAAC,CAAC;aACJ,CAAC;YAEM,cAAS,GAAG,UAAC,KAAa;gBAChC,OAAO,KAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;aAC/C,CAAC;SAhOE;;;;gBANLC,eAAU;;;gBALFC,gBAAS;gBAETC,uBAAa;gBACbC,4BAAkB;;;;QC4B3B;;;;;gBAlBCC,aAAQ,SAAC;oBACR,OAAO,EAAE;wBACPC,mBAAY;wBACZC,iBAAW;wBACXC,4BAAkB;wBAClBC,oBAAc;wBACdC,kBAAa;wBACbC,sBAAe;wBACfC,sBAAe;wBACfC,sBAAY,CAAC,OAAO,EAAE;wBAEtBC,uBAAc;qBACf;oBACD,YAAY,EAAE,CAAC,sBAAsB,CAAC;oBACtC,eAAe,EAAE,CAAC,sBAAsB,CAAC;oBACzC,OAAO,EAAE,EAAE;oBACX,SAAS,EAAE,CAAC,eAAe,CAAC;iBAC7B;;;IC/BD;;;;ICAA;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/core"),require("@angular/common"),require("@angular/material/dialog"),require("@angular/material/icon"),require("@angular/material/button"),require("@angular/material/form-field"),require("@angular/material/input"),require("@angular/forms"),require("ngx-toastr"),require("@sd-angular/core/button"),require("@sd-angular/core/translate")):"function"==typeof define&&define.amd?define("@sd-angular/core/notify",["exports","@angular/core","@angular/common","@angular/material/dialog","@angular/material/icon","@angular/material/button","@angular/material/form-field","@angular/material/input","@angular/forms","ngx-toastr","@sd-angular/core/button","@sd-angular/core/translate"],n):n(((t="undefined"!=typeof globalThis?globalThis:t||self)["sd-angular"]=t["sd-angular"]||{},t["sd-angular"].core=t["sd-angular"].core||{},t["sd-angular"].core.notify={}),t.ng.core,t.ng.common,t.ng.material.dialog,t.ng.material.icon,t.ng.material.button,t.ng.material.formField,t.ng.material.input,t.ng.forms,t.ngxToastr,t["sd-angular"].core.button,t["sd-angular"].core.translate)}(this,(function(t,n,e,a,r,o,i,l,s,d,u,c){"use strict";var g=function(t,n){var e;this.dialogRef=t,this.data=n,this.isString=!1,this.isString="string"==typeof(null===(e=this.data)||void 0===e?void 0:e.message)};g.decorators=[{type:n.Component,args:[{selector:"sd-dialog-confirm",template:'<h1 mat-dialog-title class="">\r\n <mat-icon *ngIf="data?.icon" [ngClass]="data?.icon">\r\n {{ data?.icon }}\r\n </mat-icon>\r\n <span [innerHtml]="data?.title || \'Confirm\'"></span>\r\n</h1>\r\n<div mat-dialog-content>\r\n <div *ngIf="isString" [innerHtml]="data?.message"></div>\r\n <div *ngIf="!isString" [innerHtml]="data?.message | json"></div>\r\n <div *ngIf="data?.input">\r\n <mat-form-field appearance="outline">\r\n <textarea\r\n style="width: 100%"\r\n matInput\r\n placeholder="{{ data.input?.placeholder }}"\r\n [(ngModel)]="value"\r\n autocomplete="off"\r\n rows="5"\r\n [maxlength]="data.input?.maxlength"\r\n ></textarea>\r\n \x3c!-- <span *ngIf="data.input?.maxlength" matSuffix>{{value?.length || 0}}/{{data.input?.maxlength}}</span> --\x3e\r\n </mat-form-field>\r\n </div>\r\n</div>\r\n<div mat-dialog-actions align="end">\r\n <sd-button\r\n *ngIf="data?.noTitle"\r\n [color]="data?.noButtonColor || \'secondary\'"\r\n [mat-dialog-close]="\'CANCEL\'"\r\n [title]="data?.noTitle"\r\n size="sm"\r\n ></sd-button>\r\n <sd-button\r\n class="ml-12"\r\n *ngIf="data?.yesTitle"\r\n [mat-dialog-close]="value || \'ACCEPT\'"\r\n [color]="data?.yesButtonColor || \'primary\'"\r\n [disabled]="data.input?.required && !value"\r\n cdkFocusInitial\r\n [title]="data?.yesTitle"\r\n size="sm"\r\n ></sd-button>\r\n</div>\r\n',styles:[":host .mat-dialog-content{margin:0 -16px 16px!important}:host .mat-button{background-color:#f5f5f5}:host>>>.mat-dialog-title{align-items:center;display:flex;justify-content:flex-start}:host>>>.mat-dialog-title .mat-icon{margin-right:5px}:host{display:block;padding:12px 16px}:host>>>.mat-dialog-title .mat-icon.info{color:#2962ff}:host>>>.mat-dialog-title .mat-icon.warning{color:#ffc107}:host>>>.mat-dialog-title .mat-icon.done{color:#4caf50}:host>>>.mat-dialog-title .mat-icon.error{color:#d32f2f}"]}]}],g.ctorParameters=function(){return[{type:a.MatDialogRef},{type:void 0,decorators:[{type:n.Inject,args:[a.MAT_DIALOG_DATA]}]}]};var m=function(t,n,e){var a=this;this.dialog=t,this.toastr=n,this.translateService=e,this.alert={info:function(t,n,e,r){a.dialog.open(g,{width:"400px",data:{icon:r||"info",title:n||a.translate("Notice"),message:t||"Done!",yesTitle:e||a.translate("Ok")}})},success:function(t,n,e,r){a.dialog.open(g,{width:"400px",data:{icon:r||"done",title:n||a.translate("Success"),message:t||"Done!",yesTitle:e||a.translate("Ok")}})},warning:function(t,n,e,r){a.dialog.open(g,{width:"400px",data:{icon:r||"warning",title:n||a.translate("Warning"),message:t||"Something went wrong!",yesTitle:e||a.translate("Ok")}})},error:function(t,n,e,r){a.dialog.open(g,{width:"400px",data:{icon:r||"error",title:n||a.translate("Error"),message:t||"Something went wrong!",yesTitle:e||a.translate("Ok")}})}},this.notify={success:function(t,n,e){var r=t||a.translate("Success");a.toastr.success(r,e,{enableHtml:!0,timeOut:n||3e3})},warning:function(t,n,e){var r=t||a.translate("Warning");a.toastr.warning(r,e,{enableHtml:!0,timeOut:n||3e3})},error:function(t,n,e){var r=t||a.translate("Error");a.toastr.error(r,e,{enableHtml:!0,timeOut:n||3e3})}},this.handle={error:function(t){if("string"==typeof t)a.notify.warning(t);else if("object"==typeof t){var n=(null==t?void 0:t.error)||(null==t?void 0:t.message)||(null==t?void 0:t.ExceptionMessage)||(null==t?void 0:t.Message)||"Unknown error";"function"==typeof t.json&&(t=t.json())&&(n=(null==t?void 0:t.error)||(null==t?void 0:t.message)||(null==t?void 0:t.ExceptionMessage)||(null==t?void 0:t.Message)||"Unknown error"),a.notify.warning(n)}else a.notify.warning("Unknown error")}},this.confirm=function(t,n){void 0===n&&(n={});var e=a.dialog.open(g,{width:"400px",data:{title:(null==n?void 0:n.title)||a.translate("Confirm"),message:t,yesTitle:(null==n?void 0:n.yesTitle)||a.translate("Yes"),noTitle:(null==n?void 0:n.noTitle)||a.translate("No"),noButtonColor:(null==n?void 0:n.noButtonColor)||"secondary",yesButtonColor:(null==n?void 0:n.yesButtonColor)||"primary"}});return new Promise((function(t,n){e.afterClosed().subscribe((function(e){e&&("ACCEPT"===e?t(null):"CANCEL"===e?n(e):t(null))}))}))},this.confirmDelete=function(){return a.confirm(a.translate("Delete record(s)"))},this.confirmApprove=function(){return a.confirm(a.translate("Approve record(s)"))},this.confirmWithInput=function(t,n){void 0===n&&(n={});var e=a.dialog.open(g,{width:"400px",data:{title:t||a.translate("Confirm"),message:null==n?void 0:n.message,yesTitle:(null==n?void 0:n.yesTitle)||a.translate("Yes"),noTitle:(null==n?void 0:n.noTitle)||a.translate("No"),noButtonColor:(null==n?void 0:n.noButtonColor)||"secondary",yesButtonColor:(null==n?void 0:n.yesButtonColor)||"primary",input:{maxlength:(null==n?void 0:n.maxlength)||255,required:null==n?void 0:n.required}}});return new Promise((function(t,n){e.afterClosed().subscribe((function(e){e&&("ACCEPT"===e?t(e):"CANCEL"===e?n(e):t(e))}))}))},this.translate=function(t){return a.translateService.translate(t)}};m.decorators=[{type:n.Injectable}],m.ctorParameters=function(){return[{type:a.MatDialog},{type:d.ToastrService},{type:c.SdTranslateService}]};var f=function(){};f.decorators=[{type:n.NgModule,args:[{imports:[e.CommonModule,s.FormsModule,i.MatFormFieldModule,l.MatInputModule,r.MatIconModule,o.MatButtonModule,a.MatDialogModule,d.ToastrModule.forRoot(),u.SdButtonModule],declarations:[g],entryComponents:[g],exports:[],providers:[m]}]}],t.DialogConfirmComponent=g,t.SdNotifyModule=f,t.SdNotifyService=m,Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/core"),require("@angular/common"),require("@angular/material/dialog"),require("@angular/material/icon"),require("@angular/material/button"),require("@angular/material/form-field"),require("@angular/material/input"),require("@angular/forms"),require("ngx-toastr"),require("@sd-angular/core/button"),require("@sd-angular/core/translate")):"function"==typeof define&&define.amd?define("@sd-angular/core/notify",["exports","@angular/core","@angular/common","@angular/material/dialog","@angular/material/icon","@angular/material/button","@angular/material/form-field","@angular/material/input","@angular/forms","ngx-toastr","@sd-angular/core/button","@sd-angular/core/translate"],n):n(((t="undefined"!=typeof globalThis?globalThis:t||self)["sd-angular"]=t["sd-angular"]||{},t["sd-angular"].core=t["sd-angular"].core||{},t["sd-angular"].core.notify={}),t.ng.core,t.ng.common,t.ng.material.dialog,t.ng.material.icon,t.ng.material.button,t.ng.material.formField,t.ng.material.input,t.ng.forms,t.ngxToastr,t["sd-angular"].core.button,t["sd-angular"].core.translate)}(this,(function(t,n,e,a,o,r,i,l,s,u,d,c){"use strict";var g=function(t,n){var e;this.dialogRef=t,this.data=n,this.isString=!1,this.isString="string"==typeof(null===(e=this.data)||void 0===e?void 0:e.message)};g.decorators=[{type:n.Component,args:[{selector:"sd-dialog-confirm",template:'<h1 mat-dialog-title class="">\r\n <mat-icon *ngIf="data?.icon" [ngClass]="data?.icon">\r\n {{ data?.icon }}\r\n </mat-icon>\r\n <span [innerHtml]="data?.title || \'Confirm\'"></span>\r\n</h1>\r\n<div mat-dialog-content>\r\n <div *ngIf="isString" [innerHtml]="data?.message"></div>\r\n <div *ngIf="!isString" [innerHtml]="data?.message | json"></div>\r\n <div *ngIf="data?.input">\r\n <mat-form-field appearance="outline">\r\n <textarea\r\n style="width: 100%"\r\n matInput\r\n placeholder="{{ data.input?.placeholder }}"\r\n [(ngModel)]="value"\r\n autocomplete="off"\r\n rows="5"\r\n [maxlength]="data.input?.maxlength"\r\n ></textarea>\r\n \x3c!-- <span *ngIf="data.input?.maxlength" matSuffix>{{value?.length || 0}}/{{data.input?.maxlength}}</span> --\x3e\r\n </mat-form-field>\r\n </div>\r\n</div>\r\n<div mat-dialog-actions align="end">\r\n <sd-button\r\n *ngIf="data?.noTitle"\r\n [color]="data?.noButtonColor || \'secondary\'"\r\n [mat-dialog-close]="\'CANCEL\'"\r\n [title]="data?.noTitle"\r\n size="sm"\r\n ></sd-button>\r\n <sd-button\r\n class="ml-12"\r\n *ngIf="data?.yesTitle"\r\n [mat-dialog-close]="value || \'ACCEPT\'"\r\n [color]="data?.yesButtonColor || \'primary\'"\r\n [disabled]="data.input?.required && !value"\r\n cdkFocusInitial\r\n [title]="data?.yesTitle"\r\n size="sm"\r\n ></sd-button>\r\n</div>\r\n',styles:[":host .mat-dialog-content{margin:0 -16px 16px!important}:host .mat-button{background-color:#f5f5f5}:host>>>.mat-dialog-title{align-items:center;display:flex;justify-content:flex-start}:host>>>.mat-dialog-title .mat-icon{margin-right:5px}:host{display:block;padding:12px 16px}:host>>>.mat-dialog-title .mat-icon.info{color:#2962ff}:host>>>.mat-dialog-title .mat-icon.warning{color:#ffc107}:host>>>.mat-dialog-title .mat-icon.done{color:#4caf50}:host>>>.mat-dialog-title .mat-icon.error{color:#d32f2f}"]}]}],g.ctorParameters=function(){return[{type:a.MatDialogRef},{type:void 0,decorators:[{type:n.Inject,args:[a.MAT_DIALOG_DATA]}]}]};var m=function(t,n,e){var a=this;this.dialog=t,this.toastr=n,this.translateService=e,this.alert={info:function(t,n,e,o){a.dialog.open(g,{width:"400px",data:{icon:o||"info",title:n||a.translate("Notice"),message:t||"Done!",yesTitle:e||a.translate("Ok")}})},success:function(t,n,e,o){a.dialog.open(g,{width:"400px",data:{icon:o||"done",title:n||a.translate("Success"),message:t||"Done!",yesTitle:e||a.translate("Ok")}})},warning:function(t,n,e,o){a.dialog.open(g,{width:"400px",data:{icon:o||"warning",title:n||a.translate("Warning"),message:t||"Something went wrong!",yesTitle:e||a.translate("Ok")}})},error:function(t,n,e,o){a.dialog.open(g,{width:"400px",data:{icon:o||"error",title:n||a.translate("Error"),message:t||"Something went wrong!",yesTitle:e||a.translate("Ok")}})}},this.notify={success:function(t,n,e){var o=t||a.translate("Success");a.toastr.success(o,e,{enableHtml:!0,timeOut:n||3e3,closeButton:!0})},warning:function(t,n,e){var o=t||a.translate("Warning");a.toastr.warning(o,e,{enableHtml:!0,timeOut:n||3e3,closeButton:!0})},error:function(t,n,e){var o=t||a.translate("Error");a.toastr.error(o,e,{enableHtml:!0,timeOut:n||3e3,closeButton:!0})}},this.handle={error:function(t){if("string"==typeof t)a.notify.warning(t);else if("object"==typeof t){var n=(null==t?void 0:t.error)||(null==t?void 0:t.message)||(null==t?void 0:t.ExceptionMessage)||(null==t?void 0:t.Message)||"Unknown error";"function"==typeof t.json&&(t=t.json())&&(n=(null==t?void 0:t.error)||(null==t?void 0:t.message)||(null==t?void 0:t.ExceptionMessage)||(null==t?void 0:t.Message)||"Unknown error"),a.notify.warning(n)}else a.notify.warning("Unknown error")}},this.confirm=function(t,n){void 0===n&&(n={});var e=a.dialog.open(g,{width:"400px",data:{title:(null==n?void 0:n.title)||a.translate("Confirm"),message:t,yesTitle:(null==n?void 0:n.yesTitle)||a.translate("Yes"),noTitle:(null==n?void 0:n.noTitle)||a.translate("No"),noButtonColor:(null==n?void 0:n.noButtonColor)||"secondary",yesButtonColor:(null==n?void 0:n.yesButtonColor)||"primary"}});return new Promise((function(t,n){e.afterClosed().subscribe((function(e){e&&("ACCEPT"===e?t(null):"CANCEL"===e?n(e):t(null))}))}))},this.confirmDelete=function(){return a.confirm(a.translate("Delete record(s)"))},this.confirmApprove=function(){return a.confirm(a.translate("Approve record(s)"))},this.confirmWithInput=function(t,n){void 0===n&&(n={});var e=a.dialog.open(g,{width:"400px",data:{title:t||a.translate("Confirm"),message:null==n?void 0:n.message,yesTitle:(null==n?void 0:n.yesTitle)||a.translate("Yes"),noTitle:(null==n?void 0:n.noTitle)||a.translate("No"),noButtonColor:(null==n?void 0:n.noButtonColor)||"secondary",yesButtonColor:(null==n?void 0:n.yesButtonColor)||"primary",input:{maxlength:(null==n?void 0:n.maxlength)||255,required:null==n?void 0:n.required}}});return new Promise((function(t,n){e.afterClosed().subscribe((function(e){e&&("ACCEPT"===e?t(e):"CANCEL"===e?n(e):t(e))}))}))},this.translate=function(t){return a.translateService.translate(t)}};m.decorators=[{type:n.Injectable}],m.ctorParameters=function(){return[{type:a.MatDialog},{type:u.ToastrService},{type:c.SdTranslateService}]};var f=function(){};f.decorators=[{type:n.NgModule,args:[{imports:[e.CommonModule,s.FormsModule,i.MatFormFieldModule,l.MatInputModule,o.MatIconModule,r.MatButtonModule,a.MatDialogModule,u.ToastrModule.forRoot(),d.SdButtonModule],declarations:[g],entryComponents:[g],exports:[],providers:[m]}]}],t.DialogConfirmComponent=g,t.SdNotifyModule=f,t.SdNotifyService=m,Object.defineProperty(t,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=sd-angular-core-notify.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../projects/sd-core/notify/src/lib/components/dialog-confirm/dialog-confirm.component.ts","../../../../projects/sd-core/notify/src/lib/notify.service.ts","../../../../projects/sd-core/notify/src/lib/notify.module.ts"],"names":["dialogRef","data","this","isString","_a","message","Component","args","selector","template","MatDialogRef","Inject","MAT_DIALOG_DATA","dialog","toastr","translateService","_this","alert","info","title","yesTitle","icon","open","DialogConfirmComponent","width","translate","success","warning","error","notify","delay","content","enableHtml","timeOut","handle","err","ExceptionMessage","Message","json","confirm","option","noTitle","noButtonColor","yesButtonColor","Promise","resolve","reject","afterClosed","subscribe","result","confirmDelete","confirmApprove","confirmWithInput","input","maxlength","required","value","Injectable","MatDialog","ToastrService","SdTranslateService","NgModule","imports","CommonModule","FormsModule","MatFormFieldModule","MatInputModule","MatIconModule","MatButtonModule","MatDialogModule","ToastrModule","forRoot","SdButtonModule","declarations","entryComponents","exports","providers","SdNotifyService"],"mappings":"6rCA2BE,SACSA,EACyBC,SADzBC,KAAAF,UAAAA,EACyBE,KAAAD,KAAAA,EAHlCC,KAAAC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AuB,UAAY,SAAC+B,GACnB,OAAOxC,EAAKD,iBAAiBU,UAAU+B,yBAlO1CC,EAAAA,sDALQC,EAAAA,iBAEAC,EAAAA,qBACAC,EAAAA,4BC4BT,iCAlBCC,EAAAA,SAAQtD,KAAA,CAAC,CACRuD,QAAS,CACPC,EAAAA,aACAC,EAAAA,YACAC,EAAAA,mBACAC,EAAAA,eACAC,EAAAA,cACAC,EAAAA,gBACAC,EAAAA,gBACAC,EAAAA,aAAaC,UAEbC,EAAAA,gBAEFC,aAAc,CAAClD,GACfmD,gBAAiB,CAACnD,GAClBoD,QAAS,GACTC,UAAW,CAACC","sourcesContent":["import { Component, Inject } from \"@angular/core\";\r\nimport { MatDialogRef, MAT_DIALOG_DATA } from \"@angular/material/dialog\";\r\n\r\nexport interface DialogData {\r\n icon?: string;\r\n title?: string;\r\n message?: string;\r\n yesTitle?: string;\r\n noTitle?: string;\r\n yesButtonColor?: string;\r\n noButtonColor?: string;\r\n input?: {\r\n placeholder?: string;\r\n minlength?: number;\r\n maxlength?: number;\r\n required?: boolean;\r\n };\r\n}\r\n\r\n@Component({\r\n selector: \"sd-dialog-confirm\",\r\n templateUrl: \"dialog-confirm.component.html\",\r\n styleUrls: [\"./dialog-confirm.component.css\"],\r\n})\r\nexport class DialogConfirmComponent {\r\n value: string;\r\n isString = false;\r\n constructor(\r\n public dialogRef: MatDialogRef<DialogConfirmComponent>,\r\n @Inject(MAT_DIALOG_DATA) public data: DialogData\r\n ) {\r\n this.isString = typeof this.data?.message === \"string\";\r\n }\r\n}\r\n","import { Injectable } from \"@angular/core\";\r\nimport { MatDialog } from \"@angular/material/dialog\";\r\nimport { DialogConfirmComponent } from \"./components/dialog-confirm/dialog-confirm.component\";\r\nimport { ToastrService } from \"ngx-toastr\";\r\nimport { SdTranslateService } from \"@sd-angular/core/translate\";\r\n\r\n@Injectable()\r\nexport class SdNotifyService {\r\n constructor(\r\n private dialog: MatDialog,\r\n private toastr: ToastrService,\r\n private translateService: SdTranslateService\r\n ) {}\r\n\r\n alert = {\r\n info: (\r\n message?: string,\r\n title?: string,\r\n yesTitle?: string,\r\n icon?: string\r\n ) => {\r\n this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n icon: icon || \"info\",\r\n title: title || this.translate(\"Notice\"),\r\n message: message || \"Done!\",\r\n yesTitle: yesTitle || this.translate(\"Ok\"),\r\n },\r\n });\r\n },\r\n success: (\r\n message?: string,\r\n title?: string,\r\n yesTitle?: string,\r\n icon?: string\r\n ) => {\r\n this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n icon: icon || \"done\",\r\n title: title || this.translate(\"Success\"),\r\n message: message || \"Done!\",\r\n yesTitle: yesTitle || this.translate(\"Ok\"),\r\n },\r\n });\r\n },\r\n warning: (\r\n message?: string,\r\n title?: string,\r\n yesTitle?: string,\r\n icon?: string\r\n ) => {\r\n this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n icon: icon || \"warning\",\r\n title: title || this.translate(\"Warning\"),\r\n message: message || \"Something went wrong!\",\r\n yesTitle: yesTitle || this.translate(\"Ok\"),\r\n },\r\n });\r\n },\r\n error: (\r\n message?: string,\r\n title?: string,\r\n yesTitle?: string,\r\n icon?: string\r\n ) => {\r\n this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n icon: icon || \"error\",\r\n title: title || this.translate(\"Error\"),\r\n message: message || \"Something went wrong!\",\r\n yesTitle: yesTitle || this.translate(\"Ok\"),\r\n },\r\n });\r\n },\r\n };\r\n\r\n notify = {\r\n success: (message?: string, delay?: number, title?: string) => {\r\n // tslint:disable-next-line: max-line-length\r\n // const style = `border-radius: 5px; margin: 0; padding: 12px; z-index: 99999; top: 5px; right: 5px; display: none; position: fixed;color: #4F8A10; background-color: #DFF2BF`;\r\n // tslint:disable-next-line: max-line-length\r\n // const html = `<div id=\"${this.notifyId}\" style=\"${style}\"><i class=\"fa fa-check\"></i> ${message || this.translate('Success')}</div>`;\r\n // this.showNotify(html, delay);\r\n const content = message || this.translate(\"Success\");\r\n this.toastr.success(content, title, {\r\n enableHtml: true,\r\n timeOut: delay || 3000,\r\n });\r\n },\r\n warning: (message?: string, delay?: number, title?: string) => {\r\n // tslint:disable-next-line: max-line-length\r\n // const style = `border-radius: 5px; margin: 0; padding: 12px; z-index: 99999; top: 5px; right: 5px; display: none; position: fixed;color: #9F6000; background-color: #FEEFB3`;\r\n // tslint:disable-next-line: max-line-length\r\n // const html = `<div id=\"${this.notifyId}\" style=\"${style}\"><i class=\"fa fa-exclamation-triangle\"></i> ${message || this.translate('Warning')}</div>`;\r\n // this.showNotify(html, delay);\r\n const content = message || this.translate(\"Warning\");\r\n this.toastr.warning(content, title, {\r\n enableHtml: true,\r\n timeOut: delay || 3000,\r\n });\r\n },\r\n error: (message?: string, delay?: number, title?: string) => {\r\n // tslint:disable-next-line: max-line-length\r\n // const style = `border-radius: 5px; margin: 0; padding: 12px; z-index: 99999; top: 5px; right: 5px; display: none; position: fixed;color: #D8000C; background-color: #FFD2D2`;\r\n // tslint:disable-next-line: max-line-length\r\n // const html = `<div id=\"${this.notifyId}\" style=\"${style}\"><i class=\"fa fa-times\"></i> ${message || this.translate('Error')}</div>`;\r\n // this.showNotify(html, delay);\r\n const content = message || this.translate(\"Error\");\r\n this.toastr.error(content, title, {\r\n enableHtml: true,\r\n timeOut: delay || 3000,\r\n });\r\n },\r\n };\r\n\r\n handle = {\r\n error: (err: any) => {\r\n if (typeof err === \"string\") {\r\n this.notify.warning(err);\r\n } else if (typeof err === \"object\") {\r\n let message =\r\n err?.error ||\r\n err?.message ||\r\n err?.ExceptionMessage ||\r\n err?.Message ||\r\n \"Unknown error\";\r\n if (typeof err.json === \"function\") {\r\n err = err.json();\r\n if (err) {\r\n message =\r\n err?.error ||\r\n err?.message ||\r\n err?.ExceptionMessage ||\r\n err?.Message ||\r\n \"Unknown error\";\r\n }\r\n }\r\n this.notify.warning(message);\r\n } else {\r\n this.notify.warning(\"Unknown error\");\r\n }\r\n },\r\n };\r\n\r\n confirm = (\r\n message: string,\r\n option: {\r\n title?: string;\r\n yesTitle?: string;\r\n noTitle?: string;\r\n yesButtonColor?: string;\r\n noButtonColor?: string;\r\n } = {}\r\n ) => {\r\n const dialogRef = this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n title: option?.title || this.translate(\"Confirm\"),\r\n message,\r\n yesTitle: option?.yesTitle || this.translate(\"Yes\"),\r\n noTitle: option?.noTitle || this.translate(\"No\"),\r\n noButtonColor: option?.noButtonColor || \"secondary\",\r\n yesButtonColor: option?.yesButtonColor || \"primary\",\r\n },\r\n });\r\n return new Promise((resolve, reject) => {\r\n dialogRef.afterClosed().subscribe((result) => {\r\n if (result) {\r\n if (result === \"ACCEPT\") {\r\n resolve(null);\r\n } else if (result === \"CANCEL\") {\r\n reject(result);\r\n } else {\r\n resolve(null);\r\n }\r\n }\r\n });\r\n });\r\n };\r\n\r\n confirmDelete = () => this.confirm(this.translate(\"Delete record(s)\"));\r\n\r\n confirmApprove = () => this.confirm(this.translate(\"Approve record(s)\"));\r\n\r\n confirmWithInput = (\r\n title: string,\r\n option: {\r\n message?: string;\r\n yesTitle?: string;\r\n noTitle?: string;\r\n required?: boolean;\r\n maxlength?: number;\r\n yesButtonColor?: string;\r\n noButtonColor?: string;\r\n } = {}\r\n ): Promise<string> => {\r\n const dialogRef = this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n title: title || this.translate(\"Confirm\"),\r\n message: option?.message,\r\n yesTitle: option?.yesTitle || this.translate(\"Yes\"),\r\n noTitle: option?.noTitle || this.translate(\"No\"),\r\n noButtonColor: option?.noButtonColor || \"secondary\",\r\n yesButtonColor: option?.yesButtonColor || \"primary\",\r\n input: {\r\n maxlength: option?.maxlength || 255,\r\n required: option?.required,\r\n },\r\n },\r\n });\r\n return new Promise((resolve, reject) => {\r\n dialogRef.afterClosed().subscribe((result) => {\r\n if (result) {\r\n if (result === \"ACCEPT\") {\r\n resolve(result);\r\n } else if (result === \"CANCEL\") {\r\n reject(result);\r\n } else {\r\n resolve(result);\r\n }\r\n }\r\n });\r\n });\r\n };\r\n\r\n private translate = (value: string): string => {\r\n return this.translateService.translate(value);\r\n };\r\n}\r\n","import { NgModule } from \"@angular/core\";\r\nimport { CommonModule } from \"@angular/common\";\r\nimport { MatDialogModule } from \"@angular/material/dialog\";\r\nimport { MatIconModule } from \"@angular/material/icon\";\r\nimport { MatButtonModule } from \"@angular/material/button\";\r\nimport { MatFormFieldModule } from \"@angular/material/form-field\";\r\nimport { MatInputModule } from \"@angular/material/input\";\r\nimport { FormsModule } from \"@angular/forms\";\r\nimport { ToastrService, ToastrModule } from \"ngx-toastr\";\r\nimport { SdButtonModule } from \"@sd-angular/core/button\";\r\n\r\nimport { SdNotifyService } from \"./notify.service\";\r\nimport { DialogConfirmComponent } from \"./components/dialog-confirm/dialog-confirm.component\";\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n MatFormFieldModule,\r\n MatInputModule,\r\n MatIconModule,\r\n MatButtonModule,\r\n MatDialogModule,\r\n ToastrModule.forRoot(),\r\n\r\n SdButtonModule,\r\n ],\r\n declarations: [DialogConfirmComponent],\r\n entryComponents: [DialogConfirmComponent],\r\n exports: [],\r\n providers: [SdNotifyService],\r\n})\r\nexport class SdNotifyModule {}\r\n"]}
1
+ {"version":3,"sources":["../../../../projects/sd-core/notify/src/lib/components/dialog-confirm/dialog-confirm.component.ts","../../../../projects/sd-core/notify/src/lib/notify.service.ts","../../../../projects/sd-core/notify/src/lib/notify.module.ts"],"names":["dialogRef","data","this","isString","_a","message","Component","args","selector","template","MatDialogRef","Inject","MAT_DIALOG_DATA","dialog","toastr","translateService","_this","alert","info","title","yesTitle","icon","open","DialogConfirmComponent","width","translate","success","warning","error","notify","delay","content","enableHtml","timeOut","closeButton","handle","err","ExceptionMessage","Message","json","confirm","option","noTitle","noButtonColor","yesButtonColor","Promise","resolve","reject","afterClosed","subscribe","result","confirmDelete","confirmApprove","confirmWithInput","input","maxlength","required","value","Injectable","MatDialog","ToastrService","SdTranslateService","NgModule","imports","CommonModule","FormsModule","MatFormFieldModule","MatInputModule","MatIconModule","MatButtonModule","MatDialogModule","ToastrModule","forRoot","SdButtonModule","declarations","entryComponents","exports","providers","SdNotifyService"],"mappings":"6rCA2BE,SACSA,EACyBC,SADzBC,KAAAF,UAAAA,EACyBE,KAAAD,KAAAA,EAHlCC,KAAAC,UAAW,EAKTD,KAAKC,SAAyC,iBAAd,QAAhBC,EAAOF,KAAKD,YAAI,IAAAG,OAAA,EAAAA,EAAEC,8BAZrCC,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,oBACVC,SAAA,09DApBOC,EAAAA,6CA4BJC,EAAAA,OAAMJ,KAAA,CAACK,EAAAA,4BCrBV,SACUC,EACAC,EACAC,GAHV,IAAAC,EAAAd,KACUA,KAAAW,OAAAA,EACAX,KAAAY,OAAAA,EACAZ,KAAAa,iBAAAA,EAGVb,KAAAe,MAAQ,CACNC,KAAM,SACJb,EACAc,EACAC,EACAC,GAEAL,EAAKH,OAAOS,KAAKC,EAAwB,CACvCC,MAAO,QACPvB,KAAM,CACJoB,KAAMA,GAAQ,OACdF,MAAOA,GAASH,EAAKS,UAAU,UAC/BpB,QAASA,GAAW,QACpBe,SAAUA,GAAYJ,EAAKS,UAAU,UAI3CC,QAAS,SACPrB,EACAc,EACAC,EACAC,GAEAL,EAAKH,OAAOS,KAAKC,EAAwB,CACvCC,MAAO,QACPvB,KAAM,CACJoB,KAAMA,GAAQ,OACdF,MAAOA,GAASH,EAAKS,UAAU,WAC/BpB,QAASA,GAAW,QACpBe,SAAUA,GAAYJ,EAAKS,UAAU,UAI3CE,QAAS,SACPtB,EACAc,EACAC,EACAC,GAEAL,EAAKH,OAAOS,KAAKC,EAAwB,CACvCC,MAAO,QACPvB,KAAM,CACJoB,KAAMA,GAAQ,UACdF,MAAOA,GAASH,EAAK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F,MAAAA,OAAM,EAANA,EAAQE,gBAAiB,YACxCC,gBAAgBH,MAAAA,OAAM,EAANA,EAAQG,iBAAkB,UAC1CU,MAAO,CACLC,WAAWd,MAAAA,OAAM,EAANA,EAAQc,YAAa,IAChCC,SAAUf,MAAAA,OAAM,EAANA,EAAQe,aAIxB,OAAO,IAAIX,SAAQ,SAACC,EAASC,GAC3B/C,EAAUgD,cAAcC,WAAU,SAACC,GAC7BA,IACa,WAAXA,EACFJ,EAAQI,GACY,WAAXA,EACTH,EAAOG,GAEPJ,EAAQI,WAOVhD,KAAAuB,UAAY,SAACgC,GACnB,OAAOzC,EAAKD,iBAAiBU,UAAUgC,yBArO1CC,EAAAA,sDALQC,EAAAA,iBAEAC,EAAAA,qBACAC,EAAAA,4BC4BT,iCAlBCC,EAAAA,SAAQvD,KAAA,CAAC,CACRwD,QAAS,CACPC,EAAAA,aACAC,EAAAA,YACAC,EAAAA,mBACAC,EAAAA,eACAC,EAAAA,cACAC,EAAAA,gBACAC,EAAAA,gBACAC,EAAAA,aAAaC,UAEbC,EAAAA,gBAEFC,aAAc,CAACnD,GACfoD,gBAAiB,CAACpD,GAClBqD,QAAS,GACTC,UAAW,CAACC","sourcesContent":["import { Component, Inject } from \"@angular/core\";\r\nimport { MatDialogRef, MAT_DIALOG_DATA } from \"@angular/material/dialog\";\r\n\r\nexport interface DialogData {\r\n icon?: string;\r\n title?: string;\r\n message?: string;\r\n yesTitle?: string;\r\n noTitle?: string;\r\n yesButtonColor?: string;\r\n noButtonColor?: string;\r\n input?: {\r\n placeholder?: string;\r\n minlength?: number;\r\n maxlength?: number;\r\n required?: boolean;\r\n };\r\n}\r\n\r\n@Component({\r\n selector: \"sd-dialog-confirm\",\r\n templateUrl: \"dialog-confirm.component.html\",\r\n styleUrls: [\"./dialog-confirm.component.css\"],\r\n})\r\nexport class DialogConfirmComponent {\r\n value: string;\r\n isString = false;\r\n constructor(\r\n public dialogRef: MatDialogRef<DialogConfirmComponent>,\r\n @Inject(MAT_DIALOG_DATA) public data: DialogData\r\n ) {\r\n this.isString = typeof this.data?.message === \"string\";\r\n }\r\n}\r\n","import { Injectable } from \"@angular/core\";\r\nimport { MatDialog } from \"@angular/material/dialog\";\r\nimport { DialogConfirmComponent } from \"./components/dialog-confirm/dialog-confirm.component\";\r\nimport { ToastrService } from \"ngx-toastr\";\r\nimport { SdTranslateService } from \"@sd-angular/core/translate\";\r\n\r\n@Injectable()\r\nexport class SdNotifyService {\r\n constructor(\r\n private dialog: MatDialog,\r\n private toastr: ToastrService,\r\n private translateService: SdTranslateService\r\n ) {}\r\n\r\n alert = {\r\n info: (\r\n message?: string,\r\n title?: string,\r\n yesTitle?: string,\r\n icon?: string\r\n ) => {\r\n this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n icon: icon || \"info\",\r\n title: title || this.translate(\"Notice\"),\r\n message: message || \"Done!\",\r\n yesTitle: yesTitle || this.translate(\"Ok\"),\r\n },\r\n });\r\n },\r\n success: (\r\n message?: string,\r\n title?: string,\r\n yesTitle?: string,\r\n icon?: string\r\n ) => {\r\n this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n icon: icon || \"done\",\r\n title: title || this.translate(\"Success\"),\r\n message: message || \"Done!\",\r\n yesTitle: yesTitle || this.translate(\"Ok\"),\r\n },\r\n });\r\n },\r\n warning: (\r\n message?: string,\r\n title?: string,\r\n yesTitle?: string,\r\n icon?: string\r\n ) => {\r\n this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n icon: icon || \"warning\",\r\n title: title || this.translate(\"Warning\"),\r\n message: message || \"Something went wrong!\",\r\n yesTitle: yesTitle || this.translate(\"Ok\"),\r\n },\r\n });\r\n },\r\n error: (\r\n message?: string,\r\n title?: string,\r\n yesTitle?: string,\r\n icon?: string\r\n ) => {\r\n this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n icon: icon || \"error\",\r\n title: title || this.translate(\"Error\"),\r\n message: message || \"Something went wrong!\",\r\n yesTitle: yesTitle || this.translate(\"Ok\"),\r\n },\r\n });\r\n },\r\n };\r\n\r\n notify = {\r\n success: (message?: string, delay?: number, title?: string) => {\r\n // tslint:disable-next-line: max-line-length\r\n // const style = `border-radius: 5px; margin: 0; padding: 12px; z-index: 99999; top: 5px; right: 5px; display: none; position: fixed;color: #4F8A10; background-color: #DFF2BF`;\r\n // tslint:disable-next-line: max-line-length\r\n // const html = `<div id=\"${this.notifyId}\" style=\"${style}\"><i class=\"fa fa-check\"></i> ${message || this.translate('Success')}</div>`;\r\n // this.showNotify(html, delay);\r\n const content = message || this.translate(\"Success\");\r\n this.toastr.success(content, title, {\r\n enableHtml: true,\r\n timeOut: delay || 3000,\r\n closeButton: true,\r\n });\r\n },\r\n warning: (message?: string, delay?: number, title?: string) => {\r\n // tslint:disable-next-line: max-line-length\r\n // const style = `border-radius: 5px; margin: 0; padding: 12px; z-index: 99999; top: 5px; right: 5px; display: none; position: fixed;color: #9F6000; background-color: #FEEFB3`;\r\n // tslint:disable-next-line: max-line-length\r\n // const html = `<div id=\"${this.notifyId}\" style=\"${style}\"><i class=\"fa fa-exclamation-triangle\"></i> ${message || this.translate('Warning')}</div>`;\r\n // this.showNotify(html, delay);\r\n const content = message || this.translate(\"Warning\");\r\n this.toastr.warning(content, title, {\r\n enableHtml: true,\r\n timeOut: delay || 3000,\r\n closeButton: true,\r\n });\r\n },\r\n error: (message?: string, delay?: number, title?: string) => {\r\n // tslint:disable-next-line: max-line-length\r\n // const style = `border-radius: 5px; margin: 0; padding: 12px; z-index: 99999; top: 5px; right: 5px; display: none; position: fixed;color: #D8000C; background-color: #FFD2D2`;\r\n // tslint:disable-next-line: max-line-length\r\n // const html = `<div id=\"${this.notifyId}\" style=\"${style}\"><i class=\"fa fa-times\"></i> ${message || this.translate('Error')}</div>`;\r\n // this.showNotify(html, delay);\r\n const content = message || this.translate(\"Error\");\r\n this.toastr.error(content, title, {\r\n enableHtml: true,\r\n timeOut: delay || 3000,\r\n closeButton: true,\r\n });\r\n },\r\n };\r\n\r\n handle = {\r\n error: (err: any) => {\r\n if (typeof err === \"string\") {\r\n this.notify.warning(err);\r\n } else if (typeof err === \"object\") {\r\n let message =\r\n err?.error ||\r\n err?.message ||\r\n err?.ExceptionMessage ||\r\n err?.Message ||\r\n \"Unknown error\";\r\n if (typeof err.json === \"function\") {\r\n err = err.json();\r\n if (err) {\r\n message =\r\n err?.error ||\r\n err?.message ||\r\n err?.ExceptionMessage ||\r\n err?.Message ||\r\n \"Unknown error\";\r\n }\r\n }\r\n this.notify.warning(message);\r\n } else {\r\n this.notify.warning(\"Unknown error\");\r\n }\r\n },\r\n };\r\n\r\n confirm = (\r\n message: string,\r\n option: {\r\n title?: string;\r\n yesTitle?: string;\r\n noTitle?: string;\r\n yesButtonColor?: string;\r\n noButtonColor?: string;\r\n } = {}\r\n ) => {\r\n const dialogRef = this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n title: option?.title || this.translate(\"Confirm\"),\r\n message,\r\n yesTitle: option?.yesTitle || this.translate(\"Yes\"),\r\n noTitle: option?.noTitle || this.translate(\"No\"),\r\n noButtonColor: option?.noButtonColor || \"secondary\",\r\n yesButtonColor: option?.yesButtonColor || \"primary\",\r\n },\r\n });\r\n return new Promise((resolve, reject) => {\r\n dialogRef.afterClosed().subscribe((result) => {\r\n if (result) {\r\n if (result === \"ACCEPT\") {\r\n resolve(null);\r\n } else if (result === \"CANCEL\") {\r\n reject(result);\r\n } else {\r\n resolve(null);\r\n }\r\n }\r\n });\r\n });\r\n };\r\n\r\n confirmDelete = () => this.confirm(this.translate(\"Delete record(s)\"));\r\n\r\n confirmApprove = () => this.confirm(this.translate(\"Approve record(s)\"));\r\n\r\n confirmWithInput = (\r\n title: string,\r\n option: {\r\n message?: string;\r\n yesTitle?: string;\r\n noTitle?: string;\r\n required?: boolean;\r\n maxlength?: number;\r\n yesButtonColor?: string;\r\n noButtonColor?: string;\r\n } = {}\r\n ): Promise<string> => {\r\n const dialogRef = this.dialog.open(DialogConfirmComponent, {\r\n width: \"400px\",\r\n data: {\r\n title: title || this.translate(\"Confirm\"),\r\n message: option?.message,\r\n yesTitle: option?.yesTitle || this.translate(\"Yes\"),\r\n noTitle: option?.noTitle || this.translate(\"No\"),\r\n noButtonColor: option?.noButtonColor || \"secondary\",\r\n yesButtonColor: option?.yesButtonColor || \"primary\",\r\n input: {\r\n maxlength: option?.maxlength || 255,\r\n required: option?.required,\r\n },\r\n },\r\n });\r\n return new Promise((resolve, reject) => {\r\n dialogRef.afterClosed().subscribe((result) => {\r\n if (result) {\r\n if (result === \"ACCEPT\") {\r\n resolve(result);\r\n } else if (result === \"CANCEL\") {\r\n reject(result);\r\n } else {\r\n resolve(result);\r\n }\r\n }\r\n });\r\n });\r\n };\r\n\r\n private translate = (value: string): string => {\r\n return this.translateService.translate(value);\r\n };\r\n}\r\n","import { NgModule } from \"@angular/core\";\r\nimport { CommonModule } from \"@angular/common\";\r\nimport { MatDialogModule } from \"@angular/material/dialog\";\r\nimport { MatIconModule } from \"@angular/material/icon\";\r\nimport { MatButtonModule } from \"@angular/material/button\";\r\nimport { MatFormFieldModule } from \"@angular/material/form-field\";\r\nimport { MatInputModule } from \"@angular/material/input\";\r\nimport { FormsModule } from \"@angular/forms\";\r\nimport { ToastrService, ToastrModule } from \"ngx-toastr\";\r\nimport { SdButtonModule } from \"@sd-angular/core/button\";\r\n\r\nimport { SdNotifyService } from \"./notify.service\";\r\nimport { DialogConfirmComponent } from \"./components/dialog-confirm/dialog-confirm.component\";\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n MatFormFieldModule,\r\n MatInputModule,\r\n MatIconModule,\r\n MatButtonModule,\r\n MatDialogModule,\r\n ToastrModule.forRoot(),\r\n\r\n SdButtonModule,\r\n ],\r\n declarations: [DialogConfirmComponent],\r\n entryComponents: [DialogConfirmComponent],\r\n exports: [],\r\n providers: [SdNotifyService],\r\n})\r\nexport class SdNotifyModule {}\r\n"]}
@@ -1,8 +1,31 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs/operators'), require('@angular/core'), require('rxjs'), require('@sd-angular/core/notify'), require('@angular/router'), require('@angular/common'), require('@angular/material/icon'), require('@angular/material/tooltip')) :
3
- typeof define === 'function' && define.amd ? define('@sd-angular/core/tab-router', ['exports', 'rxjs/operators', '@angular/core', 'rxjs', '@sd-angular/core/notify', '@angular/router', '@angular/common', '@angular/material/icon', '@angular/material/tooltip'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['sd-angular'] = global['sd-angular'] || {}, global['sd-angular'].core = global['sd-angular'].core || {}, global['sd-angular'].core['tab-router'] = {}), global.rxjs.operators, global.ng.core, global.rxjs, global['sd-angular'].core.notify, global.ng.router, global.ng.common, global.ng.material.icon, global.ng.material.tooltip));
5
- }(this, (function (exports, operators, i0, rxjs, i1, router, common, icon, tooltip) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs/operators'), require('@angular/core'), require('rxjs'), require('@sd-angular/core/notify'), require('@angular/router'), require('object-hash'), require('@angular/common'), require('@angular/material/icon'), require('@angular/material/tooltip')) :
3
+ typeof define === 'function' && define.amd ? define('@sd-angular/core/tab-router', ['exports', 'rxjs/operators', '@angular/core', 'rxjs', '@sd-angular/core/notify', '@angular/router', 'object-hash', '@angular/common', '@angular/material/icon', '@angular/material/tooltip'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['sd-angular'] = global['sd-angular'] || {}, global['sd-angular'].core = global['sd-angular'].core || {}, global['sd-angular'].core['tab-router'] = {}), global.rxjs.operators, global.ng.core, global.rxjs, global['sd-angular'].core.notify, global.ng.router, global.hash, global.ng.common, global.ng.material.icon, global.ng.material.tooltip));
5
+ }(this, (function (exports, operators, i0, rxjs, i1, router, hash, common, icon, tooltip) { 'use strict';
6
+
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) { return e; } else {
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
+
28
+ var hash__namespace = /*#__PURE__*/_interopNamespace(hash);
6
29
 
7
30
  /*! *****************************************************************************
8
31
  Copyright (c) Microsoft Corporation.
@@ -523,14 +546,13 @@
523
546
 
524
547
  var _rootRoute, _subscription, _firstLoad, _closeTab, _activeRoute, _getActivatedRouteSnapshot, _getActivatedRoute;
525
548
  var SdTabRouterOutletComponent = /** @class */ (function () {
526
- function SdTabRouterOutletComponent(router$1, activatedRoute, cd, injector, compiler, parentContexts, tabDecoratorService, tabRouterService, sdNotifyService) {
549
+ function SdTabRouterOutletComponent(router$1, activatedRoute, cd, injector, compiler, tabDecoratorService, tabRouterService, sdNotifyService) {
527
550
  var _this = this;
528
551
  this.router = router$1;
529
552
  this.activatedRoute = activatedRoute;
530
553
  this.cd = cd;
531
554
  this.injector = injector;
532
555
  this.compiler = compiler;
533
- this.parentContexts = parentContexts;
534
556
  this.tabDecoratorService = tabDecoratorService;
535
557
  this.tabRouterService = tabRouterService;
536
558
  this.sdNotifyService = sdNotifyService;
@@ -566,11 +588,11 @@
566
588
  _this.cd.markForCheck();
567
589
  }
568
590
  });
569
- _activeRoute.set(this, function (url, route) { return __awaiter(_this, void 0, void 0, function () {
570
- var _a, _b, _c, _d, _e, _f, _g, component, queryParams, params, existedIndex, currentNavigation, existedTab, module, factory, injector_1, activatedRoute_1, tab;
591
+ _activeRoute.set(this, function (fullUrl, route) { return __awaiter(_this, void 0, void 0, function () {
592
+ var _a, _b, _c, _d, _e, _f, _g, component, queryParams, params, key, _h, url, existedIndex, currentNavigation, existedTab, module, factory, injector_1, activatedRoute_1, tab;
571
593
  var _this = this;
572
- return __generator(this, function (_h) {
573
- switch (_h.label) {
594
+ return __generator(this, function (_j) {
595
+ switch (_j.label) {
574
596
  case 0:
575
597
  if (!(route === null || route === void 0 ? void 0 : route.component)) {
576
598
  return [2 /*return*/];
@@ -578,9 +600,11 @@
578
600
  component = route.component;
579
601
  queryParams = Object.assign({}, (route.queryParams || {}));
580
602
  params = Object.assign({}, (route.params || {}));
603
+ key = hash__namespace({ url: fullUrl });
604
+ _h = __read(fullUrl.split('?'), 1), url = _h[0];
581
605
  existedIndex = -1;
582
606
  this.tabs.forEach(function (tab, index) {
583
- if (tab.key === url) {
607
+ if (tab.key === key) {
584
608
  tab.isActive = true;
585
609
  existedIndex = index;
586
610
  }
@@ -601,14 +625,14 @@
601
625
  if (!(typeof ((_d = (_c = route === null || route === void 0 ? void 0 : route.parent) === null || _c === void 0 ? void 0 : _c.routeConfig) === null || _d === void 0 ? void 0 : _d.loadChildren) === 'function')) return [3 /*break*/, 4];
602
626
  return [4 /*yield*/, route.parent.routeConfig.loadChildren()];
603
627
  case 2:
604
- module = _h.sent();
628
+ module = _j.sent();
605
629
  return [4 /*yield*/, this.compiler.compileModuleAsync(module)];
606
630
  case 3:
607
- factory = _h.sent();
631
+ factory = _j.sent();
608
632
  injector_1 = factory.create(this.injector);
609
633
  activatedRoute_1 = __classPrivateFieldGet(this, _getActivatedRoute).call(this, __classPrivateFieldGet(this, _rootRoute), component);
610
634
  tab = {
611
- key: url,
635
+ key: key,
612
636
  component: component,
613
637
  injector: new SdOutletInjector(activatedRoute_1, injector_1),
614
638
  isActive: true,
@@ -624,7 +648,7 @@
624
648
  else {
625
649
  this.tabs.push(tab);
626
650
  }
627
- _h.label = 4;
651
+ _j.label = 4;
628
652
  case 4:
629
653
  (_g = this.tabRouterNav) === null || _g === void 0 ? void 0 : _g.checkUI();
630
654
  if (this.tabs.length > 10) {
@@ -633,7 +657,7 @@
633
657
  if (this.tabs.length > 12) {
634
658
  this.tabs.splice(0, this.tabs.length - 10);
635
659
  }
636
- _h.label = 5;
660
+ _j.label = 5;
637
661
  case 5:
638
662
  this.cd.markForCheck();
639
663
  return [2 /*return*/];
@@ -644,12 +668,10 @@
644
668
  if (!activatedRouteSnapshot) {
645
669
  return null;
646
670
  }
647
- if (activatedRouteSnapshot.firstChild) {
648
- return __classPrivateFieldGet(_this, _getActivatedRouteSnapshot).call(_this, activatedRouteSnapshot.firstChild);
649
- }
650
- else {
651
- return activatedRouteSnapshot;
671
+ while (activatedRouteSnapshot.firstChild) {
672
+ activatedRouteSnapshot = activatedRouteSnapshot.firstChild;
652
673
  }
674
+ return activatedRouteSnapshot;
653
675
  });
654
676
  _getActivatedRoute.set(this, function (activatedRoute, component) {
655
677
  if (!activatedRoute) {
@@ -658,12 +680,13 @@
658
680
  if (activatedRoute.component && activatedRoute.component === component) {
659
681
  return activatedRoute;
660
682
  }
661
- else if (activatedRoute.firstChild) {
662
- return __classPrivateFieldGet(_this, _getActivatedRoute).call(_this, activatedRoute.firstChild, component);
663
- }
664
- else {
665
- return null;
683
+ while (activatedRoute.firstChild) {
684
+ activatedRoute = activatedRoute.firstChild;
685
+ if (activatedRoute.component && activatedRoute.component === component) {
686
+ return activatedRoute;
687
+ }
666
688
  }
689
+ return null;
667
690
  });
668
691
  __classPrivateFieldGet(this, _subscription).add(router$1.events.pipe(operators.filter(function (event) { return event instanceof router.RoutesRecognized || event instanceof router.NavigationEnd; }))
669
692
  .subscribe(function (event) { return __awaiter(_this, void 0, void 0, function () {
@@ -681,7 +704,6 @@
681
704
  return [2 /*return*/];
682
705
  case 2:
683
706
  if (!(!__classPrivateFieldGet(this, _firstLoad) && event instanceof router.RoutesRecognized)) return [3 /*break*/, 4];
684
- console.log(event);
685
707
  route = __classPrivateFieldGet(this, _getActivatedRouteSnapshot).call(this, event.state.root);
686
708
  __classPrivateFieldSet(this, _rootRoute, this.router.routerState.root);
687
709
  return [4 /*yield*/, __classPrivateFieldGet(this, _activeRoute).call(this, event.urlAfterRedirects || event.url, route)];
@@ -717,7 +739,6 @@
717
739
  { type: i0.ChangeDetectorRef },
718
740
  { type: i0.Injector },
719
741
  { type: i0.Compiler },
720
- { type: router.ChildrenOutletContexts },
721
742
  { type: SdTabDecoratorService },
722
743
  { type: SdTabRouterService },
723
744
  { type: i1.SdNotifyService }