diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Navs/Pivot/BitPivot.razor.cs b/src/BlazorUI/Bit.BlazorUI/Components/Navs/Pivot/BitPivot.razor.cs index 16c9664879..87d5a17350 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Navs/Pivot/BitPivot.razor.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/Navs/Pivot/BitPivot.razor.cs @@ -7,6 +7,12 @@ public partial class BitPivot : BitComponentBase + /// + /// Determines the alignment of the header section of the pivot. + /// + [Parameter, ResetStyleBuilder] + public BitAlignment? Alignment { get; set; } + /// /// The content of pivot, It can be Any custom tag /// @@ -106,6 +112,19 @@ protected override void RegisterCssClasses() protected override void RegisterCssStyles() { StyleBuilder.Register(() => Styles?.Root); + + StyleBuilder.Register(() => Alignment switch + { + BitAlignment.Start => "--bit-pvt-hal:flex-start", + BitAlignment.End => "--bit-pvt-hal:flex-end", + BitAlignment.Center => "--bit-pvt-hal:center", + BitAlignment.SpaceBetween => "--bit-pvt-hal:space-between", + BitAlignment.SpaceAround => "--bit-pvt-hal:space-around", + BitAlignment.SpaceEvenly => "--bit-pvt-hal:space-evenly", + BitAlignment.Baseline => "--bit-pvt-hal:baseline", + BitAlignment.Stretch => "--bit-pvt-hal:stretch", + _ => "--bit-pvt-hal:flex-start" + }); } protected override async Task OnInitializedAsync() diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Navs/Pivot/BitPivot.scss b/src/BlazorUI/Bit.BlazorUI/Components/Navs/Pivot/BitPivot.scss index 845153d779..b56e20fe53 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Navs/Pivot/BitPivot.scss +++ b/src/BlazorUI/Bit.BlazorUI/Components/Navs/Pivot/BitPivot.scss @@ -25,6 +25,7 @@ .bit-pvt-hct { display: flex; white-space: nowrap; + justify-content: var(--bit-pvt-hal); * { font-size: spacing(2); diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Navs/Pivot/BitPivotDemo.razor b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Navs/Pivot/BitPivotDemo.razor index 5aab40eda0..39d1d6c603 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Navs/Pivot/BitPivotDemo.razor +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Navs/Pivot/BitPivotDemo.razor @@ -340,7 +340,32 @@ - + + + + +
+

Pivot #1

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras eu ligula quis orci accumsan pharetra. Fusce mattis sit amet enim vitae imperdiet. Maecenas hendrerit sapien nisl, quis consectetur mi bibendum vel. Pellentesque vel rhoncus quam, non bibendum arcu. Vivamus euismod tellus non felis finibus, dictum finibus eros elementum. Vivamus a massa sit amet leo volutpat blandit at vel tortor. Praesent posuere, nulla eu tempus accumsan, nibh elit rhoncus mauris, eu semper tellus risus et nisi. Duis felis ipsum, luctus eget ultrices sit amet, scelerisque quis metus.

+
+
+ +
+

Pivot #2

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras eu ligula quis orci accumsan pharetra.

+
+
+ +
+

Pivot #3

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras eu ligula quis orci accumsan pharetra. Fusce mattis sit amet enim vitae imperdiet. Maecenas hendrerit sapien nisl, quis consectetur mi bibendum vel. Pellentesque vel rhoncus quam, non bibendum arcu. Vivamus euismod tellus non felis finibus, dictum finibus eros elementum. Vivamus a massa sit amet leo volutpat blandit at vel tortor. Praesent posuere, nulla eu tempus accumsan, nibh elit rhoncus mauris, eu semper tellus risus et nisi. Duis felis ipsum, luctus eget ultrices sit amet, scelerisque quis metus.
Suspendisse blandit erat ac lobortis pulvinar. Donec nunc leo, tempus sit amet accumsan in, sagittis sed odio. Pellentesque tristique felis sed purus pellentesque, ac dictum ex fringilla. Integer a tincidunt eros, non porttitor turpis. Sed gravida felis massa, in viverra massa aliquam sit amet. Etiam vitae dolor in velit sodales tristique id nec turpis. Proin sit amet urna sollicitudin, malesuada enim et, lacinia mi. Fusce nisl massa, efficitur sit amet elementum convallis, porttitor vel turpis. Fusce congue dui sit amet mollis pulvinar. Suspendisse vulputate leo quis nunc tincidunt, nec dictum risus congue.

