From 3009f554c4e7ad3b11b0d00565499f778762a2b6 Mon Sep 17 00:00:00 2001 From: Saleh Yusefnejad Date: Tue, 3 Dec 2024 20:18:50 +0330 Subject: [PATCH 01/59] feat(blazorui): improve BitPanel #9351 (#9356) --- .../IServiceCollectionExtensions.cs | 2 +- .../Surfaces/Panel/BitPanelTests.cs | 53 +-- .../Navs/Breadcrumb/BitBreadcrumb.scss | 10 +- .../Navs/Pagination/BitPagination.scss | 10 +- .../Components/Surfaces/Panel/BitPanel.razor | 97 ++--- .../Surfaces/Panel/BitPanel.razor.cs | 137 +++++-- .../Components/Surfaces/Panel/BitPanel.scss | 107 ++---- .../Components/Surfaces/Panel/BitPanel.ts | 182 +++++++++ .../Panel/BitPanelJsRuntimeExtensions.cs | 14 + .../Surfaces/Panel/BitPanelPosition.cs | 5 +- .../Surfaces/Panel/BitPanelDemo.razor | 258 ++++++------- .../Surfaces/Panel/BitPanelDemo.razor.cs | 359 +++++++++--------- .../Surfaces/Panel/BitPanelDemo.razor.scss | 17 +- 13 files changed, 756 insertions(+), 495 deletions(-) create mode 100644 src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Panel/BitPanel.ts create mode 100644 src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Panel/BitPanelJsRuntimeExtensions.cs diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/IServiceCollectionExtensions.cs b/src/BlazorUI/Bit.BlazorUI.Extras/IServiceCollectionExtensions.cs index 108d64b637..0ae549d8eb 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/IServiceCollectionExtensions.cs +++ b/src/BlazorUI/Bit.BlazorUI.Extras/IServiceCollectionExtensions.cs @@ -9,7 +9,7 @@ public static class IServiceCollectionExtensions /// Registers required services of the Extras package of the BitBlazorUI components. /// /// - /// Tries to register the services as singleton, but only for the services can be singleton (e.g. the services that do not use IJSRuntime). + /// Tries to register the services as singleton, but only for the services that can be singleton (e.g. the services that do not use IJSRuntime). /// public static IServiceCollection AddBitBlazorUIExtrasServices(this IServiceCollection services, bool trySingleton = false) { diff --git a/src/BlazorUI/Bit.BlazorUI.Tests/Components/Surfaces/Panel/BitPanelTests.cs b/src/BlazorUI/Bit.BlazorUI.Tests/Components/Surfaces/Panel/BitPanelTests.cs index c2ef4de625..e7a3a7fbc8 100644 --- a/src/BlazorUI/Bit.BlazorUI.Tests/Components/Surfaces/Panel/BitPanelTests.cs +++ b/src/BlazorUI/Bit.BlazorUI.Tests/Components/Surfaces/Panel/BitPanelTests.cs @@ -1,5 +1,6 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; +using AngleSharp.Css.Dom; using Bunit; +using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Bit.BlazorUI.Tests.Components.Surfaces.Panel; @@ -12,42 +13,49 @@ public class BitPanelTests : BunitTestContext DataRow(false), DataRow(true) ] - public void BitPanelIsBlockingTest(bool isBlocking) + public void BitPanelBlockingTest(bool blocking) { var com = RenderComponent(parameters => { - parameters.Add(p => p.IsBlocking, isBlocking); + parameters.Add(p => p.Blocking, blocking); parameters.Add(p => p.IsOpen, isPanelOpen); parameters.Add(p => p.IsOpenChanged, HandleIsOpenChanged); }); - var bitPanel = com.FindAll(".bit-pnl"); - Assert.AreEqual(1, bitPanel.Count); + var container = com.Find(".bit-pnl-cnt"); + Assert.IsTrue(container.GetStyle().CssText.Contains("opacity: 1")); var overlayElement = com.Find(".bit-pnl-ovl"); overlayElement.Click(); - bitPanel = com.FindAll(".bit-pnl"); - Assert.AreEqual(isBlocking ? 1 : 0, bitPanel.Count); + container = com.Find(".bit-pnl-cnt"); + if (blocking) + { + Assert.IsTrue(container.GetStyle().CssText.Contains("opacity: 1")); + } + else + { + Assert.AreEqual("", container.GetStyle().CssText); + } } [DataTestMethod, DataRow(false), DataRow(true) ] - public void BitPanelIsModelessTest(bool isModeless) + public void BitPanelModelessTest(bool modeless) { var com = RenderComponent(parameters => { - parameters.Add(p => p.IsModeless, isModeless); + parameters.Add(p => p.Modeless, modeless); parameters.Add(p => p.IsOpen, true); }); var element = com.Find(".bit-pnl"); - Assert.AreEqual(element.Attributes["aria-modal"].Value, (isModeless is false).ToString()); + Assert.AreEqual(element.Attributes["aria-modal"].Value, (modeless is false).ToString()); var elementOverlay = com.FindAll(".bit-pnl-ovl"); - Assert.AreEqual(isModeless ? 0 : 1, elementOverlay.Count); + Assert.AreEqual(modeless ? 0 : 1, elementOverlay.Count); } [DataTestMethod, @@ -61,8 +69,8 @@ public void BitPanelIsOpenTest(bool isOpen) parameters.Add(p => p.IsOpen, isOpen); }); - var bitModel = com.FindAll(".bit-pnl"); - Assert.AreEqual(isOpen ? 1 : 0, bitModel.Count); + var container = com.Find(".bit-pnl-cnt"); + Assert.AreEqual(isOpen, container.GetStyle().CssText.Contains("opacity: 1")); } [DataTestMethod, @@ -178,14 +186,14 @@ public void BitPanelCloseWhenClickOutOfPanelTest() parameters.Add(p => p.IsOpenChanged, HandleIsOpenChanged); }); - var bitPanel = com.FindAll(".bit-pnl"); - Assert.AreEqual(1, bitPanel.Count); + var container = com.Find(".bit-pnl-cnt"); + Assert.IsTrue(container.GetStyle().CssText.Contains("opacity: 1")); var overlayElement = com.Find(".bit-pnl-ovl"); overlayElement.Click(); - bitPanel = com.FindAll(".bit-pnl"); - Assert.AreEqual(0, bitPanel.Count); + container = com.Find(".bit-pnl-cnt"); + Assert.AreEqual("", container.GetStyle().CssText); } [TestMethod] @@ -208,8 +216,8 @@ public void BitPanelOnDismissShouldWorkCorrect() } [DataTestMethod, - DataRow(BitPanelPosition.Right), - DataRow(BitPanelPosition.Left), + DataRow(BitPanelPosition.End), + DataRow(BitPanelPosition.Start), DataRow(BitPanelPosition.Top), DataRow(BitPanelPosition.Bottom), DataRow(null) @@ -229,12 +237,11 @@ public void BitPanelPositionTest(BitPanelPosition? position) var positionClass = position switch { - BitPanelPosition.Right => "bit-pnl-right", - BitPanelPosition.Left => "bit-pnl-left", + BitPanelPosition.End => "bit-pnl-end", + BitPanelPosition.Start => "bit-pnl-start", BitPanelPosition.Top => "bit-pnl-top", BitPanelPosition.Bottom => "bit-pnl-bottom", - - _ => "bit-pnl-right", + _ => "bit-pnl-end", }; Assert.IsTrue(PanelElement.ClassList.Contains(positionClass)); diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Navs/Breadcrumb/BitBreadcrumb.scss b/src/BlazorUI/Bit.BlazorUI/Components/Navs/Breadcrumb/BitBreadcrumb.scss index 68fba198dd..49baafcb2e 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Navs/Breadcrumb/BitBreadcrumb.scss +++ b/src/BlazorUI/Bit.BlazorUI/Components/Navs/Breadcrumb/BitBreadcrumb.scss @@ -4,6 +4,10 @@ white-space: nowrap; --bit-brc-div-transform: scaleX(1); + &.bit-rtl { + --bit-brc-div-transform: scaleX(-1); + } + &.bit-dis { cursor: default; font-weight: 400; @@ -49,10 +53,6 @@ transform: var(--bit-brc-div-transform); } -.bit-rtl { - --bit-brc-div-transform: scaleX(-1); -} - .bit-brc-obt { display: flex; cursor: pointer; @@ -176,4 +176,4 @@ .bit-brc-sel { font-weight: 600; -} \ No newline at end of file +} diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Navs/Pagination/BitPagination.scss b/src/BlazorUI/Bit.BlazorUI/Components/Navs/Pagination/BitPagination.scss index 45aaba6ff9..be21d2f680 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Navs/Pagination/BitPagination.scss +++ b/src/BlazorUI/Bit.BlazorUI/Components/Navs/Pagination/BitPagination.scss @@ -27,6 +27,11 @@ --bit-pgn-clr-btn-sel-bg-active: var(--bit-pgn-clr-sel-active); --bit-pgn-clr-btn-sel-brd-active: var(--bit-pgn-clr-sel-active); + &.bit-rtl { + --bit-pgn-ico-transform-end: scaleX(-1); + --bit-pgn-ico-transform-start: scaleX(1); + } + &.bit-dis { cursor: default; color: $clr-fg-dis; @@ -42,11 +47,6 @@ transform: var(--bit-pgn-ico-transform-end); } -.bit-rtl { - --bit-pgn-ico-transform-end: scaleX(-1); - --bit-pgn-ico-transform-start: scaleX(1); -} - .bit-pgn-elp { display: flex; font-size: inherit; diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Panel/BitPanel.razor b/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Panel/BitPanel.razor index db17013e2e..c6f1965ebb 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Panel/BitPanel.razor +++ b/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Panel/BitPanel.razor @@ -1,57 +1,60 @@ @namespace Bit.BlazorUI @inherits BitComponentBase -@if (IsOpen) -{ - diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Settings/SessionsSection.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Settings/SessionsSection.razor index aedc82200b..4efab54dff 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Settings/SessionsSection.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Settings/SessionsSection.razor @@ -1,7 +1,5 @@ @inherits AppComponentBase - -
@if (isLoading) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Settings/SessionsSection.razor.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Settings/SessionsSection.razor.cs index 2fb5d51e7e..df400150e1 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Settings/SessionsSection.razor.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Settings/SessionsSection.razor.cs @@ -8,7 +8,6 @@ public partial class SessionsSection { private bool isLoading; private Guid? currentSessionId; - private bool hasRevokedAnySession; private UserSessionDto? currentSession; private List revokingSessionIds = []; private UserSessionDto[] otherSessions = []; @@ -63,7 +62,6 @@ private async Task RevokeSession(UserSessionDto session) if (await AuthManager.TryEnterElevatedAccessMode(CurrentCancellationToken)) { await userController.RevokeSession(session.Id, CurrentCancellationToken); - hasRevokedAnySession = true; SnackBarService.Success(Localizer[nameof(AppStrings.RemoveSessionSuccessMessage)]); await LoadSessions(); } @@ -106,13 +104,4 @@ private string GetLastSeenOn(DateTimeOffset renewedOn) : DateTimeOffset.UtcNow - renewedOn < TimeSpan.FromMinutes(15) ? Localizer[nameof(AppStrings.Recently)] : renewedOn.ToLocalTime().ToString("g"); } - - private async Task OnBeforeInternalNavigation(LocationChangingContext context) - { - if (hasRevokedAnySession && await AuthorizationService.AuthorizeAsync((await AuthenticationStateTask).User, AuthPolicies.PRIVILEGED_ACCESS) is { Succeeded: false }) - { - // Refreshing the token to check if the user session can now be privileged. - await AuthManager.RefreshToken("CheckPrivilege"); - } - } } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/ModalData.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/ModalData.cs deleted file mode 100644 index 0c33cba671..0000000000 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/ModalData.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Boilerplate.Client.Core.Services; - -public partial class ModalData(Type type, IDictionary? parameters, string? title, TaskCompletionSource taskCompletionSource) -{ - public Type ComponentType { get; set; } = type; - - public IDictionary? Parameters { get; set; } = parameters; - - public string? Title { get; set; } = title; - - public TaskCompletionSource TaskCompletionSource { get; set; } = taskCompletionSource; -} diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js index d831d4272e..d8cb862b32 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js @@ -68,11 +68,11 @@ self.defaultUrl = "/"; self.isPassive = true; self.errorTolerance = 'lax'; self.caseInsensitiveUrl = true; +self.noPrerenderQuery = 'no-prerender=true'; -// on apps with Prerendering enabled, to have the best experience for the end user un-comment the following two lines. +// on apps with Prerendering enabled, to have the best experience for the end user un-comment the following line. // more info: https://bitplatform.dev/bswup/service-worker -// self.noPrerenderQuery = 'no-prerender=true'; // self.disablePassiveFirstBoot = true; diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Categories/CategoryController.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Categories/CategoryController.cs index 2b07229ad1..ba89bde5e3 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Categories/CategoryController.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Categories/CategoryController.cs @@ -1,7 +1,7 @@ //+:cnd:noEmit -using Boilerplate.Server.Api.SignalR; //#if (signalR == true) using Microsoft.AspNetCore.SignalR; +using Boilerplate.Server.Api.SignalR; //#endif using Boilerplate.Shared.Dtos.Categories; using Boilerplate.Shared.Controllers.Categories; diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Products/ProductController.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Products/ProductController.cs index 40673c8145..f18bc12384 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Products/ProductController.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Products/ProductController.cs @@ -1,7 +1,7 @@ //+:cnd:noEmit -using Boilerplate.Server.Api.SignalR; //#if (signalR == true) using Microsoft.AspNetCore.SignalR; +using Boilerplate.Server.Api.SignalR; //#endif using Boilerplate.Shared.Dtos.Products; using Boilerplate.Shared.Controllers.Products; diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs index 74e353d811..863fe95df7 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs @@ -152,9 +152,6 @@ public static void ConfigureMiddlewares(this WebApplication app) app.UseSiteMap(); // Handle the rest of requests with blazor - //#if (framework == 'net9.0') - app.MapStaticAssets(); - //#endif var blazorApp = app.MapRazorComponents() .AddInteractiveServerRenderMode() .AddInteractiveWebAssemblyRenderMode() diff --git a/src/Websites/Careers/src/Bit.Websites.Careers.Server/Startup/Middlewares.cs b/src/Websites/Careers/src/Bit.Websites.Careers.Server/Startup/Middlewares.cs index c8254b483b..7c1e312c33 100644 --- a/src/Websites/Careers/src/Bit.Websites.Careers.Server/Startup/Middlewares.cs +++ b/src/Websites/Careers/src/Bit.Websites.Careers.Server/Startup/Middlewares.cs @@ -75,7 +75,6 @@ public static void Use(WebApplication app, IWebHostEnvironment env, IConfigurati UseSiteMap(app); - app.MapStaticAssets(); app.MapRazorComponents() .AddInteractiveServerRenderMode() .AddInteractiveWebAssemblyRenderMode() diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Server/Startup/Middlewares.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Server/Startup/Middlewares.cs index 219413febd..1c44c771dc 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Server/Startup/Middlewares.cs +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Server/Startup/Middlewares.cs @@ -75,7 +75,6 @@ public static void Use(WebApplication app, IWebHostEnvironment env, IConfigurati UseSiteMap(app); - app.MapStaticAssets(); app.MapRazorComponents() .AddInteractiveServerRenderMode() .AddInteractiveWebAssemblyRenderMode() diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Server/Startup/Middlewares.cs b/src/Websites/Sales/src/Bit.Websites.Sales.Server/Startup/Middlewares.cs index faa6cba38a..ee201ac321 100644 --- a/src/Websites/Sales/src/Bit.Websites.Sales.Server/Startup/Middlewares.cs +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Server/Startup/Middlewares.cs @@ -75,7 +75,6 @@ public static void Use(WebApplication app, IWebHostEnvironment env, IConfigurati UseSiteMap(app); - app.MapStaticAssets(); app.MapRazorComponents() .AddInteractiveServerRenderMode() .AddInteractiveWebAssemblyRenderMode() From a031b91acf54d2da23457d61f9998153b9b9b596 Mon Sep 17 00:00:00 2001 From: Saleh Yusefnejad Date: Sun, 15 Dec 2024 18:14:42 +0330 Subject: [PATCH 47/59] feat(blazorui): add BitProPanel component #9392 (#9460) --- .../Components/ProPanel/BitProPanel.razor | 70 ++ .../Components/ProPanel/BitProPanel.razor.cs | 151 +++++ .../Components/ProPanel/BitProPanel.scss | 71 ++ .../ProPanel/BitProPanelClassStyles.cs | 34 + .../Styles/bit.blazorui.extras.scss | 4 +- .../Styles/components.scss | 2 +- .../Bit.BlazorUI.Tests.csproj | 3 +- .../Extras/ProPanel/BitProPanelTests.cs | 54 ++ .../Surfaces/Panel/BitPanelTests.cs | 97 +-- src/BlazorUI/Bit.BlazorUI/Bit.BlazorUI.csproj | 8 + .../Components/BitComponentBase.cs | 4 +- .../{Surfaces/Panel => }/BitPanelPosition.cs | 0 .../Inputs/Dropdown/BitDropdown.razor.cs | 2 +- .../BitCircularTimePicker.razor.cs | 2 +- .../DatePicker/BitDatePicker.razor.cs | 2 +- .../BitDateRangePicker.razor.cs | 2 +- .../TimePicker/BitTimePicker.razor.cs | 2 +- .../Navs/DropMenu/BitDropMenu.razor.cs | 2 +- .../Progress/Loading/Base/BitLoadingBase.cs | 6 + .../Components/Surfaces/Panel/BitPanel.razor | 52 +- .../Surfaces/Panel/BitPanel.razor.cs | 80 +-- .../Components/Surfaces/Panel/BitPanel.scss | 103 +-- .../Components/Surfaces/Panel/BitPanel.ts | 193 ------ .../Surfaces/Panel/BitPanelClassStyles.cs | 30 - .../Panel/BitPanelJsRuntimeExtensions.cs | 19 - .../JsInterop/SwipesJsRuntimeExtensions.cs | 13 +- .../Extensions/JsInterop/SwipesPosition.cs | 9 - src/BlazorUI/Bit.BlazorUI/Scripts/Swipes.ts | 9 +- src/BlazorUI/Bit.BlazorUI/Styles/general.scss | 5 +- .../Extras/ProPanel/BitProPanelDemo.razor | 320 +++++++++ .../Extras/ProPanel/BitProPanelDemo.razor.cs | 621 ++++++++++++++++++ .../ProPanel/BitProPanelDemo.razor.scss | 60 ++ .../Surfaces/Panel/BitPanelDemo.razor | 209 +++--- .../Surfaces/Panel/BitPanelDemo.razor.cs | 335 +++------- .../Surfaces/Panel/BitPanelDemo.razor.scss | 31 +- .../Pages/Home/ComponentsSection.razor | 3 + .../Shared/NavMenu.razor.cs | 1 + .../compilerconfig.json | 10 +- 38 files changed, 1648 insertions(+), 971 deletions(-) create mode 100644 src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.razor create mode 100644 src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.razor.cs create mode 100644 src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.scss create mode 100644 src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanelClassStyles.cs create mode 100644 src/BlazorUI/Bit.BlazorUI.Tests/Components/Extras/ProPanel/BitProPanelTests.cs rename src/BlazorUI/Bit.BlazorUI/Components/{Surfaces/Panel => }/BitPanelPosition.cs (100%) delete mode 100644 src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Panel/BitPanel.ts delete mode 100644 src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Panel/BitPanelJsRuntimeExtensions.cs delete mode 100644 src/BlazorUI/Bit.BlazorUI/Extensions/JsInterop/SwipesPosition.cs create mode 100644 src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProPanel/BitProPanelDemo.razor create mode 100644 src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProPanel/BitProPanelDemo.razor.cs create mode 100644 src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProPanel/BitProPanelDemo.razor.scss diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.razor b/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.razor new file mode 100644 index 0000000000..b461e34683 --- /dev/null +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.razor @@ -0,0 +1,70 @@ +@namespace Bit.BlazorUI +@inherits BitComponentBase + + + @if (Header is not null || HeaderText is not null || ShowCloseButton) + { +
+ @if (Header is not null) + { +
+ @Header +
+ } + else if (HeaderText is not null) + { +
+ @HeaderText +
+ } + + @if (ShowCloseButton) + { + + } +
+ } + +
+ @(Body ?? ChildContent) +
+ + @if (Footer is not null) + { +
+ @Footer +
+ } + else if (FooterText is not null) + { +
+ @FooterText +
+ } +
diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.razor.cs b/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.razor.cs new file mode 100644 index 0000000000..cc7b077732 --- /dev/null +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.razor.cs @@ -0,0 +1,151 @@ +namespace Bit.BlazorUI; + +public partial class BitProPanel : BitComponentBase +{ + /// + /// Enables the auto scrollbar toggle behavior of the panel. + /// + [Parameter] public bool AutoToggleScroll { get; set; } + + /// + /// The alias of the ChildContent. + /// + [Parameter] public RenderFragment? Body { get; set; } + + /// + /// Whether the panel can be dismissed by clicking outside of it on the overlay. + /// + [Parameter] public bool Blocking { get; set; } + + /// + /// The content of the panel. + /// + [Parameter] public RenderFragment? ChildContent { get; set; } + + /// + /// Custom CSS classes for different parts of the panel. + /// + [Parameter] public BitProPanelClassStyles? Classes { get; set; } + + /// + /// The template used to render the footer section of the panel. + /// + [Parameter] public RenderFragment? Footer { get; set; } + + /// + /// The text of the footer section of the panel. + /// + [Parameter] public string? FooterText { get; set; } + + /// + /// The template used to render the header section of the panel. + /// + [Parameter] public RenderFragment? Header { get; set; } + + /// + /// The text of the header section of the panel. + /// + [Parameter] public string? HeaderText { get; set; } + + /// + /// Determines the openness of the panel. + /// + [Parameter, TwoWayBound] + public bool IsOpen { get; set; } + + /// + /// Renders the overlay in full mode that gives it an opaque background. + /// + [Parameter] public bool ModeFull { get; set; } + + /// + /// Removes the overlay element of the panel. + /// + [Parameter] public bool Modeless { get; set; } + + /// + /// A callback function for when the Panel is dismissed. + /// + [Parameter] public EventCallback OnDismiss { get; set; } + + /// + /// The event callback for when the swipe action starts on the container of the panel. + /// + [Parameter] public EventCallback OnSwipeStart { get; set; } + + /// + /// The event callback for when the swipe action moves on the container of the panel. + /// + [Parameter] public EventCallback OnSwipeMove { get; set; } + + /// + /// The event callback for when the swipe action ends on the container of the panel. + /// + [Parameter] public EventCallback OnSwipeEnd { get; set; } + + /// + /// The position of the panel to show on the screen. + /// + [Parameter] public BitPanelPosition? Position { get; set; } + + /// + /// The value of the height or width (based on the position) of the Panel. + /// + [Parameter] public double? Size { get; set; } + + /// + /// Specifies the element selector for which the Panel disables its scroll if applicable. + /// + [Parameter] public string? ScrollerSelector { get; set; } + + /// + /// Shows the close button of the Panel. + /// + [Parameter] public bool ShowCloseButton { get; set; } + + /// + /// Custom CSS styles for different parts of the panel component. + /// + [Parameter] public BitProPanelClassStyles? Styles { get; set; } + + /// + /// The swiping point (difference percentage) based on the width of the panel container to trigger the close action (default is 0.25m). + /// + [Parameter] public decimal? SwipeTrigger { get; set; } + + + + public async Task Open() + { + if (await AssignIsOpen(true) is false) return; + + StateHasChanged(); + } + + public async Task Close() + { + if (await AssignIsOpen(false) is false) return; + + StateHasChanged(); + } + + + + protected override string RootElementClass => "bit-ppl"; + + protected override void RegisterCssClasses() + { + ClassBuilder.Register(() => ModeFull ? "bit-ppl-mfl" : string.Empty); + } + + + + private async Task ClosePanel(MouseEventArgs e) + { + if (IsEnabled is false) return; + + if (await AssignIsOpen(false) is false) return; + + await OnDismiss.InvokeAsync(e); + } +} diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.scss b/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.scss new file mode 100644 index 0000000000..db747ffc91 --- /dev/null +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.scss @@ -0,0 +1,71 @@ +@import '../../../Bit.BlazorUI/Styles/functions.scss'; + +.bit-ppl { + .bit-pnl-cnt { + display: flex; + flex-direction: column; + } +} + +.bit-ppl-mfl { + .bit-pnl-ovl { + background-color: $clr-bg-overlay; + } +} + +.bit-ppl-hcn { + top: 0; + z-index: 1; + display: flex; + position: sticky; + font-weight: 600; + color: $clr-fg-pri; + overflow-wrap: anywhere; + background-color: $clr-bg-pri; + padding: spacing(2) spacing(2) 0; +} + +.bit-ppl-hdr { + flex-grow: 1; + display: flex; + align-items: center; + font-size: spacing(2.5); +} + +.bit-ppl-cls { + display: flex; + cursor: pointer; + width: spacing(5); + height: spacing(5); + align-items: center; + justify-content: center; + font-size: spacing(1.75); + border-radius: spacing(0.25); + background-color: transparent; + + @media (hover: hover) { + &:hover { + color: $clr-fg-pri-hover; + background-color: $clr-bg-pri-hover; + } + } + + &:active { + color: $clr-fg-pri-active; + background-color: $clr-bg-pri-active; + } +} + +.bit-ppl-bdy { + flex-grow: 1; + overflow-y: auto; + padding: spacing(2); +} + +.bit-ppl-fcn { + bottom: 0; + z-index: 1; + position: sticky; + background-color: $clr-bg-pri; + padding: 0 spacing(2) spacing(2) spacing(2); +} diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanelClassStyles.cs b/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanelClassStyles.cs new file mode 100644 index 0000000000..0ce332226a --- /dev/null +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanelClassStyles.cs @@ -0,0 +1,34 @@ +namespace Bit.BlazorUI; + +public class BitProPanelClassStyles : BitPanelClassStyles +{ + /// + /// Custom CSS classes/styles for the header container of the BitProPanel. + /// + public string? HeaderContainer { get; set; } + + /// + /// Custom CSS classes/styles for the header of the BitProPanel. + /// + public string? Header { get; set; } + + /// + /// Custom CSS classes/styles for the close button of the BitProPanel. + /// + public string? CloseButton { get; set; } + + /// + /// Custom CSS classes/styles for the close button of the BitProPanel. + /// + public string? CloseIcon { get; set; } + + /// + /// Custom CSS classes/styles for the body of the BitProPanel. + /// + public string? Body { get; set; } + + /// + /// Custom CSS classes/styles for the footer of the BitProPanel. + /// + public string? Footer { get; set; } +} diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Styles/bit.blazorui.extras.scss b/src/BlazorUI/Bit.BlazorUI.Extras/Styles/bit.blazorui.extras.scss index 66554e8edc..4d58f1782c 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/Styles/bit.blazorui.extras.scss +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Styles/bit.blazorui.extras.scss @@ -1,2 +1,2 @@ -@import "fabric.mdl2.bit.blazoui.extras.scss"; -@import "components.scss"; +@import "components.scss"; +@import "fabric.mdl2.bit.blazoui.extras.scss"; diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Styles/components.scss b/src/BlazorUI/Bit.BlazorUI.Extras/Styles/components.scss index 0e9f9d3e91..ca46bd9aef 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/Styles/components.scss +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Styles/components.scss @@ -1,4 +1,4 @@ @import "../Components/DataGrid/BitDataGrid.scss"; @import "../Components/DataGrid/Pagination/BitDataGridPaginator.scss"; - @import "../Components/PdfReader/BitPdfReader.scss"; +@import "../Components/ProPanel/BitProPanel.scss"; diff --git a/src/BlazorUI/Bit.BlazorUI.Tests/Bit.BlazorUI.Tests.csproj b/src/BlazorUI/Bit.BlazorUI.Tests/Bit.BlazorUI.Tests.csproj index 79d9f65d85..a01542257f 100644 --- a/src/BlazorUI/Bit.BlazorUI.Tests/Bit.BlazorUI.Tests.csproj +++ b/src/BlazorUI/Bit.BlazorUI.Tests/Bit.BlazorUI.Tests.csproj @@ -24,7 +24,8 @@ - + + diff --git a/src/BlazorUI/Bit.BlazorUI.Tests/Components/Extras/ProPanel/BitProPanelTests.cs b/src/BlazorUI/Bit.BlazorUI.Tests/Components/Extras/ProPanel/BitProPanelTests.cs new file mode 100644 index 0000000000..be0b2ba6e8 --- /dev/null +++ b/src/BlazorUI/Bit.BlazorUI.Tests/Components/Extras/ProPanel/BitProPanelTests.cs @@ -0,0 +1,54 @@ +using Bunit; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Bit.BlazorUI.Tests.Components.Extras.ProPanel; + +[TestClass] +public class BitProPanelTests : BunitTestContext +{ + [TestMethod] + public void BitProPanelContentTest() + { + var com = RenderComponent(parameters => + { + parameters.Add(p => p.IsOpen, true); + parameters.AddChildContent("
Test Content
"); + }); + + var elementContent = com.Find(".bit-ppl-bdy"); + + elementContent.MarkupMatches("
Test Content
"); + } + + [TestMethod] + public void BitProPanelFooterContentTest() + { + var footerContent = "
Test Footer Content
"; + + var com = RenderComponent(parameters => + { + parameters.Add(p => p.IsOpen, true); + parameters.Add(p => p.Footer, footerContent); + }); + + var elementContent = com.Find(".bit-ppl-fcn :first-child"); + + elementContent.MarkupMatches(footerContent); + } + + [TestMethod] + public void BitProPanelHeaderContentTest() + { + const string headerContent = "
Test Header Content
"; + + var com = RenderComponent(parameters => + { + parameters.Add(p => p.IsOpen, true); + parameters.Add(p => p.Header, headerContent); + }); + + var elementContent = com.Find(".bit-ppl-hcn :first-child :first-child"); + + elementContent.MarkupMatches(headerContent); + } +} diff --git a/src/BlazorUI/Bit.BlazorUI.Tests/Components/Surfaces/Panel/BitPanelTests.cs b/src/BlazorUI/Bit.BlazorUI.Tests/Components/Surfaces/Panel/BitPanelTests.cs index e7a3a7fbc8..5477856812 100644 --- a/src/BlazorUI/Bit.BlazorUI.Tests/Components/Surfaces/Panel/BitPanelTests.cs +++ b/src/BlazorUI/Bit.BlazorUI.Tests/Components/Surfaces/Panel/BitPanelTests.cs @@ -51,9 +51,6 @@ public void BitPanelModelessTest(bool modeless) parameters.Add(p => p.IsOpen, true); }); - var element = com.Find(".bit-pnl"); - Assert.AreEqual(element.Attributes["aria-modal"].Value, (modeless is false).ToString()); - var elementOverlay = com.FindAll(".bit-pnl-ovl"); Assert.AreEqual(modeless ? 0 : 1, elementOverlay.Count); } @@ -73,64 +70,6 @@ public void BitPanelIsOpenTest(bool isOpen) Assert.AreEqual(isOpen, container.GetStyle().CssText.Contains("opacity: 1")); } - [DataTestMethod, - DataRow(null), - DataRow(""), - DataRow("Test-S-A-Id") - ] - public void BitPanelSubtitleAriaIdTest(string subtitleAriaId) - { - var com = RenderComponent(parameters => - { - parameters.Add(p => p.SubtitleAriaId, subtitleAriaId); - parameters.Add(p => p.IsOpen, true); - }); - - var element = com.Find(".bit-pnl"); - - if (subtitleAriaId == null) - { - Assert.IsFalse(element.HasAttribute("aria-describedby")); - } - else if (subtitleAriaId == string.Empty) - { - Assert.AreEqual(element.Attributes["aria-describedby"].Value, string.Empty); - } - else - { - Assert.AreEqual(element.Attributes["aria-describedby"].Value, subtitleAriaId); - } - } - - [DataTestMethod, - DataRow(null), - DataRow(""), - DataRow("Test-T-A-Id") - ] - public void BitPanelTitleAriaIdTest(string titleAriaId) - { - var com = RenderComponent(parameters => - { - parameters.Add(p => p.TitleAriaId, titleAriaId); - parameters.Add(p => p.IsOpen, true); - }); - - var element = com.Find(".bit-pnl"); - - if (titleAriaId == null) - { - Assert.IsFalse(element.HasAttribute("aria-labelledby")); - } - else if (titleAriaId == string.Empty) - { - Assert.AreEqual(element.Attributes["aria-labelledby"].Value, string.Empty); - } - else - { - Assert.AreEqual(element.Attributes["aria-labelledby"].Value, titleAriaId); - } - } - [TestMethod] public void BitPanelContentTest() { @@ -140,41 +79,9 @@ public void BitPanelContentTest() parameters.AddChildContent("
Test Content
"); }); - var elementContent = com.Find(".bit-pnl-bdy"); - - elementContent.MarkupMatches("
Test Content
"); - } - - [TestMethod] - public void BitPanelFooterContentTest() - { - var footerContent = "
Test Footer Content
"; - - var com = RenderComponent(parameters => - { - parameters.Add(p => p.IsOpen, true); - parameters.Add(p => p.FooterTemplate, footerContent); - }); - - var elementContent = com.Find(".bit-pnl-fcn :first-child"); - - elementContent.MarkupMatches(footerContent); - } - - [TestMethod] - public void BitPanelHeaderContentTest() - { - const string headerContent = "
Test Header Content
"; - - var com = RenderComponent(parameters => - { - parameters.Add(p => p.IsOpen, true); - parameters.Add(p => p.HeaderTemplate, headerContent); - }); - - var elementContent = com.Find(".bit-pnl-hcn :first-child"); + var elementContent = com.Find(".bit-pnl-cnt"); - elementContent.MarkupMatches(headerContent); + elementContent.MarkupMatches("
Test Content
"); } [TestMethod] diff --git a/src/BlazorUI/Bit.BlazorUI/Bit.BlazorUI.csproj b/src/BlazorUI/Bit.BlazorUI/Bit.BlazorUI.csproj index 489b257821..849452fbee 100644 --- a/src/BlazorUI/Bit.BlazorUI/Bit.BlazorUI.csproj +++ b/src/BlazorUI/Bit.BlazorUI/Bit.BlazorUI.csproj @@ -16,6 +16,14 @@ + + + + + + + + diff --git a/src/BlazorUI/Bit.BlazorUI/Components/BitComponentBase.cs b/src/BlazorUI/Bit.BlazorUI/Components/BitComponentBase.cs index c30cbcd9ff..746f61ef90 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/BitComponentBase.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/BitComponentBase.cs @@ -177,9 +177,9 @@ protected override void OnAfterRender(bool firstRender) protected abstract string RootElementClass { get; } - internal ElementClassBuilder ClassBuilder { get; private set; } = new ElementClassBuilder(); + protected ElementClassBuilder ClassBuilder { get; private set; } = new ElementClassBuilder(); - internal ElementStyleBuilder StyleBuilder { get; private set; } = new ElementStyleBuilder(); + protected ElementStyleBuilder StyleBuilder { get; private set; } = new ElementStyleBuilder(); protected virtual void RegisterCssStyles() { } diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Panel/BitPanelPosition.cs b/src/BlazorUI/Bit.BlazorUI/Components/BitPanelPosition.cs similarity index 100% rename from src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Panel/BitPanelPosition.cs rename to src/BlazorUI/Bit.BlazorUI/Components/BitPanelPosition.cs diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/BitDropdown.razor.cs b/src/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/BitDropdown.razor.cs index a228db8891..addc3d92be 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/BitDropdown.razor.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/BitDropdown.razor.cs @@ -852,7 +852,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender) if (firstRender is false) return; if (Responsive is false) return; - await _js.SwipesSetup(_calloutId, 0.25m, SwipesPosition.End, Dir is BitDir.Rtl, _dotnetObj); + await _js.SwipesSetup(_calloutId, 0.25m, BitPanelPosition.End, Dir is BitDir.Rtl, _dotnetObj); } protected override bool TryParseValueFromString(string? value, [MaybeNullWhen(false)] out TValue result, [NotNullWhen(false)] out string? parsingErrorMessage) diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/CircularTimePicker/BitCircularTimePicker.razor.cs b/src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/CircularTimePicker/BitCircularTimePicker.razor.cs index d7d3197c5b..31936c2e66 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/CircularTimePicker/BitCircularTimePicker.razor.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/CircularTimePicker/BitCircularTimePicker.razor.cs @@ -307,7 +307,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender) if (firstRender is false) return; - await _js.SwipesSetup(_calloutId, 0.25m, SwipesPosition.Top, Dir is BitDir.Rtl, _dotnetObj); + await _js.SwipesSetup(_calloutId, 0.25m, BitPanelPosition.Top, Dir is BitDir.Rtl, _dotnetObj); _pointerUpAbortControllerId = await _js.BitCircularTimePickerRegisterPointerUp(_dotnetObj, nameof(_HandlePointerUp)); _pointerMoveAbortControllerId = await _js.BitCircularTimePickerRegisterPointerMove(_dotnetObj, nameof(_HandlePointerMove)); } diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/DatePicker/BitDatePicker.razor.cs b/src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/DatePicker/BitDatePicker.razor.cs index a43798701a..35b8b01462 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/DatePicker/BitDatePicker.razor.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/DatePicker/BitDatePicker.razor.cs @@ -530,7 +530,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender) if (firstRender is false) return; if (Responsive is false) return; - await _js.SwipesSetup(_calloutId, 0.25m, SwipesPosition.Top, Dir is BitDir.Rtl, _dotnetObj); + await _js.SwipesSetup(_calloutId, 0.25m, BitPanelPosition.Top, Dir is BitDir.Rtl, _dotnetObj); } protected override bool TryParseValueFromString(string? value, [MaybeNullWhen(false)] out DateTimeOffset? result, [NotNullWhen(false)] out string? validationErrorMessage) diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/DateRangePicker/BitDateRangePicker.razor.cs b/src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/DateRangePicker/BitDateRangePicker.razor.cs index 77abb1fe3f..a64044a39c 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/DateRangePicker/BitDateRangePicker.razor.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/DateRangePicker/BitDateRangePicker.razor.cs @@ -593,7 +593,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender) if (firstRender is false) return; if (Responsive is false) return; - await _js.SwipesSetup(_calloutId, 0.25m, SwipesPosition.Top, Dir is BitDir.Rtl, _dotnetObj); + await _js.SwipesSetup(_calloutId, 0.25m, BitPanelPosition.Top, Dir is BitDir.Rtl, _dotnetObj); } protected override bool TryParseValueFromString(string? value, [MaybeNullWhen(false)] out BitDateRangePickerValue? result, [NotNullWhen(false)] out string? validationErrorMessage) diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/TimePicker/BitTimePicker.razor.cs b/src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/TimePicker/BitTimePicker.razor.cs index 7c19c82d49..d554b0d9ee 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/TimePicker/BitTimePicker.razor.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/TimePicker/BitTimePicker.razor.cs @@ -345,7 +345,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender) if (firstRender is false) return; if (Responsive is false) return; - await _js.SwipesSetup(_calloutId, 0.25m, SwipesPosition.Top, Dir is BitDir.Rtl, _dotnetObj); + await _js.SwipesSetup(_calloutId, 0.25m, BitPanelPosition.Top, Dir is BitDir.Rtl, _dotnetObj); } protected override bool TryParseValueFromString(string? value, [MaybeNullWhen(false)] out TimeSpan? result, [NotNullWhen(false)] out string? validationErrorMessage) diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Navs/DropMenu/BitDropMenu.razor.cs b/src/BlazorUI/Bit.BlazorUI/Components/Navs/DropMenu/BitDropMenu.razor.cs index 2a426aa349..48f83584e7 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Navs/DropMenu/BitDropMenu.razor.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/Navs/DropMenu/BitDropMenu.razor.cs @@ -150,7 +150,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender) if (firstRender is false) return; if (Responsive is false) return; - await _js.SwipesSetup(_calloutId, 0.25m, SwipesPosition.End, Dir is BitDir.Rtl, _dotnetObj); + await _js.SwipesSetup(_calloutId, 0.25m, BitPanelPosition.End, Dir is BitDir.Rtl, _dotnetObj); } diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Progress/Loading/Base/BitLoadingBase.cs b/src/BlazorUI/Bit.BlazorUI/Components/Progress/Loading/Base/BitLoadingBase.cs index c9d9247d69..5b774859de 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Progress/Loading/Base/BitLoadingBase.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/Progress/Loading/Base/BitLoadingBase.cs @@ -111,6 +111,12 @@ public override Task SetParametersAsync(ParameterView parameters) + internal new ElementClassBuilder ClassBuilder => base.ClassBuilder; + + internal new ElementStyleBuilder StyleBuilder => base.StyleBuilder; + + + protected override void RegisterCssClasses() { ClassBuilder.Register(() => "bit-ldn"); diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Panel/BitPanel.razor b/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Panel/BitPanel.razor index c6f1965ebb..cd189aa5fb 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Panel/BitPanel.razor +++ b/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Panel/BitPanel.razor @@ -6,55 +6,19 @@ role="dialog" style="@StyleBuilder.Value" class="@ClassBuilder.Value" - dir="@Dir?.ToString().ToLower()" - aria-labelledby="@TitleAriaId" - aria-describedby="@SubtitleAriaId" - aria-modal="@((Modeless is false).ToString())"> + dir="@Dir?.ToString().ToLower()"> @if (IsOpen && Modeless is false) { - +
+ + isProPanelStylesOpen = true"">Open ProPanel Styles + + BitProPanel with Styles to customize its elements. +
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit + amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor + sagittis nunc, ut interdum ipsum vestibulum non. Proin dolor elit, aliquam eget tincidunt non, vestibulum ut + turpis. +
+
+ + isProPanelClassesOpen = true"">Open ProPanel Classes + + BitProPanel with Classes to customize its elements. +
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit + amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor + sagittis nunc, ut interdum ipsum vestibulum non. Proin dolor elit, aliquam eget tincidunt non, vestibulum ut + turpis. +
+
"; + private readonly string example5CsharpCode = @" +private bool isStyledPanelOpen; +private bool isClassedPanelOpen; +private bool isPanelStylesOpen; +private bool isPanelClassesOpen;"; + + private readonly string example6RazorCode = @" + isRtlPanelOpenStart = true"">آغاز + isRtlPanelOpenEnd = true"">پایان + + +
+ لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است. + چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی مورد نیاز و کاربردهای متنوع با هدف بهبود ابزارهای کاربردی می باشد. + کتابهای زیادی در شصت و سه درصد گذشته، حال و آینده شناخت فراوان جامعه و متخصصان را می طلبد تا با نرم افزارها شناخت بیشتری را برای طراحان رایانه ای علی الخصوص طراحان خلاقی و فرهنگ پیشرو در زبان فارسی ایجاد کرد. + در این صورت می توان امید داشت که تمام و دشواری موجود در ارائه راهکارها و شرایط سخت تایپ به پایان رسد وزمان مورد نیاز شامل حروفچینی دستاوردهای اصلی و جوابگوی سوالات پیوسته اهل دنیای موجود طراحی اساسا مورد استفاده قرار گیرد. +
+
+
+ لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است. + چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی مورد نیاز و کاربردهای متنوع با هدف بهبود ابزارهای کاربردی می باشد. + کتابهای زیادی در شصت و سه درصد گذشته، حال و آینده شناخت فراوان جامعه و متخصصان را می طلبد تا با نرم افزارها شناخت بیشتری را برای طراحان رایانه ای علی الخصوص طراحان خلاقی و فرهنگ پیشرو در زبان فارسی ایجاد کرد. + در این صورت می توان امید داشت که تمام و دشواری موجود در ارائه راهکارها و شرایط سخت تایپ به پایان رسد وزمان مورد نیاز شامل حروفچینی دستاوردهای اصلی و جوابگوی سوالات پیوسته اهل دنیای موجود طراحی اساسا مورد استفاده قرار گیرد. +
+
"; + private readonly string example6CsharpCode = @" +private bool isRtlProPanelOpenStart; +private bool isRtlProPanelOpenEnd;"; +} diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProPanel/BitProPanelDemo.razor.scss b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProPanel/BitProPanelDemo.razor.scss new file mode 100644 index 0000000000..2fd279810f --- /dev/null +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProPanel/BitProPanelDemo.razor.scss @@ -0,0 +1,60 @@ +@import '../../../../Styles/abstracts/functions'; + +.btn-container { + display: flex; + gap: rem2(16px); + flex-flow: column; + max-width: max-content; +} + +.position-btn { + gap: rem2(16px); + display: flex; + flex-flow: column nowrap; + + div { + display: flex; + justify-content: space-between; + } +} + +::deep { + .custom-class { + .item { + color: black; + padding: 1rem; + margin: 0.5rem; + border-radius: 0.5rem; + background-color: brown; + } + } + + .custom-container { + border: 0.25rem solid #0054C6; + } + + .custom-overlay { + background-color: #ffbd5a66; + } + + .custom-header-container { + padding: 1.5rem; + background-color: tomato; + } + + .custom-header { + font-size: 2rem; + } + + .custom-body { + color: black; + background-color: lightseagreen; + } + + .custom-footer { + color: brown; + padding: 1.5rem; + font-size: 1.5rem; + background-color: tomato; + } +} diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Panel/BitPanelDemo.razor b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Panel/BitPanelDemo.razor index e282901360..adda9f235c 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Panel/BitPanelDemo.razor +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Panel/BitPanelDemo.razor @@ -14,7 +14,7 @@ Open Panel -
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor sagittis nunc, ut interdum ipsum vestibulum non. Proin dolor elit, aliquam eget tincidunt non, vestibulum ut @@ -24,111 +24,43 @@ - - -
HeaderText:

- Open Panel - -
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit - amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor - sagittis nunc, ut interdum ipsum vestibulum non. Proin dolor elit, aliquam eget tincidunt non, vestibulum ut - turpis. In hac habitasse platea dictumst. In a odio eget enim porttitor maximus. Aliquam nulla nibh, - ullamcorper aliquam placerat eu, viverra et dui. Phasellus ex lectus, maximus in mollis ac, luctus vel eros. - Vivamus ultrices, turpis sed malesuada gravida, eros ipsum venenatis elit, et volutpat eros dui et ante. - Quisque ultricies mi nec leo ultricies mollis. Vivamus egestas volutpat lacinia. Quisque pharetra eleifend - efficitur. -
-
-


-
HeaderTemplate:

- Open Panel - - -
-

BitPanel with custom header content

- -
-
- -
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit - amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor - sagittis nunc, ut interdum ipsum vestibulum non. Proin dolor elit, aliquam eget tincidunt non, vestibulum ut - turpis. In hac habitasse platea dictumst. In a odio eget enim porttitor maximus. Aliquam nulla nibh, - ullamcorper aliquam placerat eu, viverra et dui. Phasellus ex lectus, maximus in mollis ac, luctus vel eros. - Vivamus ultrices, turpis sed malesuada gravida, eros ipsum venenatis elit, et volutpat eros dui et ante. - Quisque ultricies mi nec leo ultricies mollis. Vivamus egestas volutpat lacinia. Quisque pharetra eleifend - efficitur. -
-
-
-
-
- - - -
FooterTemplate:

- Open Panel - - -
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit - amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor - sagittis nunc, ut interdum ipsum vestibulum non. Proin dolor elit, aliquam eget tincidunt non, vestibulum ut - turpis. In hac habitasse platea dictumst. In a odio eget enim porttitor maximus. Aliquam nulla nibh, - ullamcorper aliquam placerat eu, viverra et dui. Phasellus ex lectus, maximus in mollis ac, luctus vel eros. - Vivamus ultrices, turpis sed malesuada gravida, eros ipsum venenatis elit, et volutpat eros dui et ante. - Quisque ultricies mi nec leo ultricies mollis. Vivamus egestas volutpat lacinia. Quisque pharetra eleifend - efficitur. -
-
- - Save - Close - -
-
-
- - +
BitPanel has some advanced options to be customized.


-
ShowCloseButton:

- Open Panel - -
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit - amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor - sagittis nunc, ut interdum ipsum vestibulum non. -
-
-


Blocking:

Open Panel - -
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit - amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor - sagittis nunc, ut interdum ipsum vestibulum non. + +
+

Blocking

+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit + amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor + sagittis nunc, ut interdum ipsum vestibulum non. +
+ Close



Modeless:

Open Panel - -
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit - amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor - sagittis nunc, ut interdum ipsum vestibulum non. + +
+

Modeless

+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit + amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor + sagittis nunc, ut interdum ipsum vestibulum non. +
+ Close



AutoToggleScroll:

Open Panel - -
+ +
+

AutoToggleScroll

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor sagittis nunc, ut interdum ipsum vestibulum non. @@ -137,7 +69,7 @@ - +
To set the Panel position on the page you can use the Position parameter.


@@ -153,69 +85,82 @@
- - BitPanel with Start position and custom Size. - + +
+ BitPanel with Start position and custom Size. + +
- - BitPanel with End position and custom Size. - + +
+ BitPanel with End position and custom Size. + +
- BitPanel with Top position and custom Size. - +
+ BitPanel with Top position and custom Size. + +
- - BitPanel with Bottom position and custom Size. - + +
+ BitPanel with Bottom position and custom Size. + +
- +
Explore styling and class customization for BitPanel, including component styles, custom classes, and detailed styles.


Component's Style & Class:

Open Styled panel -

- Open Classed panel -


-
Styles & Classes:

- Open panel Styles -

- Open panel Classes - - BitPanel with custom style. +
+ BitPanel with custom style. +
- +

+ Open Classed panel - BitPanel with custom class: -
Item 1
-
Item 2
-
Item 3
+
+ BitPanel with custom class: +
Item 1
+
Item 2
+
Item 3
+
- - +



+
Styles & Classes:

+ Open panel Styles + BitPanel with Styles to customize its elements. - +

+ Open panel Classes + Overlay = "custom-overlay" })"> BitPanel with Classes to customize its elements.
- +
Use BitPanel in right-to-left (RTL).


