fix(types): improve e.detail type for dispatched events (#1907)

* fix(types): improve `e.detail` type for dispatched events

* Run "yarn build:docs"

* test: assert new types
This commit is contained in:
metonym 2024-02-01 07:56:34 -08:00 committed by GitHub
commit 6590457574
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 70 additions and 35 deletions

View file

@ -11,6 +11,9 @@
maxLabel="990 MB"
value="{100}"
fullWidth
on:change="{(e) => {
console.log(e.detail); // number
}}"
/>
<Slider

View file

@ -11,7 +11,13 @@
import CheckmarkFilled from "carbon-icons-svelte/lib/CheckmarkFilled.svelte";
</script>
<StructuredList>
<StructuredList
selection
selected="row-1-value"
on:change="{(e) => {
console.log(e.detail); // string
}}"
>
<StructuredListHead>
<StructuredListRow head>
<StructuredListCell head>Column A</StructuredListCell>

View file

@ -2,7 +2,11 @@
import { Tabs, Tab, TabContent, TabsSkeleton } from "../types";
</script>
<Tabs>
<Tabs
on:change="{(e) => {
console.log(e.detail); // number
}}"
>
<Tab label="Tab label 1" />
<Tab label="Tab label 2" />
<Tab label="Tab label 3" />