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"
|
2021-01-21 17:20:10 +08:00
|
|
|
|
@onclick="OnClick"
|
|
|
|
|
@ref="Ref">
|
2020-05-10 22:43:58 +08:00
|
|
|
|
|
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-06-07 19:41:00 +08:00
|
|
|
|
<Icon Type="check-circle" Theme="outline"></Icon>
|
2020-05-10 22:43:58 +08:00
|
|
|
|
</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-06-07 19:41:00 +08:00
|
|
|
|
<Icon Type="exclamation-circle" Theme="outline"></Icon>
|
2020-05-10 22:43:58 +08:00
|
|
|
|
</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-06-07 19:41:00 +08:00
|
|
|
|
<Icon Type="close-circle" Theme="outline"></Icon>
|
2020-05-10 22:43:58 +08:00
|
|
|
|
</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-06-07 19:41:00 +08:00
|
|
|
|
<Icon Type="info-circle" Theme="outline"></Icon>
|
2020-05-10 22:43:58 +08:00
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-16 16:52:44 +08:00
|
|
|
|
<div class="@(ClassPrefix)-notice-message">
|
2020-06-25 21:20:50 +08:00
|
|
|
|
@{
|
|
|
|
|
if (Config.Message.IsT0)
|
2020-05-10 22:43:58 +08:00
|
|
|
|
{
|
2020-06-25 21:20:50 +08:00
|
|
|
|
@((MarkupString)(Config.Message.AsT0))
|
2020-05-10 22:43:58 +08:00
|
|
|
|
}
|
2020-06-25 21:20:50 +08:00
|
|
|
|
else
|
2020-05-10 22:43:58 +08:00
|
|
|
|
{
|
2020-06-25 21:20:50 +08:00
|
|
|
|
@Config.Message.AsT1
|
2020-05-10 22:43:58 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
|
2020-05-16 16:52:44 +08:00
|
|
|
|
<div class="@(ClassPrefix)-notice-description">
|
2020-06-25 21:20:50 +08:00
|
|
|
|
@{
|
|
|
|
|
if (Config.Description.IsT0)
|
2020-05-10 22:43:58 +08:00
|
|
|
|
{
|
2020-06-25 21:20:50 +08:00
|
|
|
|
@((MarkupString)(Config.Description.AsT0))
|
2020-05-10 22:43:58 +08:00
|
|
|
|
}
|
2020-06-25 21:20:50 +08:00
|
|
|
|
else
|
2020-05-10 22:43:58 +08:00
|
|
|
|
{
|
2020-06-25 21:20:50 +08:00
|
|
|
|
@Config.Description.AsT1
|
2020-05-10 22:43:58 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</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>
|