[WIP]: Transfer commit

features/nuget_autobuild
Matija Koželj 2 years ago
parent c33820a8a7
commit d042b55ac6

@ -7,7 +7,7 @@
<Grid> <Grid>
<Item md="4" xs="12"> <Item md="4" xs="12">
<Alert Severity="Severity.Normal" ClassList="my-2 justify-end dense">Default Square</Alert> <Alert Severity="Severity.Normal" ClassList="my-2 justify-end dense" CloseGlyphVisible="true">Default Square</Alert>
<Alert Severity="Severity.Info" ClassList="my-2">Info Square</Alert> <Alert Severity="Severity.Info" ClassList="my-2">Info Square</Alert>
<Alert Severity="Severity.Success" ClassList="my-2">Success Square</Alert> <Alert Severity="Severity.Success" ClassList="my-2">Success Square</Alert>
<Alert Severity="Severity.Warning" ClassList="my-2">Warning Square</Alert> <Alert Severity="Severity.Warning" ClassList="my-2">Warning Square</Alert>

@ -23,7 +23,7 @@
@if (CloseGlyphVisible) @if (CloseGlyphVisible)
{ {
<div class="alert-close"> <div class="alert-close">
<ToggleIconButton Glyph="@CloseGlyph" @onclick="OnCloseGlyphClick" Size="Size.Small" /> <GlyphButton ClassList="size-small" Glyph="@CloseGlyph" Clicked="OnCloseGlyphClick" />
</div> </div>
} }
</div> </div>

@ -4,8 +4,7 @@ using Microsoft.AspNetCore.Components.Web;
namespace Connected.Components; namespace Connected.Components;
public partial class Alert : UIComponent public partial class Alert : UIComponent{
{
/// <summary> /// <summary>
/// Contains the default container classlist and the user defined classes. /// Contains the default container classlist and the user defined classes.
/// </summary> /// </summary>

@ -2,7 +2,7 @@
@inherits UIComponent @inherits UIComponent
<header @attributes="CustomAttributes" class="@CompiledHeaderClassList"> <header @attributes="CustomAttributes" class="@CompiledHeaderClassList">
<ToolBar Dense="@Dense" DisableGutters="@DisableGutters" Class="@CompiledToolbarClassList"> <ToolBar Class="@CompiledToolbarClassList">
@ChildContent @ChildContent
</ToolBar> </ToolBar>
</header> </header>

@ -27,11 +27,8 @@ public partial class AppBar : UIComponent
get get
{ {
return new CssBuilder("app-bar") return new CssBuilder("app-bar")
.AddClass($"appbar-dense", Dense)
.AddClass($"appbar-fixed-top", Fixed && VerticalAlignment == VerticalAlignment.Top) .AddClass($"appbar-fixed-top", Fixed && VerticalAlignment == VerticalAlignment.Top)
.AddClass($"appbar-fixed-bottom", Fixed && VerticalAlignment == VerticalAlignment.Bottom) .AddClass($"appbar-fixed-bottom", Fixed && VerticalAlignment == VerticalAlignment.Bottom)
.AddClass($"elevation-{Elevation}")
.AddClass($"theme-{Color}", Color != ThemeColor.Default)
.AddClass(HeaderClassList); .AddClass(HeaderClassList);
} }
} }
@ -42,30 +39,6 @@ public partial class AppBar : UIComponent
[Parameter] [Parameter]
public RenderFragment? ChildContent { get; set; } public RenderFragment? ChildContent { get; set; }
/// <summary>
/// The color of the component. It supports the theme colors.
/// </summary>
[Parameter]
public ThemeColor Color { get; set; } = ThemeColor.Default;
/// <summary>
/// If true, compact padding will be used.
/// </summary>
[Parameter]
public bool Dense { get; set; }
/// <summary>
/// If true, the left and right padding is removed from from the appbar.
/// </summary>
[Parameter]
public bool DisableGutters { get; set; }
/// <summary>
/// The higher the number, the heavier the drop-shadow. 0 for no shadow.
/// </summary>
[Parameter]
public int Elevation { set; get; } = 4;
/// <summary> /// <summary>
/// If true, appbar will be fixed. /// If true, appbar will be fixed.
/// </summary> /// </summary>

@ -55,12 +55,12 @@ public partial class Autocomplete<T> : InputBase<T>, IDisposable
[Parameter] [Parameter]
public bool Dense { get; set; } public bool Dense { get; set; }
/// <summary> /// <summary>
/// The Open Autocomplete Icon /// The Open Autocomplete Glyph
/// </summary> /// </summary>
[Parameter] [Parameter]
public string OpenIcon { get; set; } = Icons.Material.Filled.ArrowDropDown; public string OpenIcon { get; set; } = Icons.Material.Filled.ArrowDropDown;
/// <summary> /// <summary>
/// The Close Autocomplete Icon /// The Close Autocomplete Glyph
/// </summary> /// </summary>
[Parameter] [Parameter]
public string CloseIcon { get; set; } = Icons.Material.Filled.ArrowDropUp; public string CloseIcon { get; set; } = Icons.Material.Filled.ArrowDropUp;

@ -17,7 +17,7 @@ partial class AvatarGroup : UIComponent
{ {
return new CssBuilder("avatar-group") return new CssBuilder("avatar-group")
.AddClass($"avatar-group-outlined", Outlined) .AddClass($"avatar-group-outlined", Outlined)
.AddClass($"avatar-group-outlined-{OutlineColor.ToDescriptionString()}", Outlined) .AddClass($"avatar-group-outlined-{OutlineColor.ToDescription()}", Outlined)
.AddClass(ClassList); .AddClass(ClassList);
} }
} }

@ -15,7 +15,7 @@ public partial class Badge : UIComponent
.Build(); .Build();
protected string WrapperClass => protected string WrapperClass =>
new CssBuilder("badge-wrapper") new CssBuilder("badge-wrapper")
.AddClass($"badge-{Origin.ToDescriptionString().Replace("-", " ")}") .AddClass($"badge-{Origin.ToDescription().Replace("-", " ")}")
.Build(); .Build();
protected string BadgeClassName => protected string BadgeClassName =>
@ -23,9 +23,9 @@ public partial class Badge : UIComponent
.AddClass("badge-dot", Dot) .AddClass("badge-dot", Dot)
.AddClass("badge-bordered", Bordered) .AddClass("badge-bordered", Bordered)
.AddClass("badge-icon", !string.IsNullOrEmpty(Icon) && !Dot) .AddClass("badge-icon", !string.IsNullOrEmpty(Icon) && !Dot)
.AddClass($"badge-{Origin.ToDescriptionString().Replace("-", " ")}") .AddClass($"badge-{Origin.ToDescription().Replace("-", " ")}")
.AddClass($"elevation-{Elevation.ToString()}") .AddClass($"elevation-{Elevation.ToString()}")
.AddClass("theme-" + Color.ToDescriptionString(), Color != ThemeColor.Default) .AddClass("theme-" + Color.ToDescription(), Color != ThemeColor.Default)
.AddClass("badge-default", Color == ThemeColor.Default) .AddClass("badge-default", Color == ThemeColor.Default)
.AddClass("badge-overlap", Overlap) .AddClass("badge-overlap", Overlap)
.AddClass(BadgeClass) .AddClass(BadgeClass)
@ -102,7 +102,7 @@ public partial class Badge : UIComponent
public bool Bordered { get; set; } public bool Bordered { get; set; }
/// <summary> /// <summary>
/// Sets the Icon to use in the badge. /// Sets the Glyph to use in the badge.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Badge.Behavior)] [Category(CategoryTypes.Badge.Behavior)]

@ -1,15 +1,17 @@
@namespace Connected.Components @namespace Connected.Components
@using Connected.Extensions; @using Connected.Extensions;
@inherits ButtonBase @inherits ButtonBase
<Element @bind-Ref="@_elementReference" <Element type="@ButtonType.ToDescription()"
disabled="@Disabled"
HtmlTag="@HtmlTag" HtmlTag="@HtmlTag"
Class="@CompiledClassList" ClassList="@CompiledClassList.ToString()"
PreventOnClickPropagation="PreventOnClickPropagation"
@attributes="CustomAttributes" @attributes="CustomAttributes"
@onclick="OnClickHandler" @onclick="OnClick">
type="@ButtonType.ToDescriptionString()" <span name="button-content" class="button-content">
disabled="@Disabled">
<span class="button-label">
@ChildContent @ChildContent
</span> </span>
</Element> </Element>

@ -1,6 +1,4 @@
using Connected.Annotations; using Connected.Utilities;
using Connected.Extensions;
using Connected.Utilities;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
namespace Connected.Components; namespace Connected.Components;
@ -8,46 +6,36 @@ namespace Connected.Components;
public partial class Button : ButtonBase public partial class Button : ButtonBase
{ {
/// <summary> /// <summary>
/// Child content of component. /// Contains the default container classlist and the user defined classes.
/// </summary> /// </summary>
[Parameter]
public RenderFragment? ChildContent { get; set; }
private CssBuilder CompiledClassList private CssBuilder CompiledClassList
{ {
get get
{ {
return new CssBuilder("button-root mud-button") return new CssBuilder("button-root mud-button")
.AddClass($"button-{Variant}") .AddClass($"button-{Variant}")
.AddClass($"button-{Variant}-{Color}")
.AddClass($"button-{Variant}-size-{Size}")
.AddClass($"ripple", !CanRipple)
.AddClass($"elevation-{Elevation}")
.AddClass(ClassList); .AddClass(ClassList);
} }
} }
#region Styling properties
/// <summary> /// <summary>
/// A space separated list of class names, added on top of the default class list. /// Child content of component.
/// </summary>
[Parameter]
public string? ClassList { get; set; }
/// <summary>
/// The color of the component. It supports the theme colors.
/// </summary> /// </summary>
[Parameter] [Parameter]
public ThemeColor Color { get; set; } = ThemeColor.Default; public RenderFragment? ChildContent { get; set; }
/// <summary> /// <summary>
/// The Size of the component. /// A space separated list of class names, added on top of the default class list.
/// </summary> /// </summary>
[Parameter] [Parameter]
public Size Size { get; set; } = Size.Medium; public string? ClassList { get; set; }
/// <summary> /// <summary>
/// The variant to use. /// The variant to use.
/// </summary> /// </summary>
[Parameter] [Parameter]
public Variant Variant { get; set; } = Variant.Text; public Variant Variant { get; set; } = Variant.Text;
#endregion
} }

