mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11: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
|
@ -4679,10 +4679,12 @@ None.
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
| Event name | Type | Detail |
|
| Event name | Type | Detail |
|
||||||
| :--------- | :-------- | :----- |
|
| :--------- | :--------- | :--------------- |
|
||||||
| click | forwarded | -- |
|
| open | dispatched | <code>any</code> |
|
||||||
| mousedown | forwarded | -- |
|
| close | dispatched | <code>any</code> |
|
||||||
|
| click | forwarded | -- |
|
||||||
|
| mousedown | forwarded | -- |
|
||||||
|
|
||||||
## `TooltipDefinition`
|
## `TooltipDefinition`
|
||||||
|
|
||||||
|
|
|
@ -13090,6 +13090,8 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"events": [
|
"events": [
|
||||||
|
{ "type": "dispatched", "name": "open", "detail": "any" },
|
||||||
|
{ "type": "dispatched", "name": "close", "detail": "any" },
|
||||||
{ "type": "forwarded", "name": "click", "element": "div" },
|
{ "type": "forwarded", "name": "click", "element": "div" },
|
||||||
{ "type": "forwarded", "name": "mousedown", "element": "div" }
|
{ "type": "forwarded", "name": "mousedown", "element": "div" }
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* @event {any} open
|
||||||
|
* @event {any} close
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the alignment of the tooltip relative to the icon
|
* Set the alignment of the tooltip relative to the icon
|
||||||
* @type {"start" | "center" | "end"}
|
* @type {"start" | "center" | "end"}
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Tooltip, Link, Button } from "../types";
|
import { Tooltip, Link, Button } from "../types";
|
||||||
import Catalog16 from "carbon-icons-svelte/lib/Catalog16";
|
import Catalog16 from "carbon-icons-svelte/lib/Catalog16";
|
||||||
|
|
||||||
|
let open = true;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Tooltip>
|
<Tooltip bind:open on:open on:close>
|
||||||
<p>Resources are provisioned based on your account's organization.</p>
|
<p>Resources are provisioned based on your account's organization.</p>
|
||||||
</Tooltip>
|
</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<
|
export default class Tooltip extends SvelteComponentTyped<
|
||||||
TooltipProps,
|
TooltipProps,
|
||||||
{ click: WindowEventMap["click"]; mousedown: WindowEventMap["mousedown"] },
|
{
|
||||||
|
open: CustomEvent<any>;
|
||||||
|
close: CustomEvent<any>;
|
||||||
|
click: WindowEventMap["click"];
|
||||||
|
mousedown: WindowEventMap["mousedown"];
|
||||||
|
},
|
||||||
{ default: {}; icon: {}; triggerText: {} }
|
{ default: {}; icon: {}; triggerText: {} }
|
||||||
> {}
|
> {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue