carbon-components-svelte/tests/ComposedModal.test.svelte
Eric Liu 0a69f8ec74
Various features/fixes (#727)
* fix(data-table): export useStaticWidth prop

* docs(data-table): add static width example

* fix(data-table): do not render table header if title/description not provided

* feat(modal): dispatch "click:button--primary" as an alias to "submit"

* test: update DataTable types test

* test(modal): update modal type tests

* docs(data-table): add clear reminder to key headers/rows
2021-07-05 13:22:56 -07:00

26 lines
635 B
Svelte

<script lang="ts">
import {
ComposedModal,
ModalHeader,
ModalBody,
ModalFooter,
Checkbox,
} from "../types";
let checked = false;
</script>
<ComposedModal open on:close on:click:button--primary>
<ModalHeader title="Confirm changes" />
<ModalBody hasForm>
<Checkbox labelText="I have reviewed the changes" bind:checked />
</ModalBody>
<ModalFooter
primaryButtonText="Proceed"
primaryButtonDisabled="{!checked}"
secondaryButtons="{[{ text: 'Cancel' }, { text: 'Duplicate' }]}"
on:click:button--secondary="{({ detail }) => {
console.log(detail);
}}"
/>
</ComposedModal>