@ -54,10 +54,16 @@ public abstract class ButtonBase : UIComponent
/// <summary> /// <summary>
/// The HTML element that will be rendered in the root by the component /// The HTML element that will be rendered in the root by the component
/// By default, is a button /// By default, is a button.
/// </summary> /// </summary>
protected string HtmlTag => ButtonType.ToString().ToLower(); protected string HtmlTag => ButtonType.ToString().ToLower();
/// <summary>
/// Indicates whether the internal click propagation should be disabled,
/// as it is handled in the component itself.
/// </summary>
protected bool PreventOnClickPropagation => string.Compare(HtmlTag, "button", true) == 0;
protected async Task OnClick(MouseEventArgs e) protected async Task OnClick(MouseEventArgs e)
{ {
if (Disabled) if (Disabled)

@ -4,12 +4,11 @@
@using Connected.Extensions; @using Connected.Extensions;
<Element @bind-Ref="@_elementReference" <Element HtmlTag="@HtmlTag"
HtmlTag="@HtmlTag"
Class="@Classname" Class="@Classname"
@attributes="CustomAttributes" @attributes="CustomAttributes"
@onclick="OnClickHandler" @onclick="OnClick"
type="@ButtonType.ToDescriptionString()" type="@ButtonType.ToDescription()"
disabled="@Disabled" disabled="@Disabled"
title="@Title"> title="@Title">
<span class="fab-label"> <span class="fab-label">

@ -10,9 +10,8 @@ public partial class Fab : ButtonBase
protected string Classname => protected string Classname =>
new CssBuilder("button-root mud-fab") new CssBuilder("button-root mud-fab")
.AddClass($"fab-extended", !string.IsNullOrEmpty(Label)) .AddClass($"fab-extended", !string.IsNullOrEmpty(Label))
.AddClass($"fab-{Color.ToDescriptionString()}") .AddClass($"fab-{Color.ToDescription()}")
.AddClass($"fab-size-{Size.ToDescriptionString()}") .AddClass($"fab-size-{Size.ToDescription()}")
.AddClass($"ripple", !CanRipple && !Disabled)
.Build(); .Build();
/// <summary> /// <summary>
@ -30,19 +29,19 @@ public partial class Fab : ButtonBase
public Size Size { get; set; } = Size.Large; public Size Size { get; set; } = Size.Large;
/// <summary> /// <summary>
/// If applied Icon will be added at the start of the component. /// If applied Glyph will be added at the start of the component.
/// </summary> /// </summary>
[Obsolete("This property is obsolete. Use StartIcon instead.")][Parameter] public string Icon { get => StartIcon; set => StartIcon = value; } [Obsolete("This property is obsolete. Use StartIcon instead.")][Parameter] public string Icon { get => StartIcon; set => StartIcon = value; }
/// <summary> /// <summary>
/// If applied Icon will be added at the start of the component. /// If applied Glyph will be added at the start of the component.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Button.Behavior)] [Category(CategoryTypes.Button.Behavior)]
public string StartIcon { get; set; } public string StartIcon { get; set; }
/// <summary> /// <summary>
/// If applied Icon will be added at the end of the component. /// If applied Glyph will be added at the end of the component.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Button.Behavior)] [Category(CategoryTypes.Button.Behavior)]
@ -70,7 +69,7 @@ public partial class Fab : ButtonBase
public string Label { get; set; } public string Label { get; set; }
/// <summary> /// <summary>
/// Title of the icon used for accessibility. /// GlyphTitle of the icon used for accessibility.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Button.Behavior)] [Category(CategoryTypes.Button.Behavior)]

@ -0,0 +1,27 @@
@namespace Connected.Components
@inherits ButtonBase
@using Connected.Extensions;
<Element disabled="@Disabled"
title="@GlyphTitle"
type="@ButtonType.ToDescription()"
ClassList="@CompiledClassList.ToString()"
HtmlTag="@HtmlTag"
PreventOnClickPropagation="PreventOnClickPropagation"
@attributes="CustomAttributes"
@onclick="OnClick">
@if (!String.IsNullOrEmpty(Glyph))
{
<span name="glyph-container" class="glyph-button-label">
<Icon Glyph="@Glyph" />
</span>
}
else
{
<TextContent Typo="Typo.body2">
@ChildContent
</TextContent>
}
</Element>

@ -0,0 +1,56 @@
using Connected.Utilities;
using Microsoft.AspNetCore.Components;
namespace Connected.Components;
public partial class GlyphButton : ButtonBase
{
/// <summary>
/// Contains the default container classlist and the user defined classes.
/// </summary>
private CssBuilder CompiledClassList
{
get
{
return new CssBuilder("button-root glyph-button")
.AddClass(ClassList);
}
}
/// <summary>
/// Child content of component, only shows if Glyph is null or Empty.
/// </summary>
[Parameter]
public RenderFragment? ChildContent { get; set; }
#region EventCallbacks
#endregion
#region Content placeholders
/// <summary>
/// The Glyph that will be used in the component.
/// </summary>
[Parameter]
public string? Glyph { get; set; }
/// <summary>
/// GlyphTitle of the icon used for accessibility.
/// </summary>
[Parameter]
public string? GlyphTitle { get; set; }
#endregion
#region Styling properties
/// <summary>
/// A space separated list of class names, added on top of the default class list.
/// </summary>
[Parameter]
public string? ClassList { get; set; }
/// <summary>
/// The variant to use.
/// </summary>
[Parameter]
public Variant Variant { get; set; } = Variant.Text;
#endregion
}

@ -1,25 +0,0 @@
@namespace Connected.Components
@inherits ButtonBase
@using Connected.Extensions;
<Element @bind-Ref="@_elementReference"
HtmlTag="@HtmlTag"
Class="@Classname"
@attributes="CustomAttributes"
@onclick="OnClickHandler"
type="@ButtonType.ToDescriptionString()"
disabled="@Disabled"
title="@Title">
@if (!String.IsNullOrEmpty(Icon))
{
<span class="icon-button-label">
<Icon Glyph="@Icon" Size="@Size" />
</span>
}
else
{
<TextContent Typo="Typo.body2" Color="ThemeColor.Inherit">@ChildContent</TextContent>
}
</Element>

@ -1,75 +0,0 @@
using Connected.Annotations;
using Connected.Extensions;
using Connected.Utilities;
using Microsoft.AspNetCore.Components;
namespace Connected.Components;
public partial class IconButton : ButtonBase
{
protected string Classname =>
new CssBuilder("button-root mud-icon-button")
.AddClass("button", when: AsButton)
.AddClass($"{Color.ToDescriptionString()}-text hover:mud-{Color.ToDescriptionString()}-hover", !AsButton && Color != ThemeColor.Default)
.AddClass($"button-{Variant.ToDescriptionString()}", AsButton)
.AddClass($"button-{Variant.ToDescriptionString()}-{Color.ToDescriptionString()}", AsButton)
.AddClass($"button-{Variant.ToDescriptionString()}-size-{Size.ToDescriptionString()}", AsButton)
.AddClass($"ripple", !CanRipple)
.AddClass($"ripple-icon", !CanRipple && !AsButton)
.AddClass($"icon-button-size-{Size.ToDescriptionString()}", when: () => Size != Size.Medium)
.AddClass($"icon-button-edge-{Edge.ToDescriptionString()}", when: () => Edge != Edge.False)
.AddClass(AdditionalClassList)
.Build();
protected bool AsButton => Variant != Variant.Text;
/// <summary>
/// The Icon that will be used in the component.
/// </summary>
[Parameter]
[Category(CategoryTypes.Button.Behavior)]
public string Icon { get; set; }
/// <summary>
/// Title of the icon used for accessibility.
/// </summary>
[Parameter]
[Category(CategoryTypes.Button.Behavior)]
public string Title { get; set; }
/// <summary>
/// The color of the component. It supports the theme colors.
/// </summary>
[Parameter]
[Category(CategoryTypes.Button.Appearance)]
public ThemeColor Color { get; set; } = ThemeColor.Default;
/// <summary>
/// The Size of the component.
/// </summary>
[Parameter]
[Category(CategoryTypes.Button.Appearance)]
public Size Size { get; set; } = Size.Medium;
/// <summary>
/// If set uses a negative margin.
/// </summary>
[Parameter]
[Category(CategoryTypes.Button.Appearance)]
public Edge Edge { get; set; }
/// <summary>
/// Child content of component, only shows if Icon is null or Empty.
/// </summary>
[Parameter]
[Category(CategoryTypes.Button.Behavior)]
public RenderFragment ChildContent { get; set; }
/// <summary>
/// The variant to use.
/// </summary>
[Parameter]
[Category(CategoryTypes.Button.Appearance)]
public Variant Variant { get; set; } = Variant.Text;
}

@ -0,0 +1,13 @@
@namespace Connected.Components
@inherits UIComponent
<GlyphButton aria-pressed="@Toggled.ToString()"
ClassList="@ClassList"
Clicked="Toggle"
Disabled="Disabled"
Glyph="@(Toggled ? ToggledGlyph : Glyph)"
GlyphTitle="@(Toggled && ToggledGlyphTitle != null ? ToggledGlyphTitle : GlyphTitle)"
Variant="Variant"
@attributes="CustomAttributes"
/>

@ -0,0 +1,89 @@
using Microsoft.AspNetCore.Components;
namespace Connected.Components;
public partial class ToggleGlyphButton : UIComponent
{
#region EventCallbacks
/// <summary>
/// Fires whenever toggled is changed.
/// </summary>
[Parameter]
public EventCallback<bool> ToggledChanged { get; set; }
#endregion
#region Content placeholders
/// <summary>
/// The glyph that will be used in the untoggled state.
/// </summary>
[Parameter]
public string? Glyph { get; set; }
/// <summary>
/// GlyphTitle of the icon used for accessibility.
/// </summary>
[Parameter]
public string? GlyphTitle { get; set; }
/// <summary>
/// The glyph that will be used in the toggled state.
/// </summary>
[Parameter]
public string? ToggledGlyph { get; set; }
/// <summary>
/// GlyphTitle used in toggled state, if different.
/// </summary>
[Parameter]
public string? ToggledGlyphTitle { get; set; }
#endregion
#region Styling properties
/// <summary>
/// A space separated list of class names, added on top of the default class list.
/// </summary>
[Parameter]
public string? ClassList { get; set; }
/// <summary>
/// The variant to use.
/// </summary>
[Parameter]
public Variant Variant { get; set; } = Variant.Text;
#endregion
#region Behavior properties
/// <summary>
/// If true, the button will be disabled.
/// </summary>
[Parameter]
public bool Disabled { get; set; }
/// <summary>
/// The button toggled state.
/// </summary>
[Parameter]
public bool Toggled { get; set; }
#endregion
public async Task Toggle()
{
await SetToggledAsync(!Toggled);
}
protected internal async Task SetToggledAsync(bool toggled)
{
if (Disabled)
return;
if (Toggled != toggled)
{
Toggled = toggled;
if (!ToggledChanged.HasDelegate)
return;
await ToggledChanged.InvokeAsync(Toggled);
}
}
}

@ -1,20 +0,0 @@
@namespace Connected.Components
@inherits UIComponent
@{
var ariaPressedValue = @Toggled ? "true" : "false";
}
<IconButton Icon="@(Toggled ? ToggledIcon : Icon)"
Size="(Toggled ? ToggledSize : Size)"
Color="(Toggled ? ToggledColor : Color)"
Title="@(Toggled && ToggledTitle != null ? ToggledTitle : Title)"
Variant="Variant"
Disabled="Disabled"
Edge="Edge"
DisableRipple="DisableRipple"
OnClick="Toggle"
Class="@AdditionalClassList"
aria-pressed="@ariaPressedValue"
@attributes="CustomAttributes" />

@ -1,119 +0,0 @@
using Connected.Annotations;
using Microsoft.AspNetCore.Components;
namespace Connected.Components;
public partial class ToggleIconButton : UIComponent
{
/// <summary>
/// The toggled value.
/// </summary>
[Parameter]
[Category(CategoryTypes.Button.Behavior)]
public bool Toggled { get; set; }
/// <summary>
/// Fires whenever toggled is changed.
/// </summary>
[Parameter] public EventCallback<bool> ToggledChanged { get; set; }
/// <summary>
/// The Icon that will be used in the untoggled state.
/// </summary>
[Parameter]
[Category(CategoryTypes.Button.Behavior)]
public string Icon { get; set; }
/// <summary>
/// The Icon that will be used in the toggled state.
/// </summary>
[Parameter]
[Category(CategoryTypes.Button.Behavior)]
public string ToggledIcon { get; set; }
/// <summary>
/// Title of the icon used for accessibility.
/// </summary>
[Parameter]
[Category(CategoryTypes.Button.Behavior)]
public string Title { get; set; }
/// <summary>
/// Title used in toggled state, if different.
/// </summary>
[Parameter]
[Category(CategoryTypes.Button.Behavior)]
public string ToggledTitle { get; set; }
/// <summary>
/// The color of the icon in the untoggled state. It supports the theme colors.
/// </summary>
[Parameter]
[Category(CategoryTypes.Button.Appearance)]
public ThemeColor Color { get; set; } = ThemeColor.Default;
/// <summary>
/// The color of the icon in the toggled state. It supports the theme colors.
/// </summary>
[Parameter]
[Category(CategoryTypes.Button.Appearance)]
public ThemeColor ToggledColor { get; set; } = ThemeColor.Default;
/// <summary>
/// The Size of the component in the untoggled state.
/// </summary>
[Parameter]
[Category(CategoryTypes.Button.Appearance)]
public Size Size { get; set; } = Size.Medium;
/// <summary>
/// The Size of the component in the toggled state.
/// </summary>
[Parameter]
[Category(CategoryTypes.Button.Appearance)]
public Size ToggledSize { get; set; } = Size.Medium;
/// <summary>
/// If set uses a negative margin.
/// </summary>
[Parameter]
[Category(CategoryTypes.Button.Appearance)]
public Edge Edge { get; set; }
/// <summary>
/// If true, disables ripple effect.
/// </summary>
[Parameter]
[Category(CategoryTypes.Button.Appearance)]
public bool DisableRipple { get; set; }
/// <summary>
/// If true, the button will be disabled.
/// </summary>
[Parameter]
[Category(CategoryTypes.Button.Behavior)]
public bool Disabled { get; set; }
/// <summary>
/// The variant to use.
/// </summary>
[Parameter]
[Category(CategoryTypes.Button.Appearance)]
public Variant Variant { get; set; } = Variant.Text;
public Task Toggle()
{
return SetToggledAsync(!Toggled);
}
protected internal async Task SetToggledAsync(bool toggled)
{
if (Disabled)
return;
if (Toggled != toggled)
{
Toggled = toggled;
await ToggledChanged.InvokeAsync(Toggled);
}
}
}

@ -10,9 +10,9 @@ public partial class ButtonGroup : UIComponent
protected string Classname => protected string Classname =>
new CssBuilder("button-group-root") new CssBuilder("button-group-root")
.AddClass($"button-group-override-styles", OverrideStyles) .AddClass($"button-group-override-styles", OverrideStyles)
.AddClass($"button-group-{Variant.ToDescriptionString()}") .AddClass($"button-group-{Variant.ToDescription()}")
.AddClass($"button-group-{Variant.ToDescriptionString()}-{Color.ToDescriptionString()}") .AddClass($"button-group-{Variant.ToDescription()}-{Color.ToDescription()}")
.AddClass($"button-group-{Variant.ToDescriptionString()}-size-{Size.ToDescriptionString()}") .AddClass($"button-group-{Variant.ToDescription()}-size-{Size.ToDescription()}")
.AddClass($"button-group-vertical", VerticalAlign) .AddClass($"button-group-vertical", VerticalAlign)
.AddClass($"button-group-horizontal", !VerticalAlign) .AddClass($"button-group-horizontal", !VerticalAlign)
.AddClass($"button-group-disable-elevation", DisableElevation) .AddClass($"button-group-disable-elevation", DisableElevation)

@ -16,7 +16,7 @@ public partial class CardMedia : UIComponent
.Build(); .Build();
/// <summary> /// <summary>
/// Title of the image used for accessibility. /// GlyphTitle of the image used for accessibility.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Card.Behavior)] [Category(CategoryTypes.Card.Behavior)]

@ -42,7 +42,7 @@
} }
@*Bullets*@ @*Bullets*@
<div class="@($"flex-grow-1 align-self-{ConvertPosition(BulletsPosition).ToDescriptionString()}")" style="z-index:3"> <div class="@($"flex-grow-1 align-self-{ConvertPosition(BulletsPosition).ToDescription()}")" style="z-index:3">
@if (ShowBullets) @if (ShowBullets)
{ {
<div class="d-flex justify-center"> <div class="d-flex justify-center">

@ -10,13 +10,13 @@ public partial class Carousel<TData> : BindableItemsControlBase<CarouselItem, TD
{ {
protected string Classname => protected string Classname =>
new CssBuilder("carousel") new CssBuilder("carousel")
.AddClass($"carousel-{(BulletsColor ?? _currentColor).ToDescriptionString()}") .AddClass($"carousel-{(BulletsColor ?? _currentColor).ToDescription()}")
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)
.Build(); .Build();
protected string NavigationButtonsClassName => protected string NavigationButtonsClassName =>
new CssBuilder() new CssBuilder()
.AddClass($"align-self-{ConvertPosition(ArrowsPosition).ToDescriptionString()}", !(NavigationButtonsClass ?? "").Contains("align-self-")) .AddClass($"align-self-{ConvertPosition(ArrowsPosition).ToDescription()}", !(NavigationButtonsClass ?? "").Contains("align-self-"))
.AddClass("carousel-elements-rtl", RightToLeft) .AddClass("carousel-elements-rtl", RightToLeft)
.AddClass(NavigationButtonsClass) .AddClass(NavigationButtonsClass)
.Build(); .Build();

@ -9,7 +9,7 @@ public partial class CarouselItem : UIComponent, IDisposable
{ {
protected string Classname => protected string Classname =>
new CssBuilder("carousel-item") new CssBuilder("carousel-item")
.AddClass($"carousel-item-{Color.ToDescriptionString()}") .AddClass($"carousel-item-{Color.ToDescription()}")
.AddClass("carousel-item-exit", !_disposed && Parent.LastContainer == this) .AddClass("carousel-item-exit", !_disposed && Parent.LastContainer == this)
.AddClass("carousel-transition-fade-in", !_disposed && Transition == Transition.Fade && Parent.SelectedContainer == this) .AddClass("carousel-transition-fade-in", !_disposed && Transition == Transition.Fade && Parent.SelectedContainer == this)

@ -37,7 +37,7 @@ public partial class Chart : UIComponent
protected string Classname => protected string Classname =>
new CssBuilder("chart") new CssBuilder("chart")
.AddClass($"chart-legend-{ConvertLegendPosition(LegendPosition).ToDescriptionString()}") .AddClass($"chart-legend-{ConvertLegendPosition(LegendPosition).ToDescription()}")
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)
.Build(); .Build();

@ -23,8 +23,8 @@ public partial class CheckBox<T> : BooleanInput<T>
protected string CheckBoxClassname => protected string CheckBoxClassname =>
new CssBuilder("button-root mud-icon-button") new CssBuilder("button-root mud-icon-button")
.AddClass($"{Color.ToDescriptionString()}-text hover:mud-{Color.ToDescriptionString()}-hover", UnCheckedColor == null || (UnCheckedColor != null && BoolValue == true)) .AddClass($"{Color.ToDescription()}-text hover:mud-{Color.ToDescription()}-hover", UnCheckedColor == null || (UnCheckedColor != null && BoolValue == true))
.AddClass($"{UnCheckedColor?.ToDescriptionString()}-text hover:mud-{UnCheckedColor?.ToDescriptionString()}-hover", UnCheckedColor != null && BoolValue == false) .AddClass($"{UnCheckedColor?.ToDescription()}-text hover:mud-{UnCheckedColor?.ToDescription()}-hover", UnCheckedColor != null && BoolValue == false)
.AddClass($"checkbox-dense", Dense) .AddClass($"checkbox-dense", Dense)
.AddClass($"ripple mud-ripple-checkbox", !DisableRipple && !ReadOnly && !Disabled) .AddClass($"ripple mud-ripple-checkbox", !DisableRipple && !ReadOnly && !Disabled)
.AddClass($"disabled", Disabled) .AddClass($"disabled", Disabled)

@ -17,9 +17,9 @@ public partial class Chip : UIComponent, IDisposable
protected string Classname => protected string Classname =>
new CssBuilder("chip") new CssBuilder("chip")
.AddClass($"chip-{GetVariant().ToDescriptionString()}") .AddClass($"chip-{GetVariant().ToDescription()}")
.AddClass($"chip-size-{Size.ToDescriptionString()}") .AddClass($"chip-size-{Size.ToDescription()}")
.AddClass($"chip-color-{GetColor().ToDescriptionString()}") .AddClass($"chip-color-{GetColor().ToDescription()}")
.AddClass("clickable", !ChipSet?.ReadOnly ?? OnClick.HasDelegate) .AddClass("clickable", !ChipSet?.ReadOnly ?? OnClick.HasDelegate)
.AddClass("ripple", !ChipSet?.ReadOnly ?? OnClick.HasDelegate && !DisableRipple) .AddClass("ripple", !ChipSet?.ReadOnly ?? OnClick.HasDelegate && !DisableRipple)
.AddClass("chip-label", Label) .AddClass("chip-label", Label)
@ -88,7 +88,7 @@ public partial class Chip : UIComponent, IDisposable
public ThemeColor SelectedColor { get; set; } = ThemeColor.Inherit; public ThemeColor SelectedColor { get; set; } = ThemeColor.Inherit;
/// <summary> /// <summary>
/// Avatar Icon, Overrides the regular Icon if set. /// Avatar Glyph, Overrides the regular Glyph if set.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Chip.Behavior)] [Category(CategoryTypes.Chip.Behavior)]
@ -116,7 +116,7 @@ public partial class Chip : UIComponent, IDisposable
public bool Disabled { get; set; } public bool Disabled { get; set; }
/// <summary> /// <summary>
/// Sets the Icon to use. /// Sets the Glyph to use.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Chip.Behavior)] [Category(CategoryTypes.Chip.Behavior)]

@ -9,7 +9,7 @@ public partial class Container : UIComponent
protected string Classname => protected string Classname =>
new CssBuilder("container") new CssBuilder("container")
.AddClass($"container-fixed", Fixed) .AddClass($"container-fixed", Fixed)
.AddClass($"container-maxwidth-{MaxWidth.ToDescriptionString()}", !Fixed) .AddClass($"container-maxwidth-{MaxWidth.ToDescription()}", !Fixed)
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)
.Build(); .Build();

@ -60,7 +60,7 @@
@Filter(f, null) @Filter(f, null)
} }
</Grid> </Grid>
<Button Class="mt-2" StartIcon="@Icons.Material.Filled.Add" OnClick="@AddFilter" Color="@ThemeColor.Primary">Add Filter</Button> <Button Class="mt-2" StartIcon="@Icons.Material.Filled.Add" Clicked="@AddFilter" Color="@ThemeColor.Primary">Add Filter</Button>
@if (ServerData != null) @if (ServerData != null)
{ {
<Button Class="mt-2" StartIcon="@Icons.Material.Filled.Add" OnClick="@ApplyFilters" Color="@ThemeColor.Primary">Apply</Button> <Button Class="mt-2" StartIcon="@Icons.Material.Filled.Add" OnClick="@ApplyFilters" Color="@ThemeColor.Primary">Apply</Button>
@ -273,8 +273,8 @@
</Form> </Form>
</DialogContent> </DialogContent>
<DialogActions> <DialogActions>
<Button Variant="Variant.Filled" Color="ThemeColor.Default" OnClick="@CancelEditingItemAsync" Class="px-10">Cancel</Button> <Button Variant="Variant.Filled" Color="ThemeColor.Default" Clicked="@CancelEditingItemAsync" Class="px-10">Cancel</Button>
<Button Variant="Variant.Filled" Color="ThemeColor.Primary" OnClick="@CommitItemChangesAsync" Class="px-10">Save</Button> <Button Variant="Variant.Filled" Color="ThemeColor.Primary" Clicked="@CommitItemChangesAsync" Class="px-10">Save</Button>
</DialogActions> </DialogActions>
</Dialog> </Dialog>
</CascadingValue> </CascadingValue>

@ -58,7 +58,7 @@
} }
} }
</Menu> </Menu>
<IconButton Class="align-self-center" Icon="@Icons.Material.Filled.FilterAltOff" Size="@Size.Small" OnClick="@ClearFilter"></IconButton> <GlyphButton Class="align-self-center" Icon="@Icons.Material.Filled.FilterAltOff" Size="@Size.Small" Clicked="@ClearFilter"></GlyphButton>
</Stack> </Stack>
} }
} }

