Creates a collapse/expand toggle button inside a control header.
The button uses the BEM modifier <classPrefix>__toggle, an i18n
aria-label and the "⟱" glyph. Clicking it stops propagation and invokes
onToggle. A teardown that detaches the listener (clone-replace) is pushed
into cleanups so the control can dispose it on removal.
Parameters
header: HTMLElement
The header element the button is appended to.
classPrefix: string
BEM block prefix, e.g. "gl-layer-manager" or "gl-map-legend".
Creates a collapse/expand toggle button inside a control header.
The button uses the BEM modifier
<classPrefix>__toggle, an i18naria-labeland the "⟱" glyph. Clicking it stops propagation and invokesonToggle. A teardown that detaches the listener (clone-replace) is pushed intocleanupsso the control can dispose it on removal.