Skip to content

Commit c96b550

Browse files
committed
Merge branch 'main' into feat-rtl
2 parents c0b35ed + feda9f4 commit c96b550

File tree

10 files changed

+24
-72
lines changed

10 files changed

+24
-72
lines changed

src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<PackageReference Include="BootstrapBlazor.TagHelper" Version="9.0.0-beta01" />
6565
<PackageReference Include="BootstrapBlazor.Topology" Version="9.0.0-beta01" />
6666
<PackageReference Include="BootstrapBlazor.VideoPlayer" Version="9.0.0-beta01" />
67-
<PackageReference Include="BootstrapBlazor.WinBox" Version="9.0.0-beta01" />
67+
<PackageReference Include="BootstrapBlazor.WinBox" Version="9.0.0-beta02" />
6868
<PackageReference Include="Longbow.Logging" Version="9.0.0-beta01" />
6969
<PackageReference Include="Longbow.Tasks" Version="9.0.0-beta01" />
7070
</ItemGroup>

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55

66
<h4>@Localizer["SubTitle"]</h4>
77

8-
<DemoBlock Title="@Localizer["BaseUsageText"]" Introduction="@Localizer["IntroText1"]" Name="Normal">
9-
<Handwritten HandwrittenBase64="e => DrawBase64 = e" />
10-
<textarea type="text" class="form-control mt-3" readonly rows="5" @bind="DrawBase64" />
11-
</DemoBlock>
8+
<Tips>
9+
<div>@((MarkupString)Localizer["Tips"].Value)</div>
10+
</Tips>
1211

1312
<AttributeTable Items="@GetAttributes()" />

src/BootstrapBlazor.Server/Components/Samples/Handwrittens.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace BootstrapBlazor.Server.Components.Samples;
77