@ -113,8 +113,8 @@ else if (Column != null && !Column.Hidden)
@DataGrid.Filter(Column.filterContext.FilterDefinition, Column) @DataGrid.Filter(Column.filterContext.FilterDefinition, Column)
</Item> </Item>
<Item xs="12" Class="d-flex justify-end"> <Item xs="12" Class="d-flex justify-end">
<Button Class="clear-filter-button" OnClick="@ClearFilter">Clear</Button> <Button Class="clear-filter-button" Clicked="@ClearFilter">Clear</Button>
<Button Class="apply-filter-button" Color="@ThemeColor.Primary" OnClick="@ApplyFilter">Filter</Button> <Button Class="apply-filter-button" Color="@ThemeColor.Primary" Clicked="@ApplyFilter">Filter</Button>
</Item> </Item>
</Grid> </Grid>
} }

@ -68,9 +68,9 @@ public class DatePicker : DatePickerBase
if (day < GetMonthStart(month) || day > GetMonthEnd(month)) if (day < GetMonthStart(month) || day > GetMonthEnd(month))
return b.AddClass("hidden").Build(); return b.AddClass("hidden").Build();
if ((Date?.Date == day && _selectedDate == null) || _selectedDate?.Date == day) if ((Date?.Date == day && _selectedDate == null) || _selectedDate?.Date == day)
return b.AddClass("selected").AddClass($"theme-{Color.ToDescriptionString()}").Build(); return b.AddClass("selected").AddClass($"theme-{Color.ToDescription()}").Build();
if (day == DateTime.Today) if (day == DateTime.Today)
return b.AddClass("current mud-button-outlined").AddClass($"button-outlined-{Color.ToDescriptionString()} mud-{Color.ToDescriptionString()}-text").Build(); return b.AddClass("current mud-button-outlined").AddClass($"button-outlined-{Color.ToDescription()} mud-{Color.ToDescription()}-text").Build();
return b.Build(); return b.Build();
} }

@ -497,7 +497,7 @@ public abstract partial class DatePickerBase : Picker<DateTime?>
private string GetYearClasses(int year) private string GetYearClasses(int year)
{ {
if (year == GetMonthStart(0).Year) if (year == GetMonthStart(0).Year)
return $"picker-year-selected mud-{Color.ToDescriptionString()}-text"; return $"picker-year-selected mud-{Color.ToDescription()}-text";
return null; return null;
} }
@ -546,7 +546,7 @@ public abstract partial class DatePickerBase : Picker<DateTime?>
private string GetMonthClasses(DateTime month) private string GetMonthClasses(DateTime month)
{ {
if (GetMonthStart(0) == month) if (GetMonthStart(0) == month)
return $"picker-month-selected mud-{Color.ToDescriptionString()}-text"; return $"picker-month-selected mud-{Color.ToDescription()}-text";
return null; return null;
} }