@@ -227,8 +172,10 @@
- -
+ +
لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است. چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی مورد نیاز و کاربردهای متنوع با هدف بهبود ابزارهای کاربردی می باشد. کتابهای زیادی در شصت و سه درصد گذشته، حال و آینده شناخت فراوان جامعه و متخصصان را می طلبد تا با نرم افزارها شناخت بیشتری را برای طراحان رایانه ای علی الخصوص طراحان خلاقی و فرهنگ پیشرو در زبان فارسی ایجاد کرد. @@ -236,8 +183,10 @@
- -
+ +
لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است. چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی مورد نیاز و کاربردهای متنوع با هدف بهبود ابزارهای کاربردی می باشد. کتابهای زیادی در شصت و سه درصد گذشته، حال و آینده شناخت فراوان جامعه و متخصصان را می طلبد تا با نرم افزارها شناخت بیشتری را برای طراحان رایانه ای علی الخصوص طراحان خلاقی و فرهنگ پیشرو در زبان فارسی ایجاد کرد. diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Panel/BitPanelDemo.razor.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Panel/BitPanelDemo.razor.cs index f1d64e297e..ac7c61e7c0 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Panel/BitPanelDemo.razor.cs +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Panel/BitPanelDemo.razor.cs @@ -35,27 +35,6 @@ public partial class BitPanelDemo LinkType = LinkType.Link, }, new() - { - Name = "FooterTemplate", - Type = "RenderFragment?", - DefaultValue = "null", - Description = "The template used to render the footer section of the panel.", - }, - new() - { - Name = "HeaderTemplate", - Type = "RenderFragment?", - DefaultValue = "null", - Description = "The template used to render the header section of the panel.", - }, - new() - { - Name = "HeaderText", - Type = "string?", - DefaultValue = "null", - Description = "The text of the header section of the panel.", - }, - new() { Name = "IsOpen", Type = "bool", @@ -117,13 +96,6 @@ public partial class BitPanelDemo Description = "Specifies the element selector for which the Panel disables its scroll if applicable.", }, new() - { - Name = "ShowCloseButton", - Type = "bool", - DefaultValue = "false", - Description = "Shows the close button of the Panel.", - }, - new() { Name = "Styles", Type = "BitPanelClassStyles?", @@ -133,26 +105,12 @@ public partial class BitPanelDemo LinkType = LinkType.Link, }, new() - { - Name = "SubtitleAriaId", - Type = "string?", - DefaultValue = "null", - Description = "Specifies the id for the aria-describedby attribute of the panel.", - }, - new() { Name = "SwipeTrigger", Type = "decimal?", DefaultValue = "null", Description = "The swiping point (difference percentage) based on the width of the panel container to trigger the close action (default is 0.25m).", }, - new() - { - Name = "TitleAriaId", - Type = "string?", - DefaultValue = "null", - Description = "Specifies the id for the aria-labelledby attribute of the panel.", - }, ]; private readonly List componentSubClasses = @@ -183,48 +141,6 @@ public partial class BitPanelDemo Type = "string?", DefaultValue = "null", Description = "Custom CSS classes/styles for the container of the BitPanel." - }, - new() - { - Name = "Header", - Type = "string?", - DefaultValue = "null", - Description = "Custom CSS classes/styles for the header of the BitPanel." - }, - new() - { - Name = "HeaderText", - Type = "string?", - DefaultValue = "null", - Description = "Custom CSS classes/styles for the header text of the BitPanel." - }, - new() - { - Name = "CloseButton", - Type = "string?", - DefaultValue = "null", - Description = "Custom CSS classes/styles for the close button of the BitPanel." - }, - new() - { - Name = "CloseIcon", - Type = "string?", - DefaultValue = "null", - Description = "Custom CSS classes/styles for the close icon of the BitPanel." - }, - new() - { - Name = "Body", - Type = "string?", - DefaultValue = "null", - Description = "Custom CSS classes/styles for the body of the BitPanel." - }, - new() - { - Name = "Footer", - Type = "string?", - DefaultValue = "null", - Description = "Custom CSS classes/styles for the footer of the BitPanel." } ] } @@ -251,15 +167,10 @@ public partial class BitPanelDemo private bool isBasicPanelOpen; - private bool isPanelWithHeaderTextOpen; - private bool isPanelWithCustomHeaderOpen; - - private bool isPanelWithFooterOpen; - private bool isBlockingPanelOpen; private bool isModelessPanelOpen; + private BitPanel modelessPanelRef = default!; private bool isAutoToggleScrollPanelOpen; - private BitPanel bitPanelRef = default!; private double customPanelSize = 300; private bool isOpenInPositionStart; @@ -280,7 +191,7 @@ public partial class BitPanelDemo private readonly string example1RazorCode = @" isBasicPanelOpen = true"">Open Panel -
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor sagittis nunc, ut interdum ipsum vestibulum non. Proin dolor elit, aliquam eget tincidunt non, vestibulum ut @@ -291,111 +202,48 @@ public partial class BitPanelDemo private bool isBasicPanelOpen;"; private readonly string example2RazorCode = @" - isPanelWithHeaderTextOpen = true"">Open Panel - -
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit - amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor - sagittis nunc, ut interdum ipsum vestibulum non. Proin dolor elit, aliquam eget tincidunt non, vestibulum ut - turpis. In hac habitasse platea dictumst. In a odio eget enim porttitor maximus. Aliquam nulla nibh, - ullamcorper aliquam placerat eu, viverra et dui. Phasellus ex lectus, maximus in mollis ac, luctus vel eros. - Vivamus ultrices, turpis sed malesuada gravida, eros ipsum venenatis elit, et volutpat eros dui et ante. - Quisque ultricies mi nec leo ultricies mollis. Vivamus egestas volutpat lacinia. Quisque pharetra eleifend - efficitur. -
-
- - isPanelWithCustomHeaderOpen = true"">Open Panel - - -
-

BitPanel with custom header content

- -
-
- -
+ isBlockingPanelOpen = true"">Open Panel + +
+

Blocking

+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor - sagittis nunc, ut interdum ipsum vestibulum non. Proin dolor elit, aliquam eget tincidunt non, vestibulum ut - turpis. In hac habitasse platea dictumst. In a odio eget enim porttitor maximus. Aliquam nulla nibh, - ullamcorper aliquam placerat eu, viverra et dui. Phasellus ex lectus, maximus in mollis ac, luctus vel eros. - Vivamus ultrices, turpis sed malesuada gravida, eros ipsum venenatis elit, et volutpat eros dui et ante. - Quisque ultricies mi nec leo ultricies mollis. Vivamus egestas volutpat lacinia. Quisque pharetra eleifend - efficitur. + sagittis nunc, ut interdum ipsum vestibulum non.
- -"; - private readonly string example2CsharpCode = @" -private bool isPanelWithHeaderTextOpen; -private bool isPanelWithCustomHeaderOpen;"; - - private readonly string example3RazorCode = @" - isPanelWithFooterOpen = true"">Open Panel - - -

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit - amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor - sagittis nunc, ut interdum ipsum vestibulum non. Proin dolor elit, aliquam eget tincidunt non, vestibulum ut - turpis. In hac habitasse platea dictumst. In a odio eget enim porttitor maximus. Aliquam nulla nibh, - ullamcorper aliquam placerat eu, viverra et dui. Phasellus ex lectus, maximus in mollis ac, luctus vel eros. - Vivamus ultrices, turpis sed malesuada gravida, eros ipsum venenatis elit, et volutpat eros dui et ante. - Quisque ultricies mi nec leo ultricies mollis. Vivamus egestas volutpat lacinia. Quisque pharetra eleifend - efficitur. -

-
- - isPanelWithFooterOpen = false"">Save - isPanelWithFooterOpen = false"">Close - -
"; - private readonly string example3CsharpCode = @" -private bool isPanelWithFooterOpen;"; - - private readonly string example4RazorCode = @" - bitPanelRef.Open()"">Open Panel - -
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit - amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor - sagittis nunc, ut interdum ipsum vestibulum non. -
-
- - isBlockingPanelOpen = true"">Open Panel - -
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit - amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor - sagittis nunc, ut interdum ipsum vestibulum non. + isBlockingPanelOpen = false"">Close
isModelessPanelOpen = true"">Open Panel - -
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit - amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor - sagittis nunc, ut interdum ipsum vestibulum non. + +
+

Modeless

+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit + amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor + sagittis nunc, ut interdum ipsum vestibulum non. +
+ modelessPanelRef.Close()"">Close
isAutoToggleScrollPanelOpen = true"">Open Panel - -
+ +
+

