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
This commit is contained in:
Eric Liu 2021-07-05 13:22:56 -07:00 committed by GitHub
commit 0a69f8ec74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 128 additions and 28 deletions

View file

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

View file

@ -98,6 +98,7 @@
description="Your organization's active load balancers."
headers="{headers}"
rows="{rows}"
useStaticWidth
/>
<DataTable

View file

@ -16,6 +16,7 @@
on:open
on:close
on:submit
on:click:button--primary
>
<p>Create a new Cloudant database in the US South region.</p>
</Modal>