Home > @findkit/ui > FindkitUI
FindkitUI class
The Lazy loading Findkit UI
https://docs.findkit.com/ui/api/
Signature:
export declare class FindkitUI<G extends FindkitUIGenerics = FindkitUIGenerics, O extends FindkitUIOptions<G> = FindkitUIOptions<G>, E extends FindkitUIEvents<G, O> = FindkitUIEvents<G, O>>
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(options) | Constructs a new instance of the FindkitUI class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
activateGroup | (groupId: string | number | { id: string | number; }) => void | Activate group by id, index or group object. Does not open the modal. Use with open() to open the modal as well. | |
addTranslation | (lang: string, translation: Partial<TranslationStrings>, custom?: Record<string, string> | undefined) => void | Set the UI translations transt for a given language https://docs.findkit.com/ui/api/#addTranslation lang - language code translations - translations object custom - Additional custom translations when using the useTranslator in slot overrides |
|
clearGroup | () => void | Clear possibly active group by returni the multiple groups view | |
close | () => void | Close the modal https://docs.findkit.com/ui/api/#close |
|
container? | Element | (Optional) The container element. Available after the "loaded" event. | |
customRouterData | readonly |
G["customRouterData"] | |
groups | readonly |
GroupsOrDefault<G, O> | |
id | readonly |
string | The instance id |
loaded | boolean | True when the implementation has been loaded | |
nextTerms | readonly |
string | Get the possible pending terms that will be used in the next search |
params | readonly |
SearchParamsOrDefault<G, O> | https://docs.findkit.com/ui/api/#params |
preload | () => Promise<void> | ||
searchKey | readonly |
string | InstanceId + separator + q or searchKey if defined |
separator | readonly |
string | The separator |
setCustomRouterData | (data: NonNullable<G["customRouterData"]>) => void | ||
setLang | (lang: string) => void | Set the current UI language https://docs.findkit.com/ui/api/#setLang |
|
status | readonly |
Status | https://docs.findkit.com/ui/api/#status |
terms | readonly |
string | |
updateGroups | (arg: UpdateGroupsArgument<GroupsOrDefault<G, O>>) => void | Update groups | |
updateParams | (arg: UpdateParamsArgument<SearchParamsOrDefault<G, O>>) => void | Update search params | |
usedTerms | readonly |
string | The search terms used on the last search |
Methods
Method | Modifiers | Description |
---|---|---|
bindInput(selector) | ||
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(terms, options) | https://docs.findkit.com/ui/api/#open | |
openFrom(selector) | 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. Element is not added to the focus trap automatically. If the element is visible on the page when the modal is open .focus() should be manually called on the element. The FindkitUI implementation is preloaded on mouseover. https://docs.findkit.com/ui/api/#openFrom |
|
search(terms) | https://docs.findkit.com/ui/api/#search | |
toggle() | https://docs.findkit.com/ui/api/#togggle |