mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
parent
f7551e4a8f
commit
5caad3eba0
19 changed files with 153 additions and 57 deletions
|
@ -75,6 +75,7 @@
|
|||
{ key: 'attached_groups', value: 'Attached Groups' },
|
||||
{ key: 'status', value: 'Status' }
|
||||
];
|
||||
let sortable = true;
|
||||
</script>
|
||||
|
||||
<Layout>
|
||||
|
@ -104,6 +105,28 @@
|
|||
</Table>
|
||||
</TableContainer>
|
||||
</DataTable>
|
||||
{:else if story === 'sortable'}
|
||||
<DataTable
|
||||
bind:sortable
|
||||
title={$$props.title}
|
||||
description={$$props.description}
|
||||
zebra={$$props.zebra}
|
||||
size={$$props.size}
|
||||
stickyHeader={$$props.stickyHeader}
|
||||
on:click={({ detail }) => {
|
||||
console.log('on:click', detail);
|
||||
}}
|
||||
on:click:header={({ detail }) => {
|
||||
console.log('on:click:header', detail);
|
||||
}}
|
||||
on:click:row={({ detail }) => {
|
||||
console.log('on:click:row', detail);
|
||||
}}
|
||||
on:click:cell={({ detail }) => {
|
||||
console.log('on:click:cell', detail);
|
||||
}}
|
||||
{rows}
|
||||
{headers} />
|
||||
{:else}
|
||||
<DataTable
|
||||
title={$$props.title}
|
||||
|
@ -111,6 +134,9 @@
|
|||
zebra={$$props.zebra}
|
||||
size={$$props.size}
|
||||
stickyHeader={$$props.stickyHeader}
|
||||
on:click={({ detail }) => {
|
||||
console.log('on:click', detail);
|
||||
}}
|
||||
on:click:header={({ detail }) => {
|
||||
console.log('on:click:header', detail);
|
||||
}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue