@typeparam TValue @inherits DInputBase @* daisyUI Range: https://daisyui.com/components/range/ . TValue is numeric; Min and Max are always rendered, as daisyUI requires. *@ @code { [Parameter] public double Min { get; set; } [Parameter] public double Max { get; set; } = 100; [Parameter] public double? Step { get; set; } [Parameter] public DColor Color { get; set; } [Parameter] public DSize Size { get; set; } [Parameter] public DDirection Direction { get; set; } /// Update the bound value while dragging instead of on release. [Parameter] public bool Immediate { get; set; } string CssClassFull => Cx("range", IsInvalid ? "range-error" : ColorClass, SizeClass, Direction == DDirection.Vertical ? "range-vertical" : null, CssClass); string ColorClass => Color switch { DColor.Neutral => "range-neutral", DColor.Primary => "range-primary", DColor.Secondary => "range-secondary", DColor.Accent => "range-accent", DColor.Info => "range-info", DColor.Success => "range-success", DColor.Warning => "range-warning", DColor.Error => "range-error", _ => null }; string SizeClass => Size switch { DSize.Xs => "range-xs", DSize.Sm => "range-sm", DSize.Lg => "range-lg", DSize.Xl => "range-xl", _ => null }; static string Format(double value) => value.ToString(System.Globalization.CultureInfo.InvariantCulture); void OnInput(ChangeEventArgs e) { if (Immediate) CurrentValueAsString = e.Value?.ToString(); } void OnChange(ChangeEventArgs e) => CurrentValueAsString = e.Value?.ToString(); }