Cleanup, progress #5

Merged
koma merged 1 commits from features/rewrite/cleanup into features/rewrite/main 2 years ago

@ -42,13 +42,5 @@
<ProjectReference Include="..\connected.components\Connected.Components.csproj" /> <ProjectReference Include="..\connected.components\Connected.Components.csproj" />
</ItemGroup> </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> </Project>

@ -96,6 +96,10 @@ public partial class Button
[Parameter] [Parameter]
public string Style { get; set; } = string.Empty; public string Style { get; set; } = string.Empty;
#endregion
#region Events
/// <summary> /// <summary>
/// Button click event. /// Button click event.
/// Options: any MouseEventCallback event /// Options: any MouseEventCallback event
@ -103,13 +107,9 @@ public partial class Button
[Parameter] [Parameter]
public EventCallback<MouseEventArgs> OnClick { get; set; } public EventCallback<MouseEventArgs> OnClick { get; set; }
#endregion
#region Events
protected async Task Click(MouseEventArgs e) protected async Task Click(MouseEventArgs e)
{ {
await OnClick.InvokeAsync(e); await OnClick.InvokeAsync(e);
} }
#endregion #endregion
@ -146,5 +146,4 @@ public partial class Button
#endregion #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) @((MarkupString)SVG)
</svg> </svg>
</div>

@ -13,11 +13,27 @@ namespace Connected.Components
public string Color { get; set; } = "#000000"; public string Color { get; set; } = "#000000";
[Parameter] [Parameter]
public int Width { get; set; } = 25; public int Width { get; set; } = 24;
[Parameter] [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; public string Class { get; set; } = string.Empty;
private string GlyphClassList private string GlyphClassList
@ -32,7 +48,7 @@ namespace Connected.Components
[Parameter] [Parameter]
/// <summary> /// <summary>
/// Button click event. /// Glyph click event.
/// </summary> /// </summary>
public EventCallback<MouseEventArgs> Click { get; set; } public EventCallback<MouseEventArgs> Click { get; set; }
protected async Task OnClick(MouseEventArgs e) protected async Task OnClick(MouseEventArgs e)

@ -11,10 +11,12 @@
disabled="@Disabled" disabled="@Disabled"
readonly="@Readonly" readonly="@Readonly"
@onmousewheel="@OnMouseWheel" @onmousewheel="@OnMouseWheel"
@onwheel="@OnMouseWheel"
@oninput=@ChangeValueAsync @oninput=@ChangeValueAsync
@bind-value="@_value" @bind-value="@Value"
@attributes="@InputAttributes"> @attributes="@InputAttributes">
</input> </input>
<span class="highlight"></span> <span class="highlight"></span>
<span class="bar"></span> <span class="bar"></span>

@ -3,9 +3,10 @@ using Connected.Utilities;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.Web;
using System.Numerics; using System.Numerics;
using static Connected.Colors;
namespace Connected.Components; 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; private double _step =1;
[Parameter] [Parameter]
@ -40,7 +41,7 @@ public partial class InputNumber<NumberType>:InputBase where NumberType : INumbe
} }
protected async Task OnMouseWheel(WheelEventArgs obj) protected async Task OnMouseWheel(WheelEventArgs obj)
{ {
if (!DisableMouseWheel) if (DisableMouseWheel==false)
{ {
if (!obj.ShiftKey || Disabled || Readonly) if (!obj.ShiftKey || Disabled || Readonly)
return; return;
@ -55,19 +56,12 @@ public partial class InputNumber<NumberType>:InputBase where NumberType : INumbe
} }
} }
private NumberType _value;
[Parameter] [Parameter]
public NumberType Value public NumberType Value
{ {
get get;
{ set;
return _value;
}
set
{
_value = AdjustDecimalPlaces(value);
}
} }
[Parameter] [Parameter]
@ -81,13 +75,13 @@ public partial class InputNumber<NumberType>:InputBase where NumberType : INumbe
{ {
if (args.Value is not null) if (args.Value is not null)
{ {
NumberType value = (NumberType)Convert.ChangeType(args.Value, typeof(NumberType)); NumberType value = (NumberType)Convert.ChangeType(args.Value, typeof(NumberType));
if (value.ToString().Length <= 0) if (value.ToString().Length <= 0)
{ {
value = (NumberType)Convert.ChangeType(0, typeof(NumberType)); value = (NumberType)Convert.ChangeType(0, typeof(NumberType));
} }
await ValueChanged.InvokeAsync((NumberType)Convert.ChangeType(AdjustDecimalPlaces(value), typeof(NumberType))); await ValueChanged.InvokeAsync((NumberType)Convert.ChangeType(AdjustDecimalPlaces(value), typeof(NumberType)));
} }
} }

@ -41,7 +41,7 @@
} }
<span class="input-glyph-wraper"> <span class="input-glyph-wraper">
<span class="input-glyph"> <span class="input-glyph">
@if (Clearable && Value.ToString().Length>0) @if (Clearable && !string.IsNullOrEmpty(Value))
{ {
<span class="input-glyph button" @onclick="Clear"> <span class="input-glyph button" @onclick="Clear">
<Glyph SVG="@Icons.Material.Rounded.Dangerous" /> <Glyph SVG="@Icons.Material.Rounded.Dangerous" />

@ -2,7 +2,7 @@
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace Connected.Components; namespace Connected.Components;
public partial class InputText: InputBase public partial class TextInput: InputBase
{ {
[Parameter] [Parameter]
@ -31,7 +31,7 @@ public partial class InputText: InputBase
[Parameter] [Parameter]
public string Value { get; set; } public string Value { get; set; } = string.Empty;
private string inputType private string inputType
{ {
@ -42,7 +42,6 @@ public partial class InputText: InputBase
} }
} }
[Parameter] [Parameter]
public EventCallback<string> ValueChanged { get; set; } public EventCallback<string> ValueChanged { get; set; }

@ -20,13 +20,6 @@
<ItemGroup> <ItemGroup>
<None Include="compilerconfig.json" /> <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>
<ItemGroup> <ItemGroup>
@ -39,9 +32,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Interfaces\" />
<Folder Include="Services\" />
<Folder Include="wwwroot\" />
<None Include="..\..\LICENSE"> <None Include="..\..\LICENSE">
<Pack>True</Pack> <Pack>True</Pack>
<PackagePath>\</PackagePath> <PackagePath>\</PackagePath>
@ -86,19 +76,11 @@
<Delete Files="./Styles/Connected.Components.min.css" /> <Delete Files="./Styles/Connected.Components.min.css" />
</Target> </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> <ItemGroup>
<Watch Include="**/*.scss" /> <Watch Include="**/*.scss" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Watch Remove="Styles\Connected.Components.scss" /> <Watch Remove="Styles\Connected.Components.scss" />
</ItemGroup> </ItemGroup>

Loading…
Cancel
Save