GridRowContent - fixed Collapsable
This commit is contained in:
parent
402e904b10
commit
f770bd26bc
@ -22,4 +22,9 @@
|
|||||||
<Watch Remove="..\..\src\**\bin\**" />
|
<Watch Remove="..\..\src\**\bin\**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Watch Remove="Program.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -4,9 +4,20 @@
|
|||||||
|
|
||||||
<h1 style="text-align:center;">Component Sandbox</h1>
|
<h1 style="text-align:center;">Component Sandbox</h1>
|
||||||
|
|
||||||
<DatePicker @bind-SelectedDate=date>
|
<Grid>
|
||||||
|
@for (int i = 0; i < 5; i++)
|
||||||
</DatePicker>
|
{
|
||||||
|
int num = i;
|
||||||
|
<GridRow>
|
||||||
|
<GridRowContent>
|
||||||
|
Fixed content @num.ToString()
|
||||||
|
</GridRowContent>
|
||||||
|
<GridRowContent Collapsable=true>
|
||||||
|
Collapsable content @num.ToString()
|
||||||
|
</GridRowContent>
|
||||||
|
</GridRow>
|
||||||
|
}
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<p>Izbran datum je: @date</p>
|
<p>Izbran datum je: @date</p>
|
||||||
|
|
||||||
|
@ -26,15 +26,22 @@ public partial class GridRowContent : ComponentBase
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return new CssBuilder("row")
|
CssBuilder cssBuilder = new CssBuilder("row");
|
||||||
.AddClass("collapsed", Collapsable)
|
|
||||||
.AddClass("show", (Collapsable ? Parent?.CollapsedItemShown : false))
|
cssBuilder.AddClass("collapsed", Collapsable);
|
||||||
.Build();
|
|
||||||
|
if (Parent is not null)
|
||||||
|
{
|
||||||
|
cssBuilder.AddClass("show", (Collapsable ? Parent.CollapsedItemShown : false));
|
||||||
|
}
|
||||||
|
|
||||||
|
return cssBuilder.Build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (Parent is not null)
|
if (Parent is not null)
|
||||||
{
|
{
|
||||||
if (Parent.Children is null) Parent.Children = new();
|
if (Parent.Children is null) Parent.Children = new();
|
||||||
|
23
src/Connected.Components/Enums/ThemeProvider.cs
Normal file
23
src/Connected.Components/Enums/ThemeProvider.cs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
|
namespace Connected;
|
||||||
|
|
||||||
|
public enum Theme
|
||||||
|
{
|
||||||
|
[Description("")]
|
||||||
|
Default,
|
||||||
|
|
||||||
|
[Description("dark")]
|
||||||
|
Dark,
|
||||||
|
|
||||||
|
[Description("light")]
|
||||||
|
Light,
|
||||||
|
|
||||||
|
[Description("pink")]
|
||||||
|
Pink
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ThemeProvider
|
||||||
|
{
|
||||||
|
public static Theme theme { get; set; } = Theme.Default;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user