parent
c791f8930e
commit
42177fc1a0
File diff suppressed because one or more lines are too long
@ -0,0 +1,13 @@
|
|||||||
|
<div class="item"
|
||||||
|
ondragover="event.preventDefault();"
|
||||||
|
draggable="true"
|
||||||
|
@ondragstart="@OnDragStart"
|
||||||
|
@ondrop="@OnDrop"
|
||||||
|
@ondragenter="@OnDragEnter"
|
||||||
|
@ondragleave="@OnDragLeave">
|
||||||
|
|
||||||
|
@if (Item != null)
|
||||||
|
{
|
||||||
|
@Item.DisplayName
|
||||||
|
}
|
||||||
|
</div>
|
@ -0,0 +1,14 @@
|
|||||||
|
@code {
|
||||||
|
[Parameter]
|
||||||
|
public RenderFragment ChildContent { get; set; }
|
||||||
|
|
||||||
|
[CascadingParameter]
|
||||||
|
public MyRootComponent RootComponent { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
<div style="border: 1px solid black; padding: 10px;">
|
||||||
|
<strong>MyFirstChildComponent - @RootComponent.Text</strong>
|
||||||
|
<div>
|
||||||
|
@ChildContent
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,16 @@
|
|||||||
|
@code {
|
||||||
|
[Parameter]
|
||||||
|
public RenderFragment ChildContent { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public string Text { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
<div style="border: 1px solid black; padding: 10px;">
|
||||||
|
<strong>MyRootComponent - @Text</strong>
|
||||||
|
<div>
|
||||||
|
<CascadingValue Value="@this">
|
||||||
|
@ChildContent
|
||||||
|
</CascadingValue>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,14 @@
|
|||||||
|
@code {
|
||||||
|
[Parameter]
|
||||||
|
public RenderFragment ChildContent { get; set; }
|
||||||
|
|
||||||
|
[CascadingParameter]
|
||||||
|
public MyRootComponent RootComponent { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
<div style="border: 1px solid black; padding: 10px;">
|
||||||
|
<strong>MySecondChildComponent - @RootComponent.Text</strong>
|
||||||
|
<div>
|
||||||
|
@ChildContent
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,11 @@
|
|||||||
|
@typeparam TItem
|
||||||
|
|
||||||
|
<div>
|
||||||
|
@if ((Items?.Count ?? 0) != 0)
|
||||||
|
{
|
||||||
|
@foreach (var item in Items)
|
||||||
|
{
|
||||||
|
@ShowTemplate(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</div>
|
@ -0,0 +1,8 @@
|
|||||||
|
<h3>TestRenderFragment</h3>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
[Parameter]
|
||||||
|
public RenderFragment ChildContent { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
@ChildContent
|
@ -0,0 +1,29 @@
|
|||||||
|
@page "/pets1"
|
||||||
|
|
||||||
|
<h1>Pets</h1>
|
||||||
|
|
||||||
|
<TableTemplate Items="pets" Context="pet">
|
||||||
|
<TableHeader>
|
||||||
|
<th>ID</th>
|
||||||
|
<th>Name</th>
|
||||||
|
</TableHeader>
|
||||||
|
<RowTemplate>
|
||||||
|
<td>@pet.PetId</td>
|
||||||
|
<td>@pet.Name</td>
|
||||||
|
</RowTemplate>
|
||||||
|
</TableTemplate>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
private List<Pet> pets = new()
|
||||||
|
{
|
||||||
|
new Pet { PetId = 2, Name = "Mr. Bigglesworth" },
|
||||||
|
new Pet { PetId = 4, Name = "Salem Saberhagen" },
|
||||||
|
new Pet { PetId = 7, Name = "K-9" }
|
||||||
|
};
|
||||||
|
|
||||||
|
private class Pet
|
||||||
|
{
|
||||||
|
public int PetId { get; set; }
|
||||||
|
public string? Name { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
@page "/pets2"
|
||||||
|
|
||||||
|
<h1>Pets</h1>
|
||||||
|
|
||||||
|
<TableTemplate Items="pets">
|
||||||
|
<TableHeader>
|
||||||
|
<th>ID</th>
|
||||||
|
<th>Name</th>
|
||||||
|
</TableHeader>
|
||||||
|
<RowTemplate Context="pet">
|
||||||
|
<td>@pet.PetId</td>
|
||||||
|
<td>@pet.Name</td>
|
||||||
|
</RowTemplate>
|
||||||
|
</TableTemplate>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
private List<Pet> pets = new()
|
||||||
|
{
|
||||||
|
new Pet { PetId = 2, Name = "Mr. Bigglesworth" },
|
||||||
|
new Pet { PetId = 4, Name = "Salem Saberhagen" },
|
||||||
|
new Pet { PetId = 7, Name = "K-9" }
|
||||||
|
};
|
||||||
|
|
||||||
|
private class Pet
|
||||||
|
{
|
||||||
|
public int PetId { get; set; }
|
||||||
|
public string? Name { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
@page "/pets3"
|
||||||
|
|
||||||
|
<h1>Pets</h1>
|
||||||
|
|
||||||
|
<TableTemplate Items="pets">
|
||||||
|
<TableHeader>
|
||||||
|
<th>ID</th>
|
||||||
|
<th>Name</th>
|
||||||
|
</TableHeader>
|
||||||
|
<RowTemplate>
|
||||||
|
<td>@context.PetId</td>
|
||||||
|
<td>@context.Name</td>
|
||||||
|
</RowTemplate>
|
||||||
|
</TableTemplate>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
private List<Pet> pets = new()
|
||||||
|
{
|
||||||
|
new Pet { PetId = 2, Name = "Mr. Bigglesworth" },
|
||||||
|
new Pet { PetId = 4, Name = "Salem Saberhagen" },
|
||||||
|
new Pet { PetId = 7, Name = "K-9" }
|
||||||
|
};
|
||||||
|
|
||||||
|
private class Pet
|
||||||
|
{
|
||||||
|
public int PetId { get; set; }
|
||||||
|
public string? Name { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
@page "/pets4"
|
||||||
|
|
||||||
|
<h1>Pets</h1>
|
||||||
|
|
||||||
|
<TableTemplate Items="pets" TItem="Pet">
|
||||||
|
<TableHeader>
|
||||||
|
<th>ID</th>
|
||||||
|
<th>Name</th>
|
||||||
|
</TableHeader>
|
||||||
|
<RowTemplate>
|
||||||
|
<td>@context.PetId</td>
|
||||||
|
<td>@context.Name</td>
|
||||||
|
</RowTemplate>
|
||||||
|
</TableTemplate>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
private List<Pet> pets = new()
|
||||||
|
{
|
||||||
|
new Pet { PetId = 2, Name = "Mr. Bigglesworth" },
|
||||||
|
new Pet { PetId = 4, Name = "Salem Saberhagen" },
|
||||||
|
new Pet { PetId = 7, Name = "K-9" }
|
||||||
|
};
|
||||||
|
|
||||||
|
private class Pet
|
||||||
|
{
|
||||||
|
public int PetId { get; set; }
|
||||||
|
public string? Name { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
@typeparam TItem
|
||||||
|
@using System.Diagnostics.CodeAnalysis
|
||||||
|
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>@TableHeader</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach (var item in Items)
|
||||||
|
{
|
||||||
|
if (RowTemplate is not null)
|
||||||
|
{
|
||||||
|
<tr>@RowTemplate(item)</tr>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
[Parameter]
|
||||||
|
public RenderFragment? TableHeader { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public RenderFragment<TItem>? RowTemplate { get; set; }
|
||||||
|
|
||||||
|
[Parameter, AllowNull]
|
||||||
|
public IReadOnlyList<TItem> Items { get; set; }
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
4675b14f1ace08800c34c4dca72127f225e725cf
|
08ef396d16c6a4c56c81b8b5e46b63f43850d232
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
.css-grid[b-vyaap35qwa] {
|
||||||
|
grid-template-columns: repeat(4,minmax(0,1fr));
|
||||||
|
gap: 10px;
|
||||||
|
display: grid;
|
||||||
|
width: 286px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.css-recipe[b-vyaap35qwa] {
|
||||||
|
grid-template-columns: repeat(3,minmax(0,1fr));
|
||||||
|
gap: 10px;
|
||||||
|
display: grid;
|
||||||
|
width: 212px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.actions[b-vyaap35qwa] {
|
||||||
|
border: 1px solid black;
|
||||||
|
height: 250px;
|
||||||
|
overflow: scroll;
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
.item[b-madgw7igqh] {
|
||||||
|
width: 64px;
|
||||||
|
height: 64px;
|
||||||
|
border: 1px solid;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 115 KiB |
Loading…
Reference in new issue