Builds a diagram action toolbar attached to the given diagram view.
The host element that will contain the toolbar buttons.
The diagram view whose actions the toolbar controls.
Optional layout and style configuration.
ProtecteddiagramProtectedactionsProtectedhostProtectedconfigProtectedbuttonsProtected ReadonlyonProtected ReadonlyonCleans up toolbar resources and detaches diagram listeners.
Re-evaluates enabled and active state for all registered actions.
Swap the underlying diagram view (e.g. after remounting).
ProtectedbindSubscribes to diagram-level events that trigger toolbar state updates.
ProtectedunbindUnsubscribes all diagram-level event listeners attached by bindDiagramEvents.
ProtectedbuildInstantiates buttons for each action in the resolved layout.
The toolbar config used to determine the button layout.
ProtectedresolveReturns the ordered list of layout items from config, or falls back to the default layout.
The toolbar config.
The resolved layout array.
Manually adds a button to the toolbar. This is useful for dynamically adding buttons after the toolbar has been created.
The definition of the button to add.
The HTMLButtonElement that was created and added to the toolbar.
Manually adds a separator to the toolbar. This is useful for dynamically adding separators after the toolbar has been created.
The HTMLDivElement that was created and added to the toolbar.
Sets the active state of a button.
The ID of the button.
Whether the button should be active.
Sets the enabled state of a button.
The ID of the button.
Whether the button should be enabled.
Gets a button by its ID.
The ID of the button.
The HTMLButtonElement if found, otherwise undefined.
ProtectedbuildCreates a button DOM element from the given definition and wires its click handler.
The button definition including id, icon, label, and callbacks.
The constructed HTMLButtonElement.
ProtectedresolveResolves a string icon reference or Element into a DOM element suitable for button content.
Optionalicon: string | ElementAn SVG sprite reference (e.g. '#icon-undo'), an img URL, raw SVG markup, or an Element.
The icon element, or null when no icon is provided.
A simple toolbar component that can be used to create a toolbar with buttons and separators. The toolbar can be customized with CSS classes and tooltip attributes. Buttons can be added with icons, labels, tooltips, and click event handlers. Buttons can also be toggled on/off and enabled/disabled.