Adjust Settings Popup Position
This commit is contained in:
1 parent
010771b22a
commit
898df6a318
9 files changed
+64
-19
No files matched your search
@@ -1,4 +1,11 @@
|
||||
import { Component, output } from '@angular/core';
|
||||
import { Component, input, output } from '@angular/core';
|
||||
|
||||
export type PopupPosition = {
|
||||
top?: string;
|
||||
left?: string;
|
||||
right?: string;
|
||||
bottom?: string;
|
||||
};
|
||||
|
||||
@Component({
|
||||
selector: 'app-popup',
|
||||
@@ -7,6 +14,12 @@ import { Component, output } from '@angular/core';
|
||||
styleUrl: './popup.scss',
|
||||
})
|
||||
export class PopupComponent {
|
||||
/**
|
||||
* 팝업의 위치 (기본값은 'center')
|
||||
* 'center' 또는 { top, left, right, bottom } 객체를 받습니다.
|
||||
*/
|
||||
position = input<PopupPosition | 'center'>('center');
|
||||
|
||||
/**
|
||||
* 팝업 닫기 요청 (배경 클릭 또는 닫기 버튼)
|
||||
*/
|
||||
@@ -15,4 +28,13 @@ export class PopupComponent {
|
||||
onClose() {
|
||||
this.closeRequest.emit();
|
||||
}
|
||||
|
||||
get isCenter() {
|
||||
return this.position() === 'center';
|
||||
}
|
||||
|
||||
get customStyle() {
|
||||
const pos = this.position();
|
||||
return pos === 'center' ? {} : pos;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user