Skip to content

Commit 8b588e8

Browse files
committed
Merge branch 'main' into feat-socket
2 parents 2b23292 + 48a7777 commit 8b588e8

23 files changed

+167
-43
lines changed

src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
<PackageReference Include="BootstrapBlazor.BootstrapIcon" Version="9.0.2" />
3232
<PackageReference Include="BootstrapBlazor.Chart" Version="9.0.0" />
3333
<PackageReference Include="BootstrapBlazor.ChatBot" Version="9.0.0" />
34-
<PackageReference Include="BootstrapBlazor.CherryMarkdown" Version="9.0.0" />
34+
<PackageReference Include="BootstrapBlazor.CherryMarkdown" Version="9.0.1" />
3535
<PackageReference Include="BootstrapBlazor.Dock" Version="9.0.0" />
36-
<PackageReference Include="BootstrapBlazor.DockView" Version="9.1.13" />
36+
<PackageReference Include="BootstrapBlazor.DockView" Version="9.1.14" />
3737
<PackageReference Include="BootstrapBlazor.DriverJs" Version="9.0.3" />
3838
<PackageReference Include="BootstrapBlazor.ElementIcon" Version="9.0.3" />
3939
<PackageReference Include="BootstrapBlazor.FileViewer" Version="9.0.0" />

src/BootstrapBlazor.Server/Components/Samples/CherryMarkdowns.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<Pre class="no-highlight">builder.Services.Configure&lt;HubOptions&gt;(option => option.MaximumReceiveMessageSize = null);</Pre>
1212

1313
<DemoBlock Title="@Localizer["NormalTitle"]" Introduction="@Localizer["NormalIntro"]" Name="Normal">
14-
<CherryMarkdown @bind-Value="MarkdownString" @bind-Html="HtmlString" style="height: 400px" />
14+
<CherryMarkdown @bind-Value="MarkdownString" @bind-Html="HtmlString" IsSupportMath="true" style="height: 400px" />
1515
<div class="mt-3">
1616
<textarea class="form-control" rows="6" disabled="disabled">@MarkdownString</textarea>
1717
</div>

src/BootstrapBlazor.Server/Components/Samples/Selects.razor

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,15 @@
364364
<DemoBlock Title="@Localizer["SelectsConfirmSelectTitle"]"
365365
Introduction="@Localizer["SelectsConfirmSelectIntro"]"
366366
Name="ConfirmSelect">
367+
<section ignore>
368+
<ul class="ul-demo">
369+
<li>@((MarkupString)Localizer["SelectConfifrmSelectDesc1"].Value)</li>
370+
<li>@((MarkupString)Localizer["SelectConfifrmSelectDesc2"].Value)</li>
371+
</ul>
372+
</section>
367373
<div class="row">
368374
<div class="col-12 col-sm-6">
369-
<Select TValue="string" Items="Items" OnBeforeSelectedItemChange="@OnBeforeSelectedItemChange"
375+
<Select TValue="string" Items="Items" ShowSwal="true"
370376
SwalTitle="@Localizer["SwalTitle"]" SwalContent="@Localizer["SwalContent"]" SwalFooter="@Localizer["SwalFooter"]" />
371377
</div>
372378
</div>

src/BootstrapBlazor.Server/Locales/en-US.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3219,7 +3219,9 @@
32193219
"SelectsShowSearchTitle": "Drop-down box with search box",
32203220
"SelectsShowSearchIntro": "Controls whether the search box is displayed by setting the <code>ShowSearch</code> property, which is not displayed by default <b>false</b>. You can set the <code>IsAutoClearSearchTextWhenCollapsed</code> parameter to control whether the text in the search box is automatically cleared after the drop-down box is collapsed. The default value is <b>false</b>.",
32213221
"SelectsConfirmSelectTitle": "Drop-down box with confirmation",
3222-
"SelectsConfirmSelectIntro": "Block changes to the current value by setting the <code>OnBeforeSelectedItemChange</code> delegate.",
3222+
"SelectsConfirmSelectIntro": "Prevent the current value from changing by setting the <code>OnBeforeSelectedItemChange</code> delegate or setting the <code>ShowSwal</code> parameter to <code>true</code>.",
3223+
"SelectConfifrmSelectDesc1": "Set the <code>OnBeforeSelectedItemChange</code> callback method, and pop up a window in the callback method to confirm whether to change the value. If it returns <code>true</code>, the value will be changed, otherwise it will not be changed.",
3224+
"SelectConfifrmSelectDesc2": "Set <code>ShowSwal=\"true\"</code> and then confirm the value of the <code>SwalTitle</code> <code>SwalContent</code> parameter using the built-in popup window. In the callback method, you can confirm whether to change the value.",
32233225
"SelectsTimeZoneTitle": "Timezone",
32243226
"SelectsTimeZoneIntro": "Display data of Timezone",
32253227
"SwalTitle": "The drop-down box value changes",

