Class LisPaginatedSearchElementInterface<SearchData, SearchResult, SearchFunctionType>

The interface of the class generated by the LisPaginatedSearchMixin mixin.

Type Parameters

Constructors

Properties

_formRef: Ref<LisFormWrapperElement>
_loadingRef: Ref<LisLoadingElement>
_searchData: undefined | SearchData
cancelPromiseController: LisCancelPromiseController

Current Web standards do not allow Promises to be cancelled. Components that use the LisPaginatedSearchMixin mixin can use this controller to make Promises cancelable. Event listeners can also subscribe to the controller and will be called whenever it cancels. The underlying AbortSignal is also available for more low-level access. This is the value of the abortSignal attribute of the PaginatedSearchOptions object passed to the component's SearchFunction.

domContentLoadedController: LisDomContentLoadedController

Components that use the LisPaginatedSearchMixin mixin can use this controller to subscribe to the DOMContentLoaded event. The advantage to using the controller instead of subscribing to the event directly is that the controller triggers a redraw of the component's template, meaning if a listener updates a property that should change the template, triggering a redraw of the template will be handled by the controller.

queryStringController: LisQueryStringParametersController

Components that use the LisPaginatedSearchMixin mixin can use this controller to interact with URL query string parameters. For example, it can be used to set values of form elements reactively, i.e. if the query string parameter a form element gets its value changes, then the element's value will be updated in the component's template.

requiredQueryStringParams: string[][]

The LisPaginatedSearchMixin mixin will automatically perform a search when loaded if certain parameters are present in the URL query string. Components that use the mixin can specify what parameters are necessary by setting this property in their constructor. Specifically, this property represents groups of parameters that will trigger a search if all parameters within a group are present.

resultAttributes: string[]

Components that use the LisPaginatedSearchMixin mixin must define what attributes their search results will have so the mixin can correctly parse and display the results in a table. These attributes can be specified by setting this property in a component's constructor. Additionally, this property may be used by the end user at run-time to override the default result attributes defined by the component.

resultsInfo: string

Info about the results returned by the searchFunction.

searchFunction: SearchFunctionType

Components that use the LisPaginatedSearchMixin mixin will inherit this property. It stores an external function that must be provided by users of the component that performs a search using the data from the component's submitted search form.

searchResults: SearchResult[]

The results returned by the searchFunction.

tableColumnClasses: StringObjectModel

Components that use the LisPaginatedSearchMixin mixin can optionally define CSS classes for the columns of the table results are displayed in a table. The classes are set from an object that has attributes matching the resultAttributes. The object can be specified by setting this property in a component's constructor. Additionally, this property may be used by the end used at run-time to override the default table column classes defined by the component.

tableHeader: StringObjectModel

Components that use the LisPaginatedSearchMixin mixin must define what attributes their search results will have so the mixin can correctly parse and display the results in a table. The header of the table is set from an object that has these attributes. The object can be specified by setting this property in a component's constructor. Additionally, this property may be used by the end used at run-time to override the default table headers defined by the component.

Methods

  • When the form of a component that use the LisPaginatedSearchMixin mixin is submitted, the mixin parses the form contents into a !FormData | FormData instance. This instance is converted into a simple object mapping form element names to their values. This conversion is done with the formToObject method. If the object doesn't match the expected SearchData template type or if there are redundant names in the !FormData | FormData instance that need to be resolved, then the component should override the formToObject method.

    Parameters

    • formData: FormData

      The !FormData | FormData instance to convert into an object.

    Returns SearchData

    The object generated from the given !FormData | FormData instance.

  • Components that use the LisPaginatedSearchMixin mixin need to provide the search form that the mixin will process. This is done by overriding the renderForm method.

    Returns unknown

    The form portion of the template.

    Throws

    Error This exception is thrown if the renderForm method is not overridden when called.

  • By default, the LisPaginatedSearchMixin displays search results using the LisSimpleTableElement | LisSimpleTableElement. Components that use the mixin can override this portion of the template by implementing their own renderResults method. The results data will be available via the inherited searchResults variable.

    Returns unknown

    The results portion of the template.

  • By default, the LisPaginatedSearchMixin displays search results info using the in paragraph tags. Components that use the mixin can override this portion of the template by implementing their own renderResultsInfo method.

    Returns unknown

    The results info portion of the template.

  • A helper method that returns that first value that's defined: the given value, the value of the specified querystring parameter, an empty string.

    Parameters

    • value: undefined | string

      The value to potentially return.

    • parameter: string

      The querystring parameter to potentially return the value of.

    Returns string

    The first value that was defined.

Generated using TypeDoc