@page "/"

<h1 style="text-align:center;">Component Sandbox</h1>

<p>ValueDouble: @inputValueDouble.ToString()</p>
<p>ValueInt: @inputValueInt.ToString()</p>
<p>ValueText: @inputValueText</p>

<InputNumber
    Label="Double"
    Required="true"
    Step="0.001"
    DecimalPlaces="2"
    @bind-Value="@inputValueDouble">
</InputNumber>

<InputNumber
       Label="Integer"
       Required="true"
       Step="0.002"
       
       @bind-Value="@inputValueInt">
</InputNumber>

<InputText
       Label="String"
       Required="true"
       ErrorText="@errorText"
       @bind-Value="@inputValueText">
</InputText>

<InputPassword Label="Password"
           Required="true"
           @bind-Value="@inputValueText">
</InputPassword>


@code {


    int counter { get; set; } = 0;

    private string _inputText = string.Empty;
    string inputValueText
    {
        get
        {
            return _inputText;
        }
        set
        {
            if (value.Length > 0) errorText = "Error!!!";
            else errorText = "";
            _inputText = value;
            StateHasChanged();
        }
    }
    double inputValueDouble = 12.756;
    int inputValueInt = 12;

    DateTime inputValueDate = DateTime.Now.AddDays(-10);

    public void CounterIncrement()
    {
        counter++;
        StateHasChanged();
    }

    string errorText = "Error!!";

}