Skip to content

Commit

Permalink
Update package 6.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavnavar committed Nov 13, 2024
1 parent 51a9cc1 commit 3d07542
Show file tree
Hide file tree
Showing 153 changed files with 2,809 additions and 21,449 deletions.
14 changes: 7 additions & 7 deletions GridBlazor.Tests/GridBlazor.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Version>5.0.14</Version>
<TargetFramework>net9.0</TargetFramework>
<Version>6.0.0</Version>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.2" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="MSTest.TestAdapter" Version="3.4.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.4.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="9.0.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.3" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions GridBlazor/CGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using GridShared.Grouping;
using GridShared.Pagination;
using GridShared.Sorting;
using GridShared.Style;
using GridShared.Totals;
using GridShared.Utility;
using Microsoft.AspNetCore.Components;
Expand Down Expand Up @@ -958,6 +959,10 @@ public virtual void AutoGenerateColumns()

public bool EditAfterInsert { get; set; } = false;

public CssFramework CssFramework { get; set; }

public HtmlClass HtmlClass { get; set; }

#region Custom row css classes
public void SetRowCssClassesContraint(Func<T, string> contraint)
{
Expand Down
15 changes: 15 additions & 0 deletions GridBlazor/Extensions/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using GridShared;
using Microsoft.Extensions.DependencyInjection;
using System;

namespace GridBlazor
{
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddGridBlazor(this IServiceCollection serviceCollection, Action<IGridBlazorOptions> options = null)
{
serviceCollection.AddSingleton<IGridBlazorService>(x => new GridBlazorService(options));
return serviceCollection;
}
}
}
18 changes: 15 additions & 3 deletions GridBlazor/GridBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>netstandard2.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net5.0;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<RazorLangVersion>3.0</RazorLangVersion>
<LangVersion>11.0</LangVersion>
<GenerateEmbeddedFilesManifest>True</GenerateEmbeddedFilesManifest>
<EnableDefaultEmbeddedResourceItems>False</EnableDefaultEmbeddedResourceItems>
<Version>5.0.14</Version>
<Version>6.0.0</Version>
<Title>GridBlazor</Title>
<Description>Grid components for Blazor</Description>
<Summary>Grid components for Blazor</Summary>
<Authors>Gustau Navarro</Authors>
<PackageTags>grid blazor table crud rest grpc</PackageTags>
<PackageProjectUrl>https://github.com/gustavnavar/Grid.Blazor</PackageProjectUrl>
<PackageLicenseExpression>LGPL-2.1-only</PackageLicenseExpression>
<PackageReleaseNotes>Supports .NET Standard 2.1, .NET 5.0, .NET 6.0, .NET 7.0, .NET 8.0</PackageReleaseNotes>
<PackageReleaseNotes>Supports .NET Standard 2.1, .NET 5.0, .NET 6.0, .NET 7.0, .NET 8.0, .NET 9.0</PackageReleaseNotes>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Expand All @@ -26,6 +26,14 @@
</AssemblyAttribute>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="9.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0" />
<PackageReference Include="Microsoft.Extensions.Primitives" Version="9.0" />
<PackageReference Include="System.Net.Http.Json" Version="9.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="8.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0" />
Expand Down Expand Up @@ -173,6 +181,10 @@
<None Include="wwwroot\css\gridblazor.min.css" />
<None Include="wwwroot\css\gridblazor-bootstrap3.css" />
<None Include="wwwroot\css\gridblazor-bootstrap3.min.css" />
<None Include="wwwroot\css\gridblazor-bulma.css" />
<None Include="wwwroot\css\gridblazor-bulma.min.css" />
<None Include="wwwroot\css\gridblazor-materialize.css" />
<None Include="wwwroot\css\gridblazor-materialize.min.css" />
<None Include="wwwroot\js\gridblazor.js" />
<None Include="wwwroot\js\gridblazor.min.js" />
</ItemGroup>
Expand Down
15 changes: 11 additions & 4 deletions GridBlazor/Pages/BooleanFilterComponent.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@

