mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 19:46:36 +00:00
docs: add dispatched event details
Brought in part by sveld 0.18
This commit is contained in:
parent
1b54825c85
commit
1627fa023f
5 changed files with 38 additions and 9 deletions
|
@ -8406,7 +8406,8 @@
|
||||||
{
|
{
|
||||||
"type": "dispatched",
|
"type": "dispatched",
|
||||||
"name": "change",
|
"name": "change",
|
||||||
"detail": "{ page?: number; pageSize?: number }"
|
"detail": "{ page?: number; pageSize?: number }",
|
||||||
|
"description": "Dispatched after any user interaction"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "dispatched",
|
"type": "dispatched",
|
||||||
|
@ -10257,7 +10258,12 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"events": [
|
"events": [
|
||||||
{ "type": "dispatched", "name": "update", "detail": "string | number" },
|
{
|
||||||
|
"type": "dispatched",
|
||||||
|
"name": "update",
|
||||||
|
"detail": "string | number",
|
||||||
|
"description": "The selected value."
|
||||||
|
},
|
||||||
{ "type": "forwarded", "name": "change", "element": "select" },
|
{ "type": "forwarded", "name": "change", "element": "select" },
|
||||||
{ "type": "forwarded", "name": "input", "element": "select" },
|
{ "type": "forwarded", "name": "input", "element": "select" },
|
||||||
{ "type": "forwarded", "name": "focus", "element": "select" },
|
{ "type": "forwarded", "name": "focus", "element": "select" },
|
||||||
|
|
|
@ -168,11 +168,33 @@
|
||||||
<h2 id="dispatched-events">Dispatched events</h2>
|
<h2 id="dispatched-events">Dispatched events</h2>
|
||||||
|
|
||||||
{#if dispatched_events.length > 0}
|
{#if dispatched_events.length > 0}
|
||||||
<UnorderedList class="my-layout-01-03">
|
{@const hasDescription = dispatched_events.find((el) => el.description)}
|
||||||
|
<StructuredList flush>
|
||||||
|
<StructuredListHead>
|
||||||
|
<StructuredListRow>
|
||||||
|
<StructuredListCell>Event name</StructuredListCell>
|
||||||
|
<StructuredListCell><code>event.details</code> type</StructuredListCell>
|
||||||
|
{#if hasDescription}
|
||||||
|
<StructuredListCell>Description</StructuredListCell>
|
||||||
|
{/if}
|
||||||
|
</StructuredListRow>
|
||||||
|
</StructuredListHead>
|
||||||
|
<StructuredListBody>
|
||||||
{#each dispatched_events as event (event.name)}
|
{#each dispatched_events as event (event.name)}
|
||||||
<ListItem>on:{event.name}</ListItem>
|
<StructuredListRow>
|
||||||
|
<StructuredListCell>
|
||||||
|
<strong>on:{event.name}</strong>
|
||||||
|
</StructuredListCell>
|
||||||
|
<StructuredListCell>
|
||||||
|
<code>{event.detail}</code>
|
||||||
|
</StructuredListCell>
|
||||||
|
<StructuredListCell>
|
||||||
|
{event.description ?? ""}
|
||||||
|
</StructuredListCell>
|
||||||
|
</StructuredListRow>
|
||||||
{/each}
|
{/each}
|
||||||
</UnorderedList>
|
</StructuredListBody>
|
||||||
|
</StructuredList>
|
||||||
{:else}
|
{:else}
|
||||||
<p class="my-layout-01-03">No dispatched events.</p>
|
<p class="my-layout-01-03">No dispatched events.</p>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
/**
|
/**
|
||||||
* @event {string | number} update
|
* @event {string | number} update The selected value.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
1
types/Pagination/Pagination.svelte.d.ts
vendored
1
types/Pagination/Pagination.svelte.d.ts
vendored
|
@ -103,6 +103,7 @@ export interface PaginationProps
|
||||||
export default class Pagination extends SvelteComponentTyped<
|
export default class Pagination extends SvelteComponentTyped<
|
||||||
PaginationProps,
|
PaginationProps,
|
||||||
{
|
{
|
||||||
|
/** Dispatched after any user interaction */
|
||||||
change: CustomEvent<{ page?: number; pageSize?: number }>;
|
change: CustomEvent<{ page?: number; pageSize?: number }>;
|
||||||
["click:button--previous"]: CustomEvent<{ page: number }>;
|
["click:button--previous"]: CustomEvent<{ page: number }>;
|
||||||
["click:button--next"]: CustomEvent<{ page: number }>;
|
["click:button--next"]: CustomEvent<{ page: number }>;
|
||||||
|
|
2
types/Select/Select.svelte.d.ts
vendored
2
types/Select/Select.svelte.d.ts
vendored
|
@ -109,7 +109,7 @@ export interface SelectProps
|
||||||
export default class Select extends SvelteComponentTyped<
|
export default class Select extends SvelteComponentTyped<
|
||||||
SelectProps,
|
SelectProps,
|
||||||
{
|
{
|
||||||
update: CustomEvent<string | number>;
|
/** The selected value. */ update: CustomEvent<string | number>;
|
||||||
change: WindowEventMap["change"];
|
change: WindowEventMap["change"];
|
||||||
input: WindowEventMap["input"];
|
input: WindowEventMap["input"];
|
||||||
focus: WindowEventMap["focus"];
|
focus: WindowEventMap["focus"];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue