Skip to content

BaseExpandList

Props

Prop nameDescriptionTypeValuesDefault
datashould be an object array with the following properties:
label string - the displayed label
id string - an identifier
data Object[] - an object array with the property:
* label string (renders component as
expandable row) or
* value string (renders component as entry row)

optional properties:
count number - used for the number shown in brackets
(else the array length will be used)
hidden boolean - used to set visibility and is set in edit mode to toggle item

the v-model directive might be used on this prop
array-[]
editset edit mode from outsideboolean-false
minItemsspecify number of minimal displayed itemsnumber-3
multipleexpand multiple itemsboolean-false
showMoreTextbutton text to show more contentstring-'Show all'
showLessTextbutton text to show less contentstring-'Show less'
editHideTextbutton text to hide itemstring-'Hide'
editShowTextbutton text to show itemstring-'Show'
assistiveTextadditional texts for screen-reader users to order items.
object that needs to have the following properties:
activate: Text read when item is focused, use variable {state} to
announce item visibility - specify text used in properties 'hidden' and 'visible'
activated: Text read after item was activated (selected by enter key)
description: Text read on initial list focus
moved: Text read after item was moved; can contain variables {pos} (for new position) and {total}
visible: string substituted to 'activate' text for state variable if item is visible
hidden: string substituted to 'activate' text for state variable if item is hidden
object-{
activate: 'Use the Enter key to select item. Item is currently {state}',
activated: 'Item selected. Use arrow keys to order item.',
description: 'Use Tab key to navigate to item an order item.',
moved: 'Item moved: {pos} of {total}',
visible: 'visible',
hidden: 'hidden'
}
controlTypespecify the type of visibility switch in edit mode
button: a BaseButton without text
toggle: a BaseToggle element without text
stringbutton, toggle'button'
expandeddefine which items are expanded
v-model might be used on this property
array-[]
disabledoption to disable the edit functionalities of the element (toggle and draggable)boolean-false

Methods

reset

reset list data - this always restores the state of the data on last save() triggered (=was triggered in parent)

save

save changed data

Events

Event namePropertiesDescription
savedundefined object - the data altered and ready for savingtriggered on button click
update:expandedundefined Array - array with indices of the expanded item per level; eg: [0, 1]: level1 first item, level2 second item is expandedevent triggered when expanded state changes
update:dataundefined Object[] - the modified data (e.g. from sorting)event emitted when data change internally (e.g. sorting, toggling hidden, etc.).
the v-model directive may be used on the corresponding prop
update:edit-mode-is-readyundefined boolean - the current loading statetriggered when async component is initialized

Slots

NameDescriptionBindings
contenta slot to provide customized entry rowdata Object - an object in data array

Demo

Component to render list data