ui package
Classes
Class | Description |
---|---|
Emitter | Simple event emitter |
FindkitUI | The Lazy loading Findkit UI https://docs.findkit.com/ui/api/ |
FindkitURLSearchParams | |
SearchEngine | A class for the internal logic and state of the search ui This includes - managing the search requests - input value throttling - keyboard navigation - query string monitoring This is basically a wrapper around a Valtio proxy object. The data flow is as follows: - User types in the input - The input events are throttled and the search term is copied to the query string (fdk_q by default) - A query string change is deteted and the search is triggered - Once the search completes the results are put into the Valtio state with the used search terms Eg. the search is always triggered from the query string change. This means it is also possible to trigger the search with history.pushState() or history.replaceState() and input value will updated to match it unless the input is focused. |
Functions
Function | Description |
---|---|
css(strings, expr) | No-op template tag for css. This only for editor syntax highlighting. |
init(_options) | |
select(selector, instanceFilter, cb) | Run the given CSS selector after the DOMContentLoaded event and filter the results to given instance type. Does not invoke the callback if no elements where matched. The callback is invoked immediately when the DOMContentLoaded event has already fired. |
Interfaces
Interface | Description |
---|---|
BindInputEvent | |
ContentSlotProps | Props for the Content slot component override. See Slots. |
CustomRouterData | |
CustomRouterDataEvent | |
DebouncedSearchEvent | |
FetchDoneEvent | |
FetchEvent | |
FindkitUIEvents | FindkitUI event definitions |
FindkitUIGenerics | Generic type for defining custom ui.params and ui.updateParams() types |
FindkitUIOptions | Modal options |
GroupDefinition | Group type for the search engine |
GroupResults | Type for groupped search results. |
GroupsChangeEvent | |
GroupSlotParts | Part components for the Group slot |
GroupSlotProps | |
HeaderSlotParts | Part components for the Header slot. See Slots. |
HeaderSlotProps | Props for the Header slot component override. See Slots. |
HitClickEvent | |
HitSlotParts | Part components for the Hit slot. See Slots. |
HitSlotProps | Props for the Hit slot component override. See Slots. |
Implementation | |
InitEvent | |
LanguageChangeEvent | |
LayoutSlotProps | Props for the Layout slot component override. See Slots. |
OpenEvent | |
ParamsChangeEvent | |
PreactFunctions | Small subset of commonly used Preact functions |
RequestOpenEvent | |
ResultSlotParts | |
ResultSlotProps | |
RouterBackend | |
SearchParams | Same as FindkitSearchGroupParams but without "from" field since it is managed by the SearchEngine |
SearchResultHit | Like the findkit result but real dates instead of the string dates |
SearchResultHitWithGroupId | |
ShowAllLinkProps | Props for AllResultsLink component in Group slot parts. See Slots. |
Slots | All avaivable slots |
State | |
StatusChangeEvent | |
TranslationStrings | UI strings available for translation |
UnbindInputEvent |
Variables
Variable | Description |
---|---|
h | JSX pragma |
html | HTM (Hyperscript Tagged Markup) tagged template literal. https://github.com/developit/htm |
MODULE_FORMAT | |
preact | Lazily loaded preact hooks |
useCustomRouterData | Manage custom router data from a slot override |
useGroups | Read or update the search groups |
useInput | Returns a ref for binding a inputs to the search Example: const ref = useInput(); <input ref={ref} type="text" /> |
useLang | Get the current ui language |
useLoading | Return true when the search is loading something for too long. Works like the loading event. |
useParams | Read or update the search params |
useResults | Use search results |
useTerms | Use search terms |
useTotal | Use total count of search results |
useTotalHitCount | Return total hit count. Includes count from all groups if multiple groups are used. |
useTranslate | Get the translate function. |
VERSION | The package version |
Type Aliases
Type Alias | Description |
---|---|
CustomFields | |
CustomRouterDataSetter | |
ElementSelector | Set of DOM elements as CSS selector, a NodeList or an array of DOM elements |
Filter | New in v0.9.0 |
MethodParameters | Like Example: |
Operator | Operator type for a filter. $eq, $gt, $gte, $lt, $lte, $all, $in, $ne etc.. New in v0.9.0 |
SearchEngineParams | |
SelectCallback | Callback invoked from select() |
Sort | New in v0.9.0 |
Status | UI status |
UpdateGroupsArgument | |
UpdateParamsArgument |