Lib: Add optional tail element to Input component
This commit is contained in:
@ -13,6 +13,8 @@
|
|||||||
|
|
||||||
/** The type of the input element, e.g. "text". */
|
/** The type of the input element, e.g. "text". */
|
||||||
type?: string;
|
type?: string;
|
||||||
|
|
||||||
|
tail?: Snippet;
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
@ -20,6 +22,7 @@
|
|||||||
labelwidth = "auto",
|
labelwidth = "auto",
|
||||||
value = $bindable(),
|
value = $bindable(),
|
||||||
type = "text",
|
type = "text",
|
||||||
|
tail = undefined,
|
||||||
...restProps
|
...restProps
|
||||||
}: InputProps = $props();
|
}: InputProps = $props();
|
||||||
</script>
|
</script>
|
||||||
@ -32,4 +35,7 @@
|
|||||||
{@render children()}
|
{@render children()}
|
||||||
</div>
|
</div>
|
||||||
<input bind:value class="!outline-none" {type} {...restProps} />
|
<input bind:value class="!outline-none" {type} {...restProps} />
|
||||||
|
{#if tail}
|
||||||
|
{@render tail()}
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user