Skip to content

Commit 65c7eee

Browse files
committed
Demos and Docs updates- draft version
1 parent afc277d commit 65c7eee

25 files changed

Lines changed: 297 additions & 120 deletions

BlazorExpress.ChartJS.Demo.RCL/Extensions/EnumExtensions.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@
55
/// </summary>
66
public static class EnumExtensions
77
{
8+
public static string? ToHeadingCssClass(this HeadingSize headingSize) =>
9+
headingSize switch
10+
{
11+
HeadingSize.H1 => "h1",
12+
HeadingSize.H2 => "h2",
13+
HeadingSize.H3 => "h3",
14+
HeadingSize.H4 => "h4",
15+
HeadingSize.H5 => "h5",
16+
HeadingSize.H6 => "h6",
17+
_ => null
18+
};
19+
820
public static string? ToLanguageCssClass(this LanguageCode languageCode) =>
921
languageCode switch
1022
{

BlazorExpress.ChartJS.Demo.RCL/Shared/Demo.razor

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@using BlazorBootstrap
2-
@using BlazorExpress.ChartJS.Demo.RCL.Extensions
32
@namespace BlazorExpress.ChartJS.Demo.RCL
4-
@inherits ComponentBase
3+
@inherits BlazorBootstrapComponentBase
54

65
@if (ShowCodeOnly)
76
{

BlazorExpress.ChartJS.Demo.RCL/Shared/Demo.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace BlazorExpress.ChartJS.Demo.RCL;
22

3-
public partial class Demo : ComponentBase
3+
public partial class Demo : BlazorBootstrapComponentBase
44
{
55
#region Fields and Constants
66

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@using BlazorBootstrap
2+
@namespace BlazorExpress.ChartJS.Demo.RCL
3+
@inherits BlazorBootstrapComponentBase
4+
5+
<div>
6+
<Button Color="ButtonColor.Primary" Type="ButtonType.Link" Href="@Href">
7+
<span>Demos</span>
8+
<Icon Class="ml-1" Name="IconName.BoxArrowUpRight" />
9+
</Button>
10+
</div>
11+
12+
@code {
13+
[Parameter]
14+
public string? Href { get; set; }
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@using BlazorBootstrap
2+
@namespace BlazorExpress.ChartJS.Demo.RCL
3+
@inherits BlazorBootstrapComponentBase
4+
5+
<div>
6+
<Button Type="ButtonType.Link" Href="@Href">
7+
<span>API Documentation</span>
8+
<Icon Class="ml-1" Name="IconName.BoxArrowUpRight" />
9+
</Button>
10+
</div>
11+
12+
@code {
13+
[Parameter]
14+
public string? Href { get; set; }
15+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@namespace BlazorExpress.ChartJS.Demo.RCL
2+
@inherits ComponentBase
3+
@typeparam TItem
4+
5+
<tr>
6+
<td>@PropertyInfo.Name</td>
7+
<td class="has-text-danger">@ReturnType</td>
8+
<td>@((MarkupString)Description)</td>
9+
<td>@AddedVersion</td>
10+
</tr>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace BlazorExpress.ChartJS.Demo.RCL;
2+
3+
public partial class DocxEventCallbackRow<TItem> : ComponentBase
4+
{
5+
private string AddedVersion => PropertyInfo.GetPropertyAddedVersion();
6+
7+
private string Description => PropertyInfo.GetPropertyDescription();
8+
9+
private string ParameterTypeName => PropertyInfo.GetParameterTypeName();
10+
11+
private string ReturnType => ParameterTypeName ?? PropertyInfo.GetEventCallbackReturnType();
12+
13+
[Parameter]
14+
public PropertyInfo PropertyInfo { get; set; } = default!;
15+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@namespace BlazorExpress.ChartJS.Demo.RCL
2+
@inherits ComponentBase
3+
@typeparam TItem
4+
5+
<tr>
6+
<td>@MethodNameWithParameters</td>
7+
<td class="has-text-danger">@ReturnTypeShortName</td>
8+
<td>@((MarkupString)Description)</td>
9+
<td>@AddedVersion</td>
10+
</tr>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
namespace BlazorExpress.ChartJS.Demo.RCL;
2+
3+
public partial class DocxMethodRow<TItem> : ComponentBase
4+
{
5+
private string AddedVersion => MethodInfo.GetMethodAddedVersion();
6+
7+
private string Description => MethodInfo.GetMethodDescription();
8+
9+
public string ReturnType => MethodInfo.GetMethodReturnType();
10+
11+
public string MethodNameWithParameters => $"{MethodInfo.Name}({MethodParameters})";
12+
13+
public string MethodParameters => MethodInfo.GetMethodParameters();
14+
15+
public string ReturnTypeShortName => ReturnType.Contains(".")
16+
? ReturnType.Split('.').Last()
17+
: ReturnType;
18+
19+
[Parameter]
20+
public MethodInfo MethodInfo { get; set; } = default!;
21+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@namespace BlazorExpress.ChartJS.Demo.RCL
2+
@inherits ComponentBase
3+
@typeparam TItem
4+
5+
<tr>
6+
<td>@PropertyInfo.Name</td>
7+
<td class="has-text-danger">@PropertyTypeShortName</td>
8+
<td>@DefaultValue</td>
9+
<td class="has-text-centered">
10+
@if (IsRequired)
11+
{
12+
<i class="bi bi-check-circle-fill has-text-success"></i>
13+
}
14+
</td>
15+
<td>@((MarkupString)Description)</td>
16+
<td>@AddedVersion</td>
17+
</tr>

0 commit comments

Comments
 (0)