Skip to content

Commit

Permalink
Api Page Refactoring (CodeBeamOrg#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
mckaragoz authored Nov 26, 2023
1 parent 1f5bdbb commit 7ccb9f6
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 703 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,6 @@
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<!--<None Include="wwwroot\MudExtensions.js" />-->
<!--<None Include="Components\ListExtended\MudListExtended.razor" />
<None Include="Components\ListExtended\MudListItemExtended.razor" />
<None Include="Components\ListExtended\MudListSubheaderExtended.razor" />
<None Include="Components\SwitchM3\MudSwitchM3.razor" />
<None Include="wwwroot\MudExtensions.js" />-->
</ItemGroup>

<ItemGroup>
Expand Down
47 changes: 47 additions & 0 deletions ComponentViewer.Docs/Components/DocsApiTable.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@namespace ComponentViewer.Docs.Components
@using System.Text.RegularExpressions

<MudText Class="my-2" Color="Color.Secondary" Typo="Typo.h6">Parameters</MudText>
<MudTable Items="@(RelatedType.GetProperties().Where(x => x.Name != "FieldId" && x.Name != "UserAttributes").OrderBy(x => x.Name).ToList())">
<HeaderContent>
<MudTh>Name</MudTh>
<MudTh>Type</MudTh>
<MudTh>Default</MudTh>
</HeaderContent>
<RowTemplate>
<MudTd DataLabel="Name">@context.Name</MudTd>
<MudTd DataLabel="Type">@context.PropertyType.Name</MudTd>
<MudTd DataLabel="Default">
@if (true)
{
object instance = Activator.CreateInstance(RelatedType);
<MudText Typo="Typo.body2">@(context.GetValue(instance)?.ToString() ?? "null")</MudText>
}
</MudTd>
</RowTemplate>
</MudTable>

<MudText Class="my-2" Color="Color.Secondary" Typo="Typo.h6">Methods</MudText>
<MudTable Items="@(RelatedType.GetMethods().Where(x => x.Name != "SetParametersAsync" && Regex.IsMatch(x.Name[0].ToString(), "[A-Z]")).OrderBy(x => x.Name).ToList())">
<HeaderContent>
<MudTh>Name</MudTh>
<MudTh>Type</MudTh>
<MudTh>Default</MudTh>
</HeaderContent>
<RowTemplate>
<MudTd DataLabel="Name">@context.Name</MudTd>
<MudTd DataLabel="Type">@context.ReturnType.Name</MudTd>
<MudTd DataLabel="Default">
@if (true)
{
@* MudStepper instance = new(); *@
@*<MudText Typo="Typo.body2">@(context(instance)?.ToString() ?? "null")</MudText>*@
}
</MudTd>
</RowTemplate>
</MudTable>

@code{
[Parameter]
public Type RelatedType { get; set; }
}
Loading

0 comments on commit 7ccb9f6

Please sign in to comment.