AutoToggleScroll

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem nulla, malesuada ut sagittis sit amet, vulputate in leo. Maecenas vulputate congue sapien eu tincidunt. Etiam eu sem turpis. Fusce tempor sagittis nunc, ut interdum ipsum vestibulum non.
"; - private readonly string example4CsharpCode = @" + private readonly string example2CsharpCode = @" private bool isBlockingPanelOpen; private bool isModelessPanelOpen; -private bool isAutoToggleScrollPanelOpen; -private BitPanel bitPanelRef = default!;"; +private BitPanel modelessPanelRef = default!; +private bool isAutoToggleScrollPanelOpen;"; - private readonly string example5RazorCode = @" + private readonly string example3RazorCode = @" isOpenInPositionStart = true"">Start @@ -403,121 +251,108 @@ Quisque ultricies mi nec leo ultricies mollis. Vivamus egestas volutpat lacinia. isOpenInPositionTop = true"">Top isOpenInPositionBottom = true"">Bottom - - BitPanel with Start position and custom Size. - + +
+ BitPanel with Start position and custom Size. + +
- - BitPanel with End position and custom Size. - + +
+ BitPanel with End position and custom Size. + +
- BitPanel with Top position and custom Size. - +
+ BitPanel with Top position and custom Size. + +
- - BitPanel with Bottom position and custom Size. - + +
+ BitPanel with Bottom position and custom Size. + +
"; - private readonly string example5CsharpCode = @" + private readonly string example3CsharpCode = @" private double customPanelSize = 300; private bool isOpenInPositionStart; private bool isOpenPositionEnd; private bool isOpenInPositionTop; private bool isOpenInPositionBottom;"; - private readonly string example6RazorCode = @" - - - + private readonly string example4RazorCode = @" isStyledPanelOpen = true"">Open Styled panel - isClassedPanelOpen = true"">Open Classed panel - - isPanelStylesOpen = true"">Open panel Styles - isPanelClassesOpen = true"">Open panel Classes - BitPanel with custom style. -
+ BitPanel with custom style. +
+
+ isClassedPanelOpen = true"">Open Classed panel - BitPanel with custom class: -
Item 1
-
Item 2
-
Item 3
-
+ BitPanel with custom class: +
Item 1
+
Item 2
+
Item 3
+
+
- + isPanelStylesOpen = true"">Open panel Styles + BitPanel with Styles to customize its elements. - + isPanelClassesOpen = true"">Open panel Classes + Overlay = ""custom-overlay"" })""> BitPanel with Classes to customize its elements. "; - private readonly string example6CsharpCode = @" + private readonly string example4CsharpCode = @" private bool isStyledPanelOpen; private bool isClassedPanelOpen; private bool isPanelStylesOpen; private bool isPanelClassesOpen;"; - private readonly string example7RazorCode = @" + private readonly string example5RazorCode = @" isRtlPanelOpenStart = true"">آغاز isRtlPanelOpenEnd = true"">پایان - -

+ +

لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است. چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی مورد نیاز و کاربردهای متنوع با هدف بهبود ابزارهای کاربردی می باشد. کتابهای زیادی در شصت و سه درصد گذشته، حال و آینده شناخت فراوان جامعه و متخصصان را می طلبد تا با نرم افزارها شناخت بیشتری را برای طراحان رایانه ای علی الخصوص طراحان خلاقی و فرهنگ پیشرو در زبان فارسی ایجاد کرد. در این صورت می توان امید داشت که تمام و دشواری موجود در ارائه راهکارها و شرایط سخت تایپ به پایان رسد وزمان مورد نیاز شامل حروفچینی دستاوردهای اصلی و جوابگوی سوالات پیوسته اهل دنیای موجود طراحی اساسا مورد استفاده قرار گیرد. -

- - - -

+

+
+
لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است. چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی مورد نیاز و کاربردهای متنوع با هدف بهبود ابزارهای کاربردی می باشد. کتابهای زیادی در شصت و سه درصد گذشته، حال و آینده شناخت فراوان جامعه و متخصصان را می طلبد تا با نرم افزارها شناخت بیشتری را برای طراحان رایانه ای علی الخصوص طراحان خلاقی و فرهنگ پیشرو در زبان فارسی ایجاد کرد. در این صورت می توان امید داشت که تمام و دشواری موجود در ارائه راهکارها و شرایط سخت تایپ به پایان رسد وزمان مورد نیاز شامل حروفچینی دستاوردهای اصلی و جوابگوی سوالات پیوسته اهل دنیای موجود طراحی اساسا مورد استفاده قرار گیرد. -

