text input: add asterisk option
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
value?: string;
|
||||
invalidMessage?: string | null;
|
||||
ref?: HTMLInputElement | null;
|
||||
asterisk?: boolean;
|
||||
class?: ClassValue | null | undefined;
|
||||
}
|
||||
|
||||
@@ -20,6 +21,7 @@
|
||||
value = $bindable(''),
|
||||
invalidMessage = 'Field is required',
|
||||
ref = $bindable<HTMLInputElement | null>(null),
|
||||
asterisk = false,
|
||||
class: classValue,
|
||||
...others
|
||||
}: Props = $props();
|
||||
@@ -33,7 +35,12 @@
|
||||
|
||||
<div class={['w-full', classValue]}>
|
||||
{#if label}
|
||||
<Label for={id}>{label}</Label>
|
||||
<Label for={id}>
|
||||
{label}
|
||||
{#if asterisk}
|
||||
<span class="text-red-500">*</span>
|
||||
{/if}
|
||||
</Label>
|
||||
{/if}
|
||||
|
||||
<StyledRawInput
|
||||
|
||||
Reference in New Issue
Block a user