Skip to content

Commit

Permalink
2.3.1 Update nuget package
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe Peugnet committed Nov 15, 2023
1 parent 9603fe5 commit 48652c3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Blazor-Color-Picker-Library/BlazorColorPicker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<RootNamespace>BlazorColorPicker</RootNamespace>
<Authors>Christophe Peugnet</Authors>
<PackageIcon>icon.png</PackageIcon>
<Version>2.3.0</Version>
<Version>2.3.1</Version>
<Description>Opens a modal palette with the Material colors for Blazor Application</Description>
<PackageProjectUrl>https://github.com/tossnet/Blazor-Color-Picker</PackageProjectUrl>
<RepositoryUrl>https://github.com/tossnet/Blazor-Color-Picker</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageReleaseNotes>CSS: migrate to NET7</PackageReleaseNotes>
<Copyright>Copyright 2020-2022</Copyright>
<PackageReleaseNotes>Update nuget package</PackageReleaseNotes>
<Copyright>Copyright 2020-2023</Copyright>
<PackageTags>blazor, color, picker, material, component</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
Expand All @@ -29,7 +29,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.14" />
</ItemGroup>


Expand Down
4 changes: 2 additions & 2 deletions Blazor-Color-Picker-Library/ColorPicker.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<div class="color-picker-modal @cssClass"
<div class="color-picker-modal @CssClass"
tabindex="0" @onkeydown="@KeyDown" @ref="myPalette">
<div class="color-picker-content">
@if (!string.IsNullOrEmpty(Title))
Expand All @@ -10,7 +10,7 @@
</div>
}
<div class="color-picker-body">
<div class="color-picker-palette" style="@customStyle">
<div class="color-picker-palette" style="@CustomStyle">
@foreach (string item in colors)
{
<div class="color-picker-case text-center" style="background-color:@item" @onclick="() => ColorClick(item)">
Expand Down
8 changes: 4 additions & 4 deletions Blazor-Color-Picker-Library/ColorPicker.razor.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components;
namespace BlazorColorPicker;

using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;

public partial class ColorPicker
Expand All @@ -23,8 +23,8 @@ public partial class ColorPicker
[Parameter]
public EventCallback<string> Closed { get; set; }

private string customStyle => !string.IsNullOrWhiteSpace(OverwriteBackgroundColor) ? $"background-color:{OverwriteBackgroundColor}" : "";
private string cssClass => IsOpened ? "color-picker-show" : "color-picker-hide";
private string CustomStyle => !string.IsNullOrWhiteSpace(OverwriteBackgroundColor) ? $"background-color:{OverwriteBackgroundColor}" : "";
private string CssClass => IsOpened ? "color-picker-show" : "color-picker-hide";
private List<string> colors = new();
protected ElementReference myPalette; // set by the @ref attribute

Expand All @@ -37,7 +37,7 @@ protected override void OnParametersSet()
{
colors.Clear();
//My own color pallet
if (MyColorPallet != null && MyColorPallet.Count() > 0)
if (MyColorPallet is not null && MyColorPallet.Any())
{
colors.AddRange(MyColorPallet);
return;
Expand Down

0 comments on commit 48652c3

Please sign in to comment.