diff --git a/BlazorBootstrap.Demo.RCL/Components/Layout/EmptyLayout.razor b/BlazorBootstrap.Demo.RCL/Components/Layout/EmptyLayout.razor index 3167f32d0..a08295da0 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Layout/EmptyLayout.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Layout/EmptyLayout.razor @@ -31,34 +31,34 @@

diff --git a/BlazorBootstrap.Demo.RCL/Components/Layout/MainLayout.razor.cs b/BlazorBootstrap.Demo.RCL/Components/Layout/MainLayout.razor.cs index e076eb178..b68b2a24f 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Layout/MainLayout.razor.cs +++ b/BlazorBootstrap.Demo.RCL/Components/Layout/MainLayout.razor.cs @@ -2,9 +2,9 @@ public partial class MainLayout : MainLayoutBase { - internal override IEnumerable GetNavItems() + internal override IReadOnlyCollection GetNavItems() { - navItems ??= new List + NavItems ??= new List { new (){ Id = "1", Text = "Getting Started", Href = "/getting-started", IconName = IconName.HouseDoorFill }, @@ -15,6 +15,7 @@ internal override IEnumerable GetNavItems() new (){ Id = "3", Text = "Content", IconName = IconName.BodyText, IconColor = IconColor.Primary }, new (){ Id = "300", Text = "Icons", Href = "/icons", IconName = IconName.PersonSquare, ParentId = "3" }, new (){ Id = "301", Text = "Images", Href = "/images", IconName = IconName.Image, ParentId = "3" }, + new (){ Id = "302", Text = "CSS Generator", Href = "/customcss", IconName = IconName.WrenchAdjustableCircle, ParentId = "3" }, new (){ Id = "4", Text = "Forms", IconName = IconName.InputCursorText, IconColor = IconColor.Success }, new (){ Id = "400", Text = "Auto Complete", Href = "/form/autocomplete", IconName = IconName.InputCursorText, ParentId = "4" }, @@ -97,7 +98,7 @@ internal override IEnumerable GetNavItems() new (){ Id = "1900", Text = "Color Utility", Href = "/utils/color-utility", IconName = IconName.Palette2, ParentId = "19" }, }; - return navItems; + return NavItems; } private async ValueTask OnThemeChanged(string themeName) diff --git a/BlazorBootstrap.Demo.RCL/Components/Layout/MainLayoutBase.cs b/BlazorBootstrap.Demo.RCL/Components/Layout/MainLayoutBase.cs index 68ae5a072..affeaa18f 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Layout/MainLayoutBase.cs +++ b/BlazorBootstrap.Demo.RCL/Components/Layout/MainLayoutBase.cs @@ -1,21 +1,11 @@ -namespace BlazorBootstrap.Demo.RCL; +using System.Runtime.InteropServices; + +namespace BlazorBootstrap.Demo.RCL; public class MainLayoutBase : LayoutComponentBase { - internal string version = default!; - internal string dotNetVersion = default!; - internal string docsUrl = default!; - internal string blogUrl = default!; - internal string githubUrl = default!; - internal string twitterUrl = default!; - internal string linkedInUrl = default!; - internal string openCollectiveUrl = default!; - internal string githubIssuesUrl = default!; - internal string githubDiscussionsUrl = default!; - internal string stackoverflowUrl = default!; - internal Sidebar2 sidebar2 = default!; - internal IEnumerable navItems = default!; + internal IReadOnlyCollection? NavItems; [Inject] public IConfiguration Configuration { get; set; } = default!; @@ -23,39 +13,44 @@ public class MainLayoutBase : LayoutComponentBase protected override void OnInitialized() { - version = $"v{Configuration["version"]}"; // example: v0.6.1 - dotNetVersion = $".NET {Configuration["dotNetVersion"]}"; // example: 9.0.0 - docsUrl = $"{Configuration["urls:docs"]}"; - blogUrl = $"{Configuration["urls:blog"]}"; - githubUrl = $"{Configuration["urls:github"]}"; - twitterUrl = $"{Configuration["urls:twitter"]}"; - linkedInUrl = $"{Configuration["urls:linkedin"]}"; - openCollectiveUrl = $"{Configuration["urls:opencollective"]}"; - githubIssuesUrl = $"{Configuration["urls:github_issues"]}"; - githubDiscussionsUrl = $"{Configuration["urls:github_discussions"]}"; - stackoverflowUrl = $"{Configuration["urls:stackoverflow"]}"; + Version = $"v{Configuration["version"]}"; // example: v0.6.1 + DocsUrl = $"{Configuration["urls:docs"]}"; + BlogUrl = $"{Configuration["urls:blog"]}"; + GithubUrl = $"{Configuration["urls:github"]}"; + TwitterUrl = $"{Configuration["urls:twitter"]}"; + LinkedInUrl = $"{Configuration["urls:linkedin"]}"; + OpenCollectiveUrl = $"{Configuration["urls:opencollective"]}"; + GithubIssuesUrl = $"{Configuration["urls:github_issues"]}"; + GithubDiscussionsUrl = $"{Configuration["urls:github_discussions"]}"; + StackoverflowUrl = $"{Configuration["urls:stackoverflow"]}"; base.OnInitialized(); } - internal virtual async Task Sidebar2DataProvider(Sidebar2DataProviderRequest request) + internal virtual Task Sidebar2DataProvider() { - if (navItems is null) - navItems = GetNavItems(); - - return await Task.FromResult(request.ApplyTo(navItems)); + return Task.FromResult(Sidebar2DataProviderRequest.ApplyTo(NavItems)); } + internal virtual IReadOnlyCollection GetNavItems() => new List(); + + public string Version { get; private set; } = default!; + + public string DocsUrl { get; private set; } = default!; + + public string BlogUrl { get; private set; } = default!; + + public string GithubUrl { get; private set; } = default!; + + public string TwitterUrl { get; private set; } = default!; + + public string LinkedInUrl { get; private set; } = default!; + + public string OpenCollectiveUrl { get; private set; } = default!; + + public string GithubIssuesUrl { get; private set; } = default!; + + public string GithubDiscussionsUrl { get; private set; } = default!; - internal virtual IEnumerable GetNavItems() => new List(); - - public string Version => version; - public string DotNetVersion => dotNetVersion; - public string DocsUrl => docsUrl; - public string BlogUrl => blogUrl; - public string GithubUrl => githubUrl; - public string TwitterUrl => twitterUrl; - public string LinkedInUrl => linkedInUrl; - public string OpenCollectiveUrl => openCollectiveUrl; - public string GithubIssuesUrl => githubIssuesUrl; - public string GithubDiscussionsUrl => githubDiscussionsUrl; - public string StackoverflowUrl => stackoverflowUrl; + public string StackoverflowUrl { get; private set; } = default!; + + public string DotNetVersion => RuntimeInformation.FrameworkDescription; } diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/AI/AIChat/AIChatDocumentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/AI/AIChat/AIChatDocumentation.razor deleted file mode 100644 index fffd2c360..000000000 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/AI/AIChat/AIChatDocumentation.razor +++ /dev/null @@ -1,26 +0,0 @@ -@attribute [Route(pageUrl)] - - - - - @pageDescription - - - - -
-
Alerts are available for any length of text, as well as an optional close button. For proper styling, use one of the eight colors.
- -
- -@code{ - private const string pageUrl = RouteConstants.Demos_AI_Chat_Documentation; - private const string pageTitle = "Blazor Open AI Chat Component"; - private const string pageDescription = "Provide contextual feedback messages for typical user actions with the handful of available and flexible Blazor Bootstrap alert messages."; // TODO: update - private const string metaTitle = "Blazor Open AI Chat Component"; - private const string metaDescription = "Provide contextual feedback messages for typical user actions with the handful of available and flexible Blazor Bootstrap alert messages."; // TODO: update - private const string imageUrl = "https://i.imgur.com/FGgEMp6.jpg"; // TODO: update -} \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/AI/AIChat/AIChat_Demo_01_Examples.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/AI/AIChat/AIChat_Demo_01_Examples.razor deleted file mode 100644 index a9cdd295b..000000000 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/AI/AIChat/AIChat_Demo_01_Examples.razor +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_01_Examples.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_01_Examples.razor index 0303a22e2..309aeadc1 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_01_Examples.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_01_Examples.razor @@ -1,17 +1,11 @@  - - This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - - This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - - This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_02_Title_with_Icon.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_02_Title_with_Icon.razor index 743460343..8c28d4ec7 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_02_Title_with_Icon.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_02_Title_with_Icon.razor @@ -3,24 +3,24 @@ Accordion Item #1 - + This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + Accordion Item #2 - + This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + Accordion Item #3 - + This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_03_Flush.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_03_Flush.razor index b75355408..ba3523a35 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_03_Flush.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_03_Flush.razor @@ -1,17 +1,11 @@  - - This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - - This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - - This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_04_Set_Default_Active.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_04_Set_Default_Active.razor index 2a16b6977..48c342bc9 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_04_Set_Default_Active.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_04_Set_Default_Active.razor @@ -1,17 +1,11 @@  - - This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - - This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - - This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_05_Always_Open.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_05_Always_Open.razor index fdcbf5994..df78e139c 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_05_Always_Open.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_05_Always_Open.razor @@ -1,17 +1,11 @@  - - This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - - This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - - This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_06_Show_Hide_Individual_AccordionItems.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_06_Show_Hide_Individual_AccordionItems.razor index 4af9addc6..7ee56c19a 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_06_Show_Hide_Individual_AccordionItems.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_06_Show_Hide_Individual_AccordionItems.razor @@ -1,33 +1,21 @@  - - This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - - This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - - This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - - This is the fourth item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the fourth item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - - This is the fifth item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the fifth item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - - This is the sixth item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the sixth item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. @@ -52,16 +40,16 @@ @code { private Accordion accordion1 = default!; - private async Task ShowFirstAccordionItemAsync() => await accordion1.ShowFirstAccordionItemAsync(); - private async Task ShowSecondAccordionItemAsync() => await accordion1.ShowAccordionItemByIndexAsync(1); - private async Task ShowThirdAccordionItemAsync() => await accordion1.ShowAccordionItemByIndexAsync(2); - private async Task ShowProductsAccordionItemAsync() => await accordion1.ShowAccordionItemByNameAsync("Products"); - private async Task ShowFaqsAccordionItemAsync() => await accordion1.ShowAccordionItemByNameAsync("FAQ"); - private async Task ShowLastAccordionItemAsync() => await accordion1.ShowLastAccordionItemAsync(); - private async Task HideFirstAccordionItemAsync() => await accordion1.HideFirstAccordionItemAsync(); - private async Task HideSecondAccordionItemAsync() => await accordion1.HideAccordionItemByIndexAsync(1); - private async Task HideThirdAccordionItemAsync() => await accordion1.HideAccordionItemByIndexAsync(2); - private async Task HideProductsAccordionItemAsync() => await accordion1.HideAccordionItemByNameAsync("Products"); - private async Task HideFaqsAccordionItemAsync() => await accordion1.HideAccordionItemByNameAsync("FAQ"); - private async Task HideLastAccordionItemAsync() => await accordion1.HideLastAccordionItemAsync(); + private Task ShowFirstAccordionItemAsync() => accordion1.ShowFirstAccordionItemAsync(); + private Task ShowSecondAccordionItemAsync() => accordion1.ShowAccordionItemByIndexAsync(1); + private Task ShowThirdAccordionItemAsync() => accordion1.ShowAccordionItemByIndexAsync(2); + private Task ShowProductsAccordionItemAsync() => accordion1.ShowAccordionItemByNameAsync("Products"); + private Task ShowFaqsAccordionItemAsync() => accordion1.ShowAccordionItemByNameAsync("FAQ"); + private Task ShowLastAccordionItemAsync() => accordion1.ShowLastAccordionItemAsync(); + private Task HideFirstAccordionItemAsync() => accordion1.HideFirstAccordionItemAsync(); + private Task HideSecondAccordionItemAsync() => accordion1.HideAccordionItemByIndexAsync(1); + private Task HideThirdAccordionItemAsync() => accordion1.HideAccordionItemByIndexAsync(2); + private Task HideProductsAccordionItemAsync() => accordion1.HideAccordionItemByNameAsync("Products"); + private Task HideFaqsAccordionItemAsync() => accordion1.HideAccordionItemByNameAsync("FAQ"); + private Task HideLastAccordionItemAsync() => accordion1.HideLastAccordionItemAsync(); } \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_07_Show_Hide_All_AccordionItems.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_07_Show_Hide_All_AccordionItems.razor index 9a4400721..734553afd 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_07_Show_Hide_All_AccordionItems.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_07_Show_Hide_All_AccordionItems.razor @@ -1,18 +1,12 @@  - - This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - - This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - - This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - + This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_08_Events.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_08_Events.razor index e6ecffb83..b93c69eb1 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_08_Events.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Accordion/Accordion_Demo_08_Events.razor @@ -4,19 +4,13 @@ OnHiding="OnHidingAsync" OnHidden="OnHiddenAsync"> - This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - - This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - - This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. - diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Alerts/Alert_Demo_04_Icons.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Alerts/Alert_Demo_04_Icons.razor index ac84b153b..527f8fd61 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Alerts/Alert_Demo_04_Icons.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Alerts/Alert_Demo_04_Icons.razor @@ -1,4 +1,4 @@ - An example alert with an icon - A simple success alert with an icon - A simple danger alert with an icon - A simple warning alert with an icon \ No newline at end of file + An example alert with an icon + A simple success alert with an icon + A simple danger alert with an icon + A simple warning alert with an icon \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Alerts/Alert_Demo_05_Dismissing_B.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Alerts/Alert_Demo_05_Dismissing_B.razor index a3b750be8..429e2c5cb 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Alerts/Alert_Demo_05_Dismissing_B.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Alerts/Alert_Demo_05_Dismissing_B.razor @@ -1,8 +1,7 @@  - Holy guacamole! You should check in on some of those fields below. + Holy guacamole! You should check in on some of those fields below. @code { Alert warningAlert = default!; - private async Task CloseAlert() => await warningAlert.CloseAsync(); } diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Alerts/Alert_Demo_06_Switch_Alert_Type_Dynamically.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Alerts/Alert_Demo_06_Switch_Alert_Type_Dynamically.razor index b354a3680..0957c76c0 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Alerts/Alert_Demo_06_Switch_Alert_Type_Dynamically.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Alerts/Alert_Demo_06_Switch_Alert_Type_Dynamically.razor @@ -1,4 +1,4 @@ - @alertMessage + @alertMessage diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Buttons/Button_Demo_08_Show_Hide_Loading_Spinner.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Buttons/Button_Demo_08_Show_Hide_Loading_Spinner.razor index 636ccf9d5..f0c0eb80e 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Buttons/Button_Demo_08_Show_Hide_Loading_Spinner.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Buttons/Button_Demo_08_Show_Hide_Loading_Spinner.razor @@ -1,17 +1,17 @@  @code { private Button saveButton1 = default!, saveButton2 = default!, saveButton3 = default!, saveButton4 = default!, saveButton5 = default!; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_02_Horizontal_BarChart.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_02_Horizontal_BarChart.razor index 948bf9ce0..b608a57ff 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_02_Horizontal_BarChart.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_02_Horizontal_BarChart.razor @@ -19,16 +19,27 @@ }; datasets.Add(dataset1); - chartData = new ChartData { Labels = labels, Datasets = datasets }; + chartData = new ChartData { + Labels = labels, + Datasets = datasets, + }; barChartOptions = new BarChartOptions(); barChartOptions.Responsive = true; barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Y }; barChartOptions.IndexAxis = "y"; - - barChartOptions.Scales.X!.Title = new ChartAxesTitle { Text = "Visitors", Display = true }; - barChartOptions.Scales.Y!.Title = new ChartAxesTitle { Text = "Browser", Display = true }; - + barChartOptions.Scales = new Scales + { + X = new ChartAxes() + { + Title = new ChartAxesTitle() { Text = "Visitors", Display = true } + }, + Y = new ChartAxes() + { + Title = new ChartAxesTitle() { Text = "Browser", Display = true } + }, + }; + barChartOptions.Plugins.Legend.Display = false; } diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_03_Stacked_BarChart.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_03_Stacked_BarChart.razor index 83b824549..3f4b7e3af 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_03_Stacked_BarChart.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_03_Stacked_BarChart.razor @@ -48,12 +48,19 @@ barChartOptions.Responsive = true; barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Y }; barChartOptions.IndexAxis = "y"; - - barChartOptions.Scales.X!.Title = new ChartAxesTitle { Text = "Visitors", Display = true }; - barChartOptions.Scales.Y!.Title = new ChartAxesTitle { Text = "Browser", Display = true }; - - barChartOptions.Scales.X.Stacked = true; - barChartOptions.Scales.Y.Stacked = true; + barChartOptions.Scales = new Scales + { + X = new ChartAxes() + { + Stacked = true, + Title = new ChartAxesTitle() { Text = "Visitors", Display = true } + }, + Y = new ChartAxes() + { + Stacked = true, + Title = new ChartAxesTitle() { Text = "Browser", Display = true } + }, + }; barChartOptions.Plugins.Title!.Text = "Operating system"; barChartOptions.Plugins.Title.Display = true; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_04_Locale.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_04_Locale.razor index c28f87227..14bc034b0 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_04_Locale.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_04_Locale.razor @@ -49,12 +49,20 @@ barChartOptions.Responsive = true; barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Y }; barChartOptions.IndexAxis = "y"; - - barChartOptions.Scales.X!.Title = new ChartAxesTitle { Text = "Visitors", Display = true }; - barChartOptions.Scales.Y!.Title = new ChartAxesTitle { Text = "Browser", Display = true }; - - barChartOptions.Scales.X.Stacked = true; - barChartOptions.Scales.Y.Stacked = true; + + barChartOptions.Scales = new Scales + { + X = new ChartAxes() + { + Stacked = true, + Title = new ChartAxesTitle() { Text = "Visitors", Display = true } + }, + Y = new ChartAxes() + { + Stacked = true, + Title = new ChartAxesTitle() { Text = "Browser", Display = true } + }, + }; barChartOptions.Plugins.Title!.Text = "Operating system"; barChartOptions.Plugins.Title.Display = true; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_05_Stacked_BarChart_with_Datalabels.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_05_Stacked_BarChart_with_Datalabels.razor index a0f29f319..2b1be3ce5 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_05_Stacked_BarChart_with_Datalabels.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/BarCharts/BarChart_Demo_05_Stacked_BarChart_with_Datalabels.razor @@ -52,15 +52,24 @@ barChartOptions.Responsive = true; barChartOptions.Interaction = new Interaction { Mode = InteractionMode.Y }; barChartOptions.IndexAxis = "y"; - - barChartOptions.Scales.X!.Title = new ChartAxesTitle { Text = "Visitors", Display = true }; - barChartOptions.Scales.Y!.Title = new ChartAxesTitle { Text = "Browser", Display = true }; - - barChartOptions.Scales.X.Stacked = true; - barChartOptions.Scales.Y.Stacked = true; + + barChartOptions.Scales = new Scales + { + X = new ChartAxes() + { + Stacked = true, + Title = new ChartAxesTitle() { Text = "Visitors", Display = true } + }, + Y = new ChartAxes() + { + Stacked = true, + Title = new ChartAxesTitle() { Text = "Browser", Display = true } + }, + }; barChartOptions.Plugins.Title!.Text = "Operating system"; barChartOptions.Plugins.Title.Display = true; + } protected override async Task OnAfterRenderAsync(bool firstRender) diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/Charts_Demo_00_Examples.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/Charts_Demo_00_Examples.razor index 613fe20af..6524efbf4 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/Charts_Demo_00_Examples.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/Charts_Demo_00_Examples.razor @@ -69,27 +69,27 @@ { Label = "India", Data = new List{ 9, 20, 29, 33, 50, 66, 75, 86, 91, 105, 120, 126, 141, 150, 156, 164, 177, 180, 184, 195 }, - BackgroundColor = "rgb(88, 80, 141)", - BorderColor = "rgb(88, 80, 141)", - BorderWidth = 2, - HoverBorderWidth = 4, - //PointBackgroundColor = "rgb(88, 80, 141)", - //PointBorderColor = "rgb(88, 80, 141)", - //PointRadius = 0, // hide points - //PointHoverRadius = 4, + BackgroundColor = new List{ "rgb(88, 80, 141)" }, + BorderColor = new List{ "rgb(88, 80, 141)" }, + BorderWidth = new List{2}, + HoverBorderWidth = new List{4}, + PointBackgroundColor = ["rgb(88, 80, 141)"] , + PointBorderColor = ["rgb(88, 80, 141)"] , + PointRadius = [0], // hide points + PointHoverRadius = [4], }, new LineChartDataset() { Label = "England", Data = new List{ 1, 1, 8, 19, 24, 26, 39, 47, 56, 66, 75, 88, 95, 100, 109, 114, 124, 129, 140, 142 }, - BackgroundColor = "rgb(255, 166, 0)", - BorderColor = "rgb(255, 166, 0)", - BorderWidth = 2, - HoverBorderWidth = 4, - // PointBackgroundColor = "rgb(255, 166, 0)", - // PointBorderColor = "rgb(255, 166, 0)", - // PointRadius = 0, // hide points - // PointHoverRadius = 4, + BackgroundColor = new List{ "rgb(255, 166, 0)" }, + BorderColor = new List{ "rgb(255, 166, 0)" }, + BorderWidth = new List{2}, + HoverBorderWidth = new List{4}, + PointBackgroundColor = ["rgb(255, 166, 0)"] , + PointBorderColor = ["rgb(255, 166, 0)"] , + PointRadius = [0], // hide points + PointHoverRadius = [4], } } }; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/DoughnutCharts/DoughnutChart_Demo_01_Examples.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/DoughnutCharts/DoughnutChart_Demo_01_Examples.razor index e6d4e272e..fd4e431a1 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/DoughnutCharts/DoughnutChart_Demo_01_Examples.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/DoughnutCharts/DoughnutChart_Demo_01_Examples.razor @@ -46,8 +46,7 @@ foreach (var dataset in chartData.Datasets) { if (dataset is DoughnutChartDataset doughnutChartDataset - && doughnutChartDataset is not null - && doughnutChartDataset.Data is not null) + && doughnutChartDataset?.Data != null) { var count = doughnutChartDataset.Data.Count; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_01_A_Examples.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_01_A_Examples.razor index 6a6e950d5..251b659f0 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_01_A_Examples.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_01_A_Examples.razor @@ -129,10 +129,13 @@ { Label = $"Team {datasetsCount}", Data = GetRandomData(), - BackgroundColor = c.ToRgbaString(), - BorderColor = c.ToRgbString(), - PointRadius = new List { 5 }, - PointHoverRadius = new List { 8 }, + BackgroundColor = [c.ToRgbString()], + BorderColor = [c.ToRgbString()], + BorderWidth = [2], + HoverBorderWidth = [4], + PointBackgroundColor = [c.ToRgbString()], + PointRadius = [0], // hide points + PointHoverRadius = [4], }; } diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_01_B_Examples.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_01_B_Examples.razor index ede26b2dc..a3aeed0bc 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_01_B_Examples.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_01_B_Examples.razor @@ -18,13 +18,13 @@ { Label = "Windows", Data = new List { 7265791, 5899643, 6317759, 6315641, 5338211, 8496306, 7568556, 8538933, 8274297, 8657298, 7548388, 7764845 }, - BackgroundColor = colors[0], - BorderColor = colors[0], - BorderWidth = 2, - HoverBorderWidth = 4, - // PointBackgroundColor = colors[0], - // PointRadius = 0, // hide points - // PointHoverRadius = 4, + BackgroundColor = new List { colors[0] }, + BorderColor = new List { colors[0] }, + BorderWidth = new List { 2 }, + HoverBorderWidth = new List { 4 }, + PointBackgroundColor = colors, + PointRadius = [0], // hide points + PointHoverRadius = [4] }; datasets.Add(dataset1); @@ -32,13 +32,13 @@ { Label = "macOS", Data = new List { 1809499, 1816642, 2122410, 1809499, 1850793, 1846743, 1954797, 2391313, 1983430, 2469918, 2633303, 2821149 }, - BackgroundColor = colors[1], - BorderColor = colors[1], - BorderWidth = 2, - HoverBorderWidth = 4, - // PointBackgroundColor = colors[1], - // PointRadius = 0, // hide points - // PointHoverRadius = 4, + BackgroundColor = new List { colors[1] }, + BorderColor = new List { colors[1] }, + BorderWidth = new List { 2 }, + HoverBorderWidth = new List { 4 }, + PointBackgroundColor = colors, + PointRadius = [0], // hide points + PointHoverRadius = [4] }; datasets.Add(dataset2); @@ -46,13 +46,13 @@ { Label = "Other", Data = new List { 1081241, 1100363, 1118136, 1073255, 1120315, 1395736, 1488788, 1489466, 1489947, 1414739, 1735811, 1820171 }, - BackgroundColor = colors[2], - BorderColor = colors[2], - BorderWidth = 2, - HoverBorderWidth = 4, - // PointBackgroundColor = colors[2], - // PointRadius = 0, // hide points - // PointHoverRadius = 4, + BackgroundColor = new List { colors[2] }, + BorderColor = new List { colors[2] }, + BorderWidth = new List { 2 }, + HoverBorderWidth = new List { 4 }, + PointBackgroundColor = colors, + PointRadius = [0], // hide points + PointHoverRadius = [4] }; datasets.Add(dataset3); @@ -62,8 +62,18 @@ lineChartOptions.Responsive = true; lineChartOptions.Interaction = new Interaction { Mode = InteractionMode.Index }; - lineChartOptions.Scales.X!.Title = new ChartAxesTitle { Text = "2019", Display = true }; - lineChartOptions.Scales.Y!.Title = new ChartAxesTitle { Text = "Visitors", Display = true }; + lineChartOptions.Scales = new Scales + { + X = new ChartAxes() + { + Title = new ChartAxesTitle() { Text = "Visitors", Display = true } + }, + Y = new ChartAxes() + { + Title = new ChartAxesTitle() { Text = "Browser", Display = true } + }, + }; + lineChartOptions.Plugins.Title!.Text = "Operating system"; lineChartOptions.Plugins.Title.Display = true; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_02_Locale.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_02_Locale.razor index b7f880816..f1877ab8a 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_02_Locale.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_02_Locale.razor @@ -18,13 +18,13 @@ { Label = "Windows", Data = new List { 7265791, 5899643, 6317759, 6315641, 5338211, 8496306, 7568556, 8538933, 8274297, 8657298, 7548388, 7764845 }, - BackgroundColor = colors[0], - BorderColor = colors[0], - BorderWidth = 2, - HoverBorderWidth = 4, - // PointBackgroundColor = colors[0], - // PointRadius = 0, // hide points - // PointHoverRadius = 4, + BackgroundColor = new List { colors[0] }, + BorderColor = new List { colors[0] }, + BorderWidth = new List { 2 }, + HoverBorderWidth = new List { 4 }, + PointBackgroundColor = colors, + PointRadius = [0], // hide points + PointHoverRadius = [4] }; datasets.Add(dataset1); @@ -32,13 +32,13 @@ { Label = "macOS", Data = new List { 1809499, 1816642, 2122410, 1809499, 1850793, 1846743, 1954797, 2391313, 1983430, 2469918, 2633303, 2821149 }, - BackgroundColor = colors[1], - BorderColor = colors[1], - BorderWidth = 2, - HoverBorderWidth = 4, - // PointBackgroundColor = colors[1], - // PointRadius = 0, // hide points - // PointHoverRadius = 4, + BackgroundColor = new List { colors[1] }, + BorderColor = new List { colors[1] }, + BorderWidth = new List { 2 }, + HoverBorderWidth = new List { 4 }, + PointBackgroundColor = colors, + PointRadius = [0], // hide points + PointHoverRadius = [4] }; datasets.Add(dataset2); @@ -46,13 +46,13 @@ { Label = "Other", Data = new List { 1081241, 1100363, 1118136, 1073255, 1120315, 1395736, 1488788, 1489466, 1489947, 1414739, 1735811, 1820171 }, - BackgroundColor = colors[2], - BorderColor = colors[2], - BorderWidth = 2, - HoverBorderWidth = 4, - // PointBackgroundColor = colors[2], - // PointRadius = 0, // hide points - // PointHoverRadius = 4, + BackgroundColor = new List { colors[2] }, + BorderColor = new List { colors[2] }, + BorderWidth = new List { 2 }, + HoverBorderWidth = new List { 4 }, + PointBackgroundColor = colors, + PointRadius = [0], // hide points + PointHoverRadius = [4] }; datasets.Add(dataset3); @@ -63,8 +63,19 @@ lineChartOptions.Responsive = true; lineChartOptions.Interaction = new Interaction { Mode = InteractionMode.Index }; - lineChartOptions.Scales.X!.Title = new ChartAxesTitle { Text = "2019", Display = true }; - lineChartOptions.Scales.Y!.Title = new ChartAxesTitle { Text = "Visitors", Display = true }; + + lineChartOptions.Scales = new Scales + { + X = new ChartAxes() + { + Title = new ChartAxesTitle() { Text = "Visitors", Display = true } + }, + Y = new ChartAxes() + { + Title = new ChartAxesTitle() { Text = "Browser", Display = true } + }, + }; + lineChartOptions.Plugins.Title!.Text = "Operating system"; lineChartOptions.Plugins.Title.Display = true; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_03_Dynamically_add_data.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_03_Dynamically_add_data.razor index 6d0bdb41f..c81320b17 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_03_Dynamically_add_data.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_03_Dynamically_add_data.razor @@ -58,27 +58,27 @@ { Label = "India", Data = new List(), - BackgroundColor = "rgb(88, 80, 141)", - BorderColor = "rgb(88, 80, 141)", - BorderWidth = 2, - HoverBorderWidth = 4, - // PointBackgroundColor = "rgb(88, 80, 141)", - // PointBorderColor = "rgb(88, 80, 141)", - // PointRadius = 0, // hide points - // PointHoverRadius = 4, + BackgroundColor = new List { "rgb(88, 80, 141)" }, + BorderColor = new List { "rgb(88, 80, 141)" }, + BorderWidth = new List { 2 }, + HoverBorderWidth = new List { 4 }, + PointBackgroundColor = ["rgb(88, 80, 141)"], + PointBorderColor = ["rgb(88, 80, 141)"], + PointRadius = [0], // hide points + PointHoverRadius = [4] }, new LineChartDataset { Label = "England", Data = new List(), - BackgroundColor = "rgb(255, 166, 0)", - BorderColor = "rgb(255, 166, 0)", - BorderWidth = 2, - HoverBorderWidth = 4, - // PointBackgroundColor = "rgb(255, 166, 0)", - // PointBorderColor = "rgb(255, 166, 0)", - // PointRadius = 0, // hide points - // PointHoverRadius = 4, + BackgroundColor = new List { "rgb(255, 166, 0)" }, + BorderColor = new List { "rgb(255, 166, 0)" }, + BorderWidth = new List { 2 }, + HoverBorderWidth = new List { 4 }, + PointBackgroundColor = ["rgb(255, 166, 0)"], + PointBorderColor = ["rgb(255, 166, 0)"], + PointRadius = [0], // hide points + PointHoverRadius = [4] } }; @@ -91,13 +91,25 @@ options.Interaction.Mode = InteractionMode.Index; - options.Plugins.Title = new ChartPluginsTitle { Text = "WORM", Display = true, Font = new ChartFont { Size = 20 } }; - + options.Plugins.Title = new ChartPluginsTitle() + { + Text = "WORM", + Display = true, + Font = new ChartFont() { Size = 20 } + }; options.Responsive = true; - - options.Scales.X!.Title = new ChartAxesTitle { Text = "Overs", Display = true }; - options.Scales.Y!.Title = new ChartAxesTitle { Text = "Runs", Display = true }; - options.Scales.Y.SuggestedMax = 150; + options.Scales = new Scales + { + X = new ChartAxes() + { + Title = new ChartAxesTitle() { Text = "Over", Display = true } + }, + Y = new ChartAxes() + { + Title = new ChartAxesTitle() { Text = "Runs", Display = true }, + SuggestedMax = 150 + }, + }; return options; } diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_04_Datalabels.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_04_Datalabels.razor index 90f429671..cea29e437 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_04_Datalabels.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_04_Datalabels.razor @@ -18,13 +18,13 @@ { Label = "Windows", Data = new List { 7265791, 5899643, 6317759, 6315641, 5338211, 8496306, 7568556, 8538933, 8274297, 8657298, 7548388, 7764845 }, - BackgroundColor = colors[0], - BorderColor = colors[0], - BorderWidth = 2, - HoverBorderWidth = 4, - // PointBackgroundColor = colors[0], - // PointRadius = 3, // show points - // PointHoverRadius = 4, + BackgroundColor = new List { colors[0] }, + BorderColor = new List { colors[0] }, + BorderWidth = new List { 2 }, + HoverBorderWidth = new List { 4 }, + PointBackgroundColor = colors, + PointRadius = [3], // show points + PointHoverRadius = [4], // datalabels Datalabels = new() { Alignment = Alignment.End, Anchor = Anchor.End } @@ -35,13 +35,13 @@ { Label = "macOS", Data = new List { 1809499, 1816642, 2122410, 1809499, 1850793, 1846743, 1954797, 2391313, 1983430, 2469918, 2633303, 2821149 }, - BackgroundColor = colors[1], - BorderColor = colors[1], - BorderWidth = 2, - HoverBorderWidth = 4, - // PointBackgroundColor = colors[1], - // PointRadius = 3, // show points - // PointHoverRadius = 4, + BackgroundColor = new List { colors[1] }, + BorderColor = new List { colors[1] }, + BorderWidth = new List { 2 }, + HoverBorderWidth = new List { 4 }, + PointBackgroundColor = colors, + PointRadius = [3], // show points + PointHoverRadius = [4], // datalabels Datalabels = new() { Alignment = Alignment.End, Anchor = Anchor.End } @@ -52,13 +52,13 @@ { Label = "Other", Data = new List { 1081241, 1100363, 1118136, 1073255, 1120315, 1395736, 1488788, 1489466, 1489947, 1414739, 1735811, 1820171 }, - BackgroundColor = colors[2], - BorderColor = colors[2], - BorderWidth = 2, - HoverBorderWidth = 4, - // PointBackgroundColor = colors[2], - // PointRadius = 3, // show points - // PointHoverRadius = 4, + BackgroundColor = new List { colors[2] }, + BorderColor = new List { colors[2] }, + BorderWidth = new List { 2 }, + HoverBorderWidth = new List { 4 }, + PointBackgroundColor = colors, + PointRadius = [3], // show points + PointHoverRadius = [4], // datalabels Datalabels = new() { Alignment = Alignment.Start, Anchor = Anchor.Start } @@ -75,8 +75,17 @@ lineChartOptions.Responsive = true; lineChartOptions.Interaction = new Interaction { Mode = InteractionMode.Index }; - lineChartOptions.Scales.X!.Title = new ChartAxesTitle { Text = "2019", Display = true }; - lineChartOptions.Scales.Y!.Title = new ChartAxesTitle { Text = "Visitors", Display = true }; + lineChartOptions.Scales = new Scales + { + X = new ChartAxes() + { + Title = new ChartAxesTitle() { Text = "2019", Display = true } + }, + Y = new ChartAxes() + { + Title = new ChartAxesTitle() { Text = "Visitors", Display = true } + }, + }; lineChartOptions.Plugins.Title!.Text = "Operating system"; lineChartOptions.Plugins.Title.Display = true; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_05_Tick_Configuration.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_05_Tick_Configuration.razor index 1a9cbb827..6afd175a9 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_05_Tick_Configuration.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_05_Tick_Configuration.razor @@ -79,13 +79,13 @@ { Label = $"Team {datasetsCount}", Data = GetRandomData(), - BackgroundColor = c.ToRgbString(), - BorderColor = c.ToRgbString(), - BorderWidth = 2, - HoverBorderWidth = 4, - // PointBackgroundColor = c.ToRgbString(), - // PointRadius = 0, // hide points - // PointHoverRadius = 4, + BackgroundColor = [c.ToRgbString()], + BorderColor = [c.ToRgbString()], + BorderWidth = [2], + HoverBorderWidth = [4], + PointBackgroundColor = [c.ToRgbString()], + PointRadius = [0], // hide points + PointHoverRadius = [4], }; } diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_06_Dataset_Fill.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_06_Dataset_Fill.razor index 7c91693f1..e9058c681 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_06_Dataset_Fill.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/LineCharts/LineChart_Demo_06_Dataset_Fill.razor @@ -110,11 +110,11 @@ { Label = $"Team {datasetsCount}", Data = GetRandomData(), - BackgroundColor = c.ToRgbaString(), + BackgroundColor = [c.ToRgbaString()], BorderCapStyle = "round", - BorderColor = c.ToRgbString(), - BorderWidth = 2, - HoverBorderWidth = 4, + BorderColor = [c.ToRgbString()], + BorderWidth = [2], + HoverBorderWidth = [4], PointBackgroundColor = new List() { c.ToRgbString() }, // PointRadius = 0, // hide points PointHoverRadius = new List() { 4 }, diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/PieCharts/PieChart_Demo_01_Examples.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/PieCharts/PieChart_Demo_01_Examples.razor index de529bfed..3d15b07f4 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/PieCharts/PieChart_Demo_01_Examples.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/PieCharts/PieChart_Demo_01_Examples.razor @@ -46,8 +46,7 @@ foreach (var dataset in chartData.Datasets) { if (dataset is PieChartDataset pieChartDataset - && pieChartDataset is not null - && pieChartDataset.Data is not null) + && pieChartDataset?.Data != null) { var count = pieChartDataset.Data.Count; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/PieCharts/PieChart_Demo_03_Change_Legend_Position.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/PieCharts/PieChart_Demo_03_Change_Legend_Position.razor index 10b91c699..d7a9fa67f 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/PieCharts/PieChart_Demo_03_Change_Legend_Position.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/PieCharts/PieChart_Demo_03_Change_Legend_Position.razor @@ -40,15 +40,15 @@ await base.OnAfterRenderAsync(firstRender); } - private async Task PositionTopAsync() => await UpdatePositionAsync("top"); - private async Task PositionRightAsync() => await UpdatePositionAsync("right"); - private async Task PositionBottomAsync() => await UpdatePositionAsync("bottom"); - private async Task PositionLeftAsync() => await UpdatePositionAsync("left"); + private Task PositionTopAsync() => UpdatePositionAsync("top"); + private Task PositionRightAsync() => UpdatePositionAsync("right"); + private Task PositionBottomAsync() => UpdatePositionAsync("bottom"); + private Task PositionLeftAsync() => UpdatePositionAsync("left"); - private async Task UpdatePositionAsync(string position) + private Task UpdatePositionAsync(string position) { pieChartOptions.Plugins.Legend.Position = position; - await pieChart.UpdateAsync(chartData, pieChartOptions); + return pieChart.UpdateAsync(chartData, pieChartOptions); } #region Data Preparation diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/RadarCharts/RadarChart_Demo_01_Examples.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/RadarCharts/RadarChart_Demo_01_Examples.razor index a4de5e1a6..c768a63f1 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/RadarCharts/RadarChart_Demo_01_Examples.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/RadarCharts/RadarChart_Demo_01_Examples.razor @@ -132,11 +132,11 @@ { Label = $"Team {datasetsCount}", Data = GetRandomData(), - BackgroundColor = c.ToRgbaString(), - BorderColor = c.ToRgbaString(0.8), - BorderWidth = 2, + BackgroundColor = [c.ToRgbaString()], + BorderColor = [c.ToRgbaString(0.8)], + BorderWidth = [2], Fill = true, - HoverBorderWidth = 4, + HoverBorderWidth = [4], }; } diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/ScatterCharts/ScatterChart_Demo_01_Basic_Example.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/ScatterCharts/ScatterChart_Demo_01_Basic_Example.razor index 9e32eb5bd..3b00e1865 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/ScatterCharts/ScatterChart_Demo_01_Basic_Example.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/ScatterCharts/ScatterChart_Demo_01_Basic_Example.razor @@ -41,10 +41,10 @@ { Label = $"Team {recordIndex + 1}", Data = GetRandomData(), - BackgroundColor = c.ToRgbaString(), // RGBA - BorderColor = c.ToRgbString(), // RGB - BorderWidth = 2, - HoverBorderWidth = 4, + BackgroundColor = [c.ToRgbaString()], // RGBA + BorderColor = [c.ToRgbString()], // RGB + BorderWidth = [2], + HoverBorderWidth = [4], }; } diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/ScatterCharts/ScatterChart_Demo_02_Dynamic_Data.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/ScatterCharts/ScatterChart_Demo_02_Dynamic_Data.razor index 49b8b2acd..9a89922fa 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/ScatterCharts/ScatterChart_Demo_02_Dynamic_Data.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Charts/ScatterCharts/ScatterChart_Demo_02_Dynamic_Data.razor @@ -1,11 +1,11 @@ 
- - - - - + + + + +
@code { @@ -128,11 +128,11 @@ { Label = $"Team {datasetsCount}", Data = GetRandomData(), - BackgroundColor = c.ToRgbaString(), // RGBA - BorderColor = c.ToRgbString(), // RGB - BorderWidth = 2, + BackgroundColor = [c.ToRgbaString()], // RGBA + BorderColor = [c.ToRgbString()], // RGB + BorderWidth = [2], Fill = true, - HoverBorderWidth = 4, + HoverBorderWidth = [4], PointHoverRadius = new List{6}, }; } diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Collapse/Collapse_Demo_01_Examples.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Collapse/Collapse_Demo_01_Examples.razor index 9c6fc0184..ed8fdba87 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Collapse/Collapse_Demo_01_Examples.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Collapse/Collapse_Demo_01_Examples.razor @@ -1,6 +1,6 @@ - - - + + + @@ -13,7 +13,7 @@ @code { Collapse collapse1 = default!; - private async Task ShowContentAsync() => await collapse1.ShowAsync(); - private async Task HideContentAsync() => await collapse1.HideAsync(); - private async Task ToggleContentAsync() => await collapse1.ToggleAsync(); + private ValueTask ShowContentAsync() => collapse1.ShowAsync(); + private ValueTask HideContentAsync() => collapse1.HideAsync(); + private ValueTask ToggleContentAsync() => collapse1.ToggleAsync(); } \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Collapse/Collapse_Demo_02_Horizontal.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Collapse/Collapse_Demo_02_Horizontal.razor index d5d7be886..8f76125cf 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Collapse/Collapse_Demo_02_Horizontal.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Collapse/Collapse_Demo_02_Horizontal.razor @@ -1,6 +1,6 @@ - - - + + + @@ -13,7 +13,7 @@ @code { Collapse collapse1 = default!; - private async Task ShowContentAsync() => await collapse1.ShowAsync(); - private async Task HideContentAsync() => await collapse1.HideAsync(); - private async Task ToggleContentAsync() => await collapse1.ToggleAsync(); + private ValueTask ShowContentAsync() => collapse1.ShowAsync(); + private ValueTask HideContentAsync() => collapse1.HideAsync(); + private ValueTask ToggleContentAsync() => collapse1.ToggleAsync(); } \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Collapse/Collapse_Demo_03_Events.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Collapse/Collapse_Demo_03_Events.razor index da71c0c9c..d7ab05e34 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Collapse/Collapse_Demo_03_Events.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Collapse/Collapse_Demo_03_Events.razor @@ -1,6 +1,6 @@ - - - + + + messages = new List(); + List messages = new(); - private async Task ShowContentAsync() => await collapse1.ShowAsync(); - private async Task HideContentAsync() => await collapse1.HideAsync(); - private async Task ToggleContentAsync() => await collapse1.ToggleAsync(); + private ValueTask ShowContentAsync() => collapse1.ShowAsync(); + private ValueTask HideContentAsync() => collapse1.HideAsync(); + private ValueTask ToggleContentAsync() => collapse1.ToggleAsync(); private void OnCollapseShowingAsync() => messages.Add($"Event: OnShowing called {DateTime.Now.ToLocalTime()}"); diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/CustomCss/CustomCss.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/CustomCss/CustomCss.razor new file mode 100644 index 000000000..8cd97e33b --- /dev/null +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/CustomCss/CustomCss.razor @@ -0,0 +1,141 @@ +@page "/customcss" + +@Title + + + +

Bootstrap CSS Generator

+
+ To prevent the need to generate custom Bootstrap CSS for your website using Node.js or by hand, Blazor Bootstrap can generate custom CSS to stylize your web page to your specific needs, for both light and dark mode. +
+ + + + +
+ CSS is generated by providing it with a provided data model for CSS settings. By default, the generator will take the manually provided values and use the default Bootstrap values as default if not provided. + For example, if you provide a value for the primary color, it will use that value. it will then use that provided value for the buttons, links, and other elements using said primary color. + However, if need be, you can also override the primary button color itself with a different value. + + + Don't override what you don't need to override. It is recommended to only override the CSS settings you need to specifically override, and let the generator use the default values otherwise. + + + + The generator has been based on the functionalities of the default Bootstrap customization toolkit using SASS. + +
+ + +
+ The following example contains a simple controller that generates the CSS for the website. The controller is set up to generate the CSS once and cache it for future requests. + + + Warning: Constantly regenerating the CSS code may impact the performance of your server. It is recommended to only regenerate it if changes have occurred, + e.g. a custom styling that the user has decided to edit and apply. + + + +
+ + +
+ For certain values, e.g. font-sizes, you can use the CssPropertyValue class to provide the value of a specific unit. + + +
+ + +
+ In the front, e.g. the Blazor Host.cshtml file, you can replace the default Bootstrap.css with the custom CSS generated by the controller. + Note how the line loading the default Bootstrap.min.css is replaced with the custom CSS controller providing the custom CSS. + + + Warning: If you load both the original Bootstrap(.min).css and the custom CSS, the custom CSS will not be applied properly, causing the styles to be mixed and not work as intended. + + + + +
+ +@code { + private const string PageUrl = "/customcss"; + private const string Title = "Blazor Custom CSS Generator"; + private const string Description = "Blazor Bootstrap can generate custom CSS to stylize your web page to your specific needs, for both light and dark mode."; + private const string ImageUrl = "https://i.imgur.com/beAr31J.png"; + + private const string CssValuesTypesSnippet = @" +var degrees = CssPropertyValue.Angle(50); // returns 50deg +var rem = CssPropertyValue.Rem(1.5f); // returns 1.5rem +var raw = CssPropertyValue.RawNumber(100); // returns 100em +var percent = CssPropertyValue.Percentage(50); // returns 50% +var pixels = CssPropertyValue.Pixels(12); // returns 12px +var resolution = CssPropertyValue.Resolution(10); // returns 10dpi + +// Alternatively, default values can be used on properties of type CssPropertyValue. +var inherit = CssStyleEnum.Inherit; +var initial = CssStyleEnum.Initial; +var unset = CssStyleEnum.Unset; +var auto = CssStyleEnum.Auto; +var none = CssStyleEnum.None; +"; + + private const string CshtmlCodeSnippet = @" + +"; + + private const string ControllerCodeSnippet = @"[Route(""Css/Bootstrap.css"")] +[AllowAnonymous] +public class CssController : Controller +{ + /// + /// Default MobileTrack Bootstrap CSS settings (for both light/dark mode) + /// + private static readonly BootstrapCssSettings Settings; + + /// + /// CSS Cache + /// + private static readonly string CssCache; + + /// + /// Default controller to set the CSS cache. + /// + static CssController() + { + var primary = Color.FromArgb(48, 55, 117); + var primaryLight = Color.FromArgb(216, 217, 223); + var primaryDark = Color.FromArgb(9, 12, 38); + Settings = new BootstrapCssSettings + { + BodyFontFamily = ""Cursive"", + CardCapPaddingY = CssPropertyValue.Pixels(12), + PrimaryColor = primary, + DangerColor = Color.FromArgb(240, 2, 2), + SuccessColor = Color.FromArgb(0, 100, 0), + WarningColor = Color.FromArgb(150, 150, 34), + Light = + { + CardCapBgColor = primaryLight, + CardCapTextColor = primaryDark + }, + Dark = + { + CardCapBgColor = primaryDark, + CardCapTextColor = primaryLight + } + }; + + CssCache = CssGenerator.GetBootstrapCss(Settings); + } + + /// + /// Retrieves CSS for Bootstrap, customized for the website. + /// + /// CSS content + public IActionResult Get() + { + return Content(CssCache, ""text/css""); + } +}"; +} diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Dropdowns/Dropdown_Demo_05_A_Directions_Dropup.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Dropdowns/Dropdown_Demo_05_A_Directions_Dropup.razor index 6e3a658fd..3ac5278eb 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Dropdowns/Dropdown_Demo_05_A_Directions_Dropup.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Dropdowns/Dropdown_Demo_05_A_Directions_Dropup.razor @@ -1,5 +1,5 @@ 
- + Dropup button with text Action @@ -8,7 +8,7 @@ - + Dropup split button diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Dropdowns/Dropdown_Demo_05_B_Directions_DropupCentered.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Dropdowns/Dropdown_Demo_05_B_Directions_DropupCentered.razor index d516eb235..5ce58cdf3 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Dropdowns/Dropdown_Demo_05_B_Directions_DropupCentered.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Dropdowns/Dropdown_Demo_05_B_Directions_DropupCentered.razor @@ -1,5 +1,5 @@ 
- + Centered dropup Action diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Dropdowns/Dropdown_Demo_05_C_Directions_Dropend.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Dropdowns/Dropdown_Demo_05_C_Directions_Dropend.razor index cf314c603..5fd0810d7 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Dropdowns/Dropdown_Demo_05_C_Directions_Dropend.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Dropdowns/Dropdown_Demo_05_C_Directions_Dropend.razor @@ -1,5 +1,5 @@ 
- + Dropend Action @@ -8,7 +8,7 @@ - + Split dropend diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Dropdowns/Dropdown_Demo_05_D_Directions_Dropstart.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Dropdowns/Dropdown_Demo_05_D_Directions_Dropstart.razor index 44b7374ef..228570cac 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Dropdowns/Dropdown_Demo_05_D_Directions_Dropstart.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Dropdowns/Dropdown_Demo_05_D_Directions_Dropstart.razor @@ -1,5 +1,5 @@ 
- + Dropstart Action @@ -7,7 +7,7 @@ Something else here - + Action diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Dropdowns/Dropdown_Demo_14_Methods.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Dropdowns/Dropdown_Demo_14_Methods.razor index 85d7034b6..afbce21ec 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Dropdowns/Dropdown_Demo_14_Methods.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Dropdowns/Dropdown_Demo_14_Methods.razor @@ -7,14 +7,14 @@ - - - + + + @code{ private Dropdown dropdown1 = default!; - private async Task ShowAsync() => await dropdown1.ShowAsync(); - private async Task HideAsync() => await dropdown1.HideAsync(); - private async Task ToggleAsync() => await dropdown1.ToggleAsync(); + private ValueTask ShowAsync() => dropdown1.ShowAsync(); + private ValueTask HideAsync() => dropdown1.HideAsync(); + private ValueTask ToggleAsync() => dropdown1.ToggleAsync(); } diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Form/AutoComplete/AutoComplete_Demo_01_A_Client_Side_Filtering.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Form/AutoComplete/AutoComplete_Demo_01_A_Client_Side_Filtering.razor index 3645eb003..b8a7c333a 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Form/AutoComplete/AutoComplete_Demo_01_A_Client_Side_Filtering.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Form/AutoComplete/AutoComplete_Demo_01_A_Client_Side_Filtering.razor @@ -11,17 +11,17 @@ @code { private string? customerName; - public IEnumerable? customers; + public IReadOnlyCollection? customers; private async Task> CustomersDataProvider(AutoCompleteDataProviderRequest request) { if (customers is null) // pull customers only one time for client-side autocomplete customers = GetCustomers(); // call a service or an API to pull the customers - return await Task.FromResult(request.ApplyTo(customers.OrderBy(customer => customer.CustomerName))); + return await Task.FromResult(request.ApplyTo(customers.OrderBy(customer => customer.CustomerName).ToArray())); } - private IEnumerable GetCustomers() + private IReadOnlyCollection GetCustomers() { return new List { new(1, "Pich S"), diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Form/AutoComplete/AutoComplete_Demo_01_B_Client_Side_Filtering_With_StringComparision.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Form/AutoComplete/AutoComplete_Demo_01_B_Client_Side_Filtering_With_StringComparision.razor index acf198e4d..082d687ce 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Form/AutoComplete/AutoComplete_Demo_01_B_Client_Side_Filtering_With_StringComparision.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Form/AutoComplete/AutoComplete_Demo_01_B_Client_Side_Filtering_With_StringComparision.razor @@ -12,17 +12,17 @@ @code { private string? customerName; - public IEnumerable? customers; + public IReadOnlyCollection? customers; private async Task> CustomersDataProvider(AutoCompleteDataProviderRequest request) { if (customers is null) // pull customers only one time for client-side autocomplete customers = GetCustomers(); // call a service or an API to pull the customers - return await Task.FromResult(request.ApplyTo(customers.OrderBy(customer => customer.CustomerName))); + return await Task.FromResult(request.ApplyTo(customers.OrderBy(customer => customer.CustomerName).ToArray())); } - private IEnumerable GetCustomers() + private IReadOnlyCollection GetCustomers() { return new List { new(1, "Pich S"), diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Form/AutoComplete/AutoComplete_Demo_03_Set_Default_Value.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Form/AutoComplete/AutoComplete_Demo_03_Set_Default_Value.razor index e7321fdf8..b25a26e10 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Form/AutoComplete/AutoComplete_Demo_03_Set_Default_Value.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Form/AutoComplete/AutoComplete_Demo_03_Set_Default_Value.razor @@ -11,7 +11,7 @@ @code { private string? customerName; - public IEnumerable? customers; + public IReadOnlyCollection? customers; protected override void OnInitialized() { @@ -23,10 +23,10 @@ if (customers is null) // pull customers only one time for client-side autocomplete customers = GetCustomers(); // call a service or an API to pull the customers - return await Task.FromResult(request.ApplyTo(customers.OrderBy(customer => customer.CustomerName))); + return await Task.FromResult(request.ApplyTo(customers.OrderBy(customer => customer.CustomerName).ToArray())); } - private IEnumerable GetCustomers() + private IReadOnlyCollection GetCustomers() { return new List { new(1, "Pich S"), diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Form/AutoComplete/AutoComplete_Demo_06_Sizing.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Form/AutoComplete/AutoComplete_Demo_06_Sizing.razor index f875904d6..88a066d9a 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Form/AutoComplete/AutoComplete_Demo_06_Sizing.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Form/AutoComplete/AutoComplete_Demo_06_Sizing.razor @@ -37,17 +37,17 @@ private string? customerName1; private string? customerName2; private string? customerName3; - public IEnumerable? customers; + public IReadOnlyCollection? customers; private async Task> CustomersDataProvider(AutoCompleteDataProviderRequest request) { if (customers is null) // pull customers only one time for client-side autocomplete customers = GetCustomers(); // call a service or an API to pull the customers - return await Task.FromResult(request.ApplyTo(customers.OrderBy(customer => customer.CustomerName))); + return await Task.FromResult(request.ApplyTo(customers.OrderBy(customer => customer.CustomerName).ToArray())); } - private IEnumerable GetCustomers() + private IReadOnlyCollection GetCustomers() { return new List { new(1, "Pich S"), diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Form/RangeInput/RangeInput_Demo_06_Tick_Marks.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Form/RangeInput/RangeInput_Demo_06_Tick_Marks.razor index 7ba165ddd..d65044456 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Form/RangeInput/RangeInput_Demo_06_Tick_Marks.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Form/RangeInput/RangeInput_Demo_06_Tick_Marks.razor @@ -9,7 +9,7 @@ @code { float temperature1 = 10; - IEnumerable list = new List + IReadOnlyCollection list = new List { new(){ Label = "very cold!", Value = "0"}, new(){ Label = "cool", Value = "25"}, diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Form/TimeInput/TimeInput_Demo_07_Restrict_The_Time_Field_Based_On_The_Entry_In_Another_Time_Field.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Form/TimeInput/TimeInput_Demo_07_Restrict_The_Time_Field_Based_On_The_Entry_In_Another_Time_Field.razor index 9a97fff3f..54eca6dd0 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Form/TimeInput/TimeInput_Demo_07_Restrict_The_Time_Field_Based_On_The_Entry_In_Another_Time_Field.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Form/TimeInput/TimeInput_Demo_07_Restrict_The_Time_Field_Based_On_The_Entry_In_Another_Time_Field.razor @@ -69,7 +69,7 @@ private void DepartureTimeChanged(TimeOnly? departureTime) { - if (departureTime is null || !departureTime.HasValue) + if (!departureTime.HasValue) { flightForm.DepartureTime = null; flightForm.ArrivalTime = null; diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/01-Overview/Grid_Demo_01_Client_Side_Filtering_Paging_And_Sorting.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/01-Overview/Grid_Demo_01_Client_Side_Filtering_Paging_And_Sorting.razor index 1cd6dcb42..836631bdd 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/01-Overview/Grid_Demo_01_Client_Side_Filtering_Paging_And_Sorting.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/01-Overview/Grid_Demo_01_Client_Side_Filtering_Paging_And_Sorting.razor @@ -45,7 +45,7 @@
@code { - private IEnumerable employees = default!; + private IReadOnlyCollection employees = default!; private HashSet selectedEmployees = new(); @@ -57,7 +57,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_01_A_Client_Side_Filtering.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_01_A_Client_Side_Filtering.razor index 0795e9c95..415e2f098 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_01_A_Client_Side_Filtering.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_01_A_Client_Side_Filtering.razor @@ -25,7 +25,8 @@ @code { - private IEnumerable employees = default!; + BlazorBootstrap.Grid grid = default!; + private IReadOnlyCollection employees = default!; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -35,7 +36,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_01_B_Client_Side_Filtering_With_StringComparision.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_01_B_Client_Side_Filtering_With_StringComparision.razor index 8004b7319..432e01c62 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_01_B_Client_Side_Filtering_With_StringComparision.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_01_B_Client_Side_Filtering_With_StringComparision.razor @@ -25,7 +25,7 @@ @code { - private IEnumerable? employees; + private IReadOnlyCollection? employees; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -35,7 +35,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_02_Set_Default_Filter.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_02_Set_Default_Filter.razor index c65d898fc..19565a517 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_02_Set_Default_Filter.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_02_Set_Default_Filter.razor @@ -25,7 +25,7 @@ @code { - private IEnumerable? employees; + private IReadOnlyCollection? employees; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -35,7 +35,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_03_Disable_Specific_Column_Filter.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_03_Disable_Specific_Column_Filter.razor index 3efe14721..f789022cd 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_03_Disable_Specific_Column_Filter.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_03_Disable_Specific_Column_Filter.razor @@ -25,7 +25,7 @@ @code { - private IEnumerable? employees; + private IReadOnlyCollection? employees; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -35,7 +35,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_04_Increase_Filter_Textbox_Width.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_04_Increase_Filter_Textbox_Width.razor index 8ebb95f4e..e6ce3c46f 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_04_Increase_Filter_Textbox_Width.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_04_Increase_Filter_Textbox_Width.razor @@ -37,7 +37,7 @@ @code { - private IEnumerable? employees; + private IReadOnlyCollection? employees; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -47,7 +47,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_05_Enum_Filters.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_05_Enum_Filters.razor index f642a5b1d..4937a16ef 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_05_Enum_Filters.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_05_Enum_Filters.razor @@ -1,4 +1,4 @@ - @code { - private IEnumerable users = default!; + private IReadOnlyCollection users = default!; private async Task> UsersDataProvider(GridDataProviderRequest request) { @@ -32,7 +32,7 @@ return await Task.FromResult(request.ApplyTo(users)); } - private IEnumerable GetUsers() + private IReadOnlyCollection GetUsers() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_06_Guid_Filters.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_06_Guid_Filters.razor index 9d226d025..573421543 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_06_Guid_Filters.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/03-filters/Grid_Demo_06_Guid_Filters.razor @@ -25,7 +25,8 @@ @code { - private IEnumerable users = default!; + BlazorBootstrap.Grid grid = default!; + private IReadOnlyCollection users = default!; private async Task> UsersDataProvider(GridDataProviderRequest request) { @@ -35,7 +36,7 @@ return await Task.FromResult(request.ApplyTo(users)); } - private IEnumerable GetUsers() + private IReadOnlyCollection GetUsers() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/04-paging/Grid_Demo_02_Client_Side_Paging.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/04-paging/Grid_Demo_02_Client_Side_Paging.razor index 5e5f66827..14abee4cd 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/04-paging/Grid_Demo_02_Client_Side_Paging.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/04-paging/Grid_Demo_02_Client_Side_Paging.razor @@ -26,7 +26,7 @@ @code { - private IEnumerable employees = default!; + private IReadOnlyCollection employees = default!; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -36,7 +36,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/04-paging/Grid_Demo_25_Dynamic_Page_Size.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/04-paging/Grid_Demo_25_Dynamic_Page_Size.razor index e71e4436f..f4b79a3b6 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/04-paging/Grid_Demo_25_Dynamic_Page_Size.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/04-paging/Grid_Demo_25_Dynamic_Page_Size.razor @@ -31,7 +31,7 @@ @code { private int pageSize = 5; - private IEnumerable employees = default!; + private IReadOnlyCollection employees = default!; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -41,7 +41,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/04-paging/Grid_Demo_26_Page_Size_Selection.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/04-paging/Grid_Demo_26_Page_Size_Selection.razor index 4ac6081db..c8702b7f2 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/04-paging/Grid_Demo_26_Page_Size_Selection.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/04-paging/Grid_Demo_26_Page_Size_Selection.razor @@ -28,7 +28,7 @@ @code { - private IEnumerable employees = default!; + private IReadOnlyCollection employees = default!; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -38,7 +38,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/04-paging/Grid_Demo_34_AutoHide_Paging.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/04-paging/Grid_Demo_34_AutoHide_Paging.razor index 654cd5031..cc7e770cc 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/04-paging/Grid_Demo_34_AutoHide_Paging.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/04-paging/Grid_Demo_34_AutoHide_Paging.razor @@ -31,7 +31,7 @@ @code { - private IEnumerable employees = default!; + private IReadOnlyCollection employees = default!; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -41,7 +41,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/05-sorting/Grid_Demo_03_Client_Side_Sorting.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/05-sorting/Grid_Demo_03_Client_Side_Sorting.razor index cbd0bbdfd..7c8471890 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/05-sorting/Grid_Demo_03_Client_Side_Sorting.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/05-sorting/Grid_Demo_03_Client_Side_Sorting.razor @@ -29,7 +29,7 @@ @code { - private IEnumerable employees = default!; + private IReadOnlyCollection employees = default!; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -39,7 +39,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/05-sorting/Grid_Demo_08_Default_Sorting.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/05-sorting/Grid_Demo_08_Default_Sorting.razor index 0510716bd..f786c1e8c 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/05-sorting/Grid_Demo_08_Default_Sorting.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/05-sorting/Grid_Demo_08_Default_Sorting.razor @@ -24,7 +24,7 @@ @code { - private IEnumerable? employees; + private IReadOnlyCollection? employees; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -34,7 +34,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/05-sorting/Grid_Demo_09_Disable_Specific_Column_Sorting.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/05-sorting/Grid_Demo_09_Disable_Specific_Column_Sorting.razor index 09d964927..ffe7efca0 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/05-sorting/Grid_Demo_09_Disable_Specific_Column_Sorting.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/05-sorting/Grid_Demo_09_Disable_Specific_Column_Sorting.razor @@ -24,7 +24,7 @@ @code { - private IEnumerable? employees; + private IReadOnlyCollection? employees; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -34,7 +34,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/06-selection/Grid_Demo_01_Selection.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/06-selection/Grid_Demo_01_Selection.razor index 35b337d05..5547be127 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/06-selection/Grid_Demo_01_Selection.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/06-selection/Grid_Demo_01_Selection.razor @@ -40,21 +40,21 @@
@code { - private IEnumerable employees = default!; + private IReadOnlyCollection employees = default!; private HashSet selectedEmployees = new(); - private async Task> EmployeesDataProvider(GridDataProviderRequest request) + private async Task> EmployeesDataProvider(GridDataProviderRequest result) { Console.WriteLine("EmployeesDataProvider called..."); if (employees is null) // pull employees only one time for client-side filtering, sorting, and paging employees = GetEmployees(); // call a service or an API to pull the employees - return await Task.FromResult(request.ApplyTo(employees)); + return await Task.FromResult(result.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/06-selection/Grid_Demo_02_Multiple_Selection.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/06-selection/Grid_Demo_02_Multiple_Selection.razor index caf8cab3b..0cd2991d3 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/06-selection/Grid_Demo_02_Multiple_Selection.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/06-selection/Grid_Demo_02_Multiple_Selection.razor @@ -42,7 +42,7 @@
@code { - private IEnumerable employees = default!; + private IReadOnlyCollection employees = default!; private HashSet selectedEmployees = new(); @@ -56,7 +56,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/06-selection/Grid_Demo_03_Disable_Selection.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/06-selection/Grid_Demo_03_Disable_Selection.razor index 2f39eb670..d7ada8f24 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/06-selection/Grid_Demo_03_Disable_Selection.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/06-selection/Grid_Demo_03_Disable_Selection.razor @@ -43,7 +43,7 @@
@code { - private IEnumerable employees = default!; + private IReadOnlyCollection employees = default!; private HashSet selectedEmployees = new(); @@ -55,7 +55,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { @@ -71,7 +71,7 @@ }; } - private bool DisableAllRowsSelectionHandler(IEnumerable employees) + private bool DisableAllRowsSelectionHandler(IReadOnlyCollection employees) { return employees?.Any(x => x.Id < 105) ?? false; // disable selection if EmployeeId < 105 } diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/06-selection/Grid_Demo_04_A_Change_Selected_Row_Background_Color.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/06-selection/Grid_Demo_04_A_Change_Selected_Row_Background_Color.razor index a98d3deae..ec1c2cff9 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/06-selection/Grid_Demo_04_A_Change_Selected_Row_Background_Color.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/06-selection/Grid_Demo_04_A_Change_Selected_Row_Background_Color.razor @@ -43,7 +43,7 @@
@code { - private IEnumerable employees = default!; + private IReadOnlyCollection employees = default!; private HashSet selectedEmployees = new(); @@ -57,7 +57,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/07-alignment/Grid_Demo_10_Header_Text_Alignment.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/07-alignment/Grid_Demo_10_Header_Text_Alignment.razor index 10de84a01..c51634f7c 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/07-alignment/Grid_Demo_10_Header_Text_Alignment.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/07-alignment/Grid_Demo_10_Header_Text_Alignment.razor @@ -23,7 +23,7 @@ @code { - private IEnumerable? employees; + private IReadOnlyCollection? employees; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -33,7 +33,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/07-alignment/Grid_Demo_11_Grid_Cell_Alignment.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/07-alignment/Grid_Demo_11_Grid_Cell_Alignment.razor index 4cf121ac3..3c0e61c14 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/07-alignment/Grid_Demo_11_Grid_Cell_Alignment.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/07-alignment/Grid_Demo_11_Grid_Cell_Alignment.razor @@ -23,7 +23,7 @@ @code { - private IEnumerable? employees; + private IReadOnlyCollection? employees; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -33,7 +33,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/08-grid-settings/Grid_Demo_16_Save_And_Load_Grid_Settings.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/08-grid-settings/Grid_Demo_16_Save_And_Load_Grid_Settings.razor index 5cd100111..5e067bbe9 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/08-grid-settings/Grid_Demo_16_Save_And_Load_Grid_Settings.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/08-grid-settings/Grid_Demo_16_Save_And_Load_Grid_Settings.razor @@ -34,7 +34,7 @@ @code { BlazorBootstrap.Grid grid = default!; - private IEnumerable? employees; + private IReadOnlyCollection? employees; [Inject] public IJSRuntime JS { get; set; } = default!; @@ -71,7 +71,7 @@ return settings; } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/09-custom-css-class/Grid_Demo_18_Specify_Custom_Row_Class.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/09-custom-css-class/Grid_Demo_18_Specify_Custom_Row_Class.razor index 19dcc4d0c..d90091936 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/09-custom-css-class/Grid_Demo_18_Specify_Custom_Row_Class.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/09-custom-css-class/Grid_Demo_18_Specify_Custom_Row_Class.razor @@ -29,7 +29,7 @@ @code { - private IEnumerable? employees; + private IReadOnlyCollection? employees; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -43,13 +43,13 @@ { if (!emp.IsActive) return "table-danger"; - else if (emp.Designation == "Architect") + if (emp.Designation == "Architect") return "table-success"; return string.Empty; } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/09-custom-css-class/Grid_Demo_19_Specify_Custom_Column_Class.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/09-custom-css-class/Grid_Demo_19_Specify_Custom_Column_Class.razor index 923b1f876..5e736acff 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/09-custom-css-class/Grid_Demo_19_Specify_Custom_Column_Class.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/09-custom-css-class/Grid_Demo_19_Specify_Custom_Column_Class.razor @@ -32,7 +32,7 @@ @code { - private IEnumerable? employees; + private IReadOnlyCollection? employees; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -42,7 +42,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/09-custom-css-class/Grid_Demo_20_Column_Css_Class.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/09-custom-css-class/Grid_Demo_20_Column_Css_Class.razor index 7874288a2..d1acf05da 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/09-custom-css-class/Grid_Demo_20_Column_Css_Class.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/09-custom-css-class/Grid_Demo_20_Column_Css_Class.razor @@ -28,7 +28,7 @@ @code { - private IEnumerable? employees; + private IReadOnlyCollection? employees; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -38,7 +38,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/09-custom-css-class/Grid_Demo_27_Header_Row_CSS_Class.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/09-custom-css-class/Grid_Demo_27_Header_Row_CSS_Class.razor index 5eee54107..f4be519c5 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/09-custom-css-class/Grid_Demo_27_Header_Row_CSS_Class.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/09-custom-css-class/Grid_Demo_27_Header_Row_CSS_Class.razor @@ -123,17 +123,17 @@ @code { - private IEnumerable employees = default!; + private IReadOnlyCollection employees = default!; - private async Task> EmployeesDataProvider(GridDataProviderRequest request) + private async Task> EmployeesDataProvider(GridDataProviderRequest result) { if (employees is null) // pull employees only one time for client-side filtering, sorting, and paging employees = GetEmployees(); // call a service or an API to pull the employees - return await Task.FromResult(request.ApplyTo(employees)); + return await Task.FromResult(result.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/09-custom-css-class/Grid_Demo_28_Filters_Row_CSS_Class.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/09-custom-css-class/Grid_Demo_28_Filters_Row_CSS_Class.razor index 3a2576579..b5ac1197d 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/09-custom-css-class/Grid_Demo_28_Filters_Row_CSS_Class.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/09-custom-css-class/Grid_Demo_28_Filters_Row_CSS_Class.razor @@ -230,7 +230,7 @@ @code { - private IEnumerable employees = default!; + private IReadOnlyCollection employees = default!; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -240,7 +240,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/10-events/Grid_Demo_29_Row_Click.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/10-events/Grid_Demo_29_Row_Click.razor index 2a4bfb4bf..4cb6e789b 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/10-events/Grid_Demo_29_Row_Click.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/10-events/Grid_Demo_29_Row_Click.razor @@ -34,7 +34,7 @@ @code { [Inject] ModalService ModalService { get; set; } = default!; - private IEnumerable employees = default!; + private IReadOnlyCollection employees = default!; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -44,7 +44,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/10-events/Grid_Demo_30_Row_Double_Click.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/10-events/Grid_Demo_30_Row_Double_Click.razor index 1dc88ce8e..5c2a5ac4c 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/10-events/Grid_Demo_30_Row_Double_Click.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/10-events/Grid_Demo_30_Row_Double_Click.razor @@ -34,7 +34,7 @@ @code { [Inject] ModalService ModalService { get; set; } = default!; - private IEnumerable employees = default!; + private IReadOnlyCollection employees = default!; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -44,7 +44,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/11-translations/Grid_Demo_01_Translations.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/11-translations/Grid_Demo_01_Translations.razor index e55abdadb..e27f05811 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/11-translations/Grid_Demo_01_Translations.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/11-translations/Grid_Demo_01_Translations.razor @@ -33,9 +33,9 @@ @code { - private IEnumerable users = default!; + private IReadOnlyCollection users = default!; - private async Task> GridFiltersTranslationProvider() + private IReadOnlyCollection GridFiltersTranslationProvider() { var filtersTranslation = new List(); @@ -56,7 +56,7 @@ // common filtersTranslation.Add(new("x", "Duidelijk", FilterOperator.Clear)); - return await Task.FromResult(filtersTranslation); + return filtersTranslation; } @@ -68,7 +68,7 @@ return await Task.FromResult(request.ApplyTo(users)); } - private IEnumerable GetUsers() + private IReadOnlyCollection GetUsers() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/12-fixed-header/Grid_Demo_32_Fixed_Header_A.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/12-fixed-header/Grid_Demo_32_Fixed_Header_A.razor index 72d5a6d5f..e73b001d8 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/12-fixed-header/Grid_Demo_32_Fixed_Header_A.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/12-fixed-header/Grid_Demo_32_Fixed_Header_A.razor @@ -1,5 +1,4 @@ - -@code { - BlazorBootstrap.Grid grid = default!; - private IEnumerable employees = default!; +@code { + private IReadOnlyCollection employees = default!; protected override async Task OnAfterRenderAsync(bool firstRender) { @@ -65,7 +63,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/13-freeze-columns/Grid_Demo_33_Freeze_Column_B_Fixed_Header.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/13-freeze-columns/Grid_Demo_33_Freeze_Column_B_Fixed_Header.razor index a65457af3..0e8ad2b4c 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/13-freeze-columns/Grid_Demo_33_Freeze_Column_B_Fixed_Header.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/13-freeze-columns/Grid_Demo_33_Freeze_Column_B_Fixed_Header.razor @@ -4,29 +4,28 @@ AllowPaging="true" AllowSorting="true" FixedHeader="true" - Responsive="true" - Unit="Unit.Px"> + Responsive="true"> - + @context.CustomerId - + @context.CustomerName - + @context.Phone - + @context.Email - + @context.Address - + @context.PostalZip - + @context.Country diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/13-freeze-columns/Grid_Demo_33_Freeze_Column_C_Fixed_Header_With_Filters.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/13-freeze-columns/Grid_Demo_33_Freeze_Column_C_Fixed_Header_With_Filters.razor index 6bc1d00ee..ecb652c86 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/13-freeze-columns/Grid_Demo_33_Freeze_Column_C_Fixed_Header_With_Filters.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/13-freeze-columns/Grid_Demo_33_Freeze_Column_C_Fixed_Header_With_Filters.razor @@ -9,25 +9,25 @@ Unit="Unit.Px"> - + @context.CustomerId - + @context.CustomerName - + @context.Phone - + @context.Email - + @context.Address - + @context.PostalZip - + @context.Country diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/14-detail-view/Grid_Demo_14_A_DetailView.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/14-detail-view/Grid_Demo_14_A_DetailView.razor index a0193f0a8..86ae12191 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/14-detail-view/Grid_Demo_14_A_DetailView.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/14-detail-view/Grid_Demo_14_A_DetailView.razor @@ -66,7 +66,7 @@ new Ingredient { Id = 20115, ProductId = 20, Description = "Ingredient 5", Unit = "UNIT1", Quantity = 750 }, }; - private IEnumerable GetIngredients(int productId) => ingredients.Where(i => i.ProductId == productId); + private IReadOnlyCollection GetIngredients(int productId) => ingredients.Where(i => i.ProductId == productId).ToList(); public record class Product { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/99-other/Grid_Demo_01_Grid_Cell_Formating.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/99-other/Grid_Demo_01_Grid_Cell_Formating.razor index c66cdf8fe..49b1a37e0 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/99-other/Grid_Demo_01_Grid_Cell_Formating.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/99-other/Grid_Demo_01_Grid_Cell_Formating.razor @@ -23,7 +23,7 @@ @code { - private IEnumerable? employees; + private IReadOnlyCollection? employees; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -33,7 +33,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/99-other/Grid_Demo_02_Grid_Cell_Nowrap.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/99-other/Grid_Demo_02_Grid_Cell_Nowrap.razor index 4743b178a..637c9c3e2 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/99-other/Grid_Demo_02_Grid_Cell_Nowrap.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/99-other/Grid_Demo_02_Grid_Cell_Nowrap.razor @@ -36,7 +36,7 @@ @code { - private IEnumerable? employees; + private IReadOnlyCollection? employees; private async Task> EmployeesDataProvider(GridDataProviderRequest request) { @@ -46,7 +46,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/99-other/Grid_Demo_05_Specify_Custom_Column_Header.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/99-other/Grid_Demo_05_Specify_Custom_Column_Header.razor index a5c161f07..cc0ace13f 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/99-other/Grid_Demo_05_Specify_Custom_Column_Header.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/99-other/Grid_Demo_05_Specify_Custom_Column_Header.razor @@ -33,7 +33,7 @@ @code { - private IEnumerable employees = default!; + private IReadOnlyCollection employees = default!; private bool IsAllChecked { @@ -51,7 +51,7 @@ return await Task.FromResult(request.ApplyTo(employees)); } - private IEnumerable GetEmployees() + private IReadOnlyCollection GetEmployees() { return new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Index.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Index.razor index 7f65a9275..dca1b83a0 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Index.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Index.razor @@ -95,6 +95,16 @@

Confirm Dialog

+ +

Currency Input

diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Layout/server/Layout_Server_Demo_01.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Layout/server/Layout_Server_Demo_01.razor index 4a3f063dc..2fce0863c 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Layout/server/Layout_Server_Demo_01.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Layout/server/Layout_Server_Demo_01.razor @@ -10,7 +10,7 @@ ImageSrc="https://demos.blazorbootstrap.com/images/logo/logo-white.svg" Title="Blazor Bootstrap" BadgeText="3.3.1" - DataProvider="Sidebar2DataProvider" + DataProvider="SidebarDataProvider" WidthUnit="Unit.Px" /> @@ -24,17 +24,18 @@ @code { - private IEnumerable navItems = default!; + private Sidebar sidebar = default!; + private IReadOnlyCollection? navItems; - private async Task Sidebar2DataProvider(Sidebar2DataProviderRequest request) + private Task SidebarDataProvider() { if (navItems is null) navItems = GetNavItems(); - return await Task.FromResult(request.ApplyTo(navItems)); + return Task.FromResult(Sidebar2DataProviderRequest.ApplyTo(navItems)); } - private IEnumerable GetNavItems() + private IReadOnlyCollection GetNavItems() { navItems = new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Layout/webassembly/Layout_WebAssembly_Demo_01.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Layout/webassembly/Layout_WebAssembly_Demo_01.razor index fbcfc9f07..cae368a90 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Layout/webassembly/Layout_WebAssembly_Demo_01.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Layout/webassembly/Layout_WebAssembly_Demo_01.razor @@ -10,7 +10,7 @@ ImageSrc="https://demos.blazorbootstrap.com/images/logo/logo-white.svg" Title="Blazor Bootstrap" BadgeText="3.3.1" - DataProvider="Sidebar2DataProvider" + DataProvider="SidebarDataProvider" WidthUnit="Unit.Px" /> @@ -24,17 +24,18 @@ @code { - private IEnumerable navItems = default!; + private Sidebar sidebar = default!; + private IReadOnlyCollection? navItems; - private async Task Sidebar2DataProvider(Sidebar2DataProviderRequest request) + private async Task SidebarDataProvider() { if (navItems is null) navItems = GetNavItems(); - return await Task.FromResult(request.ApplyTo(navItems)); + return await Task.FromResult(Sidebar2DataProviderRequest.ApplyTo(navItems)); } - private IEnumerable GetNavItems() + private IReadOnlyCollection GetNavItems() { navItems = new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMapDemoComponentBase.cs b/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMapDemoComponentBase.cs deleted file mode 100644 index b1724a7bf..000000000 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMapDemoComponentBase.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace BlazorBootstrap.Demo.RCL; - -public class GoogleMapDemoComponentBase : ComponentBase -{ - public string ApiKey = default!; - - [Inject] private IConfiguration Configuration { get; set; } = default!; - - protected override void OnInitialized() - { - ApiKey = Configuration["GoogleMap:ApiKey"].ToString(); - base.OnInitialized(); - } -} diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMapDocumentation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMapDocumentation.razor deleted file mode 100644 index ecc5f8e76..000000000 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMapDocumentation.razor +++ /dev/null @@ -1,81 +0,0 @@ -@attribute [Route(pageUrl)] - - - - - @pageDescription - - - - -
- -
- -
-
This example demonstrates how to use a simple Google Map component.
- -
- -
-
This example demonstrates how to use a simple Google Map component with marker.
- -
- -
-
-
To scale a marker, use the PinElement.Scale option.
- -
-
-
Use the PinElement.Background option to change the background color of a marker.
- -
-
-
Use the PinElement.BorderColor option to change the border color of a marker.
- -
-
-
Use the PinElement.GlyphColor option to change the glyph color of a marker.
- -
-
-
Set the PinElement.Glyph option to an empty string to hide a marker's glyph.
- -
-
-
Use the PinElement.UseIconFonts and PinElement.Glyph options to use the icon fonts.
- -
- -
- -
- -
-
- This example shows you how to make markers respond to click events. To make a marker clickable: - Set the Clickable parameter to true. -
- -
- -
- -
- -@code { - private const string pageUrl = RouteConstants.Demos_GoogleMap_Documentation; - private const string pageTitle = "Blazor Google Map"; - private const string pageDescription = "Blazor Bootstrap Google Map component will create maps to show locations anywhere in the world using the Google JavaScript API."; - private const string metaTitle = "Blazor Google Map Component"; - private const string metaDescription = "Blazor Bootstrap Google Map component will create maps to show locations anywhere in the world using the Google JavaScript API."; - private const string imageUrl = "https://i.imgur.com/AbyDP51.png"; -} diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_01_Examples.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_01_Examples.razor deleted file mode 100644 index 16b50dc0d..000000000 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_01_Examples.razor +++ /dev/null @@ -1,7 +0,0 @@ -@inherits GoogleMapDemoComponentBase - - \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_02_Marker.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_02_Marker.razor deleted file mode 100644 index 7eb3d7404..000000000 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_02_Marker.razor +++ /dev/null @@ -1,24 +0,0 @@ -@inherits GoogleMapDemoComponentBase - - - -@code { - List markers = new() - { - new GoogleMapMarker() - { - Position = new GoogleMapMarkerPosition(37.50024109655184, -122.28528451834352) , - Title = "Single family house with modern design", - }, - new GoogleMapMarker() - { - Position = new GoogleMapMarkerPosition(37.44440882321596, -122.2160620727) , - Title = "Townhouse with friendly neighbors", - } - }; -} \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_03_Marker_Customization_A_Scale_the_marker.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_03_Marker_Customization_A_Scale_the_marker.razor deleted file mode 100644 index 13f6a4e14..000000000 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_03_Marker_Customization_A_Scale_the_marker.razor +++ /dev/null @@ -1,26 +0,0 @@ -@inherits GoogleMapDemoComponentBase - - - -@code { - List markers = new() - { - new GoogleMapMarker() - { - PinElement = new PinElement{ Scale = 1.5 }, - Position = new GoogleMapMarkerPosition(37.50024109655184, -122.28528451834352) , - Title = "Single family house with modern design", - }, - new GoogleMapMarker() - { - PinElement = new PinElement{ Scale = 1.5 }, - Position = new GoogleMapMarkerPosition(37.44440882321596, -122.2160620727) , - Title = "Townhouse with friendly neighbors", - } - }; -} \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_03_Marker_Customization_B_Change_the_background_color.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_03_Marker_Customization_B_Change_the_background_color.razor deleted file mode 100644 index 02e59c8d0..000000000 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_03_Marker_Customization_B_Change_the_background_color.razor +++ /dev/null @@ -1,26 +0,0 @@ -@inherits GoogleMapDemoComponentBase - - - -@code { - List markers = new() - { - new GoogleMapMarker() - { - PinElement = new PinElement{ Background = "#FBBC04", }, - Position = new GoogleMapMarkerPosition(37.50024109655184, -122.28528451834352) , - Title = "Single family house with modern design", - }, - new GoogleMapMarker() - { - PinElement = new PinElement{ Background = "#FBBC04", }, - Position = new GoogleMapMarkerPosition(37.44440882321596, -122.2160620727) , - Title = "Townhouse with friendly neighbors", - } - }; -} \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_03_Marker_Customization_C_Change_the_border_color.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_03_Marker_Customization_C_Change_the_border_color.razor deleted file mode 100644 index a507feee4..000000000 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_03_Marker_Customization_C_Change_the_border_color.razor +++ /dev/null @@ -1,26 +0,0 @@ -@inherits GoogleMapDemoComponentBase - - - -@code { - List markers = new() - { - new GoogleMapMarker() - { - PinElement = new PinElement{ BorderColor = "#137333", }, - Position = new GoogleMapMarkerPosition(37.50024109655184, -122.28528451834352) , - Title = "Single family house with modern design", - }, - new GoogleMapMarker() - { - PinElement = new PinElement{ BorderColor = "#137333", }, - Position = new GoogleMapMarkerPosition(37.44440882321596, -122.2160620727) , - Title = "Townhouse with friendly neighbors", - } - }; -} \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_03_Marker_Customization_D_Change_the_glyph_color.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_03_Marker_Customization_D_Change_the_glyph_color.razor deleted file mode 100644 index 9f298a3d8..000000000 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_03_Marker_Customization_D_Change_the_glyph_color.razor +++ /dev/null @@ -1,26 +0,0 @@ -@inherits GoogleMapDemoComponentBase - - - -@code { - List markers = new() - { - new GoogleMapMarker() - { - PinElement = new PinElement{ GlyphColor = "white", }, - Position = new GoogleMapMarkerPosition(37.50024109655184, -122.28528451834352) , - Title = "Single family house with modern design", - }, - new GoogleMapMarker() - { - PinElement = new PinElement{ GlyphColor = "white", }, - Position = new GoogleMapMarkerPosition(37.44440882321596, -122.2160620727) , - Title = "Townhouse with friendly neighbors", - } - }; -} \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_03_Marker_Customization_E_Hide_the_glyph.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_03_Marker_Customization_E_Hide_the_glyph.razor deleted file mode 100644 index a80d26525..000000000 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_03_Marker_Customization_E_Hide_the_glyph.razor +++ /dev/null @@ -1,26 +0,0 @@ -@inherits GoogleMapDemoComponentBase - - - -@code { - List markers = new() - { - new GoogleMapMarker() - { - PinElement = new PinElement{ Glyph = "", }, - Position = new GoogleMapMarkerPosition(37.50024109655184, -122.28528451834352) , - Title = "Single family house with modern design", - }, - new GoogleMapMarker() - { - PinElement = new PinElement{ Glyph = "", }, - Position = new GoogleMapMarkerPosition(37.44440882321596, -122.2160620727) , - Title = "Townhouse with friendly neighbors", - } - }; -} \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_03_Marker_Customization_F_Use_icon_fonts.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_03_Marker_Customization_F_Use_icon_fonts.razor deleted file mode 100644 index 8402fd1c3..000000000 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_03_Marker_Customization_F_Use_icon_fonts.razor +++ /dev/null @@ -1,110 +0,0 @@ -@inherits GoogleMapDemoComponentBase - - - -@code { - List markers = new() - { - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-drizzle-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[0].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[0].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.50024109655184, -122.28528451834352), - Title = "Drizzle", - }, - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-drizzle-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[0].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[0].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.44440882321596, -122.2160620727), - Title = "Drizzle", - }, - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-lightning-rain-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[2].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[2].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.39561833718522, -122.21855116258479), - Title = "Lightning rain", - }, - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-lightning-rain-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[2].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[2].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.423928529779644, -122.1087629822001), - Title = "Lightning rain", - }, - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-rain-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[1].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[1].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.40578635332598, -122.15043378466069), - Title = "Rain", - }, - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-rain-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[1].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[1].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.36399747905774, -122.10465384268522), - Title = "Rain", - }, - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-rain-heavy-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[3].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[3].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.38343706184458, -122.02340436985183), - Title = "Heavy rain", - }, - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-rain-heavy-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[3].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[3].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.34576403052, -122.04455090047453), - Title = "Heavy rain", - } - }; -} \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_04_Markers_with_HTML_and_CSS.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_04_Markers_with_HTML_and_CSS.razor deleted file mode 100644 index 51e78a200..000000000 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_04_Markers_with_HTML_and_CSS.razor +++ /dev/null @@ -1,32 +0,0 @@ -@inherits GoogleMapDemoComponentBase - - - -@code { - List markers = new() - { - new GoogleMapMarker() - { - Content = "", - Position = new GoogleMapMarkerPosition(37.50024109655184, -122.28528451834352), - Title = "Drizzle" - }, - new GoogleMapMarker() - { - Content = "", - Position = new GoogleMapMarkerPosition(37.44440882321596, -122.2160620727), - Title = "Lightning rain" - }, - new GoogleMapMarker() - { - Content = "", - Position = new GoogleMapMarkerPosition(37.39561833718522, -122.21855116258479), - Title = "Rain" - } - }; -} \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_05_Make_a_marker_clickable.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_05_Make_a_marker_clickable.razor deleted file mode 100644 index b6e5e6476..000000000 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_05_Make_a_marker_clickable.razor +++ /dev/null @@ -1,119 +0,0 @@ -@inherits GoogleMapDemoComponentBase - - - -@code { - [Inject] public ToastService ToastService { get; set; } = default!; - - private void OnGoogleMapMarkerClick(GoogleMapMarker marker) - { - ToastService.Notify(new ToastMessage(ToastType.Success, $"{marker.Title}", $"This is a toast message for a weather forecast. DateTime: {DateTime.Now}")); - } - - List markers = new() - { - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-drizzle-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[0].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[0].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.50024109655184, -122.28528451834352), - Title = "Drizzle", - }, - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-drizzle-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[0].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[0].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.44440882321596, -122.2160620727), - Title = "Drizzle", - }, - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-lightning-rain-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[2].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[2].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.39561833718522, -122.21855116258479), - Title = "Lightning rain", - }, - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-lightning-rain-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[2].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[2].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.423928529779644, -122.1087629822001), - Title = "Lightning rain", - }, - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-rain-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[1].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[1].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.40578635332598, -122.15043378466069), - Title = "Rain", - }, - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-rain-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[1].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[1].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.36399747905774, -122.10465384268522), - Title = "Rain", - }, - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-rain-heavy-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[3].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[3].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.38343706184458, -122.02340436985183), - Title = "Heavy rain", - }, - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-rain-heavy-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[3].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[3].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.34576403052, -122.04455090047453), - Title = "Heavy rain", - } - }; -} \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_06_Dynamic_markers.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_06_Dynamic_markers.razor deleted file mode 100644 index 447efeeec..000000000 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Maps/GoogleMap_Demo_06_Dynamic_markers.razor +++ /dev/null @@ -1,164 +0,0 @@ -@inherits GoogleMapDemoComponentBase - -
- - - -
- - - -@code { - Random random = new Random(2000000000); - GoogleMap googleMapRef = default!; - - [Inject] public ToastService ToastService { get; set; } = default!; - - private async ValueTask AddWeatherMarkerAsync() => await googleMapRef.AddMarkerAsync(GetRandomMarker()); - - private async Task UpdateWeatherMarkersAsync() - { - var markerList = new List - { - GetRandomMarker(), - GetRandomMarker(), - GetRandomMarker(), - GetRandomMarker(), - GetRandomMarker(), - GetRandomMarker(), - }; - await googleMapRef.UpdateMarkersAsync(markerList); - } - - private async Task RefreshMapAsync() - { - markers.Add(GetRandomMarker()); - markers.Add(GetRandomMarker()); - - await googleMapRef.RefreshAsync(); - } - - private void OnGoogleMapMarkerClick(GoogleMapMarker marker) - { - ToastService.Notify(new ToastMessage(ToastType.Success, $"{marker.Title}", $"This is a toast message for a weather forecast. DateTime: {DateTime.Now}")); - } - - List markers = new() - { - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-drizzle-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[0].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[0].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.50024109655184, -122.28528451834352), - Title = "Drizzle", - }, - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-drizzle-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[0].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[0].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.44440882321596, -122.2160620727), - Title = "Drizzle", - }, - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-lightning-rain-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[2].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[2].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.39561833718522, -122.21855116258479), - Title = "Lightning rain", - }, - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-lightning-rain-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[2].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[2].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.423928529779644, -122.1087629822001), - Title = "Lightning rain", - }, - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-rain-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[1].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[1].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.40578635332598, -122.15043378466069), - Title = "Rain", - }, - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-rain-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[1].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[1].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.36399747905774, -122.10465384268522), - Title = "Rain", - }, - new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-rain-heavy-fill fs-6 text-white", - UseIconFonts = true, - Background=ColorUtility.CategoricalSixColors[3].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor=ColorUtility.CategoricalSixColors[3].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(37.38343706184458, -122.02340436985183), - Title = "Heavy rain", - } - }; - - private GoogleMapMarker GetRandomMarker() - { - var lat = Double.Parse($"37.{random.Next()}"); - var lng = Double.Parse($"-122.{random.Next()}"); - return new GoogleMapMarker() - { - PinElement = new PinElement - { - Glyph = "bi bi-cloud-rain-heavy-fill fs-6 text-white", - UseIconFonts = true, - Background = ColorUtility.CategoricalTwelveColors[9].ToColor().ToRgbaString().ToLowerInvariant(), - BorderColor = ColorUtility.CategoricalTwelveColors[9].ToColor().ToRgbString().ToLowerInvariant() - }, - Position = new GoogleMapMarkerPosition(lat, lng), - Title = "Heavy rain", - }; - } -} \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Offcanvas/Offcanvas_Demo_01_Examples.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Offcanvas/Offcanvas_Demo_01_Examples.razor index 49946f0a7..a0c3bbb21 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Offcanvas/Offcanvas_Demo_01_Examples.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Offcanvas/Offcanvas_Demo_01_Examples.razor @@ -11,7 +11,7 @@
- +
@@ -21,7 +21,7 @@ @code { private Offcanvas offcanvas = default!; - private async Task OnShowOffcanvasClick() => await offcanvas.ShowAsync(); + private Task OnShowOffcanvasClick() => offcanvas.ShowAsync(); - private async Task OnHideOffcanvasClick() => await offcanvas.HideAsync(); + private ValueTask OnHideOffcanvasClick() => offcanvas.HideAsync(); } \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Offcanvas/Offcanvas_Demo_04_Static_Backdrop.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Offcanvas/Offcanvas_Demo_04_Static_Backdrop.razor index f3479871c..a884e6875 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Offcanvas/Offcanvas_Demo_04_Static_Backdrop.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Offcanvas/Offcanvas_Demo_04_Static_Backdrop.razor @@ -15,5 +15,5 @@ @code { private Offcanvas offcanvas = default!; - private async Task OnShowOffcanvasClick() => await offcanvas.ShowAsync(); + private Task OnShowOffcanvasClick() => offcanvas.ShowAsync(); } \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Offcanvas/Offcanvas_Demo_05_Sizes_A_Small.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Offcanvas/Offcanvas_Demo_05_Sizes_A_Small.razor index e0152fa6f..dd1481cf8 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Offcanvas/Offcanvas_Demo_05_Sizes_A_Small.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Offcanvas/Offcanvas_Demo_05_Sizes_A_Small.razor @@ -15,5 +15,5 @@ @code { private Offcanvas offcanvas = default!; - private async Task OnShowOffcanvasClick() => await offcanvas.ShowAsync(); + private Task OnShowOffcanvasClick() => offcanvas.ShowAsync(); } \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Offcanvas/Offcanvas_Demo_05_Sizes_B_Large.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Offcanvas/Offcanvas_Demo_05_Sizes_B_Large.razor index b369e5cc2..b8edd432f 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Offcanvas/Offcanvas_Demo_05_Sizes_B_Large.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Offcanvas/Offcanvas_Demo_05_Sizes_B_Large.razor @@ -15,5 +15,5 @@ @code { private Offcanvas offcanvas = default!; - private async Task OnShowOffcanvasClick() => await offcanvas.ShowAsync(); + private Task OnShowOffcanvasClick() => offcanvas.ShowAsync(); } \ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Offcanvas/Offcanvas_Demo_06_Events.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Offcanvas/Offcanvas_Demo_06_Events.razor index 41e24b4d9..54cfc8427 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Offcanvas/Offcanvas_Demo_06_Events.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Offcanvas/Offcanvas_Demo_06_Events.razor @@ -10,7 +10,7 @@ - + diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/PdfViewer/PdfViewer_Demo_03_Base64String.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/PdfViewer/PdfViewer_Demo_03_Base64String.razor index 4092d0106..1867abd1f 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/PdfViewer/PdfViewer_Demo_03_Base64String.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/PdfViewer/PdfViewer_Demo_03_Base64String.razor @@ -7,7 +7,7 @@ @code { private string eventLog { get; set; } = $"Last event: ..., CurrentPage: 0, TotalPages: 0"; - private string pdfBase64String; + private string pdfBase64String = default!; protected override void OnInitialized() { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Progress/Progress_Demo_03_Set_Width_Programmatically.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Progress/Progress_Demo_03_Set_Width_Programmatically.razor index 2a7195386..1bf17f7ff 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Progress/Progress_Demo_03_Set_Width_Programmatically.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Progress/Progress_Demo_03_Set_Width_Programmatically.razor @@ -12,18 +12,18 @@ private void IncreaseProgressBar() { progressBar.IncreaseWidth(10); - progressBar.SetLabel($"{progressBar.GetWidth()}%"); + progressBar.SetLabel($"{progressBar.Width}%"); } private void DecreaseProgressBar() { progressBar.DecreaseWidth(10); - progressBar.SetLabel($"{progressBar.GetWidth()}%"); + progressBar.SetLabel($"{progressBar.Width}%"); } private void ResetProgressBar() { progressBar.SetWidth(0); - progressBar.SetLabel($"{progressBar.GetWidth()}%"); + progressBar.SetLabel($"{progressBar.Width}%"); } } diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Ribbon/Ribbon_Demo_01_How_It_Works.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Ribbon/Ribbon_Demo_01_How_It_Works.razor index 82c82f68c..fa43c3573 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Ribbon/Ribbon_Demo_01_How_It_Works.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Ribbon/Ribbon_Demo_01_How_It_Works.razor @@ -1,6 +1,6 @@  - + New
Email
@@ -11,10 +11,10 @@
-
+
- + Send/Receive
All Folders
@@ -25,10 +25,10 @@ Show
Progress
Cancel
All
-
+
- + New
Folder
@@ -41,7 +41,7 @@ Move
Folder
Delete
Folder
-
+
diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Ribbon/Ribbon_Demo_02_Images.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Ribbon/Ribbon_Demo_02_Images.razor index f84ae2843..9f56c87bd 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Ribbon/Ribbon_Demo_02_Images.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Ribbon/Ribbon_Demo_02_Images.razor @@ -1,6 +1,6 @@  - + New
Email
@@ -11,10 +11,10 @@
-
+
- + Send/Receive
All Folders
@@ -25,10 +25,10 @@ Show
Progress
Cancel
All
-
+
- + New
Folder
@@ -41,7 +41,7 @@ Move
Folder
Delete
Folder
-
+
diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_01_Basic_Usage.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_01_Basic_Usage.razor index da8cde40d..fa18a2452 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_01_Basic_Usage.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_01_Basic_Usage.razor @@ -4,17 +4,17 @@ DataProvider="SidebarDataProvider" /> @code { - IEnumerable? navItems; + IReadOnlyCollection? navItems; - private async Task SidebarDataProvider(SidebarDataProviderRequest request) + private async Task SidebarDataProvider() { if (navItems is null) navItems = GetNavItems(); - return await Task.FromResult(request.ApplyTo(navItems)); + return await Task.FromResult(SidebarDataProviderRequest.ApplyTo(navItems)); } - private IEnumerable GetNavItems() + private IReadOnlyCollection GetNavItems() { navItems = new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_02_Two_level_navigation.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_02_Two_level_navigation.razor index d7dc759e8..021ef43fb 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_02_Two_level_navigation.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_02_Two_level_navigation.razor @@ -4,17 +4,17 @@ DataProvider="SidebarDataProvider" /> @code { - IEnumerable? navItems; + IReadOnlyCollection? navItems; - private async Task SidebarDataProvider(SidebarDataProviderRequest request) + private async Task SidebarDataProvider() { if (navItems is null) navItems = GetNavItems(); - return await Task.FromResult(request.ApplyTo(navItems)); + return await Task.FromResult(SidebarDataProviderRequest.ApplyTo(navItems)); } - private IEnumerable GetNavItems() + private IReadOnlyCollection GetNavItems() { navItems = new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_03_Change_Icons_Color.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_03_Change_Icons_Color.razor index f6ff1512a..83a2ba789 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_03_Change_Icons_Color.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_03_Change_Icons_Color.razor @@ -4,17 +4,17 @@ DataProvider="SidebarDataProvider" /> @code { - IEnumerable? navItems; + IReadOnlyCollection? navItems; - private async Task SidebarDataProvider(SidebarDataProviderRequest request) + private async Task SidebarDataProvider() { if (navItems is null) navItems = GetNavItems(); - return await Task.FromResult(request.ApplyTo(navItems)); + return await Task.FromResult(SidebarDataProviderRequest.ApplyTo(navItems)); } - private IEnumerable GetNavItems() + private IReadOnlyCollection GetNavItems() { navItems = new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_04_Full_layout_with_sidebar.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_04_Full_layout_with_sidebar.razor index 2d4c9a64b..cff7132c0 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_04_Full_layout_with_sidebar.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_04_Full_layout_with_sidebar.razor @@ -18,17 +18,17 @@ @code { - IEnumerable? navItems; + IReadOnlyCollection? navItems; - private async Task SidebarDataProvider(SidebarDataProviderRequest request) + private async Task SidebarDataProvider() { if (navItems is null) navItems = GetNavItems(); - return await Task.FromResult(request.ApplyTo(navItems)); + return await Task.FromResult(SidebarDataProviderRequest.ApplyTo(navItems)); } - private IEnumerable GetNavItems() + private IReadOnlyCollection GetNavItems() { navItems = new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_05_Toggle_Sidebar_to_Show_Icons_Only.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_05_Toggle_Sidebar_to_Show_Icons_Only.razor index 5c333d2fa..a098e917e 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_05_Toggle_Sidebar_to_Show_Icons_Only.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_05_Toggle_Sidebar_to_Show_Icons_Only.razor @@ -21,17 +21,17 @@ @code { Sidebar sidebar = default!; - IEnumerable? navItems; + IReadOnlyCollection? navItems; - private async Task SidebarDataProvider(SidebarDataProviderRequest request) + private async Task SidebarDataProvider() { if (navItems is null) navItems = GetNavItems(); - return await Task.FromResult(request.ApplyTo(navItems)); + return await Task.FromResult(SidebarDataProviderRequest.ApplyTo(navItems)); } - private IEnumerable GetNavItems() + private IReadOnlyCollection GetNavItems() { navItems = new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_06_Show_Badge.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_06_Show_Badge.razor index 7a9626707..d2c4e5249 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_06_Show_Badge.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_06_Show_Badge.razor @@ -22,17 +22,17 @@ @code { Sidebar sidebar = default!; - IEnumerable? navItems; + IReadOnlyCollection? navItems; - private async Task SidebarDataProvider(SidebarDataProviderRequest request) + private async Task SidebarDataProvider() { if (navItems is null) navItems = GetNavItems(); - return await Task.FromResult(request.ApplyTo(navItems)); + return await Task.FromResult(SidebarDataProviderRequest.ApplyTo(navItems)); } - private IEnumerable GetNavItems() + private IReadOnlyCollection GetNavItems() { navItems = new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_07_Custom_Brand_Icon.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_07_Custom_Brand_Icon.razor index 361edea8f..a170440e5 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_07_Custom_Brand_Icon.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_07_Custom_Brand_Icon.razor @@ -22,17 +22,17 @@ @code { Sidebar sidebar = default!; - IEnumerable? navItems; + IReadOnlyCollection? navItems; - private async Task SidebarDataProvider(SidebarDataProviderRequest request) + private async Task SidebarDataProvider() { if (navItems is null) navItems = GetNavItems(); - return await Task.FromResult(request.ApplyTo(navItems)); + return await Task.FromResult(SidebarDataProviderRequest.ApplyTo(navItems)); } - private IEnumerable GetNavItems() + private IReadOnlyCollection GetNavItems() { navItems = new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_08_Show_Image_as_Brand_Logo.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_08_Show_Image_as_Brand_Logo.razor index d354267ab..039b16b7b 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_08_Show_Image_as_Brand_Logo.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_08_Show_Image_as_Brand_Logo.razor @@ -22,17 +22,17 @@ @code { Sidebar sidebar = default!; - IEnumerable? navItems; + IReadOnlyCollection? navItems; - private async Task SidebarDataProvider(SidebarDataProviderRequest request) + private async Task SidebarDataProvider() { if (navItems is null) navItems = GetNavItems(); - return await Task.FromResult(request.ApplyTo(navItems)); + return await Task.FromResult(SidebarDataProviderRequest.ApplyTo(navItems)); } - private IEnumerable GetNavItems() + private IReadOnlyCollection GetNavItems() { navItems = new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_09_Customize_Sidebar.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_09_Customize_Sidebar.razor index cd765a9da..70b464555 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_09_Customize_Sidebar.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_09_Customize_Sidebar.razor @@ -22,17 +22,17 @@ @code { bool applyPurpleStyle = false; - IEnumerable? navItems; + IReadOnlyCollection? navItems; - private async Task SidebarDataProvider(SidebarDataProviderRequest request) + private async Task SidebarDataProvider() { if (navItems is null) navItems = GetNavItems(); - return await Task.FromResult(request.ApplyTo(navItems)); + return await Task.FromResult(SidebarDataProviderRequest.ApplyTo(navItems)); } - private IEnumerable GetNavItems() + private IReadOnlyCollection GetNavItems() { navItems = new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_10_Apply_Custom_CSS_Class_to_NavItem.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_10_Apply_Custom_CSS_Class_to_NavItem.razor index f32fa48fa..d74349bad 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_10_Apply_Custom_CSS_Class_to_NavItem.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_10_Apply_Custom_CSS_Class_to_NavItem.razor @@ -4,17 +4,17 @@ DataProvider="SidebarDataProvider" /> @code { - IEnumerable? navItems; + IReadOnlyCollection? navItems; - private async Task SidebarDataProvider(SidebarDataProviderRequest request) + private async Task SidebarDataProvider() { if (navItems is null) navItems = GetNavItems(); - return await Task.FromResult(request.ApplyTo(navItems)); + return await Task.FromResult(SidebarDataProviderRequest.ApplyTo(navItems)); } - private IEnumerable GetNavItems() + private IReadOnlyCollection GetNavItems() { navItems = new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_11_Width.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_11_Width.razor index 524c3a53b..e07ba918e 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_11_Width.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar/Sidebar_Demo_11_Width.razor @@ -6,17 +6,17 @@ WidthUnit="Unit.Px" /> @code { - IEnumerable? navItems; + IReadOnlyCollection? navItems; - private async Task SidebarDataProvider(SidebarDataProviderRequest request) + private async Task SidebarDataProvider() { if (navItems is null) navItems = GetNavItems(); - return await Task.FromResult(request.ApplyTo(navItems)); + return await Task.FromResult(SidebarDataProviderRequest.ApplyTo(navItems)); } - private IEnumerable GetNavItems() + private IReadOnlyCollection GetNavItems() { navItems = new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_01_Basic_Usage.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_01_Basic_Usage.razor index cdf3f8aed..d54b70cc3 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_01_Basic_Usage.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_01_Basic_Usage.razor @@ -5,19 +5,19 @@ DataProvider="Sidebar2DataProvider" /> @code { - IEnumerable? navItems; + IReadOnlyCollection? navItems; - private async Task Sidebar2DataProvider(Sidebar2DataProviderRequest request) + private async Task Sidebar2DataProvider() { if (navItems is null) navItems = GetNavItems(); await Task.Delay(2000); - return await Task.FromResult(request.ApplyTo(navItems)); + return await Task.FromResult(Sidebar2DataProviderRequest.ApplyTo(navItems)); } - private IEnumerable GetNavItems() + private IReadOnlyCollection GetNavItems() { navItems = new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_02_More_Nested_Levels.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_02_More_Nested_Levels.razor index 9ed8f494f..4d7fedb78 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_02_More_Nested_Levels.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_02_More_Nested_Levels.razor @@ -5,19 +5,19 @@ DataProvider="Sidebar2DataProvider" /> @code { - IEnumerable? navItems; + IReadOnlyCollection? navItems; - private async Task Sidebar2DataProvider(Sidebar2DataProviderRequest request) + private async Task Sidebar2DataProvider() { if (navItems is null) navItems = GetNavItems(); await Task.Delay(2000); - return await Task.FromResult(request.ApplyTo(navItems)); + return await Task.FromResult(Sidebar2DataProviderRequest.ApplyTo(navItems)); } - private IEnumerable GetNavItems() + private IReadOnlyCollection GetNavItems() { navItems = new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_03_Change_Icons_Color.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_03_Change_Icons_Color.razor index ceba2d892..1b3ae2743 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_03_Change_Icons_Color.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_03_Change_Icons_Color.razor @@ -5,19 +5,19 @@ DataProvider="Sidebar2DataProvider" /> @code { - IEnumerable? navItems; + IReadOnlyCollection? navItems; - private async Task Sidebar2DataProvider(Sidebar2DataProviderRequest request) + private async Task Sidebar2DataProvider() { if (navItems is null) navItems = GetNavItems(); await Task.Delay(2000); - return await Task.FromResult(request.ApplyTo(navItems)); + return await Task.FromResult(Sidebar2DataProviderRequest.ApplyTo(navItems)); } - private IEnumerable GetNavItems() + private IReadOnlyCollection GetNavItems() { navItems = new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_04_Full_layout_with_sidebar.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_04_Full_layout_with_sidebar.razor index f6c78ac81..68b36cad0 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_04_Full_layout_with_sidebar.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_04_Full_layout_with_sidebar.razor @@ -19,19 +19,19 @@ @code { - IEnumerable? navItems; + IReadOnlyCollection? navItems; - private async Task Sidebar2DataProvider(Sidebar2DataProviderRequest request) + private async Task Sidebar2DataProvider() { if (navItems is null) navItems = GetNavItems(); await Task.Delay(2000); - return await Task.FromResult(request.ApplyTo(navItems)); + return await Task.FromResult(Sidebar2DataProviderRequest.ApplyTo(navItems)); } - private IEnumerable GetNavItems() + private IReadOnlyCollection GetNavItems() { navItems = new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_07_Custom_Brand_Icon.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_07_Custom_Brand_Icon.razor index 1e75b2d99..fac8b45e1 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_07_Custom_Brand_Icon.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_07_Custom_Brand_Icon.razor @@ -19,19 +19,19 @@ @code { - IEnumerable? navItems; + IReadOnlyCollection? navItems; - private async Task Sidebar2DataProvider(Sidebar2DataProviderRequest request) + private async Task Sidebar2DataProvider() { if (navItems is null) navItems = GetNavItems(); await Task.Delay(2000); - return await Task.FromResult(request.ApplyTo(navItems)); + return await Task.FromResult(Sidebar2DataProviderRequest.ApplyTo(navItems)); } - private IEnumerable GetNavItems() + private IReadOnlyCollection GetNavItems() { navItems = new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_08_Show_Image_as_Brand_Logo.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_08_Show_Image_as_Brand_Logo.razor index a70c472a2..00d589722 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_08_Show_Image_as_Brand_Logo.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_08_Show_Image_as_Brand_Logo.razor @@ -19,19 +19,19 @@ @code { - IEnumerable? navItems; + IReadOnlyCollection? navItems; - private async Task Sidebar2DataProvider(Sidebar2DataProviderRequest request) + private async Task Sidebar2DataProvider() { if (navItems is null) navItems = GetNavItems(); await Task.Delay(2000); - return await Task.FromResult(request.ApplyTo(navItems)); + return await Task.FromResult(Sidebar2DataProviderRequest.ApplyTo(navItems)); } - private IEnumerable GetNavItems() + private IReadOnlyCollection GetNavItems() { navItems = new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_09_Width.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_09_Width.razor index 0bc1b7991..348b08e53 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_09_Width.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Sidebar2/Sidebar2_Demo_09_Width.razor @@ -7,19 +7,19 @@ WidthUnit="Unit.Px" /> @code { - IEnumerable? navItems; + IReadOnlyCollection? navItems; - private async Task Sidebar2DataProvider(Sidebar2DataProviderRequest request) + private async Task Sidebar2DataProvider() { if (navItems is null) navItems = GetNavItems(); await Task.Delay(2000); - return await Task.FromResult(request.ApplyTo(navItems)); + return await Task.FromResult(Sidebar2DataProviderRequest.ApplyTo(navItems)); } - private IEnumerable GetNavItems() + private IReadOnlyCollection GetNavItems() { navItems = new List { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_01_Examples.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_01_Examples.razor index 60a824c7a..272b7a5eb 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_01_Examples.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_01_Examples.razor @@ -1,22 +1,22 @@  - - -

This is the placeholder content for the Home tab.

-
-
- - -

This is the placeholder content for the Profile tab.

-
-
- - -

This is the placeholder content for the Contact tab.

-
-
- - -

This is the placeholder content for the About tab.

-
-
+ + +

This is the placeholder content for the Home tab.

+
+
+ + +

This is the placeholder content for the Profile tab.

+
+
+ + +

This is the placeholder content for the Contact tab.

+
+
+ + +

This is the placeholder content for the About tab.

+
+
\ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_02_Enable_FadeEffect.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_02_Enable_FadeEffect.razor index d65c2e19a..16836ac2d 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_02_Enable_FadeEffect.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_02_Enable_FadeEffect.razor @@ -1,17 +1,17 @@  - - -

This is the placeholder content for the Home tab.

-
-
- - -

This is the placeholder content for the Profile tab.

-
-
- - -

This is the placeholder content for the Contact tab.

-
-
+ + +

This is the placeholder content for the Home tab.

+
+
+ + +

This is the placeholder content for the Profile tab.

+
+
+ + +

This is the placeholder content for the Contact tab.

+
+
\ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_03_Title_with_Icon.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_03_Title_with_Icon.razor index 35d4351d7..aa8bb61c7 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_03_Title_with_Icon.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_03_Title_with_Icon.razor @@ -1,26 +1,26 @@  - - - Home - - -

This is the placeholder content for the Home tab.

-
-
- - - Profile - - -

This is the placeholder content for the Profile tab.

-
-
- - - Contact - - -

This is the placeholder content for the Contact tab.

-
-
+ + + Home + + +

This is the placeholder content for the Home tab.

+
+
+ + + Profile + + +

This is the placeholder content for the Profile tab.

+
+
+ + + Contact + + +

This is the placeholder content for the Contact tab.

+
+
\ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_04_Disable_Tab.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_04_Disable_Tab.razor index 003ae4aff..0bb6c372e 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_04_Disable_Tab.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_04_Disable_Tab.razor @@ -1,22 +1,22 @@  - - -

This is the placeholder content for the Home tab.

-
-
- - -

This is the placeholder content for the Profile tab.

-
-
- - -

This is the placeholder content for the Projects tab.

-
-
- - -

This is the placeholder content for the Contact tab.

-
-
+ + +

This is the placeholder content for the Home tab.

+
+
+ + +

This is the placeholder content for the Profile tab.

+
+
+ + +

This is the placeholder content for the Projects tab.

+
+
+ + +

This is the placeholder content for the Contact tab.

+
+
\ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_05_Nav_Style_Pills.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_05_Nav_Style_Pills.razor index 330c753e6..dbfdfb26b 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_05_Nav_Style_Pills.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_05_Nav_Style_Pills.razor @@ -1,17 +1,17 @@  - +

This is the placeholder content for the Home tab.

-
+
- +

This is the placeholder content for the Profile tab.

-
+
- +

This is the placeholder content for the Contact tab.

-
+
\ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_06_Nav_Style_Underline.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_06_Nav_Style_Underline.razor index cd8d152a3..ffef4ecf8 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_06_Nav_Style_Underline.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_06_Nav_Style_Underline.razor @@ -1,17 +1,17 @@  - +

This is the placeholder content for the Home tab.

-
+
- +

This is the placeholder content for the Profile tab.

-
+
- +

This is the placeholder content for the Contact tab.

-
+
\ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_07_Vertical_A.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_07_Vertical_A.razor index 83472ebbf..3c0ebee3b 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_07_Vertical_A.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_07_Vertical_A.razor @@ -1,22 +1,22 @@  - +

This is the placeholder content for the Home tab.

-
+
- +

This is the placeholder content for the Profile tab.

-
+
- +

This is the placeholder content for the Contact tab.

-
+
- +

This is the placeholder content for the About tab.

-
+
\ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_07_Vertical_B_Pills.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_07_Vertical_B_Pills.razor index b4a6f7fa1..f61fae750 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_07_Vertical_B_Pills.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_07_Vertical_B_Pills.razor @@ -1,22 +1,22 @@  - +

This is the placeholder content for the Home tab.

-
+
- +

This is the placeholder content for the Profile tab.

-
+
- +

This is the placeholder content for the Contact tab.

-
+
- +

This is the placeholder content for the About tab.

-
+
\ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_07_Vertical_C_Underline.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_07_Vertical_C_Underline.razor index 17632bc42..d45c55dbb 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_07_Vertical_C_Underline.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_07_Vertical_C_Underline.razor @@ -1,22 +1,24 @@  + - +

This is the placeholder content for the Home tab.

-
+
- +

This is the placeholder content for the Profile tab.

-
+
- +

This is the placeholder content for the Contact tab.

-
+
- +

This is the placeholder content for the About tab.

-
+
+
\ No newline at end of file diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_08_Activate_Individual_Tabs.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_08_Activate_Individual_Tabs.razor index a0560057e..7aff6b599 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_08_Activate_Individual_Tabs.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_08_Activate_Individual_Tabs.razor @@ -1,34 +1,36 @@  + - +

This is the placeholder content for the Home tab.

-
+
- +

This is the placeholder content for the Profile tab.

-
+
- +

This is the placeholder content for the Contact tab.

-
+
- +

This is the placeholder content for the Products tab.

-
+
- +

This is the placeholder content for the FAQs tab.

-
+
- +

This is the placeholder content for the About tab.

-
+
+
@@ -41,10 +43,10 @@ @code{ Tabs tabs = default!; - private async Task ShowFirstTabAsync() => await tabs.ShowFirstTabAsync(); - private async Task ShowSecondTabAsync() => await tabs.ShowTabByIndexAsync(1); - private async Task ShowThirdTabAsync() => await tabs.ShowTabByIndexAsync(2); - private async Task ShowProductsTabAsync() => await tabs.ShowTabByNameAsync("Products"); - private async Task ShowFaqsAsync() => await tabs.ShowTabByNameAsync("FAQ"); - private async Task ShowLastTabAsync() => await tabs.ShowLastTabAsync(); + private Task ShowFirstTabAsync() => tabs.ShowFirstTabAsync(); + private Task ShowSecondTabAsync() => tabs.ShowTabByIndexAsync(1); + private Task ShowThirdTabAsync() => tabs.ShowTabByIndexAsync(2); + private Task ShowProductsTabAsync() => tabs.ShowTabByNameAsync("Products"); + private Task ShowFaqsAsync() => tabs.ShowTabByNameAsync("FAQ"); + private Task ShowLastTabAsync() => tabs.ShowLastTabAsync(); } diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_09_Events_Order.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_09_Events_Order.razor index 2d901ed13..f39c10eec 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_09_Events_Order.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_09_Events_Order.razor @@ -3,21 +3,23 @@ OnShown="@(args => OnTabShownAsync(args))" OnHiding="@(args => OnTabHidingAsync(args))" OnHidden="@(args => OnTabHiddenAsync(args))"> + - +

This is the placeholder content for the Home tab.

-
+
- +

This is the placeholder content for the Profile tab.

-
+
- +

This is the placeholder content for the Contact tab.

-
+
+
diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_10_Events_Example.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_10_Events_Example.razor index 877d97d26..fdd7ab56a 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_10_Events_Example.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_10_Events_Example.razor @@ -3,21 +3,23 @@ OnShown="@(args => OnTabShownAsync(args))" OnHiding="@(args => OnTabHidingAsync(args))" OnHidden="@(args => OnTabHiddenAsync(args))"> - - + + +

This is the placeholder content for the Home tab.

-
+
- - + +

This is the placeholder content for the Profile tab.

-
+
- - + +

This is the placeholder content for the Contact tab.

-
+
+

Current Active Tab Name: @activeTabName

diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_11_Methods_Set_Active_Tab_OnAfterRender.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_11_Methods_Set_Active_Tab_OnAfterRender.razor index a8611773b..ab7bcddea 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_11_Methods_Set_Active_Tab_OnAfterRender.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_11_Methods_Set_Active_Tab_OnAfterRender.razor @@ -1,24 +1,26 @@  + - +

This is the placeholder content for the Home tab.

-
+
- +

This is the placeholder content for the Profile tab.

-
+
- +

This is the placeholder content for the Contact tab.

-
+
- +

This is the placeholder content for the About tab.

-
+
+
@code { diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_12_Tab_Callback_Event_OnClick.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_12_Tab_Callback_Event_OnClick.razor index 0ce797711..816ff0439 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_12_Tab_Callback_Event_OnClick.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_12_Tab_Callback_Event_OnClick.razor @@ -1,16 +1,18 @@  + @foreach (var customer in customers) { - +
This is the placeholder content for the @customer.CustomerName tab.
-
+
} +
@if (selectedCustomer is not null) diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_13_Dynamic_Tabs.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_13_Dynamic_Tabs.razor index 3bdc9cd52..ba267a38d 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_13_Dynamic_Tabs.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_13_Dynamic_Tabs.razor @@ -5,16 +5,18 @@ + @foreach (var customer in customers) { - +
This is the placeholder content for the @customer.CustomerName tab.
-
+
} +
diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_14_Remove_Dynamic_Tabs.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_14_Remove_Dynamic_Tabs.razor index 3639e9a97..975843280 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_14_Remove_Dynamic_Tabs.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Tabs/Tabs_Demo_14_Remove_Dynamic_Tabs.razor @@ -5,12 +5,13 @@ + @foreach (var customer in customers) { - +
This is the placeholder content for the @customer.CustomerName tab. @@ -19,9 +20,10 @@
-
+
} +
diff --git a/BlazorBootstrap.Demo.RCL/Components/Shared/Demo.razor b/BlazorBootstrap.Demo.RCL/Components/Shared/Demo.razor index 8eddb2996..b072d1ac4 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Shared/Demo.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Shared/Demo.razor @@ -7,7 +7,7 @@
@LanguageCode.ToLanguageCodeString()
- +
@@ -15,9 +15,9 @@
                 
-                    @if (snippet is not null)
+                    @if (ProvidedCode is not null)
                     {
-                        @snippet.Trim()
+                        @ProvidedCode.Trim()
                     }
                 
             
@@ -33,7 +33,7 @@ else if (!Tabs)
@LanguageCode.ToLanguageCodeString()
- +
@@ -41,9 +41,9 @@ else if (!Tabs)
                 
-                    @if (snippet is not null)
+                    @if (ProvidedCode is not null)
                     {
-                        @snippet.Trim()
+                        @ProvidedCode.Trim()
                     }
                 
             
@@ -57,33 +57,33 @@ else // Tabs = true Example - -
+ +
- +
View Source - +
- +
                         
-                            @if (snippet is not null)
+                            @if (ProvidedCode is not null)
                             {
-                                @snippet.Trim()
+                                @ProvidedCode.Trim()
                             }
                         
                     
-
+
} diff --git a/BlazorBootstrap.Demo.RCL/Components/Shared/Demo.razor.cs b/BlazorBootstrap.Demo.RCL/Components/Shared/Demo.razor.cs index d2b282d24..d751bfebc 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Shared/Demo.razor.cs +++ b/BlazorBootstrap.Demo.RCL/Components/Shared/Demo.razor.cs @@ -15,7 +15,10 @@ public partial class Demo : BlazorBootstrapComponentBase /// private DotNetObjectReference objRef = default!; - private string? snippet; + /// + /// Can be used if the code snippet is provided directly, rather than from a .razor file + /// + [Parameter] public string? ProvidedCode { get; set; } #endregion @@ -37,26 +40,22 @@ protected override async Task OnInitializedAsync() protected override async Task OnParametersSetAsync() { - if (snippet is null) - { - var resourceFullName = Type.FullName + ".razor"; + if (ProvidedCode is null) + { + var resourceName = Type.FullName + ".razor"; - using (var stream = Type.Assembly.GetManifestResourceStream(resourceFullName)!) + await using var stream = Type.Assembly.GetManifestResourceStream(resourceName); + try { - try - { - if (stream is null) - return; - - using (var reader = new StreamReader(stream)) - { - snippet = await reader.ReadToEndAsync(); - } - } - catch (Exception ex) - { - Console.WriteLine(ex.Message); - } + if (stream is null) + return; + + using var reader = new StreamReader(stream); + ProvidedCode = await reader.ReadToEndAsync(); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); } } } @@ -97,14 +96,12 @@ public void ResetCopyStatusJS() StateHasChanged(); } - private async Task CopyToClipboardAsync() => await JS.InvokeVoidAsync("copyToClipboard", snippet, objRef); + private ValueTask CopyToClipboardAsync() => JS.InvokeVoidAsync("copyToClipboard", ProvidedCode, objRef); #endregion #region Properties, Indexers - - protected override string? ClassNames => BuildClassNames(Class, ("bd-example-snippet bd-code-snippet", true)); - + [Inject] protected IJSRuntime JS { get; set; } = default!; [Parameter] public LanguageCode LanguageCode { get; set; } = LanguageCode.Razor; diff --git a/BlazorBootstrap.Demo.RCL/Components/Shared/Section.razor b/BlazorBootstrap.Demo.RCL/Components/Shared/Section.razor index f09066915..5fdaba8c6 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Shared/Section.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Shared/Section.razor @@ -3,8 +3,8 @@
@if (Size == HeadingSize.H2) diff --git a/BlazorBootstrap.Demo.RCL/Components/Shared/Section.razor.cs b/BlazorBootstrap.Demo.RCL/Components/Shared/Section.razor.cs index 115d9a92c..9f6203f6a 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Shared/Section.razor.cs +++ b/BlazorBootstrap.Demo.RCL/Components/Shared/Section.razor.cs @@ -17,7 +17,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender) if (firstRender && IsRenderComplete) { await Task.Delay(200); - await JSRuntime.InvokeVoidAsync("navigateToHeading"); + await JsRuntime.InvokeVoidAsync("navigateToHeading"); } await base.OnAfterRenderAsync(firstRender); @@ -25,7 +25,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender) private async Task OnClick() { - await JSRuntime.InvokeVoidAsync("navigateToHeading"); + await JsRuntime.InvokeVoidAsync("navigateToHeading"); } #endregion @@ -52,5 +52,11 @@ private async Task OnClick() [Parameter] public HeadingSize Size { get; set; } + + /// + /// Dependency injected Javascript Runtime + /// + [Inject] private IJSRuntime JsRuntime { get; set; } = default!; + #endregion } diff --git a/BlazorBootstrap.Demo.RCL/Enums/LanguageCode.cs b/BlazorBootstrap.Demo.RCL/Enums/LanguageCode.cs deleted file mode 100644 index 5ff099558..000000000 --- a/BlazorBootstrap.Demo.RCL/Enums/LanguageCode.cs +++ /dev/null @@ -1,68 +0,0 @@ -namespace BlazorBootstrap.Demo.RCL; - -/// -/// -/// -public enum LanguageCode -{ - /// - /// ASP.NET (C#) - aspnet - /// - AspNet, - - /// - /// C# - csharp, cs, dotnet - /// - CSharp, - - /// - /// CSS - css - /// - Css, - - /// - /// HTML - html - /// - HTML, - - /// - /// JavaScript - javascript, js - /// - JavaScript, - - /// - /// JSON - json - /// - JSON, - - /// - /// JSONP - jsonp - /// - JSONP, - - /// - /// Markdown - md - /// - Markdown, - - /// - /// PowerShell - powershell - /// - PowerShell, - - /// - /// Razor C# - cshtml, razor - /// - Razor, - - /// - /// Text - none - /// - Text, - - /// - /// YAML - yaml, yml - /// - YAML -} - diff --git a/BlazorBootstrap.Demo.RCL/Extensions/EnumExtensions.cs b/BlazorBootstrap.Demo.RCL/Extensions/EnumExtensions.cs index f84671155..d6ea6e76b 100644 --- a/BlazorBootstrap.Demo.RCL/Extensions/EnumExtensions.cs +++ b/BlazorBootstrap.Demo.RCL/Extensions/EnumExtensions.cs @@ -8,15 +8,15 @@ public static class EnumExtensions LanguageCode.AspNet => "language-aspnet", LanguageCode.CSharp => "language-csharp", LanguageCode.Css => "language-css", - LanguageCode.HTML => "language-html", + LanguageCode.Html => "language-html", LanguageCode.JavaScript => "language-js", - LanguageCode.JSON => "language-json", - LanguageCode.JSONP => "language-jsonp", + LanguageCode.Json => "language-json", + LanguageCode.Jsonp => "language-jsonp", LanguageCode.Markdown => "language-md", LanguageCode.PowerShell => "language-powershell", LanguageCode.Razor => "language-razor", - LanguageCode.Text => "language-none", - LanguageCode.YAML => "language-yaml", + LanguageCode.StructuredText => "language-none", + LanguageCode.Yaml => "language-yaml", _ => null }; @@ -26,15 +26,15 @@ public static class EnumExtensions LanguageCode.AspNet => "ASP.NET", LanguageCode.CSharp => "C#", LanguageCode.Css => "CSS", - LanguageCode.HTML => "HTML", + LanguageCode.Html => "HTML", LanguageCode.JavaScript => "JS", - LanguageCode.JSON => "JSON", - LanguageCode.JSONP => "JSONP", + LanguageCode.Json => "JSON", + LanguageCode.Jsonp => "JSONP", LanguageCode.Markdown => "Markdown", LanguageCode.PowerShell => "PowerShell", LanguageCode.Razor => "Razor", - LanguageCode.Text => "Text", - LanguageCode.YAML => "yaml", + LanguageCode.StructuredText => "Text", + LanguageCode.Yaml => "yaml", _ => null }; } diff --git a/BlazorBootstrap.Demo.RCL/Services/CustomerService.cs b/BlazorBootstrap.Demo.RCL/Services/CustomerService.cs index 1a08c47aa..9b37e15ce 100644 --- a/BlazorBootstrap.Demo.RCL/Services/CustomerService.cs +++ b/BlazorBootstrap.Demo.RCL/Services/CustomerService.cs @@ -9,22 +9,22 @@ public CustomerService(HttpClient httpClient) _httpClient = httpClient; } - public async Task> GetCustomersAsync(FilterItem filter, CancellationToken cancellationToken = default) + public async Task> GetCustomersAsync(FilterItem filter, CancellationToken cancellationToken = default) { var customers = await _httpClient.GetFromJsonAsync("sample-data/customer/customer.json", cancellationToken); if (customers is null) - return Enumerable.Empty(); + return Array.Empty(); var parameterExpression = Expression.Parameter(typeof(Customer2)); // second param optional var lambda = ExpressionExtensions.GetExpressionDelegate(parameterExpression, filter); - return customers.Where(lambda!.Compile()).OrderBy(customer => customer.CustomerName); + return customers.Where(lambda!.Compile()).OrderBy(customer => customer.CustomerName).ToArray(); } - public async Task, int>> GetCustomersAsync(IEnumerable filters, int pageNumber, int pageSize, string sortKey, SortDirection sortDirection, CancellationToken cancellationToken = default) + public async Task, int>> GetCustomersAsync(IReadOnlyCollection filters, int pageNumber, int pageSize, string sortKey, SortDirection sortDirection, CancellationToken cancellationToken = default) { - var customers = await _httpClient.GetFromJsonAsync>("sample-data/customer/customer.json", cancellationToken); + var customers = await _httpClient.GetFromJsonAsync>("sample-data/customer/customer.json", cancellationToken); if (customers is null) - return new(Enumerable.Empty(), 0); + return new(Array.Empty(), 0); // apply filters if (filters is not null && filters.Any()) @@ -39,66 +39,66 @@ public async Task, int>> GetCustomersAsync(IEnumera else lambda = lambda.And(ExpressionExtensions.GetExpressionDelegate(parameterExpression, filter)!); } - customers = customers.Where(lambda!.Compile()); + customers = customers.Where(lambda!.Compile()).ToArray(); } // apply sorting then paging if (string.IsNullOrEmpty(sortKey) || sortDirection == SortDirection.None) { - return new(customers.Skip((pageNumber - 1) * pageSize).Take(pageSize), customers.Count()); + return new(customers.Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), customers.Count()); } else if (sortKey == "CustomerId") { if (sortDirection == SortDirection.Ascending) - return new(customers.OrderBy(e => e.CustomerId).Skip((pageNumber - 1) * pageSize).Take(pageSize), customers.Count()); + return new(customers.OrderBy(e => e.CustomerId).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), customers.Count()); else if (sortDirection == SortDirection.Descending) - return new(customers.OrderByDescending(e => e.CustomerId).Skip((pageNumber - 1) * pageSize).Take(pageSize), customers.Count()); + return new(customers.OrderByDescending(e => e.CustomerId).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), customers.Count()); } else if (sortKey == "CustomerName") { if (sortDirection == SortDirection.Ascending) - return new(customers.OrderBy(e => e.CustomerName).Skip((pageNumber - 1) * pageSize).Take(pageSize), customers.Count()); + return new(customers.OrderBy(e => e.CustomerName).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), customers.Count()); else if (sortDirection == SortDirection.Descending) - return new(customers.OrderByDescending(e => e.CustomerName).Skip((pageNumber - 1) * pageSize).Take(pageSize), customers.Count()); + return new(customers.OrderByDescending(e => e.CustomerName).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), customers.Count()); } else if (sortKey == "Phone") { if (sortDirection == SortDirection.Ascending) - return new(customers.OrderBy(e => e.Phone).Skip((pageNumber - 1) * pageSize).Take(pageSize), customers.Count()); + return new(customers.OrderBy(e => e.Phone).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), customers.Count()); else if (sortDirection == SortDirection.Descending) - return new(customers.OrderByDescending(e => e.Phone).Skip((pageNumber - 1) * pageSize).Take(pageSize), customers.Count()); + return new(customers.OrderByDescending(e => e.Phone).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), customers.Count()); } else if (sortKey == "Email") { if (sortDirection == SortDirection.Ascending) - return new(customers.OrderBy(e => e.Email).Skip((pageNumber - 1) * pageSize).Take(pageSize), customers.Count()); + return new(customers.OrderBy(e => e.Email).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), customers.Count()); else if (sortDirection == SortDirection.Descending) - return new(customers.OrderByDescending(e => e.Email).Skip((pageNumber - 1) * pageSize).Take(pageSize), customers.Count()); + return new(customers.OrderByDescending(e => e.Email).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), customers.Count()); } else if (sortKey == "Address") { if (sortDirection == SortDirection.Ascending) - return new(customers.OrderBy(e => e.Address).Skip((pageNumber - 1) * pageSize).Take(pageSize), customers.Count()); + return new(customers.OrderBy(e => e.Address).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), customers.Count()); else if (sortDirection == SortDirection.Descending) - return new(customers.OrderByDescending(e => e.Address).Skip((pageNumber - 1) * pageSize).Take(pageSize), customers.Count()); + return new(customers.OrderByDescending(e => e.Address).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), customers.Count()); } else if (sortKey == "PostalZip") { if (sortDirection == SortDirection.Ascending) - return new(customers.OrderBy(e => e.PostalZip).Skip((pageNumber - 1) * pageSize).Take(pageSize), customers.Count()); + return new(customers.OrderBy(e => e.PostalZip).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), customers.Count()); else if (sortDirection == SortDirection.Descending) - return new(customers.OrderByDescending(e => e.PostalZip).Skip((pageNumber - 1) * pageSize).Take(pageSize), customers.Count()); + return new(customers.OrderByDescending(e => e.PostalZip).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), customers.Count()); } else if (sortKey == "Country") { if (sortDirection == SortDirection.Ascending) - return new(customers.OrderBy(e => e.Country).Skip((pageNumber - 1) * pageSize).Take(pageSize), customers.Count()); + return new(customers.OrderBy(e => e.Country).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), customers.Count()); else if (sortDirection == SortDirection.Descending) - return new(customers.OrderByDescending(e => e.Country).Skip((pageNumber - 1) * pageSize).Take(pageSize), customers.Count()); + return new(customers.OrderByDescending(e => e.Country).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), customers.Count()); } else - return new(customers.Skip((pageNumber - 1) * pageSize).Take(pageSize), customers.Count()); + return new(customers.Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), customers.Count()); - return new(customers, customers.Count()); + return new(customers.ToArray(), customers.Count()); } } diff --git a/BlazorBootstrap.Demo.RCL/Services/EmployeeService.cs b/BlazorBootstrap.Demo.RCL/Services/EmployeeService.cs index 66f171899..bec77a30f 100644 --- a/BlazorBootstrap.Demo.RCL/Services/EmployeeService.cs +++ b/BlazorBootstrap.Demo.RCL/Services/EmployeeService.cs @@ -2,14 +2,14 @@ public class EmployeeService : IEmployeeService { - public Tuple, int> GetEmployees( - IEnumerable filters, + public Tuple, int> GetEmployees( + IReadOnlyCollection? filters, int pageNumber, int pageSize, string sortKey, SortDirection sortDirection) { - IEnumerable employees = new List + IReadOnlyCollection employees = new List { new Employee { Id = 101, FirstName = "Eathan", LastName = "Ellis", Designation = "Associate Architect", Salary = 19000, DOJ = new DateTime(1998, 11, 17), IsActive = true }, new Employee { Id = 103, FirstName = "Cohan", LastName = "Wheatley", Designation = "Senior DevOps Engineer", Salary = 19000, DOJ = new DateTime(1985, 1, 5), IsActive = true }, @@ -31,7 +31,7 @@ public Tuple, int> GetEmployees( }; // apply filters - if (filters is not null && filters.Any()) + if (filters is not null && filters.Count > 0) { var parameterExpression = Expression.Parameter(typeof(Employee)); // second param optional Expression>? lambda = null; @@ -43,64 +43,64 @@ public Tuple, int> GetEmployees( else lambda = lambda.And(ExpressionExtensions.GetExpressionDelegate(parameterExpression, filter)!); } - employees = employees.Where(lambda!.Compile()); + employees = employees.Where(lambda!.Compile()).ToArray(); } // apply sorting then paging if (sortKey == "Id") { if (sortDirection == SortDirection.Ascending) - return new(employees.OrderBy(e => e.Id).Skip((pageNumber - 1) * pageSize).Take(pageSize), employees.Count()); - else if (sortDirection == SortDirection.Descending) - return new(employees.OrderByDescending(e => e.Id).Skip((pageNumber - 1) * pageSize).Take(pageSize), employees.Count()); + return new(employees.OrderBy(e => e.Id).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), employees.Count); + if (sortDirection == SortDirection.Descending) + return new(employees.OrderByDescending(e => e.Id).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), employees.Count); } else if (sortKey == "FirstName") { if (sortDirection == SortDirection.Ascending) - return new(employees.OrderBy(e => e.FirstName).Skip((pageNumber - 1) * pageSize).Take(pageSize), employees.Count()); - else if (sortDirection == SortDirection.Descending) - return new(employees.OrderByDescending(e => e.FirstName).Skip((pageNumber - 1) * pageSize).Take(pageSize), employees.Count()); + return new(employees.OrderBy(e => e.FirstName).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), employees.Count); + if (sortDirection == SortDirection.Descending) + return new(employees.OrderByDescending(e => e.FirstName).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), employees.Count); } else if (sortKey == "LastName") { if (sortDirection == SortDirection.Ascending) - return new(employees.OrderBy(e => e.LastName).Skip((pageNumber - 1) * pageSize).Take(pageSize), employees.Count()); - else if (sortDirection == SortDirection.Descending) - return new(employees.OrderByDescending(e => e.LastName).Skip((pageNumber - 1) * pageSize).Take(pageSize), employees.Count()); + return new(employees.OrderBy(e => e.LastName).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), employees.Count); + + return new(employees.OrderByDescending(e => e.LastName).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), employees.Count); } else if (sortKey == "Designation") { if (sortDirection == SortDirection.Ascending) - return new(employees.OrderBy(e => e.Designation).Skip((pageNumber - 1) * pageSize).Take(pageSize), employees.Count()); - else if (sortDirection == SortDirection.Descending) - return new(employees.OrderByDescending(e => e.Designation).Skip((pageNumber - 1) * pageSize).Take(pageSize), employees.Count()); + return new(employees.OrderBy(e => e.Designation).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), employees.Count); + if (sortDirection == SortDirection.Descending) + return new(employees.OrderByDescending(e => e.Designation).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), employees.Count); } else if (sortKey == "Salary") { if (sortDirection == SortDirection.Ascending) - return new(employees.OrderBy(e => e.Salary).Skip((pageNumber - 1) * pageSize).Take(pageSize), employees.Count()); - else if (sortDirection == SortDirection.Descending) - return new(employees.OrderByDescending(e => e.Salary).Skip((pageNumber - 1) * pageSize).Take(pageSize), employees.Count()); + return new(employees.OrderBy(e => e.Salary).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), employees.Count); + if (sortDirection == SortDirection.Descending) + return new(employees.OrderByDescending(e => e.Salary).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), employees.Count); } else if (sortKey == "DOJ") { if (sortDirection == SortDirection.Ascending) - return new(employees.OrderBy(e => e.DOJ).Skip((pageNumber - 1) * pageSize).Take(pageSize), employees.Count()); - else if (sortDirection == SortDirection.Descending) - return new(employees.OrderByDescending(e => e.DOJ).Skip((pageNumber - 1) * pageSize).Take(pageSize), employees.Count()); + return new(employees.OrderBy(e => e.DOJ).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), employees.Count); + if (sortDirection == SortDirection.Descending) + return new(employees.OrderByDescending(e => e.DOJ).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), employees.Count); } else if (sortKey == "IsActive") { if (sortDirection == SortDirection.Ascending) - return new(employees.OrderBy(e => e.IsActive).Skip((pageNumber - 1) * pageSize).Take(pageSize), employees.Count()); - else if (sortDirection == SortDirection.Descending) - return new(employees.OrderByDescending(e => e.IsActive).Skip((pageNumber - 1) * pageSize).Take(pageSize), employees.Count()); + return new(employees.OrderBy(e => e.IsActive).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), employees.Count); + if (sortDirection == SortDirection.Descending) + return new(employees.OrderByDescending(e => e.IsActive).Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), employees.Count); } else if (string.IsNullOrEmpty(sortKey)) { - return new(employees.Skip((pageNumber - 1) * pageSize).Take(pageSize), employees.Count()); + return new(employees.Skip((pageNumber - 1) * pageSize).Take(pageSize).ToArray(), employees.Count); } - return new(employees, employees.Count()); + return new(employees, employees.Count); } } diff --git a/BlazorBootstrap.Demo.RCL/Services/ICustomerService.cs b/BlazorBootstrap.Demo.RCL/Services/ICustomerService.cs index 27b29ab52..0743fbf71 100644 --- a/BlazorBootstrap.Demo.RCL/Services/ICustomerService.cs +++ b/BlazorBootstrap.Demo.RCL/Services/ICustomerService.cs @@ -2,6 +2,6 @@ public interface ICustomerService { - public Task> GetCustomersAsync(FilterItem filter, CancellationToken cancellationToken = default); - public Task, int>> GetCustomersAsync(IEnumerable filters, int pageNumber, int pageSize, string sortKey, SortDirection sortDirection, CancellationToken cancellationToken = default); + public Task> GetCustomersAsync(FilterItem filter, CancellationToken cancellationToken = default); + public Task, int>> GetCustomersAsync(IReadOnlyCollection filters, int pageNumber, int pageSize, string sortKey, SortDirection sortDirection, CancellationToken cancellationToken = default); } diff --git a/BlazorBootstrap.Demo.RCL/Services/IEmployeeService.cs b/BlazorBootstrap.Demo.RCL/Services/IEmployeeService.cs index 4b814ddb1..d81006ecf 100644 --- a/BlazorBootstrap.Demo.RCL/Services/IEmployeeService.cs +++ b/BlazorBootstrap.Demo.RCL/Services/IEmployeeService.cs @@ -2,5 +2,5 @@ public interface IEmployeeService { - public Tuple, int> GetEmployees(IEnumerable filters, int pageNumber, int pageSize, string sortKey, SortDirection sortDirection); + public Tuple, int> GetEmployees(IReadOnlyCollection filters, int pageNumber, int pageSize, string sortKey, SortDirection sortDirection); } diff --git a/blazorbootstrap.sln.DotSettings b/blazorbootstrap.sln.DotSettings new file mode 100644 index 000000000..24083def9 --- /dev/null +++ b/blazorbootstrap.sln.DotSettings @@ -0,0 +1,4 @@ + + True + True + True \ No newline at end of file diff --git a/blazorbootstrap/BlazorBootstrap.csproj b/blazorbootstrap/BlazorBootstrap.csproj index ba6f40e44..aed077f20 100644 --- a/blazorbootstrap/BlazorBootstrap.csproj +++ b/blazorbootstrap/BlazorBootstrap.csproj @@ -15,18 +15,31 @@ Vikram Reddy Copyright © 2024 Blazor Bootstrap + true - net6.0;net8.0;net9.0 + net6.0;net7.0;net8.0;net9.0 enable enable Library true - 10.0 128X128.png README.md git https://github.com/vikramlearning/blazorbootstrap/releases + True + 10.0 + 11.0 + 11.0 + true + + + + 7 + + + + 7 @@ -46,17 +59,18 @@ - + + + + - - + - \ No newline at end of file diff --git a/blazorbootstrap/Components/AI/Chat/AIChat.razor b/blazorbootstrap/Components/AI/Chat/AIChat.razor deleted file mode 100644 index 254561235..000000000 --- a/blazorbootstrap/Components/AI/Chat/AIChat.razor +++ /dev/null @@ -1,63 +0,0 @@ -@namespace BlazorBootstrap -@inherits BlazorBootstrapComponentBase - - \ No newline at end of file diff --git a/blazorbootstrap/Components/AI/Chat/AIChat.razor.cs b/blazorbootstrap/Components/AI/Chat/AIChat.razor.cs deleted file mode 100644 index cc8c1ec77..000000000 --- a/blazorbootstrap/Components/AI/Chat/AIChat.razor.cs +++ /dev/null @@ -1,156 +0,0 @@ -namespace BlazorBootstrap; - -public partial class AIChat : BlazorBootstrapComponentBase -{ - #region Fields and Constants - - private readonly List conversationHistory = new(); - private string? apiKey; - private string? apiVersion; - private string? currentCompletion; - private string? deploymentName; - private string? endpoint; - private bool isRequestInProgress; - private DotNetObjectReference? objRef; - private string userPrompt = string.Empty; - - #endregion - - #region Methods - - protected override async Task OnInitializedAsync() - { - var configurationSection = Configuration.GetSection("AzureOpenAI"); - - if (Configuration is null) - throw new ArgumentException("`AzureOpenAI` section was not found in the application configuration."); - - endpoint = configurationSection["Endpoint"]; - - if (endpoint is null) - throw new ArgumentException("`Endpoint` key/value was not found in the 'AzureOpenAI' section of the application configuration."); - - deploymentName = configurationSection["DeploymentName"]; - - if (deploymentName is null) - throw new ArgumentException("`DeploymentName` key/value was not found in the 'AzureOpenAI' section of the application configuration."); - - apiKey = configurationSection["ApiKey"]; - - if (apiKey is null) - throw new ArgumentException("`ApiKey` key/value was not found in the 'AzureOpenAI' section of the application configuration."); - - apiVersion = configurationSection["ApiVersion"]; - - if (apiVersion is null) - throw new ArgumentException("`ApiVersion` key/value was not found in the 'AzureOpenAI' section of the application configuration."); - - objRef ??= DotNetObjectReference.Create(this); - - await base.OnInitializedAsync(); - } - - [JSInvokable] - public async Task ChartCompletetionsStreamJs(string content, bool done) - { - ClearInput(); - - if (isRequestInProgress) - isRequestInProgress = false; - - if (done) - { - conversationHistory.Add(new OpenAIChatMessage("system", currentCompletion!)); - currentCompletion = ""; - await InvokeAsync(StateHasChanged); - await JSRuntime.InvokeVoidAsync(BlazorBootstrapInterop.ScrollToElementBottom, Id); - - return; - } - - currentCompletion += content; - await InvokeAsync(StateHasChanged); - await JSRuntime.InvokeVoidAsync(BlazorBootstrapInterop.ScrollToElementBottom, Id); - } - - private void ClearInput() => userPrompt = string.Empty; - - private async Task CreateCompletionAsync(List messages) - { - isRequestInProgress = true; - - var payload = new OpenAIChatPayload { Messages = messages, MaximumTokens = MaximumTokens, Temperature = Temperature, TopP = TopP }; - - try - { - await JSRuntime.InvokeVoidAsync( - AIChatInterop.AzureOpenAIChatCompletions, - $"{endpoint}openai/deployments/{deploymentName}/chat/completions?api-version={apiVersion}", - apiKey, - payload, - objRef! - ); - } - catch - { - isRequestInProgress = false; - } - } - - private async Task SendPromptAsync() - { - if (string.IsNullOrWhiteSpace(userPrompt)) - return; - - var message = new OpenAIChatMessage("user", userPrompt); - conversationHistory.Add(message); - - await CreateCompletionAsync(new List { message }); - } - - #endregion - - #region Properties, Indexers - - protected override string? ClassNames => - BuildClassNames( - Class, - (BootstrapClass.Container, true) - ); - - protected override string? StyleNames => - BuildStyleNames( - Style, - //("min-height:200px", true), - //("max-height:400px", true), - ("overflow-x:hidden", true), - ("overflow-y:auto", true) - ); - - /// - /// The maximum number of tokens to generate shared between the prompt and completion. - /// The exact limit varies by model. (One token is roughly 4 characters for standard English text) - /// Minimum 1 and the maximum tokens is 4096. - /// - /// Default value is 2048. This value is limited by gpt-3.5-turbo. - [Parameter] - public long MaximumTokens { get; set; } = 2048; - - /// - /// Controls randomness: Lowering results in less random completions. - /// As the temperature approaches zero, the model will become deterministic and repetitive. - /// Minimum 1 and the maximum is 2. - /// - /// Default value is 1. - [Parameter] - public double Temperature { get; set; } = 1; - - /// - /// Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. - /// - /// Default value is 1. - [Parameter] - public double TopP { get; set; } = 1; - - #endregion -} diff --git a/blazorbootstrap/Components/AI/Chat/AIChatInterop.cs.cs b/blazorbootstrap/Components/AI/Chat/AIChatInterop.cs.cs deleted file mode 100644 index 8dc241100..000000000 --- a/blazorbootstrap/Components/AI/Chat/AIChatInterop.cs.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace BlazorBootstrap; - -public class AIChatInterop -{ - #region Fields and Constants - - private const string Prefix = "window.blazorBootstrap.ai."; - - public const string AzureOpenAIChatCompletions = Prefix + "azureOpenAI.chat.completions"; - - #endregion -} diff --git a/blazorbootstrap/Components/Accordion/Accordion.razor b/blazorbootstrap/Components/Accordion/Accordion.razor index 5c8f44be7..e5f3ba429 100644 --- a/blazorbootstrap/Components/Accordion/Accordion.razor +++ b/blazorbootstrap/Components/Accordion/Accordion.razor @@ -2,7 +2,10 @@ @inherits BlazorBootstrapComponentBase -
- @ChildContent +
+ @if (ChildContent != null) + { + @ChildContent + }
diff --git a/blazorbootstrap/Components/Accordion/Accordion.razor.cs b/blazorbootstrap/Components/Accordion/Accordion.razor.cs index 8fe07966b..b20439f8f 100644 --- a/blazorbootstrap/Components/Accordion/Accordion.razor.cs +++ b/blazorbootstrap/Components/Accordion/Accordion.razor.cs @@ -1,5 +1,9 @@ namespace BlazorBootstrap; +/// +/// Build vertically collapsing accordions in combination with our > component.
+/// The accordion is based on the Bootstrap Accordion component. +///
public partial class Accordion : BlazorBootstrapComponentBase { #region Fields and Constants @@ -9,15 +13,7 @@ public partial class Accordion : BlazorBootstrapComponentBase #endregion #region Methods - - /// - protected override async ValueTask DisposeAsyncCore(bool disposing) - { - if (disposing) items = null; - - await base.DisposeAsyncCore(disposing); - } - + /// /// Hides the by index. /// @@ -55,7 +51,7 @@ public async Task HideAllAccordionItemsAsync() { if (!items?.Any() ?? false) return; - foreach (var accordionItem in items!) + foreach (var accordionItem in items!.ToList()) if (accordionItem is not null) await accordionItem.HideAsync(); } @@ -117,7 +113,7 @@ public async Task ShowAccordionItemByNameAsync(string accordionItemName) } /// - /// Shows all instances if AlwaysOpen is true. + /// Shows all instances if is . /// public async Task ShowAllAccordionItemsAsync() { @@ -161,52 +157,71 @@ public async Task ShowLastAccordionItemAsync() /// The AccordionItem to add. internal void Add(AccordionItem accordionItem) { - if (items is null) - items = new List(); - - if (accordionItem is not null) - items.Add(accordionItem); + items ??= new List(); + items.Add(accordionItem); + } + + /// + /// Parameters are loaded manually for sake of performance. + /// + /// + public override Task SetParametersAsync(ParameterView parameters) + { + foreach (var parameter in parameters) + { + switch (parameter.Name) + { + case var _ when String.Equals(parameter.Name, nameof(AlwaysOpen), StringComparison.OrdinalIgnoreCase): AlwaysOpen = (bool)parameter.Value; break; + case var _ when String.Equals(parameter.Name, nameof(ChildContent), StringComparison.OrdinalIgnoreCase): ChildContent = (RenderFragment)parameter.Value; break; + case var _ when String.Equals(parameter.Name, nameof(Class), StringComparison.OrdinalIgnoreCase): Class = (string)parameter.Value; break; + case var _ when String.Equals(parameter.Name, nameof(Flush), StringComparison.OrdinalIgnoreCase): Flush = (bool)parameter.Value; break; + case var _ when String.Equals(parameter.Name, nameof(Id), StringComparison.OrdinalIgnoreCase): Id = (string)parameter.Value; break; + case var _ when String.Equals(parameter.Name, nameof(OnHidden), StringComparison.OrdinalIgnoreCase): OnHidden = (EventCallback)parameter.Value; break; + case var _ when String.Equals(parameter.Name, nameof(OnHiding), StringComparison.OrdinalIgnoreCase): OnHiding = (EventCallback)parameter.Value; break; + case var _ when String.Equals(parameter.Name, nameof(OnShowing), StringComparison.OrdinalIgnoreCase): OnShowing = (EventCallback)parameter.Value; break; + case var _ when String.Equals(parameter.Name, nameof(OnShown), StringComparison.OrdinalIgnoreCase): OnShown = (EventCallback)parameter.Value; break; + default: + AdditionalAttributes[parameter.Name] = parameter.Value; + break; + } + } + + return base.SetParametersAsync(ParameterView.Empty); } #endregion - #region Properties, Indexers - - protected override string? ClassNames => - BuildClassNames(Class, - (BootstrapClass.Accordion, true), - (BootstrapClass.AccordionFlush, Flush)); + #region Properties, Indexers /// /// If , accordion items stay open when another item is opened. /// /// - /// Default value is false. + /// Default value is . /// [Parameter] public bool AlwaysOpen { get; set; } - + /// /// Gets or sets the content to be rendered within the component. /// /// - /// Default value is null. + /// Default value is . /// [Parameter] [EditorRequired] - public RenderFragment ChildContent { get; set; } = default!; + public RenderFragment? ChildContent { get; set; } /// /// If , removes borders and rounded corners to render accordions edge-to-edge with their parent container. /// /// - /// Default value is false. + /// Default value is . /// - [Parameter] - public bool Flush { get; set; } + [Parameter] public bool Flush { get; set; } /// - /// This event is fired when a accordion item has been hidden from the user (will wait for CSS transitions to complete). + /// This event is fired when an accordion item has been hidden from the user (will wait for CSS transitions to complete). /// [Parameter] public EventCallback OnHidden { get; set; } @@ -224,7 +239,7 @@ internal void Add(AccordionItem accordionItem) public EventCallback OnShowing { get; set; } /// - /// This event is fired when a accordion item has been made visible to the user (will wait for CSS transitions to + /// This event is fired when an accordion item has been made visible to the user (will wait for CSS transitions to /// complete). /// [Parameter] diff --git a/blazorbootstrap/Components/Accordion/AccordionItem.razor b/blazorbootstrap/Components/Accordion/AccordionItem.razor index a28a54dde..52b1d2edb 100644 --- a/blazorbootstrap/Components/Accordion/AccordionItem.razor +++ b/blazorbootstrap/Components/Accordion/AccordionItem.razor @@ -1,9 +1,9 @@ @namespace BlazorBootstrap @inherits BlazorBootstrapComponentBase -
+

-

diff --git a/blazorbootstrap/Components/Accordion/AccordionItem.razor.cs b/blazorbootstrap/Components/Accordion/AccordionItem.razor.cs index b691486ac..4680c8e87 100644 --- a/blazorbootstrap/Components/Accordion/AccordionItem.razor.cs +++ b/blazorbootstrap/Components/Accordion/AccordionItem.razor.cs @@ -1,5 +1,8 @@ namespace BlazorBootstrap; +/// +/// Represents an item within an . +/// public partial class AccordionItem : BlazorBootstrapComponentBase { #region Fields and Constants @@ -11,25 +14,24 @@ public partial class AccordionItem : BlazorBootstrapComponentBase #endregion #region Methods - - protected override void OnInitialized() - { - Id = IdUtility.GetNextId(); // This is required - Parent.Add(this); - } - + + + /// protected override void OnParametersSet() { - if (TitleTemplate is not null && !string.IsNullOrWhiteSpace(Title)) throw new InvalidOperationException($"{nameof(AccordionItem)} requires one of {nameof(TitleTemplate)} or {nameof(Title)}, but both were specified."); + if (TitleTemplate is not null && !string.IsNullOrWhiteSpace(Title)) + throw new InvalidOperationException($"{nameof(AccordionItem)} requires one of {nameof(TitleTemplate)} or {nameof(Title)}, but both were specified."); + + base.OnParametersSet(); } - internal async Task HideAsync() => await collapse.HideAsync(); + internal ValueTask HideAsync() => collapse.HideAsync(); - internal async Task ShowAsync() => await collapse.ShowAsync(); + internal ValueTask ShowAsync() => collapse.ShowAsync(); private async Task OnCollapseHiddenAsync() { - if (Parent is not null && Parent.OnHidden.HasDelegate) + if (Parent.OnHidden.HasDelegate) await Parent.OnHidden.InvokeAsync(new AccordionEventArgs(Name, Title)); } @@ -37,7 +39,7 @@ private async Task OnCollapseHidingAsync() { isCollapsed = true; - if (Parent is not null && Parent.OnHiding.HasDelegate) + if (Parent.OnHiding.HasDelegate) await Parent.OnHiding.InvokeAsync(new AccordionEventArgs(Name, Title)); } @@ -45,66 +47,94 @@ private async Task OnCollapseShowingAsync() { isCollapsed = false; - if (Parent is not null && Parent.OnShowing.HasDelegate) + if (Parent.OnShowing.HasDelegate) await Parent.OnShowing.InvokeAsync(new AccordionEventArgs(Name, Title)); } private async Task OnCollapseShownAsync() { - if (Parent is not null && Parent.OnShown.HasDelegate) + if (Parent.OnShown.HasDelegate) await Parent.OnShown.InvokeAsync(new AccordionEventArgs(Name, Title)); } - private async Task ToggleAsync() => await collapse.ToggleAsync(); + private ValueTask ToggleAsync() => collapse.ToggleAsync(); - #endregion - #region Properties, Indexers + /// + /// Parameters are loaded manually for sake of performance. + /// + /// + public override Task SetParametersAsync(ParameterView parameters) + { + Id = IdUtility.GetNextId(); // This is required + + foreach (var parameter in parameters) + { + switch (parameter.Name) + { + case var _ when String.Equals(parameter.Name, nameof(Active), StringComparison.OrdinalIgnoreCase): Active = (bool)parameter.Value; break; + case var _ when String.Equals(parameter.Name, nameof(ChildContent), StringComparison.OrdinalIgnoreCase): ChildContent = (RenderFragment)parameter.Value; break; + case var _ when String.Equals(parameter.Name, nameof(Class), StringComparison.OrdinalIgnoreCase): Class = (string)parameter.Value; break; + case var _ when String.Equals(parameter.Name, nameof(Id), StringComparison.OrdinalIgnoreCase): Id = (string)parameter.Value; break; + case var _ when String.Equals(parameter.Name, nameof(Name), StringComparison.OrdinalIgnoreCase): Name = (string)parameter.Value; break; + case var _ when String.Equals(parameter.Name, nameof(Parent), StringComparison.OrdinalIgnoreCase): Parent = (Accordion)parameter.Value; break; + case var _ when String.Equals(parameter.Name, nameof(Title), StringComparison.OrdinalIgnoreCase): Title = (string)parameter.Value; break; + case var _ when String.Equals(parameter.Name, nameof(TitleTemplate), StringComparison.OrdinalIgnoreCase): TitleTemplate = (RenderFragment)parameter.Value; break; + default: + AdditionalAttributes[parameter.Name] = parameter.Value; + break; + } + } + + Parent.Add(this); + return base.SetParametersAsync(ParameterView.Empty); + } + - protected override string? ClassNames => - BuildClassNames(Class, (BootstrapClass.AccordionItem, true)); + #endregion + #region Properties, Indexers + /// /// Gets or sets the active state. /// /// - /// Default value is false. + /// Default value is . /// - [Parameter] - public bool Active { get; set; } - - private string buttonCollapsedStateCSSClass => isCollapsed ? "collapsed" : string.Empty; + [Parameter] public bool Active { get; set; } + + private string ButtonCollapsedStateCssClass => isCollapsed ? "collapsed" : string.Empty; /// /// Gets or sets the content to be rendered within the component. /// /// - /// Default value is null. + /// Default value is . /// [Parameter] [EditorRequired] - public RenderFragment Content { get; set; } = default!; + public RenderFragment? ChildContent { get; set; } /// /// Gets or sets the name. /// /// - /// Default value is null. + /// Default value is . /// [Parameter] - public string Name { get; set; } = default!; + public string? Name { get; set; } = default!; /// /// Gets or sets the parent. /// - [CascadingParameter] - internal Accordion Parent { get; set; } = default!; + [CascadingParameter, EditorRequired] + internal Accordion Parent { get; set; } = default!; /// /// Gets or sets the title. /// /// - /// Default value is null. + /// Default value is . /// [Parameter] public string Title { get; set; } = default!; @@ -113,10 +143,10 @@ private async Task OnCollapseShownAsync() /// Gets or sets the title template. /// /// - /// Default value is null. + /// Default value is . /// [Parameter] - public RenderFragment TitleTemplate { get; set; } = default!; - + public RenderFragment? TitleTemplate { get; set; } = default!; + #endregion } diff --git a/blazorbootstrap/Components/Alert/Alert.razor b/blazorbootstrap/Components/Alert/Alert.razor index 25b565c6d..7b54472b6 100644 --- a/blazorbootstrap/Components/Alert/Alert.razor +++ b/blazorbootstrap/Components/Alert/Alert.razor @@ -1,8 +1,11 @@ @namespace BlazorBootstrap @inherits BlazorBootstrapComponentBase -