src/BootstrapBlazor.Server/Locales/zh-CN.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3219,7 +3219,9 @@
32193219
"SelectsShowSearchTitle": "带搜索框的下拉框",
32203220
"SelectsShowSearchIntro": "通过设置 <code>ShowSearch</code> 属性控制是否显示搜索框,默认为 <b>false</b> 不显示搜索框,可以通过设置 <code>IsAutoClearSearchTextWhenCollapsed</code> 参数控制下拉框收起后是否自动清空搜索框内文字,默认值为 <b>false</b> 不清空",
32213221
"SelectsConfirmSelectTitle": "带确认的下拉框",
3222-
"SelectsConfirmSelectIntro": "通过设置 <code>OnBeforeSelectedItemChange</code> 委托,阻止当前值的改变",
3222+
"SelectsConfirmSelectIntro": "通过设置 <code>OnBeforeSelectedItemChange</code> 委托或者设置 <code>ShowSwal</code> 参数值为 <code>true</code>,阻止当前值的改变。",
3223+
"SelectConfifrmSelectDesc1": "设置 <code>OnBeforeSelectedItemChange</code> 回调方法,在回调方法内自己弹窗确认是否更改值,返回 <code>true</code> 时更改,否则不更改",
3224+
"SelectConfifrmSelectDesc2": "设置 <code>ShowSwal=\"true\"</code> 然后通过设置 <code>SwalTitle</code> <code>SwalContent</code> 参数值使用内置弹窗进行确认即可,在回调方法内自己弹窗确认是否更改值",
32233225
"SelectsTimeZoneTitle": "时区下拉框",
32243226
"SelectsTimeZoneIntro": "下拉框展现时区数据",
32253227
"SwalTitle": "下拉框值变更",

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.7.4-beta05</Version>
4+
<Version>9.7.4-beta08</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Components/ErrorLogger/BootstrapBlazorErrorBoundary.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class BootstrapBlazorErrorBoundary : ErrorBoundaryBase
1818
{
1919
[Inject]
2020
[NotNull]
21-
private ILogger<ErrorLogger>? Logger { get; set; }
21+
private ILogger<BootstrapBlazorErrorBoundary>? Logger { get; set; }
2222

2323
[Inject]
2424
[NotNull]
@@ -48,6 +48,12 @@ class BootstrapBlazorErrorBoundary : ErrorBoundaryBase
4848
[Parameter]
4949
public bool ShowToast { get; set; } = true;
5050

51+
/// <summary>
52+
/// 获得/设置 是否启用日志记录功能 默认 true 启用
53+
/// </summary>
54+
[Parameter]
55+
public bool EnableILogger { get; set; } = true;
56+
5157
/// <summary>
5258
/// 获得/设置 Toast 弹窗标题
5359
/// </summary>
@@ -61,7 +67,10 @@ class BootstrapBlazorErrorBoundary : ErrorBoundaryBase
6167
/// <param name="exception"></param>
6268
protected override Task OnErrorAsync(Exception exception)
6369
{
64-
Logger.LogError(exception, "{BootstrapBlazorErrorBoundary} {OnErrorAsync} log this error occurred at {Page}", nameof(BootstrapBlazorErrorBoundary), nameof(OnErrorAsync), NavigationManager.Uri);
70+
if (EnableILogger)
71+
{
72+
Logger.LogError(exception, "BootstrapBlazorErrorBoundary OnErrorAsync log this error occurred at {Page}", NavigationManager.Uri);
73+
}
6574
return Task.CompletedTask;
6675
}
6776

src/BootstrapBlazor/Components/ErrorLogger/ErrorLogger.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ public class ErrorLogger : ComponentBase, IErrorLogger
3030
[Parameter]
3131
public bool ShowToast { get; set; } = true;
3232

33+
/// <summary>
34+
/// <inheritdoc/>
35+
/// </summary>
36+
[Parameter]
37+
public bool EnableILogger { get; set; } = true;
38+
3339
/// <summary>
3440
/// <inheritdoc/>
3541
/// </summary>
@@ -112,6 +118,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder)
112118
builder.AddAttribute(3, nameof(BootstrapBlazorErrorBoundary.ToastTitle), ToastTitle);
113119
builder.AddAttribute(4, nameof(BootstrapBlazorErrorBoundary.ErrorContent), ErrorContent);
114120
builder.AddAttribute(5, nameof(BootstrapBlazorErrorBoundary.ChildContent), ChildContent);
121+
builder.AddAttribute(6, nameof(BootstrapBlazorErrorBoundary.EnableILogger), EnableILogger);
115122
builder.AddComponentReferenceCapture(5, obj => _errorBoundary = (BootstrapBlazorErrorBoundary)obj);
116123
builder.CloseComponent();
117124
};

src/BootstrapBlazor/Components/ErrorLogger/IErrorLogger.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ public interface IErrorLogger
2727
/// </summary>
2828
bool ShowToast { get; }
2929

30+
/// <summary>
31+
/// 获得/设置 是否启用日志记录功能 默认 true 启用
32+
/// <para>设置 false 后关闭记录日志功能</para>
33+
/// </summary>
34+
bool EnableILogger { get; }
35+
3036
/// <summary>
3137
/// 获得 Error Toast 弹窗标题 默认读取资源文件内容
3238
/// </summary>

src/BootstrapBlazor/Components/IpAddress/IpAddress.razor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ protected override void OnParametersSet()
3636
var ipSegments = CurrentValueAsString.Split(".", System.StringSplitOptions.RemoveEmptyEntries);
3737
if (ipSegments.Length == 4)
3838
{
39-
Value1 = ipSegments[0];
40-
Value2 = ipSegments[1];
41-
Value3 = ipSegments[2];
42-
Value4 = ipSegments[3];
39+
Value1 = ipSegments[0].Trim();
40+
Value2 = ipSegments[1].Trim();
41+
Value3 = ipSegments[2].Trim();
42+
Value4 = ipSegments[3].Trim();
4343
}
4444
else
4545
{

0 commit comments

Comments
 (0)