Skip to content

BaseChipsBelow

A very specialized component based on BaseChipsInput in order to assign additional values (e.g. roles) to selected entries)]

Props

Prop nameDescriptionTypeValuesDefault
listlist of selectable options objects with at least an identifier and a label property.
property names can be set with props identifierPropertyName and labelPropertyName
array-[]
modelValuelist of already selected options objects with at least an identifier and a label property
and a property to use for the secondary drop down ('additional property'), displayed as
chips.
property names can be set with props identifierPropertyName, labelPropertyName and
additionalPropertyName
array-[]
inputIdif field is occurring more than once - set an idstring-''
labelinput field labelstring-
showLabeldefine if label should be visibleboolean-true
placeholderinput field placeholderstring-null
dropDownNoOptionsInfomessage displayed when no selectable options are availablestring-'No options available'
allowUnknownEntriesdefine if the user can add an option that is not in the listboolean-false
allowMultipleEntriesdefine whether one or more entries can be selected from the drop-down menuboolean-true
allowDynamicDropDownEntriesdefine if selectable list options should be fetched every time of if the
list passed in the beginning is used
boolean-false
additionalPropAllowMultipleEntriesdefine whether one or more options can be selected from the drop-down menuboolean-true
additionalPropOptionsAdditional property options will set the drop down available for the selected entries
needs to be an object with following attributes:
label|* string: the label of the default option - use the property name set via prop labelPropertyName
id|* string?: (optional) identifier of the default option - use the property name set via prop identifierPropertyName
array-[]
additionalPropDefaultOptiondefine a default option for additional props
see defaultEntry at BaseChipsInput props for more details
object|null-null
additionalPropRequiredspecify additional options as requiredboolean-false
additionalPropPlaceholderspecify a placeholder of the additional property input fieldstring-'Select role(s)'
validationTextsdefine validation messagesobject-{
required: 'Select an option.'
}
isLoadingshow spinner to indicate that something is loading.
This is meant for dynamically fetching entries from a backend and will only
have an effect if prop allowDynamicDropDownEntries is set true!
boolean-false
sortTextif sorting is enabled this will be the text shown in the buttonstring-'Sort A – Z'
sortNameif true sorting will consider the last string in a label or if a comma is
present the string before the comma
boolean-false
languageset a language (ISO 639-1)string-''
addNewChipTextset a chips text for adding a new chip
(alternatively add a 'form.Add' value to your localization files).
if allowUnknownEntries is true please add this in one form or another!
string-''
identifierPropertyNamespecify the object property that should be used as identifierstring-'id'
labelPropertyNamespecify the object property that should be used as value to be displayedstring-'label'
additionalPropertyNamedefine the name of the property that is relevant for the additional drop down
once a value was selected from the primary drop down
string-'roles'
requiredmark as required fieldboolean-false
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
disabledset true if input field should be disabled.
for an example see BaseInput
boolean-false
errorMessageadd an error message to be displayed below form field if field is invalid
for an example see BaseInput
string-''
showErrorIcondefine if error icon should be shown.
for an example see BaseInput
boolean-false
clearableif true a remove icon will be shown allowing to remove
all input at once.
for an example see BaseInput
boolean-false
closeDropdownOnOptionSelectset false if dropdown should be still open after selecting an optionboolean-true
inputClassspecify additional input field stylingstring-''
sortabledefine if a button for sorting the entries is visibleboolean-true
draggabledefine if chips should be draggableboolean-true
highlightStringMatchset this flag to true to highlight autocomplete option characters that match
the current search input string
this will only have effect when the slot drop-down-entry is not used
boolean-false
highlightStringTagsif highlightAutocompleteMatch is set true
provide tag names to style the matched characters
(without '<' and '>', e.g. ['b'] for <b>)
this will only have effect when the slot drop-down-entry is not used
array-[]
assistiveTextthis prop gives the option to add assistive text for screen readers
properties:
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
resultsRetrieved: text that is announced when results were retrieved (drop down
list changed)
optionAdded: text read when option was added to the selected list. string {label}
could be added to be replaced by the actual chip label (value in [labelPropertyName])
optionRemoved: text read when option was removed from the selected list. string {label}
could be added to be replaced by the actual chip label (value in [labelPropertyName])
object-{
loaderActive: 'loading.',
clearInput: 'Clear input',
resultsRetrieved: '{number} options in drop down.',
optionAdded: 'option {label} added to selected list.',
optionRemoved: 'option {label} removed.'
}
chipsEditableset true if chips (only [labelPropertyName] not additional attribute) should be editable on click
caveat: this will only have an effect if allowUnknownEntries is true as well
boolean-false

Methods

validate

Validation can be triggered by executing e.g. this.$refs.baseChipsBelowEl.validate(); from parent.
Therefore, the component must have a reference set.

Return

TypeDescription
booleancomponents error state

Events

Event namePropertiesDescription
additional-property-changedobj Object - changed objectpropagate additional-property-changed change event to parent
Note: useful when validation is done from the parent
fetch-dropdown-entriesvalue string - the input string
type string - the labelPropertyName that was specified
if drop down entries dynamically set - fetch new entries on input
update:model-valueundefined Object - the altered listpropagate list change from dragging event to parent
duplicateundefined Object[] - the altered selected list (modelValue)event emitted when user is trying to add duplicate freetext which will be
prevented (so that user can be informed)

Slots

NameDescriptionBindings
drop-down-entrya slot to provide customized drop down optionsitem Object - an option in the options list
label-additionSlot to allow for additional elements on the right side of the label row <div> (e.g. language tabs)). for an example see BaseChipsInputField
input-field-addition-beforeSlot to allow for additional elements in the input field <div> (before <input>). for an example see BaseChipsInputField
input-field-addition-afterfor adding elements after input
post-input-fieldfor adding elements at the end covering the whole height. for an example see BaseChipsInputField
error-iconuse a custom icon instead of standard error/warning icon. for an example see BaseChipsInputField
remove-iconuse a custom icon instead of standard remove icon. for an example see BaseChipsInputField
no-optionsa slot to customize messages in case of no options present in drop down
below-input

Demo

Example with draggable and editable chips

A simple chips input form field with chips displayed below and default (base project specific) role selection

Demo with optional validation

A chips input form field with chips displayed below and optional validation