Compare commits
No commits in common. "96d65df75c2b44bf80780fbf9f60f1f354f58a7e" and "ed15c8f24dfa4fdc99aecdb06f8eaa842973f119" have entirely different histories.
96d65df75c
...
ed15c8f24d
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +0,0 @@
|
|||||||
[submodule "dependencies/Connected"]
|
|
||||||
path = dependencies/Connected
|
|
||||||
url = https://git.tompit.com/Connected/Connected.git
|
|
@ -9,10 +9,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Components.Showca
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Components.Showcase.Runner", "src\Connected.Components.Showcase.Runner\Connected.Components.Showcase.Runner.csproj", "{347B526C-39A0-43CE-B0F9-79E61B4897C6}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Components.Showcase.Runner", "src\Connected.Components.Showcase.Runner\Connected.Components.Showcase.Runner.csproj", "{347B526C-39A0-43CE-B0F9-79E61B4897C6}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dependencies", "Dependencies", "{BCBA8E3E-D4C0-45A5-8780-FDED0B4C7A47}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Client", "dependencies\Connected\src\Connected.Client\Connected.Client.csproj", "{2118ED53-21AC-4D53-8B02-52980E5C715F}"
|
|
||||||
EndProject
|
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@ -31,17 +27,10 @@ Global
|
|||||||
{347B526C-39A0-43CE-B0F9-79E61B4897C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{347B526C-39A0-43CE-B0F9-79E61B4897C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{347B526C-39A0-43CE-B0F9-79E61B4897C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{347B526C-39A0-43CE-B0F9-79E61B4897C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{347B526C-39A0-43CE-B0F9-79E61B4897C6}.Release|Any CPU.Build.0 = Release|Any CPU
|
{347B526C-39A0-43CE-B0F9-79E61B4897C6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{2118ED53-21AC-4D53-8B02-52980E5C715F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{2118ED53-21AC-4D53-8B02-52980E5C715F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{2118ED53-21AC-4D53-8B02-52980E5C715F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{2118ED53-21AC-4D53-8B02-52980E5C715F}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(NestedProjects) = preSolution
|
|
||||||
{2118ED53-21AC-4D53-8B02-52980E5C715F} = {BCBA8E3E-D4C0-45A5-8780-FDED0B4C7A47}
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {CBDD97EC-4855-4005-97A7-29FE298FB057}
|
SolutionGuid = {CBDD97EC-4855-4005-97A7-29FE298FB057}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
1
dependencies/Connected
vendored
1
dependencies/Connected
vendored
@ -1 +0,0 @@
|
|||||||
Subproject commit cc259dfc18c4ad6989898fa813e281b9249c3bd3
|
|
@ -8,20 +8,56 @@
|
|||||||
<p>ValueText: @inputValueText</p>
|
<p>ValueText: @inputValueText</p>
|
||||||
<p>SimpleSelectValue: @SelectedItemValue</p>
|
<p>SimpleSelectValue: @SelectedItemValue</p>
|
||||||
|
|
||||||
<TextInput
|
<InputNumber
|
||||||
|
Clearable="false"
|
||||||
|
DisableMouseWheel="false"
|
||||||
|
Disabled="false"
|
||||||
|
Readonly="false"
|
||||||
|
Placeholder="Double"
|
||||||
|
Label="Double"
|
||||||
|
Required="true"
|
||||||
|
Step="0.000516"
|
||||||
|
DecimalPlaces=5
|
||||||
|
Class="m-2"
|
||||||
|
@bind-Value="@inputValueDouble">
|
||||||
|
</InputNumber>
|
||||||
|
|
||||||
|
<InputNumber
|
||||||
|
Clearable="true"
|
||||||
|
DisableMouseWheel="false"
|
||||||
|
Disabled="false"
|
||||||
|
Readonly="false"
|
||||||
|
Placeholder="Double"
|
||||||
|
Label="Integer"
|
||||||
|
Required="true"
|
||||||
|
Step="0.001"
|
||||||
|
DecimalPlaces="2"
|
||||||
|
Class="m-4"
|
||||||
|
@bind-Value="@inputValueInt">
|
||||||
|
</InputNumber>
|
||||||
|
|
||||||
|
<InputText
|
||||||
Label="String"
|
Label="String"
|
||||||
Required="true"
|
Required="true"
|
||||||
ErrorText="@errorText"
|
ErrorText="@errorText"
|
||||||
@bind-Value="@inputValueText">
|
@bind-Value="@inputValueText">
|
||||||
</TextInput>
|
</InputText>
|
||||||
|
|
||||||
<TextInput
|
<InputText
|
||||||
Label="Password"
|
Label="Password"
|
||||||
IsPassword="true"
|
IsPassword="true"
|
||||||
Required="true"
|
Required="true"
|
||||||
ErrorText="@errorText"
|
ErrorText="@errorText"
|
||||||
@bind-Value="@inputValueText">
|
@bind-Value="@inputValueText">
|
||||||
</TextInput>
|
</InputText>
|
||||||
|
|
||||||
|
<SimpleSelect
|
||||||
|
Label="Simple Select"
|
||||||
|
|
||||||
|
ValueType="string"
|
||||||
|
@bind-Value="@SelectedItemValue"
|
||||||
|
Items="@SelectFieldItems">
|
||||||
|
</SimpleSelect>
|
||||||
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.*-*" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.*-*" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.*-*" PrivateAssets="all" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.*-*" PrivateAssets="all" />
|
||||||
|
<PackageReference Include="Connected.Client" Version="1.0.*-*" />
|
||||||
<PackageReference Include="Nerdbank.GitVersioning" Version="3.5.119" PrivateAssets="all" Condition="!Exists('packages.config')" />
|
<PackageReference Include="Nerdbank.GitVersioning" Version="3.5.119" PrivateAssets="all" Condition="!Exists('packages.config')" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@ -38,7 +39,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\dependencies\Connected\src\Connected.Client\Connected.Client.csproj" />
|
|
||||||
<ProjectReference Include="..\connected.components\Connected.Components.csproj" />
|
<ProjectReference Include="..\connected.components\Connected.Components.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
18
src/Connected.Components/Components/SimpleSelect.razor
Normal file
18
src/Connected.Components/Components/SimpleSelect.razor
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
@using Connected.Models;
|
||||||
|
|
||||||
|
@typeparam ValueType
|
||||||
|
|
||||||
|
@inherits InputBase;
|
||||||
|
|
||||||
|
<div class="@InputFieldClassList">
|
||||||
|
<select @bind="@Value" @oninput="@ChangeValueAsync">
|
||||||
|
@if (EnableSearch)
|
||||||
|
{
|
||||||
|
<InputText @bind-Value="@SearchText" ValueChanged=""></InputText>
|
||||||
|
}
|
||||||
|
@foreach(SelectItem<ValueType> item in Items)
|
||||||
|
{
|
||||||
|
<option value="@item.Value">@item.DisplayedText</option>
|
||||||
|
}
|
||||||
|
</select>
|
||||||
|
</div>
|
45
src/Connected.Components/Components/SimpleSelect.razor.cs
Normal file
45
src/Connected.Components/Components/SimpleSelect.razor.cs
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
using Connected.Models;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Connected.Components;
|
||||||
|
public partial class SimpleSelect<ValueType> : InputBase
|
||||||
|
{
|
||||||
|
[Parameter]
|
||||||
|
public ValueType Value { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public IEnumerable<SelectItem<ValueType>> Items { get; set; }
|
||||||
|
|
||||||
|
public IEnumerable<SelectItem<ValueType>> 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<ValueType> 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();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user