From 4f36e41d737cc19ccae6b43c1c56340b5aee6630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20Ko=C5=BEelj?= Date: Mon, 13 Feb 2023 15:03:18 +0100 Subject: [PATCH] Remove botched SimpleSelect --- .../Components/SimpleSelect.razor | 18 -------- .../Components/SimpleSelect.razor.cs | 45 ------------------- 2 files changed, 63 deletions(-) delete mode 100644 src/Connected.Components/Components/SimpleSelect.razor delete mode 100644 src/Connected.Components/Components/SimpleSelect.razor.cs diff --git a/src/Connected.Components/Components/SimpleSelect.razor b/src/Connected.Components/Components/SimpleSelect.razor deleted file mode 100644 index facc072..0000000 --- a/src/Connected.Components/Components/SimpleSelect.razor +++ /dev/null @@ -1,18 +0,0 @@ -@using Connected.Models; - -@typeparam ValueType - -@inherits InputBase; - -
- -
\ No newline at end of file diff --git a/src/Connected.Components/Components/SimpleSelect.razor.cs b/src/Connected.Components/Components/SimpleSelect.razor.cs deleted file mode 100644 index 4bdfdc2..0000000 --- a/src/Connected.Components/Components/SimpleSelect.razor.cs +++ /dev/null @@ -1,45 +0,0 @@ -using Connected.Models; -using Microsoft.AspNetCore.Components; -using System; - -namespace Connected.Components; -public partial class SimpleSelect : InputBase -{ - [Parameter] - public ValueType Value { get; set; } - - [Parameter] - public IEnumerable> Items { get; set; } - - public IEnumerable> OriginalItems { get; set; } - - [Parameter] - public bool EnableSearch { get; set; } = true; - public string SearchText { get; set; } - - public void FilterItems() - { - Items= Items.Where(item => item.Value.ToString().ToLower().Contains(SearchText.ToLower()) || item.DisplayedText.ToString().ToLower().Contains(SearchText.ToLower())); - } - - - [Parameter] - public EventCallback ValueChanged { get; set; } - - private async Task ChangeValueAsync(ChangeEventArgs args) - { - await ValueChanged.InvokeAsync((ValueType)Convert.ChangeType(args.Value, typeof(ValueType))); - } - - protected override async Task OnParametersSetAsync() - { - if (base.InputAttributes is null) base.InputAttributes = new(); - if (base.Required) - { - if (base.InputAttributes.ContainsKey("required")) base.InputAttributes.Add("required", true); - } - OriginalItems = Items; - await base.OnInitializedAsync(); - } - -} \ No newline at end of file