revert
This commit is contained in:
parent
e637a86a2b
commit
2f407ad7d8
|
@ -2,7 +2,7 @@
|
|||
import { getContext } from "svelte"
|
||||
import Context from "../context"
|
||||
|
||||
const { hide } = getContext(Context.Modal)
|
||||
const { hide } = getContext(Context.Modal) as { hide: () => void }
|
||||
|
||||
let count: number = 0
|
||||
const clicks: number = 5
|
||||
|
|
|
@ -73,7 +73,12 @@
|
|||
})
|
||||
}
|
||||
|
||||
setContext(Context.Modal, { show, hide, toggle, cancel })
|
||||
setContext(Context.Modal, {
|
||||
show,
|
||||
hide,
|
||||
toggle,
|
||||
cancel,
|
||||
} as { show: () => void; hide: () => void; toggle: () => void; cancel: () => void })
|
||||
|
||||
onMount(() => {
|
||||
document.addEventListener("keydown", handleKey)
|
||||
|
|
|
@ -30,7 +30,10 @@
|
|||
export let secondaryButtonWarning: boolean = false
|
||||
export let custom: boolean = false
|
||||
|
||||
const { hide, cancel } = getContext(Context.Modal)
|
||||
const { hide, cancel } = getContext(Context.Modal) as {
|
||||
hide: () => void
|
||||
cancel: () => void
|
||||
}
|
||||
|
||||
let loading: boolean = false
|
||||
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
declare module "svelte" {
|
||||
export function getContext(key: "bbui-modal"): {
|
||||
hide: () => void
|
||||
cancel: () => void
|
||||
show: () => void
|
||||
}
|
||||
export function getContext(key: "bbui-popover-root"): {
|
||||
show: () => void
|
||||
hide: () => void
|
||||
}
|
||||
export function getContext(key: "actionMenu"): {
|
||||
hideAll: () => void
|
||||
}
|
||||
}
|
||||
|
||||
declare const Context: {
|
||||
readonly Modal: "bbui-modal"
|
||||
readonly PopoverRoot: "bbui-popover-root"
|
||||
}
|
||||
|
||||
export default Context
|
|
@ -1,6 +1,4 @@
|
|||
const Context = {
|
||||
export default {
|
||||
Modal: "bbui-modal",
|
||||
PopoverRoot: "bbui-popover-root",
|
||||
} as const
|
||||
|
||||
export default Context
|
||||
}
|
Loading…
Reference in New Issue