🎉 Init
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import type { Component } from 'vue'
|
||||
|
||||
export class Popup<P> {
|
||||
component?: Component
|
||||
payload?: P
|
||||
config?: PopupConfig
|
||||
|
||||
public static component<P>(component: Component): Popup<P> {
|
||||
const popup = new Popup<P>()
|
||||
popup.component = component
|
||||
return popup
|
||||
}
|
||||
|
||||
public setPayload(payload: P) {
|
||||
this.payload = payload
|
||||
return this
|
||||
}
|
||||
|
||||
public setConfig(config: PopupConfig) {
|
||||
this.config = config
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
export interface PopupConfig {
|
||||
heading: string
|
||||
size: PopupSize
|
||||
closeOnOverlayClick?: boolean
|
||||
callback?: (payload?: unknown) => void
|
||||
}
|
||||
|
||||
export enum PopupSize {
|
||||
SMALL = 'small',
|
||||
MEDIUM = 'medium',
|
||||
LARGE = 'large',
|
||||
FULL = 'full',
|
||||
}
|
||||
Reference in New Issue
Block a user