1
0
Fork 0
mirror of synced 2024-09-14 00:08:25 +12:00
budibase/packages/builder/src/components/common/ConfirmDialog.svelte

35 lines
651 B
Svelte
Raw Normal View History

2020-02-19 05:51:28 +13:00
<script>
2020-10-08 21:35:11 +13:00
import { Modal, ModalContent } 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
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} red>
<div class="body">
{body}
<slot />
</div>
2020-10-08 21:35:11 +13:00
</ModalContent>
</Modal>
2020-03-24 23:56:48 +13:00
<style>
.body {
font-size: var(--font-size-s);
}
2020-03-24 23:56:48 +13:00
</style>