Browse Source
Merge pull request #20792 from nebula2/19785-html-uimessagealert
feat(blazor): html ui message alert
pull/20829/head
maliming
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
16 additions and
1 deletions
-
framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/UiMessageOptions.cs
-
framework/src/Volo.Abp.BlazoriseUI/Components/UiMessageAlert.razor
-
framework/src/Volo.Abp.BlazoriseUI/Components/UiMessageAlert.razor.cs
|
|
|
@ -49,4 +49,9 @@ public class UiMessageOptions |
|
|
|
/// Custom icon for the Cancel button.
|
|
|
|
/// </summary>
|
|
|
|
public object? CancelButtonIcon { get; set; } |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Whether the message is html (true) or plain text (false)
|
|
|
|
/// </summary>
|
|
|
|
public bool IsMessageHtmlMarkup { get; set; } |
|
|
|
} |
|
|
|
|
|
|
|
@ -16,7 +16,14 @@ |
|
|
|
</DisplayHeading> |
|
|
|
} |
|
|
|
<Paragraph TextAlignment="TextAlignment.Center" Margin="Margin.Is0.FromBottom" Style="white-space: break-spaces;"> |
|
|
|
@Message |
|
|
|
@if (!IsMessageHtmlMarkup) |
|
|
|
{ |
|
|
|
@Message |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
@((MarkupString)Message) |
|
|
|
} |
|
|
|
</Paragraph> |
|
|
|
</ModalBody> |
|
|
|
<ModalFooter class="d-flex justify-content-center"> |
|
|
|
|
|
|
|
@ -21,6 +21,9 @@ public partial class UiMessageAlert : ComponentBase, IDisposable |
|
|
|
protected virtual bool ShowMessageIcon |
|
|
|
=> Options?.ShowMessageIcon ?? true; |
|
|
|
|
|
|
|
protected virtual bool IsMessageHtmlMarkup |
|
|
|
=> Options?.IsMessageHtmlMarkup ?? false; |
|
|
|
|
|
|
|
protected virtual object? MessageIcon => Options?.MessageIcon ?? MessageType switch |
|
|
|
{ |
|
|
|
UiMessageType.Info => IconName.Info, |
|
|
|
|