@ -190,7 +190,7 @@ public partial class DateRangePicker : DatePickerBase
.AddClass("range") .AddClass("range")
.AddClass("range-start-selected") .AddClass("range-start-selected")
.AddClass("range-selection", _firstDate != null) .AddClass("range-selection", _firstDate != null)
.AddClass($"theme-{Color.ToDescriptionString()}") .AddClass($"theme-{Color.ToDescription()}")
.Build(); .Build();
} }
@ -200,19 +200,19 @@ public partial class DateRangePicker : DatePickerBase
return b.AddClass("selected") return b.AddClass("selected")
.AddClass("range") .AddClass("range")
.AddClass("range-end-selected") .AddClass("range-end-selected")
.AddClass($"theme-{Color.ToDescriptionString()}") .AddClass($"theme-{Color.ToDescription()}")
.Build(); .Build();
} }
if (_firstDate == null && _dateRange != null && _dateRange.Start == _dateRange.End && _dateRange.Start == day) if (_firstDate == null && _dateRange != null && _dateRange.Start == _dateRange.End && _dateRange.Start == day)
{ {
return b.AddClass("selected").AddClass($"theme-{Color.ToDescriptionString()}").Build(); return b.AddClass("selected").AddClass($"theme-{Color.ToDescription()}").Build();
} }
else if (_firstDate != null && day > _firstDate) else if (_firstDate != null && day > _firstDate)
{ {
return b.AddClass("range") return b.AddClass("range")
.AddClass("range-selection", _secondDate == null) .AddClass("range-selection", _secondDate == null)
.AddClass($"range-selection-{Color.ToDescriptionString()}", _firstDate != null) .AddClass($"range-selection-{Color.ToDescription()}", _firstDate != null)
.Build(); .Build();
} }
@ -221,8 +221,8 @@ public partial class DateRangePicker : DatePickerBase
return b.AddClass("current") return b.AddClass("current")
.AddClass("range", _firstDate != null && day > _firstDate) .AddClass("range", _firstDate != null && day > _firstDate)
.AddClass("range-selection", _firstDate != null && day > _firstDate) .AddClass("range-selection", _firstDate != null && day > _firstDate)
.AddClass($"range-selection-{Color.ToDescriptionString()}", _firstDate != null && day > _firstDate) .AddClass($"range-selection-{Color.ToDescription()}", _firstDate != null && day > _firstDate)
.AddClass($"{Color.ToDescriptionString()}-text") .AddClass($"{Color.ToDescription()}-text")
.Build(); .Build();
} }

@ -24,7 +24,7 @@ public partial class Dialog : UIComponent
[Inject] public IDialogService DialogService { get; set; } [Inject] public IDialogService DialogService { get; set; }
/// <summary> /// <summary>
/// Define the dialog title as a renderfragment (overrides Title) /// Define the dialog title as a renderfragment (overrides GlyphTitle)
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Dialog.Behavior)] [Category(CategoryTypes.Dialog.Behavior)]
@ -109,7 +109,7 @@ public partial class Dialog : UIComponent
/// <summary> /// <summary>
/// Define the dialog title as a renderfragment (overrides Title) /// Define the dialog title as a renderfragment (overrides GlyphTitle)
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Dialog.Behavior)] [Category(CategoryTypes.Dialog.Behavior)]

@ -191,7 +191,7 @@ public partial class DialogInstance : UIComponent, IDisposable
{ {
position = DialogPosition.Center; position = DialogPosition.Center;
} }
return $"dialog-{position.ToDescriptionString()}"; return $"dialog-{position.ToDescription()}";
} }
private string SetMaxWidth() private string SetMaxWidth()
@ -210,7 +210,7 @@ public partial class DialogInstance : UIComponent, IDisposable
{ {
maxWidth = MaxWidth.Small; maxWidth = MaxWidth.Small;
} }
return $"dialog-width-{maxWidth.ToDescriptionString()}"; return $"dialog-width-{maxWidth.ToDescription()}";
} }
private bool SetFullWidth() private bool SetFullWidth()

@ -12,7 +12,7 @@ public partial class Divider : UIComponent
.AddClass($"divider-flexitem", FlexItem) .AddClass($"divider-flexitem", FlexItem)
.AddClass($"divider-light", Light) .AddClass($"divider-light", Light)
.AddClass($"divider-vertical", Vertical) .AddClass($"divider-vertical", Vertical)
.AddClass($"divider-{DividerType.ToDescriptionString()}", when: () => DividerType != DividerType.FullWidth) .AddClass($"divider-{DividerType.ToDescription()}", when: () => DividerType != DividerType.FullWidth)
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)
.Build(); .Build();

@ -28,11 +28,11 @@ public partial class Drawer : UIComponent, IDisposable, INavigationEventReceiver
.AddClass($"drawer--open", Open) .AddClass($"drawer--open", Open)
.AddClass($"drawer--closed", !Open) .AddClass($"drawer--closed", !Open)
.AddClass($"drawer--initial", _initial) .AddClass($"drawer--initial", _initial)
.AddClass($"drawer-{Breakpoint.ToDescriptionString()}") .AddClass($"drawer-{Breakpoint.ToDescription()}")
.AddClass($"drawer-clipped-{_clipMode.ToDescriptionString()}") .AddClass($"drawer-clipped-{_clipMode.ToDescription()}")
.AddClass($"theme-{Color.ToDescriptionString()}", Color != ThemeColor.Default) .AddClass($"theme-{Color.ToDescription()}", Color != ThemeColor.Default)
.AddClass($"elevation-{Elevation}") .AddClass($"elevation-{Elevation}")
.AddClass($"drawer-{Variant.ToDescriptionString()}") .AddClass($"drawer-{Variant.ToDescription()}")
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)
.Build(); .Build();
@ -40,8 +40,8 @@ public partial class Drawer : UIComponent, IDisposable, INavigationEventReceiver
new CssBuilder("drawer-overlay mud-overlay-drawer") new CssBuilder("drawer-overlay mud-overlay-drawer")
.AddClass($"drawer-pos-{GetPosition()}") .AddClass($"drawer-pos-{GetPosition()}")
.AddClass($"drawer-overlay--open", Open) .AddClass($"drawer-overlay--open", Open)
.AddClass($"drawer-overlay-{Variant.ToDescriptionString()}") .AddClass($"drawer-overlay-{Variant.ToDescription()}")
.AddClass($"drawer-overlay-{Breakpoint.ToDescriptionString()}") .AddClass($"drawer-overlay-{Breakpoint.ToDescription()}")
.AddClass($"drawer-overlay--initial", _initial) .AddClass($"drawer-overlay--initial", _initial)
.Build(); .Build();
@ -385,7 +385,7 @@ public partial class Drawer : UIComponent, IDisposable, INavigationEventReceiver
default: break; default: break;
} }
return Anchor.ToDescriptionString(); return Anchor.ToDescription();
} }

@ -53,14 +53,14 @@ public partial class DrawerContainer : UIComponent
if (drawer == null) if (drawer == null)
return string.Empty; return string.Empty;
var className = $"drawer-{(drawer.Open ? "open" : "close")}-{drawer.Variant.ToDescriptionString()}"; var className = $"drawer-{(drawer.Open ? "open" : "close")}-{drawer.Variant.ToDescription()}";
if (drawer.Variant is DrawerVariant.Responsive or DrawerVariant.Mini) if (drawer.Variant is DrawerVariant.Responsive or DrawerVariant.Mini)
{ {
className += $"-{drawer.Breakpoint.ToDescriptionString()}"; className += $"-{drawer.Breakpoint.ToDescription()}";
} }
className += $"-{drawer.GetPosition()}"; className += $"-{drawer.GetPosition()}";
className += $" mud-drawer-{drawer.GetPosition()}-clipped-{drawer.ClipMode.ToDescriptionString()}"; className += $" mud-drawer-{drawer.GetPosition()}-clipped-{drawer.ClipMode.ToDescription()}";
return className; return className;
} }

@ -1,5 +1,4 @@
using Connected.Annotations; using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Rendering; using Microsoft.AspNetCore.Components.Rendering;
using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.Web;
@ -15,56 +14,80 @@ public class Element : UIComponent
/// Child content /// Child content
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Element.Misc)] public RenderFragment? ChildContent { get; set; }
public RenderFragment ChildContent { get; set; }
#region EventCallbacks
[Parameter]
public EventCallback<ElementReference> RefChanged { get; set; }
#endregion
#region Content placeholders
/// <summary> /// <summary>
/// The HTML element that will be rendered in the root by the component /// The Ref to bind to.
/// Usage: @bind-Ref="myRef"
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Element.Misc)] public ElementReference? Ref { get; set; }
public string HtmlTag { get; set; } = "span"; #endregion
#region Styling properties
/// <summary> /// <summary>
/// The ElementReference to bind to. /// A space separated list of class names, added on top of the default class list.
/// Use like @bind-Ref="myRef"
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Element.Misc)] public string? ClassList { get; set; }
public ElementReference? Ref { get; set; } #endregion
#region Behavior properties
/// <summary>
/// The HTML element that will be rendered in the root by the component
/// </summary>
[Parameter]
public string HtmlTag { get; set; } = "span";
[Parameter] public EventCallback<ElementReference> RefChanged { get; set; } [Parameter]
public bool PreventOnClickPropagation { get; set; }
#endregion
/// <summary> /// <summary>
/// Calling StateHasChanged to refresh the component's state /// Schedules a component's state refresh
/// </summary> /// </summary>
public void Refresh() => StateHasChanged(); public void Refresh() => StateHasChanged();
protected override void BuildRenderTree(RenderTreeBuilder builder) protected override void BuildRenderTree(RenderTreeBuilder builder)
{ {
base.BuildRenderTree(builder); base.BuildRenderTree(builder);
//Open
builder.OpenElement(0, HtmlTag); builder.OpenElement(0, HtmlTag);
//splatted attributes /*
* Handle splatted attributes
*/
foreach (var attribute in CustomAttributes) foreach (var attribute in CustomAttributes)
{ {
// checking if the value is null, we can get rid of null event handlers /*
// for example `@onmouseenter=@(IsOpen ? HandleEnter : null)` * Checking if the value is null, we can get rid of null event handlers,
// this is a powerful feature that in normal HTML elements doesn't work, because * for example `@onmouseenter=@(IsOpen ? HandleEnter : null)`.
// Blazor adds always the attribute value and creates an EventCallback * This is a powerful feature that does not work in regular html elements
if (attribute.Value != null) * because Blazor always adds the attribute value and creates an EventCallback.
* */
if (attribute.Value is not null)
builder.AddAttribute(1, attribute.Key, attribute.Value); builder.AddAttribute(1, attribute.Key, attribute.Value);
} }
//Class
builder.AddAttribute(2, "class", AdditionalClassList);
// StopPropagation builder.AddAttribute(2, "class", ClassList);
// the order matters. This has to be before content is added
if (HtmlTag == "button") /*
* Stop onclock propagation for buttons. The order matters.
* This has to be before content is added
*/
if (PreventOnClickPropagation)
builder.AddEventStopPropagationAttribute(5, "onclick", true); builder.AddEventStopPropagationAttribute(5, "onclick", true);
//Reference capture /*
if (Ref != null) * Add reference capture propagation.
*/
if (Ref is not null)
{ {
builder.AddElementReferenceCapture(6, async capturedRef => builder.AddElementReferenceCapture(6, async capturedRef =>
{ {
@ -73,10 +96,11 @@ public class Element : UIComponent
}); });
} }
//Content /*
* Render child content
*/
builder.AddContent(10, ChildContent); builder.AddContent(10, ChildContent);
//Close
builder.CloseElement(); builder.CloseElement();
} }
} }

