diff --git a/BlazorBootstrap.Demo.RCL/Components/Layout/MainLayout.razor.cs b/BlazorBootstrap.Demo.RCL/Components/Layout/MainLayout.razor.cs index c94f1f78e..64f809290 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Layout/MainLayout.razor.cs +++ b/BlazorBootstrap.Demo.RCL/Components/Layout/MainLayout.razor.cs @@ -24,7 +24,7 @@ internal override IEnumerable GetNavItems() new (){ Id = "403", Text = "Number Input", Href = RouteConstants.Demos_NumberInput_Documentation, IconName = IconName.InputCursor, ParentId = "4" }, new (){ Id = "403", Text = "Radio Input", Href = RouteConstants.Demos_RadioInput_Documentation, IconName = IconName.RecordCircle, ParentId = "4" }, new (){ Id = "404", Text = "Range Input", Href = RouteConstants.Demos_RangeInput_Documentation, IconName = IconName.Sliders, ParentId = "4" }, - new (){ Id = "404", Text = "Select Input", Href = RouteConstants.Demos_SelectInput_Documentation, IconName = IconName.MenuButtonWideFill, ParentId = "4" }, + //new (){ Id = "404", Text = "Select Input", Href = RouteConstants.Demos_SelectInput_Documentation, IconName = IconName.MenuButtonWideFill, ParentId = "4" }, new (){ Id = "405", Text = "Switch", Href = RouteConstants.Demos_Switch_Documentation, IconName = IconName.ToggleOn, ParentId = "4" }, new (){ Id = "406", Text = "Text Input", Href = RouteConstants.Demos_TextInput_Documentation, IconName = IconName.InputCursorText, ParentId = "4" }, new (){ Id = "407", Text = "Text Area Input", Href = RouteConstants.Demos_TextAreaInput_Documentation, IconName = IconName.InputCursorText, ParentId = "4" }, diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Index.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Index.razor index 34d81885e..feb8706c4 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Index.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Index.razor @@ -200,11 +200,11 @@

Script Loader

-
+ @* +
*@

Sidebar

@@ -309,11 +309,11 @@

Range Input

-
+ @* +
*@

Switch

