Індикатори
Some forms (document, task) have the built-in support of the toolbar indicators.
Indicators in the createIndicators event handler which must return
an array indicator configuration objects.
Due to the reactivity of the Script Module instance, changes of the event
properties (document, task, etc.) used inside the createIndicators handler
will trigger an update of indicators' view.
Indicator configuration supports next options:
- text - indicator caption
- type -
success,info,warning,danger,none- optional, defaultnone - size -
medium,small,mini- optional, defaultsmall - style -
dark,light,plain- optional, defaultlight
Basic usage:
module.exports = {
createIndicators(event) {
// Indicator caption changes on attribute update
const text = event.document.getAttribute('someTextAttr')
// Indicator visibility changes on attribute toggling
const visible = event.document.getAttribute('someBooleanAttr')
// Indicator color changes on file add/remove
const type = event.document.getFileAttribute('someFileAttr')?.fileInfo?.fileName
? 'success'
: 'danger'
return [{text, visible, type, size: 'medium', style: 'dark'}]
}
}