@ -11,9 +11,9 @@ public partial class Field : UIComponent
{ {
protected string Classname => protected string Classname =>
new CssBuilder("input") new CssBuilder("input")
.AddClass($"input-{Variant.ToDescriptionString()}") .AddClass($"input-{Variant.ToDescription()}")
.AddClass($"input-adorned-{Adornment.ToDescriptionString()}", Adornment != Adornment.None) .AddClass($"input-adorned-{Adornment.ToDescription()}", Adornment != Adornment.None)
.AddClass($"input-margin-{Margin.ToDescriptionString()}", when: () => Margin != Margin.None) .AddClass($"input-margin-{Margin.ToDescription()}", when: () => Margin != Margin.None)
.AddClass("input-underline", when: () => DisableUnderLine == false && Variant != Variant.Outlined) .AddClass("input-underline", when: () => DisableUnderLine == false && Variant != Variant.Outlined)
.AddClass("shrink", when: () => !string.IsNullOrWhiteSpace(ChildContent?.ToString()) || Adornment == Adornment.Start) .AddClass("shrink", when: () => !string.IsNullOrWhiteSpace(ChildContent?.ToString()) || Adornment == Adornment.Start)
.AddClass("disabled", Disabled) .AddClass("disabled", Disabled)
@ -24,14 +24,14 @@ public partial class Field : UIComponent
new CssBuilder("input-slot") new CssBuilder("input-slot")
.AddClass("input-root") .AddClass("input-root")
.AddClass("input-slot-nopadding", when: () => InnerPadding == false) .AddClass("input-slot-nopadding", when: () => InnerPadding == false)
.AddClass($"input-root-{Variant.ToDescriptionString()}") .AddClass($"input-root-{Variant.ToDescription()}")
.AddClass($"input-adorned-{Adornment.ToDescriptionString()}", Adornment != Adornment.None) .AddClass($"input-adorned-{Adornment.ToDescription()}", Adornment != Adornment.None)
.AddClass($"input-root-margin-{Margin.ToDescriptionString()}", when: () => Margin != Margin.None) .AddClass($"input-root-margin-{Margin.ToDescription()}", when: () => Margin != Margin.None)
.Build(); .Build();
protected string AdornmentClassname => protected string AdornmentClassname =>
new CssBuilder("input-adornment") new CssBuilder("input-adornment")
.AddClass($"input-adornment-{Adornment.ToDescriptionString()}", Adornment != Adornment.None) .AddClass($"input-adornment-{Adornment.ToDescription()}", Adornment != Adornment.None)
.AddClass($"text", !string.IsNullOrEmpty(AdornmentText)) .AddClass($"text", !string.IsNullOrEmpty(AdornmentText))
.AddClass($"input-root-filled-shrink", Variant == Variant.Filled) .AddClass($"input-root-filled-shrink", Variant == Variant.Filled)
.Build(); .Build();
@ -105,14 +105,14 @@ public partial class Field : UIComponent
public bool Disabled { get; set; } public bool Disabled { get; set; }
/// <summary> /// <summary>
/// Icon that will be used if Adornment is set to Start or End. /// Glyph that will be used if Adornment is set to Start or End.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Field.Behavior)] [Category(CategoryTypes.Field.Behavior)]
public string AdornmentIcon { get; set; } public string AdornmentIcon { get; set; }
/// <summary> /// <summary>
/// Text that will be used if Adornment is set to Start or End, the Text overrides Icon. /// Text that will be used if Adornment is set to Start or End, the Text overrides Glyph.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Field.Behavior)] [Category(CategoryTypes.Field.Behavior)]
@ -133,7 +133,7 @@ public partial class Field : UIComponent
public ThemeColor AdornmentColor { get; set; } = ThemeColor.Default; public ThemeColor AdornmentColor { get; set; } = ThemeColor.Default;
/// <summary> /// <summary>
/// Sets the Icon Size. /// Sets the Glyph Size.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Field.Appearance)] [Category(CategoryTypes.Field.Appearance)]

@ -15,7 +15,7 @@
protected string Classname => protected string Classname =>
new CssBuilder("grid") new CssBuilder("grid")
.AddClass($"grid-spacing-xs-{Spacing.ToString()}") .AddClass($"grid-spacing-xs-{Spacing.ToString()}")
.AddClass($"justify-{Justify.ToDescriptionString()}") .AddClass($"justify-{Justify.ToDescription()}")
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)
.Build(); .Build();

@ -11,20 +11,20 @@ public partial class Icon : UIComponent
new CssBuilder("icon-root") new CssBuilder("icon-root")
.AddClass($"icon-default", Color == ThemeColor.Default) .AddClass($"icon-default", Color == ThemeColor.Default)
.AddClass($"svg-icon", !string.IsNullOrEmpty(Glyph) && Glyph.Trim().StartsWith(("<"))) .AddClass($"svg-icon", !string.IsNullOrEmpty(Glyph) && Glyph.Trim().StartsWith(("<")))
.AddClass($"{Color.ToDescriptionString()}-text", Color != ThemeColor.Default && Color != ThemeColor.Inherit) .AddClass($"{Color.ToDescription()}-text", Color != ThemeColor.Default && Color != ThemeColor.Inherit)
.AddClass($"icon-size-{Size.ToDescriptionString()}") .AddClass($"icon-size-{Size.ToDescription()}")
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)
.Build(); .Build();
/// <summary> /// <summary>
/// Icon to be used can either be svg paths for font icons. /// Glyph to be used can either be svg paths for font icons.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Icon.Behavior)] [Category(CategoryTypes.Icon.Behavior)]
public string Glyph { get; set; } public string Glyph { get; set; }
/// <summary> /// <summary>
/// Title of the icon used for accessibility. /// GlyphTitle of the icon used for accessibility.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Icon.Behavior)] [Category(CategoryTypes.Icon.Behavior)]

@ -14,8 +14,8 @@ public partial class Image : UIComponent
protected string Classname => protected string Classname =>
new CssBuilder("image") new CssBuilder("image")
.AddClass("fluid", Fluid) .AddClass("fluid", Fluid)
.AddClass($"object-{ObjectFit.ToDescriptionString()}") .AddClass($"object-{ObjectFit.ToDescription()}")
.AddClass($"object-{ObjectPosition.ToDescriptionString()}") .AddClass($"object-{ObjectPosition.ToDescription()}")
.AddClass($"elevation-{Elevation}", Elevation > 0) .AddClass($"elevation-{Elevation}", Elevation > 0)
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)
.Build(); .Build();

@ -29,7 +29,7 @@ public partial class Input<T> : InputBase<T>
internal override InputType GetInputType() => InputType; internal override InputType GetInputType() => InputType;
protected string InputTypeString => InputType.ToDescriptionString(); protected string InputTypeString => InputType.ToDescription();
protected Task OnInput(ChangeEventArgs args) protected Task OnInput(ChangeEventArgs args)
{ {

@ -63,14 +63,14 @@ public abstract class InputBase<T> : FormComponent<T, string>
public bool HelperTextOnFocus { get; set; } public bool HelperTextOnFocus { get; set; }
/// <summary> /// <summary>
/// Icon that will be used if Adornment is set to Start or End. /// Glyph that will be used if Adornment is set to Start or End.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.FormComponent.Behavior)] [Category(CategoryTypes.FormComponent.Behavior)]
public string AdornmentIcon { get; set; } public string AdornmentIcon { get; set; }
/// <summary> /// <summary>
/// Text that will be used if Adornment is set to Start or End, the Text overrides Icon. /// Text that will be used if Adornment is set to Start or End, the Text overrides Glyph.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.FormComponent.Behavior)] [Category(CategoryTypes.FormComponent.Behavior)]
@ -105,7 +105,7 @@ public abstract class InputBase<T> : FormComponent<T, string>
public string AdornmentAriaLabel { get; set; } = string.Empty; public string AdornmentAriaLabel { get; set; } = string.Empty;
/// <summary> /// <summary>
/// The Icon Size. /// The Glyph Size.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.FormComponent.Appearance)] [Category(CategoryTypes.FormComponent.Appearance)]

@ -7,9 +7,9 @@ internal static class InputCssHelper
{ {
public static string GetClassname<T>(InputBase<T> baseInput, Func<bool> shrinkWhen) => public static string GetClassname<T>(InputBase<T> baseInput, Func<bool> shrinkWhen) =>
new CssBuilder("input") new CssBuilder("input")
.AddClass($"input-{baseInput.Variant.ToDescriptionString()}") .AddClass($"input-{baseInput.Variant.ToDescription()}")
.AddClass($"input-adorned-{baseInput.Adornment.ToDescriptionString()}", baseInput.Adornment != Adornment.None) .AddClass($"input-adorned-{baseInput.Adornment.ToDescription()}", baseInput.Adornment != Adornment.None)
.AddClass($"input-margin-{baseInput.Margin.ToDescriptionString()}", when: () => baseInput.Margin != Margin.None) .AddClass($"input-margin-{baseInput.Margin.ToDescription()}", when: () => baseInput.Margin != Margin.None)
.AddClass("input-underline", when: () => baseInput.DisableUnderLine == false && baseInput.Variant != Variant.Outlined) .AddClass("input-underline", when: () => baseInput.DisableUnderLine == false && baseInput.Variant != Variant.Outlined)
.AddClass("shrink", when: shrinkWhen) .AddClass("shrink", when: shrinkWhen)
.AddClass("disabled", baseInput.Disabled) .AddClass("disabled", baseInput.Disabled)
@ -21,15 +21,15 @@ internal static class InputCssHelper
public static string GetInputClassname<T>(InputBase<T> baseInput) => public static string GetInputClassname<T>(InputBase<T> baseInput) =>
new CssBuilder("input-slot") new CssBuilder("input-slot")
.AddClass("input-root") .AddClass("input-root")
.AddClass($"input-root-{baseInput.Variant.ToDescriptionString()}") .AddClass($"input-root-{baseInput.Variant.ToDescription()}")
.AddClass($"input-root-adorned-{baseInput.Adornment.ToDescriptionString()}", baseInput.Adornment != Adornment.None) .AddClass($"input-root-adorned-{baseInput.Adornment.ToDescription()}", baseInput.Adornment != Adornment.None)
.AddClass($"input-root-margin-{baseInput.Margin.ToDescriptionString()}", when: () => baseInput.Margin != Margin.None) .AddClass($"input-root-margin-{baseInput.Margin.ToDescription()}", when: () => baseInput.Margin != Margin.None)
.AddClass(baseInput.AdditionalClassList) .AddClass(baseInput.AdditionalClassList)
.Build(); .Build();
public static string GetAdornmentClassname<T>(InputBase<T> baseInput) => public static string GetAdornmentClassname<T>(InputBase<T> baseInput) =>
new CssBuilder("input-adornment") new CssBuilder("input-adornment")
.AddClass($"input-adornment-{baseInput.Adornment.ToDescriptionString()}", baseInput.Adornment != Adornment.None) .AddClass($"input-adornment-{baseInput.Adornment.ToDescription()}", baseInput.Adornment != Adornment.None)
.AddClass($"text", !string.IsNullOrEmpty(baseInput.AdornmentText)) .AddClass($"text", !string.IsNullOrEmpty(baseInput.AdornmentText))
.AddClass($"input-root-filled-shrink", baseInput.Variant == Variant.Filled) .AddClass($"input-root-filled-shrink", baseInput.Variant == Variant.Filled)
.AddClass(baseInput.AdditionalClassList) .AddClass(baseInput.AdditionalClassList)

@ -9,8 +9,8 @@ public partial class InputLabel : UIComponent
new Utilities.CssBuilder() new Utilities.CssBuilder()
.AddClass("input-label") .AddClass("input-label")
.AddClass("input-label-animated") .AddClass("input-label-animated")
.AddClass($"input-label-{Variant.ToDescriptionString()}") .AddClass($"input-label-{Variant.ToDescription()}")
.AddClass($"input-label-margin-{Margin.ToDescriptionString()}", when: () => Margin != Margin.None) .AddClass($"input-label-margin-{Margin.ToDescription()}", when: () => Margin != Margin.None)
.AddClass($"disabled", Disabled) .AddClass($"disabled", Disabled)
.AddClass("input-error", Error) .AddClass("input-error", Error)
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)

@ -38,7 +38,7 @@ public partial class RangeInput<T> : InputBase<Range<T>>
/// </summary> /// </summary>
[Parameter] public string PlaceholderEnd { get; set; } [Parameter] public string PlaceholderEnd { get; set; }
protected string InputTypeString => InputType.ToDescriptionString(); protected string InputTypeString => InputType.ToDescription();
/// <summary> /// <summary>
/// ChildContent of the MudInput will only be displayed if InputType.Hidden and if its not null. /// ChildContent of the MudInput will only be displayed if InputType.Hidden and if its not null.

@ -9,7 +9,7 @@ public partial class InputControl : UIComponent
protected string Classname => protected string Classname =>
new CssBuilder("input-control") new CssBuilder("input-control")
.AddClass("input-required", when: () => Required) .AddClass("input-required", when: () => Required)
.AddClass($"input-control-margin-{Margin.ToDescriptionString()}", when: () => Margin != Margin.None) .AddClass($"input-control-margin-{Margin.ToDescription()}", when: () => Margin != Margin.None)
.AddClass("input-control-full-width", FullWidth) .AddClass("input-control-full-width", FullWidth)
.AddClass("input-error", Error) .AddClass("input-error", Error)
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)

@ -10,10 +10,10 @@ public partial class Link : UIComponent
{ {
protected string Classname => protected string Classname =>
new CssBuilder("typography mud-link") new CssBuilder("typography mud-link")
.AddClass($"{Color.ToDescriptionString()}-text") .AddClass($"{Color.ToDescription()}-text")
.AddClass($"link-underline-{Underline.ToDescriptionString()}") .AddClass($"link-underline-{Underline.ToDescription()}")
.AddClass($"typography-{Typo.ToDescriptionString()}") .AddClass($"typography-{Typo.ToDescription()}")
// When Href is empty, link's hover cursor is text "I beam" even when OnClick has a delegate. // When Href is empty, link's hover cursor is text "I beam" even when Clicked has a delegate.
// To change this for more expected look change hover cursor to a pointer: // To change this for more expected look change hover cursor to a pointer:
.AddClass("cursor-pointer", Href == default && OnClick.HasDelegate && !Disabled) .AddClass("cursor-pointer", Href == default && OnClick.HasDelegate && !Disabled)
.AddClass($"link-disabled", Disabled) .AddClass($"link-disabled", Disabled)

@ -15,7 +15,7 @@ public partial class ListItem : UIComponent, IDisposable
.AddClass("list-item-gutters", !DisableGutters && !(List?.DisableGutters == true)) .AddClass("list-item-gutters", !DisableGutters && !(List?.DisableGutters == true))
.AddClass("list-item-clickable", List?.Clickable) .AddClass("list-item-clickable", List?.Clickable)
.AddClass("ripple", List?.Clickable == true && !DisableRipple && !Disabled) .AddClass("ripple", List?.Clickable == true && !DisableRipple && !Disabled)
.AddClass($"selected-item mud-{List?.Color.ToDescriptionString()}-text mud-{List?.Color.ToDescriptionString()}-hover", _selected && !Disabled) .AddClass($"selected-item mud-{List?.Color.ToDescription()}-text mud-{List?.Color.ToDescription()}-hover", _selected && !Disabled)
.AddClass("list-item-disabled", Disabled) .AddClass("list-item-disabled", Disabled)
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)
.Build(); .Build();
@ -86,7 +86,7 @@ public partial class ListItem : UIComponent, IDisposable
public bool DisableRipple { get; set; } public bool DisableRipple { get; set; }
/// <summary> /// <summary>
/// Icon to use if set. /// Glyph to use if set.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.List.Behavior)] [Category(CategoryTypes.List.Behavior)]
@ -100,7 +100,7 @@ public partial class ListItem : UIComponent, IDisposable
public ThemeColor IconColor { get; set; } = ThemeColor.Inherit; public ThemeColor IconColor { get; set; } = ThemeColor.Inherit;
/// <summary> /// <summary>
/// Sets the Icon Size. /// Sets the Glyph Size.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.List.Appearance)] [Category(CategoryTypes.List.Appearance)]

@ -17,7 +17,7 @@
<input class="@InputClassname" <input class="@InputClassname"
@ref="_elementReference" @ref="_elementReference"
@attributes="CustomAttributes" @attributes="CustomAttributes"
type="@InputType.ToDescriptionString()" type="@InputType.ToDescription()"
value="@Text" value="@Text"
placeholder="@Placeholder" placeholder="@Placeholder"
disabled=@Disabled disabled=@Disabled

@ -21,9 +21,9 @@ public partial class Mask : InputBase<string>, IDisposable
protected string Classname => protected string Classname =>
new CssBuilder("input") new CssBuilder("input")
.AddClass($"input-{Variant.ToDescriptionString()}") .AddClass($"input-{Variant.ToDescription()}")
.AddClass($"input-adorned-{Adornment.ToDescriptionString()}", Adornment != Adornment.None) .AddClass($"input-adorned-{Adornment.ToDescription()}", Adornment != Adornment.None)
.AddClass($"input-margin-{Margin.ToDescriptionString()}", when: () => Margin != Margin.None) .AddClass($"input-margin-{Margin.ToDescription()}", when: () => Margin != Margin.None)
.AddClass("input-underline", when: () => DisableUnderLine == false && Variant != Variant.Outlined) .AddClass("input-underline", when: () => DisableUnderLine == false && Variant != Variant.Outlined)
.AddClass("shrink", .AddClass("shrink",
when: () => !string.IsNullOrEmpty(Text) || Adornment == Adornment.Start || when: () => !string.IsNullOrEmpty(Text) || Adornment == Adornment.Start ||
@ -37,15 +37,15 @@ public partial class Mask : InputBase<string>, IDisposable
protected string InputClassname => protected string InputClassname =>
new CssBuilder("input-slot") new CssBuilder("input-slot")
.AddClass("input-root") .AddClass("input-root")
.AddClass($"input-root-{Variant.ToDescriptionString()}") .AddClass($"input-root-{Variant.ToDescription()}")
.AddClass($"input-root-adorned-{Adornment.ToDescriptionString()}", Adornment != Adornment.None) .AddClass($"input-root-adorned-{Adornment.ToDescription()}", Adornment != Adornment.None)
.AddClass($"input-root-margin-{Margin.ToDescriptionString()}", when: () => Margin != Margin.None) .AddClass($"input-root-margin-{Margin.ToDescription()}", when: () => Margin != Margin.None)
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)
.Build(); .Build();
protected string AdornmentClassname => protected string AdornmentClassname =>
new CssBuilder("input-adornment") new CssBuilder("input-adornment")
.AddClass($"input-adornment-{Adornment.ToDescriptionString()}", Adornment != Adornment.None) .AddClass($"input-adornment-{Adornment.ToDescription()}", Adornment != Adornment.None)
.AddClass($"text", !string.IsNullOrEmpty(AdornmentText)) .AddClass($"text", !string.IsNullOrEmpty(AdornmentText))
.AddClass($"input-root-filled-shrink", Variant == Variant.Filled) .AddClass($"input-root-filled-shrink", Variant == Variant.Filled)
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)

@ -41,7 +41,7 @@ public partial class Menu : UIComponent, IActivatable
public string PopoverClass { get; set; } public string PopoverClass { get; set; }
/// <summary> /// <summary>
/// Icon to use if set will turn the button into a MudIconButton. /// Glyph to use if set will turn the button into a MudIconButton.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Menu.Behavior)] [Category(CategoryTypes.Menu.Behavior)]
@ -55,14 +55,14 @@ public partial class Menu : UIComponent, IActivatable
public ThemeColor IconColor { get; set; } = ThemeColor.Inherit; public ThemeColor IconColor { get; set; } = ThemeColor.Inherit;
/// <summary> /// <summary>
/// Icon placed before the text if set. /// Glyph placed before the text if set.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Menu.Behavior)] [Category(CategoryTypes.Menu.Behavior)]
public string StartIcon { get; set; } public string StartIcon { get; set; }
/// <summary> /// <summary>
/// Icon placed after the text if set. /// Glyph placed after the text if set.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Menu.Behavior)] [Category(CategoryTypes.Menu.Behavior)]

@ -31,7 +31,7 @@ public partial class MenuItem : UIComponent
public string Href { get; set; } public string Href { get; set; }
/// <summary> /// <summary>
/// Icon to be used for this menu entry /// Glyph to be used for this menu entry
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.List.Behavior)] [Category(CategoryTypes.List.Behavior)]
@ -43,7 +43,7 @@ public partial class MenuItem : UIComponent
[Category(CategoryTypes.List.Appearance)] [Category(CategoryTypes.List.Appearance)]
public ThemeColor IconColor { get; set; } = ThemeColor.Inherit; public ThemeColor IconColor { get; set; } = ThemeColor.Inherit;
/// <summary> /// <summary>
/// The Icon Size. /// The Glyph Size.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.List.Appearance)] [Category(CategoryTypes.List.Appearance)]

@ -18,7 +18,7 @@ public partial class MessageBox : UIComponent
public string Title { get; set; } public string Title { get; set; }
/// <summary> /// <summary>
/// Define the message box title as a renderfragment (overrides Title) /// Define the message box title as a renderfragment (overrides GlyphTitle)
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.MessageBox.Behavior)] [Category(CategoryTypes.MessageBox.Behavior)]

@ -34,7 +34,7 @@ public partial class NavGroup : UIComponent
public string Title { get; set; } public string Title { get; set; }
/// <summary> /// <summary>
/// Icon to use if set. /// Glyph to use if set.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.NavMenu.Behavior)] [Category(CategoryTypes.NavMenu.Behavior)]

@ -34,7 +34,7 @@ public partial class NavLink : SelectItemBase
} }
/// <summary> /// <summary>
/// Icon to use if set. /// Glyph to use if set.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.NavMenu.Behavior)] [Category(CategoryTypes.NavMenu.Behavior)]

@ -9,11 +9,11 @@ public partial class NavMenu : UIComponent
{ {
protected string Classname => protected string Classname =>
new CssBuilder("navmenu") new CssBuilder("navmenu")
.AddClass($"navmenu-{Color.ToDescriptionString()}") .AddClass($"navmenu-{Color.ToDescription()}")
.AddClass($"navmenu-margin-{Margin.ToDescriptionString()}") .AddClass($"navmenu-margin-{Margin.ToDescription()}")
.AddClass("navmenu-dense", Dense) .AddClass("navmenu-dense", Dense)
.AddClass("navmenu-rounded", Rounded) .AddClass("navmenu-rounded", Rounded)
.AddClass($"navmenu-bordered mud-border-{Color.ToDescriptionString()}", Bordered) .AddClass($"navmenu-bordered mud-border-{Color.ToDescription()}", Bordered)
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)
.Build(); .Build();

@ -95,7 +95,7 @@ public partial class Overlay : UIComponent, IDisposable
public bool LightBackground { get; set; } public bool LightBackground { get; set; }
/// <summary> /// <summary>
/// Icon class names, separated by space /// Glyph class names, separated by space
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Overlay.Behavior)] [Category(CategoryTypes.Overlay.Behavior)]

@ -44,7 +44,7 @@ public class PageContentSection
public int Level { get; set; } public int Level { get; set; }
/// <summary> /// <summary>
/// The Title of the section. This will be displayed in the navigation /// The GlyphTitle of the section. This will be displayed in the navigation
/// </summary> /// </summary>
public string Title { get; set; } public string Title { get; set; }

@ -16,8 +16,8 @@ public partial class Pagination : UIComponent
private string Classname => private string Classname =>
new CssBuilder("pagination") new CssBuilder("pagination")
.AddClass($"pagination-{Variant.ToDescriptionString()}") .AddClass($"pagination-{Variant.ToDescription()}")
.AddClass($"pagination-{Size.ToDescriptionString()}") .AddClass($"pagination-{Size.ToDescription()}")
.AddClass("pagination-disable-elevation", DisableElevation) .AddClass("pagination-disable-elevation", DisableElevation)
.AddClass("pagination-rtl", RightToLeft) .AddClass("pagination-rtl", RightToLeft)
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)

@ -237,7 +237,7 @@ public partial class Picker<T> : FormComponent<T, string>
public Orientation Orientation { get; set; } = Orientation.Portrait; public Orientation Orientation { get; set; } = Orientation.Portrait;
/// <summary> /// <summary>
/// Sets the Icon Size. /// Sets the Glyph Size.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.FormComponent.Appearance)] [Category(CategoryTypes.FormComponent.Appearance)]

