2021-04-22 00:12:47 +12:00
|
|
|
<script>
|
2021-04-22 00:19:10 +12:00
|
|
|
import "@spectrum-css/buttongroup/dist/index-vars.css"
|
2021-04-22 00:12:47 +12:00
|
|
|
export let vertical = false
|
2021-04-22 00:19:10 +12:00
|
|
|
|
|
|
|
function group(element) {
|
|
|
|
const buttons = Array.from(element.getElementsByTagName('button'))
|
|
|
|
buttons.forEach(button => {
|
|
|
|
button.classList.add('spectrum-ButtonGroup-item')
|
|
|
|
})
|
|
|
|
}
|
2021-04-22 00:12:47 +12:00
|
|
|
</script>
|
|
|
|
|
2021-04-22 00:19:10 +12:00
|
|
|
<div use:group class="spectrum-ButtonGroup" class:spectrum-ButtonGroup--vertical={vertical}>
|
2021-04-22 00:12:47 +12:00
|
|
|
<slot />
|
|
|
|
</div>
|