diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProModal/BitProModal.razor b/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProModal/BitProModal.razor new file mode 100644 index 0000000000..c1c9d5c011 --- /dev/null +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProModal/BitProModal.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/ProModal/BitProModal.razor.cs b/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProModal/BitProModal.razor.cs new file mode 100644 index 0000000000..236d6b1e20 --- /dev/null +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProModal/BitProModal.razor.cs @@ -0,0 +1,186 @@ +namespace Bit.BlazorUI; + +public partial class BitProModal : BitComponentBase +{ + [Inject] private IJSRuntime _js { get; set; } = default!; + + + + /// + /// When true, the Modal will be positioned absolute instead of fixed. + /// + [Parameter, ResetClassBuilder] + public bool AbsolutePosition { get; set; } + + /// + /// Determines the ARIA role of the Modal (alertdialog/dialog). If this is set, it will override the ARIA role determined by Blocking and Modeless. + /// + [Parameter] public bool? Alert { get; set; } + + /// + /// Enables the auto scrollbar toggle behavior of the Modal. + /// + [Parameter] public bool AutoToggleScroll { get; set; } + + /// + /// Whether the Modal can be light dismissed by clicking outside the Modal (on the overlay). + /// + [Parameter] public bool Blocking { get; set; } + + /// + /// The alias of the ChildContent. + /// + [Parameter] public RenderFragment? Body { get; set; } + + /// + /// The content of the Modal, it can be any custom tag or text. + /// + [Parameter] public RenderFragment? ChildContent { get; set; } + + /// + /// Custom CSS classes for different parts of the BitModal component. + /// + [Parameter] public BitProModalClassStyles? Classes { get; set; } + + /// + /// The CSS selector of the drag element. by default it's the Modal container. + /// + [Parameter] public string? DragElementSelector { get; set; } + + /// + /// Whether the Modal can be dragged around. + /// + [Parameter] public bool Draggable { 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; } + + /// + /// Makes the Modal height 100% of its parent container. + /// + [Parameter, ResetClassBuilder] + public bool FullHeight { get; set; } + + /// + /// Makes the Modal width and height 100% of its parent container. + /// + [Parameter, ResetClassBuilder] + public bool FullSize { get; set; } + + /// + /// Makes the Modal width 100% of its parent container. + /// + [Parameter, ResetClassBuilder] + public bool FullWidth { get; set; } + + /// + /// Whether the Modal is displayed. + /// + [Parameter, TwoWayBound] + public bool IsOpen { get; set; } + + /// + /// Renders the overlay in full mode that gives it an opaque background. + /// + [Parameter, ResetClassBuilder] + public bool ModeFull { get; set; } + + /// + /// Whether the Modal should be modeless (e.g. not dismiss when focusing/clicking outside of the Modal). if true: Blocking is ignored, there will be no overlay. + /// + [Parameter] public bool Modeless { get; set; } + + /// + /// Removes the default top border of the modal. + /// + [Parameter, ResetClassBuilder] + public bool NoBorder { get; set; } + + /// + /// A callback function for when the Modal is dismissed. + /// + [Parameter] public EventCallback OnDismiss { get; set; } + + /// + /// A callback function for when somewhere on the overlay element of the Modal is clicked. + /// + [Parameter] public EventCallback OnOverlayClick { get; set; } + + /// + /// Position of the Modal on the screen. + /// + [Parameter, ResetClassBuilder] + public BitPosition? Position { get; set; } + + /// + /// Set the element selector for which the Modal 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 BitModal component. + /// + [Parameter] public BitProModalClassStyles? Styles { 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-pmd"; + + protected override void RegisterCssClasses() + { + ClassBuilder.Register(() => FullSize || FullHeight ? "bit-pmd-fhe" : string.Empty); + ClassBuilder.Register(() => FullSize || FullWidth ? "bit-pmd-fwi" : string.Empty); + + ClassBuilder.Register(() => ModeFull ? "bit-pmd-mfl" : string.Empty); + ClassBuilder.Register(() => NoBorder ? "" : "bit-pmd-tbr"); + } + + + + private async Task CloseModal(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/ProModal/BitProModal.scss b/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProModal/BitProModal.scss new file mode 100644 index 0000000000..4c9c5c2091 --- /dev/null +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProModal/BitProModal.scss @@ -0,0 +1,91 @@ +@import '../../../Bit.BlazorUI/Styles/functions.scss'; + +.bit-pmd { +} + +.bit-pmd-mfl { + .bit-mdl-ovl { + background-color: $clr-bg-overlay; + } +} + +.bit-pmd-tbr { + .bit-mdl-ctn { + border-top: spacing(0.5) solid $clr-pri; + } +} + +.bit-pmd-fhe { + .bit-mdl-ctn { + height: 100%; + border-top: none; + } +} + +.bit-pmd-fwi { + .bit-mdl-ctn { + width: 100%; + } + + .bit-pmd-bdy { + max-width: unset; + } +} + +.bit-pmd-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-pmd-hdr { + flex-grow: 1; + display: flex; + align-items: center; + font-size: spacing(2.5); +} + +.bit-pmd-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-pmd-bdy { + flex-grow: 1; + overflow-y: auto; + padding: spacing(2); + max-width: spacing(75); +} + +.bit-pmd-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/ProModal/BitProModalClassStyles.cs b/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProModal/BitProModalClassStyles.cs new file mode 100644 index 0000000000..39568f6b77 --- /dev/null +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProModal/BitProModalClassStyles.cs @@ -0,0 +1,34 @@ +namespace Bit.BlazorUI; + +public class BitProModalClassStyles : BitModalClassStyles +{ + /// + /// Custom CSS classes/styles for the header container of the BitProModal. + /// + public string? HeaderContainer { get; set; } + + /// + /// Custom CSS classes/styles for the header of the BitProModal. + /// + public string? Header { get; set; } + + /// + /// Custom CSS classes/styles for the close button of the BitProModal. + /// + public string? CloseButton { get; set; } + + /// + /// Custom CSS classes/styles for the close button of the BitProModal. + /// + public string? CloseIcon { get; set; } + + /// + /// Custom CSS classes/styles for the body of the BitProModal. + /// + public string? Body { get; set; } + + /// + /// Custom CSS classes/styles for the footer of the BitProModal. + /// + public string? Footer { get; set; } +} diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.razor.cs b/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.razor.cs index cc7b077732..69d36664af 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.razor.cs +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/ProPanel/BitProPanel.razor.cs @@ -8,14 +8,14 @@ public partial class BitProPanel : BitComponentBase [Parameter] public bool AutoToggleScroll { get; set; } /// - /// The alias of the ChildContent. + /// Whether the panel can be dismissed by clicking outside of it on the overlay. /// - [Parameter] public RenderFragment? Body { get; set; } + [Parameter] public bool Blocking { get; set; } /// - /// Whether the panel can be dismissed by clicking outside of it on the overlay. + /// The alias of the ChildContent. /// - [Parameter] public bool Blocking { get; set; } + [Parameter] public RenderFragment? Body { get; set; } /// /// The content of the panel. @@ -56,7 +56,8 @@ public partial class BitProPanel : BitComponentBase /// /// Renders the overlay in full mode that gives it an opaque background. /// - [Parameter] public bool ModeFull { get; set; } + [Parameter, ResetClassBuilder] + public bool ModeFull { get; set; } /// /// Removes the overlay element of the panel. diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Styles/components.scss b/src/BlazorUI/Bit.BlazorUI.Extras/Styles/components.scss index ca46bd9aef..686e6e4d58 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/Styles/components.scss +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Styles/components.scss @@ -1,4 +1,5 @@ @import "../Components/DataGrid/BitDataGrid.scss"; @import "../Components/DataGrid/Pagination/BitDataGridPaginator.scss"; @import "../Components/PdfReader/BitPdfReader.scss"; +@import "../Components/ProModal/BitProModal.scss"; @import "../Components/ProPanel/BitProPanel.scss"; diff --git a/src/BlazorUI/Bit.BlazorUI.Tests/Components/Surfaces/Modal/BitModalTests.cs b/src/BlazorUI/Bit.BlazorUI.Tests/Components/Surfaces/Modal/BitModalTests.cs index eb3b8ed478..950c89e54c 100644 --- a/src/BlazorUI/Bit.BlazorUI.Tests/Components/Surfaces/Modal/BitModalTests.cs +++ b/src/BlazorUI/Bit.BlazorUI.Tests/Components/Surfaces/Modal/BitModalTests.cs @@ -17,7 +17,7 @@ public void BitModalIsAlertTest(bool? isAlert) { var com = RenderComponent(parameters => { - parameters.Add(p => p.IsAlert, isAlert); + parameters.Add(p => p.Alert, isAlert); parameters.Add(p => p.IsOpen, true); }); @@ -82,64 +82,6 @@ public void BitModalIsOpenTest(bool isOpen) Assert.AreEqual(isOpen ? 1 : 0, bitModel.Count); } - [DataTestMethod, - DataRow(null), - DataRow(""), - DataRow("Test-S-A-Id") - ] - public void BitModalSubtitleAriaIdTest(string subtitleAriaId) - { - var com = RenderComponent(parameters => - { - parameters.Add(p => p.SubtitleAriaId, subtitleAriaId); - parameters.Add(p => p.IsOpen, true); - }); - - var element = com.Find(".bit-mdl"); - - 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 BitModalTitleAriaIdTest(string titleAriaId) - { - var com = RenderComponent(parameters => - { - parameters.Add(p => p.TitleAriaId, titleAriaId); - parameters.Add(p => p.IsOpen, true); - }); - - var element = com.Find(".bit-mdl"); - - 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 BitModalContentTest() { diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Dialog/BitDialog.razor.cs b/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Dialog/BitDialog.razor.cs index 5ae699aba7..da8c189047 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Dialog/BitDialog.razor.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Dialog/BitDialog.razor.cs @@ -217,16 +217,16 @@ protected override async Task OnAfterRenderAsync(bool firstRender) { if (IsDraggable) { - _ = _js.BitModalSetupDragDrop(_containerId, GetDragElementSelector()); + _ = _js.DragDropsSetup(_containerId, GetDragElementSelector()); } else { - _ = _js.BitModalRemoveDragDrop(_containerId, GetDragElementSelector()); + _ = _js.DragDropsRemove(_containerId, GetDragElementSelector()); } } else { - _ = _js.BitModalRemoveDragDrop(_containerId, GetDragElementSelector()); + _ = _js.DragDropsRemove(_containerId, GetDragElementSelector()); } _offsetTop = 0; @@ -329,7 +329,7 @@ protected virtual async ValueTask DisposeAsync(bool disposing) try { - await _js.BitModalRemoveDragDrop(_containerId, GetDragElementSelector()); + await _js.DragDropsRemove(_containerId, GetDragElementSelector()); } catch (JSDisconnectedException) { } // we can ignore this exception here diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Dialog/BitDialog.scss b/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Dialog/BitDialog.scss index a91c080711..85e6aa8966 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Dialog/BitDialog.scss +++ b/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Dialog/BitDialog.scss @@ -21,14 +21,6 @@ } } -.bit-dlg-nta { - touch-action: none; - - * { - touch-action: none; - } -} - .bit-dlg-abs { z-index: unset; position: absolute; diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModal.razor b/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModal.razor index e9638db9a2..42222bcfd8 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModal.razor +++ b/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModal.razor @@ -8,8 +8,6 @@ style="@StyleBuilder.Value" class="@ClassBuilder.Value" dir="@ModalParameters.Dir?.ToString().ToLower()" - aria-labelledby="@ModalParameters.TitleAriaId" - aria-describedby="@ModalParameters.SubtitleAriaId" aria-modal="@((ModalParameters.Modeless is false).ToString().ToLower())" role="@GetRole()"> @if (ModalParameters.Modeless is false) diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModal.razor.cs b/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModal.razor.cs index c19d8f49bb..6326f03afa 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModal.razor.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModal.razor.cs @@ -16,10 +16,6 @@ public partial class BitModal : BitComponentBase, IAsyncDisposable private BitModalParameters modalParameters = new(); - /// - /// Enables the auto scrollbar toggle behavior of the Modal. - /// - [Parameter] public bool AutoToggleScroll { get; set; } /// /// When true, the Modal will be positioned absolute instead of fixed. @@ -27,6 +23,16 @@ public partial class BitModal : BitComponentBase, IAsyncDisposable [Parameter, ResetClassBuilder] public bool AbsolutePosition { get; set; } + /// + /// Determines the ARIA role of the Modal (alertdialog/dialog). If this is set, it will override the ARIA role determined by Blocking and Modeless. + /// + [Parameter] public bool? Alert { get; set; } + + /// + /// Enables the auto scrollbar toggle behavior of the Modal. + /// + [Parameter] public bool AutoToggleScroll { get; set; } + /// /// Whether the Modal can be light dismissed by clicking outside the Modal (on the overlay). /// @@ -52,29 +58,6 @@ public partial class BitModal : BitComponentBase, IAsyncDisposable /// [Parameter] public bool Draggable { get; set; } - /// - /// Makes the Modal height 100% of its parent container. - /// - [Parameter, ResetClassBuilder] - public bool FullHeight { get; set; } - - /// - /// Makes the Modal width and height 100% of its parent container. - /// - [Parameter, ResetClassBuilder] - public bool FullSize { get; set; } - - /// - /// Makes the Modal width 100% of its parent container. - /// - [Parameter, ResetClassBuilder] - public bool FullWidth { get; set; } - - /// - /// Determines the ARIA role of the Modal (alertdialog/dialog). If this is set, it will override the ARIA role determined by Blocking and Modeless. - /// - [Parameter] public bool? IsAlert { get; set; } - /// /// Whether the Modal is displayed. /// @@ -112,16 +95,6 @@ public partial class BitModal : BitComponentBase, IAsyncDisposable /// [Parameter] public BitModalClassStyles? Styles { get; set; } - /// - /// ARIA id for the subtitle of the Modal, if any. - /// - [Parameter] public string? SubtitleAriaId { get; set; } - - /// - /// ARIA id for the title of the Modal, if any. - /// - [Parameter] public string? TitleAriaId { get; set; } - protected override string RootElementClass => "bit-mdl"; @@ -133,9 +106,6 @@ protected override void RegisterCssClasses() ClassBuilder.Register(() => ModalParameters.AbsolutePosition ? "bit-mdl-abs" : string.Empty); - ClassBuilder.Register(() => ModalParameters.FullSize || ModalParameters.FullHeight ? "bit-mdl-fhe" : string.Empty); - ClassBuilder.Register(() => ModalParameters.FullSize || ModalParameters.FullWidth ? "bit-mdl-fwi" : string.Empty); - ClassBuilder.Register(() => ModalParameters.Position switch { BitPosition.Center => "bit-mdl-ctr", @@ -179,16 +149,16 @@ protected override async Task OnAfterRenderAsync(bool firstRender) { if (ModalParameters.Draggable) { - _ = _js.BitModalSetupDragDrop(_containerId, GetDragElementSelector()); + _ = _js.DragDropsSetup(_containerId, GetDragElementSelector()); } else { - _ = _js.BitModalRemoveDragDrop(_containerId, GetDragElementSelector()); + _ = _js.DragDropsRemove(_containerId, GetDragElementSelector()); } } else { - _ = _js.BitModalRemoveDragDrop(_containerId, GetDragElementSelector()); + _ = _js.DragDropsRemove(_containerId, GetDragElementSelector()); } _offsetTop = 0; @@ -225,7 +195,7 @@ private string GetDragElementSelector() private string GetRole() { - return (ModalParameters.IsAlert ?? (ModalParameters.Blocking && ModalParameters.Modeless is false)) ? "alertdialog" : "dialog"; + return (ModalParameters.Alert ?? (ModalParameters.Blocking && ModalParameters.Modeless is false)) ? "alertdialog" : "dialog"; } private async Task ToggleScroll(bool isOpen) @@ -250,7 +220,7 @@ protected virtual async ValueTask DisposeAsync(bool disposing) try { await ToggleScroll(false); - await _js.BitModalRemoveDragDrop(_containerId, GetDragElementSelector()); + await _js.DragDropsRemove(_containerId, GetDragElementSelector()); } catch (JSDisconnectedException) { } // we can ignore this exception here diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModal.scss b/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModal.scss index 370c4664f5..9b76c851cf 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModal.scss +++ b/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModal.scss @@ -19,14 +19,6 @@ transition: opacity 300ms ease 0s; } -.bit-mdl-nta { - touch-action: none; - - * { - touch-action: none; - } -} - .bit-mdl-abs { z-index: unset; position: absolute; @@ -36,7 +28,6 @@ inset: 0; z-index: 0; position: absolute; - background-color: $clr-bg-overlay; } .bit-mdl-ctn { diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModalJsRuntimeExtensions.cs b/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModalJsRuntimeExtensions.cs deleted file mode 100644 index 4bbdb16006..0000000000 --- a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModalJsRuntimeExtensions.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Bit.BlazorUI; - -internal static class BitModalJsRuntimeExtensions -{ - internal static ValueTask BitModalSetupDragDrop(this IJSRuntime js, string id, string dragElementSelector) - { - return js.InvokeVoid("BitBlazorUI.Modal.setupDragDrop", id, dragElementSelector); - } - - internal static ValueTask BitModalRemoveDragDrop(this IJSRuntime js, string id, string dragElementSelector) - { - return js.InvokeVoid("BitBlazorUI.Modal.removeDragDrop", id, dragElementSelector); - } -} diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModalParameters.cs b/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModalParameters.cs index e9cd0da410..c54074c5d5 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModalParameters.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModalParameters.cs @@ -21,13 +21,7 @@ public class BitModalParameters public bool Draggable { get { return _modal?.Draggable ?? field; } set; } - public bool FullHeight { get { return _modal?.FullHeight ?? field; } set; } - - public bool FullSize { get { return _modal?.FullSize ?? field; } set; } - - public bool FullWidth { get { return _modal?.FullWidth ?? field; } set; } - - public bool? IsAlert { get { return _modal?.IsAlert ?? field; } set; } + public bool? Alert { get { return _modal?.Alert ?? field; } set; } public bool Modeless { get { return _modal?.Modeless ?? field; } set; } @@ -63,10 +57,6 @@ public EventCallback OnOverlayClick public BitModalClassStyles? Styles { get; set; } - public string? SubtitleAriaId { get { return _modal?.SubtitleAriaId ?? field; } set; } - - public string? TitleAriaId { get { return _modal?.TitleAriaId ?? field; } set; } - private BitModal? _modal; public void SetModal(BitModal modal) @@ -94,10 +84,7 @@ public void SetModal(BitModal modal) Classes = BitModalClassStyles.Merge(params1.Classes, params2.Classes), DragElementSelector = params1.DragElementSelector ?? params2.DragElementSelector, Draggable = params1.Draggable || params2.Draggable, - FullHeight = params1.FullHeight || params2.FullHeight, - FullSize = params1.FullSize || params2.FullSize, - FullWidth = params1.FullWidth || params2.FullWidth, - IsAlert = params1.IsAlert ?? params2.IsAlert, + Alert = params1.Alert ?? params2.Alert, Modeless = params1.Modeless || params2.Modeless, OnDismiss = EventCallback.Factory.Create(new object(), async () => { @@ -112,8 +99,6 @@ public void SetModal(BitModal modal) Position = params1.Position ?? params2.Position, ScrollerSelector = params1.ScrollerSelector ?? params2.ScrollerSelector, Styles = BitModalClassStyles.Merge(params1.Styles, params2.Styles), - SubtitleAriaId = params1.SubtitleAriaId ?? params2.SubtitleAriaId, - TitleAriaId = params1.TitleAriaId ?? params2.TitleAriaId, }; } } diff --git a/src/BlazorUI/Bit.BlazorUI/Extensions/JsInterop/DragDropsJsRuntimeExtensions.cs b/src/BlazorUI/Bit.BlazorUI/Extensions/JsInterop/DragDropsJsRuntimeExtensions.cs new file mode 100644 index 0000000000..c6c9d53a6c --- /dev/null +++ b/src/BlazorUI/Bit.BlazorUI/Extensions/JsInterop/DragDropsJsRuntimeExtensions.cs @@ -0,0 +1,14 @@ +namespace Bit.BlazorUI; + +internal static class DragDropsJsRuntimeExtensions +{ + internal static ValueTask DragDropsSetup(this IJSRuntime js, string id, string dragElementSelector) + { + return js.InvokeVoid("BitBlazorUI.DragDrops.setup", id, dragElementSelector); + } + + internal static ValueTask DragDropsRemove(this IJSRuntime js, string id, string dragElementSelector) + { + return js.InvokeVoid("BitBlazorUI.DragDrops.remove", id, dragElementSelector); + } +} diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModal.ts b/src/BlazorUI/Bit.BlazorUI/Scripts/DragDrop.ts similarity index 79% rename from src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModal.ts rename to src/BlazorUI/Bit.BlazorUI/Scripts/DragDrop.ts index c07eaf45c3..862567560d 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Surfaces/Modal/BitModal.ts +++ b/src/BlazorUI/Bit.BlazorUI/Scripts/DragDrop.ts @@ -1,14 +1,17 @@ namespace BitBlazorUI { - export class Modal { + export class DragDrops { private static _dragDropListeners: any = {}; - public static setupDragDrop(containerId: string, dragElementSelector: string) { - Modal.removeDragDrop(containerId, dragElementSelector); + public static setup(id: string, dragElementSelector: string) { + DragDrops.remove(id, dragElementSelector); const listeners: any = {}; - Modal._dragDropListeners[containerId] = listeners; + DragDrops._dragDropListeners[id] = listeners; - const element = document.getElementById(containerId)! as HTMLElement; - const dragElement = document.querySelector(dragElementSelector)! as HTMLElement; + const element = document.getElementById(id) as HTMLElement; + if (!element) return; + + const dragElement = document.querySelector(dragElementSelector) as HTMLElement; + if (!dragElement) return; let x = 0; let y = 0; @@ -16,7 +19,7 @@ listeners['pointerdown'] = handlePointerDown; dragElement.addEventListener('pointerdown', handlePointerDown); dragElement.style.cursor = 'move'; - dragElement.classList.add('bit-mdl-nta'); + dragElement.classList.add('bit-nta'); function handlePointerDown(e: PointerEvent) { //e.preventDefault(); @@ -55,15 +58,15 @@ } } - public static removeDragDrop(id: string, dragElementSelector: string) { - const listeners = Modal._dragDropListeners[id]; + public static remove(id: string, dragElementSelector: string) { + const listeners = DragDrops._dragDropListeners[id]; if (!listeners) return; const dragElement = document.querySelector(dragElementSelector)! as HTMLElement; dragElement.removeEventListener('pointerdown', listeners['pointerdown']); dragElement.style.cursor = ''; - dragElement.classList.remove('bit-mdl-nta'); + dragElement.classList.remove('bit-nta'); document.removeEventListener('pointermove', listeners['pointermove']); @@ -74,7 +77,7 @@ delete listeners['pointerdown']; delete listeners['pointermove']; delete listeners['pointerup']; - delete Modal._dragDropListeners[id]; + delete DragDrops._dragDropListeners[id]; } } } diff --git a/src/BlazorUI/Bit.BlazorUI/Styles/functions.scss b/src/BlazorUI/Bit.BlazorUI/Styles/functions.scss index feee193b9f..e39212f8dc 100644 --- a/src/BlazorUI/Bit.BlazorUI/Styles/functions.scss +++ b/src/BlazorUI/Bit.BlazorUI/Styles/functions.scss @@ -3,18 +3,6 @@ $html-font-size: 16px; -@function stripUnit($value) { - @return math.div($value, ($value * 0 + 1)); -} - -@function em2($pxValue, $base-font-size: $html-font-size) { - @return #{calc(stripUnit($pxValue) / stripUnit($base-font-size))}em; -} - -@function rem2($pxValue) { - @return #{calc(stripUnit($pxValue) / stripUnit($html-font-size))}rem; -} - @function spacing($spacingValue) { @return calc($spacing-scaling-factor * $spacingValue); } diff --git a/src/BlazorUI/Bit.BlazorUI/Styles/general.scss b/src/BlazorUI/Bit.BlazorUI/Styles/general.scss index 09ae31d958..34cbd760b3 100644 --- a/src/BlazorUI/Bit.BlazorUI/Styles/general.scss +++ b/src/BlazorUI/Bit.BlazorUI/Styles/general.scss @@ -9,7 +9,16 @@ button { outline: none; } -// Prevent text selection by user +// none touch action +.bit-nta { + touch-action: none; + + * { + touch-action: none; + } +} + +// none text selection .bit-nts { user-select: none; -ms-user-select: none; diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/ComponentDemo.razor b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/ComponentDemo.razor index ffef99e155..395ca784f1 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/ComponentDemo.razor +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/ComponentDemo.razor @@ -5,21 +5,35 @@ @ComponentName
- @ComponentDescription + @if (DescriptionTemplate is not null) + { + @DescriptionTemplate + } + else + { + @ComponentDescription + }
- @if (Notes.HasValue()) + @if (NotesTemplate is not null || Notes.HasValue()) {
Notes - @Notes + @if (NotesTemplate is not null) + { + @NotesTemplate + } + else + { + @Notes + }
}
Usage - @ChildContent + @(Body ?? ChildContent)
diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/ComponentDemo.razor.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/ComponentDemo.razor.cs index 0491a6bfe9..9e03e60774 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/ComponentDemo.razor.cs +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/ComponentDemo.razor.cs @@ -5,6 +5,9 @@ public partial class ComponentDemo [Parameter] public string ComponentName { get; set; } = default!; [Parameter] public string? ComponentDescription { get; set; } [Parameter] public string? Notes { get; set; } + [Parameter] public RenderFragment? DescriptionTemplate { get; set; } + [Parameter] public RenderFragment? NotesTemplate { get; set; } + [Parameter] public RenderFragment? Body { get; set; } [Parameter] public RenderFragment? ChildContent { get; set; } [Parameter] public List ComponentParameters { get; set; } = []; [Parameter] public List ComponentSubClasses { get; set; } = []; diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProModal/BitProModalDemo.razor b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProModal/BitProModalDemo.razor new file mode 100644 index 0000000000..0b8973d133 --- /dev/null +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProModal/BitProModalDemo.razor @@ -0,0 +1,478 @@ +@page "/components/promodal" + + + + + + The BitProPanel is the advanced version of the BitModal component. + + + + + Open ProModal + + 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. + + + + + + + Open ProModal with HeaderText + + 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. + +

+ Open ProModal with Header + +
+
+
BitProModal with Header
+ +
+
+ + 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. + +
+



+ Open ProModal with FooterText + + 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. + +

+ Open ProModal with Footer + + + 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. + +
+

BitProModal with Footer

+ Save + Close +
+
+
+
+ + + +
BitProModal has some advanced options to be customized.
+

+ Open ProModal with ShowCloseButton + + 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. + +

+ Open ProModal with 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. + +

+ Open ProModal with 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. 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. + +

+ Open ProModal with ModeFull + + 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. + +

+ Open ProModal with 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. 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. + +

+ Open ProModal with NoBorder + + 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. + +
+
+ + + +
BitProModal has size related parameters to make it occupy available screen width/height or both.
+

+ Open ProModal with FullSize + + 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. + 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. +
+ +
+

+ Open ProModal with FullWidth + + 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. + 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. +
+ +
+

+ Open ProModal with FullHeight + + 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. + 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. +
+ +
+
+
+ + + +
BitProModal has an absolute position option to further customize its location.

+ Open Modal +

+ Open Modal (AutoToggleScroll & ScrollerSelector) +

+ +
+
+ + + +
To set the ProModal position on the page you can use the Position parameter.

+
+
+ Top Left + Top Center + Top Right +
+
+ Center Left + Center + Center Right +
+
+ Bottom Left + Bottom Center + Bottom Right +
+
+ +
+ Position: @position +
+ + 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. + +
+
+
+ + + +
The Draggable parameter of the BitProModal allows users to move the modal around the screen.

+ Open Modal + +
+

Draggable

+ 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. +
+
+



+
Using custom drag element:

+ Open Modal + +
+ + 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. +
+
+
+
+ + + +
+
Using css related parameter users can further customize the modal based on their needs.
+

+
Component's Style & Class:

+ Open styled modal + +
+

Styled modal

+ 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. +
+
+

+ Open classed modal + +
+

Classed modal

+ 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. +
+
+ +



+ +
Styles & Classes:

+ Open modal Styles + +
+

Modal with Styles

+ 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. +
+
+

+ Open modal Classes + +
+

Modal with Classes

+ 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. +
+
+
+
+
+ + + +
Use BitProModal in right-to-left (RTL).

+ باز کردن مُدال + +
+

مدال راست به چپ

+ لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است. + چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی مورد نیاز و کاربردهای متنوع با هدف بهبود ابزارهای کاربردی می باشد. + کتابهای زیادی در شصت و سه درصد گذشته، حال و آینده شناخت فراوان جامعه و متخصصان را می طلبد تا با نرم افزارها شناخت بیشتری را برای طراحان رایانه ای علی الخصوص طراحان خلاقی و فرهنگ پیشرو در زبان فارسی ایجاد کرد. + در این صورت می توان امید داشت که تمام و دشواری موجود در ارائه راهکارها و شرایط سخت تایپ به پایان رسد وزمان مورد نیاز شامل حروفچینی دستاوردهای اصلی و جوابگوی سوالات پیوسته اهل دنیای موجود طراحی اساسا مورد استفاده قرار گیرد. +
+
+
+
+ +
diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProModal/BitProModalDemo.razor.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProModal/BitProModalDemo.razor.cs new file mode 100644 index 0000000000..e0cf8ba5ec --- /dev/null +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProModal/BitProModalDemo.razor.cs @@ -0,0 +1,401 @@ +namespace Bit.BlazorUI.Demo.Client.Core.Pages.Components.Extras.ProModal; + +public partial class BitProModalDemo +{ + private readonly List componentParameters = + [ + new() + { + Name = "AbsolutePosition", + Type = "bool", + DefaultValue = "false", + Description = "When true, the Modal will be positioned absolute instead of fixed.", + }, + new() + { + Name = "Alert", + Type = "bool?", + DefaultValue = "null", + Description = "Determines the ARIA role of the Modal (alertdialog/dialog). If this is set, it will override the ARIA role determined by Blocking and Modeless.", + }, + new() + { + Name = "AutoToggleScroll", + Type = "bool", + DefaultValue = "false", + Description = "Enables the auto scrollbar toggle behavior of the Modal.", + }, + new() + { + Name = "Blocking", + Type = "bool", + DefaultValue = "false", + Description = "Whether the Modal can be light dismissed by clicking outside the Modal (on the overlay).", + }, + new() + { + Name = "ChildContent", + Type = "RenderFragment?", + DefaultValue = "null", + Description = "The content of Modal, It can be Any custom tag or a text.", + }, + new() + { + Name = "Classes", + Type = "BitModalClassStyles?", + DefaultValue = "null", + Description = "Custom CSS classes for different parts of the BitModal component.", + LinkType = LinkType.Link, + Href = "#modal-class-styles", + }, + new() + { + Name = "DragElementSelector", + Type = "string?", + DefaultValue = "null", + Description = "The CSS selector of the drag element. by default the Modal container is the drag element.", + }, + new() + { + Name = "Draggable", + Type = "bool", + DefaultValue = "false", + Description = "Whether the Modal can be dragged around.", + }, + new() + { + Name = "FullHeight", + Type = "bool", + DefaultValue = "false", + Description = "Makes the Modal height 100% of its parent container.", + }, + new() + { + Name = "FullSize", + Type = "bool", + DefaultValue = "false", + Description = "Makes the Modal width and height 100% of its parent container.", + }, + new() + { + Name = "FullWidth", + Type = "bool", + DefaultValue = "false", + Description = "Makes the Modal width 100% of its parent container.", + }, + new() + { + Name = "IsOpen", + Type = "bool", + DefaultValue = "false", + Description = "Whether the Modal is displayed.", + }, + new() + { + Name = "Modeless", + Type = "bool", + DefaultValue = "false", + Description = "Whether the Modal should be modeless (e.g. not dismiss when focusing/clicking outside of the Modal). if true: Blocking is ignored, there will be no overlay.", + }, + new() + { + Name = "OnDismiss", + Type = "EventCallback", + Description = "A callback function for when the Modal is dismissed.", + }, + new() + { + Name = "OnOverlayClick", + Type = "EventCallback", + Description = "A callback function for when somewhere on the overlay element of the Modal is clicked.", + }, + new() + { + Name = "Position", + Type = "BitPosition?", + DefaultValue = "null", + Description = "Position of the Modal on the screen.", + LinkType = LinkType.Link, + Href = "#position-enum", + }, + new() + { + Name = "ScrollerSelector", + Type = "string", + DefaultValue = "body", + Description = "Set the element selector for which the Modal disables its scroll if applicable.", + }, + new() + { + Name = "Styles", + Type = "BitModalClassStyles?", + DefaultValue = "null", + Description = "Custom CSS styles for different parts of the BitModal component.", + LinkType = LinkType.Link, + Href = "#modal-class-styles", + } + ]; + + private readonly List componentSubClasses = + [ + new() + { + Id = "modal-class-styles", + Title = "BitModalClassStyles", + Parameters = + [ + new() + { + Name = "Root", + Type = "string?", + DefaultValue = "null", + Description = "Custom CSS classes/styles for the root element of the BitModal." + }, + new() + { + Name = "Overlay", + Type = "string?", + DefaultValue = "null", + Description = "Custom CSS classes/styles for the overlay of the BitModal." + }, + new() + { + Name = "Content", + Type = "string?", + DefaultValue = "null", + Description = "Custom CSS classes/styles for the content of the BitModal." + } + ] + } + ]; + + private readonly List componentSubEnums = + [ + new() + { + Id = "position-enum", + Name = "BitPosition", + Description = "", + Items = + [ + new() { Name = "Center", Value = "0" }, + new() { Name = "TopLeft", Value = "1" }, + new() { Name = "TopCenter", Value = "2" }, + new() { Name = "TopRight", Value = "3" }, + new() { Name = "CenterLeft", Value = "4" }, + new() { Name = "CenterRight", Value = "5" }, + new() { Name = "BottomLeft", Value = "6" }, + new() { Name = "BottomCenter", Value = "7" }, + new() { Name = "BottomRight", Value = "8" } + ] + } + ]; + + + + private bool isOpenBasic; + + private bool isProModalWithHeaderTextOpen; + private bool isProModalWithHeaderOpen; + private bool isProModalWithFooterTextOpen; + private bool isProModalWithFooterOpen; + + private bool isCloseButtonProModalOpen; + private bool isBlockingProModalOpen; + private bool isModelessProModalOpen; + private bool isModeFullProModalOpen; + private bool isAutoToggleScrollProModalOpen; + private bool isNoBorderProModalOpen; + + private bool isFullSize; + private bool isOpenFullSize; + private bool isFullWidth; + private bool isOpenFullWidth; + private bool isFullHeight; + private bool isOpenFullHeight; + + private bool isOpenAbsolutePosition; + private bool isOpenScrollerSelector; + + private bool isOpenPosition; + private BitPosition position; + private void OpenModalInPosition(BitPosition positionValue) + { + isOpenPosition = true; + position = positionValue; + } + + private bool isOpenDraggable; + private bool isOpenDraggableSelector; + + private bool isOpenStyle; + private bool isOpenClass; + private bool isOpenStyles; + private bool isOpenClasses; + + private bool isOpenRtl; + + + + private readonly string example1RazorCode = @" + isOpenBasic = true"">Open Modal + + +
+ 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. +
+
"; + private readonly string example1CsharpCode = @" +private bool isOpenBasic;"; + + private readonly string example2RazorCode = @" + isOpenBasic = true"">Open Modal + + +
+ 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. +
+
"; + private readonly string example2CsharpCode = @" +private bool isOpenBasic;"; + + private readonly string example3RazorCode = @" + isOpenBasic = true"">Open Modal + + +
+ 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. +
+
"; + private readonly string example3CsharpCode = @" +private bool isOpenBasic;"; + + private readonly string example4RazorCode = @" + isOpenBasic = true"">Open Modal + + +
+ 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. +
+
"; + private readonly string example4CsharpCode = @" +private bool isOpenBasic;"; + + private readonly string example5RazorCode = @" + isOpenBasic = true"">Open Modal + + +
+ 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. +
+
"; + private readonly string example5CsharpCode = @" +private bool isOpenBasic;"; + + private readonly string example6RazorCode = @" + isOpenBasic = true"">Open Modal + + +
+ 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. +
+
"; + private readonly string example6CsharpCode = @" +private bool isOpenBasic;"; + + private readonly string example7RazorCode = @" + isOpenBasic = true"">Open Modal + + +
+ 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. +
+
"; + private readonly string example7CsharpCode = @" +private bool isOpenBasic;"; + + private readonly string example8RazorCode = @" + isOpenBasic = true"">Open Modal + + +
+ 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. +
+
"; + private readonly string example8CsharpCode = @" +private bool isOpenBasic;"; + + private readonly string example9RazorCode = @" + isOpenBasic = true"">Open Modal + + +
+ 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. +
+
"; + private readonly string example9CsharpCode = @" +private bool isOpenBasic;"; +} diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProModal/BitProModalDemo.razor.scss b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProModal/BitProModalDemo.razor.scss new file mode 100644 index 0000000000..a9d42776c2 --- /dev/null +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProModal/BitProModalDemo.razor.scss @@ -0,0 +1,45 @@ +.relative-container { + width: 100%; + height: 400px; + overflow: auto; + margin-top: 1rem; + position: relative; + border: 2px lightgreen solid; +} + +.position-btn-container { + gap: 1rem; + display: flex; + flex-flow: column nowrap; + + div { + display: flex; + justify-content: space-between; + } +} + +::deep { + .position-button { + width: 130px; + } + + .custom-class { + border: 0.5rem solid tomato; + background-color: darkgoldenrod; + } + + .custom-root { + border: 0.25rem solid #0054C6; + } + + .custom-overlay { + background-color: #ffbd5a66; + } + + .custom-content { + margin: 1rem; + box-shadow: 0 0 10rem purple; + border-end-end-radius: 1rem; + border-end-start-radius: 1rem; + } +} diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProPanel/BitProPanelDemo.razor b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProPanel/BitProPanelDemo.razor index afd142cdd1..3a16b05cc9 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProPanel/BitProPanelDemo.razor +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProPanel/BitProPanelDemo.razor @@ -101,8 +101,7 @@ -
BitProPanel has some advanced options to be customized.
-

+
BitProPanel has some advanced options to be customized.

Open ProPanel with ShowCloseButton
@@ -111,7 +110,7 @@ sagittis nunc, ut interdum ipsum vestibulum non.
-


+
Open ProPanel with Blocking
@@ -120,7 +119,7 @@ sagittis nunc, ut interdum ipsum vestibulum non.
-


+
Open ProPanel with Modeless
@@ -129,7 +128,7 @@ sagittis nunc, ut interdum ipsum vestibulum non.
-


+
Open ProPanel with ModeFull
@@ -138,7 +137,7 @@ sagittis nunc, ut interdum ipsum vestibulum non.
-


+
Open ProPanel with AutoToggleScroll
diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProPanel/BitProPanelDemo.razor.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProPanel/BitProPanelDemo.razor.cs index 7cac770d07..89b8f9e7a1 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProPanel/BitProPanelDemo.razor.cs +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Extras/ProPanel/BitProPanelDemo.razor.cs @@ -12,13 +12,6 @@ public partial class BitProPanelDemo Description = "Enables the auto scrollbar toggle behavior of the panel.", }, new() - { - Name = "Body", - Type = "RenderFragment?", - DefaultValue = "null", - Description = "The alias of the ChildContent.", - }, - new() { Name = "Blocking", Type = "bool", @@ -26,6 +19,13 @@ public partial class BitProPanelDemo Description = "Whether the panel can be dismissed by clicking outside of it on the overlay.", }, new() + { + Name = "Body", + Type = "RenderFragment?", + DefaultValue = "null", + Description = "The alias of the ChildContent.", + }, + new() { Name = "ChildContent", Type = "RenderFragment?", diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Modal/BitModalDemo.razor b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Modal/BitModalDemo.razor index 683e56b935..c5e7190147 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Modal/BitModalDemo.razor +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Surfaces/Modal/BitModalDemo.razor @@ -13,7 +13,7 @@ Open Modal -
+
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 @@ -27,64 +27,68 @@ - + - Open Modal - -