@ -13,7 +13,7 @@
@code { @code {
protected string Classnames => protected string Classnames =>
new CssBuilder("picker-toolbar") new CssBuilder("picker-toolbar")
.AddClass($"theme-{Color.ToDescriptionString()}") .AddClass($"theme-{Color.ToDescription()}")
.AddClass("picker-toolbar-landscape", Orientation == Orientation.Landscape) .AddClass("picker-toolbar-landscape", Orientation == Orientation.Landscape)
.AddClass(Class) .AddClass(Class)
.Build(); .Build();

@ -15,9 +15,9 @@ public partial class Popover : UIComponent, IAsyncDisposable
new CssBuilder("popover") new CssBuilder("popover")
.AddClass($"popover-fixed", Fixed) .AddClass($"popover-fixed", Fixed)
.AddClass($"popover-open", Open) .AddClass($"popover-open", Open)
.AddClass($"popover-{TransformOrigin.ToDescriptionString()}") .AddClass($"popover-{TransformOrigin.ToDescription()}")
.AddClass($"popover-anchor-{AnchorOrigin.ToDescriptionString()}") .AddClass($"popover-anchor-{AnchorOrigin.ToDescription()}")
.AddClass($"popover-overflow-{OverflowBehavior.ToDescriptionString()}") .AddClass($"popover-overflow-{OverflowBehavior.ToDescription()}")
.AddClass($"popover-relative-width", RelativeWidth) .AddClass($"popover-relative-width", RelativeWidth)
.AddClass($"paper", Paper) .AddClass($"paper", Paper)
.AddClass($"paper-square", Paper && Square) .AddClass($"paper-square", Paper && Square)

@ -12,8 +12,8 @@ public partial class ProgressCircular : UIComponent
protected string DivClassname => protected string DivClassname =>
new CssBuilder("progress-circular") new CssBuilder("progress-circular")
.AddClass($"{Color.ToDescriptionString()}-text") .AddClass($"{Color.ToDescription()}-text")
.AddClass($"progress-{Size.ToDescriptionString()}") .AddClass($"progress-{Size.ToDescription()}")
.AddClass($"progress-indeterminate", Indeterminate) .AddClass($"progress-indeterminate", Indeterminate)
.AddClass($"progress-static", !Indeterminate) .AddClass($"progress-static", !Indeterminate)
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)

@ -15,8 +15,8 @@ public partial class ProgressLinear : UIComponent
.AddClass($"progress-linear-striped", Striped) .AddClass($"progress-linear-striped", Striped)
.AddClass($"progress-indeterminate", Indeterminate) .AddClass($"progress-indeterminate", Indeterminate)
.AddClass($"progress-linear-buffer", Buffer && !Indeterminate) .AddClass($"progress-linear-buffer", Buffer && !Indeterminate)
.AddClass($"progress-linear-{Size.ToDescriptionString()}") .AddClass($"progress-linear-{Size.ToDescription()}")
.AddClass($"progress-linear-color-{Color.ToDescriptionString()}") .AddClass($"progress-linear-color-{Color.ToDescription()}")
.AddClass("horizontal", !Vertical) .AddClass("horizontal", !Vertical)
.AddClass("vertical", Vertical) .AddClass("vertical", Vertical)
.AddClass("flip-x-rtl") .AddClass("flip-x-rtl")

@ -21,8 +21,8 @@ public partial class Radio<T> : UIComponent, IDisposable
protected string ButtonClassname => protected string ButtonClassname =>
new CssBuilder("button-root mud-icon-button") new CssBuilder("button-root mud-icon-button")
.AddClass($"ripple mud-ripple-radio", !DisableRipple && !Disabled) .AddClass($"ripple mud-ripple-radio", !DisableRipple && !Disabled)
.AddClass($"{Color.ToDescriptionString()}-text hover:mud-{Color.ToDescriptionString()}-hover", UnCheckedColor == null || (UnCheckedColor != null && Checked == true)) .AddClass($"{Color.ToDescription()}-text hover:mud-{Color.ToDescription()}-hover", UnCheckedColor == null || (UnCheckedColor != null && Checked == true))
.AddClass($"{UnCheckedColor?.ToDescriptionString()}-text hover:mud-{UnCheckedColor?.ToDescriptionString()}-hover", UnCheckedColor != null && Checked == false) .AddClass($"{UnCheckedColor?.ToDescription()}-text hover:mud-{UnCheckedColor?.ToDescription()}-hover", UnCheckedColor != null && Checked == false)
.AddClass($"radio-dense", Dense) .AddClass($"radio-dense", Dense)
.AddClass($"disabled", Disabled) .AddClass($"disabled", Disabled)
.AddClass($"checked", Checked) .AddClass($"checked", Checked)
@ -36,12 +36,12 @@ public partial class Radio<T> : UIComponent, IDisposable
protected string IconClassName => protected string IconClassName =>
new CssBuilder("icon-root mud-svg-icon") new CssBuilder("icon-root mud-svg-icon")
.AddClass($"icon-size-{Size.ToDescriptionString()}") .AddClass($"icon-size-{Size.ToDescription()}")
.Build(); .Build();
protected string CheckedIconClassName => protected string CheckedIconClassName =>
new CssBuilder("icon-root mud-svg-icon mud-radio-icon-checked") new CssBuilder("icon-root mud-svg-icon mud-radio-icon-checked")
.AddClass($"icon-size-{Size.ToDescriptionString()}") .AddClass($"icon-size-{Size.ToDescription()}")
.Build(); .Build();
protected string ChildSpanClassName => protected string ChildSpanClassName =>

@ -15,7 +15,7 @@ public partial class RatingItem : UIComponent
.AddClass($"rating-item") .AddClass($"rating-item")
.AddClass($"ripple mud-ripple-icon", !DisableRipple) .AddClass($"ripple mud-ripple-icon", !DisableRipple)
.AddClass($"yellow-text.text-darken-3", Color == ThemeColor.Default) .AddClass($"yellow-text.text-darken-3", Color == ThemeColor.Default)
.AddClass($"{Color.ToDescriptionString()}-text", Color != ThemeColor.Default) .AddClass($"{Color.ToDescription()}-text", Color != ThemeColor.Default)
.AddClass($"rating-item-active", IsActive) .AddClass($"rating-item-active", IsActive)
.AddClass($"disabled", Disabled) .AddClass($"disabled", Disabled)
.AddClass($"readonly", ReadOnly) .AddClass($"readonly", ReadOnly)

@ -171,14 +171,14 @@ public partial class Select<T> : InputBase<T>, ISelect, IShadowSelect
} }
/// <summary> /// <summary>
/// The Open Select Icon /// The Open Select Glyph
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.FormComponent.Appearance)] [Category(CategoryTypes.FormComponent.Appearance)]
public string OpenIcon { get; set; } = Icons.Material.Filled.ArrowDropDown; public string OpenIcon { get; set; } = Icons.Material.Filled.ArrowDropDown;
/// <summary> /// <summary>
/// The Close Select Icon /// The Close Select Glyph
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.FormComponent.Appearance)] [Category(CategoryTypes.FormComponent.Appearance)]

@ -9,8 +9,8 @@ public partial class Skeleton : UIComponent
{ {
protected string Classname => protected string Classname =>
new CssBuilder("skeleton") new CssBuilder("skeleton")
.AddClass($"skeleton-{SkeletonType.ToDescriptionString()}") .AddClass($"skeleton-{SkeletonType.ToDescription()}")
.AddClass($"skeleton-{Animation.ToDescriptionString()}") .AddClass($"skeleton-{Animation.ToDescription()}")
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)
.Build(); .Build();

@ -10,8 +10,8 @@ public partial class Slider<T> : UIComponent
{ {
protected string Classname => protected string Classname =>
new CssBuilder("slider") new CssBuilder("slider")
.AddClass($"slider-{Size.ToDescriptionString()}") .AddClass($"slider-{Size.ToDescription()}")
.AddClass($"slider-{Color.ToDescriptionString()}") .AddClass($"slider-{Color.ToDescription()}")
.AddClass("slider-vertical", Vertical) .AddClass("slider-vertical", Vertical)
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)
.Build(); .Build();

@ -59,7 +59,7 @@ public class SnackbarOptions : CommonSnackbarOptions
{ {
Severity = severity; Severity = severity;
SnackbarTypeClass = $"alert-{SnackbarVariant.ToDescriptionString()}-{severity.ToDescriptionString()}"; SnackbarTypeClass = $"alert-{SnackbarVariant.ToDescription()}-{severity.ToDescription()}";
if (SnackbarVariant != Variant.Filled) if (SnackbarVariant != Variant.Filled)
{ {

@ -14,8 +14,8 @@ public partial class Stack : UIComponent
protected string Classname => protected string Classname =>
new CssBuilder("d-flex") new CssBuilder("d-flex")
.AddClass($"flex-{(Row ? "row" : "column")}{(Reverse ? "-reverse" : string.Empty)}") .AddClass($"flex-{(Row ? "row" : "column")}{(Reverse ? "-reverse" : string.Empty)}")
.AddClass($"justify-{Justify?.ToDescriptionString()}", Justify != null) .AddClass($"justify-{Justify?.ToDescription()}", Justify != null)
.AddClass($"align-{AlignItems?.ToDescriptionString()}", AlignItems != null) .AddClass($"align-{AlignItems?.ToDescription()}", AlignItems != null)
.AddClass($"gap-{Spacing}") .AddClass($"gap-{Spacing}")
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)
.Build(); .Build();

@ -21,8 +21,8 @@ public partial class Switch<T> : BooleanInput<T>
protected string SwitchClassname => protected string SwitchClassname =>
new CssBuilder("button-root mud-icon-button mud-switch-base") new CssBuilder("button-root mud-icon-button mud-switch-base")
.AddClass($"ripple mud-ripple-switch", !DisableRipple && !ReadOnly && !Disabled) .AddClass($"ripple mud-ripple-switch", !DisableRipple && !ReadOnly && !Disabled)
.AddClass($"{Color.ToDescriptionString()}-text hover:mud-{Color.ToDescriptionString()}-hover", BoolValue == true) .AddClass($"{Color.ToDescription()}-text hover:mud-{Color.ToDescription()}-hover", BoolValue == true)
.AddClass($"{UnCheckedColor.ToDescriptionString()}-text hover:mud-{UnCheckedColor.ToDescriptionString()}-hover", BoolValue == false) .AddClass($"{UnCheckedColor.ToDescription()}-text hover:mud-{UnCheckedColor.ToDescription()}-hover", BoolValue == false)
.AddClass($"switch-disabled", Disabled) .AddClass($"switch-disabled", Disabled)
.AddClass($"readonly", ReadOnly) .AddClass($"readonly", ReadOnly)
.AddClass($"checked", BoolValue) .AddClass($"checked", BoolValue)
@ -30,8 +30,8 @@ public partial class Switch<T> : BooleanInput<T>
protected string TrackClassname => protected string TrackClassname =>
new CssBuilder("switch-track") new CssBuilder("switch-track")
.AddClass($"{Color.ToDescriptionString()}", BoolValue == true) .AddClass($"{Color.ToDescription()}", BoolValue == true)
.AddClass($"{UnCheckedColor.ToDescriptionString()}", BoolValue == false) .AddClass($"{UnCheckedColor.ToDescription()}", BoolValue == false)
.Build(); .Build();
//Excluded because not used //Excluded because not used

@ -331,14 +331,14 @@ public abstract class TableBase : UIComponent
public string CancelEditTooltip { get; set; } public string CancelEditTooltip { get; set; }
/// <summary> /// <summary>
/// Sets the Icon of the CommitEdit Button. /// Sets the Glyph of the CommitEdit Button.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Table.Editing)] [Category(CategoryTypes.Table.Editing)]
public string CommitEditIcon { get; set; } = Icons.Material.Filled.Done; public string CommitEditIcon { get; set; } = Icons.Material.Filled.Done;
/// <summary> /// <summary>
/// Sets the Icon of the CancelEdit Button. /// Sets the Glyph of the CancelEdit Button.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Table.Editing)] [Category(CategoryTypes.Table.Editing)]

@ -27,7 +27,7 @@ public partial class TableSortLabel<[DynamicallyAccessedMembers(DynamicallyAcces
public bool Enabled { get; set; } = true; public bool Enabled { get; set; } = true;
/// <summary> /// <summary>
/// The Icon used to display sortdirection. /// The Glyph used to display sortdirection.
/// </summary> /// </summary>
[Parameter] public string SortIcon { get; set; } = Icons.Material.Filled.ArrowUpward; [Parameter] public string SortIcon { get; set; } = Icons.Material.Filled.ArrowUpward;

@ -34,7 +34,7 @@ else
public string Text { get; set; } public string Text { get; set; }
/// <summary> /// <summary>
/// Icon placed before the text if set. /// Glyph placed before the text if set.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Tabs.Behavior)] [Category(CategoryTypes.Tabs.Behavior)]

@ -14,7 +14,7 @@
@if (_showScrollButtons) @if (_showScrollButtons)
{ {
<div class="tabs-scroll-button"> <div class="tabs-scroll-button">
<IconButton Icon="@_prevIcon" Color="@ScrollIconColor" OnClick="@((e) => ScrollPrev())" Disabled="@_prevButtonDisabled" /> <GlyphButton Icon="@_prevIcon" Color="@ScrollIconColor" Clicked="@((e) => ScrollPrev())" Disabled="@_prevButtonDisabled" />
</div> </div>
} }
<div @ref="@_tabsContentSize" class="tabs-toolbar-content"> <div @ref="@_tabsContentSize" class="tabs-toolbar-content">
@ -52,7 +52,7 @@
@if (_showScrollButtons) @if (_showScrollButtons)
{ {
<div class="tabs-scroll-button"> <div class="tabs-scroll-button">
<IconButton Icon="@_nextIcon" Color="@ScrollIconColor" OnClick="@((e) => ScrollNext())" Disabled="@_nextButtonDisabled" /> <GlyphButton Icon="@_nextIcon" Color="@ScrollIconColor" Clicked="@((e) => ScrollNext())" Disabled="@_nextButtonDisabled" />
</div> </div>
} }
@if (HeaderPosition == TabHeaderPosition.After && Header != null) @if (HeaderPosition == TabHeaderPosition.After && Header != null)

@ -77,14 +77,14 @@ public partial class Tabs : UIComponent, IAsyncDisposable
public bool HideSlider { get; set; } public bool HideSlider { get; set; }
/// <summary> /// <summary>
/// Icon to use for left pagination. /// Glyph to use for left pagination.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Tabs.Appearance)] [Category(CategoryTypes.Tabs.Appearance)]
public string PrevIcon { get; set; } = Icons.Filled.ChevronLeft; public string PrevIcon { get; set; } = Icons.Filled.ChevronLeft;
/// <summary> /// <summary>
/// Icon to use for right pagination. /// Glyph to use for right pagination.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Tabs.Appearance)] [Category(CategoryTypes.Tabs.Appearance)]
@ -430,8 +430,8 @@ public partial class Tabs : UIComponent, IAsyncDisposable
new CssBuilder("tabs-toolbar") new CssBuilder("tabs-toolbar")
.AddClass($"tabs-rounded", !ApplyEffectsToContainer && Rounded) .AddClass($"tabs-rounded", !ApplyEffectsToContainer && Rounded)
.AddClass($"tabs-vertical", IsVerticalTabs()) .AddClass($"tabs-vertical", IsVerticalTabs())
.AddClass($"tabs-toolbar-{Color.ToDescriptionString()}", Color != ThemeColor.Default) .AddClass($"tabs-toolbar-{Color.ToDescription()}", Color != ThemeColor.Default)
.AddClass($"tabs-border-{ConvertPosition(Position).ToDescriptionString()}", Border) .AddClass($"tabs-border-{ConvertPosition(Position).ToDescription()}", Border)
.AddClass($"paper-outlined", !ApplyEffectsToContainer && Outlined) .AddClass($"paper-outlined", !ApplyEffectsToContainer && Outlined)
.AddClass($"elevation-{Elevation}", !ApplyEffectsToContainer && Elevation != 0) .AddClass($"elevation-{Elevation}", !ApplyEffectsToContainer && Elevation != 0)
.Build(); .Build();
@ -456,7 +456,7 @@ public partial class Tabs : UIComponent, IAsyncDisposable
protected string SliderClass => protected string SliderClass =>
new CssBuilder("tab-slider") new CssBuilder("tab-slider")
.AddClass($"{SliderColor.ToDescriptionString()}", SliderColor != ThemeColor.Inherit) .AddClass($"{SliderColor.ToDescription()}", SliderColor != ThemeColor.Inherit)
.AddClass($"tab-slider-horizontal", Position is Position.Top or Position.Bottom) .AddClass($"tab-slider-horizontal", Position is Position.Top or Position.Bottom)
.AddClass($"tab-slider-vertical", IsVerticalTabs()) .AddClass($"tab-slider-vertical", IsVerticalTabs())
.AddClass($"tab-slider-horizontal-reverse", Position == Position.Bottom) .AddClass($"tab-slider-horizontal-reverse", Position == Position.Bottom)

@ -301,24 +301,24 @@ public partial class TimePicker : Picker<TimeSpan?>
private string GetClockPinColor() private string GetClockPinColor()
{ {
return $"picker-time-clock-pin mud-{Color.ToDescriptionString()}"; return $"picker-time-clock-pin mud-{Color.ToDescription()}";
} }
private string GetClockPointerColor() private string GetClockPointerColor()
{ {
if (MouseDown) if (MouseDown)
return $"picker-time-clock-pointer mud-{Color.ToDescriptionString()}"; return $"picker-time-clock-pointer mud-{Color.ToDescription()}";
else else
return $"picker-time-clock-pointer mud-picker-time-clock-pointer-animation mud-{Color.ToDescriptionString()}"; return $"picker-time-clock-pointer mud-picker-time-clock-pointer-animation mud-{Color.ToDescription()}";
} }
private string GetClockPointerThumbColor() private string GetClockPointerThumbColor()
{ {
var deg = GetDeg(); var deg = GetDeg();
if (deg % 30 == 0) if (deg % 30 == 0)
return $"picker-time-clock-pointer-thumb mud-onclock-text mud-onclock-primary mud-{Color.ToDescriptionString()}"; return $"picker-time-clock-pointer-thumb mud-onclock-text mud-onclock-primary mud-{Color.ToDescription()}";
else else
return $"picker-time-clock-pointer-thumb mud-onclock-minute mud-{Color.ToDescriptionString()}-text"; return $"picker-time-clock-pointer-thumb mud-onclock-minute mud-{Color.ToDescription()}-text";
} }
private string GetNumberColor(int value) private string GetNumberColor(int value)
@ -333,11 +333,11 @@ public partial class TimePicker : Picker<TimeSpan?>
h = 12; h = 12;
} }
if (h == value) if (h == value)
return $"clock-number mud-theme-{Color.ToDescriptionString()}"; return $"clock-number mud-theme-{Color.ToDescription()}";
} }
else if (_currentView == OpenTo.Minutes && _timeSet.Minute == value) else if (_currentView == OpenTo.Minutes && _timeSet.Minute == value)
{ {
return $"clock-number mud-theme-{Color.ToDescriptionString()}"; return $"clock-number mud-theme-{Color.ToDescription()}";
} }
return $"clock-number"; return $"clock-number";
} }

@ -50,10 +50,10 @@ public partial class Timeline : ItemsControlBase<TimelineItem>
protected string Classnames => protected string Classnames =>
new CssBuilder("timeline") new CssBuilder("timeline")
.AddClass($"timeline-{TimelineOrientation.ToDescriptionString()}") .AddClass($"timeline-{TimelineOrientation.ToDescription()}")
.AddClass($"timeline-position-{ConvertTimelinePosition().ToDescriptionString()}") .AddClass($"timeline-position-{ConvertTimelinePosition().ToDescription()}")
.AddClass($"timeline-reverse", Reverse && TimelinePosition == TimelinePosition.Alternate) .AddClass($"timeline-reverse", Reverse && TimelinePosition == TimelinePosition.Alternate)
.AddClass($"timeline-align-{TimelineAlign.ToDescriptionString()}") .AddClass($"timeline-align-{TimelineAlign.ToDescription()}")
.AddClass($"timeline-modifiers", !DisableModifiers) .AddClass($"timeline-modifiers", !DisableModifiers)
.AddClass($"timeline-rtl", RightToLeft) .AddClass($"timeline-rtl", RightToLeft)
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)

