mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
fix(tooltip): type Tooltip
open, close events (#1058)
This commit is contained in:
parent
5358cf66ea
commit
504cf09dc8
5 changed files with 22 additions and 6 deletions
|
@ -4680,7 +4680,9 @@ None.
|
|||
### Events
|
||||
|
||||
| Event name | Type | Detail |
|
||||
| :--------- | :-------- | :----- |
|
||||
| :--------- | :--------- | :--------------- |
|
||||
| open | dispatched | <code>any</code> |
|
||||
| close | dispatched | <code>any</code> |
|
||||
| click | forwarded | -- |
|
||||
| mousedown | forwarded | -- |
|
||||
|
||||
|
|
|
@ -13090,6 +13090,8 @@
|
|||
}
|
||||
],
|
||||
"events": [
|
||||
{ "type": "dispatched", "name": "open", "detail": "any" },
|
||||
{ "type": "dispatched", "name": "close", "detail": "any" },
|
||||
{ "type": "forwarded", "name": "click", "element": "div" },
|
||||
{ "type": "forwarded", "name": "mousedown", "element": "div" }
|
||||
],
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
<script>
|
||||
/**
|
||||
* @event {any} open
|
||||
* @event {any} close
|
||||
*/
|
||||
|
||||
/**
|
||||
* Set the alignment of the tooltip relative to the icon
|
||||
* @type {"start" | "center" | "end"}
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
<script lang="ts">
|
||||
import { Tooltip, Link, Button } from "../types";
|
||||
import Catalog16 from "carbon-icons-svelte/lib/Catalog16";
|
||||
|
||||
let open = true;
|
||||
</script>
|
||||
|
||||
<Tooltip>
|
||||
<Tooltip bind:open on:open on:close>
|
||||
<p>Resources are provisioned based on your account's organization.</p>
|
||||
</Tooltip>
|
||||
|
||||
|
|
7
types/Tooltip/Tooltip.svelte.d.ts
vendored
7
types/Tooltip/Tooltip.svelte.d.ts
vendored
|
@ -91,6 +91,11 @@ export interface TooltipProps
|
|||
|
||||
export default class Tooltip extends SvelteComponentTyped<
|
||||
TooltipProps,
|
||||
{ click: WindowEventMap["click"]; mousedown: WindowEventMap["mousedown"] },
|
||||
{
|
||||
open: CustomEvent<any>;
|
||||
close: CustomEvent<any>;
|
||||
click: WindowEventMap["click"];
|
||||
mousedown: WindowEventMap["mousedown"];
|
||||
},
|
||||
{ default: {}; icon: {}; triggerText: {} }
|
||||
> {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue