Skip to content

BaseSearch

A basic text search to filter entries or files

Props

Prop nameDescriptionTypeValuesDefault
modelValueset input value from outside
for searchType daterange this needs to be an object with
date_from and date_to properties!
string|object-''
selectedChipsif input searchType is chips this is the prop to
pass selected options (chips).
you may use the v-model directive on this prop
array-[]
placeholderplaceholder to show for input; either just a string or an object with
different text for each search type (text, chips, date)
string|object-'Search your works and events'
labellabel connected with input (will not be visible but for usability!)string-'Search'
showPreInputIcondefine if the magnifier glass (in front of input field) should be shownboolean-true
dropDownListIdspecify the id of a linked drop down liststring-''
inputIdspecify a field id for identification of the input field
if none is specified an internal id will be assigned
string-''
searchTypespecify the type of input fieldstringtext, chips, controlled, date, daterange, chipssingle'text'
linkedListOptionspecify a linked list option (e.g. drop down)
(will be used in aria-activedescendant attribute)
number|string-null
loadableif true space is reserved for a loader that can be activated
with the 'isLoading' prop
boolean-false
isLoadingis loading indicator - showing loader if trueboolean-false
languageset the language (ISO 639-1)string-'en'
identifierPropertyNamespecify the object property that should be used as identifier (only needed
for type chips
string-'id'
labelPropertyNamespecify the object property that should be used as value to be displayed (only needed
for type chips
string-'label'
invalidmark the form field as invalid and ideally also provide an error message
to display below the form field.
for an example see BaseInput
boolean-false
showErrorIcondefine if error icon should be shown
for an example see BaseInput
boolean-true
clearableif true a remove icon will be shown allowing to remove
all input at once.
for an example see BaseInput
boolean-true
isActiveset active state from outsideboolean-false
setFocusOnActiveuse this prop to deactivate automatic setting of focus as soon as input element
becomes active - this might require external handling of focus setting!
boolean-true
addChipsInputDirectlyfor searchType 'chips': set this false if you want to add the chip
manually e.g. if option is selected from a dropdown, true is mainly
just useful if BaseSearch is a standalone element
boolean-false
assistiveTextthis prop gives the option to add assistive text for screen readers
properties:

selectedOption: text read when a selected option is focused (currently only
working for type chips)
loaderActive: text that is announced when results are being fetched (prop
isLoading is set true)
clearInput: text read for remove input icon if prop clearable is set true
optionAdded: text read when an option was added to selected list (for type chips)
optionToRemoveSelected: text read when a selected option is in
focus to be removed (for type chips)
optionRemoved: text read when an option was removed
from selected list (for type chips)
results: provide text that should be announced when the search has
yielded results (or not).

Caveat: results has a watcher attached to trigger the
announcement so make sure the property values are reset after filling them
by using update:assistive-text or resetting it manually (after a timeout)
object-{
selectedOption: '',
loaderActive: 'loading.',
clearInput: 'Clear input',
optionAdded: 'option {label} added to selected list.',
optionToRemoveSelected: 'option {label} from selected list marked for removal. Press delete or backspace to remove.',
optionRemoved: 'option {label} removed.',
results: ''
}
dateFieldDelayuse this prop to set a delay in ms before date input calendar is displayednumber-0

Events

Event namePropertiesDescription
update:model-valueundefined string, Object - the altered input valuesinform parent of changed input values (v-model)
update:selected-chipsundefined Array - the updated selected options listinform parent of changes in selected chips
update:is-activeinform parent if is active has changed internally
update:assistive-text

Slots

NameDescriptionBindings
pre-input-fieldadd elements within search but before all other elements. for an example see BaseInput
input-field-addition-beforeadd elements within search but before all other elements. for an example see BaseInput
input-field-inline-beforea slot to exchange the magnifier icon with other elements
input-field-addition-afterfor adding elements after input. for an example see BaseChipsInputField
post-input-fieldelements after the actual input element but within the input field container. for an example see BaseChipsInputField
error-iconuse a custom icon instead of standard error/warning icon. for an example see BaseChipsInputField
remove-iconfor adding custom input remove icon. for an example see BaseChipsInputField
below-inputbelow-input slot added to e.g. add drop down

Demo

A simple Search Component

A component with more custom settings. Also demonstrating the different types available.

For slot demonstrations see BaseChipsInput or BaseInput.