@ -14,26 +14,26 @@ public partial class TimelineItem : UIComponent, IDisposable
{ {
protected string Classnames => protected string Classnames =>
new CssBuilder("timeline-item") new CssBuilder("timeline-item")
.AddClass($"timeline-item-{TimelineAlign.ToDescriptionString()}") .AddClass($"timeline-item-{TimelineAlign.ToDescription()}")
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)
.Build(); .Build();
protected string DotClassnames => protected string DotClassnames =>
new CssBuilder("timeline-item-dot") new CssBuilder("timeline-item-dot")
.AddClass($"timeline-dot-size-{Size.ToDescriptionString()}") .AddClass($"timeline-dot-size-{Size.ToDescription()}")
.AddClass($"elevation-{Elevation.ToString()}") .AddClass($"elevation-{Elevation.ToString()}")
.Build(); .Build();
protected string DotInnerClassnames => protected string DotInnerClassnames =>
new CssBuilder("timeline-item-dot-inner") new CssBuilder("timeline-item-dot-inner")
.AddClass($"timeline-dot-fill", Variant == Variant.Filled) .AddClass($"timeline-dot-fill", Variant == Variant.Filled)
.AddClass($"timeline-dot-{Color.ToDescriptionString()}") .AddClass($"timeline-dot-{Color.ToDescription()}")
.Build(); .Build();
[CascadingParameter] protected internal ItemsControlBase<TimelineItem> Parent { get; set; } [CascadingParameter] protected internal ItemsControlBase<TimelineItem> Parent { get; set; }
/// <summary> /// <summary>
/// Dot Icon /// Dot Glyph
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.Timeline.Dot)] [Category(CategoryTypes.Timeline.Dot)]

@ -16,10 +16,10 @@ public partial class Tooltip : UIComponent
protected string Classname => new CssBuilder("tooltip") protected string Classname => new CssBuilder("tooltip")
.AddClass($"tooltip-default", Color == ThemeColor.Default) .AddClass($"tooltip-default", Color == ThemeColor.Default)
.AddClass($"tooltip-{ConvertPlacement().ToDescriptionString()}") .AddClass($"tooltip-{ConvertPlacement().ToDescription()}")
.AddClass($"tooltip-arrow", Arrow) .AddClass($"tooltip-arrow", Arrow)
.AddClass($"border-{Color.ToDescriptionString()}", Arrow && Color != ThemeColor.Default) .AddClass($"border-{Color.ToDescription()}", Arrow && Color != ThemeColor.Default)
.AddClass($"theme-{Color.ToDescriptionString()}", Color != ThemeColor.Default) .AddClass($"theme-{Color.ToDescription()}", Color != ThemeColor.Default)
.AddClass($"d-block", TooltipContent != null) .AddClass($"d-block", TooltipContent != null)
.AddClass($"d-flex", !String.IsNullOrEmpty(Text)) .AddClass($"d-flex", !String.IsNullOrEmpty(Text))
.Build(); .Build();

@ -16,8 +16,8 @@ public partial class TreeView<T> : UIComponent
new CssBuilder("treeview") new CssBuilder("treeview")
.AddClass("treeview-dense", Dense) .AddClass("treeview-dense", Dense)
.AddClass("treeview-hover", Hover) .AddClass("treeview-hover", Hover)
.AddClass($"treeview-selected-{Color.ToDescriptionString()}") .AddClass($"treeview-selected-{Color.ToDescription()}")
.AddClass($"treeview-checked-{CheckBoxColor.ToDescriptionString()}") .AddClass($"treeview-checked-{CheckBoxColor.ToDescription()}")
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)
.Build(); .Build();
protected string Stylename => protected string Stylename =>

@ -184,7 +184,7 @@ public partial class TreeViewItem<T> : UIComponent
} }
/// <summary> /// <summary>
/// Icon placed before the text if set. /// Glyph placed before the text if set.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.TreeView.Behavior)] [Category(CategoryTypes.TreeView.Behavior)]
@ -198,7 +198,7 @@ public partial class TreeViewItem<T> : UIComponent
public ThemeColor IconColor { get; set; } = ThemeColor.Default; public ThemeColor IconColor { get; set; } = ThemeColor.Default;
/// <summary> /// <summary>
/// Icon placed after the text if set. /// Glyph placed after the text if set.
/// </summary> /// </summary>
[Parameter] [Parameter]
[Category(CategoryTypes.TreeView.Behavior)] [Category(CategoryTypes.TreeView.Behavior)]

@ -9,10 +9,10 @@ public partial class TextContent : UIComponent
{ {
protected string Classname => protected string Classname =>
new CssBuilder("typography") new CssBuilder("typography")
.AddClass($"typography-{Typo.ToDescriptionString()}") .AddClass($"typography-{Typo.ToDescription()}")
.AddClass($"{Color.ToDescriptionString()}-text", Color != ThemeColor.Default && Color != ThemeColor.Inherit) .AddClass($"{Color.ToDescription()}-text", Color != ThemeColor.Default && Color != ThemeColor.Inherit)
.AddClass("typography-gutterbottom", GutterBottom) .AddClass("typography-gutterbottom", GutterBottom)
.AddClass($"typography-align-{ConvertAlign(Align).ToDescriptionString()}", Align != Align.Inherit) .AddClass($"typography-align-{ConvertAlign(Align).ToDescription()}", Align != Align.Inherit)
.AddClass("typography-display-inline", Inline) .AddClass("typography-display-inline", Inline)
.AddClass(AdditionalClassList) .AddClass(AdditionalClassList)
.Build(); .Build();

@ -4,7 +4,7 @@ namespace Connected.Extensions;
public static class EnumExtensions public static class EnumExtensions
{ {
public static string? ToDescriptionString(this Enum value) public static string? ToDescription(this Enum value)
{ {
if (value is null) if (value is null)
return null; return null;

@ -39,7 +39,7 @@ namespace Connected
/// <param name="behavior">smooth or auto</param> /// <param name="behavior">smooth or auto</param>
/// <returns></returns> /// <returns></returns>
public ValueTask ScrollToAsync(string id, int left, int top, ScrollBehavior behavior) => public ValueTask ScrollToAsync(string id, int left, int top, ScrollBehavior behavior) =>
_jSRuntime.InvokeVoidAsync("scrollManager.scrollTo", id, left, top, behavior.ToDescriptionString()); _jSRuntime.InvokeVoidAsync("scrollManager.scrollTo", id, left, top, behavior.ToDescription());
/// <summary> /// <summary>
/// Scrolls the first instance of the selector into view /// Scrolls the first instance of the selector into view
@ -48,7 +48,7 @@ namespace Connected
/// <param name="behavior"></param> /// <param name="behavior"></param>
/// <returns></returns> /// <returns></returns>
public ValueTask ScrollIntoViewAsync(string selector, ScrollBehavior behavior) => public ValueTask ScrollIntoViewAsync(string selector, ScrollBehavior behavior) =>
_jSRuntime.InvokeVoidAsync("scrollManager.scrollIntoView", selector, behavior.ToDescriptionString()); _jSRuntime.InvokeVoidAsync("scrollManager.scrollIntoView", selector, behavior.ToDescription());
/// <summary> /// <summary>
/// Scrolls to the top of the element /// Scrolls to the top of the element
@ -73,7 +73,7 @@ namespace Connected
/// <param name="behavior">smooth or auto</param> /// <param name="behavior">smooth or auto</param>
/// <returns></returns> /// <returns></returns>
public ValueTask ScrollToBottomAsync(string id, ScrollBehavior behavior) => public ValueTask ScrollToBottomAsync(string id, ScrollBehavior behavior) =>
_jSRuntime.InvokeVoidAsync("scrollManager.scrollToBottom", id, behavior.ToDescriptionString()); _jSRuntime.InvokeVoidAsync("scrollManager.scrollToBottom", id, behavior.ToDescription());
public ValueTask ScrollToYearAsync(string elementId) => public ValueTask ScrollToYearAsync(string elementId) =>
_jSRuntime.InvokeVoidAsync("scrollManager.scrollToYear", elementId); _jSRuntime.InvokeVoidAsync("scrollManager.scrollToYear", elementId);

@ -1,5 +1,4 @@
 .badge-root {
.badge-root {
position: relative; position: relative;
display: inline-block; display: inline-block;

Loading…
Cancel
Save