Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(selectable-tile): include dispatched events in types #1695

Merged
merged 1 commit into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions COMPONENT_INDEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -3272,13 +3272,15 @@ None.

### Events

| Event name | Type | Detail |
| :--------- | :-------- | :----- |
| click | forwarded | -- |
| mouseover | forwarded | -- |
| mouseenter | forwarded | -- |
| mouseleave | forwarded | -- |
| keydown | forwarded | -- |
| Event name | Type | Detail |
| :--------- | :--------- | :------------------ |
| select | dispatched | <code>string</code> |
| deselect | dispatched | <code>string</code> |
| click | forwarded | -- |
| mouseover | forwarded | -- |
| mouseenter | forwarded | -- |
| mouseleave | forwarded | -- |
| keydown | forwarded | -- |

## `SideNav`

Expand Down
2 changes: 2 additions & 0 deletions docs/src/COMPONENT_API.json
Original file line number Diff line number Diff line change
Expand Up @@ -10544,6 +10544,8 @@
"moduleExports": [],
"slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }],
"events": [
{ "type": "dispatched", "name": "select", "detail": "string" },
{ "type": "dispatched", "name": "deselect", "detail": "string" },
{ "type": "forwarded", "name": "click", "element": "label" },
{ "type": "forwarded", "name": "mouseover", "element": "label" },
{ "type": "forwarded", "name": "mouseenter", "element": "label" },
Expand Down
5 changes: 5 additions & 0 deletions src/Tile/SelectableTile.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<script>
/**
* @event {string} "select"
* @event {string} "deselect"
*/

/** Set to `true` to select the tile */
export let selected = false;

Expand Down
2 changes: 2 additions & 0 deletions types/Tile/SelectableTile.svelte.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export interface SelectableTileProps
export default class SelectableTile extends SvelteComponentTyped<
SelectableTileProps,
{
select: CustomEvent<string>;
deselect: CustomEvent<string>;
click: WindowEventMap["click"];
mouseover: WindowEventMap["mouseover"];
mouseenter: WindowEventMap["mouseenter"];
Expand Down