88
/// <summary>
9-
/// HandwrittenPage
9+
/// Handwritten 组件示例代码
1010
/// </summary>
1111
public sealed partial class Handwrittens
1212
{

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5730,6 +5730,7 @@
57305730
"BootstrapBlazor.Server.Components.Samples.Handwrittens": {
57315731
"Title": "Handwritten",
57325732
"SubTitle": "Used to save the mobile terminal signature as Base64 encoded string",
5733+
"Tips": "Deprecated, please use the <a href=\"signature-pad\">BootstrapBlazor.SignaturePad</a> component",
57335734
"BaseUsageText": "Basic usage",
57345735
"IntroText1": "Touch device handwritten signature as Base64.",
57355736
"IntroText2": "For desktop browser testing, please use F12 to simulate a touch device.",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5730,6 +5730,7 @@
57305730
"BootstrapBlazor.Server.Components.Samples.Handwrittens": {
57315731
"Title": "Handwritten 手写签名",
57325732
"SubTitle": "用于移动终端签名保存为 Base64 编码字符串",
5733+
"Tips": "已弃用,请使用 <a href=\"signature-pad\">BootstrapBlazor.SignaturePad</a> 组件,已知问题在弹窗中无法签名",
57335734
"BaseUsageText": "基础用法",
57345735
"IntroText1": "触摸设备直接手写签名保存为 Base64",
57355736
"IntroText2": "桌面浏览器测试请用F12模拟为触摸设备",

src/BootstrapBlazor/Components/Handwritten/Handwritten.razor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ namespace BootstrapBlazor.Components;
1010
/// <summary>
1111
/// Handwritten 手写签名
1212
/// </summary>
13+
[Obsolete("已弃用,请使用 BootstrapBlazor.SignaturePad 代替;Deprecated, use BootstrapBlazor.SignaturePad instead")]
14+
[ExcludeFromCodeCoverage]
1315
public partial class Handwritten
1416
{
1517
/// <summary>

src/BootstrapBlazor/Components/Table/Table.razor

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@
226226
if (RowTemplate != null)
227227
{
228228
var columns = GetVisibleColumns();
229-
@RowTemplate(new(item, columns))
229+
@RowTemplate(new(item, columns, ActiveRenderMode))
230230
}
231231
else
232232
{
@@ -259,7 +259,7 @@
259259
@if (RowContentTemplate != null)
260260
{
261261
var columns = GetVisibleColumns();
262-
@RowContentTemplate(new(item, columns))
262+
@RowContentTemplate(new(item, columns, ActiveRenderMode))
263263
}
264264
else
265265
{
@@ -393,7 +393,7 @@
393393
if (RowTemplate != null)
394394
{
395395
var columns = GetVisibleColumns();
396-
@RowTemplate(new(item, columns))
396+
@RowTemplate(new(item, columns, ActiveRenderMode))
397397
}
398398
else
399399
{
@@ -728,7 +728,7 @@
728728
@if (RowContentTemplate != null)
729729
{
730730
var columns = GetVisibleColumns();
731-
@RowContentTemplate(new (item, columns));
731+
@RowContentTemplate(new (item, columns, ActiveRenderMode));
732732
}
733733
else
734734
{

src/BootstrapBlazor/Components/Table/TableRowContext.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@ namespace BootstrapBlazor.Components;
1010
/// </summary>
1111
/// <param name="model"></param>
1212
/// <param name="columns"></param>
13-
public class TableRowContext<TItem>(TItem model, IEnumerable<ITableColumn> columns)
13+
/// <param name="renderMode"></param>
14+
public class TableRowContext<TItem>(TItem model, IEnumerable<ITableColumn> columns, TableRenderMode renderMode)
1415
{
16+
/// <summary>
17+
/// 获得/设置 当前渲染模式
18+
/// </summary>
19+
public TableRenderMode RenderMode { get; } = renderMode;
20+
1521
/// <summary>
1622
/// 获得/设置 行数据实例
1723
/// </summary>
@@ -21,5 +27,5 @@ public class TableRowContext<TItem>(TItem model, IEnumerable<ITableColumn> colum
2127
/// <summary>
2228
/// 获得/设置 当前绑定字段数据实例
2329
/// </summary>
24-
public IEnumerable<ITableColumn> Columns => columns;
30+
public IEnumerable<ITableColumn> Columns { get; } = columns;
2531
}

test/UnitTest/Components/HandwrittenTest.cs

Lines changed: 0 additions & 57 deletions
This file was deleted.

test/UnitTest/Components/TableTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7575,7 +7575,7 @@ public void TableColumnContext_Exception()
75757575
[Fact]
75767576
public void TableRowContext_Exception()
75777577
{
7578-
Assert.Throws<ArgumentNullException>(() => new TableRowContext<Foo?>(null, [new InternalTableColumn("Name", typeof(string))]));
7578+
Assert.Throws<ArgumentNullException>(() => new TableRowContext<Foo?>(null, [new InternalTableColumn("Name", typeof(string))], TableRenderMode.Table));
75797579
}
75807580

75817581
[Fact]
@@ -8104,7 +8104,7 @@ public void RowContentTemplate_Ok(TableRenderMode mode)
81048104
});
81058105
pb.Add(a => a.RowContentTemplate, context => builder =>
81068106
{
8107-
builder.OpenElement(0, "div");
8107+
builder.OpenElement(0, context.RenderMode == TableRenderMode.CardView ? "div" : "tr");
81088108
builder.AddContent(1, $"template-{context.Row.Name}");
81098109
builder.CloseElement();
81108110

@@ -8141,7 +8141,7 @@ public void RowTemplate_Ok(TableRenderMode mode)
81418141
});
81428142
pb.Add(a => a.RowTemplate, context => builder =>
81438143
{
8144-
builder.OpenElement(0, mode == TableRenderMode.CardView ? "div" : "tr");
8144+
builder.OpenElement(0, context.RenderMode == TableRenderMode.CardView ? "div" : "tr");
81458145
builder.AddContent(1, new MarkupString(mode == TableRenderMode.CardView ? $"<div>template-{context.Row.Name}</div>" : $"<td>template-{context.Row.Name}</td>"));
81468146
builder.CloseElement();
81478147

0 commit comments

Comments
 (0)