@sd-angular/core 1.3.77 → 1.3.78

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 (29) hide show
  1. package/bundles/sd-angular-core-modal.umd.js +5 -2
  2. package/bundles/sd-angular-core-modal.umd.js.map +1 -1
  3. package/bundles/sd-angular-core-modal.umd.min.js +1 -1
  4. package/bundles/sd-angular-core-modal.umd.min.js.map +1 -1
  5. package/bundles/sd-angular-core-tab-router.umd.js +1 -3
  6. package/bundles/sd-angular-core-tab-router.umd.js.map +1 -1
  7. package/bundles/sd-angular-core-tab-router.umd.min.js +1 -1
  8. package/bundles/sd-angular-core-tab-router.umd.min.js.map +1 -1
  9. package/bundles/sd-angular-core-upload-excel.umd.js +7 -2
  10. package/bundles/sd-angular-core-upload-excel.umd.js.map +1 -1
  11. package/bundles/sd-angular-core-upload-excel.umd.min.js +1 -1
  12. package/bundles/sd-angular-core-upload-excel.umd.min.js.map +1 -1
  13. package/esm2015/modal/src/lib/modal/modal.component.js +7 -4
  14. package/esm2015/tab-router/src/lib/components/tab-router-outlet/tab-router-outlet.component.js +2 -5
  15. package/esm2015/upload-excel/src/lib/upload-excel.component.js +9 -4
  16. package/fesm2015/sd-angular-core-modal.js +6 -3
  17. package/fesm2015/sd-angular-core-modal.js.map +1 -1
  18. package/fesm2015/sd-angular-core-tab-router.js +1 -3
  19. package/fesm2015/sd-angular-core-tab-router.js.map +1 -1
  20. package/fesm2015/sd-angular-core-upload-excel.js +8 -3
  21. package/fesm2015/sd-angular-core-upload-excel.js.map +1 -1
  22. package/modal/sd-angular-core-modal.metadata.json +1 -1
  23. package/modal/src/lib/modal/modal.component.d.ts +2 -1
  24. package/package.json +1 -1
  25. package/{sd-angular-core-1.3.77.tgz → sd-angular-core-1.3.78.tgz} +0 -0
  26. package/tab-router/sd-angular-core-tab-router.metadata.json +1 -1
  27. package/tab-router/src/lib/components/tab-router-outlet/tab-router-outlet.component.d.ts +1 -3
  28. package/upload-excel/sd-angular-core-upload-excel.metadata.json +1 -1
  29. package/upload-excel/src/lib/upload-excel.component.d.ts +3 -1
@@ -12,6 +12,7 @@
12
12
  this.bottomSheet = bottomSheet;
13
13
  this.height = 'auto';
14
14
  this.lazyLoadContent = true;
15
+ this.sdClosed = new core.EventEmitter();
15
16
  this.isOpened = false;
16
17
  this.alreadyOpened = false;
17
18
  this.isMobileOrTablet = false;
@@ -27,6 +28,7 @@
27
28
  _this.bottomSheetRef = _this.bottomSheet.open(_this.templateRef);
28
29
  _this.subcription.add(_this.bottomSheetRef.afterDismissed().subscribe(function () {
29
30
  _this.isOpened = false;
31
+ _this.sdClosed.emit();
30
32
  }));
31
33
  }
32
34
  else {
@@ -37,6 +39,7 @@
37
39
  });
38
40
  _this.subcription.add(_this.dialogRef.afterClosed().subscribe(function () {
39
41
  _this.isOpened = false;
42
+ _this.sdClosed.emit();
40
43
  }));
41
44
  }
42
45
  };
@@ -66,8 +69,7 @@
66
69
  }
67
70
  };
68
71
  SdModal.prototype.ngOnDestroy = function () {
69
- var _a;
70
- (_a = this.subcription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
72
+ this.subcription.unsubscribe();
71
73
  };
72
74
  return SdModal;
73
75
  }());
@@ -97,6 +99,7 @@
97
99
  view: [{ type: core.Input }],
98
100
  lazyLoadContent: [{ type: core.Input }],
99
101
  closeClickOutSide: [{ type: core.Input }],
102
+ sdClosed: [{ type: core.Output }],
100
103
  modal: [{ type: core.ViewChild, args: ['modal',] }]
101
104
  };
102
105
 
