From 9aab3fe3354c9ac98a172c5026835225eb24b50e Mon Sep 17 00:00:00 2001 From: mckaragoz <78308169+mckaragoz@users.noreply.github.com> Date: Sun, 26 Nov 2023 14:39:50 +0300 Subject: [PATCH] Api Page Refactoring --- .../CodeBeam.MudBlazor.Extensions.csproj | 6 - .../Components/DocsApiTable.razor | 47 ++ .../Pages/Components/ApiPage.razor | 757 ++---------------- 3 files changed, 107 insertions(+), 703 deletions(-) create mode 100644 ComponentViewer.Docs/Components/DocsApiTable.razor diff --git a/CodeBeam.MudBlazor.Extensions/CodeBeam.MudBlazor.Extensions.csproj b/CodeBeam.MudBlazor.Extensions/CodeBeam.MudBlazor.Extensions.csproj index 19ef2833..a9cca004 100644 --- a/CodeBeam.MudBlazor.Extensions/CodeBeam.MudBlazor.Extensions.csproj +++ b/CodeBeam.MudBlazor.Extensions/CodeBeam.MudBlazor.Extensions.csproj @@ -71,12 +71,6 @@ True \ - - diff --git a/ComponentViewer.Docs/Components/DocsApiTable.razor b/ComponentViewer.Docs/Components/DocsApiTable.razor new file mode 100644 index 00000000..e32a431d --- /dev/null +++ b/ComponentViewer.Docs/Components/DocsApiTable.razor @@ -0,0 +1,47 @@ +@namespace ComponentViewer.Docs.Components +@using System.Text.RegularExpressions + +Parameters + x.Name).ToList())"> + + Name + Type + Default + + + @context.Name + @context.PropertyType.Name + + @if (true) + { + object instance = Activator.CreateInstance(RelatedType); + @(context.GetValue(instance)?.ToString() ?? "null") + } + + + + +Methods + x.Name).ToList())"> + + Name + Type + Default + + + @context.Name + @context.ReturnType.Name + + @if (true) + { + @* MudStepper instance = new(); *@ + @*@(context(instance)?.ToString() ?? "null")*@ + } + + + + +@code{ + [Parameter] + public Type RelatedType { get; set; } +} diff --git a/ComponentViewer.Docs/Pages/Components/ApiPage.razor b/ComponentViewer.Docs/Pages/Components/ApiPage.razor index 710ce9dd..353325ab 100644 --- a/ComponentViewer.Docs/Pages/Components/ApiPage.razor +++ b/ComponentViewer.Docs/Pages/Components/ApiPage.razor @@ -2,705 +2,68 @@ @using MudBlazor.Extensions @using System.Text.RegularExpressions @using System.Security.Cryptography.X509Certificates +@using MudExtensions.Utilities - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudAnimate instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudBarcode instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - + + + + + + + @foreach (var component in _components) + { + if (component.Name.Contains(_searchString ?? string.Empty, StringComparison.CurrentCultureIgnoreCase)) + { + + + + } + + } - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudChipField instance = new(); - string val = context.GetValue(instance)?.ToString() ?? "null"; - if (context.Name.Contains("icon", StringComparison.InvariantCultureIgnoreCase)) - { - - } - else - { - @(val.Contains("EventCallback") ? "EventCallback" : val) - } - - - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudCodeInput instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudColorProvider instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudComboBox instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudCsvMapper instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudDateWheelPicker instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudGallery animate = new(); - @(context.GetValue(animate)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudInputStyler animate = new(); - @(context.GetValue(animate)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudListExtended instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudLoading instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudLoadingButton instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudPage instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudRangeSlider instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudSelectExtended instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudSection instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudPasswordField instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudPopup instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudScrollbar instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudSignaturePad instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudSpeedDial instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudSplitter instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - Properties - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudStepper instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - Methods - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.ReturnType.Name - - @if (true) - { - MudStepper instance = new(); - @*@(context(instance)?.ToString() ?? "null")*@ - } - - - - MudStep - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudStep instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudSwitchM3 instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudTeleport instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudTextFieldExtended instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudTransferList instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudTextM3 instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudWheel instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - - - - x.Name).ToList())"> - - Name - Type - Default - - - @context.Name - @context.PropertyType.Name - - @if (true) - { - MudWatch instance = new(); - @(context.GetValue(instance)?.ToString() ?? "null") - } - - - - + +@code { + private string _searchString; + + private Type[] _components = new Type[] + { + typeof(MudAnimate), + typeof(MudBarcode), + typeof(MudChipField), + typeof(MudCodeInput), + typeof(MudColorProvider), + typeof(MudComboBox), + typeof(MudCssManager), + typeof(MudCsvMapper), + typeof(MudDateWheelPicker), + typeof(MudFontPicker), + typeof(MudGallery), + typeof(MudInputStyler), + typeof(MudListExtended), + typeof(MudLoading), + typeof(MudLoadingButton), + typeof(MudPage), + typeof(MudRangeSlider), + typeof(MudSelectExtended), + typeof(MudSection), + typeof(MudPasswordField), + typeof(MudPopup), + typeof(MudScrollbar), + typeof(MudSignaturePad), + typeof(MudSpeedDial), + typeof(MudSplitter), + typeof(MudStepper), + typeof(MudStep), + typeof(MudSwitchM3), + typeof(MudTeleport), + typeof(MudTextFieldExtended), + typeof(MudTransferList), + typeof(MudTextM3), + typeof(MudWheel), + typeof(MudWatch) + }; +}