1
0
Fork 0
mirror of synced 2024-09-18 10:20:11 +12:00
budibase/packages/builder/src/components/common/ConfirmDialog.svelte

36 lines
645 B
Svelte
Raw Normal View History

2020-02-19 05:51:28 +13:00
<script>
import { Modal, ModalContent, Body } from "@budibase/bbui"
2020-02-25 04:00:48 +13:00
export let title = ""
export let body = ""
export let okText = "Confirm"
export let cancelText = "Cancel"
2020-10-08 21:35:11 +13:00
export let onOk = undefined
export let onCancel = undefined
export let warning = true
2020-10-08 21:35:11 +13:00
let modal
2020-02-25 04:00:48 +13:00
export const show = () => {
2020-10-08 21:35:11 +13:00
modal.show()
2020-02-25 04:00:48 +13:00
}
export const hide = () => {
2020-10-08 21:35:11 +13:00
modal.hide()
2020-02-25 04:00:48 +13:00
}
2020-02-19 05:51:28 +13:00
</script>
2020-10-08 21:35:11 +13:00
<Modal bind:this={modal} on:hide={onCancel}>
<ModalContent
onConfirm={onOk}
{title}
confirmText={okText}
{cancelText}
{warning}
>
<Body size="S">
{body}
<slot />
</Body>
2020-10-08 21:35:11 +13:00
</ModalContent>
</Modal>