35 lines
922 B
Plaintext
35 lines
922 B
Plaintext
<div class="my-1">
|
|
@if (!string.IsNullOrEmpty(Title))
|
|
{
|
|
<label class="block text-secondary text-sm font-bold mb-2">@Title</label>
|
|
}
|
|
<input id="@Id" value="@Value" onchange="@onChange" name="@Name" class="bg-primary appearance-none border-2 border-secondary rounded w-full py-2 px-4 text-primary leading-tight focus:outline-none focus:bg-secondary focus:border-accent transition duration-150">
|
|
@ChildContent
|
|
</div>
|
|
|
|
@code {
|
|
[Parameter]
|
|
public string? Value { get; set; }
|
|
|
|
[Parameter]
|
|
public EventCallback<string> ValueChanged { get; set; }
|
|
|
|
private void onChange(Microsoft.AspNetCore.Components.ChangeEventArgs args)
|
|
{
|
|
ValueChanged.InvokeAsync(args.Value as string ?? "");
|
|
}
|
|
|
|
[Parameter]
|
|
public RenderFragment ChildContent { get; set; } = default!;
|
|
|
|
[Parameter]
|
|
public string? Title { get; set; }
|
|
|
|
[Parameter]
|
|
public string? Id { get; set; }
|
|
|
|
[Parameter]
|
|
public string? Name { get; set; }
|
|
|
|
}
|