diff --git a/src/BootstrapBlazor.Server/Components/App.razor b/src/BootstrapBlazor.Server/Components/App.razor index 22c4becbfff..880a316b682 100644 --- a/src/BootstrapBlazor.Server/Components/App.razor +++ b/src/BootstrapBlazor.Server/Components/App.razor @@ -1,5 +1,5 @@ @inject IWebHostEnvironment Env -@inject IStringLocalizer Localizer +@inject IStringLocalizer Localizer @@ -12,7 +12,7 @@ - @Localizer["Title"] + @Localizer["SiteTitle"] diff --git a/src/BootstrapBlazor.Server/Extensions/StaticFileResponseContextExtensions.cs b/src/BootstrapBlazor.Server/Extensions/StaticFileResponseContextExtensions.cs index e13e9b94bae..823012e8bfa 100644 --- a/src/BootstrapBlazor.Server/Extensions/StaticFileResponseContextExtensions.cs +++ b/src/BootstrapBlazor.Server/Extensions/StaticFileResponseContextExtensions.cs @@ -53,12 +53,10 @@ public static RenderFragment RenderAssets(this ComponentBase component) => build private static void RenderCss(this RenderTreeBuilder builder, string url) { -#if NET9_0_OR_GREATER builder.OpenElement(0, "link"); builder.AddAttribute(1, "rel", "stylesheet"); builder.AddAttribute(2, "href", url); builder.CloseElement(); -#endif } public static void ProcessCache(this StaticFileResponseContext context, IConfiguration configuration) diff --git a/src/BootstrapBlazor.Shared/Components/Samples/Collapses.razor b/src/BootstrapBlazor.Shared/Components/Samples/Collapses.razor index d133414783a..05735f8df81 100644 --- a/src/BootstrapBlazor.Shared/Components/Samples/Collapses.razor +++ b/src/BootstrapBlazor.Shared/Components/Samples/Collapses.razor @@ -118,7 +118,7 @@ } - @@ -140,4 +140,43 @@ + + + + + +
+ +
+
+ +
@Localizer["ConsistencyItem1"]
+
@Localizer["ConsistencyItem2"]
+
@Value
+
+
+ + +
Header-Test
+
+ +
@Localizer["FeedbackItem1"]
+
@Localizer["FeedbackItem2"]
+
+
+ + +
Header-Test
+
+ +
@Localizer["ControllabilityItem1"]
+
@Localizer["ControllabilityItem2"]
+
+
+
+
+
+ + + diff --git a/src/BootstrapBlazor.Shared/Components/Samples/Collapses.razor.cs b/src/BootstrapBlazor.Shared/Components/Samples/Collapses.razor.cs index 23238f33971..2b072dc9f23 100644 --- a/src/BootstrapBlazor.Shared/Components/Samples/Collapses.razor.cs +++ b/src/BootstrapBlazor.Shared/Components/Samples/Collapses.razor.cs @@ -26,10 +26,14 @@ private void OnToggle() State = !State; } - /// - /// 获得属性方法 - /// - /// + private string Value { get; set; } + + private IEnumerable Items { get; set; } = new[] + { + new SelectedItem ("Beijing", "北京"), + new SelectedItem ("Shanghai", "上海") { Active = true }, + }; + private AttributeItem[] GetAttributes() => [ new() @@ -57,4 +61,64 @@ private AttributeItem[] GetAttributes() => DefaultValue = " — " } ]; + + private AttributeItem[] GetCollapseItemAttributes() => + [ + new() + { + Name = "Text", + Description = Localizer["CollapseItemAttributeText"], + Type = "RenderFragment", + ValueList = " — ", + DefaultValue = " — " + }, + new() + { + Name = "Icon", + Description = Localizer["CollapseItemAttributeIcon"], + Type = "Func", + ValueList = " — ", + DefaultValue = " — " + }, + new() + { + Name = "TitleColor", + Description = Localizer["CollapseItemAttributeTitleColor"], + Type = "Func", + ValueList = " — ", + DefaultValue = " — " + }, + new() + { + Name = "Class", + Description = Localizer["CollapseItemAttributeClass"], + Type = "Func", + ValueList = " — ", + DefaultValue = " — " + }, + new() + { + Name = "HeaderClass", + Description = Localizer["CollapseItemAttributeHeaderClass"], + Type = "Func", + ValueList = " — ", + DefaultValue = " — " + }, + new() + { + Name = "HeaderTemplate", + Description = Localizer["CollapseItemAttributeHeaderTemplate"], + Type = "Func", + ValueList = " — ", + DefaultValue = " — " + }, + new() + { + Name = "IsCollapsed", + Description = Localizer["CollapseItemAttributeIsCollapsed"], + Type = "bool", + ValueList = "true|false", + DefaultValue = "false" + } + ]; } diff --git a/src/BootstrapBlazor.Shared/Locales/en-US.json b/src/BootstrapBlazor.Shared/Locales/en-US.json index 1c8413edb08..037b8b1eba8 100644 --- a/src/BootstrapBlazor.Shared/Locales/en-US.json +++ b/src/BootstrapBlazor.Shared/Locales/en-US.json @@ -3859,7 +3859,16 @@ "Controllability": "Controllability", "ControllabilityItem1": "User decision-making: according to the scene can give the user action advice or security tips, but can not replace the user to make decisions;", "ControllabilityItem2": "Results controllable: Users are free to perform actions, including undoing, falling back, and terminating the current operation.", - "ButtonText": "Toggle" + "ButtonText": "Toggle", + "HeaderTemplateTitle": "Header Template", + "HeaderTemplateIntro": "Customize the Header display content by setting HeaderTemplate", + "CollapseItemAttributeText": "The title of header", + "CollapseItemAttributeIcon": "The icon of header", + "CollapseItemAttributeTitleColor": "The color of header", + "CollapseItemAttributeClass": "The class of item", + "CollapseItemAttributeHeaderClass": "The class of header", + "CollapseItemAttributeHeaderTemplate": "Header template", + "CollapseItemAttributeIsCollapsed": "The item status collapsed" }, "BootstrapBlazor.Shared.Components.Samples.DateTimeRanges": { "Title": "Date Time Range Picker", diff --git a/src/BootstrapBlazor.Shared/Locales/zh-CN.json b/src/BootstrapBlazor.Shared/Locales/zh-CN.json index 0c35a88aa2f..f8cdc912c8e 100644 --- a/src/BootstrapBlazor.Shared/Locales/zh-CN.json +++ b/src/BootstrapBlazor.Shared/Locales/zh-CN.json @@ -3859,7 +3859,16 @@ "Controllability": "可控 Controllability", "ControllabilityItem1": "用户决策:根据场景可给予用户操作建议或安全提示,但不能代替用户进行决策;", "ControllabilityItem2": "结果可控:用户可以自由的进行操作,包括撤销、回退和终止当前操作等。", - "ButtonText": "切换" + "ButtonText": "切换", + "HeaderTemplateTitle": "Header 模板", + "HeaderTemplateIntro": "通过设置 HeaderTemplate 自定义 Header 显示内容", + "CollapseItemAttributeText": "文本文字", + "CollapseItemAttributeIcon": "图标字符串", + "CollapseItemAttributeTitleColor": "标题颜色", + "CollapseItemAttributeClass": "样式名称", + "CollapseItemAttributeHeaderClass": "Header CSS 样式名称", + "CollapseItemAttributeHeaderTemplate": "Header 模板", + "CollapseItemAttributeIsCollapsed": "当前状态是否收缩" }, "BootstrapBlazor.Shared.Components.Samples.DateTimeRanges": { "Title": "DateTimeRange 日期时间段选择器", diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index 1269bb4861d..61ef2c1c1b3 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@  - 9.0.2-beta06 + 9.0.2-beta07 diff --git a/src/BootstrapBlazor/Components/Collapse/Collapse.razor b/src/BootstrapBlazor/Components/Collapse/Collapse.razor index dd0c9dbd0bf..a92f1529cbf 100644 --- a/src/BootstrapBlazor/Components/Collapse/Collapse.razor +++ b/src/BootstrapBlazor/Components/Collapse/Collapse.razor @@ -9,8 +9,20 @@ @foreach (var item in Children) {
-
-