Skip to content

Commit

Permalink
feat(Toast): support DialogCloseButton component (#5276)
Browse files Browse the repository at this point in the history
* feat: 增加 AddStyle 方法

* test: 增加单元测试

* refactor: use AddStyle method

* doc: 重构代码

* refactor: 重构代码

* Revert "refactor: 重构代码"

This reverts commit 37653dc.

* feat: 增加 BootstrapLabelSetting 组件

* feat: 增加 LabelWidth 参数

* feat: 实现 LabelWidth 逻辑

* test: 增加单元测试

* doc: 移除 IsHtml 参数说明

* doc: 更新 Content 说明文档

* feat: 增加级联参数
  • Loading branch information
ArgoZhang authored Feb 2, 2025
1 parent c33eb02 commit e654d66
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
8 changes: 0 additions & 8 deletions src/BootstrapBlazor.Server/Components/Samples/Toasts.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,6 @@ private AttributeItem[] GetAttributes() =>
DefaultValue = "true"
},
new()
{
Name = "IsHtml",
Description = Localizer["ToastsAttrIsHtml"],
Type = "boolean",
ValueList = "",
DefaultValue = "false"
},
new()
{
Name = "Placement",
Description = Localizer["ToastsAttrPlacement"],
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor.Server/Locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
"ToastsHeaderTemplateIntro": "set <code>HeaderTemplate</code> custom the header content",
"ToastsAttrCategory": "Toast type",
"ToastsAttrTitle": "Toast title",
"ToastsAttrContent": "Toast content",
"ToastsAttrContent": "Toast content support HTML",
"ToastsAttrDelay": "Auto hide interval",
"ToastsAttrIsAutoHide": "Whether to automatically hide",
"ToastsAttrIsHtml": "Whether the content contains Html code",
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor.Server/Locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
"ToastsHeaderTemplateIntro": "通过设置 <code>HeaderTemplate</code> 自定义标题栏内容",
"ToastsAttrCategory": "Toast 类型",
"ToastsAttrTitle": "Toast 标题",
"ToastsAttrContent": "Toast 内容",
"ToastsAttrContent": "Toast 内容,支持 Html 标签",
"ToastsAttrDelay": "自动关闭时间",
"ToastsAttrIsAutoHide": "是否自动关闭提示框",
"ToastsAttrIsHtml": "内容是否包含 HTML",
Expand Down
18 changes: 10 additions & 8 deletions src/BootstrapBlazor/Components/Toast/Toast.razor
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@
</div>
}
<div class="toast-body">
@if (Options.ChildContent != null)
{
@Options.ChildContent
}
else if (!string.IsNullOrEmpty(Options.Content))
{
@((MarkupString)Options.Content)
}
<CascadingValue Value="Close" IsFixed="true">
@if (Options.ChildContent != null)
{
@Options.ChildContent
}
else if (!string.IsNullOrEmpty(Options.Content))
{
@((MarkupString)Options.Content)
}
</CascadingValue>
</div>
<div class="@ProgressClass"></div>
</div>

0 comments on commit e654d66

Please sign in to comment.