2020-02-19 05:51:28 +13:00
|
|
|
<script>
|
2021-04-29 00:59:55 +12:00
|
|
|
import { Modal, ModalContent, Body } from "@budibase/bbui"
|
2020-02-25 04:00:48 +13:00
|
|
|
|
|
|
|
export let title = ""
|
2020-10-03 09:06:06 +13:00
|
|
|
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
|
2021-05-10 23:28:54 +12:00
|
|
|
export let warning = true
|
2020-10-03 00:00:17 +13:00
|
|
|
|
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}>
|
2021-05-10 23:28:54 +12:00
|
|
|
<ModalContent
|
|
|
|
onConfirm={onOk}
|
|
|
|
{title}
|
|
|
|
confirmText={okText}
|
|
|
|
{cancelText}
|
|
|
|
{warning}
|
|
|
|
>
|
2021-04-30 23:31:45 +12:00
|
|
|
<Body size="S">
|
2020-10-15 00:22:43 +13:00
|
|
|
{body}
|
|
|
|
<slot />
|
2021-04-29 00:59:55 +12:00
|
|
|
</Body>
|
2020-10-08 21:35:11 +13:00
|
|
|
</ModalContent>
|
2020-09-03 19:44:08 +12:00
|
|
|
</Modal>
|