initial commit
This commit is contained in:
13
BlazingComponents/BlazingComponents.csproj
Normal file
13
BlazingComponents/BlazingComponents.csproj
Normal file
@@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<RazorLangVersion>3.0</RazorLangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components" Version="$(AspNetCoreVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="$(AspNetCoreVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
13
BlazingComponents/TemplatedDialog.razor
Normal file
13
BlazingComponents/TemplatedDialog.razor
Normal file
@@ -0,0 +1,13 @@
|
||||
@if (Show)
|
||||
{
|
||||
<div class="dialog-container">
|
||||
<div class="dialog">
|
||||
@ChildContent
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@code {
|
||||
[Parameter] public RenderFragment ChildContent { get; set; }
|
||||
[Parameter] public bool Show { get; set; }
|
||||
}
|
||||
36
BlazingComponents/TemplatedList.razor
Normal file
36
BlazingComponents/TemplatedList.razor
Normal file
@@ -0,0 +1,36 @@
|
||||
@typeparam TItem
|
||||
|
||||
@if (items == null)
|
||||
{
|
||||
@Loading
|
||||
}
|
||||
else if (!items.Any())
|
||||
{
|
||||
@Empty
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="list-group @ListGroupClass">
|
||||
@foreach (var item in items)
|
||||
{
|
||||
<div class="list-group-item">
|
||||
@Item(item)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@code {
|
||||
IEnumerable<TItem> items;
|
||||
|
||||
[Parameter] public Func<Task<IEnumerable<TItem>>> Loader { get; set; }
|
||||
[Parameter] public RenderFragment Loading { get; set; }
|
||||
[Parameter] public RenderFragment Empty { get; set; }
|
||||
[Parameter] public RenderFragment<TItem> Item { get; set; }
|
||||
[Parameter] public string ListGroupClass { get; set; }
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
items = await Loader();
|
||||
}
|
||||
}
|
||||
1
BlazingComponents/_Imports.razor
Normal file
1
BlazingComponents/_Imports.razor
Normal file
@@ -0,0 +1 @@
|
||||
@using Microsoft.AspNetCore.Components.Web
|
||||
Reference in New Issue
Block a user