From 6132e9786f45f09f9e9391f7d1080b6f4663fca4 Mon Sep 17 00:00:00 2001 From: lubber-de Date: Sun, 4 Aug 2024 23:23:52 +0200 Subject: [PATCH 1/3] fix(types): missing/wrong types for modal and transition --- types/fomantic-ui-modal.d.ts | 27 ++++++++++++++++++++++++++- types/fomantic-ui-transition.d.ts | 12 +++++++++--- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/types/fomantic-ui-modal.d.ts b/types/fomantic-ui-modal.d.ts index 4eea57048f..96df9a78cd 100644 --- a/types/fomantic-ui-modal.d.ts +++ b/types/fomantic-ui-modal.d.ts @@ -74,6 +74,31 @@ declare namespace FomanticUI { (settings?: Partial>): JQuery; } + interface ModalTransitionSettings { + + /** + * Named animation show event to used. + * Must be defined in CSS. + */ + showMethod: string; + + /** + * Duration of the CSS show transition animation + */ + showDuration: number; + + /** + * Named animation hide event to used. + * Must be defined in CSS. + */ + hideMethod: string; + + /** + * Duration of the CSS hide transition animation + */ + hideDuration: number; + } + /** * @see {@link https://fomantic-ui.com/modules/modal.html#/settings} */ @@ -177,7 +202,7 @@ declare namespace FomanticUI { * Custom settings to extend UI dimmer. * @default 'scale' */ - transition: string | Partial>; + transition: string | ModalTransitionSettings; /** * Duration of animation. diff --git a/types/fomantic-ui-transition.d.ts b/types/fomantic-ui-transition.d.ts index fb14890d7c..41b2a7d559 100644 --- a/types/fomantic-ui-transition.d.ts +++ b/types/fomantic-ui-transition.d.ts @@ -182,10 +182,10 @@ declare namespace FomanticUI { displayType: false | string; /** - * Specify the final display type (block, inline-block etc) so that it doesn't have to be calculated. - * @default '500ms' + * Duration of the CSS transition animation + * @default false */ - duration: string; + duration: string | number | false; /** * If enabled a 'timeout' will be added to ensure 'animationend' callback occurs even if element is hidden. @@ -193,6 +193,12 @@ declare namespace FomanticUI { */ useFailSafe: boolean; + /** + * Delay in ms for fail safe + * @default 100 + */ + failSafeDelay: number; + /** * If enabled will allow same animation to be queued while it is already occurring. * @default false From b9196f495bc7ff342b8d21d31c723938232754e5 Mon Sep 17 00:00:00 2001 From: lubber-de Date: Mon, 5 Aug 2024 14:05:00 +0200 Subject: [PATCH 2/3] fix(types): missing/wrong types for dropdown and popup transition --- types/fomantic-ui-dropdown.d.ts | 34 +++++++++++++++++++++++++-------- types/fomantic-ui-popup.d.ts | 27 +++++++++++++++++++++++++- 2 files changed, 52 insertions(+), 9 deletions(-) diff --git a/types/fomantic-ui-dropdown.d.ts b/types/fomantic-ui-dropdown.d.ts index 9be97f48a3..5d5b052432 100644 --- a/types/fomantic-ui-dropdown.d.ts +++ b/types/fomantic-ui-dropdown.d.ts @@ -216,6 +216,31 @@ declare namespace FomanticUI { (settings?: Partial>): JQuery; } + interface DropdownTransitionSettings { + + /** + * Named animation show event to used. + * Must be defined in CSS. + */ + showMethod: string; + + /** + * Duration of the CSS show transition animation + */ + showDuration: number; + + /** + * Named animation hide event to used. + * Must be defined in CSS. + */ + hideMethod: string; + + /** + * Duration of the CSS hide transition animation + */ + hideDuration: number; + } + /** * @see {@link http://fomantic-ui.com/modules/dropdown.html#/settings} */ @@ -453,7 +478,7 @@ declare namespace FomanticUI { * Alternatively you can provide an 'object' to set individual values for hide/show transitions as well as hide/show duration. * @default 'auto' */ - transition: boolean | object; + transition: string | DropdownTransitionSettings; /** * Duration of animation events. @@ -468,13 +493,6 @@ declare namespace FomanticUI { */ displayType: false | string; - /** - * Maximum glyph width, used to calculate search size. - * This is usually size of a "W" in your font in 'em'. - * @default 1.037 - */ - glyphWidth: number; - /** * Whether option headers should have an additional divider line underneath when converted from '