From 877e8dd5ea3acbf5f6eec56afa7a3bf6a738045b Mon Sep 17 00:00:00 2001 From: mckaragoz <78308169+mckaragoz@users.noreply.github.com> Date: Wed, 23 Apr 2025 01:29:01 +0300 Subject: [PATCH] Fix Input Sizing --- .../Pages/VisualTest.razor | 30 ++++++++++++++++ .../Base/MudBaseInputExtended.cs | 7 ++++ .../MudInputCssHelperExtended.cs | 2 +- .../SelectExtended/MudSelectExtended.razor | 36 ++++++++++--------- .../MudTextFieldExtended.razor | 1 + 5 files changed, 59 insertions(+), 17 deletions(-) create mode 100644 CodeBeam.MudBlazor.Extensions.Docs/Pages/VisualTest.razor diff --git a/CodeBeam.MudBlazor.Extensions.Docs/Pages/VisualTest.razor b/CodeBeam.MudBlazor.Extensions.Docs/Pages/VisualTest.razor new file mode 100644 index 00000000..0de798c0 --- /dev/null +++ b/CodeBeam.MudBlazor.Extensions.Docs/Pages/VisualTest.razor @@ -0,0 +1,30 @@ +@page "/visualtest" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CodeBeam.MudBlazor.Extensions/Base/MudBaseInputExtended.cs b/CodeBeam.MudBlazor.Extensions/Base/MudBaseInputExtended.cs index 75ae60d8..09c87e62 100644 --- a/CodeBeam.MudBlazor.Extensions/Base/MudBaseInputExtended.cs +++ b/CodeBeam.MudBlazor.Extensions/Base/MudBaseInputExtended.cs @@ -59,6 +59,13 @@ protected MudBaseInputExtended() : base(new DefaultConverter()) { } /// [Parameter] public EventCallback OnChange { get; set; } + /// + /// Set the text-align on the component. + /// + [Parameter] + [Category(CategoryTypes.Text.Appearance)] + public Typo Typo { get; set; } = Typo.subtitle1; + /// /// If true, the input will take up the full width of its container. /// diff --git a/CodeBeam.MudBlazor.Extensions/Components/InputExtended/MudInputCssHelperExtended.cs b/CodeBeam.MudBlazor.Extensions/Components/InputExtended/MudInputCssHelperExtended.cs index 8afe1aab..9b2466b9 100644 --- a/CodeBeam.MudBlazor.Extensions/Components/InputExtended/MudInputCssHelperExtended.cs +++ b/CodeBeam.MudBlazor.Extensions/Components/InputExtended/MudInputCssHelperExtended.cs @@ -28,7 +28,7 @@ public static string GetClassname(MudBaseInputExtended baseInput, Func@Placeholder + @Placeholder } @if (ValuePresenter == ValuePresenter.Text) { if (string.IsNullOrEmpty(Text)) { - @Placeholder + @Placeholder } @GetSelectTextPresenter() @@ -42,7 +42,7 @@ { if (SelectedValues == null || !SelectedValues.Any()) { - @Placeholder + @Placeholder } @if (ItemCollection != null) @@ -65,7 +65,7 @@ { if (SelectedListItem == null) { - @Placeholder + @Placeholder } else if (ItemTemplate != null) @@ -76,7 +76,7 @@ } else if (!string.IsNullOrEmpty(Placeholder)) { - @Placeholder + @Placeholder } } else if (SelectedListItem.ChildContent != null) @@ -87,7 +87,7 @@ { @if (string.IsNullOrEmpty(Text)) { - @Placeholder + @Placeholder } @GetSelectTextPresenter() @@ -108,16 +108,20 @@ @StaticContent(this) } - - - @ChildContent - - + @if (ItemCollection != null || ChildContent != null) + { + + + @ChildContent + + + } + @if (StaticContent != null && ShowStaticContentAtEnd) { diff --git a/CodeBeam.MudBlazor.Extensions/Components/TextFieldExtended/MudTextFieldExtended.razor b/CodeBeam.MudBlazor.Extensions/Components/TextFieldExtended/MudTextFieldExtended.razor index 2e22af0d..2e2f5c7f 100644 --- a/CodeBeam.MudBlazor.Extensions/Components/TextFieldExtended/MudTextFieldExtended.razor +++ b/CodeBeam.MudBlazor.Extensions/Components/TextFieldExtended/MudTextFieldExtended.razor @@ -55,6 +55,7 @@ Pattern="@Pattern" AutoSize="AutoSize" ShrinkLabel="@ShrinkLabel" + Typo="@Typo" ShowVisualiser="@(DataVisualiser != null && ShowVisualiser)" DataVisualiserStyle="@(DataVisualiser != null ? "min-height: 1.1876em" : null)">