+
"; - private readonly string example7CsharpCode = @" + private readonly string example5CsharpCode = @" private bool isRtlPanelOpenStart; private bool isRtlPanelOpenEnd;"; } diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Panel/BitPanelDemo.razor.scss b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Panel/BitPanelDemo.razor.scss index a54db15c4f..99ecfa183f 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Panel/BitPanelDemo.razor.scss +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Panel/BitPanelDemo.razor.scss @@ -1,5 +1,10 @@ @import '../../../../Styles/abstracts/functions'; +.panel-body { + width: 300px; + padding: 1rem; +} + .btn-container { display: flex; gap: rem2(16px); @@ -19,21 +24,6 @@ } ::deep { - .header-margin, - .custom-header { - margin-top: var(--bit-status-bar-height); - - @supports (-webkit-touch-callout: none) { - margin-top: env(safe-area-inset-top); - } - } - - .footer-margin { - @supports (-webkit-touch-callout: none) { - margin-top: env(safe-area-inset-bottom); - } - } - .custom-class { .item { width: 3rem; @@ -45,6 +35,7 @@ } .custom-container { + padding: 1rem; border: 0.25rem solid #0054C6; border-end-start-radius: 1rem; border-start-start-radius: 1rem; @@ -53,14 +44,4 @@ .custom-overlay { background-color: #ffbd5a66; } - - .custom-header { - padding-bottom: 1.25rem; - background-color: tomato; - } - - .custom-body { - padding-top: 1.25rem; - background-color: lightseagreen; - } } diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Home/ComponentsSection.razor b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Home/ComponentsSection.razor index bec34a5508..b3e28e6a15 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Home/ComponentsSection.razor +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Home/ComponentsSection.razor @@ -253,6 +253,9 @@ PdfReader + + ProPanel + ModalService diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Shared/NavMenu.razor.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Shared/NavMenu.razor.cs index d1277d3a9f..84b6f10f89 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Shared/NavMenu.razor.cs +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Shared/NavMenu.razor.cs @@ -156,6 +156,7 @@ public partial class NavMenu : IDisposable new() { Text = "DataGrid", Url = "/components/datagrid", AdditionalUrls = ["/components/data-grid"] }, new() { Text = "Chart", Url = "/components/chart" }, new() { Text = "PdfReader", Url = "/components/pdfreader" }, + new() { Text = "ProPanel", Url = "/components/propanel" }, new() { Text = "Services", diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/compilerconfig.json b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/compilerconfig.json index 1ea4c0c110..d9e1a8c69c 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/compilerconfig.json +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/compilerconfig.json @@ -71,6 +71,12 @@ "minify": { "enabled": false }, "options": { "sourceMap": false } }, + { + "outputFile": "Pages/Components/Extras/ProPanel/BitProPanelDemo.razor.css", + "inputFile": "Pages/Components/Extras/ProPanel/BitProPanelDemo.razor.scss", + "minify": { "enabled": false }, + "options": { "sourceMap": false } + }, { "outputFile": "Pages/Components/Inputs/Calendar/BitCalendarDemo.razor.css", "inputFile": "Pages/Components/Inputs/Calendar/BitCalendarDemo.razor.scss", @@ -306,8 +312,8 @@ "options": { "sourceMap": false } }, { - "outputFile": "Pages/Components/Progress/ProgressBar/BitProgressDemo.razor.css", - "inputFile": "Pages/Components/Progress/ProgressBar/BitProgressDemo.razor.scss", + "outputFile": "Pages/Components/Progress/Progress/BitProgressDemo.razor.css", + "inputFile": "Pages/Components/Progress/Progress/BitProgressDemo.razor.scss", "minify": { "enabled": false }, "options": { "sourceMap": false } }, From 2a52a3c0c252354cb7f5551f5c217cf68a487e63 Mon Sep 17 00:00:00 2001 From: Saleh Yusefnejad Date: Sun, 15 Dec 2024 18:46:52 +0330 Subject: [PATCH 48/59] feat(bswup): add auto-update of hash-less assets #9491 (#9492) --- .../wwwroot/service-worker.published.js | 4 +++- src/Bswup/Bit.Bswup/Scripts/bit-bswup.sw.ts | 20 +++++++++---------- src/Bswup/README.md | 3 ++- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/Bswup/Bit.Bswup.NewDemo/Bit.Bswup.NewDemo.Client/wwwroot/service-worker.published.js b/src/Bswup/Bit.Bswup.NewDemo/Bit.Bswup.NewDemo.Client/wwwroot/service-worker.published.js index da15e3f5bf..bde2e9c69e 100644 --- a/src/Bswup/Bit.Bswup.NewDemo/Bit.Bswup.NewDemo.Client/wwwroot/service-worker.published.js +++ b/src/Bswup/Bit.Bswup.NewDemo/Bit.Bswup.NewDemo.Client/wwwroot/service-worker.published.js @@ -1,7 +1,9 @@ // bit version: 9.1.0 self.assetsInclude = []; -self.assetsExclude = []; +self.assetsExclude = [ + /Bit\.Bswup\.NewDemo\.Client\.styles\.css$/ +]; self.defaultUrl = '/'; self.prohibitedUrls = []; self.assetsUrl = '/service-worker-assets.js'; diff --git a/src/Bswup/Bit.Bswup/Scripts/bit-bswup.sw.ts b/src/Bswup/Bit.Bswup/Scripts/bit-bswup.sw.ts index a46c77029a..a56e1f8232 100644 --- a/src/Bswup/Bit.Bswup/Scripts/bit-bswup.sw.ts +++ b/src/Bswup/Bit.Bswup/Scripts/bit-bswup.sw.ts @@ -24,6 +24,7 @@ interface Window { errorTolerance: any enableDiagnostics: any enableFetchDiagnostics: any + disableHashlessAssetsUpdate: any } interface Event { @@ -210,8 +211,8 @@ async function createAssetsCache(ignoreProgressReport = false) { } } - let keys = await newCache.keys(); - const firstTime = keys.length === 0; + let newCacheKeys = await newCache.keys(); + const firstTime = newCacheKeys.length === 0; const passiveFirstTime = self.isPassive && firstTime if (passiveFirstTime && self.disablePassiveFirstBoot) { if (!ignoreProgressReport) { @@ -251,23 +252,20 @@ async function createAssetsCache(ignoreProgressReport = false) { const oldUrls = []; const updatedAssets = []; - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; + for (let i = 0; i < newCacheKeys.length; i++) { + const key = newCacheKeys[i]; if (!key || !key.url) continue; const lastIndex = key.url.lastIndexOf('.'); let url = lastIndex === -1 ? key.url : key.url.substring(0, lastIndex); let hash = lastIndex === -1 ? '' : key.url.substring(lastIndex + 1); - if (!hash.startsWith('sha256')) { - url = key.url; - hash = ''; - } oldUrls.push({ url, hash }); + const foundAsset = UNIQUE_ASSETS.find(a => url.endsWith(a.url)); if (!foundAsset) { diag('*** removed oldUrl:', key.url); newCache.delete(key.url); - } else if (hash && hash !== foundAsset.hash) { + } else if ((hash && hash !== foundAsset.hash) || (!hash && !self.disableHashlessAssetsUpdate)) { diag('*** updated oldUrl:', key.url); newCache.delete(key.url); updatedAssets.push(foundAsset); @@ -341,11 +339,11 @@ function createCacheUrl(asset: any) { function createNewAssetRequest(asset) { let assetUrl; if (asset.url === DEFAULT_URL && self.noPrerenderQuery) { - assetUrl = `${asset.url}?${self.noPrerenderQuery}&v=${asset.hash || self.assetsManifest.version}`; + assetUrl = `${asset.url}?v=${asset.hash || self.assetsManifest.version}&${self.noPrerenderQuery}`; } else { assetUrl = `${asset.url}?v=${asset.hash || self.assetsManifest.version}`; } - const requestInit: RequestInit = asset.hash && self.enableIntegrityCheck + const requestInit: RequestInit = asset.hash && asset.hash.startsWith('sha') && self.enableIntegrityCheck ? { cache: 'no-store', integrity: asset.hash, headers: [['cache-control', 'public, max-age=3153600']] } : { cache: 'no-store', headers: [['cache-control', 'public, max-age=3153600']] }; diff --git a/src/Bswup/README.md b/src/Bswup/README.md index ed7afb36a0..0c8e83c3d9 100644 --- a/src/Bswup/README.md +++ b/src/Bswup/README.md @@ -160,4 +160,5 @@ The other settings are: - `enableIntegrityCheck`: Enables the default integrity check available in browsers by setting the `integrity` attribute of the request object created in the service-worker to fetch the assets. - `errorTolerance`: Determines how the Bswup should handle the errors while downloading assets. Possible values are: `strict`, `lax`, `config`. - `enableDiagnostics`: Enables diagnostics by pushing service-worker logs to the browser console. -- `enableFetchDiagnostics`: Enables fetch event diagnostics by pushing service-worker fetch event logs to the browser console. \ No newline at end of file +- `enableFetchDiagnostics`: Enables fetch event diagnostics by pushing service-worker fetch event logs to the browser console. +- `disableHashlessAssetsUpdate`: Disables the update of the hash-less assets. By default, the Bswup tries to automatically update all of the hash-less assets (e.g. the external assets) every time an update found for the app. \ No newline at end of file From 2ce3e269f815716304625b979eed9cb104a0b00e Mon Sep 17 00:00:00 2001 From: Saleh Yusefnejad Date: Sun, 15 Dec 2024 18:53:10 +0330 Subject: [PATCH 49/59] feat(prerelease): v-9.1.1-pre-01 #9493 (#9494) --- src/Besql/Bit.Besql/wwwroot/bit-besql.js | 2 +- src/Bit.Build.props | 2 +- src/BlazorUI/Bit.BlazorUI/Scripts/general.ts | 2 +- .../Bit.BlazorUI.Demo.Server.csproj | 4 ++-- .../Bit.BlazorUI.Demo.Shared.csproj | 4 ++-- .../Bit.BlazorUI.Demo.Client.Core.csproj | 4 ++-- .../Bit.BlazorUI.Demo.Client.Maui.csproj | 4 ++-- .../Bit.BlazorUI.Demo.Client.Web.csproj | 6 +++--- .../wwwroot/service-worker.published.js | 2 +- .../Bit.BlazorUI.Demo.Client.Windows.csproj | 4 ++-- src/BlazorUI/Demo/Directory.Build.props | 2 +- .../Bit.Bswup.Demo/wwwroot/service-worker.js | 2 +- .../wwwroot/service-worker.published.js | 2 +- .../wwwroot/service-worker.js | 2 +- .../wwwroot/service-worker.published.js | 2 +- .../Bit.Bswup/Scripts/bit-bswup.progress.ts | 2 +- src/Bswup/Bit.Bswup/Scripts/bit-bswup.sw.ts | 2 +- src/Bswup/Bit.Bswup/Scripts/bit-bswup.ts | 2 +- .../FullDemo/Client/wwwroot/service-worker.js | 2 +- .../Client/wwwroot/service-worker.published.js | 2 +- src/Bup/Bit.Bup/Scripts/bit-bup.progress.ts | 2 +- src/Bup/Bit.Bup/Scripts/bit-bup.ts | 2 +- src/Butil/Bit.Butil/Scripts/butil.ts | 2 +- .../BlazorEmpty.Client.csproj | 8 ++++---- .../BlazorEmpty/BlazorEmpty.csproj | 8 ++++---- .../wwwroot/service-worker.published.js | 9 +++++---- .../Bit.Boilerplate/src/Directory.Build.props | 2 +- .../src/Directory.Packages.props | 18 +++++++++--------- .../src/Directory.Packages8.props | 18 +++++++++--------- .../Bit.Websites.Careers.Client.csproj | 10 +++++----- .../Bit.Websites.Careers.Server.csproj | 4 ++-- .../Bit.Websites.Careers.Shared.csproj | 4 ++-- src/Websites/Careers/src/Directory.Build.props | 2 +- .../Bit.Websites.Platform.Client.csproj | 12 ++++++------ .../Templates03GettingStartedPage.razor | 4 ++-- .../Templates03GettingStartedPage.razor.cs | 2 +- .../Bit.Websites.Platform.Server.csproj | 4 ++-- .../Bit.Websites.Platform.Shared.csproj | 4 ++-- .../Platform/src/Directory.Build.props | 2 +- .../Bit.Websites.Sales.Client.csproj | 10 +++++----- .../Bit.Websites.Sales.Server.csproj | 4 ++-- .../Bit.Websites.Sales.Shared.csproj | 4 ++-- src/Websites/Sales/src/Directory.Build.props | 2 +- 43 files changed, 96 insertions(+), 95 deletions(-) diff --git a/src/Besql/Bit.Besql/wwwroot/bit-besql.js b/src/Besql/Bit.Besql/wwwroot/bit-besql.js index b52a0bd3ea..1ccc351b82 100644 --- a/src/Besql/Bit.Besql/wwwroot/bit-besql.js +++ b/src/Besql/Bit.Besql/wwwroot/bit-besql.js @@ -1,5 +1,5 @@ var BitBesql = window.BitBesql || {}; -BitBesql.version = window['bit-besql version'] = '9.1.0'; +BitBesql.version = window['bit-besql version'] = '9.1.1-pre-01'; BitBesql.init = async function init(fileName) { const sqliteFilePath = `/${fileName}`; diff --git a/src/Bit.Build.props b/src/Bit.Build.props index c79b843b27..8153794a8a 100644 --- a/src/Bit.Build.props +++ b/src/Bit.Build.props @@ -27,7 +27,7 @@ https://github.com/bitfoundation/bitplatform - 9.1.0 + 9.1.1-pre-01 $(ReleaseVersion) https://github.com/bitfoundation/bitplatform/releases/tag/v-$(ReleaseVersion) $([System.String]::Copy($(ReleaseVersion)).Replace('-pre-', '.')) diff --git a/src/BlazorUI/Bit.BlazorUI/Scripts/general.ts b/src/BlazorUI/Bit.BlazorUI/Scripts/general.ts index 8052a0c7b4..aa14acecd2 100644 --- a/src/BlazorUI/Bit.BlazorUI/Scripts/general.ts +++ b/src/BlazorUI/Bit.BlazorUI/Scripts/general.ts @@ -1,4 +1,4 @@ -(BitBlazorUI as any).version = (window as any)['bit-blazorui version'] = '9.1.0'; +(BitBlazorUI as any).version = (window as any)['bit-blazorui version'] = '9.1.1-pre-01'; interface DotNetObject { invokeMethod(methodIdentifier: string, ...args: any[]): T; diff --git a/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Bit.BlazorUI.Demo.Server.csproj b/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Bit.BlazorUI.Demo.Server.csproj index a21714d6d4..280fddfb86 100644 --- a/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Bit.BlazorUI.Demo.Server.csproj +++ b/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Bit.BlazorUI.Demo.Server.csproj @@ -5,11 +5,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Shared/Bit.BlazorUI.Demo.Shared.csproj b/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Shared/Bit.BlazorUI.Demo.Shared.csproj index 0af97bd553..00a0c7df9c 100644 --- a/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Shared/Bit.BlazorUI.Demo.Shared.csproj +++ b/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Shared/Bit.BlazorUI.Demo.Shared.csproj @@ -5,11 +5,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Bit.BlazorUI.Demo.Client.Core.csproj b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Bit.BlazorUI.Demo.Client.Core.csproj index f87b4ed6db..7deda39397 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Bit.BlazorUI.Demo.Client.Core.csproj +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Bit.BlazorUI.Demo.Client.Core.csproj @@ -16,11 +16,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Maui/Bit.BlazorUI.Demo.Client.Maui.csproj b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Maui/Bit.BlazorUI.Demo.Client.Maui.csproj index 99ac6451ab..e966ae91ed 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Maui/Bit.BlazorUI.Demo.Client.Maui.csproj +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Maui/Bit.BlazorUI.Demo.Client.Maui.csproj @@ -85,12 +85,12 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Web/Bit.BlazorUI.Demo.Client.Web.csproj b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Web/Bit.BlazorUI.Demo.Client.Web.csproj index 8060c97d67..6b8610d9c5 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Web/Bit.BlazorUI.Demo.Client.Web.csproj +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Web/Bit.BlazorUI.Demo.Client.Web.csproj @@ -24,13 +24,13 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Web/wwwroot/service-worker.published.js b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Web/wwwroot/service-worker.published.js index cfbfd1795d..1fe7a1022e 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Web/wwwroot/service-worker.published.js +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Web/wwwroot/service-worker.published.js @@ -1,4 +1,4 @@ -// bit version: 9.1.0 +// bit version: 9.1.1-pre-01 // https://github.com/bitfoundation/bitplatform/tree/develop/src/Bswup self.assetsInclude = []; diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Windows/Bit.BlazorUI.Demo.Client.Windows.csproj b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Windows/Bit.BlazorUI.Demo.Client.Windows.csproj index 24e969f5e5..2703e34615 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Windows/Bit.BlazorUI.Demo.Client.Windows.csproj +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Windows/Bit.BlazorUI.Demo.Client.Windows.csproj @@ -29,11 +29,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/BlazorUI/Demo/Directory.Build.props b/src/BlazorUI/Demo/Directory.Build.props index e52d4f5ab9..83d49d6b32 100644 --- a/src/BlazorUI/Demo/Directory.Build.props +++ b/src/BlazorUI/Demo/Directory.Build.props @@ -1,4 +1,4 @@ - + 13.0 diff --git a/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.js b/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.js index d8f40d57ca..a0e9648778 100644 --- a/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.js +++ b/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.js @@ -1,4 +1,4 @@ -// bit version: 9.1.0 +// bit version: 9.1.1-pre-01 self.assetsExclude = [/\.scp\.css$/, /weather\.json$/]; self.caseInsensitiveUrl = true; diff --git a/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.published.js b/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.published.js index f50b5994e1..cd4f5ed7e1 100644 --- a/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.published.js +++ b/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.published.js @@ -1,4 +1,4 @@ -// bit version: 9.1.0 +// bit version: 9.1.1-pre-01 self.assetsExclude = [/\.scp\.css$/, /weather\.json$/]; self.caseInsensitiveUrl = true; diff --git a/src/Bswup/Bit.Bswup.NewDemo/Bit.Bswup.NewDemo.Client/wwwroot/service-worker.js b/src/Bswup/Bit.Bswup.NewDemo/Bit.Bswup.NewDemo.Client/wwwroot/service-worker.js index 9eccddc18e..129137e75f 100644 --- a/src/Bswup/Bit.Bswup.NewDemo/Bit.Bswup.NewDemo.Client/wwwroot/service-worker.js +++ b/src/Bswup/Bit.Bswup.NewDemo/Bit.Bswup.NewDemo.Client/wwwroot/service-worker.js @@ -1,4 +1,4 @@ -// bit version: 9.1.0 +// bit version: 9.1.1-pre-01 // In development, always fetch from the network and do not enable offline support. // This is because caching would make development more difficult (changes would not diff --git a/src/Bswup/Bit.Bswup.NewDemo/Bit.Bswup.NewDemo.Client/wwwroot/service-worker.published.js b/src/Bswup/Bit.Bswup.NewDemo/Bit.Bswup.NewDemo.Client/wwwroot/service-worker.published.js index bde2e9c69e..7502434815 100644 --- a/src/Bswup/Bit.Bswup.NewDemo/Bit.Bswup.NewDemo.Client/wwwroot/service-worker.published.js +++ b/src/Bswup/Bit.Bswup.NewDemo/Bit.Bswup.NewDemo.Client/wwwroot/service-worker.published.js @@ -1,4 +1,4 @@ -// bit version: 9.1.0 +// bit version: 9.1.1-pre-01 self.assetsInclude = []; self.assetsExclude = [ diff --git a/src/Bswup/Bit.Bswup/Scripts/bit-bswup.progress.ts b/src/Bswup/Bit.Bswup/Scripts/bit-bswup.progress.ts index dfb7590b22..16e4332c40 100644 --- a/src/Bswup/Bit.Bswup/Scripts/bit-bswup.progress.ts +++ b/src/Bswup/Bit.Bswup/Scripts/bit-bswup.progress.ts @@ -1,4 +1,4 @@ -window['bit-bswup.progress version'] = '9.1.0'; +window['bit-bswup.progress version'] = '9.1.1-pre-01'; ; (function () { (window as any).startBswupProgress = (autoReload: boolean, diff --git a/src/Bswup/Bit.Bswup/Scripts/bit-bswup.sw.ts b/src/Bswup/Bit.Bswup/Scripts/bit-bswup.sw.ts index a56e1f8232..aeeb420882 100644 --- a/src/Bswup/Bit.Bswup/Scripts/bit-bswup.sw.ts +++ b/src/Bswup/Bit.Bswup/Scripts/bit-bswup.sw.ts @@ -1,4 +1,4 @@ -self['bit-bswup.sw version'] = '9.1.0'; +self['bit-bswup.sw version'] = '9.1.1-pre-01'; interface Window { clients: any diff --git a/src/Bswup/Bit.Bswup/Scripts/bit-bswup.ts b/src/Bswup/Bit.Bswup/Scripts/bit-bswup.ts index e3f51e86f8..369a781bb6 100644 --- a/src/Bswup/Bit.Bswup/Scripts/bit-bswup.ts +++ b/src/Bswup/Bit.Bswup/Scripts/bit-bswup.ts @@ -1,5 +1,5 @@ const BitBswup = {} as any; -BitBswup.version = window['bit-bswup version'] = '9.1.0'; +BitBswup.version = window['bit-bswup version'] = '9.1.1-pre-01'; declare const Blazor: any; diff --git a/src/Bswup/FullDemo/Client/wwwroot/service-worker.js b/src/Bswup/FullDemo/Client/wwwroot/service-worker.js index 55007368db..86b3cb5c7f 100644 --- a/src/Bswup/FullDemo/Client/wwwroot/service-worker.js +++ b/src/Bswup/FullDemo/Client/wwwroot/service-worker.js @@ -1,4 +1,4 @@ -// bit version: 9.1.0 +// bit version: 9.1.1-pre-01 // In development, always fetch from the network and do not enable offline support. // This is because caching would make development more difficult (changes would not diff --git a/src/Bswup/FullDemo/Client/wwwroot/service-worker.published.js b/src/Bswup/FullDemo/Client/wwwroot/service-worker.published.js index c2533a1abf..2bfb8ccf9d 100644 --- a/src/Bswup/FullDemo/Client/wwwroot/service-worker.published.js +++ b/src/Bswup/FullDemo/Client/wwwroot/service-worker.published.js @@ -1,4 +1,4 @@ -// bit version: 9.1.0 +// bit version: 9.1.1-pre-01 self.assetsInclude = []; self.assetsExclude = [/\.scp\.css$/, /weather\.json$/]; diff --git a/src/Bup/Bit.Bup/Scripts/bit-bup.progress.ts b/src/Bup/Bit.Bup/Scripts/bit-bup.progress.ts index 059059357e..b385e4b143 100644 --- a/src/Bup/Bit.Bup/Scripts/bit-bup.progress.ts +++ b/src/Bup/Bit.Bup/Scripts/bit-bup.progress.ts @@ -1,4 +1,4 @@ -window['bit-bup.progress version'] = '9.1.0'; +window['bit-bup.progress version'] = '9.1.1-pre-01'; ; (function () { (window as any).startBupProgress = (showLogs: boolean, showAssets: boolean, appContainerSelector: string, hideApp: boolean, autoHide: boolean) => { diff --git a/src/Bup/Bit.Bup/Scripts/bit-bup.ts b/src/Bup/Bit.Bup/Scripts/bit-bup.ts index 3277a2cea7..d7784744fe 100644 --- a/src/Bup/Bit.Bup/Scripts/bit-bup.ts +++ b/src/Bup/Bit.Bup/Scripts/bit-bup.ts @@ -1,5 +1,5 @@ var BitBup = BitBup || {}; -BitBup.version = window['bit-bup version'] = '9.1.0'; +BitBup.version = window['bit-bup version'] = '9.1.1-pre-01'; declare const Blazor: any; diff --git a/src/Butil/Bit.Butil/Scripts/butil.ts b/src/Butil/Bit.Butil/Scripts/butil.ts index d2e1883010..13a0a7a528 100644 --- a/src/Butil/Bit.Butil/Scripts/butil.ts +++ b/src/Butil/Bit.Butil/Scripts/butil.ts @@ -1,2 +1,2 @@ var BitButil = BitButil || {}; -BitButil.version = window['bit-butil version'] = '9.1.0'; \ No newline at end of file +BitButil.version = window['bit-butil version'] = '9.1.1-pre-01'; \ No newline at end of file diff --git a/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty.Client/BlazorEmpty.Client.csproj b/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty.Client/BlazorEmpty.Client.csproj index 1968c78056..2234329190 100644 --- a/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty.Client/BlazorEmpty.Client.csproj +++ b/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty.Client/BlazorEmpty.Client.csproj @@ -1,4 +1,4 @@ - + @@ -17,14 +17,14 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty/BlazorEmpty.csproj b/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty/BlazorEmpty.csproj index b3aa7b5dcc..e978d32465 100644 --- a/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty/BlazorEmpty.csproj +++ b/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty/BlazorEmpty.csproj @@ -1,4 +1,4 @@ - + @@ -19,14 +19,14 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js index d8cb862b32..0f0f4585ca 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js @@ -1,5 +1,5 @@ //+:cnd:noEmit -// bit version: 9.1.0 +// bit version: 9.1.1-pre-01 // https://github.com/bitfoundation/bitplatform/tree/develop/src/Bswup //#if (notification == true) @@ -27,7 +27,8 @@ self.assetsExclude = [ /bit\.blazorui\.fluent-light\.css$/, // If a PDF viewer is needed in the PWA, remove these two lines: /pdfjs-4\.7\.76\.js$/, - /pdfjs-4\.7\.76-worker\.js$/ + /pdfjs-4\.7\.76-worker\.js$/, + /Boilerplate\.Client\.Web\.styles\.css$/ ]; self.externalAssets = [ { @@ -35,12 +36,12 @@ self.externalAssets = [ }, { //#if (framework == "net9.0") - url: "_framework/blazor.web.js?ver=9.0.0" + url: "_framework/blazor.web.js" //#else //#if (IsInsideProjectTemplate == true) /* //#endif - url: "_framework/blazor.web.js?ver=8.0.11" + url: "_framework/blazor.web.js" //#if (IsInsideProjectTemplate == true) */ //#endif diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Build.props b/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Build.props index 1d0850f05d..2e05e67fa9 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Build.props +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Build.props @@ -1,4 +1,4 @@ - + diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props b/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props index d8d2bddf8d..17bd11cba7 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props @@ -1,14 +1,14 @@  - - - - - - - - + + + + + + + + @@ -46,7 +46,7 @@ - + diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages8.props b/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages8.props index f891d1d52a..0cbb368235 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages8.props +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages8.props @@ -1,14 +1,14 @@  - - - - - - - - + + + + + + + + @@ -46,7 +46,7 @@ - + diff --git a/src/Websites/Careers/src/Bit.Websites.Careers.Client/Bit.Websites.Careers.Client.csproj b/src/Websites/Careers/src/Bit.Websites.Careers.Client/Bit.Websites.Careers.Client.csproj index a879ea2461..9cd0b8a89a 100644 --- a/src/Websites/Careers/src/Bit.Websites.Careers.Client/Bit.Websites.Careers.Client.csproj +++ b/src/Websites/Careers/src/Bit.Websites.Careers.Client/Bit.Websites.Careers.Client.csproj @@ -22,15 +22,15 @@ - - + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Careers/src/Bit.Websites.Careers.Server/Bit.Websites.Careers.Server.csproj b/src/Websites/Careers/src/Bit.Websites.Careers.Server/Bit.Websites.Careers.Server.csproj index a7be1beb4c..3d625fb963 100644 --- a/src/Websites/Careers/src/Bit.Websites.Careers.Server/Bit.Websites.Careers.Server.csproj +++ b/src/Websites/Careers/src/Bit.Websites.Careers.Server/Bit.Websites.Careers.Server.csproj @@ -10,11 +10,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Careers/src/Bit.Websites.Careers.Shared/Bit.Websites.Careers.Shared.csproj b/src/Websites/Careers/src/Bit.Websites.Careers.Shared/Bit.Websites.Careers.Shared.csproj index 671e6d8060..1a8ab7507f 100644 --- a/src/Websites/Careers/src/Bit.Websites.Careers.Shared/Bit.Websites.Careers.Shared.csproj +++ b/src/Websites/Careers/src/Bit.Websites.Careers.Shared/Bit.Websites.Careers.Shared.csproj @@ -6,11 +6,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Careers/src/Directory.Build.props b/src/Websites/Careers/src/Directory.Build.props index 539361cc6b..374386e02e 100644 --- a/src/Websites/Careers/src/Directory.Build.props +++ b/src/Websites/Careers/src/Directory.Build.props @@ -1,4 +1,4 @@ - + 13.0 diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Bit.Websites.Platform.Client.csproj b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Bit.Websites.Platform.Client.csproj index a181d12f4d..40c6f84c39 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Bit.Websites.Platform.Client.csproj +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Bit.Websites.Platform.Client.csproj @@ -22,16 +22,16 @@ - - - + + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor index c8f9aabbe5..37027af401 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor @@ -174,8 +174,8 @@ rm $HOME/dotnet.tar.gz }
  • -
    Install Bit Boilerplate project template
    - dotnet new install Bit.Boilerplate::9.1.0 +
    Install Bit Boilerplate project template
    + dotnet new install Bit.Boilerplate::9.1.1-pre-01
  • @if (showCrossPlatform && devOS is "Windows") { diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor.cs index 23f59fcd77..39b931ae0c 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor.cs +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor.cs @@ -38,7 +38,7 @@ public partial class Templates03GettingStartedPage command:"dotnet nuget add source \"https://api.nuget.org/v3/index.json\" --name \"nuget.org\"; dotnet workload install wasm-tools;"), (text:@"echo 'Install the Bit.Boilerplate project template https://www.nuget.org/packages/Boilerplate.Templates';", - command:"dotnet new install Bit.Boilerplate::9.1.0;") + command:"dotnet new install Bit.Boilerplate::9.1.1-pre-01;") ]; if (enableVirtualization) diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Server/Bit.Websites.Platform.Server.csproj b/src/Websites/Platform/src/Bit.Websites.Platform.Server/Bit.Websites.Platform.Server.csproj index d2638aff02..da10e58d84 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Server/Bit.Websites.Platform.Server.csproj +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Server/Bit.Websites.Platform.Server.csproj @@ -10,11 +10,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Shared/Bit.Websites.Platform.Shared.csproj b/src/Websites/Platform/src/Bit.Websites.Platform.Shared/Bit.Websites.Platform.Shared.csproj index 671e6d8060..1a8ab7507f 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Shared/Bit.Websites.Platform.Shared.csproj +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Shared/Bit.Websites.Platform.Shared.csproj @@ -6,11 +6,11 @@
    - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Platform/src/Directory.Build.props b/src/Websites/Platform/src/Directory.Build.props index 334fc6f636..c400befa5e 100644 --- a/src/Websites/Platform/src/Directory.Build.props +++ b/src/Websites/Platform/src/Directory.Build.props @@ -1,4 +1,4 @@ - + preview diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Client/Bit.Websites.Sales.Client.csproj b/src/Websites/Sales/src/Bit.Websites.Sales.Client/Bit.Websites.Sales.Client.csproj index dfaaaf87fa..a54e4860e5 100644 --- a/src/Websites/Sales/src/Bit.Websites.Sales.Client/Bit.Websites.Sales.Client.csproj +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Client/Bit.Websites.Sales.Client.csproj @@ -22,15 +22,15 @@ - - + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Server/Bit.Websites.Sales.Server.csproj b/src/Websites/Sales/src/Bit.Websites.Sales.Server/Bit.Websites.Sales.Server.csproj index 8dce0fa93d..1d19466309 100644 --- a/src/Websites/Sales/src/Bit.Websites.Sales.Server/Bit.Websites.Sales.Server.csproj +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Server/Bit.Websites.Sales.Server.csproj @@ -10,11 +10,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Shared/Bit.Websites.Sales.Shared.csproj b/src/Websites/Sales/src/Bit.Websites.Sales.Shared/Bit.Websites.Sales.Shared.csproj index 671e6d8060..1a8ab7507f 100644 --- a/src/Websites/Sales/src/Bit.Websites.Sales.Shared/Bit.Websites.Sales.Shared.csproj +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Shared/Bit.Websites.Sales.Shared.csproj @@ -6,11 +6,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Sales/src/Directory.Build.props b/src/Websites/Sales/src/Directory.Build.props index 2d0adb1c87..09427a0eb4 100644 --- a/src/Websites/Sales/src/Directory.Build.props +++ b/src/Websites/Sales/src/Directory.Build.props @@ -1,4 +1,4 @@ - + 13.0 From c444ba58e7acdf3af093ec70905026a9554378b8 Mon Sep 17 00:00:00 2001 From: Saleh Yusefnejad Date: Sun, 15 Dec 2024 19:49:07 +0330 Subject: [PATCH 50/59] feat(blazorui): remove InternalsVisibleTo conditions in BlazorUI project file #9495 (#9496) --- src/BlazorUI/Bit.BlazorUI/Bit.BlazorUI.csproj | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/BlazorUI/Bit.BlazorUI/Bit.BlazorUI.csproj b/src/BlazorUI/Bit.BlazorUI/Bit.BlazorUI.csproj index 849452fbee..b362585f92 100644 --- a/src/BlazorUI/Bit.BlazorUI/Bit.BlazorUI.csproj +++ b/src/BlazorUI/Bit.BlazorUI/Bit.BlazorUI.csproj @@ -16,10 +16,8 @@ - + - - From f68672d45b791b5978a63e75ea8faffd9754ea57 Mon Sep 17 00:00:00 2001 From: Saleh Yusefnejad Date: Sun, 15 Dec 2024 21:23:38 +0330 Subject: [PATCH 51/59] feat(release): v-9.1.1 #9497 (#9499) --- src/Besql/Bit.Besql/wwwroot/bit-besql.js | 2 +- src/Bit.Build.props | 2 +- src/BlazorUI/Bit.BlazorUI/Scripts/general.ts | 2 +- .../Bit.BlazorUI.Demo.Server.csproj | 4 ++-- .../Bit.BlazorUI.Demo.Shared.csproj | 4 ++-- .../Bit.BlazorUI.Demo.Client.Core.csproj | 4 ++-- .../Bit.BlazorUI.Demo.Client.Maui.csproj | 4 ++-- .../Bit.BlazorUI.Demo.Client.Web.csproj | 6 +++--- .../wwwroot/service-worker.published.js | 2 +- .../Bit.BlazorUI.Demo.Client.Windows.csproj | 4 ++-- src/BlazorUI/Demo/Directory.Build.props | 2 +- .../Bit.Bswup.Demo/wwwroot/service-worker.js | 2 +- .../wwwroot/service-worker.published.js | 2 +- .../wwwroot/service-worker.js | 2 +- .../wwwroot/service-worker.published.js | 2 +- .../Bit.Bswup/Scripts/bit-bswup.progress.ts | 2 +- src/Bswup/Bit.Bswup/Scripts/bit-bswup.sw.ts | 2 +- src/Bswup/Bit.Bswup/Scripts/bit-bswup.ts | 2 +- .../FullDemo/Client/wwwroot/service-worker.js | 2 +- .../Client/wwwroot/service-worker.published.js | 2 +- src/Bup/Bit.Bup/Scripts/bit-bup.progress.ts | 2 +- src/Bup/Bit.Bup/Scripts/bit-bup.ts | 2 +- src/Butil/Bit.Butil/Scripts/butil.ts | 2 +- .../BlazorEmpty.Client.csproj | 8 ++++---- .../BlazorEmpty/BlazorEmpty.csproj | 8 ++++---- .../wwwroot/service-worker.published.js | 2 +- .../Bit.Boilerplate/src/Directory.Build.props | 2 +- .../src/Directory.Packages.props | 18 +++++++++--------- .../src/Directory.Packages8.props | 18 +++++++++--------- .../Bit.Websites.Careers.Client.csproj | 10 +++++----- .../Bit.Websites.Careers.Server.csproj | 4 ++-- .../Bit.Websites.Careers.Shared.csproj | 4 ++-- src/Websites/Careers/src/Directory.Build.props | 2 +- .../Bit.Websites.Platform.Client.csproj | 12 ++++++------ .../Templates03GettingStartedPage.razor | 4 ++-- .../Templates03GettingStartedPage.razor.cs | 2 +- .../Bit.Websites.Platform.Server.csproj | 4 ++-- .../Bit.Websites.Platform.Shared.csproj | 4 ++-- .../Platform/src/Directory.Build.props | 2 +- .../Bit.Websites.Sales.Client.csproj | 10 +++++----- .../Bit.Websites.Sales.Server.csproj | 4 ++-- .../Bit.Websites.Sales.Shared.csproj | 4 ++-- src/Websites/Sales/src/Directory.Build.props | 2 +- 43 files changed, 92 insertions(+), 92 deletions(-) diff --git a/src/Besql/Bit.Besql/wwwroot/bit-besql.js b/src/Besql/Bit.Besql/wwwroot/bit-besql.js index 1ccc351b82..aa548d55e5 100644 --- a/src/Besql/Bit.Besql/wwwroot/bit-besql.js +++ b/src/Besql/Bit.Besql/wwwroot/bit-besql.js @@ -1,5 +1,5 @@ var BitBesql = window.BitBesql || {}; -BitBesql.version = window['bit-besql version'] = '9.1.1-pre-01'; +BitBesql.version = window['bit-besql version'] = '9.1.1'; BitBesql.init = async function init(fileName) { const sqliteFilePath = `/${fileName}`; diff --git a/src/Bit.Build.props b/src/Bit.Build.props index 8153794a8a..c7c8af3021 100644 --- a/src/Bit.Build.props +++ b/src/Bit.Build.props @@ -27,7 +27,7 @@ https://github.com/bitfoundation/bitplatform - 9.1.1-pre-01 + 9.1.1 $(ReleaseVersion) https://github.com/bitfoundation/bitplatform/releases/tag/v-$(ReleaseVersion) $([System.String]::Copy($(ReleaseVersion)).Replace('-pre-', '.')) diff --git a/src/BlazorUI/Bit.BlazorUI/Scripts/general.ts b/src/BlazorUI/Bit.BlazorUI/Scripts/general.ts index aa14acecd2..7f7c98e6b8 100644 --- a/src/BlazorUI/Bit.BlazorUI/Scripts/general.ts +++ b/src/BlazorUI/Bit.BlazorUI/Scripts/general.ts @@ -1,4 +1,4 @@ -(BitBlazorUI as any).version = (window as any)['bit-blazorui version'] = '9.1.1-pre-01'; +(BitBlazorUI as any).version = (window as any)['bit-blazorui version'] = '9.1.1'; interface DotNetObject { invokeMethod(methodIdentifier: string, ...args: any[]): T; diff --git a/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Bit.BlazorUI.Demo.Server.csproj b/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Bit.BlazorUI.Demo.Server.csproj index 280fddfb86..7bbbb07f4a 100644 --- a/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Bit.BlazorUI.Demo.Server.csproj +++ b/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Bit.BlazorUI.Demo.Server.csproj @@ -5,11 +5,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Shared/Bit.BlazorUI.Demo.Shared.csproj b/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Shared/Bit.BlazorUI.Demo.Shared.csproj index 00a0c7df9c..c4c0f14ffc 100644 --- a/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Shared/Bit.BlazorUI.Demo.Shared.csproj +++ b/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Shared/Bit.BlazorUI.Demo.Shared.csproj @@ -5,11 +5,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Bit.BlazorUI.Demo.Client.Core.csproj b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Bit.BlazorUI.Demo.Client.Core.csproj index 7deda39397..cbe900ae9b 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Bit.BlazorUI.Demo.Client.Core.csproj +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Bit.BlazorUI.Demo.Client.Core.csproj @@ -16,11 +16,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Maui/Bit.BlazorUI.Demo.Client.Maui.csproj b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Maui/Bit.BlazorUI.Demo.Client.Maui.csproj index e966ae91ed..bbfbad2c22 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Maui/Bit.BlazorUI.Demo.Client.Maui.csproj +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Maui/Bit.BlazorUI.Demo.Client.Maui.csproj @@ -85,12 +85,12 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Web/Bit.BlazorUI.Demo.Client.Web.csproj b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Web/Bit.BlazorUI.Demo.Client.Web.csproj index 6b8610d9c5..c24a58d9d8 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Web/Bit.BlazorUI.Demo.Client.Web.csproj +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Web/Bit.BlazorUI.Demo.Client.Web.csproj @@ -24,13 +24,13 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Web/wwwroot/service-worker.published.js b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Web/wwwroot/service-worker.published.js index 1fe7a1022e..a71df9e01d 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Web/wwwroot/service-worker.published.js +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Web/wwwroot/service-worker.published.js @@ -1,4 +1,4 @@ -// bit version: 9.1.1-pre-01 +// bit version: 9.1.1 // https://github.com/bitfoundation/bitplatform/tree/develop/src/Bswup self.assetsInclude = []; diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Windows/Bit.BlazorUI.Demo.Client.Windows.csproj b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Windows/Bit.BlazorUI.Demo.Client.Windows.csproj index 2703e34615..c6cec5e7bb 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Windows/Bit.BlazorUI.Demo.Client.Windows.csproj +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Windows/Bit.BlazorUI.Demo.Client.Windows.csproj @@ -29,11 +29,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/BlazorUI/Demo/Directory.Build.props b/src/BlazorUI/Demo/Directory.Build.props index 83d49d6b32..48713529b8 100644 --- a/src/BlazorUI/Demo/Directory.Build.props +++ b/src/BlazorUI/Demo/Directory.Build.props @@ -1,4 +1,4 @@ - + 13.0 diff --git a/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.js b/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.js index a0e9648778..e4cd143d5d 100644 --- a/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.js +++ b/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.js @@ -1,4 +1,4 @@ -// bit version: 9.1.1-pre-01 +// bit version: 9.1.1 self.assetsExclude = [/\.scp\.css$/, /weather\.json$/]; self.caseInsensitiveUrl = true; diff --git a/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.published.js b/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.published.js index cd4f5ed7e1..0e948d764d 100644 --- a/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.published.js +++ b/src/Bswup/Bit.Bswup.Demo/wwwroot/service-worker.published.js @@ -1,4 +1,4 @@ -// bit version: 9.1.1-pre-01 +// bit version: 9.1.1 self.assetsExclude = [/\.scp\.css$/, /weather\.json$/]; self.caseInsensitiveUrl = true; diff --git a/src/Bswup/Bit.Bswup.NewDemo/Bit.Bswup.NewDemo.Client/wwwroot/service-worker.js b/src/Bswup/Bit.Bswup.NewDemo/Bit.Bswup.NewDemo.Client/wwwroot/service-worker.js index 129137e75f..2ecbf8c7ba 100644 --- a/src/Bswup/Bit.Bswup.NewDemo/Bit.Bswup.NewDemo.Client/wwwroot/service-worker.js +++ b/src/Bswup/Bit.Bswup.NewDemo/Bit.Bswup.NewDemo.Client/wwwroot/service-worker.js @@ -1,4 +1,4 @@ -// bit version: 9.1.1-pre-01 +// bit version: 9.1.1 // In development, always fetch from the network and do not enable offline support. // This is because caching would make development more difficult (changes would not diff --git a/src/Bswup/Bit.Bswup.NewDemo/Bit.Bswup.NewDemo.Client/wwwroot/service-worker.published.js b/src/Bswup/Bit.Bswup.NewDemo/Bit.Bswup.NewDemo.Client/wwwroot/service-worker.published.js index 7502434815..17c28f1961 100644 --- a/src/Bswup/Bit.Bswup.NewDemo/Bit.Bswup.NewDemo.Client/wwwroot/service-worker.published.js +++ b/src/Bswup/Bit.Bswup.NewDemo/Bit.Bswup.NewDemo.Client/wwwroot/service-worker.published.js @@ -1,4 +1,4 @@ -// bit version: 9.1.1-pre-01 +// bit version: 9.1.1 self.assetsInclude = []; self.assetsExclude = [ diff --git a/src/Bswup/Bit.Bswup/Scripts/bit-bswup.progress.ts b/src/Bswup/Bit.Bswup/Scripts/bit-bswup.progress.ts index 16e4332c40..e983cbed8d 100644 --- a/src/Bswup/Bit.Bswup/Scripts/bit-bswup.progress.ts +++ b/src/Bswup/Bit.Bswup/Scripts/bit-bswup.progress.ts @@ -1,4 +1,4 @@ -window['bit-bswup.progress version'] = '9.1.1-pre-01'; +window['bit-bswup.progress version'] = '9.1.1'; ; (function () { (window as any).startBswupProgress = (autoReload: boolean, diff --git a/src/Bswup/Bit.Bswup/Scripts/bit-bswup.sw.ts b/src/Bswup/Bit.Bswup/Scripts/bit-bswup.sw.ts index aeeb420882..a0f9828c02 100644 --- a/src/Bswup/Bit.Bswup/Scripts/bit-bswup.sw.ts +++ b/src/Bswup/Bit.Bswup/Scripts/bit-bswup.sw.ts @@ -1,4 +1,4 @@ -self['bit-bswup.sw version'] = '9.1.1-pre-01'; +self['bit-bswup.sw version'] = '9.1.1'; interface Window { clients: any diff --git a/src/Bswup/Bit.Bswup/Scripts/bit-bswup.ts b/src/Bswup/Bit.Bswup/Scripts/bit-bswup.ts index 369a781bb6..fff156bdf3 100644 --- a/src/Bswup/Bit.Bswup/Scripts/bit-bswup.ts +++ b/src/Bswup/Bit.Bswup/Scripts/bit-bswup.ts @@ -1,5 +1,5 @@ const BitBswup = {} as any; -BitBswup.version = window['bit-bswup version'] = '9.1.1-pre-01'; +BitBswup.version = window['bit-bswup version'] = '9.1.1'; declare const Blazor: any; diff --git a/src/Bswup/FullDemo/Client/wwwroot/service-worker.js b/src/Bswup/FullDemo/Client/wwwroot/service-worker.js index 86b3cb5c7f..79553ecfce 100644 --- a/src/Bswup/FullDemo/Client/wwwroot/service-worker.js +++ b/src/Bswup/FullDemo/Client/wwwroot/service-worker.js @@ -1,4 +1,4 @@ -// bit version: 9.1.1-pre-01 +// bit version: 9.1.1 // In development, always fetch from the network and do not enable offline support. // This is because caching would make development more difficult (changes would not diff --git a/src/Bswup/FullDemo/Client/wwwroot/service-worker.published.js b/src/Bswup/FullDemo/Client/wwwroot/service-worker.published.js index 2bfb8ccf9d..b6a3ad822b 100644 --- a/src/Bswup/FullDemo/Client/wwwroot/service-worker.published.js +++ b/src/Bswup/FullDemo/Client/wwwroot/service-worker.published.js @@ -1,4 +1,4 @@ -// bit version: 9.1.1-pre-01 +// bit version: 9.1.1 self.assetsInclude = []; self.assetsExclude = [/\.scp\.css$/, /weather\.json$/]; diff --git a/src/Bup/Bit.Bup/Scripts/bit-bup.progress.ts b/src/Bup/Bit.Bup/Scripts/bit-bup.progress.ts index b385e4b143..e4a1a00937 100644 --- a/src/Bup/Bit.Bup/Scripts/bit-bup.progress.ts +++ b/src/Bup/Bit.Bup/Scripts/bit-bup.progress.ts @@ -1,4 +1,4 @@ -window['bit-bup.progress version'] = '9.1.1-pre-01'; +window['bit-bup.progress version'] = '9.1.1'; ; (function () { (window as any).startBupProgress = (showLogs: boolean, showAssets: boolean, appContainerSelector: string, hideApp: boolean, autoHide: boolean) => { diff --git a/src/Bup/Bit.Bup/Scripts/bit-bup.ts b/src/Bup/Bit.Bup/Scripts/bit-bup.ts index d7784744fe..7e7f345e31 100644 --- a/src/Bup/Bit.Bup/Scripts/bit-bup.ts +++ b/src/Bup/Bit.Bup/Scripts/bit-bup.ts @@ -1,5 +1,5 @@ var BitBup = BitBup || {}; -BitBup.version = window['bit-bup version'] = '9.1.1-pre-01'; +BitBup.version = window['bit-bup version'] = '9.1.1'; declare const Blazor: any; diff --git a/src/Butil/Bit.Butil/Scripts/butil.ts b/src/Butil/Bit.Butil/Scripts/butil.ts index 13a0a7a528..6155d41e06 100644 --- a/src/Butil/Bit.Butil/Scripts/butil.ts +++ b/src/Butil/Bit.Butil/Scripts/butil.ts @@ -1,2 +1,2 @@ var BitButil = BitButil || {}; -BitButil.version = window['bit-butil version'] = '9.1.1-pre-01'; \ No newline at end of file +BitButil.version = window['bit-butil version'] = '9.1.1'; \ No newline at end of file diff --git a/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty.Client/BlazorEmpty.Client.csproj b/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty.Client/BlazorEmpty.Client.csproj index 2234329190..40a7ff0f34 100644 --- a/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty.Client/BlazorEmpty.Client.csproj +++ b/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty.Client/BlazorEmpty.Client.csproj @@ -1,4 +1,4 @@ - + @@ -17,14 +17,14 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty/BlazorEmpty.csproj b/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty/BlazorEmpty.csproj index e978d32465..3fe47d656f 100644 --- a/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty/BlazorEmpty.csproj +++ b/src/Templates/BlazorEmpty/Bit.BlazorEmpty/BlazorEmpty/BlazorEmpty.csproj @@ -1,4 +1,4 @@ - + @@ -19,14 +19,14 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js index 0f0f4585ca..ce34c6bc0c 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js @@ -1,5 +1,5 @@ //+:cnd:noEmit -// bit version: 9.1.1-pre-01 +// bit version: 9.1.1 // https://github.com/bitfoundation/bitplatform/tree/develop/src/Bswup //#if (notification == true) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Build.props b/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Build.props index 2e05e67fa9..a99951b70b 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Build.props +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Build.props @@ -1,4 +1,4 @@ - + diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props b/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props index 17bd11cba7..7e68a63736 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props @@ -1,14 +1,14 @@  - - - - - - - - + + + + + + + + @@ -46,7 +46,7 @@ - + diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages8.props b/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages8.props index 0cbb368235..08c62affa3 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages8.props +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages8.props @@ -1,14 +1,14 @@  - - - - - - - - + + + + + + + + @@ -46,7 +46,7 @@ - + diff --git a/src/Websites/Careers/src/Bit.Websites.Careers.Client/Bit.Websites.Careers.Client.csproj b/src/Websites/Careers/src/Bit.Websites.Careers.Client/Bit.Websites.Careers.Client.csproj index 9cd0b8a89a..834ebbe27c 100644 --- a/src/Websites/Careers/src/Bit.Websites.Careers.Client/Bit.Websites.Careers.Client.csproj +++ b/src/Websites/Careers/src/Bit.Websites.Careers.Client/Bit.Websites.Careers.Client.csproj @@ -22,15 +22,15 @@ - - + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Careers/src/Bit.Websites.Careers.Server/Bit.Websites.Careers.Server.csproj b/src/Websites/Careers/src/Bit.Websites.Careers.Server/Bit.Websites.Careers.Server.csproj index 3d625fb963..d10be9c497 100644 --- a/src/Websites/Careers/src/Bit.Websites.Careers.Server/Bit.Websites.Careers.Server.csproj +++ b/src/Websites/Careers/src/Bit.Websites.Careers.Server/Bit.Websites.Careers.Server.csproj @@ -10,11 +10,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Careers/src/Bit.Websites.Careers.Shared/Bit.Websites.Careers.Shared.csproj b/src/Websites/Careers/src/Bit.Websites.Careers.Shared/Bit.Websites.Careers.Shared.csproj index 1a8ab7507f..2165ced4fe 100644 --- a/src/Websites/Careers/src/Bit.Websites.Careers.Shared/Bit.Websites.Careers.Shared.csproj +++ b/src/Websites/Careers/src/Bit.Websites.Careers.Shared/Bit.Websites.Careers.Shared.csproj @@ -6,11 +6,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Careers/src/Directory.Build.props b/src/Websites/Careers/src/Directory.Build.props index 374386e02e..cd0a54c580 100644 --- a/src/Websites/Careers/src/Directory.Build.props +++ b/src/Websites/Careers/src/Directory.Build.props @@ -1,4 +1,4 @@ - + 13.0 diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Bit.Websites.Platform.Client.csproj b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Bit.Websites.Platform.Client.csproj index 40c6f84c39..8f9c14a377 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Bit.Websites.Platform.Client.csproj +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Bit.Websites.Platform.Client.csproj @@ -22,16 +22,16 @@ - - - + + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor index 37027af401..b707e7b4d7 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor @@ -174,8 +174,8 @@ rm $HOME/dotnet.tar.gz }
  • -
    Install Bit Boilerplate project template
    - dotnet new install Bit.Boilerplate::9.1.1-pre-01 +
    Install Bit Boilerplate project template
    + dotnet new install Bit.Boilerplate::9.1.1
  • @if (showCrossPlatform && devOS is "Windows") { diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor.cs index 39b931ae0c..f4ba56aba9 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor.cs +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor.cs @@ -38,7 +38,7 @@ public partial class Templates03GettingStartedPage command:"dotnet nuget add source \"https://api.nuget.org/v3/index.json\" --name \"nuget.org\"; dotnet workload install wasm-tools;"), (text:@"echo 'Install the Bit.Boilerplate project template https://www.nuget.org/packages/Boilerplate.Templates';", - command:"dotnet new install Bit.Boilerplate::9.1.1-pre-01;") + command:"dotnet new install Bit.Boilerplate::9.1.1;") ]; if (enableVirtualization) diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Server/Bit.Websites.Platform.Server.csproj b/src/Websites/Platform/src/Bit.Websites.Platform.Server/Bit.Websites.Platform.Server.csproj index da10e58d84..34e84e8f00 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Server/Bit.Websites.Platform.Server.csproj +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Server/Bit.Websites.Platform.Server.csproj @@ -10,11 +10,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Shared/Bit.Websites.Platform.Shared.csproj b/src/Websites/Platform/src/Bit.Websites.Platform.Shared/Bit.Websites.Platform.Shared.csproj index 1a8ab7507f..2165ced4fe 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Shared/Bit.Websites.Platform.Shared.csproj +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Shared/Bit.Websites.Platform.Shared.csproj @@ -6,11 +6,11 @@
    - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Platform/src/Directory.Build.props b/src/Websites/Platform/src/Directory.Build.props index c400befa5e..bf56ee91ba 100644 --- a/src/Websites/Platform/src/Directory.Build.props +++ b/src/Websites/Platform/src/Directory.Build.props @@ -1,4 +1,4 @@ - + preview diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Client/Bit.Websites.Sales.Client.csproj b/src/Websites/Sales/src/Bit.Websites.Sales.Client/Bit.Websites.Sales.Client.csproj index a54e4860e5..fbb3e33c1a 100644 --- a/src/Websites/Sales/src/Bit.Websites.Sales.Client/Bit.Websites.Sales.Client.csproj +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Client/Bit.Websites.Sales.Client.csproj @@ -22,15 +22,15 @@ - - + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Server/Bit.Websites.Sales.Server.csproj b/src/Websites/Sales/src/Bit.Websites.Sales.Server/Bit.Websites.Sales.Server.csproj index 1d19466309..3b1e550144 100644 --- a/src/Websites/Sales/src/Bit.Websites.Sales.Server/Bit.Websites.Sales.Server.csproj +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Server/Bit.Websites.Sales.Server.csproj @@ -10,11 +10,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Shared/Bit.Websites.Sales.Shared.csproj b/src/Websites/Sales/src/Bit.Websites.Sales.Shared/Bit.Websites.Sales.Shared.csproj index 1a8ab7507f..2165ced4fe 100644 --- a/src/Websites/Sales/src/Bit.Websites.Sales.Shared/Bit.Websites.Sales.Shared.csproj +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Shared/Bit.Websites.Sales.Shared.csproj @@ -6,11 +6,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Websites/Sales/src/Directory.Build.props b/src/Websites/Sales/src/Directory.Build.props index 09427a0eb4..35d83aa6ac 100644 --- a/src/Websites/Sales/src/Directory.Build.props +++ b/src/Websites/Sales/src/Directory.Build.props @@ -1,4 +1,4 @@ - + 13.0 From 2d1d6bd0a1aa5a2edfbce75509eaa258759a219c Mon Sep 17 00:00:00 2001 From: Saleh Yusefnejad Date: Tue, 17 Dec 2024 00:13:08 +0330 Subject: [PATCH 52/59] fix(blazorui): resolve link item click and navigation issues in BitNav #9504 (#9505) --- .../Bit.BlazorUI/Components/Navs/Nav/_BitNavChild.razor | 2 +- .../Bit.BlazorUI/Components/Navs/Nav/_BitNavChild.razor.cs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Navs/Nav/_BitNavChild.razor b/src/BlazorUI/Bit.BlazorUI/Components/Navs/Nav/_BitNavChild.razor index a8fed5cdd7..4c2cf940fd 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Navs/Nav/_BitNavChild.razor +++ b/src/BlazorUI/Bit.BlazorUI/Components/Navs/Nav/_BitNavChild.razor @@ -118,7 +118,7 @@ { <_BitNavItemContainer Href="@href" Target="@target" - OnClick="HandleOnClick" + OnClick="() => HandleOnClick(renderLink)" RenderLink="renderLink" Disabled="@(isEnabled is false)" AriaLabel="@Nav.GetAriaLabel(Item)" diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Navs/Nav/_BitNavChild.razor.cs b/src/BlazorUI/Bit.BlazorUI/Components/Navs/Nav/_BitNavChild.razor.cs index dbe148bf7d..cd2271d7ab 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Navs/Nav/_BitNavChild.razor.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/Navs/Nav/_BitNavChild.razor.cs @@ -18,7 +18,7 @@ public partial class _BitNavChild where TItem : class - private async Task HandleOnClick() + private async Task HandleOnClick(bool renderLink) { if (Nav is null) return; if (Nav.GetIsEnabled(Item) is false) return; @@ -34,6 +34,10 @@ private async Task HandleOnClick() if (Nav.SelectedItem != Item || Nav.Reselectable) { + if (renderLink) + { + await Task.Yield(); // wait for the link to navigate first + } await Nav.OnItemClick.InvokeAsync(Item); } } From 45b0edd0652cc55e532c1fae34521407129e3ede Mon Sep 17 00:00:00 2001 From: Yaser Moradi Date: Tue, 17 Dec 2024 19:24:19 +0100 Subject: [PATCH 53/59] feat(templates): add Blazor WASM Standalone samples to cd pipelines and a bunch of unrelated stuff #9506 (#9507) --- .github/workflows/admin-sample.cd.yml | 50 ++++++++++++ .github/workflows/todo-sample.cd.yml | 47 +++++++++++ README.md | 4 +- .../Components/App.razor | 47 ++++++----- .../Extensions/HttpRequestExtensions.cs | 19 ----- .../wwwroot/service-worker.published.js | 3 +- .../Program.Services.cs | 11 ++- .../ServerApiSettings.cs | 7 ++ .../Components/App.razor | 77 +++++++++---------- .../Extensions/HttpRequestExtensions.cs | 19 ----- .../Extensions/HttpRequestExtensions.cs | 22 ------ .../Extensions/HttpRequestExtensions.cs | 22 ------ .../Components/App.razor | 29 ++++--- .../Extensions/HttpRequestExtensions.cs | 22 ------ 14 files changed, 188 insertions(+), 191 deletions(-) diff --git a/.github/workflows/admin-sample.cd.yml b/.github/workflows/admin-sample.cd.yml index 0e20c83b5a..20c90a0b1e 100644 --- a/.github/workflows/admin-sample.cd.yml +++ b/.github/workflows/admin-sample.cd.yml @@ -69,6 +69,56 @@ jobs: path: ${{env.DOTNET_ROOT}}/server include-hidden-files: true # Required for wwwroot/.well-known folder + deploy_blazor_wasm_standalone: + name: build blazor wasm standalone + runs-on: ubuntu-24.04 + + steps: + + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + global-json-file: src/global.json + + - name: Create project from Boilerplate + run: | + cd src/Templates/Boilerplate && dotnet build -c Release + dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0 + dotnet new install Bit.Boilerplate.0.0.0.nupkg + cd ../../../ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --sample Admin --appInsights --sentry --serverUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net9.0 + + - name: Update core appsettings.json + uses: devops-actions/variable-substitution@v1.2 + with: + files: 'AdminPanel/src/Shared/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Core/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Web/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Web/appsettings.Production.json' + env: + ServerAddress: ${{ env.SERVER_ADDRESS }} + Logging.Sentry.Dsn: ${{ secrets.ADMINPANEL_SENTRY_DSN }} + GoogleRecaptchaSiteKey: ${{ secrets.GOOGLE_RECAPTCHA_SITE_KEY }} + AdsPushVapid.PublicKey: ${{ secrets.ADMINPANEL_PUBLIC_VAPIDKEY }} + ApplicationInsights.ConnectionString: ${{ secrets.APPLICATION_INSIGHTS_CONNECTION_STRING }} + + - uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Install wasm + run: cd src && dotnet workload install wasm-tools + + - name: Generate CSS/JS files + run: dotnet build AdminPanel/src/Client/AdminPanel.Client.Core/AdminPanel.Client.Core.csproj -t:BeforeBuildTasks -p:Version="${{ vars.APPLICATION_DISPLAY_VERSION}}" --no-restore -c Release + + - name: Publish + run: dotnet publish AdminPanel/src/Client/AdminPanel.Client.Web/AdminPanel.Client.Web.csproj -c Release -p:PwaEnabled=true -o ${{env.DOTNET_ROOT}}/client -p:Version="${{ vars.APPLICATION_DISPLAY_VERSION}}" + + - name: Upload to asw + run: | + npm install -g @azure/static-web-apps-cli + swa deploy --deployment-token ${{ secrets.ADMINPANEL_ASW_TOKEN }} --env production --app-location ${{env.DOTNET_ROOT}}/client/wwwroot + deploy_api_blazor: name: deploy api + blazor needs: build_api_blazor diff --git a/.github/workflows/todo-sample.cd.yml b/.github/workflows/todo-sample.cd.yml index 387e890cd5..b668a00726 100644 --- a/.github/workflows/todo-sample.cd.yml +++ b/.github/workflows/todo-sample.cd.yml @@ -121,6 +121,53 @@ jobs: CLOUDFLARE_ZONE: ${{ secrets.BITPLATFORM_DEV_CLOUDFLARE_ZONE }} CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} + deploy_blazor_wasm_standalone: + name: build blazor wasm standalone + runs-on: ubuntu-24.04 + + steps: + + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + global-json-file: src/global.json + + - name: Create project from Boilerplate + run: | + cd src/Templates/Boilerplate && dotnet build -c Release + dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0 + dotnet new install Bit.Boilerplate.0.0.0.nupkg + cd ../../../ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample Todo --serverUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --framework net9.0 + + - name: Update core appsettings.json + uses: devops-actions/variable-substitution@v1.2 + with: + files: 'TodoSample/src/Shared/appsettings.json, TodoSample/src/Client/TodoSample.Client.Core/appsettings.json, TodoSample/src/Client/TodoSample.Client.Web/appsettings.json, TodoSample/src/Client/TodoSample.Client.Web/appsettings.Production.json' + env: + ServerAddress: ${{ env.SERVER_ADDRESS }} + GoogleRecaptchaSiteKey: ${{ secrets.GOOGLE_RECAPTCHA_SITE_KEY }} + + - uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Install wasm + run: cd src && dotnet workload install wasm-tools + + - name: Generate CSS/JS files + run: dotnet build TodoSample/src/Client/TodoSample.Client.Core/TodoSample.Client.Core.csproj -t:BeforeBuildTasks -p:Version="${{ vars.APPLICATION_DISPLAY_VERSION}}" --no-restore -c Release + + - name: Publish + run: dotnet publish TodoSample/src/Client/TodoSample.Client.Web/TodoSample.Client.Web.csproj -c Release -p:PwaEnabled=true -o ${{env.DOTNET_ROOT}}/client -p:Version="${{ vars.APPLICATION_DISPLAY_VERSION}}" -p:RunAOTCompilation=true -p:MultilingualEnabled=false + + - name: Upload to asw + run: | + npm install -g @azure/static-web-apps-cli + swa deploy --deployment-token ${{ secrets.TODO_ASW_TOKEN }} --env production --app-location ${{env.DOTNET_ROOT}}/client/wwwroot + build_blazor_hybrid_windows: name: build blazor hybrid (windows) runs-on: windows-2022 diff --git a/README.md b/README.md index d189ce9e8f..d0ffb560b2 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,9 @@ The following apps are our open-source projects powered by the bit platform show 1. [bitplatform.dev](https://bitplatform.dev): .NET 9 Pre-rendered SPA with Blazor WebAssembly 2. [blazorui.bitplatform.dev](https://blazorui.bitplatform.dev): .NET 9 Pre-rendered PWA with Blazor WebAssembly 3. [todo.bitplatform.dev](https://todo.bitplatform.dev): .NET 8 Pre-rendered PWA with Blazor WebAssembly -5. [adminpanel.bitplatform.dev](https://adminpanel.bitplatform.dev): .NET 9 PWA with Blazor WebAssembly Standalone (Hosted on Cloudflare Pages) +5. [adminpanel.bitplatform.dev](https://adminpanel.bitplatform.dev): .NET 9 PWA with Blazor WebAssembly +6. [adminpanel.bitplatform.cc](https://adminpanel.bitplatform.cc): .NET 9 PWA with Blazor WebAssembly Standalone (Free Azure static web app) +7. [todo.bitplatform.cc](https://todo.bitplatform.cc): AOT Compiled .NET 9 PWA with Blazor WebAssembly Standalone (Free Azure static web app) [Todo](https://todo.bitplatform.dev) & [Adminpanel](https://adminpanel.bitplatform.dev) web apps will launch their respective Android and iOS applications if you have already installed them, mirroring the behavior of apps like YouTube and Instagram. diff --git a/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Components/App.razor b/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Components/App.razor index 8d494028ae..97d974449b 100644 --- a/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Components/App.razor +++ b/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Components/App.razor @@ -60,34 +60,31 @@ } - @if (HttpContext.Request.IsCrawlerClient() is false) + + @if (AppRenderMode.PwaEnabled) + { + + + + } + else { - - @if (AppRenderMode.PwaEnabled) - { - - - - } - else - { - - } - - - - + } + }); + } + + + + diff --git a/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Extensions/HttpRequestExtensions.cs b/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Extensions/HttpRequestExtensions.cs index 6b0aa99f04..345f142315 100644 --- a/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Extensions/HttpRequestExtensions.cs +++ b/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Extensions/HttpRequestExtensions.cs @@ -18,23 +18,4 @@ public static Uri GetBaseUrl(this HttpRequest req) return uriBuilder.Uri; } - - public static bool IsCrawlerClient(this HttpRequest request) - { - if (request.Headers.TryGetValue(HeaderNames.UserAgent, out StringValues userAgentHeaderValue) is false) - return false; - - string? userAgent = userAgentHeaderValue.FirstOrDefault(); - - if (userAgent is null) - return false; - - if (userAgent.Contains("google", StringComparison.InvariantCultureIgnoreCase)) return true; - - if (userAgent.Contains("bing", StringComparison.InvariantCultureIgnoreCase)) return true; - - if (userAgent.Contains("lighthouse", StringComparison.InvariantCultureIgnoreCase)) return true; - - return false; - } } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js index ce34c6bc0c..463978c2b4 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js @@ -27,8 +27,7 @@ self.assetsExclude = [ /bit\.blazorui\.fluent-light\.css$/, // If a PDF viewer is needed in the PWA, remove these two lines: /pdfjs-4\.7\.76\.js$/, - /pdfjs-4\.7\.76-worker\.js$/, - /Boilerplate\.Client\.Web\.styles\.css$/ + /pdfjs-4\.7\.76-worker\.js$/ ]; self.externalAssets = [ { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Services.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Services.cs index 1bfd6afd87..b777853cb8 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Services.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Services.cs @@ -124,10 +124,15 @@ public static void AddServerApiProjectServices(this WebApplicationBuilder builde configuration.Bind(settings); var webClientUrl = settings.WebClientUrl; + var allowedOrigins = settings.Cors?.AllowedOrigins?.ToList() ?? []; - policy.SetIsOriginAllowed(origin => - AllowedOriginsRegex().IsMatch(origin) || - (string.IsNullOrEmpty(webClientUrl) is false && string.Equals(origin, webClientUrl, StringComparison.InvariantCultureIgnoreCase))) + if (string.IsNullOrEmpty(webClientUrl) is false) + { + allowedOrigins.Add(webClientUrl); + } + + policy.SetIsOriginAllowed(origin => AllowedOriginsRegex().IsMatch(origin) + || allowedOrigins.Any(o => string.Equals(o, origin, StringComparison.InvariantCultureIgnoreCase))) .AllowAnyHeader() .AllowAnyMethod() .WithExposedHeaders(HeaderNames.RequestId); diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/ServerApiSettings.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/ServerApiSettings.cs index c810c39852..f0f6989863 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/ServerApiSettings.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/ServerApiSettings.cs @@ -39,6 +39,8 @@ public partial class ServerApiSettings : SharedSettings public ForwardedHeadersOptions? ForwardedHeaders { get; set; } + public CorsOptions? Cors { get; set; } + public override IEnumerable Validate(ValidationContext validationContext) { var validationResults = base.Validate(validationContext).ToList(); @@ -157,3 +159,8 @@ public partial class SmsOptions string.IsNullOrEmpty(TwilioAccountSid) is false && string.IsNullOrEmpty(TwilioAutoToken) is false; } + +public class CorsOptions +{ + public string[] AllowedOrigins { get; set; } = []; +} diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Components/App.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Components/App.razor index 0e360e84d5..6608eeb272 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Components/App.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Components/App.razor @@ -68,49 +68,46 @@ - @if (HttpContext.Request.IsCrawlerClient() is false) - { - @*#if (framework == "net9.0")*@ - - @*#else*@ - @*#if (IsInsideProjectTemplate == true)*@ - /* - @*#endif)*@ - - @*#if (IsInsideProjectTemplate == true)*@ - */ - @*#endif)*@ + @*#if (framework == "net9.0")*@ + + @*#else*@ + @*#if (IsInsideProjectTemplate == true)*@ + /* @*#endif)*@ - - @if (serverWebSettings.WebAppRender.PwaEnabled) - { - - - - } - else - { - + @*#if (IsInsideProjectTemplate == true)*@ + */ + @*#endif)*@ + @*#endif)*@ + + @if (serverWebSettings.WebAppRender.PwaEnabled) + { + + + + } + else + { + - } - - @*#if (offlineDb == true)*@ - - @*#endif*@ - - - + } + }); + } + + @*#if (offlineDb == true)*@ + + @*#endif*@ + + + diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Extensions/HttpRequestExtensions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Extensions/HttpRequestExtensions.cs index dcd8b949b2..da3516f4d6 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Extensions/HttpRequestExtensions.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Extensions/HttpRequestExtensions.cs @@ -18,23 +18,4 @@ internal static Uri GetBaseUrl(this HttpRequest req) return uriBuilder.Uri; } - - public static bool IsCrawlerClient(this HttpRequest request) - { - if (request.Headers.TryGetValue(HeaderNames.UserAgent, out StringValues userAgentHeaderValue) is false) - return false; - - string? userAgent = userAgentHeaderValue.FirstOrDefault(); - - if (userAgent is null) - return false; - - if (userAgent.Contains("google", StringComparison.InvariantCultureIgnoreCase)) return true; - - if (userAgent.Contains("bing", StringComparison.InvariantCultureIgnoreCase)) return true; - - if (userAgent.Contains("lighthouse", StringComparison.InvariantCultureIgnoreCase)) return true; - - return false; - } } diff --git a/src/Websites/Careers/src/Bit.Websites.Careers.Server/Extensions/HttpRequestExtensions.cs b/src/Websites/Careers/src/Bit.Websites.Careers.Server/Extensions/HttpRequestExtensions.cs index 12760a7e32..fa1264050d 100644 --- a/src/Websites/Careers/src/Bit.Websites.Careers.Server/Extensions/HttpRequestExtensions.cs +++ b/src/Websites/Careers/src/Bit.Websites.Careers.Server/Extensions/HttpRequestExtensions.cs @@ -17,26 +17,4 @@ public static string GetBaseUrl(this HttpRequest req) return uriBuilder.Uri.AbsoluteUri; } - - public static bool IsCrawlerClient(this HttpRequest request) - { - var agent = GetLoweredUserAgent(request); - - if (agent.Contains("google")) return true; - - if (agent.Contains("bing")) return true; - - if (agent.Contains("lighthouse")) return true; - - return false; - } - - private static string GetLoweredUserAgent(HttpRequest request) - { - var userAgent = request.Headers[HeaderNames.UserAgent].ToString(); - - if (string.IsNullOrEmpty(userAgent)) return string.Empty; - - return userAgent.ToLowerInvariant(); - } } diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Server/Extensions/HttpRequestExtensions.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Server/Extensions/HttpRequestExtensions.cs index 12760a7e32..fa1264050d 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Server/Extensions/HttpRequestExtensions.cs +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Server/Extensions/HttpRequestExtensions.cs @@ -17,26 +17,4 @@ public static string GetBaseUrl(this HttpRequest req) return uriBuilder.Uri.AbsoluteUri; } - - public static bool IsCrawlerClient(this HttpRequest request) - { - var agent = GetLoweredUserAgent(request); - - if (agent.Contains("google")) return true; - - if (agent.Contains("bing")) return true; - - if (agent.Contains("lighthouse")) return true; - - return false; - } - - private static string GetLoweredUserAgent(HttpRequest request) - { - var userAgent = request.Headers[HeaderNames.UserAgent].ToString(); - - if (string.IsNullOrEmpty(userAgent)) return string.Empty; - - return userAgent.ToLowerInvariant(); - } } diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Server/Components/App.razor b/src/Websites/Sales/src/Bit.Websites.Sales.Server/Components/App.razor index 3b99fd9576..8e4350796e 100644 --- a/src/Websites/Sales/src/Bit.Websites.Sales.Server/Components/App.razor +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Server/Components/App.razor @@ -42,23 +42,20 @@ - @if (HttpContext.Request.IsCrawlerClient() is false) - { - - + - - - } + } + }); + + + diff --git a/src/Websites/Sales/src/Bit.Websites.Sales.Server/Extensions/HttpRequestExtensions.cs b/src/Websites/Sales/src/Bit.Websites.Sales.Server/Extensions/HttpRequestExtensions.cs index 12760a7e32..fa1264050d 100644 --- a/src/Websites/Sales/src/Bit.Websites.Sales.Server/Extensions/HttpRequestExtensions.cs +++ b/src/Websites/Sales/src/Bit.Websites.Sales.Server/Extensions/HttpRequestExtensions.cs @@ -17,26 +17,4 @@ public static string GetBaseUrl(this HttpRequest req) return uriBuilder.Uri.AbsoluteUri; } - - public static bool IsCrawlerClient(this HttpRequest request) - { - var agent = GetLoweredUserAgent(request); - - if (agent.Contains("google")) return true; - - if (agent.Contains("bing")) return true; - - if (agent.Contains("lighthouse")) return true; - - return false; - } - - private static string GetLoweredUserAgent(HttpRequest request) - { - var userAgent = request.Headers[HeaderNames.UserAgent].ToString(); - - if (string.IsNullOrEmpty(userAgent)) return string.Empty; - - return userAgent.ToLowerInvariant(); - } } From 75a5ee07e932d50a1188c6b00b0a963e7a0f6b40 Mon Sep 17 00:00:00 2001 From: Mohammad Aminsafaei Date: Wed, 18 Dec 2024 12:56:32 +0330 Subject: [PATCH 54/59] feat(blazorui): improve BitSwipeTrap demo page #9443 (#9458) --- .../SwipeTrap/BitSwipeTrapDemo.razor | 54 ++ .../SwipeTrap/BitSwipeTrapDemo.razor.cs | 345 ++++--------- .../BitSwipeTrapDemo.razor.samples.cs | 487 ++++++++++++++++++ .../SwipeTrap/BitSwipeTrapDemo.razor.scss | 53 ++ 4 files changed, 684 insertions(+), 255 deletions(-) create mode 100644 src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Utilities/SwipeTrap/BitSwipeTrapDemo.razor.samples.cs diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Utilities/SwipeTrap/BitSwipeTrapDemo.razor b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Utilities/SwipeTrap/BitSwipeTrapDemo.razor index b6d8ad507d..12c131a22b 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Utilities/SwipeTrap/BitSwipeTrapDemo.razor +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Utilities/SwipeTrap/BitSwipeTrapDemo.razor @@ -91,5 +91,59 @@ OnCancel="HandleOnCancelList" /> + + + +
    An illustrative example of integrating this component into a straightforward mobile application.
    +
    +
    +
    + +
    + + + + + bit BlazorUI + + + +
    +
    + + + + Swipe left or right + + + +
    +
    +

    Left Menu

    +
    Item1
    +
    Item2
    +
    Item3
    +
    +
    +
    +
    +

    Right Menu

    +
    Item1
    +
    Item2
    +
    Item3
    +
    +
    +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Utilities/SwipeTrap/BitSwipeTrapDemo.razor.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Utilities/SwipeTrap/BitSwipeTrapDemo.razor.cs index 800b85ba46..7295603970 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Utilities/SwipeTrap/BitSwipeTrapDemo.razor.cs +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Utilities/SwipeTrap/BitSwipeTrapDemo.razor.cs @@ -296,275 +296,110 @@ private void ResetList() } - - private readonly string example1RazorCode = @" - - - -
    -
    StartX: @swipeTrapEventArgs?.StartX
    -
    StartY: @swipeTrapEventArgs?.StartY
    -
    DiffX: @swipeTrapEventArgs?.DiffX
    -
    DiffY: @swipeTrapEventArgs?.DiffY
    -
    ---
    -
    Triggered? @isTriggered
    -
    Trigger direction: @swipeTrapTriggerArgs?.Direction
    -
    Trigger diffX: @swipeTrapTriggerArgs?.DiffX
    -
    Trigger diffY: @swipeTrapTriggerArgs?.DiffY
    -
    -
    "; - private readonly string example1CsharpCode = @" -private bool isTriggeredBasic; -BitSwipeTrapEventArgs? swipeTrapEventArgsBasic; -BitSwipeTrapTriggerArgs? swipeTrapTriggerArgsBasic; -private void HandleOnStartBasic(BitSwipeTrapEventArgs args) -{ - swipeTrapEventArgsBasic = args; -} -private void HandleOnMoveBasic(BitSwipeTrapEventArgs args) -{ - swipeTrapEventArgsBasic = args; -} -private void HandleOnEndBasic(BitSwipeTrapEventArgs args) -{ - swipeTrapEventArgsBasic = args; -} -private void HandleOnTriggerBasic(BitSwipeTrapTriggerArgs args) -{ - isTriggeredBasic = true; - swipeTrapTriggerArgsBasic = args; - _ = Task.Delay(2000).ContinueWith(_ => + private decimal? diffXPanelAdvanced; + private BitSwipeDirection? direction; + private BitSwipeDirection? panelOpen; + private void OpenPanelAdvanced(BitSwipeDirection swipeDirection) { - isTriggeredBasic = false; - swipeTrapEventArgsBasic = null; - swipeTrapTriggerArgsBasic = null; - InvokeAsync(StateHasChanged); - }); -}"; + if (panelOpen == swipeDirection) return; - private readonly string example2RazorCode = @" - - -
    - -
    - - -
    -

    Title

    -
    Item1
    -
    Item2
    -
    Item3
    -
    -
    -
    -
    "; - private readonly string example2CsharpCode = @" -private decimal diffXPanel; -private bool isPanelOpen; -private void OpenPanel() -{ - isPanelOpen = true; -} -private void ClosePanel() -{ - isPanelOpen = false; -} -private void HandleOnMovePanel(BitSwipeTrapEventArgs args) -{ - diffXPanel = args.DiffX; -} -private void HandleOnEndPanel(BitSwipeTrapEventArgs args) -{ - diffXPanel = 0; -} -private void HandleOnTriggerPanel(BitSwipeTrapTriggerArgs args) -{ - if (args.Direction == BitSwipeDirection.Left) + private void ClosePanelAdvanced() { - diffXPanel = 0; - ClosePanel(); - } -} -private string GetPanelStyle() -{ - return diffXPanel < 0 ? $""transform: translateX({diffXPanel}px)"" : """"; -}"; - - private readonly string example3RazorCode = @" - - -
    - @foreach (int idx in itemsList) + private void HandleOnEndPanelAdvanced(BitSwipeTrapEventArgs args) { - var i = idx; -
    -
    Delete
    - HandleOnMoveList(args, i)"" - OnEnd=""args => HandleOnEndList(args, i)"" - OnTrigger=""args => HandleOnTriggerList(args, i)""> -
    -
    Item@(i + 1)
    -
    -
    -
    + if (panelOpen.HasValue) + { + diffXPanelAdvanced = 0; + } + else + { + diffXPanelAdvanced = null; + } } -
    -Reset -"; - private readonly string example3CsharpCode = @" -private int deletingIndex = -1; -private bool isListDialogOpen; -private TaskCompletionSource listTcs; -private List itemsList = Enumerable.Range(0, 10).ToList(); -private decimal[] diffXList = Enumerable.Repeat(0m, 10).ToArray(); -private void HandleOnMoveList(BitSwipeTrapEventArgs args, int index) -{ - diffXList[index] = args.DiffX; -} -private void HandleOnEndList(BitSwipeTrapEventArgs args, int index) -{ - if (diffXList[index] < 60) + private void HandleOnTriggerPanelAdvanced(BitSwipeTrapTriggerArgs args) { - diffXList[index] = 0; + if (args.Direction == BitSwipeDirection.Left) + { + if (panelOpen.HasValue is false || panelOpen == BitSwipeDirection.Right) + { + OpenPanelAdvanced(BitSwipeDirection.Right); + } + else if (panelOpen == BitSwipeDirection.Left) + { + ClosePanelAdvanced(); + } + } + else if (args.Direction == BitSwipeDirection.Right) + { + if (panelOpen.HasValue is false || panelOpen == BitSwipeDirection.Left) + { + OpenPanelAdvanced(BitSwipeDirection.Left); + } + else if (panelOpen == BitSwipeDirection.Right) + { + ClosePanelAdvanced(); + } + } } -} -private async Task HandleOnTriggerList(BitSwipeTrapTriggerArgs args, int index) -{ - if (args.Direction == BitSwipeDirection.Right) + private string GetLeftPanelAdvancedStyle() { - deletingIndex = index; - listTcs = new(); - isListDialogOpen = true; - await listTcs.Task; - isListDialogOpen = false; - diffXList[index] = 0; - deletingIndex = -1; + if (panelOpen == BitSwipeDirection.Left && direction != BitSwipeDirection.Left) + { + return "transform: translateX(0px)"; + } + else if((panelOpen.HasValue is false && direction == BitSwipeDirection.Right) || (panelOpen == BitSwipeDirection.Left && direction == BitSwipeDirection.Left)) + { + return diffXPanelAdvanced switch + { + 0 or > 200 => "transform: translateX(0px)", + < 0 and < 200 => $"transform: translateX({diffXPanelAdvanced}px)", + > 0 => $"transform: translateX(calc(-100% + {diffXPanelAdvanced}px))", + _ => string.Empty + }; + } + + return string.Empty; } -} -private string GetRowStyle(int index) -{ - var x = Math.Min(diffXList[index], 60); - return x > 0 ? $""transform: translateX({x}px)"" : """"; -} -private void HandleOnOkList() -{ - if (deletingIndex != -1) + private string GetRightPanelAdvancedStyle() { - itemsList.Remove(deletingIndex); + if (panelOpen == BitSwipeDirection.Right && direction != BitSwipeDirection.Right) + { + return "transform: translateX(0px)"; + } + else if ((panelOpen.HasValue is false && direction == BitSwipeDirection.Left) || (panelOpen == BitSwipeDirection.Right && direction == BitSwipeDirection.Right)) + { + return diffXPanelAdvanced switch + { + 0 or < -200 => "transform: translateX(0px)", + > 0 => $"transform: translateX({diffXPanelAdvanced}px)", + < 0 => $"transform: translateX(calc(100% - {(-1 * diffXPanelAdvanced)}px))", + _ => string.Empty + }; + } + + return string.Empty; } - listTcs.SetResult(); -} -private void HandleOnCancelList() -{ - listTcs.SetResult(); -} -private void ResetList() -{ - itemsList = Enumerable.Range(0, 10).ToList(); -}"; } diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Utilities/SwipeTrap/BitSwipeTrapDemo.razor.samples.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Utilities/SwipeTrap/BitSwipeTrapDemo.razor.samples.cs new file mode 100644 index 0000000000..68af948649 --- /dev/null +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Utilities/SwipeTrap/BitSwipeTrapDemo.razor.samples.cs @@ -0,0 +1,487 @@ +namespace Bit.BlazorUI.Demo.Client.Core.Pages.Components.Utilities.SwipeTrap; + +public partial class BitSwipeTrapDemo +{ + + private readonly string example1RazorCode = @" + + + +
    +
    StartX: @swipeTrapEventArgs?.StartX
    +
    StartY: @swipeTrapEventArgs?.StartY
    +
    DiffX: @swipeTrapEventArgs?.DiffX
    +
    DiffY: @swipeTrapEventArgs?.DiffY
    +
    ---
    +
    Triggered? @isTriggered
    +
    Trigger direction: @swipeTrapTriggerArgs?.Direction
    +
    Trigger diffX: @swipeTrapTriggerArgs?.DiffX
    +
    Trigger diffY: @swipeTrapTriggerArgs?.DiffY
    +
    +
    "; + private readonly string example1CsharpCode = @" +private bool isTriggeredBasic; +BitSwipeTrapEventArgs? swipeTrapEventArgsBasic; +BitSwipeTrapTriggerArgs? swipeTrapTriggerArgsBasic; +private void HandleOnStartBasic(BitSwipeTrapEventArgs args) +{ + swipeTrapEventArgsBasic = args; +} +private void HandleOnMoveBasic(BitSwipeTrapEventArgs args) +{ + swipeTrapEventArgsBasic = args; +} +private void HandleOnEndBasic(BitSwipeTrapEventArgs args) +{ + swipeTrapEventArgsBasic = args; +} +private void HandleOnTriggerBasic(BitSwipeTrapTriggerArgs args) +{ + isTriggeredBasic = true; + swipeTrapTriggerArgsBasic = args; + _ = Task.Delay(2000).ContinueWith(_ => + { + isTriggeredBasic = false; + swipeTrapEventArgsBasic = null; + swipeTrapTriggerArgsBasic = null; + InvokeAsync(StateHasChanged); + }); +}"; + + private readonly string example2RazorCode = @" + + +
    + +
    + + +
    +

    Title

    +
    Item1
    +
    Item2
    +
    Item3
    +
    +
    +
    +
    "; + private readonly string example2CsharpCode = @" +private decimal diffXPanel; +private bool isPanelOpen; +private void OpenPanel() +{ + isPanelOpen = true; +} +private void ClosePanel() +{ + isPanelOpen = false; +} +private void HandleOnMovePanel(BitSwipeTrapEventArgs args) +{ + diffXPanel = args.DiffX; +} +private void HandleOnEndPanel(BitSwipeTrapEventArgs args) +{ + diffXPanel = 0; +} +private void HandleOnTriggerPanel(BitSwipeTrapTriggerArgs args) +{ + if (args.Direction == BitSwipeDirection.Left) + { + diffXPanel = 0; + ClosePanel(); + } +} +private string GetPanelStyle() +{ + return diffXPanel < 0 ? $""transform: translateX({diffXPanel}px)"" : """"; +}"; + + private readonly string example3RazorCode = @" + + +
    + @foreach (int idx in itemsList) + { + var i = idx; +
    +
    Delete
    + HandleOnMoveList(args, i)"" + OnEnd=""args => HandleOnEndList(args, i)"" + OnTrigger=""args => HandleOnTriggerList(args, i)""> +
    +
    Item@(i + 1)
    +
    +
    +
    + } +
    +Reset +"; + private readonly string example3CsharpCode = @" +private int deletingIndex = -1; +private bool isListDialogOpen; +private TaskCompletionSource listTcs; +private List itemsList = Enumerable.Range(0, 10).ToList(); +private decimal[] diffXList = Enumerable.Repeat(0m, 10).ToArray(); +private void HandleOnMoveList(BitSwipeTrapEventArgs args, int index) +{ + diffXList[index] = args.DiffX; +} +private void HandleOnEndList(BitSwipeTrapEventArgs args, int index) +{ + if (diffXList[index] < 60) + { + diffXList[index] = 0; + } +} +private async Task HandleOnTriggerList(BitSwipeTrapTriggerArgs args, int index) +{ + if (args.Direction == BitSwipeDirection.Right) + { + deletingIndex = index; + listTcs = new(); + isListDialogOpen = true; + await listTcs.Task; + isListDialogOpen = false; + diffXList[index] = 0; + deletingIndex = -1; + } +} +private string GetRowStyle(int index) +{ + var x = Math.Min(diffXList[index], 60); + return x > 0 ? $""transform: translateX({x}px)"" : """"; +} +private void HandleOnOkList() +{ + if (deletingIndex != -1) + { + itemsList.Remove(deletingIndex); + } + listTcs.SetResult(); +} +private void HandleOnCancelList() +{ + listTcs.SetResult(); +} +private void ResetList() +{ + itemsList = Enumerable.Range(0, 10).ToList(); +}"; + + private readonly string example4RazorCode = @" + + +
    +
    + +
    + + + + + bit BlazorUI + + + +
    +
    + + + + Swipe left or right + + + +
    +
    +

    Left Menu

    +
    Item1
    +
    Item2
    +
    Item3
    +
    +
    +
    +
    +

    Right Menu

    +
    Item1
    +
    Item2
    +
    Item3
    +
    +
    +
    +
    +
    +
    +
    "; + private readonly string example4CsharpCode = @" +private decimal? diffXPanelAdvanced; +private BitSwipeDirection? direction; +private BitSwipeDirection? panelOpen; +private void OpenPanelAdvanced(BitSwipeDirection swipeDirection) +{ + if (panelOpen == swipeDirection) return; + + direction = null; + panelOpen = swipeDirection; + diffXPanelAdvanced = 0; +} +private void ClosePanelAdvanced() +{ + panelOpen = null; + diffXPanelAdvanced = null; +} +private void HandleOnMovePanelAdvanced(BitSwipeTrapEventArgs args) +{ + diffXPanelAdvanced = args.DiffX; + + if (Math.Abs(args.DiffX) > 2 || Math.Abs(args.DiffY) > 2) + { + direction = Math.Abs(args.DiffX) > Math.Abs(args.DiffY) + ? args.DiffX > 0 ? BitSwipeDirection.Right : BitSwipeDirection.Left + : args.DiffY > 0 ? BitSwipeDirection.Bottom : BitSwipeDirection.Top; + } + else + { + direction = null; + } +} +private void HandleOnEndPanelAdvanced(BitSwipeTrapEventArgs args) +{ + if (panelOpen.HasValue) + { + diffXPanelAdvanced = 0; + } + else + { + diffXPanelAdvanced = null; + } +} +private void HandleOnTriggerPanelAdvanced(BitSwipeTrapTriggerArgs args) +{ + if (args.Direction == BitSwipeDirection.Left) + { + if (panelOpen.HasValue is false || panelOpen == BitSwipeDirection.Right) + { + OpenPanelAdvanced(BitSwipeDirection.Right); + } + else if (panelOpen == BitSwipeDirection.Left) + { + ClosePanelAdvanced(); + } + } + else if (args.Direction == BitSwipeDirection.Right) + { + if (panelOpen.HasValue is false || panelOpen == BitSwipeDirection.Left) + { + OpenPanelAdvanced(BitSwipeDirection.Left); + } + else if (panelOpen == BitSwipeDirection.Right) + { + ClosePanelAdvanced(); + } + } +} +private string GetLeftPanelAdvancedStyle() +{ + if (panelOpen == BitSwipeDirection.Left && direction != BitSwipeDirection.Left) + { + return ""transform: translateX(0px)""; + } + else if((panelOpen.HasValue is false && direction == BitSwipeDirection.Right) || (panelOpen == BitSwipeDirection.Left && direction == BitSwipeDirection.Left)) + { + return diffXPanelAdvanced switch + { + 0 or > 200 => ""transform: translateX(0px)"", + < 0 and < 200 => $""transform: translateX({diffXPanelAdvanced}px)"", + > 0 => $""transform: translateX(calc(-100% + {diffXPanelAdvanced}px))"", + _ => string.Empty + }; + } + + return string.Empty; +} +private string GetRightPanelAdvancedStyle() +{ + if (panelOpen == BitSwipeDirection.Right && direction != BitSwipeDirection.Right) + { + return ""transform: translateX(0px)""; + } + else if ((panelOpen.HasValue is false && direction == BitSwipeDirection.Left) || (panelOpen == BitSwipeDirection.Right && direction == BitSwipeDirection.Right)) + { + return diffXPanelAdvanced switch + { + 0 or < -200 => ""transform: translateX(0px)"", + > 0 => $""transform: translateX({diffXPanelAdvanced}px)"", + < 0 => $""transform: translateX(calc(100% - {(-1 * diffXPanelAdvanced)}px))"", + _ => string.Empty + }; + } + + return string.Empty; +}"; +} + diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Utilities/SwipeTrap/BitSwipeTrapDemo.razor.scss b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Utilities/SwipeTrap/BitSwipeTrapDemo.razor.scss index 5b3a05aedb..77a79b3945 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Utilities/SwipeTrap/BitSwipeTrapDemo.razor.scss +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Utilities/SwipeTrap/BitSwipeTrapDemo.razor.scss @@ -83,5 +83,58 @@ } } +.mobile-frame { + width: 375px; + height: 712px; + overflow: hidden; + position: relative; + border-radius: 36px; + border: 16px solid #333; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + background-color: var(--bit-clr-fg-sec); + + .screen { + width: 100%; + height: 100%; + overflow: auto; + } +} + ::deep { + .panel-adv-container { + cursor: grab; + overflow: hidden; + position: relative; + + .panel-adv { + color: black; + cursor: grab; + inset-block: 0; + user-select: none; + position: absolute; + background-color: lightgray; + + &.left { + left: 0; + width: 200px; + transform: translateX(-100%); + } + + &.right { + right: 0; + width: 200px; + transform: translateX(100%); + } + + .panel-adv-trap { + gap: 1rem; + height: 100%; + display: flex; + padding-top: 0.2rem; + padding-left: 0.8rem; + flex-direction: column; + background-color: gray; + } + } + } } From 4a4e032bc71e72980d0d28b580dc393d2930cf5a Mon Sep 17 00:00:00 2001 From: Mohammad Aminsafaei Date: Wed, 18 Dec 2024 16:36:36 +0330 Subject: [PATCH 55/59] fix(templates): resolve sentry package reference issue in Boilerplate #9501 (#9508) --- .../Server/Boilerplate.Server.Web/Boilerplate.Server.Web.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Boilerplate.Server.Web.csproj b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Boilerplate.Server.Web.csproj index 45c52c0a12..4c515ed303 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Boilerplate.Server.Web.csproj +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Boilerplate.Server.Web.csproj @@ -14,6 +14,7 @@ + From 84d075dad15e6b21f93316553a3f8a8ca0066818 Mon Sep 17 00:00:00 2001 From: Yaser Moradi Date: Wed, 18 Dec 2024 16:40:03 +0100 Subject: [PATCH 56/59] fix(templates): resolve search engines issue with StreamRendering enabled #9510 (#9511) --- .../wwwroot/service-worker.published.js | 10 ------ .../Components/App.razor | 27 ++++++++------- .../Components/App.razor.cs | 34 ++++++++++++++++++- .../Extensions/HttpRequestExtensions.cs | 29 ++++++++++++++-- 4 files changed, 74 insertions(+), 26 deletions(-) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js index 463978c2b4..b1e5efe4d9 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/service-worker.published.js @@ -34,17 +34,7 @@ self.externalAssets = [ "url": "/" }, { - //#if (framework == "net9.0") url: "_framework/blazor.web.js" - //#else - //#if (IsInsideProjectTemplate == true) - /* - //#endif - url: "_framework/blazor.web.js" - //#if (IsInsideProjectTemplate == true) - */ - //#endif - //#endif }, { "url": "Boilerplate.Server.Web.styles.css" diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Components/App.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Components/App.razor index 6608eeb272..715ead4ecc 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Components/App.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Components/App.razor @@ -1,6 +1,5 @@ @using Boilerplate.Client.Web.Components @using Microsoft.AspNetCore.Components.Routing -@attribute [StreamRendering(enabled: true)] @*+:cnd:noEmit*@ @{ @@ -66,19 +65,21 @@ } - + @if (HttpContext.Request.IsCrawlerClient()) + { + // For StreamRenderingDisabledContainer, read comments in App.razor.cs + + + + } + else + { + + + + } - @*#if (framework == "net9.0")*@ - - @*#else*@ - @*#if (IsInsideProjectTemplate == true)*@ - /* - @*#endif)*@ - - @*#if (IsInsideProjectTemplate == true)*@ - */ - @*#endif)*@ - @*#endif)*@ + @if (serverWebSettings.WebAppRender.PwaEnabled) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Components/App.razor.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Components/App.razor.cs index e745ec44e9..9e5be58fdf 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Components/App.razor.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Components/App.razor.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Localization; +using Microsoft.AspNetCore.Components.Web; +using Microsoft.AspNetCore.Components.Rendering; namespace Boilerplate.Server.Web.Components; @@ -24,3 +25,34 @@ protected override void OnInitialized() } } } + +/// +/// Streaming pre-rendering enhances user experience (UX) and overall application performance. +/// However, it prevents search engines from accessing your pre-rendered dynamic content. +/// To address this, the conditional logic in App.razor, leveraging , +/// disables streaming specifically for search engine crawlers, while maintaining the improved UX and performance for regular users. +/// +[StreamRendering(enabled: true)] +public class StreamRenderingEnabledContainer : ComponentBase +{ + [Parameter] public RenderFragment? ChildContent { get; set; } + + protected override void BuildRenderTree(RenderTreeBuilder builder) + { + builder.AddContent(0, ChildContent); + } +} + +/// +/// +/// +[StreamRendering(enabled: false)] +public class StreamRenderingDisabledContainer : ComponentBase +{ + [Parameter] public RenderFragment? ChildContent { get; set; } + + protected override void BuildRenderTree(RenderTreeBuilder builder) + { + builder.AddContent(0, ChildContent); + } +} diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Extensions/HttpRequestExtensions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Extensions/HttpRequestExtensions.cs index da3516f4d6..e676136933 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Extensions/HttpRequestExtensions.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Extensions/HttpRequestExtensions.cs @@ -1,5 +1,4 @@ -using Microsoft.Extensions.Primitives; -using Microsoft.Net.Http.Headers; +using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Http; @@ -18,4 +17,30 @@ internal static Uri GetBaseUrl(this HttpRequest req) return uriBuilder.Uri; } + + public static bool IsCrawlerClient(this HttpRequest request) + { + var agent = GetLoweredUserAgent(request); + + if (agent.Contains("google")) return true; + + if (agent.Contains("bing")) return true; + + if (agent.Contains("yahoo")) return true; + + if (agent.Contains("duckduck")) return true; + + if (agent.Contains("yandex")) return true; + + return false; + } + + private static string GetLoweredUserAgent(HttpRequest request) + { + var userAgent = request.Headers[HeaderNames.UserAgent].ToString(); + + if (string.IsNullOrEmpty(userAgent)) return string.Empty; + + return userAgent.ToLowerInvariant(); + } } From f4382c418e2980ebdc2110cc8f15b389fa6479e1 Mon Sep 17 00:00:00 2001 From: Yaser Moradi Date: Wed, 18 Dec 2024 20:28:58 +0100 Subject: [PATCH 57/59] feat(deps): update project dependencies #9512 (#9513) --- src/BlazorUI/Bit.BlazorUI.Tests/Bit.BlazorUI.Tests.csproj | 2 +- .../Bit.Boilerplate/src/Directory.Packages.props | 6 +++--- .../Bit.Boilerplate/src/Directory.Packages8.props | 6 +++--- .../Controllers/Statistics/StatisticsController.cs | 1 + 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/BlazorUI/Bit.BlazorUI.Tests/Bit.BlazorUI.Tests.csproj b/src/BlazorUI/Bit.BlazorUI.Tests/Bit.BlazorUI.Tests.csproj index a01542257f..cb16dd5cbb 100644 --- a/src/BlazorUI/Bit.BlazorUI.Tests/Bit.BlazorUI.Tests.csproj +++ b/src/BlazorUI/Bit.BlazorUI.Tests/Bit.BlazorUI.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props b/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props index 7e68a63736..05933d9a24 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props @@ -9,7 +9,7 @@ - + @@ -92,7 +92,7 @@ - - + + \ No newline at end of file diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages8.props b/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages8.props index 08c62affa3..d478f7f991 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages8.props +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages8.props @@ -9,7 +9,7 @@ - + @@ -92,7 +92,7 @@ - - + + \ No newline at end of file diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Statistics/StatisticsController.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Statistics/StatisticsController.cs index 09b4d02182..9cbba4b900 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Statistics/StatisticsController.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Statistics/StatisticsController.cs @@ -11,6 +11,7 @@ public partial class StatisticsController : AppControllerBase, IStatisticsContro [AllowAnonymous] [HttpGet("{packageId}")] + [ResponseCache(Duration = 1 * 24 * 3600, Location = ResponseCacheLocation.Any)] public async Task GetNugetStats(string packageId, CancellationToken cancellationToken) { return await nugetHttpClient.GetPackageStats(packageId, cancellationToken); From 6dc2fcae1cdb0717ee3167edc3fb7ce095111239 Mon Sep 17 00:00:00 2001 From: Mohammad Aminsafaei Date: Fri, 20 Dec 2024 14:04:39 +0330 Subject: [PATCH 58/59] feat(blazorui): improve BitButtonGroup component #9463 (#9517) --- .../BitButtonGroup/BitButtonGroup.razor | 12 +- .../BitButtonGroup/BitButtonGroup.razor.cs | 318 +++++++++++- .../BitButtonGroup/BitButtonGroup.scss | 74 +++ .../BitButtonGroup/BitButtonGroupItem.cs | 40 ++ .../BitButtonGroupNameSelectors.cs | 40 ++ .../BitButtonGroup/BitButtonGroupOption.cs | 40 ++ .../ButtonGroup/BitButtonGroupDemo.razor.cs | 198 ++++++++ .../Buttons/ButtonGroup/Operation.cs | 14 + .../_BitButtonGroupCustomDemo.razor | 132 ++++- .../_BitButtonGroupCustomDemo.razor.cs | 360 +------------- ..._BitButtonGroupCustomDemo.razor.samples.cs | 463 ++++++++++++++++++ .../ButtonGroup/_BitButtonGroupItemDemo.razor | 90 +++- .../_BitButtonGroupItemDemo.razor.cs | 259 +--------- .../_BitButtonGroupItemDemo.razor.samples.cs | 287 +++++++++++ .../_BitButtonGroupOptionDemo.razor | 138 +++++- .../_BitButtonGroupOptionDemo.razor.cs | 352 ------------- ..._BitButtonGroupOptionDemo.razor.samples.cs | 433 ++++++++++++++++ 17 files changed, 2301 insertions(+), 949 deletions(-) create mode 100644 src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupCustomDemo.razor.samples.cs create mode 100644 src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupItemDemo.razor.samples.cs create mode 100644 src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupOptionDemo.razor.samples.cs diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroup.razor b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroup.razor index 036addc7c6..34a0df0ad6 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroup.razor +++ b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroup.razor @@ -21,8 +21,9 @@ tabindex="@(isEnabled ? 0 : -1)" disabled="@(isEnabled is false)" aria-disabled="@(isEnabled is false)" + title="@GetItemTitle(item)" style="@GetStyle(item)" - class="bit-btg-itm @GetClass(item)"> + class="@GetItemClass(item)"> @if (template is not null) { @template(item) @@ -33,12 +34,17 @@ } else { - var iconName = GetIconName(item); + var iconName = GetItemIconName(item); @if (iconName.HasValue()) { } - @GetText(item) + + var text = GetItemText(item); + if (text.HasValue()) + { + @text + } } } diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroup.razor.cs b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroup.razor.cs index 9c3229eb85..73b9ff5894 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroup.razor.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroup.razor.cs @@ -4,11 +4,11 @@ namespace Bit.BlazorUI; public partial class BitButtonGroup : BitComponentBase where TItem : class { + private TItem? _toggleItem; private List _items = []; private IEnumerable _oldItems = default!; - /// /// The EditContext, which is set if the button is inside an /// @@ -27,6 +27,11 @@ public partial class BitButtonGroup : BitComponentBase where TItem : clas [Parameter, ResetClassBuilder] public BitColor? Color { get; set; } + /// + /// Determines that only the icon should be rendered. + /// + [Parameter] public bool IconOnly { get; set; } + /// /// List of Item, each of which can be a button with different action in the ButtonGroup. /// @@ -58,6 +63,11 @@ public partial class BitButtonGroup : BitComponentBase where TItem : clas [Parameter, ResetClassBuilder] public BitSize? Size { get; set; } + /// + /// Display ButtonGroup with toggle mode enabled for each button. + /// + [Parameter] public bool Toggled { get; set; } + /// /// The visual variant of the button group. /// @@ -143,7 +153,7 @@ protected override void OnParametersSet() if (_oldItems is not null && Items.SequenceEqual(_oldItems)) return; _oldItems = Items; - _items = Items.ToList(); + _items = [.. Items]; } @@ -175,6 +185,118 @@ private async Task HandleOnItemClick(TItem item) item.GetValueFromProperty?>(NameSelectors.OnClick.Name)?.Invoke(item); } } + + if (Toggled) + { + if (_toggleItem == item) + { + _toggleItem = null; + } + else + { + _toggleItem = item; + } + } + } + + private string? GetItemClass(TItem? item) + { + List classes = ["bit-btg-itm"]; + + if (GetReversedIcon(item)) + { + classes.Add("bit-btg-rvi"); + } + + if (_toggleItem == item) + { + classes.Add("bit-btg-chk"); + } + + var classItem = GetClass(item); + if (classItem.HasValue()) + { + classes.Add(classItem!); + } + + return string.Join(' ', classes); + } + + private string? GetItemText(TItem? item) + { + if (IconOnly) return null; + + if (Toggled) + { + if (_toggleItem == item) + { + var onText = GetOnText(item); + if (onText.HasValue()) + { + return onText; + } + } + else + { + var offText = GetOffText(item); + if (offText.HasValue()) + { + return offText; + } + } + } + + return GetText(item); + } + + private string? GetItemTitle(TItem? item) + { + if (Toggled) + { + if (_toggleItem == item) + { + var onTitle = GetOnTitle(item); + if (onTitle.HasValue()) + { + return onTitle; + } + } + else + { + var offTitle = GetOffTitle(item); + if (offTitle.HasValue()) + { + return offTitle; + } + } + } + + return GetTitle(item); + } + + private string? GetItemIconName(TItem? item) + { + if (Toggled) + { + if (_toggleItem == item) + { + var onIconName = GetOnIconName(item); + if (onIconName.HasValue()) + { + return onIconName; + } + } + else + { + var offIconName = GetOffIconName(item); + if (offIconName.HasValue()) + { + return offIconName; + } + } + } + + return GetIconName(item); } private string? GetClass(TItem? item) @@ -225,6 +347,54 @@ private async Task HandleOnItemClick(TItem item) return item.GetValueFromProperty(NameSelectors.IconName.Name); } + private string? GetOnIconName(TItem? item) + { + if (item is null) return null; + + if (item is BitButtonGroupItem buttonGroupItem) + { + return buttonGroupItem.OnIconName; + } + + if (item is BitButtonGroupOption buttonGroupOption) + { + return buttonGroupOption.OnIconName; + } + + if (NameSelectors is null) return null; + + if (NameSelectors.OnIconName.Selector is not null) + { + return NameSelectors.OnIconName.Selector!(item); + } + + return item.GetValueFromProperty(NameSelectors.OnIconName.Name); + } + + private string? GetOffIconName(TItem? item) + { + if (item is null) return null; + + if (item is BitButtonGroupItem buttonGroupItem) + { + return buttonGroupItem.OffIconName; + } + + if (item is BitButtonGroupOption buttonGroupOption) + { + return buttonGroupOption.OffIconName; + } + + if (NameSelectors is null) return null; + + if (NameSelectors.OffIconName.Selector is not null) + { + return NameSelectors.OffIconName.Selector!(item); + } + + return item.GetValueFromProperty(NameSelectors.OffIconName.Name); + } + private bool GetIsEnabled(TItem? item) { if (item is null) return false; @@ -320,4 +490,148 @@ private bool GetIsEnabled(TItem? item) return item.GetValueFromProperty(NameSelectors.Text.Name); } + + private string? GetOnText(TItem? item) + { + if (item is null) return null; + + if (item is BitButtonGroupItem buttonGroupItem) + { + return buttonGroupItem.OnText; + } + + if (item is BitButtonGroupOption buttonGroupOption) + { + return buttonGroupOption.OnText; + } + + if (NameSelectors is null) return null; + + if (NameSelectors.OnText.Selector is not null) + { + return NameSelectors.OnText.Selector!(item); + } + + return item.GetValueFromProperty(NameSelectors.OnText.Name); + } + + private string? GetOffText(TItem? item) + { + if (item is null) return null; + + if (item is BitButtonGroupItem buttonGroupItem) + { + return buttonGroupItem.OffText; + } + + if (item is BitButtonGroupOption buttonGroupOption) + { + return buttonGroupOption.OffText; + } + + if (NameSelectors is null) return null; + + if (NameSelectors.OffText.Selector is not null) + { + return NameSelectors.OffText.Selector!(item); + } + + return item.GetValueFromProperty(NameSelectors.OffText.Name); + } + + private string? GetTitle(TItem? item) + { + if (item is null) return null; + + if (item is BitButtonGroupItem buttonGroupItem) + { + return buttonGroupItem.Title; + } + + if (item is BitButtonGroupOption buttonGroupOption) + { + return buttonGroupOption.Title; + } + + if (NameSelectors is null) return null; + + if (NameSelectors.Title.Selector is not null) + { + return NameSelectors.Title.Selector!(item); + } + + return item.GetValueFromProperty(NameSelectors.Title.Name); + } + + private string? GetOnTitle(TItem? item) + { + if (item is null) return null; + + if (item is BitButtonGroupItem buttonGroupItem) + { + return buttonGroupItem.OnTitle; + } + + if (item is BitButtonGroupOption buttonGroupOption) + { + return buttonGroupOption.OnTitle; + } + + if (NameSelectors is null) return null; + + if (NameSelectors.OnTitle.Selector is not null) + { + return NameSelectors.OnTitle.Selector!(item); + } + + return item.GetValueFromProperty(NameSelectors.OnTitle.Name); + } + + private string? GetOffTitle(TItem? item) + { + if (item is null) return null; + + if (item is BitButtonGroupItem buttonGroupItem) + { + return buttonGroupItem.OffTitle; + } + + if (item is BitButtonGroupOption buttonGroupOption) + { + return buttonGroupOption.OffTitle; + } + + if (NameSelectors is null) return null; + + if (NameSelectors.OffTitle.Selector is not null) + { + return NameSelectors.OffTitle.Selector!(item); + } + + return item.GetValueFromProperty(NameSelectors.OffTitle.Name); + } + + private bool GetReversedIcon(TItem? item) + { + if (item is null) return false; + + if (item is BitButtonGroupItem buttonGroupItem) + { + return buttonGroupItem.ReversedIcon; + } + + if (item is BitButtonGroupOption buttonGroupOption) + { + return buttonGroupOption.ReversedIcon; + } + + if (NameSelectors is null) return false; + + if (NameSelectors.ReversedIcon.Selector is not null) + { + return NameSelectors.ReversedIcon.Selector!(item); + } + + return item.GetValueFromProperty(NameSelectors.ReversedIcon.Name, false); + } } diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroup.scss b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroup.scss index a630e467f4..9a55b86981 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroup.scss +++ b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroup.scss @@ -34,6 +34,7 @@ line-height: inherit; text-decoration: none; box-sizing: border-box; + justify-content: center; font-family: $tg-font-family; font-weight: $tg-font-weight; border-style: $shp-border-style; @@ -69,6 +70,10 @@ } } +.bit-btg-rvi { + flex-direction: row-reverse; +} + .bit-btg-btx { white-space: nowrap; text-overflow: ellipsis; @@ -131,12 +136,33 @@ } } +.bit-btg-chk { + color: var(--bit-btg-clr-txt); + border-color: var(--bit-btg-clr-dark); + background-color: var(--bit-btg-clr-dark); + + @media (hover: hover) { + &:hover { + border-color: var(--bit-btg-clr-dark-hover); + background-color: var(--bit-btg-clr-dark-hover); + } + } + + &:active { + border-color: var(--bit-btg-clr-dark-active); + background-color: var(--bit-btg-clr-dark-active); + } +} + .bit-btg-pri { --bit-btg-clr: #{$clr-pri}; --bit-btg-clr-txt: #{$clr-pri-text}; --bit-btg-clr-brd: #{$clr-pri-dark}; --bit-btg-clr-hover: #{$clr-pri-hover}; --bit-btg-clr-active: #{$clr-pri-active}; + --bit-btg-clr-dark: #{$clr-pri-dark}; + --bit-btg-clr-dark-hover: #{$clr-pri-dark-hover}; + --bit-btg-clr-dark-active: #{$clr-pri-dark-active}; } .bit-btg-sec { @@ -145,6 +171,9 @@ --bit-btg-clr-brd: #{$clr-sec-dark}; --bit-btg-clr-hover: #{$clr-sec-hover}; --bit-btg-clr-active: #{$clr-sec-active}; + --bit-btg-clr-dark: #{$clr-sec-dark}; + --bit-btg-clr-dark-hover: #{$clr-sec-dark-hover}; + --bit-btg-clr-dark-active: #{$clr-sec-dark-active}; } .bit-btg-ter { @@ -153,6 +182,9 @@ --bit-btg-clr-brd: #{$clr-ter-dark}; --bit-btg-clr-hover: #{$clr-ter-hover}; --bit-btg-clr-active: #{$clr-ter-active}; + --bit-btg-clr-dark: #{$clr-ter-dark}; + --bit-btg-clr-dark-hover: #{$clr-ter-dark-hover}; + --bit-btg-clr-dark-active: #{$clr-ter-dark-active}; } .bit-btg-inf { @@ -161,6 +193,9 @@ --bit-btg-clr-brd: #{$clr-inf-dark}; --bit-btg-clr-hover: #{$clr-inf-hover}; --bit-btg-clr-active: #{$clr-inf-active}; + --bit-btg-clr-dark: #{$clr-inf-dark}; + --bit-btg-clr-dark-hover: #{$clr-inf-dark-hover}; + --bit-btg-clr-dark-active: #{$clr-inf-dark-active}; } .bit-btg-suc { @@ -169,6 +204,9 @@ --bit-btg-clr-brd: #{$clr-suc-dark}; --bit-btg-clr-hover: #{$clr-suc-hover}; --bit-btg-clr-active: #{$clr-suc-active}; + --bit-btg-clr-dark: #{$clr-suc-dark}; + --bit-btg-clr-dark-hover: #{$clr-suc-dark-hover}; + --bit-btg-clr-dark-active: #{$clr-suc-dark-active}; } .bit-btg-wrn { @@ -177,6 +215,9 @@ --bit-btg-clr-brd: #{$clr-wrn-dark}; --bit-btg-clr-hover: #{$clr-wrn-hover}; --bit-btg-clr-active: #{$clr-wrn-active}; + --bit-btg-clr-dark: #{$clr-wrn-dark}; + --bit-btg-clr-dark-hover: #{$clr-wrn-dark-hover}; + --bit-btg-clr-dark-active: #{$clr-wrn-dark-active}; } .bit-btg-swr { @@ -185,6 +226,9 @@ --bit-btg-clr-brd: #{$clr-swr-dark}; --bit-btg-clr-hover: #{$clr-swr-hover}; --bit-btg-clr-active: #{$clr-swr-active}; + --bit-btg-clr-dark: #{$clr-swr-dark}; + --bit-btg-clr-dark-hover: #{$clr-swr-dark-hover}; + --bit-btg-clr-dark-active: #{$clr-swr-dark-active}; } .bit-btg-err { @@ -193,6 +237,9 @@ --bit-btg-clr-brd: #{$clr-err-dark}; --bit-btg-clr-hover: #{$clr-err-hover}; --bit-btg-clr-active: #{$clr-err-active}; + --bit-btg-clr-dark: #{$clr-err-dark}; + --bit-btg-clr-dark-hover: #{$clr-err-dark-hover}; + --bit-btg-clr-dark-active: #{$clr-err-dark-active}; } @@ -202,6 +249,9 @@ --bit-btg-clr-brd: #{$clr-bg-pri}; --bit-btg-clr-hover: #{$clr-bg-pri-hover}; --bit-btg-clr-active: #{$clr-bg-pri-active}; + --bit-btg-clr-dark: #{$clr-bg-pri}; + --bit-btg-clr-dark-hover: #{$clr-bg-pri-hover}; + --bit-btg-clr-dark-active: #{$clr-bg-pri-active}; } .bit-btg-sbg { @@ -210,6 +260,9 @@ --bit-btg-clr-brd: #{$clr-bg-sec}; --bit-btg-clr-hover: #{$clr-bg-sec-hover}; --bit-btg-clr-active: #{$clr-bg-sec-active}; + --bit-btg-clr-dark: #{$clr-bg-sec}; + --bit-btg-clr-dark-hover: #{$clr-bg-sec-hover}; + --bit-btg-clr-dark-active: #{$clr-bg-sec-active}; } .bit-btg-tbg { @@ -218,6 +271,9 @@ --bit-btg-clr-brd: #{$clr-bg-ter}; --bit-btg-clr-hover: #{$clr-bg-ter-hover}; --bit-btg-clr-active: #{$clr-bg-ter-active}; + --bit-btg-clr-dark: #{$clr-bg-ter}; + --bit-btg-clr-dark-hover: #{$clr-bg-ter-hover}; + --bit-btg-clr-dark-active: #{$clr-bg-ter-active}; } .bit-btg-pfg { @@ -226,6 +282,9 @@ --bit-btg-clr-brd: #{$clr-fg-pri}; --bit-btg-clr-hover: #{$clr-fg-pri-hover}; --bit-btg-clr-active: #{$clr-fg-pri-active}; + --bit-btg-clr-dark: #{$clr-fg-pri}; + --bit-btg-clr-dark-hover: #{$clr-fg-pri-hover}; + --bit-btg-clr-dark-active: #{$clr-fg-pri-active}; } .bit-btg-sfg { @@ -234,6 +293,9 @@ --bit-btg-clr-brd: #{$clr-fg-sec}; --bit-btg-clr-hover: #{$clr-fg-sec-hover}; --bit-btg-clr-active: #{$clr-fg-sec-active}; + --bit-btg-clr-dark: #{$clr-fg-sec}; + --bit-btg-clr-dark-hover: #{$clr-fg-sec-hover}; + --bit-btg-clr-dark-active: #{$clr-fg-sec-active}; } .bit-btg-tfg { @@ -242,6 +304,9 @@ --bit-btg-clr-brd: #{$clr-fg-ter}; --bit-btg-clr-hover: #{$clr-fg-ter-hover}; --bit-btg-clr-active: #{$clr-fg-ter-active}; + --bit-btg-clr-dark: #{$clr-fg-ter}; + --bit-btg-clr-dark-hover: #{$clr-fg-ter-hover}; + --bit-btg-clr-dark-active: #{$clr-fg-ter-active}; } .bit-btg-pbr { @@ -250,6 +315,9 @@ --bit-btg-clr-brd: #{$clr-brd-pri}; --bit-btg-clr-hover: #{$clr-brd-pri-hover}; --bit-btg-clr-active: #{$clr-brd-pri-active}; + --bit-btg-clr-dark: #{$clr-brd-pri}; + --bit-btg-clr-dark-hover: #{$clr-brd-pri-hover}; + --bit-btg-clr-dark-active: #{$clr-brd-pri-active}; } .bit-btg-sbr { @@ -258,6 +326,9 @@ --bit-btg-clr-brd: #{$clr-brd-sec}; --bit-btg-clr-hover: #{$clr-brd-sec-hover}; --bit-btg-clr-active: #{$clr-brd-sec-active}; + --bit-btg-clr-dark: #{$clr-brd-sec}; + --bit-btg-clr-dark-hover: #{$clr-brd-sec-hover}; + --bit-btg-clr-dark-active: #{$clr-brd-sec-active}; } .bit-btg-tbr { @@ -266,6 +337,9 @@ --bit-btg-clr-brd: #{$clr-brd-ter}; --bit-btg-clr-hover: #{$clr-brd-ter-hover}; --bit-btg-clr-active: #{$clr-brd-ter-active}; + --bit-btg-clr-dark: #{$clr-brd-ter}; + --bit-btg-clr-dark-hover: #{$clr-brd-ter-hover}; + --bit-btg-clr-dark-active: #{$clr-brd-ter-active}; } diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroupItem.cs b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroupItem.cs index afa3ee18bd..0311d50980 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroupItem.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroupItem.cs @@ -23,11 +23,46 @@ public class BitButtonGroupItem /// public string? Key { get; set; } + /// + /// The icon of the item when it is not checked in toggle mode. + /// + [Parameter] public string? OffIconName { get; set; } + + /// + /// The text of the item when it is not checked in toggle mode. + /// + [Parameter] public string? OffText { get; set; } + + /// + /// The title of the item when it is not checked in toggle mode. + /// + [Parameter] public string? OffTitle { get; set; } + + /// + /// The icon of the item when it is checked in toggle mode. + /// + [Parameter] public string? OnIconName { get; set; } + + /// + /// The text of the item when it is checked in toggle mode. + /// + [Parameter] public string? OnText { get; set; } + + /// + /// The title of the item when it is checked in toggle mode. + /// + [Parameter] public string? OnTitle { get; set; } + /// /// Click event handler of the item. /// public Action? OnClick { get; set; } + /// + /// Reverses the positions of the icon and the main content of the item. + /// + [Parameter] public bool ReversedIcon { get; set; } + /// /// The custom value for the style attribute of the item. /// @@ -42,4 +77,9 @@ public class BitButtonGroupItem /// Text to render in the item. /// public string? Text { get; set; } + + /// + /// Title to render in the item. + /// + public string? Title { get; set; } } diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroupNameSelectors.cs b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroupNameSelectors.cs index fe1caf82d6..75cd27bc93 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroupNameSelectors.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroupNameSelectors.cs @@ -22,11 +22,46 @@ public class BitButtonGroupNameSelectors /// public BitNameSelectorPair Key { get; set; } = new(nameof(BitButtonGroupItem.Key)); + /// + /// OffIconName field name and selector of the custom input class. + /// + public BitNameSelectorPair OffIconName { get; set; } = new(nameof(BitButtonGroupItem.OffIconName)); + + /// + /// OffText field name and selector of the custom input class. + /// + public BitNameSelectorPair OffText { get; set; } = new(nameof(BitButtonGroupItem.OffText)); + + /// + /// OffTitle field name and selector of the custom input class. + /// + public BitNameSelectorPair OffTitle { get; set; } = new(nameof(BitButtonGroupItem.OffTitle)); + + /// + /// OnIconName field name and selector of the custom input class. + /// + public BitNameSelectorPair OnIconName { get; set; } = new(nameof(BitButtonGroupItem.OnIconName)); + + /// + /// OnText field name and selector of the custom input class. + /// + public BitNameSelectorPair OnText { get; set; } = new(nameof(BitButtonGroupItem.OnText)); + + /// + /// OnTitle field name and selector of the custom input class. + /// + public BitNameSelectorPair OnTitle { get; set; } = new(nameof(BitButtonGroupItem.OnTitle)); + /// /// OnClick field name and selector of the custom input class. /// public BitNameSelectorPair?> OnClick { get; set; } = new(nameof(BitButtonGroupItem.OnClick)); + /// + /// ReversedIcon field name and selector of the custom input class. + /// + public BitNameSelectorPair ReversedIcon { get; set; } = new(nameof(BitButtonGroupItem.ReversedIcon)); + /// /// The CSS Style field name and selector of the custom input class. /// @@ -41,4 +76,9 @@ public class BitButtonGroupNameSelectors /// Text field name and selector of the custom input class. /// public BitNameSelectorPair Text { get; set; } = new(nameof(BitButtonGroupItem.Text)); + + /// + /// Title field name and selector of the custom input class. + /// + public BitNameSelectorPair Title { get; set; } = new(nameof(BitButtonGroupItem.Title)); } diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroupOption.cs b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroupOption.cs index ce48fed62f..2380942365 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroupOption.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitButtonGroup/BitButtonGroupOption.cs @@ -28,11 +28,46 @@ public partial class BitButtonGroupOption : ComponentBase, IDisposable /// [Parameter] public string? Key { get; set; } + /// + /// The icon of the option when it is not checked in toggle mode. + /// + [Parameter] public string? OffIconName { get; set; } + + /// + /// The text of the option when it is not checked in toggle mode. + /// + [Parameter] public string? OffText { get; set; } + + /// + /// The title of the option when it is not checked in toggle mode. + /// + [Parameter] public string? OffTitle { get; set; } + + /// + /// The icon of the option when it is checked in toggle mode. + /// + [Parameter] public string? OnIconName { get; set; } + + /// + /// The text of the option when it is checked in toggle mode. + /// + [Parameter] public string? OnText { get; set; } + + /// + /// The title of the option when it is checked in toggle mode. + /// + [Parameter] public string? OnTitle { get; set; } + /// /// Click event handler of the option. /// [Parameter] public EventCallback OnClick { get; set; } + /// + /// Reverses the positions of the icon and the main content of the option. + /// + [Parameter] public bool ReversedIcon { get; set; } + /// /// The custom value for the style attribute of the option. /// @@ -48,6 +83,11 @@ public partial class BitButtonGroupOption : ComponentBase, IDisposable /// [Parameter] public string? Text { get; set; } + /// + /// Title to render in the option + /// + [Parameter] public string? Title { get; set; } + protected override async Task OnInitializedAsync() diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/BitButtonGroupDemo.razor.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/BitButtonGroupDemo.razor.cs index dd5317259f..c4b9b4d2d7 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/BitButtonGroupDemo.razor.cs +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/BitButtonGroupDemo.razor.cs @@ -12,6 +12,13 @@ public partial class BitButtonGroupDemo Description = "The content of the BitButtonGroup, that are BitButtonGroupOption components.", }, new() + { + Name = "IconOnly", + Type = "bool", + DefaultValue = "false", + Description = "Determines that only the icon should be rendered.", + }, + new() { Name = "Color", Type = "BitColor?", @@ -59,6 +66,13 @@ public partial class BitButtonGroupDemo Description = "Alias of ChildContent.", }, new() + { + Name = "Toggled", + Type = "bool", + DefaultValue = "false", + Description = "Display ButtonGroup with toggle mode enabled for each button.", + }, + new() { Name = "Size", Type = "BitSize", @@ -122,6 +136,48 @@ public partial class BitButtonGroupDemo Description = "A unique value to use as a Key of the item.", }, new() + { + Name = "OffIconName", + Type = "string?", + DefaultValue = "null", + Description = "The icon of the item when it is not checked in toggle mode.", + }, + new() + { + Name = "OffText", + Type = "string?", + DefaultValue = "null", + Description = "The text of the item when it is not checked in toggle mode.", + }, + new() + { + Name = "OffTitle", + Type = "string?", + DefaultValue = "null", + Description = "The title of the item when it is not checked in toggle mode.", + }, + new() + { + Name = "OnIconName", + Type = "string?", + DefaultValue = "null", + Description = "The icon of the item when it is checked in toggle mode.", + }, + new() + { + Name = "OnText", + Type = "string?", + DefaultValue = "null", + Description = "The text of the item when it is checked in toggle mode.", + }, + new() + { + Name = "OnTitle", + Type = "string?", + DefaultValue = "null", + Description = "The title of the item when it is checked in toggle mode.", + }, + new() { Name = "OnClick", Type = "EventCallback", @@ -129,6 +185,13 @@ public partial class BitButtonGroupDemo Description = "Click event handler of the item.", }, new() + { + Name = "ReversedIcon", + Type = "bool", + DefaultValue = "false", + Description = "Reverses the positions of the icon and the main content of the item.", + }, + new() { Name = "Style", Type = "string?", @@ -148,6 +211,13 @@ public partial class BitButtonGroupDemo Type = "string?", DefaultValue = "null", Description = "Text to render in the item.", + }, + new() + { + Name = "Title", + Type = "string?", + DefaultValue = "null", + Description = "Title to render in the item.", } ] }, @@ -186,6 +256,48 @@ public partial class BitButtonGroupDemo Description = "A unique value to use as a key of the option.", }, new() + { + Name = "OffIconName", + Type = "string?", + DefaultValue = "null", + Description = "The icon of the option when it is not checked in toggle mode.", + }, + new() + { + Name = "OffText", + Type = "string?", + DefaultValue = "null", + Description = "The text of the option when it is not checked in toggle mode.", + }, + new() + { + Name = "OffTitle", + Type = "string?", + DefaultValue = "null", + Description = "The title of the option when it is not checked in toggle mode.", + }, + new() + { + Name = "OnIconName", + Type = "string?", + DefaultValue = "null", + Description = "The icon of the option when it is checked in toggle mode.", + }, + new() + { + Name = "OnText", + Type = "string?", + DefaultValue = "null", + Description = "The text of the option when it is checked in toggle mode.", + }, + new() + { + Name = "OnTitle", + Type = "string?", + DefaultValue = "null", + Description = "The title of the option when it is checked in toggle mode.", + }, + new() { Name = "OnClick", Type = "EventCallback", @@ -193,6 +305,13 @@ public partial class BitButtonGroupDemo Description = "Click event handler of the option.", }, new() + { + Name = "ReversedIcon", + Type = "bool", + DefaultValue = "false", + Description = "Reverses the positions of the icon and the main content of the option.", + }, + new() { Name = "Style", Type = "string?", @@ -212,6 +331,13 @@ public partial class BitButtonGroupDemo Type = "string?", DefaultValue = "null", Description = "Text to render in the option.", + }, + new() + { + Name = "Title", + Type = "string?", + DefaultValue = "null", + Description = "Title to render in the option.", } ] }, @@ -258,6 +384,60 @@ public partial class BitButtonGroupDemo LinkType = LinkType.Link, }, new() + { + Name = "OffIconName", + Type = "BitNameSelectorPair", + DefaultValue = "new(nameof(BitButtonGroupItem.OffIconName))", + Description = "OffIconName field name and selector of the custom input class.", + Href = "#name-selector-pair", + LinkType = LinkType.Link, + }, + new() + { + Name = "OffText", + Type = "BitNameSelectorPair", + DefaultValue = "new(nameof(BitButtonGroupItem.OffText))", + Description = "OffText field name and selector of the custom input class.", + Href = "#name-selector-pair", + LinkType = LinkType.Link, + }, + new() + { + Name = "OffTitle", + Type = "BitNameSelectorPair", + DefaultValue = "new(nameof(BitButtonGroupItem.OffTitle))", + Description = "OffTitle field name and selector of the custom input class.", + Href = "#name-selector-pair", + LinkType = LinkType.Link, + }, + new() + { + Name = "OnIconName", + Type = "BitNameSelectorPair", + DefaultValue = "new(nameof(BitButtonGroupItem.OnIconName))", + Description = "OnIconName field name and selector of the custom input class.", + Href = "#name-selector-pair", + LinkType = LinkType.Link, + }, + new() + { + Name = "OnText", + Type = "BitNameSelectorPair", + DefaultValue = "new(nameof(BitButtonGroupItem.OnText))", + Description = "OnText field name and selector of the custom input class.", + Href = "#name-selector-pair", + LinkType = LinkType.Link, + }, + new() + { + Name = "OnTitle", + Type = "BitNameSelectorPair", + DefaultValue = "new(nameof(BitButtonGroupItem.OnTitle))", + Description = "OnTitle field name and selector of the custom input class.", + Href = "#name-selector-pair", + LinkType = LinkType.Link, + }, + new() { Name = "OnClick", Type = "BitNameSelectorPair?>", @@ -267,6 +447,15 @@ public partial class BitButtonGroupDemo LinkType = LinkType.Link, }, new() + { + Name = "ReversedIcon", + Type = "BitNameSelectorPair", + DefaultValue = "new(nameof(BitButtonGroupItem.ReversedIcon))", + Description = "ReversedIcon field name and selector of the custom input class.", + Href = "#name-selector-pair", + LinkType = LinkType.Link, + }, + new() { Name = "Style", Type = "BitNameSelectorPair", @@ -293,6 +482,15 @@ public partial class BitButtonGroupDemo Href = "#name-selector-pair", LinkType = LinkType.Link, }, + new() + { + Name = "Title", + Type = "BitNameSelectorPair", + DefaultValue = "new(nameof(BitButtonGroupItem.Title))", + Description = "Title field name and selector of the custom input class.", + Href = "#name-selector-pair", + LinkType = LinkType.Link, + } ] }, new() diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/Operation.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/Operation.cs index 688e918c52..4b61989ffe 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/Operation.cs +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/Operation.cs @@ -8,6 +8,8 @@ public class Operation public string? Icon { get; set; } + public bool ReversedIcon { get; set; } + public bool IsEnabled { get; set; } = true; public string? Class { get; set; } @@ -15,4 +17,16 @@ public class Operation public string? Style { get; set; } public Action? Clicked { get; set; } + + public string? OnIcon { get; set; } + + public string? OffIcon { get; set; } + + public string? OnName { get; set; } + + public string? OffName { get; set; } + + public string? OnTitle { get; set; } + + public string? OffTitle { get; set; } } diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupCustomDemo.razor b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupCustomDemo.razor index b1fa55899b..8552384e10 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupCustomDemo.razor +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupCustomDemo.razor @@ -187,7 +187,129 @@ - + + +
    The IconOnly allows buttons to display only icons without any text, ideal for minimalistic designs or limited space.
    +

    +
    +
    Fill (default)
    + +
    +

    +
    +
    Outline
    + +
    +

    +
    +
    Text
    + +
    +

    +
    Alternatively, each button can be set to IconOnly by simply leaving the text field empty.
    +

    +
    +
    Fill (default)
    + +
    +

    +
    +
    Outline
    + +
    +

    +
    +
    Text
    + +
    +
    +
    + + + +
    Reverses the positions of the icon and the main content of the button.
    +

    +
    +
    Fill (default)
    + +
    +

    +
    +
    Outline
    + +
    +

    +
    +
    Text
    + +
    +
    +
    + + + +
    The Toggled in BitButtonGroup allows you to control the active or inactive state of each button, providing clear visual feedback to users about which buttons are selected or currently in use.
    +

    +
    +
    Fill (default)
    + +
    +

    +
    +
    Outline
    + +
    +

    +
    +
    Text
    + +
    +
    +
    + +
    By default the BitButtonGroup component is horizontal, but can be turned vertical by adding the Vertical property.


    @@ -210,7 +332,7 @@
    - +
    Different sizes for buttons to meet design needs, ensuring flexibility within your application.


    @@ -237,7 +359,7 @@
    - +
    Empower customization by overriding default styles and classes, allowing tailored design modifications to suit specific UI requirements.


    @@ -257,7 +379,7 @@
    - +
    Managing button click events.


    @@ -280,7 +402,7 @@
    - +
    Use BitButtonGroup in right-to-left (RTL).

    diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupCustomDemo.razor.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupCustomDemo.razor.cs index 92a70d4085..0369b8eb8c 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupCustomDemo.razor.cs +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupCustomDemo.razor.cs @@ -24,6 +24,27 @@ public partial class _BitButtonGroupCustomDemo new() { Name = "Delete", Icon = BitIconName.Delete } ]; + private List onlyIconCustoms = + [ + new() { Name = "Add", Icon = BitIconName.Add }, + new() { Icon = BitIconName.Edit }, + new() { Name = "Delete", Icon = BitIconName.Delete } + ]; + + private List reversedIconCustoms = + [ + new() { Name = "Add", Icon = BitIconName.Add, ReversedIcon = true }, + new() { Name = "Edit", Icon = BitIconName.Edit, ReversedIcon = true }, + new() { Name = "Delete", Icon = BitIconName.Delete, ReversedIcon = true } + ]; + + private List toggledCustoms = + [ + new() { OnName = "Back (2X)", OffName = "Back", OnIcon = BitIconName.RewindTwoX, OffIcon = BitIconName.Rewind }, + new() { OnTitle = "Resume", OffTitle = "Play", OnIcon = BitIconName.PlayResume, OffIcon = BitIconName.Play }, + new() { OnName = "Forward (2X)", OffName = "Forward", OnIcon = BitIconName.FastForwardTwoX, OffIcon = BitIconName.FastForward, ReversedIcon = true } + ]; + private List eventsCustoms = [ new() { Name = "Increase", Icon = BitIconName.Add }, @@ -60,343 +81,4 @@ protected override void OnInitialized() eventsCustoms[1].Clicked = _ => { clickCounter = 0; StateHasChanged(); }; eventsCustoms[2].Clicked = _ => { clickCounter--; StateHasChanged(); }; } - - - - private readonly string example1RazorCode = @" -"; - private readonly string example1CsharpCode = @" -private BitButtonGroupNameSelectors nameSelector = new() { Text = { Selector = i => i.Name } }; - -public class Operation -{ - public string? Name { get; set; } -} - -private List basicCustoms = new() -{ - new() { Name = ""Add"" }, new() { Name = ""Edit"" }, new() { Name = ""Delete"" } -};"; - - private readonly string example2RazorCode = @" - - - - - - - - - - -"; - private readonly string example2CsharpCode = @" -private BitButtonGroupNameSelectors nameSelector = new() { Text = { Selector = i => i.Name } }; - -public class Operation -{ - public string? Name { get; set; } - public bool IsEnabled { get; set; } = true; -} - -private List basicCustoms = new() -{ - new() { Name = ""Add"" }, new() { Name = ""Edit"" }, new() { Name = ""Delete"" } -}; - -private List disabledCustoms = new() -{ - new() { Name = ""Add"" }, new() { Name = ""Edit"", IsEnabled = false }, new() { Name = ""Delete"" } -};"; - - private readonly string example3RazorCode = @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"; - private readonly string example3CsharpCode = @" -private BitButtonGroupNameSelectors nameSelector = new() { Text = { Selector = i => i.Name } }; - -public class Operation -{ - public string? Name { get; set; } -} - -private List basicCustoms = new() -{ - new() { Name = ""Add"" }, new() { Name = ""Edit"" }, new() { Name = ""Delete"" } -};"; - - private readonly string example4RazorCode = @" - i.Name }, - IconName = { Selector = i => i.Icon } })"" /> - - i.Name }, - IconName = { Selector = i => i.Icon } })"" /> - - i.Name }, - IconName = { Selector = i => i.Icon } })"" />"; - private readonly string example4CsharpCode = @" -public class Operation -{ - public string? Name { get; set; } - public string? Icon { get; set; } -} - -private List iconCustoms = new() -{ - new() { Name = ""Add"", Icon = BitIconName.Add }, - new() { Name = ""Edit"", Icon = BitIconName.Edit }, - new() { Name = ""Delete"", Icon = BitIconName.Delete } -};"; - - private readonly string example5RazorCode = @" - - -"; - private readonly string example5CsharpCode = @" -private BitButtonGroupNameSelectors nameSelector = new() { Text = { Selector = i => i.Name } }; - -public class Operation -{ - public string? Name { get; set; } -} - -private List basicCustoms = new() -{ - new() { Name = ""Add"" }, new() { Name = ""Edit"" }, new() { Name = ""Delete"" } -};"; - - private readonly string example6RazorCode = @" - - - - - - - - - - -"; - private readonly string example6CsharpCode = @" -private BitButtonGroupNameSelectors nameSelector = new() { Text = { Selector = i => i.Name } }; - -public class Operation -{ - public string? Name { get; set; } -} - -private List basicCustoms = new() -{ - new() { Name = ""Add"" }, new() { Name = ""Edit"" }, new() { Name = ""Delete"" } -};"; - - private readonly string example7RazorCode = @" - - - - - - - i.Name }, - IconName = { Selector = i => i.Icon } })"" />"; - private readonly string example7CsharpCode = @" -private BitButtonGroupNameSelectors nameSelector = new() { Text = { Selector = i => i.Name } }; - -public class Operation -{ - public string? Name { get; set; } - public string? Icon { get; set; } - public string? Class { get; set; } - public string? Style { get; set; } -} - -private List basicCustoms = new() -{ - new() { Name = ""Add"" }, new() { Name = ""Edit"" }, new() { Name = ""Delete"" } -}; - -private List styleClassCustoms = new() -{ - new() - { - Name = ""Styled"", - Style = ""color: tomato; border-color: brown; background-color: peachpuff;"", - Icon = BitIconName.Brush, - }, - new() - { - Name = ""Classed"", - Class = ""custom-item"", - Icon = BitIconName.FormatPainter, - } -};"; - - private readonly string example8RazorCode = @" - clickedCustom = item.Name"" /> -
    Clicked item: @clickedCustom
    - - i.Name }, - IconName = { Selector = i => i.Icon }, - OnClick = { Selector = i => i.Clicked } })"" /> -
    Click count: @clickCounter
    "; - private readonly string example8CsharpCode = @" -private BitButtonGroupNameSelectors nameSelector = new() { Text = { Selector = i => i.Name } }; - -public class Operation -{ - public string? Name { get; set; } - public string? Icon { get; set; } - public Action? Clicked { get; set; } -} - -private int clickCounter; - -private List basicCustoms = new() -{ - new() { Name = ""Add"" }, new() { Name = ""Edit"" }, new() { Name = ""Delete"" } -}; - -private List eventsCustoms = new() -{ - new() { Name = ""Increase"", Icon = BitIconName.Add }, - new() { Name = ""Reset"", Icon = BitIconName.Reset }, - new() { Name = ""Decrease"", Icon = BitIconName.Remove } -}; - -protected override void OnInitialized() -{ - eventsCustoms[0].Clicked = _ => { clickCounter++; StateHasChanged(); }; - eventsCustoms[1].Clicked = _ => { clickCounter = 0; StateHasChanged(); }; - eventsCustoms[2].Clicked = _ => { clickCounter--; StateHasChanged(); }; -}"; - - private readonly string example9RazorCode = @" - i.Name }, - IconName = { Selector = i => i.Icon } })"" /> - - i.Name }, - IconName = { Selector = i => i.Icon } })"" /> - - i.Name }, - IconName = { Selector = i => i.Icon } })"" />"; - private readonly string example9CsharpCode = @" -public class Operation -{ - public string? Name { get; set; } - public string? Icon { get; set; } -} - -private List rtlCustoms = new() -{ - new() { Name = ""اضافه کردن"", Icon = BitIconName.Add }, - new() { Name = ""ویرایش"", Icon = BitIconName.Edit }, - new() { Name = ""حذف"", Icon = BitIconName.Delete } -};"; } diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupCustomDemo.razor.samples.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupCustomDemo.razor.samples.cs new file mode 100644 index 0000000000..76886dd07e --- /dev/null +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupCustomDemo.razor.samples.cs @@ -0,0 +1,463 @@ +namespace Bit.BlazorUI.Demo.Client.Core.Pages.Components.Buttons.ButtonGroup; + +public partial class _BitButtonGroupCustomDemo +{ + private readonly string example1RazorCode = @" +"; + private readonly string example1CsharpCode = @" +private BitButtonGroupNameSelectors nameSelector = new() { Text = { Selector = i => i.Name } }; + +public class Operation +{ + public string? Name { get; set; } +} + +private List basicCustoms = +[ + new() { Name = ""Add"" }, new() { Name = ""Edit"" }, new() { Name = ""Delete"" } +];"; + + private readonly string example2RazorCode = @" + + + + + + + + + + +"; + private readonly string example2CsharpCode = @" +private BitButtonGroupNameSelectors nameSelector = new() { Text = { Selector = i => i.Name } }; + +public class Operation +{ + public string? Name { get; set; } + public bool IsEnabled { get; set; } = true; +} + +private List basicCustoms = +[ + new() { Name = ""Add"" }, new() { Name = ""Edit"" }, new() { Name = ""Delete"" } +]; + +private List disabledCustoms = +[ + new() { Name = ""Add"" }, new() { Name = ""Edit"", IsEnabled = false }, new() { Name = ""Delete"" } +];"; + + private readonly string example3RazorCode = @" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +"; + private readonly string example3CsharpCode = @" +private BitButtonGroupNameSelectors nameSelector = new() { Text = { Selector = i => i.Name } }; + +public class Operation +{ + public string? Name { get; set; } +} + +private List basicCustoms = +[ + new() { Name = ""Add"" }, new() { Name = ""Edit"" }, new() { Name = ""Delete"" } +];"; + + private readonly string example4RazorCode = @" + i.Name }, + IconName = { Selector = i => i.Icon } })"" /> + + i.Name }, + IconName = { Selector = i => i.Icon } })"" /> + + i.Name }, + IconName = { Selector = i => i.Icon } })"" />"; + private readonly string example4CsharpCode = @" +public class Operation +{ + public string? Name { get; set; } + public string? Icon { get; set; } +} + +private List iconCustoms = +[ + new() { Name = ""Add"", Icon = BitIconName.Add }, + new() { Name = ""Edit"", Icon = BitIconName.Edit }, + new() { Name = ""Delete"", Icon = BitIconName.Delete } +];"; + + private readonly string example5RazorCode = @" + i.Name }, + IconName = { Selector = i => i.Icon } })"" IconOnly /> + + i.Name }, + IconName = { Selector = i => i.Icon } })"" IconOnly /> + + i.Name }, + IconName = { Selector = i => i.Icon } })"" IconOnly /> + + + i.Name }, + IconName = { Selector = i => i.Icon } })"" /> + + i.Name }, + IconName = { Selector = i => i.Icon } })"" /> + + i.Name }, + IconName = { Selector = i => i.Icon } })"" />"; + private readonly string example5CsharpCode = @" +public class Operation +{ + public string? Name { get; set; } + public string? Icon { get; set; } +} + +private List iconCustoms = +[ + new() { Name = ""Add"", Icon = BitIconName.Add }, + new() { Name = ""Edit"", Icon = BitIconName.Edit }, + new() { Name = ""Delete"", Icon = BitIconName.Delete } +]; + +private List onlyIconCustoms = +[ + new() { Name = ""Add"", Icon = BitIconName.Add }, + new() { Icon = BitIconName.Edit }, + new() { Name = ""Delete"", Icon = BitIconName.Delete } +];"; + + private readonly string example6RazorCode = @" + i.Name }, + IconName = { Selector = i => i.Icon }, + ReversedIcon = { Selector = i => i.ReversedIcon } })"" /> + + i.Name }, + IconName = { Selector = i => i.Icon }, + ReversedIcon = { Selector = i => i.ReversedIcon } })"" /> + + i.Name }, + IconName = { Selector = i => i.Icon }, + ReversedIcon = { Selector = i => i.ReversedIcon } })"" />"; + private readonly string example6CsharpCode = @" +public class Operation +{ + public string? Name { get; set; } + public string? Icon { get; set; } + public bool ReversedIcon { get; set; } +} + +private List reversedIconCustoms = +[ + new() { Name = ""Add"", Icon = BitIconName.Add, ReversedIcon = true }, + new() { Name = ""Edit"", Icon = BitIconName.Edit, ReversedIcon = true }, + new() { Name = ""Delete"", Icon = BitIconName.Delete, ReversedIcon = true } +];"; + + private readonly string example7RazorCode = @" + i.OnName }, + OffText = { Selector = i => i.OffName }, + OnTitle = { Selector = i => i.OnTitle }, + OffTitle = { Selector = i => i.OffTitle }, + OnIconName = { Selector = i => i.OnIcon }, + OffIconName = { Selector = i => i.OffIcon }, + ReversedIcon = { Selector = i => i.ReversedIcon } })"" Toggled /> + + i.OnName }, + OffText = { Selector = i => i.OffName }, + OnTitle = { Selector = i => i.OnTitle }, + OffTitle = { Selector = i => i.OffTitle }, + OnIconName = { Selector = i => i.OnIcon }, + OffIconName = { Selector = i => i.OffIcon }, + ReversedIcon = { Selector = i => i.ReversedIcon } })"" Toggled /> + + i.OnName }, + OffText = { Selector = i => i.OffName }, + OnTitle = { Selector = i => i.OnTitle }, + OffTitle = { Selector = i => i.OffTitle }, + OnIconName = { Selector = i => i.OnIcon }, + OffIconName = { Selector = i => i.OffIcon }, + ReversedIcon = { Selector = i => i.ReversedIcon } })"" Toggled />"; + private readonly string example7CsharpCode = @" +public class Operation +{ + public string? OnIcon { get; set; } + public string? OffIcon { get; set; } + public string? OnName { get; set; } + public string? OffName { get; set; } + public string? OnTitle { get; set; } + public string? OffTitle { get; set; } + public bool ReversedIcon { get; set; } +} + +private List toggledCustoms = +[ + new() { OnName = ""Back (2X)"", OffName = ""Back"", OnIcon = BitIconName.RewindTwoX, OffIcon = BitIconName.Rewind }, + new() { OnTitle = ""Resume"", OffTitle = ""Play"", OnIcon = BitIconName.PlayResume, OffIcon = BitIconName.Play }, + new() { OnName = ""Forward (2X)"", OffName = ""Forward"", OnIcon = BitIconName.FastForwardTwoX, OffIcon = BitIconName.FastForward, ReversedIcon = true } +];"; + + private readonly string example8RazorCode = @" + + +"; + private readonly string example8CsharpCode = @" +private BitButtonGroupNameSelectors nameSelector = new() { Text = { Selector = i => i.Name } }; + +public class Operation +{ + public string? Name { get; set; } +} + +private List basicCustoms = +[ + new() { Name = ""Add"" }, new() { Name = ""Edit"" }, new() { Name = ""Delete"" } +];"; + + private readonly string example9RazorCode = @" + + + + + + + + + + +"; + private readonly string example9CsharpCode = @" +private BitButtonGroupNameSelectors nameSelector = new() { Text = { Selector = i => i.Name } }; + +public class Operation +{ + public string? Name { get; set; } +} + +private List basicCustoms = +[ + new() { Name = ""Add"" }, new() { Name = ""Edit"" }, new() { Name = ""Delete"" } +];"; + + private readonly string example10RazorCode = @" + + + + + + + i.Name }, + IconName = { Selector = i => i.Icon } })"" />"; + private readonly string example10CsharpCode = @" +private BitButtonGroupNameSelectors nameSelector = new() { Text = { Selector = i => i.Name } }; + +public class Operation +{ + public string? Name { get; set; } + public string? Icon { get; set; } + public string? Class { get; set; } + public string? Style { get; set; } +} + +private List basicCustoms = +[ + new() { Name = ""Add"" }, new() { Name = ""Edit"" }, new() { Name = ""Delete"" } +]; + +private List styleClassCustoms = +[ + new() + { + Name = ""Styled"", + Style = ""color: tomato; border-color: brown; background-color: peachpuff;"", + Icon = BitIconName.Brush, + }, + new() + { + Name = ""Classed"", + Class = ""custom-item"", + Icon = BitIconName.FormatPainter, + } +];"; + + private readonly string example11RazorCode = @" + clickedCustom = item.Name"" /> +
    Clicked item: @clickedCustom
    + + i.Name }, + IconName = { Selector = i => i.Icon }, + OnClick = { Selector = i => i.Clicked } })"" /> +
    Click count: @clickCounter
    "; + private readonly string example11CsharpCode = @" +private BitButtonGroupNameSelectors nameSelector = new() { Text = { Selector = i => i.Name } }; + +public class Operation +{ + public string? Name { get; set; } + public string? Icon { get; set; } + public Action? Clicked { get; set; } +} + +private int clickCounter; + +private List basicCustoms = +[ + new() { Name = ""Add"" }, new() { Name = ""Edit"" }, new() { Name = ""Delete"" } +]; + +private List eventsCustoms = +[ + new() { Name = ""Increase"", Icon = BitIconName.Add }, + new() { Name = ""Reset"", Icon = BitIconName.Reset }, + new() { Name = ""Decrease"", Icon = BitIconName.Remove } +]; + +protected override void OnInitialized() +{ + eventsCustoms[0].Clicked = _ => { clickCounter++; StateHasChanged(); }; + eventsCustoms[1].Clicked = _ => { clickCounter = 0; StateHasChanged(); }; + eventsCustoms[2].Clicked = _ => { clickCounter--; StateHasChanged(); }; +}"; + + private readonly string example12RazorCode = @" + i.Name }, + IconName = { Selector = i => i.Icon } })"" /> + + i.Name }, + IconName = { Selector = i => i.Icon } })"" /> + + i.Name }, + IconName = { Selector = i => i.Icon } })"" />"; + private readonly string example12CsharpCode = @" +public class Operation +{ + public string? Name { get; set; } + public string? Icon { get; set; } +} + +private List rtlCustoms = +[ + new() { Name = ""اضافه کردن"", Icon = BitIconName.Add }, + new() { Name = ""ویرایش"", Icon = BitIconName.Edit }, + new() { Name = ""حذف"", Icon = BitIconName.Delete } +];"; +} diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupItemDemo.razor b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupItemDemo.razor index 4bdd3a2b85..f8988ea109 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupItemDemo.razor +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupItemDemo.razor @@ -181,7 +181,87 @@
    - + + +
    The IconOnly allows buttons to display only icons without any text, ideal for minimalistic designs or limited space.
    +

    +
    +
    Fill (default)
    + +
    +

    +
    +
    Outline
    + +
    +

    +
    +
    Text
    + +
    +

    +
    Alternatively, each button can be set to IconOnly by simply leaving the text field empty.
    +

    +
    +
    Fill (default)
    + +
    +

    +
    +
    Outline
    + +
    +

    +
    +
    Text
    + +
    +
    +
    + + + +
    Reverses the positions of the icon and the main content of the button.
    +

    +
    +
    Fill (default)
    + +
    +

    +
    +
    Outline
    + +
    +

    +
    +
    Text
    + +
    +
    +
    + + + +
    The Toggled in BitButtonGroup allows you to control the active or inactive state of each button, providing clear visual feedback to users about which buttons are selected or currently in use.
    +

    +
    +
    Fill (default)
    + +
    +

    +
    +
    Outline
    + +
    +

    +
    +
    Text
    + +
    +
    +
    + +
    By default the BitButtonGroup component is horizontal, but can be turned vertical by adding the Vertical property.


    @@ -204,7 +284,7 @@
    - +
    Different sizes for buttons to meet design needs, ensuring flexibility within your application.


    @@ -231,7 +311,7 @@
    - +
    Empower customization by overriding default styles and classes, allowing tailored design modifications to suit specific UI requirements.


    @@ -248,7 +328,7 @@
    - +
    Managing button click events.


    @@ -266,7 +346,7 @@
    - +
    Use BitButtonGroup in right-to-left (RTL).

    diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupItemDemo.razor.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupItemDemo.razor.cs index 1f27935f6f..15b29a29c7 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupItemDemo.razor.cs +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupItemDemo.razor.cs @@ -22,6 +22,27 @@ public partial class _BitButtonGroupItemDemo new() { Text = "Delete", IconName = BitIconName.Delete } ]; + private List onlyIconItems = + [ + new() { Text = "Add", IconName = BitIconName.Add }, + new() { IconName = BitIconName.Edit }, + new() { Text = "Delete", IconName = BitIconName.Delete } + ]; + + private List reversedIconItems = + [ + new() { Text = "Add", IconName = BitIconName.Add, ReversedIcon = true }, + new() { Text = "Edit", IconName = BitIconName.Edit, ReversedIcon = true }, + new() { Text = "Delete", IconName = BitIconName.Delete, ReversedIcon = true } + ]; + + private List toggledItems = + [ + new() { OnText = "Back (2X)", OffText = "Back", OnIconName = BitIconName.RewindTwoX, OffIconName = BitIconName.Rewind }, + new() { OnTitle = "Resume", OffTitle = "Play", OnIconName = BitIconName.PlayResume, OffIconName = BitIconName.Play }, + new() { OnText = "Forward (2X)", OffText = "Forward", OnIconName = BitIconName.FastForwardTwoX, OffIconName = BitIconName.FastForward, ReversedIcon = true } + ]; + private List eventsItems = [ new() { Text = "Increase", IconName = BitIconName.Add }, @@ -58,242 +79,4 @@ protected override void OnInitialized() eventsItems[1].OnClick = _ => { clickCounter = 0; StateHasChanged(); }; eventsItems[2].OnClick = _ => { clickCounter--; StateHasChanged(); }; } - - - - private readonly string example1RazorCode = @" -"; - private readonly string example1CsharpCode = @" -private List basicItems = new() -{ - new() { Text = ""Add"" }, new() { Text = ""Edit"" }, new() { Text = ""Delete"" } -};"; - - private readonly string example2RazorCode = @" - - - - - - - - - - -"; - private readonly string example2CsharpCode = @" -private List basicItems = new() -{ - new() { Text = ""Add"" }, new() { Text = ""Edit"" }, new() { Text = ""Delete"" } -}; - -private List disabledItems = new() -{ - new() { Text = ""Add"" }, new() { Text = ""Edit"", IsEnabled = false }, new() { Text = ""Delete"" } -};"; - - private readonly string example3RazorCode = @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"; - private readonly string example3CsharpCode = @" -private List basicItems = new() -{ - new() { Text = ""Add"" }, new() { Text = ""Edit"" }, new() { Text = ""Delete"" } -};"; - - private readonly string example4RazorCode = @" - - -"; - private readonly string example4CsharpCode = @" -private List iconItems = new() -{ - new() { Text = ""Add"", IconName = BitIconName.Add }, - new() { Text = ""Edit"", IconName = BitIconName.Edit }, - new() { Text = ""Delete"", IconName = BitIconName.Delete } -};"; - - private readonly string example5RazorCode = @" - - -"; - private readonly string example5CsharpCode = @" -private List basicItems = new() -{ - new() { Text = ""Add"" }, new() { Text = ""Edit"" }, new() { Text = ""Delete"" } -};"; - - private readonly string example6RazorCode = @" - - - - - - - - - - -"; - private readonly string example6CsharpCode = @" -private List basicItems = new() -{ - new() { Text = ""Add"" }, new() { Text = ""Edit"" }, new() { Text = ""Delete"" } -};"; - - private readonly string example7RazorCode = @" - - - - - - -"; - private readonly string example7CsharpCode = @" -private List basicItems = new() -{ - new() { Text = ""Add"" }, new() { Text = ""Edit"" }, new() { Text = ""Delete"" } -}; - -private List styleClassItems = new() -{ - new() - { - Text = ""Styled"", - Style = ""color: tomato; border-color: brown; background-color: peachpuff;"", - IconName = BitIconName.Brush, - }, - new() - { - Text = ""Classed"", - Class = ""custom-item"", - IconName = BitIconName.FormatPainter, - } -};"; - - private readonly string example8RazorCode = @" - clickedItem = item.Text"" /> -
    Clicked item: @clickedItem
    - - -
    Click count: @clickCounter
    "; - private readonly string example8CsharpCode = @" -private int clickCounter; -private string? clickedItem; - -private List eventsItems = new() -{ - new() { Text = ""Increase"", IconName = BitIconName.Add }, - new() { Text = ""Reset"", IconName = BitIconName.Reset }, - new() { Text = ""Decrease"", IconName = BitIconName.Remove } -}; - -protected override void OnInitialized() -{ - eventsItems[0].OnClick = _ => { clickCounter++; StateHasChanged(); }; - eventsItems[1].OnClick = _ => { clickCounter = 0; StateHasChanged(); }; - eventsItems[2].OnClick = _ => { clickCounter--; StateHasChanged(); }; -}"; - - private readonly string example9RazorCode = @" - - -"; - private readonly string example9CsharpCode = @" -private List rtlItems = new() -{ - new() { Text = ""اضافه کردن"", IconName = BitIconName.Add }, - new() { Text = ""ویرایش"", IconName = BitIconName.Edit }, - new() { Text = ""حذف"", IconName = BitIconName.Delete } -};"; } diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupItemDemo.razor.samples.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupItemDemo.razor.samples.cs new file mode 100644 index 0000000000..e41be97a4f --- /dev/null +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupItemDemo.razor.samples.cs @@ -0,0 +1,287 @@ +namespace Bit.BlazorUI.Demo.Client.Core.Pages.Components.Buttons.ButtonGroup; + +public partial class _BitButtonGroupItemDemo +{ + private readonly string example1RazorCode = @" +"; + private readonly string example1CsharpCode = @" +private List basicItems = +[ + new() { Text = ""Add"" }, new() { Text = ""Edit"" }, new() { Text = ""Delete"" } +];"; + + private readonly string example2RazorCode = @" + + + + + + + + + + +"; + private readonly string example2CsharpCode = @" +private List basicItems = +[ + new() { Text = ""Add"" }, new() { Text = ""Edit"" }, new() { Text = ""Delete"" } +]; + +private List disabledItems = +[ + new() { Text = ""Add"" }, new() { Text = ""Edit"", IsEnabled = false }, new() { Text = ""Delete"" } +];"; + + private readonly string example3RazorCode = @" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +"; + private readonly string example3CsharpCode = @" +private List basicItems = +[ + new() { Text = ""Add"" }, new() { Text = ""Edit"" }, new() { Text = ""Delete"" } +];"; + + private readonly string example4RazorCode = @" + + +"; + private readonly string example4CsharpCode = @" +private List iconItems = +[ + new() { Text = ""Add"", IconName = BitIconName.Add }, + new() { Text = ""Edit"", IconName = BitIconName.Edit }, + new() { Text = ""Delete"", IconName = BitIconName.Delete } +];"; + + private readonly string example5RazorCode = @" + + + + + + +"; + private readonly string example5CsharpCode = @" +private List iconItems = +[ + new() { Text = ""Add"", IconName = BitIconName.Add }, + new() { Text = ""Edit"", IconName = BitIconName.Edit }, + new() { Text = ""Delete"", IconName = BitIconName.Delete } +]; + +private List onlyIconItems = +[ + new() { Text = ""Add"", IconName = BitIconName.Add }, + new() { IconName = BitIconName.Edit }, + new() { Text = ""Delete"", IconName = BitIconName.Delete } +];"; + + private readonly string example6RazorCode = @" + + +"; + private readonly string example6CsharpCode = @" +private List reversedIconItems = +[ + new() { Text = ""Add"", IconName = BitIconName.Add, ReversedIcon = true }, + new() { Text = ""Edit"", IconName = BitIconName.Edit, ReversedIcon = true }, + new() { Text = ""Delete"", IconName = BitIconName.Delete, ReversedIcon = true } +];"; + + private readonly string example7RazorCode = @" + + +"; + private readonly string example7CsharpCode = @" +private List toggledItems = +[ + new() { OnText = ""Back (2X)"", OffText = ""Back"", OnIconName = BitIconName.RewindTwoX, OffIconName = BitIconName.Rewind }, + new() { OnTitle = ""Resume"", OffTitle = ""Play"", OnIconName = BitIconName.PlayResume, OffIconName = BitIconName.Play }, + new() { OnText = ""Forward (2X)"", OffText = ""Forward"", OnIconName = BitIconName.FastForwardTwoX, OffIconName = BitIconName.FastForward, ReversedIcon = true } +];"; + + private readonly string example8RazorCode = @" + + +"; + private readonly string example8CsharpCode = @" +private List basicItems = +[ + new() { Text = ""Add"" }, new() { Text = ""Edit"" }, new() { Text = ""Delete"" } +];"; + + private readonly string example9RazorCode = @" + + + + + + + + + + +"; + private readonly string example9CsharpCode = @" +private List basicItems = +[ + new() { Text = ""Add"" }, new() { Text = ""Edit"" }, new() { Text = ""Delete"" } +];"; + + private readonly string example10RazorCode = @" + + + + + + +"; + private readonly string example10CsharpCode = @" +private List basicItems = +[ + new() { Text = ""Add"" }, new() { Text = ""Edit"" }, new() { Text = ""Delete"" } +]; + +private List styleClassItems = +[ + new() + { + Text = ""Styled"", + Style = ""color: tomato; border-color: brown; background-color: peachpuff;"", + IconName = BitIconName.Brush, + }, + new() + { + Text = ""Classed"", + Class = ""custom-item"", + IconName = BitIconName.FormatPainter, + } +];"; + + private readonly string example11RazorCode = @" + clickedItem = item.Text"" /> +
    Clicked item: @clickedItem
    + + +
    Click count: @clickCounter
    "; + private readonly string example11CsharpCode = @" +private int clickCounter; +private string? clickedItem; + +private List eventsItems = +[ + new() { Text = ""Increase"", IconName = BitIconName.Add }, + new() { Text = ""Reset"", IconName = BitIconName.Reset }, + new() { Text = ""Decrease"", IconName = BitIconName.Remove } +]; + +protected override void OnInitialized() +{ + eventsItems[0].OnClick = _ => { clickCounter++; StateHasChanged(); }; + eventsItems[1].OnClick = _ => { clickCounter = 0; StateHasChanged(); }; + eventsItems[2].OnClick = _ => { clickCounter--; StateHasChanged(); }; +}"; + + private readonly string example12RazorCode = @" + + +"; + private readonly string example12CsharpCode = @" +private List rtlItems = +[ + new() { Text = ""اضافه کردن"", IconName = BitIconName.Add }, + new() { Text = ""ویرایش"", IconName = BitIconName.Edit }, + new() { Text = ""حذف"", IconName = BitIconName.Delete } +];"; +} diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupOptionDemo.razor b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupOptionDemo.razor index 78a2bcee32..6828f69be3 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupOptionDemo.razor +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupOptionDemo.razor @@ -317,7 +317,135 @@
    - + + +
    The IconOnly allows buttons to display only icons without any text, ideal for minimalistic designs or limited space.
    +

    +
    +
    Fill (default)
    + + + + + +
    +

    +
    +
    Outline
    + + + + + +
    +

    +
    +
    Text
    + + + + + +
    +

    +
    Alternatively, each button can be set to IconOnly by simply leaving the text field empty.
    +

    +
    +
    Fill (default)
    + + + + + +
    +

    +
    +
    Outline
    + + + + + +
    +

    +
    +
    Text
    + + + + + +
    +
    +
    + + + +
    Reverses the positions of the icon and the main content of the button.
    +

    +
    +
    Fill (default)
    + + + + + +
    +

    +
    +
    Outline
    + + + + + +
    +

    +
    +
    Text
    + + + + + +
    +
    +
    + + + +
    The Toggled in BitButtonGroup allows you to control the active or inactive state of each button, providing clear visual feedback to users about which buttons are selected or currently in use.
    +

    +
    +
    Fill (default)
    + + + + + +
    +

    +
    +
    Outline
    + + + + + +
    +

    +
    +
    Text
    + + + + + +
    +
    +
    + +
    By default the BitButtonGroup component is horizontal, but can be turned vertical by adding the Vertical property.


    @@ -346,7 +474,7 @@
    - +
    Different sizes for buttons to meet design needs, ensuring flexibility within your application.


    @@ -391,7 +519,7 @@
    - +
    Empower customization by overriding default styles and classes, allowing tailored design modifications to suit specific UI requirements.


    @@ -416,7 +544,7 @@
    - +
    Managing button click events.


    @@ -442,7 +570,7 @@
    - +
    Use BitButtonGroup in right-to-left (RTL).

    diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupOptionDemo.razor.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupOptionDemo.razor.cs index 3512afd078..998174d625 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupOptionDemo.razor.cs +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupOptionDemo.razor.cs @@ -4,356 +4,4 @@ public partial class _BitButtonGroupOptionDemo { private int clickCounter; private string? clickedOption; - - private readonly string example1RazorCode = @" - - - - -"; - - private readonly string example2RazorCode = @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"; - - private readonly string example3RazorCode = @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"; - - private readonly string example4RazorCode = @" - - - - - - - - - - - - - - - - -"; - - private readonly string example5RazorCode = @" - - - - - - - - - - -"; - - private readonly string example6RazorCode = @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"; - - private readonly string example7RazorCode = @" - - - - - - - - - - - - - - - -"; - - private readonly string example8RazorCode = @" - clickedOption = item.Text"" TItem=""BitButtonGroupOption""> - - - - -
    Clicked item: @clickedOption
    - - - { clickCounter++; StateHasChanged(); }"" /> - { clickCounter=0; StateHasChanged(); }"" /> - { clickCounter--; StateHasChanged(); }"" /> - -
    Click count: @clickCounter
    "; - private readonly string example8CsharpCode = @" -private int clickCounter; -private string? clickedOption;"; - - private readonly string example9RazorCode = @" - - - - - - - - - - - - - - - - -"; } diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupOptionDemo.razor.samples.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupOptionDemo.razor.samples.cs new file mode 100644 index 0000000000..796c28abae --- /dev/null +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/ButtonGroup/_BitButtonGroupOptionDemo.razor.samples.cs @@ -0,0 +1,433 @@ +namespace Bit.BlazorUI.Demo.Client.Core.Pages.Components.Buttons.ButtonGroup; + +public partial class _BitButtonGroupOptionDemo +{ + private readonly string example1RazorCode = @" + + + + +"; + + private readonly string example2RazorCode = @" + + + + + + + + + + + + + + + + + + + + + + + + + + + + +"; + + private readonly string example3RazorCode = @" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +"; + + private readonly string example4RazorCode = @" + + + + + + + + + + + + + + + + +"; + + private readonly string example5RazorCode = @" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +"; + + private readonly string example6RazorCode = @" + + + + + + + + + + + + + + + + +"; + + private readonly string example7RazorCode = @" + + + + + + + + + + + + + + + + +"; + + private readonly string example8RazorCode = @" + + + + + + + + + + +"; + + private readonly string example9RazorCode = @" + + + + + + + + + + + + + + + + + + + + + + + + + + + + +"; + + private readonly string example10RazorCode = @" + + + + + + + + + + + + + + + +"; + + private readonly string example11RazorCode = @" + clickedOption = item.Text"" TItem=""BitButtonGroupOption""> + + + + +
    Clicked item: @clickedOption
    + + + { clickCounter++; StateHasChanged(); }"" /> + { clickCounter=0; StateHasChanged(); }"" /> + { clickCounter--; StateHasChanged(); }"" /> + +
    Click count: @clickCounter
    "; + private readonly string example11CsharpCode = @" +private int clickCounter; +private string? clickedOption;"; + + private readonly string example12RazorCode = @" + + + + + + + + + + + + + + + + +"; +} From cf3eda1a865a421b30c003f7ec518a9ebf51cb03 Mon Sep 17 00:00:00 2001 From: Yaser Moradi Date: Fri, 20 Dec 2024 16:24:52 +0100 Subject: [PATCH 59/59] feat(templates): improve data loading and caching in Boilerplate #9515 (#9516) --- .../Components/Layout/UserMenu.razor | 31 +++++----- .../Components/Layout/UserMenu.razor.cs | 7 +-- .../Authorized/Settings/ProfileSection.razor | 6 +- .../Settings/ProfileSection.razor.cs | 12 ++-- .../Authorized/Settings/SettingsPage.razor | 4 -- .../Authorized/Settings/SettingsPage.razor.cs | 6 +- .../Components/Pages/HomePage.razor | 58 +++++++++---------- .../Components/Pages/HomePage.razor.cs | 24 +++++--- .../OfflineDbContextModelBuilder.cs | 2 +- .../Data/CompiledModel/UserDtoEntityType.cs | 9 ++- ...241220023903_InitialMigration.Designer.cs} | 8 ++- ....cs => 20241220023903_InitialMigration.cs} | 7 ++- .../OfflineDbContextModelSnapshot.cs | 6 ++ .../Controllers/AttachmentController.cs | 10 ++-- .../Statistics/StatisticsController.cs | 2 +- .../src/Shared/Dtos/Identity/UserDto.cs | 9 +++ .../Extensions/ByteArrayExtensions.cs | 2 + 17 files changed, 113 insertions(+), 90 deletions(-) rename src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Data/Migrations/{20241030140343_InitialMigration.Designer.cs => 20241220023903_InitialMigration.Designer.cs} (89%) rename src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Data/Migrations/{20241030140343_InitialMigration.cs => 20241220023903_InitialMigration.cs} (80%) rename src/Templates/Boilerplate/Bit.Boilerplate/src/{Client/Boilerplate.Client.Core => Shared}/Extensions/ByteArrayExtensions.cs (94%) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/UserMenu.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/UserMenu.razor index d6c56d0648..75c0aacf01 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/UserMenu.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/UserMenu.razor @@ -1,8 +1,4 @@ -@inherits AppComponentBase - -@{ - var imageUrl = user.ProfileImageName is null ? null : $"{profileImageUrl}&file={user.ProfileImageName}"; -} +@inherits AppComponentBase