Footer & Item State
<bk-footer></bk-footer>
The Footer & Item State renders an element counter and button acting on a selected dataset subset. It is designed to be placed as footer of a plugin page.
The Footer & Item State keeps track of selected items monitoring the selected-data-bulk event.
When all selected items share the same __STATE__ field, a button is rendered.
__STATE__ field is one of the predefined fields in collections handled vis Mia Platform's CRUD Service.
Upon clicking the button, a request is sent to update the __STATE__ field of selected items in a bulk operation.
This is achieved by the emission of an update-state-bulk event.
A component like the CRUD Client may manage this event.
How to configure
The Footer & Item State does not require any explicit configuration.
{
"tag": "bk-footer"
}
It is possible to disable the state change functionality by setting disableStateChange property to true.
Locale
The texts of the Footer can be customized through the property customLocale, which accepts an object shaped like the following:
type Locale = {
stateChangeCta: {
PUBLIC: LocalizedText
DRAFT: LocalizedText
TRASH: LocalizedText
},
element: LocalizedText
elements: LocalizedText
selected: LocalizedText
}
where LocalizedText is either a string or an object mapping language acronyms to strings.
API
Properties & Attributes
| property | attribute | type | default | description |
|---|---|---|---|---|
disableStateChange | disable-state-change | boolean | false | toggles state change functionalities |
Listens to
| event | action |
|---|---|
| loading-data | sets internal loading state |
| count-data | adjusts footer counter to currently viewed dataset |
| selected-data-bulk | prepares callToAction on a given dataset subset |
| nested-navigation-state/push | updates internal representation of the current nesting path by adding one step |
| nested-navigation-state/back | updates internal representation of the current nesting path by removing the specified number of steps |
Emits
| event | description |
|---|---|
| update-state-bulk | Updates the state of selected items in a bulk operation |