+
+
+
+
+
+ +
Pivot Position: Top
@@ -440,7 +465,7 @@ - + Toggle Pivot's IsEnabled Toggle Pivot Item's IsEnabled @@ -467,7 +492,7 @@ - +
Component's Style & Class:
@@ -561,7 +586,7 @@ - + diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Navs/Pivot/BitPivotDemo.razor.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Navs/Pivot/BitPivotDemo.razor.cs index fd7ad18632..9d2e0aa896 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Navs/Pivot/BitPivotDemo.razor.cs +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Navs/Pivot/BitPivotDemo.razor.cs @@ -4,6 +4,15 @@ public partial class BitPivotDemo { private readonly List componentParameters = [ + new() + { + Name = "Alignment", + Type = "BitAlignment?", + DefaultValue = "null", + Description = "Determines the alignment of the header section of the pivot.", + LinkType = LinkType.Link, + Href = "#alignment-enum", + }, new() { Name = "ChildContent", @@ -17,8 +26,8 @@ public partial class BitPivotDemo Type = "BitPivotClassStyles?", DefaultValue = "null", Description = "Custom CSS classes for different parts of the BitPivot component.", + LinkType = LinkType.Link, Href = "#pivot-class-styles", - LinkType = LinkType.Link }, new() { @@ -237,6 +246,55 @@ public partial class BitPivotDemo private readonly List componentSubEnums = [ + new() + { + Id = "alignment-enum", + Name = "BitAlignment", + Description = "", + Items = + [ + new() + { + Name = "Start", + Value = "0", + }, + new() + { + Name = "End", + Value = "1", + }, + new() + { + Name = "Center", + Value = "2", + }, + new() + { + Name = "SpaceBetween", + Value = "3", + }, + new() + { + Name = "SpaceAround", + Value = "4", + }, + new() + { + Name = "SpaceEvenly", + Value = "5", + }, + new() + { + Name = "Baseline", + Value = "6", + }, + new() + { + Name = "Stretch", + Value = "7", + } + ] + }, new() { Id = "linkFormat-enum", @@ -667,6 +725,28 @@ private void TogglePivotItemVisibility() "; private readonly string example11RazorCode = @" + + +
+

Pivot #1

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras eu ligula quis orci accumsan pharetra. Fusce mattis sit amet enim vitae imperdiet. Maecenas hendrerit sapien nisl, quis consectetur mi bibendum vel. Pellentesque vel rhoncus quam, non bibendum arcu. Vivamus euismod tellus non felis finibus, dictum finibus eros elementum. Vivamus a massa sit amet leo volutpat blandit at vel tortor. Praesent posuere, nulla eu tempus accumsan, nibh elit rhoncus mauris, eu semper tellus risus et nisi. Duis felis ipsum, luctus eget ultrices sit amet, scelerisque quis metus.

+
+
+ +
+

Pivot #2

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras eu ligula quis orci accumsan pharetra.

+
+
+ +
+

Pivot #3

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras eu ligula quis orci accumsan pharetra. Fusce mattis sit amet enim vitae imperdiet. Maecenas hendrerit sapien nisl, quis consectetur mi bibendum vel. Pellentesque vel rhoncus quam, non bibendum arcu. Vivamus euismod tellus non felis finibus, dictum finibus eros elementum. Vivamus a massa sit amet leo volutpat blandit at vel tortor. Praesent posuere, nulla eu tempus accumsan, nibh elit rhoncus mauris, eu semper tellus risus et nisi. Duis felis ipsum, luctus eget ultrices sit amet, scelerisque quis metus.
Suspendisse blandit erat ac lobortis pulvinar. Donec nunc leo, tempus sit amet accumsan in, sagittis sed odio. Pellentesque tristique felis sed purus pellentesque, ac dictum ex fringilla. Integer a tincidunt eros, non porttitor turpis. Sed gravida felis massa, in viverra massa aliquam sit amet. Etiam vitae dolor in velit sodales tristique id nec turpis. Proin sit amet urna sollicitudin, malesuada enim et, lacinia mi. Fusce nisl massa, efficitur sit amet elementum convallis, porttitor vel turpis. Fusce congue dui sit amet mollis pulvinar. Suspendisse vulputate leo quis nunc tincidunt, nec dictum risus congue.

+
+
+
"; + + private readonly string example12RazorCode = @"