feat(ui-shell): forward click event to HeaderActionLink (#1797)

Closes #1796
This commit is contained in:
Michael Greminger 2023-08-26 12:17:05 -05:00 committed by GitHub
commit e5675eb203
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 3 deletions

View file

@ -1652,7 +1652,9 @@ None.
### Events ### Events
None. | Event name | Type | Detail |
| :--------- | :-------- | :----- |
| click | forwarded | -- |
## `HeaderGlobalAction` ## `HeaderGlobalAction`

View file

@ -5064,7 +5064,7 @@
"slot_props": "{}" "slot_props": "{}"
} }
], ],
"events": [], "events": [{ "type": "forwarded", "name": "click", "element": "a" }],
"typedefs": [], "typedefs": [],
"rest_props": { "type": "Element", "name": "a" } "rest_props": { "type": "Element", "name": "a" }
}, },

View file

@ -25,6 +25,7 @@
href="{href}" href="{href}"
rel="{$$restProps.target === '_blank' ? 'noopener noreferrer' : undefined}" rel="{$$restProps.target === '_blank' ? 'noopener noreferrer' : undefined}"
{...$$restProps} {...$$restProps}
on:click
> >
<slot name="icon"> <slot name="icon">
<svelte:component this="{icon}" size="{20}" /> <svelte:component this="{icon}" size="{20}" />

View file

@ -33,6 +33,6 @@ export interface HeaderActionLinkProps extends RestProps {
export default class HeaderActionLink extends SvelteComponentTyped< export default class HeaderActionLink extends SvelteComponentTyped<
HeaderActionLinkProps, HeaderActionLinkProps,
Record<string, any>, { click: WindowEventMap["click"] },
{ icon: {} } { icon: {} }
> {} > {}