File size: 449 Bytes
bc20498 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
<script>import { getCtx } from "../ctx.js";
export let placeholder = "";
export let asChild = false;
export let el = void 0;
const {
states: { selectedLabel },
getAttrs
} = getCtx();
const attrs = getAttrs("value");
$:
label = $selectedLabel;
</script>
{#if asChild}
<slot {label} {attrs} />
{:else}
<span bind:this={el} {...$$restProps} {...attrs} data-placeholder={!label ? "" : undefined}>
{label ? label : placeholder}
</span>
{/if}
|