Skip to content

Commit 5dfd102

Browse files
committed
chartjs - docs update - draft
1 parent 3c0f5c8 commit 5dfd102

38 files changed

Lines changed: 839 additions & 663 deletions

BlazorExpress.ChartJS.Demo.RCL/BlazorExpress.ChartJS.Demo.RCL.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Blazor.Bootstrap" Version="3.0.0-preview.1" />
15-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.5" />
14+
<PackageReference Include="BlazorExpress.Bulma" Version="0.1.2" />
15+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.11" />
1616
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
1717
</ItemGroup>
1818

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
@namespace BlazorExpress.ChartJS.Demo.RCL
2+
@inherits MainLayoutBase
3+
4+
<BulmaLayout>
5+
6+
<HeaderSection>
7+
<BulmaNavbar BrandImgSrc="_content/BlazorExpress.Bulma.Demo.RCL/icons/logo.png"
8+
BrandImgAltText="Blazor Express Logo"
9+
ApplicationName="BlazorExpress.Bulma" />
10+
</HeaderSection>
11+
12+
<SidebarSection>
13+
<Menu @ref="menuRef" Class="be-bulma-page-menu" IsScrollable="true">
14+
@foreach (var group in linkGroups)
15+
{
16+
<MenuLabel Class="@group.CssClass">@group.Name</MenuLabel>
17+
if (group.Links?.Any() ?? false)
18+
{
19+
<MenuList>
20+
@foreach (var link in group.Links)
21+
{
22+
<MenuItem>
23+
@if (link.Links?.Any() ?? false) // level 2 links
24+
{
25+
<NavLink ActiveClass="is-active">@link.Text</NavLink>
26+
<MenuList>
27+
@foreach (var cLink in link.Links)
28+
{
29+
<MenuItem>
30+
<NavLink href="@cLink.Href" Match="@cLink.Match" ActiveClass="is-active">@cLink.Text</NavLink>
31+
</MenuItem>
32+
}
33+
</MenuList>
34+
}
35+
else
36+
{
37+
<NavLink href="@link.Href" Match="@link.Match" ActiveClass="is-active">@link.Text</NavLink>
38+
}
39+
</MenuItem>
40+
}
41+
</MenuList>
42+
}
43+
}
44+
</Menu>
45+
</SidebarSection>
46+
47+
<ContentSection>
48+
<div class="p-5">
49+
<Button Class="bi bi-box-arrow-right menu-toggle-button ml-1 mt-0 mb-1" @onclick="ToggleSidebarSection" />
50+
@Body
51+
<Notification Class="has-text-centered" Color="NotificationColor.Link" HideDeleteButton="true">
52+
<a href="//github.com/BlazorExpress/BlazorExpress.Bulma" class="be-bulma-text-decoration-none">
53+
<i class="bi bi-star-fill"></i>
54+
<span>If you like BlazorExpress.Bulma, give it a star on GitHub!</span>
55+
<i class="bi bi-star-fill"></i>
56+
</a>
57+
</Notification>
58+
<MainLayoutBaseFooter Version="@Version"
59+
DotNetVersion="@DotNetVersion"
60+
DocsUrl="@DocsUrl"
61+
BlogUrl="@BlogUrl"
62+
GithubUrl="@GithubUrl"
63+
NugetUrl="@NuGetUrl"
64+
TwitterUrl="@TwitterUrl"
65+
LinkedInUrl="@LinkedInUrl"
66+
OpenCollectiveUrl="@OpenCollectiveUrl"
67+
GithubIssuesUrl="@GithubIssuesUrl"
68+
GithubDiscussionsUrl="@GithubDiscussionsUrl"
69+
StackoverflowUrl="@StackoverflowUrl" />
70+
</div>
71+
</ContentSection>
72+
73+
<FooterSection>
74+
<div class="container is-max-desktop mb-4">
75+
</div>
76+
</FooterSection>
77+
</BulmaLayout>
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
namespace BlazorExpress.ChartJS.Demo.RCL;
2+
3+
public partial class DemosMainLayout : MainLayoutBase
4+
{
5+
#region Fields and Constants
6+
7+
private bool isSidebarVisible = false;
8+
private HashSet<LinkGroup> linkGroups = new();
9+
private Menu menuRef = default!;
10+
11+
#endregion
12+
13+
#region Methods
14+
15+
protected override async Task OnAfterRenderAsync(bool firstRender)
16+
{
17+
if (firstRender)
18+
await JS.InvokeVoidAsync("initializeTheme");
19+
20+
await base.OnAfterRenderAsync(firstRender);
21+
}
22+
23+
protected override void OnInitialized()
24+
{
25+
if (!linkGroups.Any())
26+
linkGroups = GetLinkGroups();
27+
28+
base.OnInitialized();
29+
}
30+
31+
private HashSet<LinkGroup> GetLinkGroups()
32+
{
33+
var groups = new HashSet<LinkGroup>();
34+
35+
// GETTING STARTED
36+
groups.Add(new LinkGroup
37+
{
38+
Name = "GETTING STARTED",
39+
CssClass = "is-size-7 has-text-weight-bold has-text-danger",
40+
Links = [
41+
new Link { Href = RouteConstants.Demos_Getting_Started_Introduction, Text = "Introduction" },
42+
]
43+
});
44+
45+
// FEATURES
46+
groups.Add(new LinkGroup
47+
{
48+
Name = "FEATURES",
49+
CssClass = "is-size-7 has-text-weight-bold has-text-warning",
50+
Links = [
51+
new Link { Href = RouteConstants.Demos_Skeletons_Documentation, Text = "Skeletons" }
52+
]
53+
});
54+
55+
// ICONS
56+
groups.Add(new LinkGroup
57+
{
58+
Name = "ICONS",
59+
CssClass = "is-size-7 has-text-weight-bold has-text-info",
60+
Links = [
61+
new Link { Href = RouteConstants.Demos_BootstrapIcons_Documentation, Text = "Bootstrap Icons" },
62+
new Link { Href = RouteConstants.Demos_GoogleFontIcons_Documentation, Text = "Google Font Icons" }
63+
]
64+
});
65+
66+
// ELEMENTS
67+
groups.Add(new LinkGroup
68+
{
69+
Name = "ELEMENTS",
70+
CssClass = "is-size-7 has-text-weight-bold has-text-primary",
71+
Links = [
72+
new Link { Href = RouteConstants.Demos_Block_Documentation, Text = "Block" },
73+
new Link { Href = RouteConstants.Demos_Box_Documentation, Text = "Box" },
74+
new Link { Href = RouteConstants.Demos_Button_Documentation, Text = "Button" },
75+
new Link { Href = RouteConstants.Demos_DeleteButton_Documentation, Text = "Delete Button" },
76+
new Link { Href = RouteConstants.Demos_Image_Documentation, Text = "Image" },
77+
new Link { Href = RouteConstants.Demos_Notification_Documentation, Text = "Notification" },
78+
new Link { Href = RouteConstants.Demos_ProgressBar_Documentation, Text = "Progress Bar" },
79+
new Link { Href = RouteConstants.Demos_Tags_Documentation, Text = "Tags" },
80+
]
81+
});
82+
83+
// FORM
84+
groups.Add(new LinkGroup
85+
{
86+
Name = "FORM",
87+
CssClass = "is-size-7 has-text-weight-bold has-text-primary",
88+
Links = [
89+
new Link { Href = RouteConstants.Demos_Form_DateInput_Documentation , Text = "Date Input" },
90+
new Link { Href = RouteConstants.Demos_Form_EnumInput_Documentation , Text = "Enum Input" },
91+
new Link { Href = RouteConstants.Demos_Form_OTPInput_Documentation , Text = "OTP Input" },
92+
new Link { Href = RouteConstants.Demos_Form_TextInput_Documentation , Text = "Text Input" },
93+
]
94+
});
95+
96+
// COMPONENTS
97+
groups.Add(new LinkGroup
98+
{
99+
Name = "COMPONENTS",
100+
CssClass = "is-size-7 has-text-weight-bold has-text-dark",
101+
Links = [
102+
new Link { Href = RouteConstants.Demos_Breadcrumb_Documentation, Text = "Breadcrumb" },
103+
new Link { Href = RouteConstants.Demos_ConfirmDialog_Documentation, Text = "Confirm Dialog" },
104+
new Link { Href = RouteConstants.Demos_GoogleMaps_Documentation, Text = "Google Maps" },
105+
new Link { Href = RouteConstants.Demos_Grid_Documentation, Text = "Grid" },
106+
new Link { Href = RouteConstants.Demos_Message_Documentation, Text = "Message" },
107+
new Link { Href = RouteConstants.Demos_Modal_Documentation, Text = "Modal" },
108+
new Link { Href = RouteConstants.Demos_Pagination_Documentation, Text = "Pagination" },
109+
new Link { Href = RouteConstants.Demos_ScriptLoader_Documentation, Text = "Script Loader" },
110+
new Link { Href = RouteConstants.Demos_Tabs_Documentation, Text = "Tabs" }
111+
]
112+
});
113+
114+
// LAYOUT
115+
groups.Add(new LinkGroup
116+
{
117+
Name = "LAYOUT",
118+
CssClass = "is-size-7 has-text-weight-bold has-text-success",
119+
Links = [
120+
new Link { Href = RouteConstants.Demos_Hero_Documentation, Text = "Hero" }
121+
]
122+
});
123+
124+
return groups;
125+
}
126+
127+
private Task SetAutoTheme() => SetTheme("system");
128+
129+
private Task SetDarkTheme() => SetTheme("dark");
130+
131+
private Task SetLightTheme() => SetTheme("light");
132+
133+
private async Task SetTheme(string themeName) => await JS.InvokeVoidAsync("setTheme", themeName);
134+
135+
private void ToggleSidebarSection()
136+
{
137+
@menuRef.Toggle();
138+
}
139+
140+
#endregion
141+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
@namespace BlazorExpress.ChartJS.Demo.RCL
2+
@inherits MainLayoutBase
3+
4+
<BulmaLayout>
5+
6+
<HeaderSection>
7+
<BulmaNavbar BrandImgSrc="_content/BlazorExpress.Bulma.Demo.RCL/icons/logo.png"
8+
BrandImgAltText="Blazor Express Logo"
9+
ApplicationName="BlazorExpress.Bulma" />
10+
</HeaderSection>
11+
12+
<SidebarSection>
13+
<Menu @ref="menuRef" Class="be-bulma-page-menu" IsScrollable="true">
14+
@foreach (var group in linkGroups)
15+
{
16+
<MenuLabel Class="@group.CssClass">@group.Name</MenuLabel>
17+
if (group.Links?.Any() ?? false)
18+
{
19+
<MenuList>
20+
@foreach (var link in group.Links)
21+
{
22+
<MenuItem>
23+
@if (link.Links?.Any() ?? false) // level 2 links
24+
{
25+
<NavLink ActiveClass="is-active">@link.Text</NavLink>
26+
<MenuList>
27+
@foreach (var cLink in link.Links)
28+
{
29+
<MenuItem>
30+
<NavLink href="@cLink.Href" Match="@cLink.Match" ActiveClass="is-active">@cLink.Text</NavLink>
31+
</MenuItem>
32+
}
33+
</MenuList>
34+
}
35+
else
36+
{
37+
<NavLink href="@link.Href" Match="@link.Match" ActiveClass="is-active">@link.Text</NavLink>
38+
}
39+
</MenuItem>
40+
}
41+
</MenuList>
42+
}
43+
}
44+
</Menu>
45+
</SidebarSection>
46+
47+
<ContentSection>
48+
<div class="p-5">
49+
<Button Class="bi bi-box-arrow-right menu-toggle-button ml-1 mt-0 mb-1" @onclick="ToggleSidebarSection" />
50+
@Body
51+
<Notification Class="has-text-centered mt-3" Color="NotificationColor.Link" HideDeleteButton="true">
52+
<a href="//github.com/BlazorExpress/BlazorExpress.Bulma" class="be-bulma-text-decoration-none">
53+
<i class="bi bi-star-fill"></i>
54+
<span>If you like BlazorExpress.Bulma, give it a star on GitHub!</span>
55+
<i class="bi bi-star-fill"></i>
56+
</a>
57+
</Notification>
58+
<MainLayoutBaseFooter Version="@Version"
59+
DotNetVersion="@DotNetVersion"
60+
DocsUrl="@DocsUrl"
61+
BlogUrl="@BlogUrl"
62+
GithubUrl="@GithubUrl"
63+
NugetUrl="@NuGetUrl"
64+
TwitterUrl="@TwitterUrl"
65+
LinkedInUrl="@LinkedInUrl"
66+
OpenCollectiveUrl="@OpenCollectiveUrl"
67+
GithubIssuesUrl="@GithubIssuesUrl"
68+
GithubDiscussionsUrl="@GithubDiscussionsUrl"
69+
StackoverflowUrl="@StackoverflowUrl" />
70+
</div>
71+
</ContentSection>
72+
73+
<FooterSection>
74+
<div class="container is-max-desktop mb-4">
75+
</div>
76+
</FooterSection>
77+
</BulmaLayout>

0 commit comments

Comments
 (0)