@if (_init && Visible)
{
<div class="dropdown dropdown-menu grid-dropdown opened" style="display:block;position:relative;@("margin-left:" + _offset.ToString() + "px;")" @ref="boolFilter" @onkeyup="FilterKeyup" @onclick:stopPropagation @onkeyup:stopPropagation>
<div class="@GridHeaderComponent.GridComponent.Grid.HtmlClass.DropdownMenu grid-dropdown"
style="display:block;position:relative;overflow:visible;@("margin-left:" + _offset.ToString() + "px;")"
@ref="boolFilter"
@onkeyup="FilterKeyup"
@onclick:stopPropagation
@onkeyup:stopPropagation>
<div class="grid-dropdown-arrow" style="@("margin-left:" + (-_offset).ToString() + "px;")"></div>
<div class="grid-dropdown-inner">
<div class="grid-popup-widget">
<div class="grid-filter-body">
<label><b>@Strings.FilterValueLabel:</b></label>
<ul class="menu-list">
<div class="@GridHeaderComponent.GridComponent.Grid.HtmlClass.Mt050 @GridHeaderComponent.GridComponent.Grid.HtmlClass.ListFilterValueLabel">
<label class="@GridHeaderComponent.GridComponent.Grid.HtmlClass.FormLabel"><b>@Strings.FilterValueLabel:</b></label>
</div>
<ul class="grid-menu-list">
<li>
<a class="grid-filter-choose@(_filterValue != null && _filterValue.ToLower() == "true" ? " choose-selected" : "")" data-value="true" href="javascript:void(0);" @onclick="ApplyTrueButtonClicked">
@Strings.BoolTrueLabel
Expand All @@ -27,7 +34,7 @@
<div class="grid-popup-additional">
@if (_clearVisible)
{
<ul class="menu-list">
<ul class="grid-menu-list">
<li>
<a class="grid-filter-clear" href="javascript:void(0);" @onclick="ClearButtonClicked">
@Strings.ClearFilterLabel
Expand Down
10 changes: 8 additions & 2 deletions GridBlazor/Pages/CheckboxComponent.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

@if (_readonly)
{
<input type='checkbox' checked="@_value" disabled="disabled" readonly="readonly">
<label>
<input type="checkbox" class="@GridComponent.Grid.HtmlClass.FormCheck" checked="@_value" disabled="disabled" readonly="readonly">
<span></span>
</label>
}
else
{
<input type='checkbox' checked="@_value" @onchange="ChangeHandler" @onclick:stopPropagation>
<label>
<input type="checkbox" class="@GridComponent.Grid.HtmlClass.FormCheck" checked="@_value" @onchange="ChangeHandler" @onclick:stopPropagation>
<span></span>
</label>
}
103 changes: 61 additions & 42 deletions GridBlazor/Pages/CollectionFilterComponent.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@

@if (_init && Visible)
{
<div class="dropdown dropdown-menu grid-dropdown opened" style="display:block;position:relative;@("margin-left:" + _offset.ToString() + "px;")" @ref="numberFilter" @onkeyup="FilterKeyup" @onclick:stopPropagation @onkeyup:stopPropagation>
<div class="@GridHeaderComponent.GridComponent.Grid.HtmlClass.DropdownMenu grid-dropdown"
style="display:block;position:relative;overflow:visible;@("margin-left:" + _offset.ToString() + "px;")"
@ref="numberFilter"
@onkeyup="FilterKeyup"
@onclick:stopPropagation
@onkeyup:stopPropagation>
<div class="grid-dropdown-arrow" style="@("margin-left:" + (-_offset).ToString() + "px;")"></div>
<div class="grid-dropdown-inner">
<div class="grid-popup-widget">
Expand All @@ -14,78 +19,92 @@
int j = i;
if (j == 1)
{
<div class="form-group" style="display:flex;justify-content:center;">
<div>
<select class="grid-filter-cond form-control" @bind="_condition">
<option value="1">@Strings.And</option>
<option value="2">@Strings.Or</option>
</select>
<div class="@GridHeaderComponent.GridComponent.Grid.HtmlClass.FormGroupRow" style="display:flex;justify-content:center;">
<div class="@(GridHeaderComponent.GridComponent.Grid.HtmlClass.FormDivInput + " " + GridHeaderComponent.GridComponent.Grid.HtmlClass.ColMd)3">
<div class="@GridHeaderComponent.GridComponent.Grid.HtmlClass.FormDivSelect">
<select class="grid-filter-cond @GridHeaderComponent.GridComponent.Grid.HtmlClass.FormSelect"
@bind="_condition">
<option value="1">@Strings.And</option>
<option value="2">@Strings.Or</option>
</select>
</div>
</div>
</div>
}
else if (j > 1)
{
<div class="form-group" style="display:flex;justify-content:center;">
<div>
<select class="grid-filter-cond form-control" disabled="disabled" value="@_condition">
<option value="1">@Strings.And</option>
<option value="2">@Strings.Or</option>
</select>
<div class="@GridHeaderComponent.GridComponent.Grid.HtmlClass.FormGroupRow" style="display:flex;justify-content:center;">
<div class="@(GridHeaderComponent.GridComponent.Grid.HtmlClass.FormDivInput + " " + GridHeaderComponent.GridComponent.Grid.HtmlClass.ColMd)3">
<div class="@GridHeaderComponent.GridComponent.Grid.HtmlClass.FormDivSelect">
<select class="grid-filter-cond @GridHeaderComponent.GridComponent.Grid.HtmlClass.FormSelect"
disabled="disabled"
value="@_condition">
<option value="1">@Strings.And</option>
<option value="2">@Strings.Or</option>
</select>
</div>
</div>
</div>
}
<div class="form-group row">
<div class="col-md-6 my-2">
<div class="@GridHeaderComponent.GridComponent.Grid.HtmlClass.FormGroupRow">
<div class="@(GridHeaderComponent.GridComponent.Grid.HtmlClass.ColMd)6 @GridHeaderComponent.GridComponent.Grid.HtmlClass.My050">
@if (j == 0)
{
<label class="control-label"><b>@Strings.FilterTypeLabel:</b></label>
<div>
<select @ref="firstSelect" class="grid-filter-type form-control" @bind="_filters[j].Type">
<option value="1">@Strings.Equal</option>
<option value="10">@Strings.NotEqual</option>
<option value="5">@Strings.GreaterThan</option>
<option value="6">@Strings.LessThan</option>
<option value="7">@Strings.GreaterThanOrEquals</option>
<option value="8">@Strings.LessThanOrEquals</option>
</select>
<label class="@GridHeaderComponent.GridComponent.Grid.HtmlClass.FormLabel"><b>@Strings.FilterTypeLabel:</b></label>
<div class="@GridHeaderComponent.GridComponent.Grid.HtmlClass.FormDivInput">
<div class="@GridHeaderComponent.GridComponent.Grid.HtmlClass.FormDivSelect">
<select @ref="firstSelect"
class="grid-filter-type @GridHeaderComponent.GridComponent.Grid.HtmlClass.FormSelect"
@bind="_filters[j].Type">
<option value="1">@Strings.Equal</option>
<option value="10">@Strings.NotEqual</option>
<option value="5">@Strings.GreaterThan</option>
<option value="6">@Strings.LessThan</option>
<option value="7">@Strings.GreaterThanOrEquals</option>
<option value="8">@Strings.LessThanOrEquals</option>
</select>
</div>
</div>
}
else
{
<div>
<select class="grid-filter-type form-control" @bind="_filters[j].Type">
<option value="1">@Strings.Equal</option>
<option value="10">@Strings.NotEqual</option>
<option value="5">@Strings.GreaterThan</option>
<option value="6">@Strings.LessThan</option>
<option value="7">@Strings.GreaterThanOrEquals</option>
<option value="8">@Strings.LessThanOrEquals</option>
</select>
<div class="@GridHeaderComponent.GridComponent.Grid.HtmlClass.FormDivInput">
<div class="@GridHeaderComponent.GridComponent.Grid.HtmlClass.FormDivSelect">
<select class="grid-filter-type @GridHeaderComponent.GridComponent.Grid.HtmlClass.FormSelect"
@bind="_filters[j].Type">
<option value="1">@Strings.Equal</option>
<option value="10">@Strings.NotEqual</option>
<option value="5">@Strings.GreaterThan</option>
<option value="6">@Strings.LessThan</option>
<option value="7">@Strings.GreaterThanOrEquals</option>
<option value="8">@Strings.LessThanOrEquals</option>
</select>
</div>
</div>
}
</div>
<div class="col-md-6 my-2">
<div class="@(GridHeaderComponent.GridComponent.Grid.HtmlClass.ColMd)6 @GridHeaderComponent.GridComponent.Grid.HtmlClass.My050">
@if (j == 0)
{
<label class="control-label"><b>@Strings.FilterValueLabel:</b></label>
<label class="@GridHeaderComponent.GridComponent.Grid.HtmlClass.FormLabel"><b>@Strings.FilterValueLabel:</b></label>
}
<div>
<input type="text" class="grid-filter-input form-control" @bind="_filters[j].Value" />
<div class="@GridHeaderComponent.GridComponent.Grid.HtmlClass.FormDivInput">
<input type="text" class="grid-filter-input @GridHeaderComponent.GridComponent.Grid.HtmlClass.FormInput" @bind="_filters[j].Value" />
</div>
</div>
</div>
}
<div class="grid-buttons">
<div class="grid-filter-buttons">
<button type="button" class="btn btn-primary" @onclick="ApplyButtonClicked">
<button type="button" class="@GridHeaderComponent.GridComponent.Grid.HtmlClass.ButtonPrimary" @onclick="ApplyButtonClicked">
@Strings.ApplyFilterButtonText
</button>
</div>
<div class="grid-filter-buttons">
<button type="button" class="btn btn-primary" @onclick="() => AddColumnFilterValue()"><b>+</b></button>
<button type="button" class="@GridHeaderComponent.GridComponent.Grid.HtmlClass.ButtonPrimary" @onclick="() => AddColumnFilterValue()"><b>+</b></button>
@if (_filters.Length > 1)
{
<button type="button" class="btn btn-primary" @onclick="() => RemoveColumnFilterValue()"><b>-</b></button>
<button type="button" class="@GridHeaderComponent.GridComponent.Grid.HtmlClass.ButtonPrimary" @onclick="() => RemoveColumnFilterValue()"><b>-</b></button>
}
</div>
</div>
Expand All @@ -94,7 +113,7 @@
<div class="grid-popup-additional">
@if (_clearVisible)
{
<ul class="menu-list">
<ul class="grid-menu-list">
<li>
<a class="grid-filter-clear" href="javascript:void(0);" @onclick="ClearButtonClicked">
@Strings.ClearFilterLabel
Expand Down
Loading

0 comments on commit 3d07542

Please sign in to comment.