@@ -1 +1 @@
1
- {"version":3,"file":"sd-angular-core-modal.umd.js","sources":["../../../../projects/sd-core/modal/src/lib/modal/modal.component.ts","../../../../projects/sd-core/modal/src/lib/modal/modal-header/modal-header.component.ts","../../../../projects/sd-core/modal/src/lib/modal/modal-body/modal-body.component.ts","../../../../projects/sd-core/modal/src/lib/modal/modal-footer/modal-footer.component.ts","../../../../projects/sd-core/modal/src/lib/bottom-sheet/bottom-sheet.component.ts","../../../../projects/sd-core/modal/src/lib/bottom-sheet/bottom-sheet-header/bottom-sheet-header.component.ts","../../../../projects/sd-core/modal/src/lib/bottom-sheet/bottom-sheet-body/bottom-sheet-body.component.ts","../../../../projects/sd-core/modal/src/lib/bottom-sheet/bottom-sheet-footer/bottom-sheet-footer.component.ts","../../../../projects/sd-core/modal/src/lib/modal.module.ts","../../../../projects/sd-core/modal/src/public-api.ts","../../../../projects/sd-core/modal/sd-angular-core-modal.ts"],"sourcesContent":["import { Component, ElementRef, Input, ViewChild, OnInit, OnDestroy, TemplateRef, ViewEncapsulation, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';\r\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\r\nimport { DeviceDetectorService } from 'ngx-device-detector';\r\nimport { MatBottomSheet } from '@angular/material/bottom-sheet';\r\nimport { MatBottomSheetRef } from '@angular/material/bottom-sheet';\r\nimport { Subscription } from 'rxjs';\r\n\r\n@Component({\r\n selector: 'sd-modal',\r\n templateUrl: './modal.component.html',\r\n styleUrls: ['./modal.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdModal implements OnInit, OnDestroy {\r\n static index = 0;\r\n @ViewChild('templateRef') templateRef: TemplateRef<any>;\r\n @Input() title: string;\r\n @Input() noClose: boolean;\r\n @Input() type: 'primary' | 'info' | 'success' | 'warning' | 'danger';\r\n @Input() width: 'lg' | 'md' | 'sm' | string;\r\n @Input() height = 'auto';\r\n @Input() view: 'dialog' | 'bottomSheet';\r\n @Input() lazyLoadContent = true;\r\n @Input() closeClickOutSide: boolean;\r\n @ViewChild('modal') modal: ElementRef;\r\n isOpened = false;\r\n alreadyOpened = false;\r\n isMobileOrTablet = false;\r\n private bottomSheetRef: MatBottomSheetRef<any>;\r\n private dialogRef: MatDialogRef<any>;\r\n private subcription = new Subscription();\r\n constructor(\r\n private ref: ChangeDetectorRef,\r\n private dialog: MatDialog,\r\n private bottomSheet: MatBottomSheet,\r\n deviceService: DeviceDetectorService) {\r\n this.isMobileOrTablet = !deviceService.isDesktop();\r\n }\r\n ngOnInit(): void {\r\n this.type = this.type || 'primary';\r\n this.width = this.width || '80vw';\r\n if (!this.isMobileOrTablet) {\r\n switch (this.width) {\r\n case 'lg':\r\n this.width = '80vw';\r\n break;\r\n case 'md':\r\n this.width = '60vw';\r\n break;\r\n case 'sm':\r\n this.width = '40vw';\r\n break;\r\n }\r\n }\r\n }\r\n\r\n ngOnDestroy() {\r\n this.subcription?.unsubscribe();\r\n }\r\n\r\n open = (): void => {\r\n if (this.isOpened) {\r\n return;\r\n }\r\n this.ref.markForCheck();\r\n this.alreadyOpened = true;\r\n this.isOpened = true;\r\n if ((!this.view && this.isMobileOrTablet) || this.view === 'bottomSheet') {\r\n this.bottomSheetRef = this.bottomSheet.open(this.templateRef);\r\n this.subcription.add(this.bottomSheetRef.afterDismissed().subscribe(() => {\r\n this.isOpened = false;\r\n }));\r\n } else {\r\n this.dialogRef = this.dialog.open(this.templateRef, {\r\n width: this.width,\r\n maxWidth: this.width,\r\n disableClose: !this.closeClickOutSide // mặc định ko cho đóng modal khi click out side\r\n });\r\n this.subcription.add(this.dialogRef.afterClosed().subscribe(() => {\r\n this.isOpened = false;\r\n }));\r\n }\r\n }\r\n\r\n close = (): void => {\r\n this.ref.markForCheck();\r\n this.bottomSheetRef?.dismiss();\r\n this.dialogRef?.close();\r\n }\r\n}\r\n","import { Component, OnInit, ViewEncapsulation } from '@angular/core';\r\nimport { DeviceDetectorService } from 'ngx-device-detector';\r\n\r\n@Component({\r\n selector: 'sd-modal-header',\r\n templateUrl: './modal-header.component.html',\r\n styleUrls: [\r\n './modal-header.component.scss'],\r\n encapsulation: ViewEncapsulation.None\r\n})\r\nexport class SdModalHeader implements OnInit {\r\n isMobileOrTablet = false;\r\n constructor(deviceService: DeviceDetectorService) {\r\n this.isMobileOrTablet = !deviceService.isDesktop();\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n}\r\n","import { Component, OnInit, Input } from '@angular/core';\r\nimport { DeviceDetectorService } from 'ngx-device-detector';\r\n\r\n@Component({\r\n selector: 'sd-modal-body',\r\n templateUrl: './modal-body.component.html',\r\n styleUrls: ['./modal-body.component.scss'],\r\n})\r\nexport class SdModalBody implements OnInit {\r\n @Input() height = 'auto';\r\n isMobileOrTablet = false;\r\n constructor(deviceService: DeviceDetectorService) {\r\n this.isMobileOrTablet = !deviceService.isDesktop();\r\n }\r\n ngOnInit() {\r\n }\r\n}\r\n","import { Component, OnInit, ViewEncapsulation } from '@angular/core';\r\nimport { DeviceDetectorService } from 'ngx-device-detector';\r\n\r\n@Component({\r\n selector: 'sd-modal-footer',\r\n templateUrl: './modal-footer.component.html',\r\n styleUrls: ['./modal-footer.component.scss']\r\n})\r\nexport class SdModalFooter implements OnInit {\r\n isMobileOrTablet = false;\r\n constructor(deviceService: DeviceDetectorService) {\r\n this.isMobileOrTablet = !deviceService.isDesktop();\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n}\r\n","import { Component, ViewChild, TemplateRef, Input } from '@angular/core';\r\nimport { MatBottomSheet } from '@angular/material/bottom-sheet';\r\n\r\n@Component({\r\n selector: 'sd-bottom-sheet',\r\n templateUrl: './bottom-sheet.component.html'\r\n})\r\nexport class SdBottomSheet {\r\n @ViewChild('templateRef') templateRef: TemplateRef<OptionTemplateContext>;\r\n @Input() title: string;\r\n isOpened = false;\r\n constructor(\r\n private bottomSheet: MatBottomSheet,\r\n ) { }\r\n\r\n open = () => {\r\n this.isOpened = true;\r\n this.bottomSheet.open(this.templateRef);\r\n }\r\n\r\n close = () => {\r\n this.bottomSheet.dismiss();\r\n }\r\n}\r\n\r\ninterface OptionTemplateContext {\r\n $implicit: any;\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'sd-bottom-sheet-header',\r\n templateUrl: './bottom-sheet-header.component.html'\r\n})\r\nexport class SdBottomSheetHeader implements OnInit {\r\n constructor() { }\r\n\r\n ngOnInit() {\r\n }\r\n}\r\n","import { Component, OnInit, Input } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'sd-bottom-sheet-body',\r\n templateUrl: './bottom-sheet-body.component.html'\r\n})\r\nexport class SdBottomSheetBody implements OnInit {\r\n @Input() height = 'auto';\r\n constructor() { }\r\n\r\n ngOnInit() {\r\n }\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'sd-bottom-sheet-footer',\r\n templateUrl: './bottom-sheet-footer.component.html',\r\n styleUrls: ['./bottom-sheet-footer.component.scss']\r\n})\r\nexport class SdBottomSheetFooter implements OnInit {\r\n constructor() { }\r\n\r\n ngOnInit() {\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdModal } from './modal/modal.component';\r\nimport { SdModalHeader } from './modal/modal-header/modal-header.component';\r\nimport { SdModalBody } from './modal/modal-body/modal-body.component';\r\nimport { SdModalFooter } from './modal/modal-footer/modal-footer.component';\r\nimport { SdBottomSheet } from './bottom-sheet/bottom-sheet.component';\r\nimport { SdBottomSheetHeader } from './bottom-sheet/bottom-sheet-header/bottom-sheet-header.component';\r\nimport { SdBottomSheetBody } from './bottom-sheet/bottom-sheet-body/bottom-sheet-body.component';\r\nimport { SdBottomSheetFooter } from './bottom-sheet/bottom-sheet-footer/bottom-sheet-footer.component';\r\n\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatBottomSheetModule } from '@angular/material/bottom-sheet';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { SdButtonModule } from '@sd-angular/core/button';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n MatIconModule,\r\n MatBottomSheetModule,\r\n MatDialogModule,\r\n MatButtonModule,\r\n SdButtonModule\r\n ],\r\n declarations: [\r\n SdModal,\r\n SdModalHeader,\r\n SdModalBody,\r\n SdModalFooter,\r\n SdBottomSheet,\r\n SdBottomSheetHeader,\r\n SdBottomSheetBody,\r\n SdBottomSheetFooter\r\n ],\r\n exports: [\r\n SdModal,\r\n SdModalHeader,\r\n SdModalBody,\r\n SdModalFooter,\r\n SdBottomSheet,\r\n SdBottomSheetHeader,\r\n SdBottomSheetBody,\r\n SdBottomSheetFooter\r\n ],\r\n providers: [\r\n ]\r\n})\r\nexport class SdModalModule {\r\n\r\n}\r\n","/*\r\n * Public API Surface of superdev-angular-core\r\n */\r\n\r\nexport * from './lib/modal/modal.component';\r\nexport * from './lib/modal/modal-header/modal-header.component';\r\nexport * from './lib/modal/modal-body/modal-body.component';\r\nexport * from './lib/modal/modal-footer/modal-footer.component';\r\n\r\nexport * from './lib/bottom-sheet/bottom-sheet.component';\r\nexport * from './lib/bottom-sheet/bottom-sheet-header/bottom-sheet-header.component';\r\nexport * from './lib/bottom-sheet/bottom-sheet-body/bottom-sheet-body.component';\r\nexport * from './lib/bottom-sheet/bottom-sheet-footer/bottom-sheet-footer.component';\r\n\r\nexport * from './lib/modal.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["Subscription","Component","ViewEncapsulation","ChangeDetectionStrategy","ChangeDetectorRef","MatDialog","MatBottomSheet","DeviceDetectorService","ViewChild","Input","NgModule","CommonModule","MatIconModule","MatBottomSheetModule","MatDialogModule","MatButtonModule","SdButtonModule"],"mappings":";;;;;;;QAgCE,iBACU,GAAsB,EACtB,MAAiB,EACjB,WAA2B,EACnC,aAAoC;YAJtC,iBAMC;YALS,QAAG,GAAH,GAAG,CAAmB;YACtB,WAAM,GAAN,MAAM,CAAW;YACjB,gBAAW,GAAX,WAAW,CAAgB;YAd5B,WAAM,GAAG,MAAM,CAAC;YAEhB,oBAAe,GAAG,IAAI,CAAC;YAGhC,aAAQ,GAAG,KAAK,CAAC;YACjB,kBAAa,GAAG,KAAK,CAAC;YACtB,qBAAgB,GAAG,KAAK,CAAC;YAGjB,gBAAW,GAAG,IAAIA,iBAAY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AAM,GAAG,MAAM,CAAC;SACR;QAEjB,oCAAQ,GAAR;SACC;;;;gBATFA,cAAS,SAAC;oBACT,QAAQ,EAAE,sBAAsB;oBAChC,0FAAiD;iBAClD;;;;yBAEEQ,UAAK;;;;QCCN;SAAiB;QAEjB,sCAAQ,GAAR;SACC;;;;gBATFR,cAAS,SAAC;oBACT,QAAQ,EAAE,wBAAwB;oBAClC,2KAAmD;;iBAEpD;;;;;QC2CD;;;;;gBAhCCS,aAAQ,SAAC;oBACR,OAAO,EAAE;wBACPC,mBAAY;wBACZC,kBAAa;wBACbC,gCAAoB;wBACpBC,sBAAe;wBACfC,sBAAe;wBACfC,uBAAc;qBACf;oBACD,YAAY,EAAE;wBACZ,OAAO;wBACP,aAAa;wBACb,WAAW;wBACX,aAAa;wBACb,aAAa;wBACb,mBAAmB;wBACnB,iBAAiB;wBACjB,mBAAmB;qBACpB;oBACD,OAAO,EAAE;wBACP,OAAO;wBACP,aAAa;wBACb,WAAW;wBACX,aAAa;wBACb,aAAa;wBACb,mBAAmB;wBACnB,iBAAiB;wBACjB,mBAAmB;qBACpB;oBACD,SAAS,EAAE,EACV;iBACF;;;IChDD;;;;ICAA;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"sd-angular-core-modal.umd.js","sources":["../../../../projects/sd-core/modal/src/lib/modal/modal.component.ts","../../../../projects/sd-core/modal/src/lib/modal/modal-header/modal-header.component.ts","../../../../projects/sd-core/modal/src/lib/modal/modal-body/modal-body.component.ts","../../../../projects/sd-core/modal/src/lib/modal/modal-footer/modal-footer.component.ts","../../../../projects/sd-core/modal/src/lib/bottom-sheet/bottom-sheet.component.ts","../../../../projects/sd-core/modal/src/lib/bottom-sheet/bottom-sheet-header/bottom-sheet-header.component.ts","../../../../projects/sd-core/modal/src/lib/bottom-sheet/bottom-sheet-body/bottom-sheet-body.component.ts","../../../../projects/sd-core/modal/src/lib/bottom-sheet/bottom-sheet-footer/bottom-sheet-footer.component.ts","../../../../projects/sd-core/modal/src/lib/modal.module.ts","../../../../projects/sd-core/modal/src/public-api.ts","../../../../projects/sd-core/modal/sd-angular-core-modal.ts"],"sourcesContent":["import { Component, ElementRef, Input, ViewChild, OnInit, OnDestroy, TemplateRef, ViewEncapsulation, ChangeDetectionStrategy, ChangeDetectorRef, Output, EventEmitter } from '@angular/core';\r\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\r\nimport { DeviceDetectorService } from 'ngx-device-detector';\r\nimport { MatBottomSheet } from '@angular/material/bottom-sheet';\r\nimport { MatBottomSheetRef } from '@angular/material/bottom-sheet';\r\nimport { Subscription } from 'rxjs';\r\n\r\n@Component({\r\n selector: 'sd-modal',\r\n templateUrl: './modal.component.html',\r\n styleUrls: ['./modal.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdModal implements OnInit, OnDestroy {\r\n static index = 0;\r\n @ViewChild('templateRef') templateRef: TemplateRef<any>;\r\n @Input() title: string;\r\n @Input() noClose: boolean;\r\n @Input() type: 'primary' | 'info' | 'success' | 'warning' | 'danger';\r\n @Input() width: 'lg' | 'md' | 'sm' | string;\r\n @Input() height = 'auto';\r\n @Input() view: 'dialog' | 'bottomSheet';\r\n @Input() lazyLoadContent = true;\r\n @Input() closeClickOutSide: boolean;\r\n @Output() sdClosed = new EventEmitter();\r\n @ViewChild('modal') modal: ElementRef;\r\n isOpened = false;\r\n alreadyOpened = false;\r\n isMobileOrTablet = false;\r\n private bottomSheetRef: MatBottomSheetRef<any>;\r\n private dialogRef: MatDialogRef<any>;\r\n private subcription = new Subscription();\r\n constructor(\r\n private ref: ChangeDetectorRef,\r\n private dialog: MatDialog,\r\n private bottomSheet: MatBottomSheet,\r\n deviceService: DeviceDetectorService) {\r\n this.isMobileOrTablet = !deviceService.isDesktop();\r\n }\r\n ngOnInit(): void {\r\n this.type = this.type || 'primary';\r\n this.width = this.width || '80vw';\r\n if (!this.isMobileOrTablet) {\r\n switch (this.width) {\r\n case 'lg':\r\n this.width = '80vw';\r\n break;\r\n case 'md':\r\n this.width = '60vw';\r\n break;\r\n case 'sm':\r\n this.width = '40vw';\r\n break;\r\n }\r\n }\r\n }\r\n\r\n ngOnDestroy() {\r\n this.subcription.unsubscribe();\r\n }\r\n\r\n open = (): void => {\r\n if (this.isOpened) {\r\n return;\r\n }\r\n this.ref.markForCheck();\r\n this.alreadyOpened = true;\r\n this.isOpened = true;\r\n if ((!this.view && this.isMobileOrTablet) || this.view === 'bottomSheet') {\r\n this.bottomSheetRef = this.bottomSheet.open(this.templateRef);\r\n this.subcription.add(this.bottomSheetRef.afterDismissed().subscribe(() => {\r\n this.isOpened = false;\r\n this.sdClosed.emit();\r\n }));\r\n } else {\r\n this.dialogRef = this.dialog.open(this.templateRef, {\r\n width: this.width,\r\n maxWidth: this.width,\r\n disableClose: !this.closeClickOutSide // mặc định ko cho đóng modal khi click out side\r\n });\r\n this.subcription.add(this.dialogRef.afterClosed().subscribe(() => {\r\n this.isOpened = false;\r\n this.sdClosed.emit();\r\n }));\r\n }\r\n }\r\n\r\n close = (): void => {\r\n this.ref.markForCheck();\r\n this.bottomSheetRef?.dismiss();\r\n this.dialogRef?.close();\r\n }\r\n}\r\n","import { Component, OnInit, ViewEncapsulation } from '@angular/core';\r\nimport { DeviceDetectorService } from 'ngx-device-detector';\r\n\r\n@Component({\r\n selector: 'sd-modal-header',\r\n templateUrl: './modal-header.component.html',\r\n styleUrls: [\r\n './modal-header.component.scss'],\r\n encapsulation: ViewEncapsulation.None\r\n})\r\nexport class SdModalHeader implements OnInit {\r\n isMobileOrTablet = false;\r\n constructor(deviceService: DeviceDetectorService) {\r\n this.isMobileOrTablet = !deviceService.isDesktop();\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n}\r\n","import { Component, OnInit, Input } from '@angular/core';\r\nimport { DeviceDetectorService } from 'ngx-device-detector';\r\n\r\n@Component({\r\n selector: 'sd-modal-body',\r\n templateUrl: './modal-body.component.html',\r\n styleUrls: ['./modal-body.component.scss'],\r\n})\r\nexport class SdModalBody implements OnInit {\r\n @Input() height = 'auto';\r\n isMobileOrTablet = false;\r\n constructor(deviceService: DeviceDetectorService) {\r\n this.isMobileOrTablet = !deviceService.isDesktop();\r\n }\r\n ngOnInit() {\r\n }\r\n}\r\n","import { Component, OnInit, ViewEncapsulation } from '@angular/core';\r\nimport { DeviceDetectorService } from 'ngx-device-detector';\r\n\r\n@Component({\r\n selector: 'sd-modal-footer',\r\n templateUrl: './modal-footer.component.html',\r\n styleUrls: ['./modal-footer.component.scss']\r\n})\r\nexport class SdModalFooter implements OnInit {\r\n isMobileOrTablet = false;\r\n constructor(deviceService: DeviceDetectorService) {\r\n this.isMobileOrTablet = !deviceService.isDesktop();\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n}\r\n","import { Component, ViewChild, TemplateRef, Input } from '@angular/core';\r\nimport { MatBottomSheet } from '@angular/material/bottom-sheet';\r\n\r\n@Component({\r\n selector: 'sd-bottom-sheet',\r\n templateUrl: './bottom-sheet.component.html'\r\n})\r\nexport class SdBottomSheet {\r\n @ViewChild('templateRef') templateRef: TemplateRef<OptionTemplateContext>;\r\n @Input() title: string;\r\n isOpened = false;\r\n constructor(\r\n private bottomSheet: MatBottomSheet,\r\n ) { }\r\n\r\n open = () => {\r\n this.isOpened = true;\r\n this.bottomSheet.open(this.templateRef);\r\n }\r\n\r\n close = () => {\r\n this.bottomSheet.dismiss();\r\n }\r\n}\r\n\r\ninterface OptionTemplateContext {\r\n $implicit: any;\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'sd-bottom-sheet-header',\r\n templateUrl: './bottom-sheet-header.component.html'\r\n})\r\nexport class SdBottomSheetHeader implements OnInit {\r\n constructor() { }\r\n\r\n ngOnInit() {\r\n }\r\n}\r\n","import { Component, OnInit, Input } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'sd-bottom-sheet-body',\r\n templateUrl: './bottom-sheet-body.component.html'\r\n})\r\nexport class SdBottomSheetBody implements OnInit {\r\n @Input() height = 'auto';\r\n constructor() { }\r\n\r\n ngOnInit() {\r\n }\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'sd-bottom-sheet-footer',\r\n templateUrl: './bottom-sheet-footer.component.html',\r\n styleUrls: ['./bottom-sheet-footer.component.scss']\r\n})\r\nexport class SdBottomSheetFooter implements OnInit {\r\n constructor() { }\r\n\r\n ngOnInit() {\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdModal } from './modal/modal.component';\r\nimport { SdModalHeader } from './modal/modal-header/modal-header.component';\r\nimport { SdModalBody } from './modal/modal-body/modal-body.component';\r\nimport { SdModalFooter } from './modal/modal-footer/modal-footer.component';\r\nimport { SdBottomSheet } from './bottom-sheet/bottom-sheet.component';\r\nimport { SdBottomSheetHeader } from './bottom-sheet/bottom-sheet-header/bottom-sheet-header.component';\r\nimport { SdBottomSheetBody } from './bottom-sheet/bottom-sheet-body/bottom-sheet-body.component';\r\nimport { SdBottomSheetFooter } from './bottom-sheet/bottom-sheet-footer/bottom-sheet-footer.component';\r\n\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatBottomSheetModule } from '@angular/material/bottom-sheet';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { SdButtonModule } from '@sd-angular/core/button';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n MatIconModule,\r\n MatBottomSheetModule,\r\n MatDialogModule,\r\n MatButtonModule,\r\n SdButtonModule\r\n ],\r\n declarations: [\r\n SdModal,\r\n SdModalHeader,\r\n SdModalBody,\r\n SdModalFooter,\r\n SdBottomSheet,\r\n SdBottomSheetHeader,\r\n SdBottomSheetBody,\r\n SdBottomSheetFooter\r\n ],\r\n exports: [\r\n SdModal,\r\n SdModalHeader,\r\n SdModalBody,\r\n SdModalFooter,\r\n SdBottomSheet,\r\n SdBottomSheetHeader,\r\n SdBottomSheetBody,\r\n SdBottomSheetFooter\r\n ],\r\n providers: [\r\n ]\r\n})\r\nexport class SdModalModule {\r\n\r\n}\r\n","/*\r\n * Public API Surface of superdev-angular-core\r\n */\r\n\r\nexport * from './lib/modal/modal.component';\r\nexport * from './lib/modal/modal-header/modal-header.component';\r\nexport * from './lib/modal/modal-body/modal-body.component';\r\nexport * from './lib/modal/modal-footer/modal-footer.component';\r\n\r\nexport * from './lib/bottom-sheet/bottom-sheet.component';\r\nexport * from './lib/bottom-sheet/bottom-sheet-header/bottom-sheet-header.component';\r\nexport * from './lib/bottom-sheet/bottom-sheet-body/bottom-sheet-body.component';\r\nexport * from './lib/bottom-sheet/bottom-sheet-footer/bottom-sheet-footer.component';\r\n\r\nexport * from './lib/modal.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["EventEmitter","Subscription","Component","ViewEncapsulation","ChangeDetectionStrategy","ChangeDetectorRef","MatDialog","MatBottomSheet","DeviceDetectorService","ViewChild","Input","Output","NgModule","CommonModule","MatIconModule","MatBottomSheetModule","MatDialogModule","MatButtonModule","SdButtonModule"],"mappings":";;;;;;;QAiCE,iBACU,GAAsB,EACtB,MAAiB,EACjB,WAA2B,EACnC,aAAoC;YAJtC,iBAMC;YALS,QAAG,GAAH,GAAG,CAAmB;YACtB,WAAM,GAAN,MAAM,CAAW;YACjB,gBAAW,GAAX,WAAW,CAAgB;YAf5B,WAAM,GAAG,MAAM,CAAC;YAEhB,oBAAe,GAAG,IAAI,CAAC;YAEtB,aAAQ,GAAG,IAAIA,iBAAY,EAAE,CAAC;YAExC,aAAQ,GAAG,KAAK,CAAC;YACjB,kBAAa,GAAG,KAAK,CAAC;YACtB,qBAAgB,GAAG,KAAK,CAAC;YAGjB,gBAAW,GAAG,IAAIC,iBAAY,EAAE,CAAC;YA8BzC,SAAI,GAAG;gBACL,IAAI,KAAI,CAAC,QAAQ,EAAE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AwB;oBAClC,8EAAmD;iBACpD;;;;;QCGC;YADS,WAAM,GAAG,MAAM,CAAC;SACR;QAEjB,oCAAQ,GAAR;SACC;;;;gBATFA,cAAS,SAAC;oBACT,QAAQ,EAAE,sBAAsB;oBAChC,0FAAiD;iBAClD;;;;yBAEEQ,UAAK;;;;QCCN;SAAiB;QAEjB,sCAAQ,GAAR;SACC;;;;gBATFR,cAAS,SAAC;oBACT,QAAQ,EAAE,wBAAwB;oBAClC,2KAAmD;;iBAEpD;;;;;QC2CD;;;;;gBAhCCU,aAAQ,SAAC;oBACR,OAAO,EAAE;wBACPC,mBAAY;wBACZC,kBAAa;wBACbC,gCAAoB;wBACpBC,sBAAe;wBACfC,sBAAe;wBACfC,uBAAc;qBACf;oBACD,YAAY,EAAE;wBACZ,OAAO;wBACP,aAAa;wBACb,WAAW;wBACX,aAAa;wBACb,aAAa;wBACb,mBAAmB;wBACnB,iBAAiB;wBACjB,mBAAmB;qBACpB;oBACD,OAAO,EAAE;wBACP,OAAO;wBACP,aAAa;wBACb,WAAW;wBACX,aAAa;wBACb,aAAa;wBACb,mBAAmB;wBACnB,iBAAiB;wBACjB,mBAAmB;qBACpB;oBACD,SAAS,EAAE,EACV;iBACF;;;IChDD;;;;ICAA;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/material/dialog"),require("ngx-device-detector"),require("@angular/material/bottom-sheet"),require("rxjs"),require("@angular/common"),require("@angular/material/icon"),require("@angular/material/button"),require("@sd-angular/core/button")):"function"==typeof define&&define.amd?define("@sd-angular/core/modal",["exports","@angular/core","@angular/material/dialog","ngx-device-detector","@angular/material/bottom-sheet","rxjs","@angular/common","@angular/material/icon","@angular/material/button","@sd-angular/core/button"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self)["sd-angular"]=t["sd-angular"]||{},t["sd-angular"].core=t["sd-angular"].core||{},t["sd-angular"].core.modal={}),t.ng.core,t.ng.material.dialog,t.ngxDeviceDetector,t.ng.material.bottomSheet,t.rxjs,t.ng.common,t.ng.material.icon,t.ng.material.button,t["sd-angular"].core.button)}(this,(function(t,e,n,o,i,r,a,s,l,d){"use strict";var c=function(){function t(t,e,n,o){var i=this;this.ref=t,this.dialog=e,this.bottomSheet=n,this.height="auto",this.lazyLoadContent=!0,this.isOpened=!1,this.alreadyOpened=!1,this.isMobileOrTablet=!1,this.subcription=new r.Subscription,this.open=function(){i.isOpened||(i.ref.markForCheck(),i.alreadyOpened=!0,i.isOpened=!0,!i.view&&i.isMobileOrTablet||"bottomSheet"===i.view?(i.bottomSheetRef=i.bottomSheet.open(i.templateRef),i.subcription.add(i.bottomSheetRef.afterDismissed().subscribe((function(){i.isOpened=!1})))):(i.dialogRef=i.dialog.open(i.templateRef,{width:i.width,maxWidth:i.width,disableClose:!i.closeClickOutSide}),i.subcription.add(i.dialogRef.afterClosed().subscribe((function(){i.isOpened=!1})))))},this.close=function(){var t,e;i.ref.markForCheck(),null===(t=i.bottomSheetRef)||void 0===t||t.dismiss(),null===(e=i.dialogRef)||void 0===e||e.close()},this.isMobileOrTablet=!o.isDesktop()}return t.prototype.ngOnInit=function(){if(this.type=this.type||"primary",this.width=this.width||"80vw",!this.isMobileOrTablet)switch(this.width){case"lg":this.width="80vw";break;case"md":this.width="60vw";break;case"sm":this.width="40vw"}},t.prototype.ngOnDestroy=function(){var t;null===(t=this.subcription)||void 0===t||t.unsubscribe()},t}();c.index=0,c.decorators=[{type:e.Component,args:[{selector:"sd-modal",template:'<ng-template #templateRef>\r\n <ng-container *ngIf="!lazyLoadContent || alreadyOpened">\r\n <sd-modal-header *ngIf="title">\r\n <span [innerHtml]="title"></span>\r\n <div class="d-flex align-items-center">\r\n <ng-content select="[sdModalHeaderRight]"></ng-content>\r\n <button *ngIf="!noClose" type="button" (click)="close()" mat-icon-button>\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </div>\r\n </sd-modal-header>\r\n <div class="d-flex flex-column px-12 px-md-24 pb-6 overflow-auto w-100 mh-100">\r\n <ng-content></ng-content>\r\n </div>\r\n </ng-container>\r\n</ng-template>',encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush,styles:['button:focus{outline:none!important}.mat-dialog-container{padding:0!important}.mat-dialog-container .mat-dialog-content{max-height:80vh}.mat-dialog-container .mat-dialog-actions{margin-bottom:0;min-height:auto;padding:0}.mat-bottom-sheet-container{max-height:"inherit"}sd-modal-header{display:block;padding:12px 24px;width:100%}@media (max-width:640px){sd-modal-header{padding:12px}}.cdk-global-overlay-wrapper .mat-bottom-sheet-container{border-top-left-radius:4px;border-top-right-radius:4px;box-sizing:border-box;display:flex;flex-direction:column;max-height:80vh;min-width:100vw;outline:0;overflow:hidden;padding:0}']}]}],c.ctorParameters=function(){return[{type:e.ChangeDetectorRef},{type:n.MatDialog},{type:i.MatBottomSheet},{type:o.DeviceDetectorService}]},c.propDecorators={templateRef:[{type:e.ViewChild,args:["templateRef"]}],title:[{type:e.Input}],noClose:[{type:e.Input}],type:[{type:e.Input}],width:[{type:e.Input}],height:[{type:e.Input}],view:[{type:e.Input}],lazyLoadContent:[{type:e.Input}],closeClickOutSide:[{type:e.Input}],modal:[{type:e.ViewChild,args:["modal"]}]};var p=function(){function t(t){this.isMobileOrTablet=!1,this.isMobileOrTablet=!t.isDesktop()}return t.prototype.ngOnInit=function(){},t}();p.decorators=[{type:e.Component,args:[{selector:"sd-modal-header",template:'<h3 class="mb-0" mat-dialog-title *ngIf="!isMobileOrTablet">\r\n <ng-container *ngTemplateOutlet="content"></ng-container>\r\n</h3>\r\n<sd-bottom-sheet-header *ngIf="isMobileOrTablet">\r\n <ng-container *ngTemplateOutlet="content"></ng-container>\r\n</sd-bottom-sheet-header>\r\n<ng-template #content>\r\n <ng-content></ng-content>\r\n</ng-template>',encapsulation:e.ViewEncapsulation.None,styles:[".mat-dialog-title{align-items:center;display:flex;justify-content:space-between}button:focus{outline:none!important}"]}]}],p.ctorParameters=function(){return[{type:o.DeviceDetectorService}]};var g=function(){function t(t){this.height="auto",this.isMobileOrTablet=!1,this.isMobileOrTablet=!t.isDesktop()}return t.prototype.ngOnInit=function(){},t}();g.decorators=[{type:e.Component,args:[{selector:"sd-modal-body",template:'<mat-dialog-content *ngIf="!isMobileOrTablet" [ngStyle]="{\'height\': height}" class="pb-5">\r\n <ng-container *ngTemplateOutlet="content"></ng-container>\r\n</mat-dialog-content>\r\n<sd-bottom-sheet-body *ngIf="isMobileOrTablet" [height]="height">\r\n <ng-container *ngTemplateOutlet="content"></ng-container>\r\n</sd-bottom-sheet-body>\r\n<ng-template #content>\r\n <ng-content></ng-content>\r\n</ng-template>',styles:[":host{width:100%}"]}]}],g.ctorParameters=function(){return[{type:o.DeviceDetectorService}]},g.propDecorators={height:[{type:e.Input}]};var m=function(){function t(t){this.isMobileOrTablet=!1,this.isMobileOrTablet=!t.isDesktop()}return t.prototype.ngOnInit=function(){},t}();m.decorators=[{type:e.Component,args:[{selector:"sd-modal-footer",template:'\x3c!-- <div class="modal-footer" style="padding:5px"><ng-content></ng-content></div> --\x3e\r\n<mat-dialog-actions *ngIf="!isMobileOrTablet">\r\n <div class="c-footer">\r\n <ng-container *ngTemplateOutlet="content"></ng-container>\r\n </div>\r\n</mat-dialog-actions>\r\n<sd-bottom-sheet-footer *ngIf="isMobileOrTablet">\r\n <ng-container *ngTemplateOutlet="content"></ng-container>\r\n</sd-bottom-sheet-footer>\r\n<ng-template #content>\r\n <ng-content></ng-content>\r\n</ng-template>',styles:[":host{width:100%}:host .c-footer{align-items:center;display:flex;flex:auto;justify-content:flex-end;padding:8px 0}"]}]}],m.ctorParameters=function(){return[{type:o.DeviceDetectorService}]};var u=function(t){var e=this;this.bottomSheet=t,this.isOpened=!1,this.open=function(){e.isOpened=!0,e.bottomSheet.open(e.templateRef)},this.close=function(){e.bottomSheet.dismiss()}};u.decorators=[{type:e.Component,args:[{selector:"sd-bottom-sheet",template:'<ng-template #templateRef>\r\n <ng-container *ngIf="isOpened">\r\n <sd-bottom-sheet-header *ngIf="title">{{title}}</sd-bottom-sheet-header>\r\n <ng-content></ng-content>\r\n </ng-container>\r\n</ng-template>'}]}],u.ctorParameters=function(){return[{type:i.MatBottomSheet}]},u.propDecorators={templateRef:[{type:e.ViewChild,args:["templateRef"]}],title:[{type:e.Input}]};var h=function(){function t(){}return t.prototype.ngOnInit=function(){},t}();h.decorators=[{type:e.Component,args:[{selector:"sd-bottom-sheet-header",template:'<h3 class="mb-0" mat-dialog-title><ng-content></ng-content></h3>'}]}],h.ctorParameters=function(){return[]};var f=function(){function t(){this.height="auto"}return t.prototype.ngOnInit=function(){},t}();f.decorators=[{type:e.Component,args:[{selector:"sd-bottom-sheet-body",template:"<div [ngStyle]=\"{'height': height}\">\r\n <ng-content></ng-content>\r\n<div>"}]}],f.ctorParameters=function(){return[]},f.propDecorators={height:[{type:e.Input}]};var b=function(){function t(){}return t.prototype.ngOnInit=function(){},t}();b.decorators=[{type:e.Component,args:[{selector:"sd-bottom-sheet-footer",template:'\x3c!-- <div class="modal-footer" style="padding:5px"><ng-content></ng-content></div> --\x3e\r\n<div class="c-footer">\r\n <ng-content></ng-content>\r\n</div>',styles:[".c-footer{align-items:center;display:flex;flex:auto;justify-content:flex-end;padding-bottom:5px;padding-top:5px}"]}]}],b.ctorParameters=function(){return[]};var y=function(){};y.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,s.MatIconModule,i.MatBottomSheetModule,n.MatDialogModule,l.MatButtonModule,d.SdButtonModule],declarations:[c,p,g,m,u,h,f,b],exports:[c,p,g,m,u,h,f,b],providers:[]}]}],t.SdBottomSheet=u,t.SdBottomSheetBody=f,t.SdBottomSheetFooter=b,t.SdBottomSheetHeader=h,t.SdModal=c,t.SdModalBody=g,t.SdModalFooter=m,t.SdModalHeader=p,t.SdModalModule=y,Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/material/dialog"),require("ngx-device-detector"),require("@angular/material/bottom-sheet"),require("rxjs"),require("@angular/common"),require("@angular/material/icon"),require("@angular/material/button"),require("@sd-angular/core/button")):"function"==typeof define&&define.amd?define("@sd-angular/core/modal",["exports","@angular/core","@angular/material/dialog","ngx-device-detector","@angular/material/bottom-sheet","rxjs","@angular/common","@angular/material/icon","@angular/material/button","@sd-angular/core/button"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self)["sd-angular"]=t["sd-angular"]||{},t["sd-angular"].core=t["sd-angular"].core||{},t["sd-angular"].core.modal={}),t.ng.core,t.ng.material.dialog,t.ngxDeviceDetector,t.ng.material.bottomSheet,t.rxjs,t.ng.common,t.ng.material.icon,t.ng.material.button,t["sd-angular"].core.button)}(this,(function(t,e,n,o,i,r,a,s,l,d){"use strict";var c=function(){function t(t,n,o,i){var a=this;this.ref=t,this.dialog=n,this.bottomSheet=o,this.height="auto",this.lazyLoadContent=!0,this.sdClosed=new e.EventEmitter,this.isOpened=!1,this.alreadyOpened=!1,this.isMobileOrTablet=!1,this.subcription=new r.Subscription,this.open=function(){a.isOpened||(a.ref.markForCheck(),a.alreadyOpened=!0,a.isOpened=!0,!a.view&&a.isMobileOrTablet||"bottomSheet"===a.view?(a.bottomSheetRef=a.bottomSheet.open(a.templateRef),a.subcription.add(a.bottomSheetRef.afterDismissed().subscribe((function(){a.isOpened=!1,a.sdClosed.emit()})))):(a.dialogRef=a.dialog.open(a.templateRef,{width:a.width,maxWidth:a.width,disableClose:!a.closeClickOutSide}),a.subcription.add(a.dialogRef.afterClosed().subscribe((function(){a.isOpened=!1,a.sdClosed.emit()})))))},this.close=function(){var t,e;a.ref.markForCheck(),null===(t=a.bottomSheetRef)||void 0===t||t.dismiss(),null===(e=a.dialogRef)||void 0===e||e.close()},this.isMobileOrTablet=!i.isDesktop()}return t.prototype.ngOnInit=function(){if(this.type=this.type||"primary",this.width=this.width||"80vw",!this.isMobileOrTablet)switch(this.width){case"lg":this.width="80vw";break;case"md":this.width="60vw";break;case"sm":this.width="40vw"}},t.prototype.ngOnDestroy=function(){this.subcription.unsubscribe()},t}();c.index=0,c.decorators=[{type:e.Component,args:[{selector:"sd-modal",template:'<ng-template #templateRef>\r\n <ng-container *ngIf="!lazyLoadContent || alreadyOpened">\r\n <sd-modal-header *ngIf="title">\r\n <span [innerHtml]="title"></span>\r\n <div class="d-flex align-items-center">\r\n <ng-content select="[sdModalHeaderRight]"></ng-content>\r\n <button *ngIf="!noClose" type="button" (click)="close()" mat-icon-button>\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </div>\r\n </sd-modal-header>\r\n <div class="d-flex flex-column px-12 px-md-24 pb-6 overflow-auto w-100 mh-100">\r\n <ng-content></ng-content>\r\n </div>\r\n </ng-container>\r\n</ng-template>',encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush,styles:['button:focus{outline:none!important}.mat-dialog-container{padding:0!important}.mat-dialog-container .mat-dialog-content{max-height:80vh}.mat-dialog-container .mat-dialog-actions{margin-bottom:0;min-height:auto;padding:0}.mat-bottom-sheet-container{max-height:"inherit"}sd-modal-header{display:block;padding:12px 24px;width:100%}@media (max-width:640px){sd-modal-header{padding:12px}}.cdk-global-overlay-wrapper .mat-bottom-sheet-container{border-top-left-radius:4px;border-top-right-radius:4px;box-sizing:border-box;display:flex;flex-direction:column;max-height:80vh;min-width:100vw;outline:0;overflow:hidden;padding:0}']}]}],c.ctorParameters=function(){return[{type:e.ChangeDetectorRef},{type:n.MatDialog},{type:i.MatBottomSheet},{type:o.DeviceDetectorService}]},c.propDecorators={templateRef:[{type:e.ViewChild,args:["templateRef"]}],title:[{type:e.Input}],noClose:[{type:e.Input}],type:[{type:e.Input}],width:[{type:e.Input}],height:[{type:e.Input}],view:[{type:e.Input}],lazyLoadContent:[{type:e.Input}],closeClickOutSide:[{type:e.Input}],sdClosed:[{type:e.Output}],modal:[{type:e.ViewChild,args:["modal"]}]};var p=function(){function t(t){this.isMobileOrTablet=!1,this.isMobileOrTablet=!t.isDesktop()}return t.prototype.ngOnInit=function(){},t}();p.decorators=[{type:e.Component,args:[{selector:"sd-modal-header",template:'<h3 class="mb-0" mat-dialog-title *ngIf="!isMobileOrTablet">\r\n <ng-container *ngTemplateOutlet="content"></ng-container>\r\n</h3>\r\n<sd-bottom-sheet-header *ngIf="isMobileOrTablet">\r\n <ng-container *ngTemplateOutlet="content"></ng-container>\r\n</sd-bottom-sheet-header>\r\n<ng-template #content>\r\n <ng-content></ng-content>\r\n</ng-template>',encapsulation:e.ViewEncapsulation.None,styles:[".mat-dialog-title{align-items:center;display:flex;justify-content:space-between}button:focus{outline:none!important}"]}]}],p.ctorParameters=function(){return[{type:o.DeviceDetectorService}]};var g=function(){function t(t){this.height="auto",this.isMobileOrTablet=!1,this.isMobileOrTablet=!t.isDesktop()}return t.prototype.ngOnInit=function(){},t}();g.decorators=[{type:e.Component,args:[{selector:"sd-modal-body",template:'<mat-dialog-content *ngIf="!isMobileOrTablet" [ngStyle]="{\'height\': height}" class="pb-5">\r\n <ng-container *ngTemplateOutlet="content"></ng-container>\r\n</mat-dialog-content>\r\n<sd-bottom-sheet-body *ngIf="isMobileOrTablet" [height]="height">\r\n <ng-container *ngTemplateOutlet="content"></ng-container>\r\n</sd-bottom-sheet-body>\r\n<ng-template #content>\r\n <ng-content></ng-content>\r\n</ng-template>',styles:[":host{width:100%}"]}]}],g.ctorParameters=function(){return[{type:o.DeviceDetectorService}]},g.propDecorators={height:[{type:e.Input}]};var m=function(){function t(t){this.isMobileOrTablet=!1,this.isMobileOrTablet=!t.isDesktop()}return t.prototype.ngOnInit=function(){},t}();m.decorators=[{type:e.Component,args:[{selector:"sd-modal-footer",template:'\x3c!-- <div class="modal-footer" style="padding:5px"><ng-content></ng-content></div> --\x3e\r\n<mat-dialog-actions *ngIf="!isMobileOrTablet">\r\n <div class="c-footer">\r\n <ng-container *ngTemplateOutlet="content"></ng-container>\r\n </div>\r\n</mat-dialog-actions>\r\n<sd-bottom-sheet-footer *ngIf="isMobileOrTablet">\r\n <ng-container *ngTemplateOutlet="content"></ng-container>\r\n</sd-bottom-sheet-footer>\r\n<ng-template #content>\r\n <ng-content></ng-content>\r\n</ng-template>',styles:[":host{width:100%}:host .c-footer{align-items:center;display:flex;flex:auto;justify-content:flex-end;padding:8px 0}"]}]}],m.ctorParameters=function(){return[{type:o.DeviceDetectorService}]};var u=function(t){var e=this;this.bottomSheet=t,this.isOpened=!1,this.open=function(){e.isOpened=!0,e.bottomSheet.open(e.templateRef)},this.close=function(){e.bottomSheet.dismiss()}};u.decorators=[{type:e.Component,args:[{selector:"sd-bottom-sheet",template:'<ng-template #templateRef>\r\n <ng-container *ngIf="isOpened">\r\n <sd-bottom-sheet-header *ngIf="title">{{title}}</sd-bottom-sheet-header>\r\n <ng-content></ng-content>\r\n </ng-container>\r\n</ng-template>'}]}],u.ctorParameters=function(){return[{type:i.MatBottomSheet}]},u.propDecorators={templateRef:[{type:e.ViewChild,args:["templateRef"]}],title:[{type:e.Input}]};var h=function(){function t(){}return t.prototype.ngOnInit=function(){},t}();h.decorators=[{type:e.Component,args:[{selector:"sd-bottom-sheet-header",template:'<h3 class="mb-0" mat-dialog-title><ng-content></ng-content></h3>'}]}],h.ctorParameters=function(){return[]};var f=function(){function t(){this.height="auto"}return t.prototype.ngOnInit=function(){},t}();f.decorators=[{type:e.Component,args:[{selector:"sd-bottom-sheet-body",template:"<div [ngStyle]=\"{'height': height}\">\r\n <ng-content></ng-content>\r\n<div>"}]}],f.ctorParameters=function(){return[]},f.propDecorators={height:[{type:e.Input}]};var b=function(){function t(){}return t.prototype.ngOnInit=function(){},t}();b.decorators=[{type:e.Component,args:[{selector:"sd-bottom-sheet-footer",template:'\x3c!-- <div class="modal-footer" style="padding:5px"><ng-content></ng-content></div> --\x3e\r\n<div class="c-footer">\r\n <ng-content></ng-content>\r\n</div>',styles:[".c-footer{align-items:center;display:flex;flex:auto;justify-content:flex-end;padding-bottom:5px;padding-top:5px}"]}]}],b.ctorParameters=function(){return[]};var y=function(){};y.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,s.MatIconModule,i.MatBottomSheetModule,n.MatDialogModule,l.MatButtonModule,d.SdButtonModule],declarations:[c,p,g,m,u,h,f,b],exports:[c,p,g,m,u,h,f,b],providers:[]}]}],t.SdBottomSheet=u,t.SdBottomSheetBody=f,t.SdBottomSheetFooter=b,t.SdBottomSheetHeader=h,t.SdModal=c,t.SdModalBody=g,t.SdModalFooter=m,t.SdModalHeader=p,t.SdModalModule=y,Object.defineProperty(t,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=sd-angular-core-modal.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../projects/sd-core/modal/src/lib/modal/modal.component.ts","../../../../projects/sd-core/modal/src/lib/modal/modal-header/modal-header.component.ts","../../../../projects/sd-core/modal/src/lib/modal/modal-body/modal-body.component.ts","../../../../projects/sd-core/modal/src/lib/modal/modal-footer/modal-footer.component.ts","../../../../projects/sd-core/modal/src/lib/bottom-sheet/bottom-sheet.component.ts","../../../../projects/sd-core/modal/src/lib/bottom-sheet/bottom-sheet-header/bottom-sheet-header.component.ts","../../../../projects/sd-core/modal/src/lib/bottom-sheet/bottom-sheet-body/bottom-sheet-body.component.ts","../../../../projects/sd-core/modal/src/lib/bottom-sheet/bottom-sheet-footer/bottom-sheet-footer.component.ts","../../../../projects/sd-core/modal/src/lib/modal.module.ts"],"names":["SdModal","ref","dialog","bottomSheet","deviceService","_this","this","height","lazyLoadContent","isOpened","alreadyOpened","isMobileOrTablet","subcription","Subscription","open","markForCheck","view","bottomSheetRef","templateRef","add","afterDismissed","subscribe","dialogRef","width","maxWidth","disableClose","closeClickOutSide","afterClosed","close","_a","dismiss","_b","isDesktop","prototype","ngOnInit","type","ngOnDestroy","unsubscribe","index","Component","args","selector","template","encapsulation","ViewEncapsulation","None","changeDetection","ChangeDetectionStrategy","OnPush","ChangeDetectorRef","MatDialog","MatBottomSheet","DeviceDetectorService","ViewChild","Input","SdModalHeader","SdModalBody","SdModalFooter","SdBottomSheetHeader","SdBottomSheetBody","SdBottomSheetFooter","NgModule","imports","CommonModule","MatIconModule","MatBottomSheetModule","MatDialogModule","MatButtonModule","SdButtonModule","declarations","SdBottomSheet","exports","providers"],"mappings":"uhCAgCE,SAAAA,EACUC,EACAC,EACAC,EACRC,GAJF,IAAAC,EAAAC,KACUA,KAAAL,IAAAA,EACAK,KAAAJ,OAAAA,EACAI,KAAAH,YAAAA,EAdDG,KAAAC,OAAS,OAETD,KAAAE,iBAAkB,EAG3BF,KAAAG,UAAW,EACXH,KAAAI,eAAgB,EAChBJ,KAAAK,kBAAmB,EAGXL,KAAAM,YAAc,IAAIC,EAAAA,aA8B1BP,KAAAQ,KAAO,WACDT,EAAKI,WAGTJ,EAAKJ,IAAIc,eACTV,EAAKK,eAAgB,EACrBL,EAAKI,UAAW,GACVJ,EAAKW,MAAQX,EAAKM,kBAAmC,gBAAdN,EAAKW,MAChDX,EAAKY,eAAiBZ,EAAKF,YAAYW,KAAKT,EAAKa,aACjDb,EAAKO,YAAYO,IAAId,EAAKY,eAAeG,iBAAiBC,WAAU,WAClEhB,EAAKI,UAAW,QAGlBJ,EAAKiB,UAAYjB,EAAKH,OAAOY,KAAKT,EAAKa,YAAa,CAClDK,MAAOlB,EAAKkB,MACZC,SAAUnB,EAAKkB,MACfE,cAAepB,EAAKqB,oBAEtBrB,EAAKO,YAAYO,IAAId,EAAKiB,UAAUK,cAAcN,WAAU,WAC1DhB,EAAKI,UAAW,SAKtBH,KAAAsB,MAAQ,mBACNvB,EAAKJ,IAAIc,eACU,QAAnBc,EAAAxB,EAAKY,sBAAc,IAAAY,GAAAA,EAAEC,UACP,QAAdC,EAAA1B,EAAKiB,iBAAS,IAAAS,GAAAA,EAAEH,SAnDhBtB,KAAKK,kBAAoBP,EAAc4B,mBAEzChC,EAAAiC,UAAAC,SAAA,WAGE,GAFA5B,KAAK6B,KAAO7B,KAAK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AC,SAAA,sCAXDK,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,kBACVC,SAAA,0pBAJOU,EAAAA,+BCUP,SACUjD,GADV,IAAAE,EAAAC,KACUA,KAAAH,YAAAA,EAFVG,KAAAG,UAAW,EAKXH,KAAAQ,KAAO,WACLT,EAAKI,UAAW,EAChBJ,EAAKF,YAAYW,KAAKT,EAAKa,cAG7BZ,KAAAsB,MAAQ,WACNvB,EAAKF,YAAY2B,gCAlBpBS,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,kBACVC,SAAA,uQAJOS,EAAAA,uDAONE,EAAAA,UAASb,KAAA,CAAC,8BACVc,EAAAA,0BCFD,SAAAI,YAEAA,EAAAzB,UAAAC,SAAA,sCAPDK,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,yBACVC,SAAA,8HCIA,SAAAiB,IADSrD,KAAAC,OAAS,cAGlBoD,EAAA1B,UAAAC,SAAA,sCARDK,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,uBACVC,SAAA,2JAGCY,EAAAA,0BCCD,SAAAM,YAEAA,EAAA3B,UAAAC,SAAA,sCARDK,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,yBACVC,SAAA,8UC6CF,iCAhCCmB,EAAAA,SAAQrB,KAAA,CAAC,CACRsB,QAAS,CACPC,EAAAA,aACAC,EAAAA,cACAC,EAAAA,qBACAC,EAAAA,gBACAC,EAAAA,gBACAC,EAAAA,gBAEFC,aAAc,CACZrE,EACAuD,EACAC,EACAC,EACAa,EACAZ,EACAC,EACAC,GAEFW,QAAS,CACPvE,EACAuD,EACAC,EACAC,EACAa,EACAZ,EACAC,EACAC,GAEFY,UAAW","sourcesContent":["import { Component, ElementRef, Input, ViewChild, OnInit, OnDestroy, TemplateRef, ViewEncapsulation, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';\r\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\r\nimport { DeviceDetectorService } from 'ngx-device-detector';\r\nimport { MatBottomSheet } from '@angular/material/bottom-sheet';\r\nimport { MatBottomSheetRef } from '@angular/material/bottom-sheet';\r\nimport { Subscription } from 'rxjs';\r\n\r\n@Component({\r\n selector: 'sd-modal',\r\n templateUrl: './modal.component.html',\r\n styleUrls: ['./modal.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdModal implements OnInit, OnDestroy {\r\n static index = 0;\r\n @ViewChild('templateRef') templateRef: TemplateRef<any>;\r\n @Input() title: string;\r\n @Input() noClose: boolean;\r\n @Input() type: 'primary' | 'info' | 'success' | 'warning' | 'danger';\r\n @Input() width: 'lg' | 'md' | 'sm' | string;\r\n @Input() height = 'auto';\r\n @Input() view: 'dialog' | 'bottomSheet';\r\n @Input() lazyLoadContent = true;\r\n @Input() closeClickOutSide: boolean;\r\n @ViewChild('modal') modal: ElementRef;\r\n isOpened = false;\r\n alreadyOpened = false;\r\n isMobileOrTablet = false;\r\n private bottomSheetRef: MatBottomSheetRef<any>;\r\n private dialogRef: MatDialogRef<any>;\r\n private subcription = new Subscription();\r\n constructor(\r\n private ref: ChangeDetectorRef,\r\n private dialog: MatDialog,\r\n private bottomSheet: MatBottomSheet,\r\n deviceService: DeviceDetectorService) {\r\n this.isMobileOrTablet = !deviceService.isDesktop();\r\n }\r\n ngOnInit(): void {\r\n this.type = this.type || 'primary';\r\n this.width = this.width || '80vw';\r\n if (!this.isMobileOrTablet) {\r\n switch (this.width) {\r\n case 'lg':\r\n this.width = '80vw';\r\n break;\r\n case 'md':\r\n this.width = '60vw';\r\n break;\r\n case 'sm':\r\n this.width = '40vw';\r\n break;\r\n }\r\n }\r\n }\r\n\r\n ngOnDestroy() {\r\n this.subcription?.unsubscribe();\r\n }\r\n\r\n open = (): void => {\r\n if (this.isOpened) {\r\n return;\r\n }\r\n this.ref.markForCheck();\r\n this.alreadyOpened = true;\r\n this.isOpened = true;\r\n if ((!this.view && this.isMobileOrTablet) || this.view === 'bottomSheet') {\r\n this.bottomSheetRef = this.bottomSheet.open(this.templateRef);\r\n this.subcription.add(this.bottomSheetRef.afterDismissed().subscribe(() => {\r\n this.isOpened = false;\r\n }));\r\n } else {\r\n this.dialogRef = this.dialog.open(this.templateRef, {\r\n width: this.width,\r\n maxWidth: this.width,\r\n disableClose: !this.closeClickOutSide // mặc định ko cho đóng modal khi click out side\r\n });\r\n this.subcription.add(this.dialogRef.afterClosed().subscribe(() => {\r\n this.isOpened = false;\r\n }));\r\n }\r\n }\r\n\r\n close = (): void => {\r\n this.ref.markForCheck();\r\n this.bottomSheetRef?.dismiss();\r\n this.dialogRef?.close();\r\n }\r\n}\r\n","import { Component, OnInit, ViewEncapsulation } from '@angular/core';\r\nimport { DeviceDetectorService } from 'ngx-device-detector';\r\n\r\n@Component({\r\n selector: 'sd-modal-header',\r\n templateUrl: './modal-header.component.html',\r\n styleUrls: [\r\n './modal-header.component.scss'],\r\n encapsulation: ViewEncapsulation.None\r\n})\r\nexport class SdModalHeader implements OnInit {\r\n isMobileOrTablet = false;\r\n constructor(deviceService: DeviceDetectorService) {\r\n this.isMobileOrTablet = !deviceService.isDesktop();\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n}\r\n","import { Component, OnInit, Input } from '@angular/core';\r\nimport { DeviceDetectorService } from 'ngx-device-detector';\r\n\r\n@Component({\r\n selector: 'sd-modal-body',\r\n templateUrl: './modal-body.component.html',\r\n styleUrls: ['./modal-body.component.scss'],\r\n})\r\nexport class SdModalBody implements OnInit {\r\n @Input() height = 'auto';\r\n isMobileOrTablet = false;\r\n constructor(deviceService: DeviceDetectorService) {\r\n this.isMobileOrTablet = !deviceService.isDesktop();\r\n }\r\n ngOnInit() {\r\n }\r\n}\r\n","import { Component, OnInit, ViewEncapsulation } from '@angular/core';\r\nimport { DeviceDetectorService } from 'ngx-device-detector';\r\n\r\n@Component({\r\n selector: 'sd-modal-footer',\r\n templateUrl: './modal-footer.component.html',\r\n styleUrls: ['./modal-footer.component.scss']\r\n})\r\nexport class SdModalFooter implements OnInit {\r\n isMobileOrTablet = false;\r\n constructor(deviceService: DeviceDetectorService) {\r\n this.isMobileOrTablet = !deviceService.isDesktop();\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n}\r\n","import { Component, ViewChild, TemplateRef, Input } from '@angular/core';\r\nimport { MatBottomSheet } from '@angular/material/bottom-sheet';\r\n\r\n@Component({\r\n selector: 'sd-bottom-sheet',\r\n templateUrl: './bottom-sheet.component.html'\r\n})\r\nexport class SdBottomSheet {\r\n @ViewChild('templateRef') templateRef: TemplateRef<OptionTemplateContext>;\r\n @Input() title: string;\r\n isOpened = false;\r\n constructor(\r\n private bottomSheet: MatBottomSheet,\r\n ) { }\r\n\r\n open = () => {\r\n this.isOpened = true;\r\n this.bottomSheet.open(this.templateRef);\r\n }\r\n\r\n close = () => {\r\n this.bottomSheet.dismiss();\r\n }\r\n}\r\n\r\ninterface OptionTemplateContext {\r\n $implicit: any;\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'sd-bottom-sheet-header',\r\n templateUrl: './bottom-sheet-header.component.html'\r\n})\r\nexport class SdBottomSheetHeader implements OnInit {\r\n constructor() { }\r\n\r\n ngOnInit() {\r\n }\r\n}\r\n","import { Component, OnInit, Input } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'sd-bottom-sheet-body',\r\n templateUrl: './bottom-sheet-body.component.html'\r\n})\r\nexport class SdBottomSheetBody implements OnInit {\r\n @Input() height = 'auto';\r\n constructor() { }\r\n\r\n ngOnInit() {\r\n }\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'sd-bottom-sheet-footer',\r\n templateUrl: './bottom-sheet-footer.component.html',\r\n styleUrls: ['./bottom-sheet-footer.component.scss']\r\n})\r\nexport class SdBottomSheetFooter implements OnInit {\r\n constructor() { }\r\n\r\n ngOnInit() {\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdModal } from './modal/modal.component';\r\nimport { SdModalHeader } from './modal/modal-header/modal-header.component';\r\nimport { SdModalBody } from './modal/modal-body/modal-body.component';\r\nimport { SdModalFooter } from './modal/modal-footer/modal-footer.component';\r\nimport { SdBottomSheet } from './bottom-sheet/bottom-sheet.component';\r\nimport { SdBottomSheetHeader } from './bottom-sheet/bottom-sheet-header/bottom-sheet-header.component';\r\nimport { SdBottomSheetBody } from './bottom-sheet/bottom-sheet-body/bottom-sheet-body.component';\r\nimport { SdBottomSheetFooter } from './bottom-sheet/bottom-sheet-footer/bottom-sheet-footer.component';\r\n\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatBottomSheetModule } from '@angular/material/bottom-sheet';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { SdButtonModule } from '@sd-angular/core/button';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n MatIconModule,\r\n MatBottomSheetModule,\r\n MatDialogModule,\r\n MatButtonModule,\r\n SdButtonModule\r\n ],\r\n declarations: [\r\n SdModal,\r\n SdModalHeader,\r\n SdModalBody,\r\n SdModalFooter,\r\n SdBottomSheet,\r\n SdBottomSheetHeader,\r\n SdBottomSheetBody,\r\n SdBottomSheetFooter\r\n ],\r\n exports: [\r\n SdModal,\r\n SdModalHeader,\r\n SdModalBody,\r\n SdModalFooter,\r\n SdBottomSheet,\r\n SdBottomSheetHeader,\r\n SdBottomSheetBody,\r\n SdBottomSheetFooter\r\n ],\r\n providers: [\r\n ]\r\n})\r\nexport class SdModalModule {\r\n\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../../projects/sd-core/modal/src/lib/modal/modal.component.ts","../../../../projects/sd-core/modal/src/lib/modal/modal-header/modal-header.component.ts","../../../../projects/sd-core/modal/src/lib/modal/modal-body/modal-body.component.ts","../../../../projects/sd-core/modal/src/lib/modal/modal-footer/modal-footer.component.ts","../../../../projects/sd-core/modal/src/lib/bottom-sheet/bottom-sheet.component.ts","../../../../projects/sd-core/modal/src/lib/bottom-sheet/bottom-sheet-header/bottom-sheet-header.component.ts","../../../../projects/sd-core/modal/src/lib/bottom-sheet/bottom-sheet-body/bottom-sheet-body.component.ts","../../../../projects/sd-core/modal/src/lib/bottom-sheet/bottom-sheet-footer/bottom-sheet-footer.component.ts","../../../../projects/sd-core/modal/src/lib/modal.module.ts"],"names":["SdModal","ref","dialog","bottomSheet","deviceService","_this","this","height","lazyLoadContent","sdClosed","EventEmitter","isOpened","alreadyOpened","isMobileOrTablet","subcription","Subscription","open","markForCheck","view","bottomSheetRef","templateRef","add","afterDismissed","subscribe","emit","dialogRef","width","maxWidth","disableClose","closeClickOutSide","afterClosed","close","_a","dismiss","_b","isDesktop","prototype","ngOnInit","type","ngOnDestroy","unsubscribe","index","Component","args","selector","template","encapsulation","ViewEncapsulation","None","changeDetection","ChangeDetectionStrategy","OnPush","ChangeDetectorRef","MatDialog","MatBottomSheet","DeviceDetectorService","ViewChild","Input","Output","SdModalHeader","SdModalBody","SdModalFooter","SdBottomSheetHeader","SdBottomSheetBody","SdBottomSheetFooter","NgModule","imports","CommonModule","MatIconModule","MatBottomSheetModule","MatDialogModule","MatButtonModule","SdButtonModule","declarations","SdBottomSheet","exports","providers"],"mappings":"uhCAiCE,SAAAA,EACUC,EACAC,EACAC,EACRC,GAJF,IAAAC,EAAAC,KACUA,KAAAL,IAAAA,EACAK,KAAAJ,OAAAA,EACAI,KAAAH,YAAAA,EAfDG,KAAAC,OAAS,OAETD,KAAAE,iBAAkB,EAEjBF,KAAAG,SAAW,IAAIC,EAAAA,aAEzBJ,KAAAK,UAAW,EACXL,KAAAM,eAAgB,EAChBN,KAAAO,kBAAmB,EAGXP,KAAAQ,YAAc,IAAIC,EAAAA,aA8B1BT,KAAAU,KAAO,WACDX,EAAKM,WAGTN,EAAKJ,IAAIgB,eACTZ,EAAKO,eAAgB,EACrBP,EAAKM,UAAW,GACVN,EAAKa,MAA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3B,UAAAC,SAAA,sCARDK,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,uBACVC,SAAA,2JAGCY,EAAAA,0BCCD,SAAAO,YAEAA,EAAA5B,UAAAC,SAAA,sCARDK,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,yBACVC,SAAA,8UC6CF,iCAhCCoB,EAAAA,SAAQtB,KAAA,CAAC,CACRuB,QAAS,CACPC,EAAAA,aACAC,EAAAA,cACAC,EAAAA,qBACAC,EAAAA,gBACAC,EAAAA,gBACAC,EAAAA,gBAEFC,aAAc,CACZzE,EACA2D,EACAC,EACAC,EACAa,EACAZ,EACAC,EACAC,GAEFW,QAAS,CACP3E,EACA2D,EACAC,EACAC,EACAa,EACAZ,EACAC,EACAC,GAEFY,UAAW","sourcesContent":["import { Component, ElementRef, Input, ViewChild, OnInit, OnDestroy, TemplateRef, ViewEncapsulation, ChangeDetectionStrategy, ChangeDetectorRef, Output, EventEmitter } from '@angular/core';\r\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\r\nimport { DeviceDetectorService } from 'ngx-device-detector';\r\nimport { MatBottomSheet } from '@angular/material/bottom-sheet';\r\nimport { MatBottomSheetRef } from '@angular/material/bottom-sheet';\r\nimport { Subscription } from 'rxjs';\r\n\r\n@Component({\r\n selector: 'sd-modal',\r\n templateUrl: './modal.component.html',\r\n styleUrls: ['./modal.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdModal implements OnInit, OnDestroy {\r\n static index = 0;\r\n @ViewChild('templateRef') templateRef: TemplateRef<any>;\r\n @Input() title: string;\r\n @Input() noClose: boolean;\r\n @Input() type: 'primary' | 'info' | 'success' | 'warning' | 'danger';\r\n @Input() width: 'lg' | 'md' | 'sm' | string;\r\n @Input() height = 'auto';\r\n @Input() view: 'dialog' | 'bottomSheet';\r\n @Input() lazyLoadContent = true;\r\n @Input() closeClickOutSide: boolean;\r\n @Output() sdClosed = new EventEmitter();\r\n @ViewChild('modal') modal: ElementRef;\r\n isOpened = false;\r\n alreadyOpened = false;\r\n isMobileOrTablet = false;\r\n private bottomSheetRef: MatBottomSheetRef<any>;\r\n private dialogRef: MatDialogRef<any>;\r\n private subcription = new Subscription();\r\n constructor(\r\n private ref: ChangeDetectorRef,\r\n private dialog: MatDialog,\r\n private bottomSheet: MatBottomSheet,\r\n deviceService: DeviceDetectorService) {\r\n this.isMobileOrTablet = !deviceService.isDesktop();\r\n }\r\n ngOnInit(): void {\r\n this.type = this.type || 'primary';\r\n this.width = this.width || '80vw';\r\n if (!this.isMobileOrTablet) {\r\n switch (this.width) {\r\n case 'lg':\r\n this.width = '80vw';\r\n break;\r\n case 'md':\r\n this.width = '60vw';\r\n break;\r\n case 'sm':\r\n this.width = '40vw';\r\n break;\r\n }\r\n }\r\n }\r\n\r\n ngOnDestroy() {\r\n this.subcription.unsubscribe();\r\n }\r\n\r\n open = (): void => {\r\n if (this.isOpened) {\r\n return;\r\n }\r\n this.ref.markForCheck();\r\n this.alreadyOpened = true;\r\n this.isOpened = true;\r\n if ((!this.view && this.isMobileOrTablet) || this.view === 'bottomSheet') {\r\n this.bottomSheetRef = this.bottomSheet.open(this.templateRef);\r\n this.subcription.add(this.bottomSheetRef.afterDismissed().subscribe(() => {\r\n this.isOpened = false;\r\n this.sdClosed.emit();\r\n }));\r\n } else {\r\n this.dialogRef = this.dialog.open(this.templateRef, {\r\n width: this.width,\r\n maxWidth: this.width,\r\n disableClose: !this.closeClickOutSide // mặc định ko cho đóng modal khi click out side\r\n });\r\n this.subcription.add(this.dialogRef.afterClosed().subscribe(() => {\r\n this.isOpened = false;\r\n this.sdClosed.emit();\r\n }));\r\n }\r\n }\r\n\r\n close = (): void => {\r\n this.ref.markForCheck();\r\n this.bottomSheetRef?.dismiss();\r\n this.dialogRef?.close();\r\n }\r\n}\r\n","import { Component, OnInit, ViewEncapsulation } from '@angular/core';\r\nimport { DeviceDetectorService } from 'ngx-device-detector';\r\n\r\n@Component({\r\n selector: 'sd-modal-header',\r\n templateUrl: './modal-header.component.html',\r\n styleUrls: [\r\n './modal-header.component.scss'],\r\n encapsulation: ViewEncapsulation.None\r\n})\r\nexport class SdModalHeader implements OnInit {\r\n isMobileOrTablet = false;\r\n constructor(deviceService: DeviceDetectorService) {\r\n this.isMobileOrTablet = !deviceService.isDesktop();\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n}\r\n","import { Component, OnInit, Input } from '@angular/core';\r\nimport { DeviceDetectorService } from 'ngx-device-detector';\r\n\r\n@Component({\r\n selector: 'sd-modal-body',\r\n templateUrl: './modal-body.component.html',\r\n styleUrls: ['./modal-body.component.scss'],\r\n})\r\nexport class SdModalBody implements OnInit {\r\n @Input() height = 'auto';\r\n isMobileOrTablet = false;\r\n constructor(deviceService: DeviceDetectorService) {\r\n this.isMobileOrTablet = !deviceService.isDesktop();\r\n }\r\n ngOnInit() {\r\n }\r\n}\r\n","import { Component, OnInit, ViewEncapsulation } from '@angular/core';\r\nimport { DeviceDetectorService } from 'ngx-device-detector';\r\n\r\n@Component({\r\n selector: 'sd-modal-footer',\r\n templateUrl: './modal-footer.component.html',\r\n styleUrls: ['./modal-footer.component.scss']\r\n})\r\nexport class SdModalFooter implements OnInit {\r\n isMobileOrTablet = false;\r\n constructor(deviceService: DeviceDetectorService) {\r\n this.isMobileOrTablet = !deviceService.isDesktop();\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n}\r\n","import { Component, ViewChild, TemplateRef, Input } from '@angular/core';\r\nimport { MatBottomSheet } from '@angular/material/bottom-sheet';\r\n\r\n@Component({\r\n selector: 'sd-bottom-sheet',\r\n templateUrl: './bottom-sheet.component.html'\r\n})\r\nexport class SdBottomSheet {\r\n @ViewChild('templateRef') templateRef: TemplateRef<OptionTemplateContext>;\r\n @Input() title: string;\r\n isOpened = false;\r\n constructor(\r\n private bottomSheet: MatBottomSheet,\r\n ) { }\r\n\r\n open = () => {\r\n this.isOpened = true;\r\n this.bottomSheet.open(this.templateRef);\r\n }\r\n\r\n close = () => {\r\n this.bottomSheet.dismiss();\r\n }\r\n}\r\n\r\ninterface OptionTemplateContext {\r\n $implicit: any;\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'sd-bottom-sheet-header',\r\n templateUrl: './bottom-sheet-header.component.html'\r\n})\r\nexport class SdBottomSheetHeader implements OnInit {\r\n constructor() { }\r\n\r\n ngOnInit() {\r\n }\r\n}\r\n","import { Component, OnInit, Input } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'sd-bottom-sheet-body',\r\n templateUrl: './bottom-sheet-body.component.html'\r\n})\r\nexport class SdBottomSheetBody implements OnInit {\r\n @Input() height = 'auto';\r\n constructor() { }\r\n\r\n ngOnInit() {\r\n }\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'sd-bottom-sheet-footer',\r\n templateUrl: './bottom-sheet-footer.component.html',\r\n styleUrls: ['./bottom-sheet-footer.component.scss']\r\n})\r\nexport class SdBottomSheetFooter implements OnInit {\r\n constructor() { }\r\n\r\n ngOnInit() {\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdModal } from './modal/modal.component';\r\nimport { SdModalHeader } from './modal/modal-header/modal-header.component';\r\nimport { SdModalBody } from './modal/modal-body/modal-body.component';\r\nimport { SdModalFooter } from './modal/modal-footer/modal-footer.component';\r\nimport { SdBottomSheet } from './bottom-sheet/bottom-sheet.component';\r\nimport { SdBottomSheetHeader } from './bottom-sheet/bottom-sheet-header/bottom-sheet-header.component';\r\nimport { SdBottomSheetBody } from './bottom-sheet/bottom-sheet-body/bottom-sheet-body.component';\r\nimport { SdBottomSheetFooter } from './bottom-sheet/bottom-sheet-footer/bottom-sheet-footer.component';\r\n\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatBottomSheetModule } from '@angular/material/bottom-sheet';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { SdButtonModule } from '@sd-angular/core/button';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n MatIconModule,\r\n MatBottomSheetModule,\r\n MatDialogModule,\r\n MatButtonModule,\r\n SdButtonModule\r\n ],\r\n declarations: [\r\n SdModal,\r\n SdModalHeader,\r\n SdModalBody,\r\n SdModalFooter,\r\n SdBottomSheet,\r\n SdBottomSheetHeader,\r\n SdBottomSheetBody,\r\n SdBottomSheetFooter\r\n ],\r\n exports: [\r\n SdModal,\r\n SdModalHeader,\r\n SdModalBody,\r\n SdModalFooter,\r\n SdBottomSheet,\r\n SdBottomSheetHeader,\r\n SdBottomSheetBody,\r\n SdBottomSheetFooter\r\n ],\r\n providers: [\r\n ]\r\n})\r\nexport class SdModalModule {\r\n\r\n}\r\n"]}
@@ -572,14 +572,13 @@
572
572
 
573
573
  var _rootRoute, _subscription, _firstLoad, _closeTab, _activeRoute, _getActivatedRouteSnapshot, _getActivatedRoute;
574
574
  var SdTabRouterOutletComponent = /** @class */ (function () {
575
- function SdTabRouterOutletComponent(router$1, activatedRoute, cd, injector, compiler, tabDecoratorService, tabRouterService, sdNotifyService) {
575
+ function SdTabRouterOutletComponent(router$1, activatedRoute, cd, injector, compiler, tabRouterService, sdNotifyService) {
576
576
  var _this = this;
577
577
  this.router = router$1;
578
578
  this.activatedRoute = activatedRoute;
579
579
  this.cd = cd;
580
580
  this.injector = injector;
581
581
  this.compiler = compiler;
582
- this.tabDecoratorService = tabDecoratorService;
583
582
  this.tabRouterService = tabRouterService;
584
583
  this.sdNotifyService = sdNotifyService;
585
584
  this.tabs = [];
@@ -864,7 +863,6 @@
864
863
  { type: i0.ChangeDetectorRef },
865
864
  { type: i0.Injector },
866
865
  { type: i0.Compiler },
867
- { type: SdTabDecoratorService },
868
866
  { type: SdTabRouterService },
869
867
  { type: i1.SdNotifyService }
870
868
  ]; };