Fix issue with button column width and allow collapsed button groups to use a secondary variant

This commit is contained in:
Andrew Kingston 2024-09-05 16:46:55 +01:00
parent 1bbbeab25b
commit da6ce2256a
No known key found for this signature in database
2 changed files with 5 additions and 6 deletions

View File

@ -10,6 +10,7 @@
export let align = "left"
export let offset
export let animate
export let secondary = false
let anchor
let popover
@ -24,7 +25,8 @@
bind:ref={anchor}
{size}
icon="ChevronDown"
cta
cta={!secondary}
{secondary}
on:click={() => popover?.show()}
on:click
>

View File

@ -57,7 +57,7 @@
onMount(() => {
const observer = new ResizeObserver(entries => {
const width = entries?.[0]?.contentRect?.width ?? 0
buttonColumnWidth.set(width)
buttonColumnWidth.set(width - 1)
})
observer.observe(container)
})
@ -68,7 +68,6 @@
class="button-column"
style="left:{left}px"
class:hidden={$buttonColumnWidth === 0}
class:right-border={left !== gridEnd}
>
<div class="content" on:mouseleave={() => ($hoveredRowId = null)}>
<GridScrollWrapper scrollVertically attachHandlers bind:ref={container}>
@ -99,6 +98,7 @@
align="right"
offset={5}
size="S"
secondary
animate={false}
on:mouseenter={() => ($hoveredRowId = row._id)}
/>
@ -188,7 +188,4 @@
.button-column :global(.cell) {
border-left: var(--cell-border);
}
.button-column:not(.right-border) :global(.cell) {
border-right-color: transparent;
}
</style>