Class BOBInputNumber<TValue>
- Namespace
- BlazOrbit.Components.Forms
- Assembly
- BlazOrbit.dll
[GenerateComponentInfo]
public class BOBInputNumber<TValue> : BOBInputComponentBase<TValue, BOBInputNumber<TValue>, BOBInputVariant>, IHasReadOnly, IHasDisabled, IHasRequired, IHasError, IVariantComponent<BOBInputVariant>, IVariantComponent, IBuiltComponent, IHasSize, IHasLoading, IHasDensity, IHasShadow, IHasColor, IHasBackgroundColor, IHasPrefix, IHasSuffix, IInputFamilyComponent
Type Parameters
TValue
- Inheritance
-
objectComponentBaseInputBase<TValue>BOBInputComponentBase<TValue>BOBInputNumber<TValue>
- Implements
- Inherited Members
Constructors
BOBInputNumber()
public BOBInputNumber()
Properties
AccelerationInitialDelay
Initial delay (ms) before holding a step button starts accelerating.
[Parameter]
public int AccelerationInitialDelay { get; set; }
Property Value
- int
AccelerationMinDelay
Minimum delay (ms) between repeats once acceleration has ramped up.
[Parameter]
public int AccelerationMinDelay { get; set; }
Property Value
- int
AccelerationStepReduction
Decrement (ms) applied to the repeat delay each acceleration tick until AccelerationMinDelay.
[Parameter]
public int AccelerationStepReduction { get; set; }
Property Value
- int
AllowNegative
When true, negative values are accepted; otherwise the input clamps at zero.
[Parameter]
public bool AllowNegative { get; set; }
Property Value
- bool
BackgroundColor
Background color of the input. Accepts any valid CSS color value, PaletteColor or BOBColor.
[Parameter]
public string? BackgroundColor { get; set; }
Property Value
- string
BuiltInTemplates
protected override IReadOnlyDictionary<BOBInputVariant, Func<BOBInputNumber<TValue>, RenderFragment>> BuiltInTemplates { get; }
Property Value
- IReadOnlyDictionary<BOBInputVariant, Func<BOBInputNumber<TValue>, RenderFragment>>
ButtonPlacement
Placement of the increment/decrement buttons relative to the input field.
[Parameter]
public StepButtonPlacement ButtonPlacement { get; set; }
Property Value
Color
Text color of the input. Accepts any valid CSS color value, PaletteColor or BOBColor.
[Parameter]
public string? Color { get; set; }
Property Value
- string
Culture
Culture used for number formatting and parsing. Defaults to System.Globalization.CultureInfo.CurrentCulture.
[Parameter]
public CultureInfo? Culture { get; set; }
Property Value
- CultureInfo
DecimalPlaces
Number of decimal places to display. null defers to the value type's default formatting.
[Parameter]
public int? DecimalPlaces { get; set; }
Property Value
- int?
DefaultVariant
Default variant used when no explicit variant is specified.
public override BOBInputVariant DefaultVariant { get; }
Property Value
Density
Vertical density (gap) of the input.
[Parameter]
public BOBDensity Density { get; set; }
Property Value
EnableAcceleration
When true, Acceleration is enabled.
[Parameter]
public bool EnableAcceleration { get; set; }
Property Value
- bool
EnableMouseWheel
When true, MouseWheel is enabled.
[Parameter]
public bool EnableMouseWheel { get; set; }
Property Value
- bool
HelperText
Helper text displayed below the component for additional context.
[Parameter]
public string? HelperText { get; set; }
Property Value
- string
Label
Floating label displayed above the input when it has a value or focus.
[Parameter]
public string? Label { get; set; }
Property Value
- string
Loading
When true, the input shows a loading indicator.
[Parameter]
public bool Loading { get; set; }
Property Value
- bool
LoadingIndicatorVariant
[Parameter]
public BOBProgressIconVariant LoadingIndicatorVariant { get; set; }
Property Value
Max
Upper bound for the input, emitted as the max HTML attribute and
enforced by the step buttons. UI hint only — re-validate on the server.
[Parameter]
public decimal? Max { get; set; }
Property Value
- decimal?
Min
Lower bound for the input, emitted as the min HTML attribute and
enforced by the step buttons. UI hint only — re-validate on the server.
[Parameter]
public decimal? Min { get; set; }
Property Value
- decimal?
OnDecrement
Raised when the Decrement event occurs.
[Parameter]
public EventCallback<TValue?> OnDecrement { get; set; }
Property Value
- EventCallback<TValue>
OnIncrement
Raised when the Increment event occurs.
[Parameter]
public EventCallback<TValue?> OnIncrement { get; set; }
Property Value
- EventCallback<TValue>
Placeholder
Placeholder text shown when the component is empty.
[Parameter]
public string? Placeholder { get; set; }
Property Value
- string
PrefixBackgroundColor
PrefixBackground color. Accepts any valid CSS color value, PaletteColor or BOBColor.
[Parameter]
public string? PrefixBackgroundColor { get; set; }
Property Value
- string
PrefixColor
Prefix color. Accepts any valid CSS color value, PaletteColor or BOBColor.
[Parameter]
public string? PrefixColor { get; set; }
Property Value
- string
PrefixIcon
Material icon name for the Prefix.
[Parameter]
public IconKey? PrefixIcon { get; set; }
Property Value
PrefixText
Text displayed before the input value.
[Parameter]
public string? PrefixText { get; set; }
Property Value
- string
Shadow
Shadow style applied to the input container.
[Parameter]
public ShadowStyle? Shadow { get; set; }
Property Value
ShowStepButtons
When true, the StepButtons is shown.
[Parameter]
public bool ShowStepButtons { get; set; }
Property Value
- bool
Size
Visual size of the input.
[Parameter]
public BOBSize Size { get; set; }
Property Value
Step
Step size for the increment/decrement buttons and the step HTML
attribute. UI hint only — re-validate on the server.
[Parameter]
public decimal Step { get; set; }
Property Value
- decimal
SuffixBackgroundColor
SuffixBackground color. Accepts any valid CSS color value, PaletteColor or BOBColor.
[Parameter]
public string? SuffixBackgroundColor { get; set; }
Property Value
- string
SuffixColor
Suffix color. Accepts any valid CSS color value, PaletteColor or BOBColor.
[Parameter]
public string? SuffixColor { get; set; }
Property Value
- string
SuffixIcon
Material icon name for the Suffix.
[Parameter]
public IconKey? SuffixIcon { get; set; }
Property Value
SuffixText
Text displayed after the input value.
[Parameter]
public string? SuffixText { get; set; }
Property Value
- string
UseThousandsSeparator
When true, the displayed value is grouped with the culture's thousands separator.
[Parameter]
public bool UseThousandsSeparator { get; set; }
Property Value
- bool
Methods
BuildComponentCssVariables(Dictionary<string, string>)
Contributes additional CSS custom properties to the inline style attribute. Keys
that collide with framework-owned --bob-inline-* variables will be overwritten.
public void BuildComponentCssVariables(Dictionary<string, string> cssVariables)
Parameters
cssVariablesDictionary<string, string>
BuildComponentDataAttributes(Dictionary<string, object>)
Contributes additional data- attributes to the root element. Keys that collide
with framework-owned data-bob- attributes will be overwritten.
public void BuildComponentDataAttributes(Dictionary<string, object> dataAttributes)
Parameters
dataAttributesDictionary<string, object>
BuildRenderTree(RenderTreeBuilder)
Renders the component to the supplied Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builderRenderTreeBuilder
Dispose(bool)
Sync disposal path inherited from Microsoft.AspNetCore.Components.Forms.InputBase<TValue>. Unsubscribes the Microsoft.AspNetCore.Components.Forms.EditContext validation handler so the next component instance does not double-fire validation. JS-side cleanup belongs in DisposeAsync().
protected override void Dispose(bool disposing)
Parameters
disposingbool
OnParametersSet()
Method invoked when the component has received parameters from its parent in the render tree, and the incoming values have been assigned to properties.
protected override void OnParametersSet()
TryParseValueFromString(string?, out TValue, out string?)
Parses a string to create an instance of TValue. Derived classes can override this to change how
Microsoft.AspNetCore.Components.Forms.InputBase<TValue>.CurrentValueAsString interprets incoming values.
protected override bool TryParseValueFromString(string? value, out TValue result, out string? validationErrorMessage)
Parameters
valuestringThe string value to be parsed.
resultTValueAn instance of
TValue.validationErrorMessagestringIf the value could not be parsed, provides a validation error message.
Returns
- bool
True if the value could be parsed; otherwise false.