2020-05-29 00:33:49 +08:00
|
|
|
|
@namespace AntDesign
|
2020-05-16 16:52:44 +08:00
|
|
|
|
@inherits NotificationBase
|
2020-05-10 22:43:58 +08:00
|
|
|
|
|
|
|
|
|
<div id="@Config.Key"
|
2020-05-16 16:52:44 +08:00
|
|
|
|
class="@(ClassPrefix)-notice @(ClassPrefix)-notice-closable @GetClassName()"
|
2020-05-10 22:43:58 +08:00
|
|
|
|
style="@Config.Style"
|
|
|
|
|
@onclick="OnClick">
|
|
|
|
|
|
2020-05-16 16:52:44 +08:00
|
|
|
|
<div class="@(ClassPrefix)-notice-content">
|
2020-05-10 22:43:58 +08:00
|
|
|
|
<div class="@GetIconClassName()">
|
|
|
|
|
@if (Config.Icon != null)
|
|
|
|
|
{
|
2020-05-16 16:52:44 +08:00
|
|
|
|
<span class="@(ClassPrefix)-notice-icon">
|
2020-05-10 22:43:58 +08:00
|
|
|
|
@Config.Icon
|
|
|
|
|
</span>
|
|
|
|
|
}
|
2020-05-16 16:52:44 +08:00
|
|
|
|
else if (Config.NotificationType != NotificationType.None)
|
2020-05-10 22:43:58 +08:00
|
|
|
|
{
|
|
|
|
|
switch (Config.NotificationType)
|
|
|
|
|
{
|
2020-05-16 16:52:44 +08:00
|
|
|
|
case NotificationType.Success:
|
2020-05-10 22:43:58 +08:00
|
|
|
|
{
|
2020-05-16 16:52:44 +08:00
|
|
|
|
<span role="img" aria-label="check-circle" class="anticon anticon-check-circle @(ClassPrefix)-notice-icon @(ClassPrefix)-notice-icon-success">
|
2020-05-10 22:43:58 +08:00
|
|
|
|
<AntIcon Type="check-circle" Theme="outline"></AntIcon>
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
2020-05-16 16:52:44 +08:00
|
|
|
|
case NotificationType.Warning:
|
2020-05-10 22:43:58 +08:00
|
|
|
|
{
|
2020-05-16 16:52:44 +08:00
|
|
|
|
<span role="img" aria-label="exclamation-circle" class="anticon anticon-exclamation-circle @(ClassPrefix)-notice-icon @(ClassPrefix)-notice-icon-warning">
|
2020-05-10 22:43:58 +08:00
|
|
|
|
<AntIcon Type="exclamation-circle" Theme="outline"></AntIcon>
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
2020-05-16 16:52:44 +08:00
|
|
|
|
case NotificationType.Error:
|
2020-05-10 22:43:58 +08:00
|
|
|
|
{
|
2020-05-16 16:52:44 +08:00
|
|
|
|
<span role="img" aria-label="close-circle" class="anticon anticon-close-circle @(ClassPrefix)-notice-icon @(ClassPrefix)-notice-icon-error">
|
2020-05-10 22:43:58 +08:00
|
|
|
|
<AntIcon Type="close-circle" Theme="outline"></AntIcon>
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
2020-05-16 16:52:44 +08:00
|
|
|
|
case NotificationType.Info:
|
2020-05-10 22:43:58 +08:00
|
|
|
|
{
|
2020-05-16 16:52:44 +08:00
|
|
|
|
<span role="img" aria-label="info-circle" class="anticon anticon-info-circle @(ClassPrefix)-notice-icon @(ClassPrefix)-notice-icon-info">
|
2020-05-10 22:43:58 +08:00
|
|
|
|
<AntIcon Type="info-circle" Theme="outline"></AntIcon>
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-16 16:52:44 +08:00
|
|
|
|
<div class="@(ClassPrefix)-notice-message">
|
2020-05-10 22:43:58 +08:00
|
|
|
|
@if (Config.Message != null)
|
|
|
|
|
{
|
|
|
|
|
if (Config.Message is string msg)
|
|
|
|
|
{
|
|
|
|
|
@((MarkupString)(msg))
|
|
|
|
|
}
|
|
|
|
|
else if (Config.Message is RenderFragment renderFragment)
|
|
|
|
|
{
|
|
|
|
|
@renderFragment
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
|
2020-05-16 16:52:44 +08:00
|
|
|
|
<div class="@(ClassPrefix)-notice-description">
|
2020-05-10 22:43:58 +08:00
|
|
|
|
@if (Config.Description != null)
|
|
|
|
|
{
|
|
|
|
|
if (Config.Description is string description)
|
|
|
|
|
{
|
|
|
|
|
@((MarkupString)(description))
|
|
|
|
|
}
|
|
|
|
|
else if (Config.Message is RenderFragment renderFragment)
|
|
|
|
|
{
|
|
|
|
|
@renderFragment
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@if (Config.Btn != null)
|
|
|
|
|
{
|
2020-05-16 16:52:44 +08:00
|
|
|
|
<span class="@(ClassPrefix)-notice-btn">
|
2020-05-10 22:43:58 +08:00
|
|
|
|
@Config.Btn
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2020-05-16 16:52:44 +08:00
|
|
|
|
<a tabindex="0" class="@(ClassPrefix)-notice-close" @onclick="Close" @onclick:preventDefault @onclick:stopPropagation>
|
|
|
|
|
<span class="@(ClassPrefix)-close-x">
|
|
|
|
|
<span role="img" aria-label="close" class="anticon anticon-close @(ClassPrefix)-close-icon">
|
2020-05-10 22:43:58 +08:00
|
|
|
|
@Config.CloseIcon
|
|
|
|
|
</span>
|
|
|
|
|
</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|