diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index f708aa4c..a34b1d40 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -4692,6 +4692,7 @@ None. | Prop name | Kind | Reactive | Type | Default value | Description | | :---------- | :--------------- | :------- | :------------------------------------------------ | ------------------------------------------------ | ----------------------------------------------------- | | ref | let | Yes | null | HTMLButtonElement | null | Obtain a reference to the button HTML element | +| open | let | Yes | boolean | false | Set to `true` to open the tooltip | | tooltipText | let | No | string | "" | Specify the tooltip text | | align | let | No | "start" | "center" | "end" | "center" | Set the alignment of the tooltip relative to the icon | | direction | let | No | "top" | "bottom" | "bottom" | Set the direction of the tooltip relative to the icon | @@ -4706,13 +4707,15 @@ None. ### Events -| Event name | Type | Detail | -| :--------- | :-------- | :----- | -| click | forwarded | -- | -| mouseover | forwarded | -- | -| mouseenter | forwarded | -- | -| mouseleave | forwarded | -- | -| focus | forwarded | -- | +| Event name | Type | Detail | +| :--------- | :--------- | :--------------- | +| open | dispatched | any | +| close | dispatched | any | +| click | forwarded | -- | +| mouseover | forwarded | -- | +| mouseenter | forwarded | -- | +| mouseleave | forwarded | -- | +| focus | forwarded | -- | ## `TooltipFooter` diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index b816f45f..0472a252 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -13110,6 +13110,17 @@ "constant": false, "reactive": false }, + { + "name": "open", + "kind": "let", + "description": "Set to `true` to open the tooltip", + "type": "boolean", + "value": "false", + "isFunction": false, + "isFunctionDeclaration": false, + "constant": false, + "reactive": true + }, { "name": "align", "kind": "let", @@ -13165,6 +13176,8 @@ } ], "events": [ + { "type": "dispatched", "name": "open", "detail": "any" }, + { "type": "dispatched", "name": "close", "detail": "any" }, { "type": "forwarded", "name": "click", "element": "button" }, { "type": "forwarded", "name": "mouseover", "element": "button" }, { "type": "forwarded", "name": "mouseenter", "element": "button" }, diff --git a/src/TooltipDefinition/TooltipDefinition.svelte b/src/TooltipDefinition/TooltipDefinition.svelte index 979d33a2..0cea292e 100644 --- a/src/TooltipDefinition/TooltipDefinition.svelte +++ b/src/TooltipDefinition/TooltipDefinition.svelte @@ -1,7 +1,17 @@ import { TooltipDefinition } from "../types"; + + let open = false; Armonk diff --git a/types/TooltipDefinition/TooltipDefinition.svelte.d.ts b/types/TooltipDefinition/TooltipDefinition.svelte.d.ts index 0c1d70cb..e90112a2 100644 --- a/types/TooltipDefinition/TooltipDefinition.svelte.d.ts +++ b/types/TooltipDefinition/TooltipDefinition.svelte.d.ts @@ -9,6 +9,12 @@ export interface TooltipDefinitionProps */ tooltipText?: string; + /** + * Set to `true` to open the tooltip + * @default false + */ + open?: boolean; + /** * Set the alignment of the tooltip relative to the icon * @default "center" @@ -37,6 +43,8 @@ export interface TooltipDefinitionProps export default class TooltipDefinition extends SvelteComponentTyped< TooltipDefinitionProps, { + open: CustomEvent; + close: CustomEvent; click: WindowEventMap["click"]; mouseover: WindowEventMap["mouseover"]; mouseenter: WindowEventMap["mouseenter"];