From 504cf09dc89d639cd03c3f4e1c8aa3a07c0f2824 Mon Sep 17 00:00:00 2001 From: metonym Date: Tue, 1 Feb 2022 07:20:43 -0800 Subject: [PATCH] fix(tooltip): type `Tooltip` open, close events (#1058) --- COMPONENT_INDEX.md | 10 ++++++---- docs/src/COMPONENT_API.json | 2 ++ src/Tooltip/Tooltip.svelte | 5 +++++ tests/Tooltip.test.svelte | 4 +++- types/Tooltip/Tooltip.svelte.d.ts | 7 ++++++- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index 6100ec0d..40dca5e0 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -4679,10 +4679,12 @@ None. ### Events -| Event name | Type | Detail | -| :--------- | :-------- | :----- | -| click | forwarded | -- | -| mousedown | forwarded | -- | +| Event name | Type | Detail | +| :--------- | :--------- | :--------------- | +| open | dispatched | any | +| close | dispatched | any | +| click | forwarded | -- | +| mousedown | forwarded | -- | ## `TooltipDefinition` diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index 96a991c2..8983f063 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -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" } ], diff --git a/src/Tooltip/Tooltip.svelte b/src/Tooltip/Tooltip.svelte index b6191b6f..2f270bd0 100644 --- a/src/Tooltip/Tooltip.svelte +++ b/src/Tooltip/Tooltip.svelte @@ -1,4 +1,9 @@ - +

Resources are provisioned based on your account's organization.

diff --git a/types/Tooltip/Tooltip.svelte.d.ts b/types/Tooltip/Tooltip.svelte.d.ts index 347c4e96..0e1fe782 100644 --- a/types/Tooltip/Tooltip.svelte.d.ts +++ b/types/Tooltip/Tooltip.svelte.d.ts @@ -91,6 +91,11 @@ export interface TooltipProps export default class Tooltip extends SvelteComponentTyped< TooltipProps, - { click: WindowEventMap["click"]; mousedown: WindowEventMap["mousedown"] }, + { + open: CustomEvent; + close: CustomEvent; + click: WindowEventMap["click"]; + mousedown: WindowEventMap["mousedown"]; + }, { default: {}; icon: {}; triggerText: {} } > {}