Home > @findkit/ui > FindkitUI

FindkitUI class

The Lazy loading Findkit UI


export declare class FindkitUI<G extends FindkitUIGenerics = FindkitUIGenerics, O extends FindkitUIOptions<G> = FindkitUIOptions<G>, E extends FindkitUIEvents<G, O> = FindkitUIEvents<G, O>> 


Constructor Modifiers Description
(constructor)(options) Constructs a new instance of the FindkitUI class


Property Modifiers Type Description
addTranslation (lang: string, translation: Partial<TranslationStrings>) => void

Set the UI translations transt for a given language

lang - language code translations - translations object

close () => void Close the modal
container? Element (Optional) The container element. Available after the "loaded" event.
groups readonly GroupsOrDefault<G, O>
id readonly string The instance id
params readonly SearchParamsOrDefault<G, O>
preload () => Promise<void>
setCustomRouterData (data: NonNullable<G["customRouterData"]>) => void
setLang (lang: string) => void Set the current UI language
setUIStrings (lang: string, overrides?: Partial<TranslationStrings> | undefined) => void
updateGroups (arg: UpdateGroupsArgument<GroupsOrDefault<G, O>>) => void Update groups
updateParams (arg: UpdateParamsArgument<SearchParamsOrDefault<G, O>>) => void Update search params


Method Modifiers Description
dispose() Unbind all event listeners, close the modal and remove it from the DOM
on(eventName, handler) Bind an event handler to the emitter
once(eventName, handler) Bind an event handler to the emitter

Open the modal from the given elements. If a string is given it is used as a query selector to find the elements after the DOMContentLoaded event.

The implementation is preloaded on mouseover.

PRIVATE_getStyleSheets() Return css file urls
terms() The search terms used on the last search
trapFocus(selector) Add additional elements to focus trap when modal is open