OptionalabortAllow cancelling of in flight async request if disconnected
ReadonlycontextDefer writing the results while there is interaction with the target container
ReadonlyhasReadonlyhasReadonlyhasReadonlyhasOptionaliconThe related icon element to attach the spinner to
ReadonlyinputA dotted path to the HTML string value to extract from the JSON response
OptionalreplaceDebounced function to request a URL and then replace the DOM with the results
OptionalsearchDebounced function to search results and then replace the DOM
OptionalsubmitDebounced function to submit the serialized form and then replace the DOM
OptionalwriteA function that writes the HTML to the target
StaticblessingsStaticdefaultStaticoutletsStatictargetsStaticvaluesElement that receives the fetch result HTML output
StaticshouldWhen disconnecting, ensure we reset any visual related state values and cancel any in-flight requests.
Toggle the visual spinner icon if available and ensure content about to be replaced is flagged as busy.
Abort any existing requests & set up new abort controller, then fetch and replace the HTML target with the new results. Cancel any in progress results request using the AbortController so that a faster response does not replace an in flight request.
OptionalurlSource: string | CustomEvent<{ url: string }> & { params?: { url?: string } }Optionaldata: FormDataPerform a URL search param update based on the input's value with a comparison against the matching URL search params. Will replace the target element's content with the results of the async search request based on the query.
Search will only be performed with the URL param value is different to the input value. Cleared params will be removed from the URL if present.
clear can be provided as Event detail or action param to override the default of 'p'.
Optionaldata: CustomEvent<{ clear: string }> & { params?: { clear?: string } }Update the target element's content with the response from a request based on the input's form values serialized. Do not account for anything in the main location/URL, simply replace the content within the target element.
Staticafter
Allow for an element to trigger an async query that will patch the results into a results DOM container. The controlled element can be the query input, the containing form, or a button. It supports the ability to update the URL with the query when processed or simply make a query based on a form's values.
Example: - A form that will update the results based on the form's input
Example: - A single input that will update the results & the URL
Example: - A single button that will update the results