@inherits DComponentBase
@* daisyUI File input: https://daisyui.com/components/file-input/ . Blazor's InputFile with the file-input classes;
read the files in OnChange (e.File / e.GetMultipleFiles()). *@
@code {
[Parameter] public EventCallback OnChange { get; set; }
[Parameter] public bool Multiple { get; set; }
/// The accept attribute: file types, e.g. "image/*,.pdf".
[Parameter] public string Accept { get; set; }
[Parameter] public DColor Color { get; set; }
[Parameter] public DSize Size { get; set; }
[Parameter] public bool Ghost { get; set; }
string CssClass => Cx("file-input", ColorClass, SizeClass, Ghost ? "file-input-ghost" : null, Class);
string ColorClass => Color switch
{
DColor.Neutral => "file-input-neutral",
DColor.Primary => "file-input-primary",
DColor.Secondary => "file-input-secondary",
DColor.Accent => "file-input-accent",
DColor.Info => "file-input-info",
DColor.Success => "file-input-success",
DColor.Warning => "file-input-warning",
DColor.Error => "file-input-error",
_ => null
};
string SizeClass => Size switch
{
DSize.Xs => "file-input-xs",
DSize.Sm => "file-input-sm",
DSize.Lg => "file-input-lg",
DSize.Xl => "file-input-xl",
_ => null
};
}