Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/BootstrapBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>10.4.1-beta01</Version>
<Version>10.4.1-beta02</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 4 additions & 2 deletions src/BootstrapBlazor/Components/Table/Table.razor
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@
}
else
{
<DynamicElement class="@GetRowClassString(item, "table-row")" @key="GetKeyByITem(item)"
<DynamicElement @key="GetKeyByITem(item)"
class="@GetRowClassString(item, "table-row")" style="@GetRowStyleString(item)"
TriggerContextMenu="ContextMenuZone != null"
OnContextMenu="e => OnContextMenu(e, item)"
@ontouchstart="e => OnTouchStart(e, item)"
Expand Down Expand Up @@ -747,7 +748,8 @@
</thead>;

RenderFragment<TItem> RenderRow => item =>
@<DynamicElement TagName="tr" class="@GetRowClassString(item)" @key="GetKeyByITem(item)"
@<DynamicElement @key="GetKeyByITem(item)" TagName="tr"
class="@GetRowClassString(item)" style="@GetRowStyleString(item)"
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a trailing whitespace at the end of the style="@GetRowStyleString(item)" attribute line. While this is not functionally harmful, it's a minor style issue and the codebase should ideally be free of unnecessary trailing whitespace.

Copilot uses AI. Check for mistakes.
TriggerContextMenu="ContextMenuZone != null" OnContextMenu="e => OnContextMenu(e, item)"
@ontouchstart="e => OnTouchStart(e, item)" @ontouchend="OnTouchEnd"
TriggerClick="@(ClickToSelect || OnClickRowCallback != null)" OnClick="() => ClickRow(item)"
Expand Down
7 changes: 7 additions & 0 deletions src/BootstrapBlazor/Components/Table/Table.razor.Edit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ public partial class Table<TItem>
[Parameter]
public Func<TItem, string?>? SetRowClassFormatter { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 行样式格式回调委托</para>
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Chinese documentation (lang="zh") for SetRowStyleFormatter is identical to the one for SetRowClassFormatter above it: both use "获得/设置 行样式格式回调委托". This is misleading — SetRowClassFormatter deals with CSS class names while SetRowStyleFormatter deals with inline CSS style strings. The zh-CN doc for SetRowStyleFormatter should be updated to distinguish it, such as "获得/设置 行内联样式格式回调委托" (inline style formatter callback).

Copilot uses AI. Check for mistakes.
/// <para lang="en">Gets or sets Row Style Formatter Callback</para>
/// </summary>
[Parameter]
public Func<TItem, string?>? SetRowStyleFormatter { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 取消保存后回调委托方法</para>
/// <para lang="en">Gets or sets After Cancel Save Callback</para>
Expand Down
8 changes: 8 additions & 0 deletions src/BootstrapBlazor/Components/Table/Table.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ public partial class Table<TItem> : ITable, IModelEqualityComparer<TItem> where
.AddClass("is-edit", EditInCell)
.Build();

/// <summary>
/// <para lang="zh">获得 Body 内行内联样式</para>
/// <para lang="en">Get Body Row Inline Style</para>
/// </summary>
protected string? GetRowStyleString(TItem item) => CssBuilder.Default()
.AddClass(SetRowStyleFormatter?.Invoke(item))
.Build();
Comment on lines +136 to +142
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GetRowStyleString method is missing a <param name="item"> XML documentation tag, while similar methods in the same file (GetRowClassString, GetDetailBarClassString, GetDetailRowClassString, GetDetailCaretClassString) all document their item parameter.

Copilot uses AI. Check for mistakes.

/// <summary>
/// <para lang="zh">明细行首小图标单元格样式</para>
/// <para lang="en">Detail Row Icon Cell CSS Class</para>
Expand Down
2 changes: 2 additions & 0 deletions test/UnitTest/Components/TableTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5405,6 +5405,7 @@ public void SetRowClassFormatter_Ok()
pb.Add(a => a.ShowLoading, false);
pb.Add(a => a.RenderModeResponsiveWidth, BreakPoint.Medium);
pb.Add(a => a.SetRowClassFormatter, foo => "test_row_class");
pb.Add(a => a.SetRowStyleFormatter, foo => "height: 36px;");
pb.Add(a => a.TableColumns, foo => builder =>
{
builder.OpenComponent<TableColumn<Foo, string>>(0);
Expand All @@ -5415,6 +5416,7 @@ public void SetRowClassFormatter_Ok()
});
});
cut.Contains("test_row_class");
cut.Contains("height: 36px;");
}

[Fact]
Expand Down