diff --git a/blazorbootstrap/Components/Form/SelectInput/SelectInput.razor b/blazorbootstrap/Components/Form/SelectInput/SelectInput.razor index 795fbbbc6..9e3df9654 100644 --- a/blazorbootstrap/Components/Form/SelectInput/SelectInput.razor +++ b/blazorbootstrap/Components/Form/SelectInput/SelectInput.razor @@ -1,4 +1,4 @@ -@namespace BlazorBootstrap +@* @namespace BlazorBootstrap @inherits BlazorBootstrapComponentBase \ No newline at end of file + @onchange="OnChange" /> *@ \ No newline at end of file diff --git a/blazorbootstrap/Components/Form/SelectInput/SelectInput.razor.cs b/blazorbootstrap/Components/Form/SelectInput/SelectInput.razor.cs index fde894568..c22fc7617 100644 --- a/blazorbootstrap/Components/Form/SelectInput/SelectInput.razor.cs +++ b/blazorbootstrap/Components/Form/SelectInput/SelectInput.razor.cs @@ -1,116 +1,116 @@ -namespace BlazorBootstrap; - -public partial class SelectInput : BlazorBootstrapComponentBase -{ - #region Fields and Constants - - private FieldIdentifier fieldIdentifier; - - #endregion - - #region Methods - - protected override void OnInitialized() - { - AdditionalAttributes ??= new Dictionary(); - - fieldIdentifier = FieldIdentifier.Create(ValueExpression); - - base.OnInitialized(); - } - - /// - /// Disables number input. - /// - public void Disable() => Disabled = true; - - /// - /// Enables number input. - /// - public void Enable() => Disabled = false; - - private async Task OnChange(ChangeEventArgs e) - { - var oldValue = Value; - var newValue = e.Value?.ToString() ?? string.Empty; // object - - await ValueChanged.InvokeAsync(newValue); - - EditContext?.NotifyFieldChanged(fieldIdentifier); - } - - #endregion - - #region Properties, Indexers - - protected override string? ClassNames => - BuildClassNames( - Class, - (BootstrapClass.FormControl, true), - (TextAlignment.ToTextAlignmentClass(), TextAlignment != Alignment.None) - ); - - private string autoComplete => AutoComplete ? "true" : "false"; - - /// - /// If , NumberInput can complete the values automatically by the browser. - /// - /// - /// Default value is false. - /// - [Parameter] - public bool AutoComplete { get; set; } - - /// - /// Gets or sets the disabled state. - /// - /// - /// Default value is false. - /// - [Parameter] - public bool Disabled { get; set; } - - [CascadingParameter] private EditContext EditContext { get; set; } = default!; - - private string fieldCssClasses => EditContext?.FieldCssClass(fieldIdentifier) ?? ""; - - /// - /// Gets or sets the maximum length of the input. - /// - [Parameter] - public int? MaxLength { get; set; } - - /// - /// Gets or sets the placeholder. - /// - /// - /// Default value is null. - /// - [Parameter] - public string? Placeholder { get; set; } - - /// - /// Gets or sets the text alignment. - /// - /// - /// Default value is . - /// - [Parameter] - public Alignment TextAlignment { get; set; } = Alignment.None; - - /// - /// Gets or sets the value. - /// - [Parameter] - public string Value { get; set; } = default!; - - /// - /// This event fired on every user keystroke that changes the NumberInput value. - /// - [Parameter] - public EventCallback ValueChanged { get; set; } - - [Parameter] public Expression> ValueExpression { get; set; } = default!; - - #endregion -} +//namespace BlazorBootstrap; + +//public partial class SelectInput : BlazorBootstrapComponentBase +//{ +// #region Fields and Constants + +// private FieldIdentifier fieldIdentifier; + +// #endregion + +// #region Methods + +// protected override void OnInitialized() +// { +// AdditionalAttributes ??= new Dictionary(); + +// fieldIdentifier = FieldIdentifier.Create(ValueExpression); + +// base.OnInitialized(); +// } + +// /// +// /// Disables number input. +// /// +// public void Disable() => Disabled = true; + +// /// +// /// Enables number input. +// /// +// public void Enable() => Disabled = false; + +// private async Task OnChange(ChangeEventArgs e) +// { +// var oldValue = Value; +// var newValue = e.Value?.ToString() ?? string.Empty; // object + +// await ValueChanged.InvokeAsync(newValue); + +// EditContext?.NotifyFieldChanged(fieldIdentifier); +// } + +// #endregion + +// #region Properties, Indexers + +// protected override string? ClassNames => +// BuildClassNames( +// Class, +// (BootstrapClass.FormControl, true), +// (TextAlignment.ToTextAlignmentClass(), TextAlignment != Alignment.None) +// ); + +// private string autoComplete => AutoComplete ? "true" : "false"; + +// /// +// /// If , NumberInput can complete the values automatically by the browser. +// /// +// /// +// /// Default value is false. +// /// +// [Parameter] +// public bool AutoComplete { get; set; } + +// /// +// /// Gets or sets the disabled state. +// /// +// /// +// /// Default value is false. +// /// +// [Parameter] +// public bool Disabled { get; set; } + +// [CascadingParameter] private EditContext EditContext { get; set; } = default!; + +// private string fieldCssClasses => EditContext?.FieldCssClass(fieldIdentifier) ?? ""; + +// /// +// /// Gets or sets the maximum length of the input. +// /// +// [Parameter] +// public int? MaxLength { get; set; } + +// /// +// /// Gets or sets the placeholder. +// /// +// /// +// /// Default value is null. +// /// +// [Parameter] +// public string? Placeholder { get; set; } + +// /// +// /// Gets or sets the text alignment. +// /// +// /// +// /// Default value is . +// /// +// [Parameter] +// public Alignment TextAlignment { get; set; } = Alignment.None; + +// /// +// /// Gets or sets the value. +// /// +// [Parameter] +// public string Value { get; set; } = default!; + +// /// +// /// This event fired on every user keystroke that changes the NumberInput value. +// /// +// [Parameter] +// public EventCallback ValueChanged { get; set; } + +// [Parameter] public Expression> ValueExpression { get; set; } = default!; + +// #endregion +//}