-
-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9659 from bitfoundation/develop
Version 9.3.0 (#9655)
- Loading branch information
Showing
208 changed files
with
1,597 additions
and
468 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/BlazorUI/Bit.BlazorUI.Extras/Components/AppShell/BitAppShell.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/BlazorUI/Bit.BlazorUI.Extras/Components/DataGrid/BitDataGrid.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/BlazorUI/Bit.BlazorUI.Extras/Components/ErrorBoundary/BitErrorBoundary.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
@namespace Bit.BlazorUI | ||
@inherits ErrorBoundaryBase | ||
|
||
@if (CurrentException is null) | ||
{ | ||
@(Body ?? ChildContent) | ||
} | ||
else if (ErrorContent is not null) | ||
{ | ||
@ErrorContent(CurrentException) | ||
} | ||
else | ||
{ | ||
<div class="bit-erb"> | ||
<svg width="64" height="64" viewBox="0 0 64 64" fill="none"> | ||
<path d="M30.268 3C31.0378 1.66666 32.9622 1.66667 33.7321 3L57.9808 45C58.7506 46.3333 57.7883 48 56.2487 48H7.75129C6.21169 48 5.24944 46.3333 6.01924 45L30.268 3Z" fill="#FFDAD4" /> | ||
<path d="M29.0025 24C29.0025 22.8954 29.8979 22 31.0025 22H32C33.1046 22 34 22.8954 34 24V32.5C34 33.6046 33.1046 34.5 32 34.5H31.0025C29.8979 34.5 29.0025 33.6046 29.0025 32.5V24ZM29 39C29 37.8954 29.8954 37 31 37H31.9975C33.1021 37 33.9975 37.8954 33.9975 39V40C33.9975 41.1046 33.1021 42 31.9975 42H31C29.8954 42 29 41.1046 29 40V39Z" fill="#A4262C" /> | ||
</svg> | ||
|
||
<BitText Color="BitColor.Error" Typography="BitTypography.H3"> | ||
@(Title ?? "Oops, Something went wrong...") | ||
</BitText> | ||
|
||
@if (ShowException) | ||
{ | ||
<div class="bit-erb-exp"> | ||
@CurrentException?.ToString() | ||
</div> | ||
} | ||
|
||
@if (Footer is not null) | ||
{ | ||
@Footer | ||
} | ||
else | ||
{ | ||
<div class="bit-erb-ftr"> | ||
<BitButton OnClick="Refresh">@(RefreshText ?? "Refresh")</BitButton> | ||
<BitButton OnClick="GoHome" Variant="BitVariant.Outline">@(HomeText ?? "Home")</BitButton> | ||
<BitButton OnClick="Recover" Variant="BitVariant.Outline">@(RecoverText ?? "Recover")</BitButton> | ||
@if (AdditionalButtons is not null) | ||
{ | ||
@AdditionalButtons | ||
} | ||
</div> | ||
} | ||
</div> | ||
} |
80 changes: 80 additions & 0 deletions
80
src/BlazorUI/Bit.BlazorUI.Extras/Components/ErrorBoundary/BitErrorBoundary.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
namespace Bit.BlazorUI; | ||
|
||
/// <summary> | ||
/// BitErrorBoundary is a simple error boundary to handle exceptions happening in its children. | ||
/// </summary> | ||
public partial class BitErrorBoundary : ErrorBoundaryBase | ||
{ | ||
[Inject] private NavigationManager _navigationManager { get; set; } = default!; | ||
|
||
|
||
|
||
/// <summary> | ||
/// The footer content of the boundary. | ||
/// </summary> | ||
[Parameter] public RenderFragment? AdditionalButtons { get; set; } | ||
|
||
/// <summary> | ||
/// Alias of the ChildContent. | ||
/// </summary> | ||
[Parameter] public RenderFragment? Body { get; set; } | ||
|
||
/// <summary> | ||
/// The footer content of the boundary. | ||
/// </summary> | ||
[Parameter] public RenderFragment? Footer { get; set; } | ||
|
||
/// <summary> | ||
/// The text of the Home button. | ||
/// </summary> | ||
[Parameter] public string? HomeText { get; set; } | ||
|
||
/// <summary> | ||
/// The url of the home page for the Home button. | ||
/// </summary> | ||
[Parameter] public string? HomeUrl { get; set; } | ||
|
||
/// <summary> | ||
/// The callback for when an error get caught by the boundary. | ||
/// </summary> | ||
[Parameter] public EventCallback<Exception> OnError { get; set; } | ||
|
||
/// <summary> | ||
/// The text of the Recover button. | ||
/// </summary> | ||
[Parameter] public string? RecoverText { get; set; } | ||
|
||
/// <summary> | ||
/// The text of the Refresh button. | ||
/// </summary> | ||
[Parameter] public string? RefreshText { get; set; } | ||
|
||
/// <summary> | ||
/// Whether the actual exception information should be shown or not. | ||
/// </summary> | ||
[Parameter] public bool ShowException { get; set; } | ||
|
||
/// <summary> | ||
/// The header title of the boundary. | ||
/// </summary> | ||
[Parameter] public string? Title { get; set; } | ||
|
||
|
||
|
||
protected override async Task OnErrorAsync(Exception exception) | ||
{ | ||
await OnError.InvokeAsync(exception); | ||
} | ||
|
||
|
||
|
||
private void Refresh() | ||
{ | ||
_navigationManager.Refresh(forceReload: true); | ||
} | ||
|
||
private void GoHome() | ||
{ | ||
_navigationManager.NavigateTo(HomeUrl ?? "/", forceLoad: true); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/BlazorUI/Bit.BlazorUI.Extras/Components/ErrorBoundary/BitErrorBoundary.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@import '../../../Bit.BlazorUI/Styles/functions.scss'; | ||
|
||
.bit-erb { | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
gap: spacing(2); | ||
align-items: center; | ||
box-sizing: border-box; | ||
flex-direction: column; | ||
justify-content: center; | ||
background-color: $clr-bg-pri; | ||
} | ||
|
||
.bit-erb-exp { | ||
width: 90%; | ||
overflow: auto; | ||
white-space: pre; | ||
text-align: start; | ||
margin: spacing(3); | ||
} | ||
|
||
.bit-erb-ftr { | ||
width: 100%; | ||
display: flex; | ||
gap: spacing(2); | ||
align-items: center; | ||
box-sizing: border-box; | ||
justify-content: center; | ||
} |
36 changes: 36 additions & 0 deletions
36
src/BlazorUI/Bit.BlazorUI.Extras/Components/MessageBox/BitMessageBox.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
@namespace Bit.BlazorUI | ||
|
||
<div style="@Styles?.Root" class="bit-msb @Classes?.Root"> | ||
<div style="@Styles?.Container" class="bit-msb-con @Classes?.Container"> | ||
<div style="@Styles?.Header" class="bit-msb-hdr @Classes?.Header"> | ||
<BitText Typography="BitTypography.H5" | ||
Color="BitColor.Tertiary" | ||
Style="@(Styles?.Title)" | ||
Class="@(Classes?.Title)"> | ||
@Title | ||
</BitText> | ||
|
||
<BitSpacer Style="@(Styles?.Spacer)" Class="@(Classes?.Spacer)" /> | ||
|
||
<BitButton OnClick="CloseModal" | ||
IconName="ChromeClose" | ||
Color="BitColor.Tertiary" | ||
Variant="BitVariant.Text" | ||
Styles="@Styles?.CloseButton" | ||
Classes="@Classes?.CloseButton" /> | ||
</div> | ||
|
||
<div style="@Styles?.Body" class="bit-msb-bdy @Classes?.Body"> | ||
@Body | ||
</div> | ||
|
||
<div style="@Styles?.Footer" class="bit-msb-ftr @Classes?.Footer"> | ||
<BitButton OnClick="OnOkClick" | ||
Color="BitColor.Tertiary" | ||
Styles="@Styles?.OkButton" | ||
Classes="@Classes?.OkButton"> | ||
@(OkText ?? "Ok") | ||
</BitButton> | ||
</div> | ||
</div> | ||
</div> |
51 changes: 51 additions & 0 deletions
51
src/BlazorUI/Bit.BlazorUI.Extras/Components/MessageBox/BitMessageBox.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System.Reflection.Metadata; | ||
|
||
namespace Bit.BlazorUI; | ||
|
||
/// <summary> | ||
/// BitMessageBox is a pre-implemented box for showing messages with title and body. | ||
/// </summary> | ||
public partial class BitMessageBox | ||
{ | ||
/// <summary> | ||
/// The body of the message box. | ||
/// </summary> | ||
[Parameter] public string? Body { get; set; } | ||
|
||
/// <summary> | ||
/// Custom CSS classes for different parts of the message box. | ||
/// </summary> | ||
[Parameter] public BitMessageBoxClassStyles? Classes { get; set; } | ||
|
||
/// <summary> | ||
/// The text of the Ok button. | ||
/// </summary> | ||
[Parameter] public string? OkText { get; set; } | ||
|
||
/// <summary> | ||
/// The event callback for closing the message box. | ||
/// </summary> | ||
[Parameter] public EventCallback OnClose { get; set; } | ||
|
||
/// <summary> | ||
/// Custom CSS styles for different parts of the message box. | ||
/// </summary> | ||
[Parameter] public BitMessageBoxClassStyles? Styles { get; set; } | ||
|
||
/// <summary> | ||
/// The title of the message box. | ||
/// </summary> | ||
[Parameter] public string? Title { get; set; } | ||
|
||
|
||
|
||
private async Task CloseModal() | ||
{ | ||
await OnClose.InvokeAsync(); | ||
} | ||
|
||
private async Task OnOkClick() | ||
{ | ||
await OnClose.InvokeAsync(); | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
src/BlazorUI/Bit.BlazorUI.Extras/Components/MessageBox/BitMessageBox.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
@import "../../Styles/extra-variables.scss"; | ||
@import "../../../Bit.BlazorUI/Styles/functions.scss"; | ||
@import "../../../Bit.BlazorUI/Styles/media-queries.scss"; | ||
|
||
.bit-msb { | ||
padding: spacing(2); | ||
min-width: spacing(40); | ||
max-height: $bit-env-height-available; | ||
|
||
@include lt-md { | ||
min-width: unset; | ||
} | ||
} | ||
|
||
.bit-msb-con { | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
gap: spacing(2); | ||
box-sizing: border-box; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
justify-content: flex-start; | ||
max-height: calc(#{$bit-env-height-available} - #{spacing(6)}); | ||
} | ||
|
||
.bit-msb-hdr { | ||
width: 100%; | ||
display: flex; | ||
gap: spacing(2); | ||
flex-direction: row; | ||
box-sizing: border-box; | ||
align-items: flex-start; | ||
justify-content: flex-start; | ||
} | ||
|
||
.bit-msb-bdy { | ||
width: 100%; | ||
flex-grow: 1; | ||
display: flex; | ||
overflow: auto; | ||
color: $clr-ter; | ||
line-height: 1.5; | ||
white-space: pre; | ||
font-weight: 400; | ||
font-size: spacing(2); | ||
letter-spacing: 0.01em; | ||
} | ||
|
||
.bit-msb-ftr { | ||
width: 100%; | ||
display: flex; | ||
gap: spacing(2); | ||
align-items: center; | ||
box-sizing: border-box; | ||
flex-direction: column; | ||
justify-content: center; | ||
} |
Oops, something went wrong.