mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +00:00
fix(outbound-link): forward Link events
This commit is contained in:
parent
422e991b71
commit
e91049a011
4 changed files with 24 additions and 3 deletions
|
@ -2376,7 +2376,12 @@ None.
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
None.
|
| Event name | Type | Detail |
|
||||||
|
| :--------- | :-------- | :----- |
|
||||||
|
| click | forwarded | -- |
|
||||||
|
| mouseover | forwarded | -- |
|
||||||
|
| mouseenter | forwarded | -- |
|
||||||
|
| mouseleave | forwarded | -- |
|
||||||
|
|
||||||
## `OverflowMenu`
|
## `OverflowMenu`
|
||||||
|
|
||||||
|
|
|
@ -5088,7 +5088,12 @@
|
||||||
"filePath": "/src/Link/OutboundLink.svelte",
|
"filePath": "/src/Link/OutboundLink.svelte",
|
||||||
"props": [],
|
"props": [],
|
||||||
"slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }],
|
"slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }],
|
||||||
"events": [],
|
"events": [
|
||||||
|
{ "type": "forwarded", "name": "click", "element": "Link" },
|
||||||
|
{ "type": "forwarded", "name": "mouseover", "element": "Link" },
|
||||||
|
{ "type": "forwarded", "name": "mouseenter", "element": "Link" },
|
||||||
|
{ "type": "forwarded", "name": "mouseleave", "element": "Link" }
|
||||||
|
],
|
||||||
"typedefs": [],
|
"typedefs": [],
|
||||||
"rest_props": { "type": "InlineComponent", "name": "Link" },
|
"rest_props": { "type": "InlineComponent", "name": "Link" },
|
||||||
"extends": { "interface": "LinkProps", "import": "\"./Link\"" }
|
"extends": { "interface": "LinkProps", "import": "\"./Link\"" }
|
||||||
|
|
|
@ -5,7 +5,14 @@
|
||||||
import Launch16 from "carbon-icons-svelte/lib/Launch16/Launch16.svelte";
|
import Launch16 from "carbon-icons-svelte/lib/Launch16/Launch16.svelte";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Link {...$$restProps} target="_blank">
|
<Link
|
||||||
|
{...$$restProps}
|
||||||
|
on:click
|
||||||
|
on:mouseover
|
||||||
|
on:mouseenter
|
||||||
|
on:mouseleave
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
<slot />
|
<slot />
|
||||||
<Launch16 />
|
<Launch16 />
|
||||||
</Link>
|
</Link>
|
||||||
|
|
4
types/Link/OutboundLink.d.ts
vendored
4
types/Link/OutboundLink.d.ts
vendored
|
@ -9,5 +9,9 @@ export default class OutboundLink {
|
||||||
default: {};
|
default: {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;
|
||||||
|
$on(eventname: "mouseover", cb: (event: WindowEventMap["mouseover"]) => void): () => void;
|
||||||
|
$on(eventname: "mouseenter", cb: (event: WindowEventMap["mouseenter"]) => void): () => void;
|
||||||
|
$on(eventname: "mouseleave", cb: (event: WindowEventMap["mouseleave"]) => void): () => void;
|
||||||
$on(eventname: string, cb: (event: Event) => void): () => void;
|
$on(eventname: string, cb: (event: Event) => void): () => void;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue