Fixed DropdownLabelsIntl layout

Signed-off-by: Alexander Platov <alexander.platov@hardcoreeng.com>
This commit is contained in:
Alexander Platov 2024-08-07 08:06:27 +07:00
parent ce9a30a3ff
commit 7180c87aa8
No known key found for this signature in database
GPG Key ID: 67AE092F5EB4180C

View File

@ -39,7 +39,7 @@
export let shouldUpdateUndefined: boolean = true export let shouldUpdateUndefined: boolean = true
export let minW0 = true export let minW0 = true
let container: HTMLElement let container: HTMLButtonElement
let opened: boolean = false let opened: boolean = false
$: selectedItem = items.find((x) => x.id === selected) $: selectedItem = items.find((x) => x.id === selected)
@ -75,28 +75,27 @@
} }
</script> </script>
<div bind:this={container} class:min-w-0={minW0}> <Button
<Button {icon}
{icon} width={width ?? 'min-content'}
width={width ?? 'min-content'} {size}
{size} {kind}
{kind} {disabled}
{disabled} {justify}
{justify} showTooltip={{ label, direction: labelDirection }}
showTooltip={{ label, direction: labelDirection }} bind:input={container}
on:click={openPopup} on:click={openPopup}
> >
<span slot="content" class="overflow-label disabled flex-grow text-left mr-2"> <span slot="content" class="overflow-label disabled flex-grow text-left mr-2">
<Label <Label
label={selectedItem ? selectedItem.label : label} label={selectedItem ? selectedItem.label : label}
params={selectedItem ? selectedItem.params ?? params : params} params={selectedItem ? selectedItem.params ?? params : params}
/> />
</span> </span>
<svelte:fragment slot="iconRight"> <svelte:fragment slot="iconRight">
<DropdownIcon <DropdownIcon
size={'small'} size={'small'}
fill={kind === 'primary' && !disabled ? 'var(--primary-button-content-color)' : 'var(--theme-dark-color)'} fill={kind === 'primary' && !disabled ? 'var(--primary-button-content-color)' : 'var(--theme-dark-color)'}
/> />
</svelte:fragment> </svelte:fragment>
</Button> </Button>
</div>