Skip to content

Commit 7ccb9f6

Browse files
authored
Api Page Refactoring (#332)
1 parent 1f5bdbb commit 7ccb9f6

File tree

3 files changed

+107
-703
lines changed

3 files changed

+107
-703
lines changed

CodeBeam.MudBlazor.Extensions/CodeBeam.MudBlazor.Extensions.csproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,6 @@
7171
<Pack>True</Pack>
7272
<PackagePath>\</PackagePath>
7373
</None>
74-
<!--<None Include="wwwroot\MudExtensions.js" />-->
75-
<!--<None Include="Components\ListExtended\MudListExtended.razor" />
76-
<None Include="Components\ListExtended\MudListItemExtended.razor" />
77-
<None Include="Components\ListExtended\MudListSubheaderExtended.razor" />
78-
<None Include="Components\SwitchM3\MudSwitchM3.razor" />
79-
<None Include="wwwroot\MudExtensions.js" />-->
8074
</ItemGroup>
8175

8276
<ItemGroup>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
@namespace ComponentViewer.Docs.Components
2+
@using System.Text.RegularExpressions
3+
4+
<MudText Class="my-2" Color="Color.Secondary" Typo="Typo.h6">Parameters</MudText>
5+
<MudTable Items="@(RelatedType.GetProperties().Where(x => x.Name != "FieldId" && x.Name != "UserAttributes").OrderBy(x => x.Name).ToList())">
6+
<HeaderContent>
7+
<MudTh>Name</MudTh>
8+
<MudTh>Type</MudTh>
9+
<MudTh>Default</MudTh>
10+
</HeaderContent>
11+
<RowTemplate>
12+
<MudTd DataLabel="Name">@context.Name</MudTd>
13+
<MudTd DataLabel="Type">@context.PropertyType.Name</MudTd>
14+
<MudTd DataLabel="Default">
15+
@if (true)
16+
{
17+
object instance = Activator.CreateInstance(RelatedType);
18+
<MudText Typo="Typo.body2">@(context.GetValue(instance)?.ToString() ?? "null")</MudText>
19+
}
20+
</MudTd>
21+
</RowTemplate>
22+
</MudTable>
23+
24+
<MudText Class="my-2" Color="Color.Secondary" Typo="Typo.h6">Methods</MudText>
25+
<MudTable Items="@(RelatedType.GetMethods().Where(x => x.Name != "SetParametersAsync" && Regex.IsMatch(x.Name[0].ToString(), "[A-Z]")).OrderBy(x => x.Name).ToList())">
26+
<HeaderContent>
27+
<MudTh>Name</MudTh>
28+
<MudTh>Type</MudTh>
29+
<MudTh>Default</MudTh>
30+
</HeaderContent>
31+
<RowTemplate>
32+
<MudTd DataLabel="Name">@context.Name</MudTd>
33+
<MudTd DataLabel="Type">@context.ReturnType.Name</MudTd>
34+
<MudTd DataLabel="Default">
35+
@if (true)
36+
{
37+
@* MudStepper instance = new(); *@
38+
@*<MudText Typo="Typo.body2">@(context(instance)?.ToString() ?? "null")</MudText>*@
39+
}
40+
</MudTd>
41+
</RowTemplate>
42+
</MudTable>
43+
44+
@code{
45+
[Parameter]
46+
public Type RelatedType { get; set; }
47+
}

0 commit comments

Comments
 (0)