Aller au contenu

Toolbar widgets

A placement may render an input instead of a button. It reads its value from a source and emits an event on validation — the store is still only written by a handler.

ctx.place({
id: "title",
toolbar: "view:notes:editor",
order: 5,
widget: {
valueType: "text",
label: ctx.i18n.key("widget.title"),
width: "w-48",
event: "notes/document.rename", // payload: { value, context }
value: valueFrom(slice, (state, context) => targetDoc(context, state)?.title ?? ""),
// commitOn: "change" to emit on every keystroke; default is Enter / blur
},
});

Documentation sous licence CC BY 4.0 · © les contributeurs de SCFlow ·Retour à supplychainflow.org