|
|
@ -1,36 +1,54 @@
|
|
|
|
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;
|
|
|
|
public partial class Container : UIComponent
|
|
|
|
public partial class Container : UIComponent
|
|
|
|
{
|
|
|
|
{
|
|
|
|
protected string Classname =>
|
|
|
|
|
|
|
|
new CssBuilder("container")
|
|
|
|
#region Event callbacks
|
|
|
|
.AddClass($"container-fixed", Fixed)
|
|
|
|
#endregion
|
|
|
|
.AddClass($"container-maxwidth-{MaxWidth.ToDescription()}", !Fixed)
|
|
|
|
|
|
|
|
.AddClass(AdditionalClassList)
|
|
|
|
#region Content placeholders
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Set the max-width to match the min-width of the current breakpoint. This is useful if you'd prefer to design for a fixed set of sizes instead of trying to accommodate a fully fluid viewport. It's fluid by default.
|
|
|
|
/// Child content of component.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[Parameter]
|
|
|
|
[Parameter]
|
|
|
|
[Category(CategoryTypes.Container.Behavior)]
|
|
|
|
public RenderFragment ChildContent { get; set; }
|
|
|
|
public bool Fixed { get; set; } = false;
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region Styling properties
|
|
|
|
|
|
|
|
private CssBuilder CompiledClassList
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return new CssBuilder("container")
|
|
|
|
|
|
|
|
.AddClass(ClassList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected StyleBuilder CompiledStyleList
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return new StyleBuilder()
|
|
|
|
|
|
|
|
.AddStyle(StyleList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Determine the max-width of the container. The container width grows with the size of the screen. Set to false to disable maxWidth.
|
|
|
|
/// A space separated list of class names, added on top of the default class list.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[Parameter]
|
|
|
|
[Parameter]
|
|
|
|
[Category(CategoryTypes.Container.Behavior)]
|
|
|
|
public string? ClassList { get; set; }
|
|
|
|
public MaxWidth MaxWidth { get; set; } = MaxWidth.Large;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Child content of component.
|
|
|
|
/// A space separated list of class names, added on top of the default class list.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[Parameter]
|
|
|
|
[Parameter]
|
|
|
|
[Category(CategoryTypes.Container.Behavior)]
|
|
|
|
public string? StyleList { get; set; }
|
|
|
|
public RenderFragment ChildContent { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
}
|
|
|
|