Compare commits
8 Commits
38d5bd0149
...
a63bd4e5ed
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a63bd4e5ed | ||
151f64cef3 | |||
![]() |
96d65df75c | ||
![]() |
d6f63ab76a | ||
![]() |
3804dfbc35 | ||
![]() |
4f36e41d73 | ||
ed15c8f24d | |||
![]() |
3540dc8b54 |
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "dependencies/Connected"]
|
||||
path = dependencies/Connected
|
||||
url = https://git.tompit.com/Connected/Connected.git
|
@ -9,6 +9,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Components.Showca
|
||||
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}"
|
||||
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
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -27,10 +31,17 @@ Global
|
||||
{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.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
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{2118ED53-21AC-4D53-8B02-52980E5C715F} = {BCBA8E3E-D4C0-45A5-8780-FDED0B4C7A47}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {CBDD97EC-4855-4005-97A7-29FE298FB057}
|
||||
EndGlobalSection
|
||||
|
1
dependencies/Connected
vendored
Submodule
1
dependencies/Connected
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit cc259dfc18c4ad6989898fa813e281b9249c3bd3
|
@ -10,8 +10,6 @@
|
||||
</packageRestore>
|
||||
<packageSources>
|
||||
<add key="NuGet official package source" value="https://api.nuget.org/v3/index.json" />
|
||||
<add key="LocalNugetServer" value="%LOCAL_NUGET_SERVER%" />
|
||||
<add key="Local file repository" value="%LOCAL_NUGET%" />
|
||||
</packageSources>
|
||||
<disabledPackageSources />
|
||||
</configuration>
|
@ -8,56 +8,20 @@
|
||||
<p>ValueText: @inputValueText</p>
|
||||
<p>SimpleSelectValue: @SelectedItemValue</p>
|
||||
|
||||
<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
|
||||
<TextInput
|
||||
Label="String"
|
||||
Required="true"
|
||||
ErrorText="@errorText"
|
||||
@bind-Value="@inputValueText">
|
||||
</InputText>
|
||||
</TextInput>
|
||||
|
||||
<InputText
|
||||
<TextInput
|
||||
Label="Password"
|
||||
IsPassword="true"
|
||||
Required="true"
|
||||
ErrorText="@errorText"
|
||||
@bind-Value="@inputValueText">
|
||||
</InputText>
|
||||
|
||||
<SimpleSelect
|
||||
Label="Simple Select"
|
||||
|
||||
ValueType="string"
|
||||
@bind-Value="@SelectedItemValue"
|
||||
Items="@SelectFieldItems">
|
||||
</SimpleSelect>
|
||||
</TextInput>
|
||||
|
||||
|
||||
@code {
|
||||
|
@ -20,7 +20,6 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.*-*" />
|
||||
<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')" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -39,16 +38,9 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\dependencies\Connected\src\Connected.Client\Connected.Client.csproj" />
|
||||
<ProjectReference Include="..\connected.components\Connected.Components.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="CopyPackages" AfterTargets="Pack">
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
</Target>
|
||||
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages">
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
</Project>
|
||||
|
@ -96,6 +96,10 @@ public partial class Button
|
||||
[Parameter]
|
||||
public string Style { get; set; } = string.Empty;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Button click event.
|
||||
/// Options: any MouseEventCallback event
|
||||
@ -103,13 +107,9 @@ public partial class Button
|
||||
[Parameter]
|
||||
public EventCallback<MouseEventArgs> OnClick { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
protected async Task Click(MouseEventArgs e)
|
||||
{
|
||||
await OnClick.InvokeAsync(e);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -146,5 +146,4 @@ public partial class Button
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,6 @@
|
||||
<br/>
|
||||
<svg height="@Height" width="@Width" style="fill:@Color;" class="@GlyphClassList" @onclick="@OnClick">
|
||||
|
||||
<div style="width:@WidthString; height:@HeightString; overflow:hidden">
|
||||
<svg viewBox="0 0 24 24" style="fill:@Color;" class="@GlyphClassList" @onclick="@OnClick">
|
||||
@((MarkupString)SVG)
|
||||
</svg>
|
||||
</svg>
|
||||
</div>
|
@ -13,11 +13,27 @@ namespace Connected.Components
|
||||
public string Color { get; set; } = "#000000";
|
||||
|
||||
[Parameter]
|
||||
public int Width { get; set; } = 25;
|
||||
public int Width { get; set; } = 24;
|
||||
[Parameter]
|
||||
public int Height { get; set; } = 25;
|
||||
public int Height { get; set; } = 24;
|
||||
|
||||
[Parameter]
|
||||
private string WidthString
|
||||
{
|
||||
get
|
||||
{
|
||||
return Width.ToString() + "px";
|
||||
}
|
||||
}
|
||||
|
||||
private string HeightString
|
||||
{
|
||||
get
|
||||
{
|
||||
return Width.ToString() + "px";
|
||||
}
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public string Class { get; set; } = string.Empty;
|
||||
|
||||
private string GlyphClassList
|
||||
@ -32,7 +48,7 @@ namespace Connected.Components
|
||||
|
||||
[Parameter]
|
||||
/// <summary>
|
||||
/// Button click event.
|
||||
/// Glyph click event.
|
||||
/// </summary>
|
||||
public EventCallback<MouseEventArgs> Click { get; set; }
|
||||
protected async Task OnClick(MouseEventArgs e)
|
||||
|
@ -11,10 +11,12 @@
|
||||
disabled="@Disabled"
|
||||
readonly="@Readonly"
|
||||
@onmousewheel="@OnMouseWheel"
|
||||
@onwheel="@OnMouseWheel"
|
||||
@oninput=@ChangeValueAsync
|
||||
@bind-value="@_value"
|
||||
@bind-value="@Value"
|
||||
@attributes="@InputAttributes">
|
||||
</input>
|
||||
|
||||
|
||||
<span class="highlight"></span>
|
||||
<span class="bar"></span>
|
@ -3,9 +3,10 @@ using Connected.Utilities;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using System.Numerics;
|
||||
using static Connected.Colors;
|
||||
|
||||
namespace Connected.Components;
|
||||
public partial class InputNumber<NumberType>:InputBase where NumberType : INumber<NumberType>
|
||||
public partial class NumberInput<NumberType>:InputBase where NumberType : INumber<NumberType>
|
||||
{
|
||||
private double _step =1;
|
||||
[Parameter]
|
||||
@ -40,7 +41,7 @@ public partial class InputNumber<NumberType>:InputBase where NumberType : INumbe
|
||||
}
|
||||
protected async Task OnMouseWheel(WheelEventArgs obj)
|
||||
{
|
||||
if (!DisableMouseWheel)
|
||||
if (DisableMouseWheel==false)
|
||||
{
|
||||
if (!obj.ShiftKey || Disabled || Readonly)
|
||||
return;
|
||||
@ -55,19 +56,12 @@ public partial class InputNumber<NumberType>:InputBase where NumberType : INumbe
|
||||
}
|
||||
}
|
||||
|
||||
private NumberType _value;
|
||||
|
||||
[Parameter]
|
||||
public NumberType Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return _value;
|
||||
}
|
||||
set
|
||||
{
|
||||
_value = AdjustDecimalPlaces(value);
|
||||
}
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
@ -81,13 +75,13 @@ public partial class InputNumber<NumberType>:InputBase where NumberType : INumbe
|
||||
{
|
||||
if (args.Value is not null)
|
||||
{
|
||||
NumberType value = (NumberType)Convert.ChangeType(args.Value, typeof(NumberType));
|
||||
if (value.ToString().Length <= 0)
|
||||
{
|
||||
NumberType value = (NumberType)Convert.ChangeType(args.Value, typeof(NumberType));
|
||||
if (value.ToString().Length <= 0)
|
||||
{
|
||||
|
||||
value = (NumberType)Convert.ChangeType(0, typeof(NumberType));
|
||||
}
|
||||
await ValueChanged.InvokeAsync((NumberType)Convert.ChangeType(AdjustDecimalPlaces(value), typeof(NumberType)));
|
||||
value = (NumberType)Convert.ChangeType(0, typeof(NumberType));
|
||||
}
|
||||
await ValueChanged.InvokeAsync((NumberType)Convert.ChangeType(AdjustDecimalPlaces(value), typeof(NumberType)));
|
||||
}
|
||||
}
|
||||
|
@ -1,18 +0,0 @@
|
||||
@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>
|
@ -1,45 +0,0 @@
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
@ -41,7 +41,7 @@
|
||||
}
|
||||
<span class="input-glyph-wraper">
|
||||
<span class="input-glyph">
|
||||
@if (Clearable && Value.ToString().Length>0)
|
||||
@if (Clearable && !string.IsNullOrEmpty(Value))
|
||||
{
|
||||
<span class="input-glyph button" @onclick="Clear">
|
||||
<Glyph SVG="@Icons.Material.Rounded.Dangerous" />
|
@ -2,7 +2,7 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace Connected.Components;
|
||||
public partial class InputText: InputBase
|
||||
public partial class TextInput: InputBase
|
||||
{
|
||||
|
||||
[Parameter]
|
||||
@ -31,7 +31,7 @@ public partial class InputText: InputBase
|
||||
|
||||
|
||||
[Parameter]
|
||||
public string Value { get; set; }
|
||||
public string Value { get; set; } = string.Empty;
|
||||
|
||||
private string inputType
|
||||
{
|
||||
@ -42,7 +42,6 @@ public partial class InputText: InputBase
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<string> ValueChanged { get; set; }
|
||||
|
@ -20,13 +20,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="compilerconfig.json" />
|
||||
<None Include="ComponentsN\ToggleButton.razor" />
|
||||
<None Include="ComponentsN\Button.razor" />
|
||||
<None Include="ComponentsN\Glyph.razor" />
|
||||
<None Include="ComponentsN\Link.razor" />
|
||||
<None Include="ComponentsN\InputDate.razor" />
|
||||
<None Include="ComponentsN\InputNumber.razor" />
|
||||
<None Include="ComponentsN\InputText.razor" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -39,9 +32,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Interfaces\" />
|
||||
<Folder Include="Services\" />
|
||||
<Folder Include="wwwroot\" />
|
||||
<None Include="..\..\LICENSE">
|
||||
<Pack>True</Pack>
|
||||
<PackagePath>\</PackagePath>
|
||||
@ -86,19 +76,11 @@
|
||||
<Delete Files="./Styles/Connected.Components.min.css" />
|
||||
</Target>
|
||||
|
||||
<!--Dont Include in build output-->
|
||||
<ItemGroup>
|
||||
<Content Remove="compilerconfig.json" />
|
||||
<Content Remove="excubowebcompiler.json" />
|
||||
<Content Remove="wwwroot/DoNotRemove.txt" />
|
||||
<!--macOS hidden file (causes problems with dotnet pack)-->
|
||||
<Content Remove="**/*/.DS_Store" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Watch Include="**/*.scss" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<Watch Remove="Styles\Connected.Components.scss" />
|
||||
</ItemGroup>
|
||||
|
Loading…
x
Reference in New Issue
Block a user