Skip to content

Commit

Permalink
Renames BlazorStrap-WASM to BlazorStrap.WASM
Browse files Browse the repository at this point in the history
Renames BlazorStrap-Docs to BlazorStrap.Docs
Starts work on BSDataGrid a QuickGrid like bootstrap formatted DataGrid.
  • Loading branch information
jbomhold3 committed Sep 9, 2024
1 parent 8e024bd commit d544af1
Show file tree
Hide file tree
Showing 1,012 changed files with 1,227 additions and 49 deletions.
4 changes: 2 additions & 2 deletions BlazorStrap.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorStrap", "src\BlazorSt
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorStrap.Server", "src\BlazorStrap.Server\BlazorStrap.Server.csproj", "{4D1CD190-DA57-410E-8B80-99BC55E071E5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorStrap-Docs", "src\BlazorStrap-Docs\BlazorStrap-Docs.csproj", "{FD2823C0-8B9F-4BE6-8973-D2D0DA5946F1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorStrap.Docs", "src\BlazorStrap.Docs\BlazorStrap.Docs.csproj", "{FD2823C0-8B9F-4BE6-8973-D2D0DA5946F1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorStrap.WASM", "src\BlazorStrap-WASM\BlazorStrap.WASM.csproj", "{87EC6C53-E1FC-4E3F-A089-F4D20FF19E70}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorStrap.WASM", "src\BlazorStrap.WASM\BlazorStrap.WASM.csproj", "{87EC6C53-E1FC-4E3F-A089-F4D20FF19E70}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorStrap.Tests", "src\BlazorStrap.Tests\BlazorStrap.Tests.csproj", "{63E96825-F8C9-4505-B2BB-89A4F8A54A36}"
EndProject
Expand Down
2 changes: 0 additions & 2 deletions src/BlazorStrap-Docs/Pages/WIP.razor

This file was deleted.

File renamed without changes.
16 changes: 16 additions & 0 deletions src/BlazorStrap.Docs/AppDbContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using BlazorStrap_Docs.Pages;
using BlazorStrap_Docs.SamplesHelpers.Content.Tables;
using Microsoft.EntityFrameworkCore;

namespace BlazorStrap_Docs;


public class AppDbContext : DbContext
{
public DbSet<Employee> Employees { get; set; }

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseInMemoryDatabase("PeopleDb");
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<WarningLevel>0</WarningLevel>
</PropertyGroup>

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
Expand All @@ -15,46 +18,26 @@

<ItemGroup>
<PackageReference Include="Markdig.SyntaxHighlighting" Version="1.0.0-custom" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.*" />
<PackageReference Include="Markdig" Version="0.26.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.8" />

</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BlazorStrap.V5\BlazorStrap.V5.csproj" />
<ProjectReference Include="..\BlazorStrap.V4\BlazorStrap.V4.csproj" />
<ProjectReference Include="..\BlazorStrap\BlazorStrap.csproj" />
<!-- <ProjectReference Include="..\BlazorStrap\BlazorStrap.csproj" />-->
<ProjectReference Include="..\Extensions\BlazorStrap.Extensions.FluentValidation\BlazorStrap.Extensions.FluentValidation.csproj" />
<ProjectReference Include="..\Extensions\BlazorStrap.Extensions.TreeView\BlazorStrap.Extensions.TreeView.csproj" />
<ProjectReference Include="..\Extensions\BlazorStrap.Extensions.Wizard\BlazorStrap.Extensions.Wizard.csproj" />
</ItemGroup>

<ItemGroup>
<Content Update="Samples\V4\Components\Navbar\Navbar10.razor">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</Content>
<Content Update="Samples\V4\Components\Nav\Nav17.razor">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</Content>
<Content Update="Samples\V5\Components\Nav\Nav17.razor">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</Content>
<Content Update="Shared\MainLayout.razor">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</Content>
</ItemGroup>

<ItemGroup>
<_ContentIncludedByDefault Remove="wwwroot\Static\V5\Test\Modal.md" />
</ItemGroup>


<Target Name="BeforeBuildStep" BeforeTargets="Build">
<ItemGroup>
<ANTLR Include=".\Samples\**\*.*" />
</ItemGroup>
<Copy SourceFiles="@(ANTLR)" DestinationFiles=".\wwwroot\Samples\%(RecursiveDir)%(Filename).md" SkipUnchangedFiles="true" />
</Target>


<!-- <Target Name="BeforeBuildStep" BeforeTargets="Build">-->
<!-- <ItemGroup>-->
<!-- <ANTLR Include=".\Samples\**\*.*" />-->
<!-- </ItemGroup>-->
<!-- <Copy SourceFiles="@(ANTLR)" DestinationFiles=".\wwwroot\Samples\%(RecursiveDir)%(Filename).md" SkipUnchangedFiles="true" />-->
<!-- </Target>-->
<!-- -->

</Project>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
94 changes: 94 additions & 0 deletions src/BlazorStrap.Docs/Pages/WIP.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
@page "/wip"
@layout WipLayout
@using BlazorStrap_Docs.SamplesHelpers.Content.Tables
@using BlazorStrap.Shared.Components.DataGrid.Models
@using BlazorStrap.V5
@using Microsoft.EntityFrameworkCore
@inject AppDbContext _db


@* <div class="container mt-3"> *@
@* <div class="datagrid"> *@
@* <BSDataGrid IsStriped="true" IsSmall="true" Items="_employees"> *@
@* <Columns> *@
@* <TemplateColumn Title="Id" IsSortable="true" SortField="employee => employee.Id"> *@
@* <Header> *@
@* Custom Is Custom *@
@* </Header> *@
@* <Content> *@
@* <strong>@context.Id</strong> *@
@* </Content> *@
@* </TemplateColumn> *@
@* <TemplateColumn Title="Name" IsSortable="true" SortField="employee => employee.Name" > *@
@* <Content>@context.Name</Content> *@
@* </TemplateColumn> *@
@* <TemplateColumn Title="Email"> *@
@* <Content>@context.Email</Content> *@
@* </TemplateColumn> *@
@* <TemplateColumn Title=""> *@
@* <Content> *@
@* <BSButton Color="BSColor.Danger">Delete @context.Id</BSButton> *@
@* </Content> *@
@* *@
@* </TemplateColumn> *@
@* </Columns> *@
@* </BSDataGrid> *@
@* </div> *@
@* </div> *@

<div class="container mt-3">
<div class="datagrid">
<BSDataGrid IsStriped="true" IsSmall="true" Items="_employees" IsMultiSort="true">
<Columns>
<PropertyColumn Property="e => e.Id" IsSortable="true"/>
<PropertyColumn Property="e => e.NameObject.FirstName" IsSortable="true"/>
<PropertyColumn Property="e => e.NameObject.LastName" IsSortable="true"/>
<PropertyColumn Property="e => e.Email" IsSortable="true"/>
</Columns>
</BSDataGrid>
</div>
</div>


<BSButton OnClick="StateHasChanged">State Change</BSButton>

@code {

//This is just a auto fill class for the table for sample data.
private readonly Table2Model _sampleData = new Table2Model();
IQueryable<Employee> _employees;

private Func<SortData<Employee>, SortData<Employee>> _nameSort = data =>
{
data.Ordered = data.Descending ? data.Query.OrderByDescending(q => q.Name) : data.Query.OrderBy(q => q.Name);
return data;
};

protected override void OnInitialized()
{
try
{
_db.Employees.AddRange(_sampleData.DataSet);
_db.SaveChanges();
}
catch
{
}


_employees = _db.Employees;
}

// For EF Core, use DbSet
private static Func<IQueryable<Employee>, Task<int>> CountAsync()
{
return query => query.CountAsync();
}

private static Func<IQueryable<Employee>, Task<Employee[]>> ToArrayAsync()
{
return query => query.ToArrayAsync();
}

}
23 changes: 23 additions & 0 deletions src/BlazorStrap.Docs/Pages/WIP.razor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.datagrid {
/*height: 25rem !important;*/
overflow-y: auto;
}

.datagrid ::deep table {
}

.datagrid ::deep thead {
position: sticky;
top:0;
z-index: 1;
background-color: white;
border-bottom: 1px solid #ccc;
}

.datagrid ::deep tr {
height: 30px;
}

.datagrid ::deep tbody td {

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,12 @@ public class Employee
public string Name { get; set; } = null!;
public string Email { get; set; } = null!;
public BSColor RowColor { get; set; }
public Name NameObject { get; set; } = null!;
}
public class Name
{
public string Id { get; set; } = null!;
public string FirstName { get; set; } = null!;
public string LastName { get; set; } = null!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ public Table2Model()
{
Id = (i + 1000).ToString(),
Name = name,
NameObject = new Name()
{
Id = Guid.NewGuid().ToString(),
FirstName = name.Split(' ')[0],
LastName = name.Split(' ')[1]
},
Email = name.Replace(" ", ".") + "@" + email[rd.Next(0, email.Length - 1)],
RowColor = Table2Model.GetRandomColor()
});
Expand Down
Loading

0 comments on commit d544af1

Please sign in to comment.