Skip to content

Commit cd3e7b6

Browse files
committed
refactor: add additional attributes to table components
1 parent 9d9c9c1 commit cd3e7b6

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/AzureAppConfigurationEmulator/Components/AzureTable.razor

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@typeparam TItem
22

3-
<table class="w-full border-collapse table-fixed">
3+
<table @attributes="@AdditionalAttributes" class="w-full border-collapse table-fixed @(AdditionalAttributes?.TryGetValue("class", out var @class) is true ? @class : null)">
44
<thead>
55
<tr class="border-b border-b-alto h-[32px] dark:border-b-masala">
66
<th class="text-center w-[24px]" scope="col">
@@ -33,6 +33,9 @@
3333
</table>
3434

3535
@code {
36+
37+
[Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, object>? AdditionalAttributes { get; set; }
38+
3639
[EditorRequired, Parameter] public RenderFragment HeaderContent { get; set; } = null!;
3740

3841
[Parameter] public IEnumerable<TItem> Items { get; set; } = [];
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
<td class="px-1 text-left truncate">
1+
<td @attributes="@AdditionalAttributes" class="px-1 text-left truncate @(AdditionalAttributes?.TryGetValue("class", out var @class) is true ? @class : null)">
22
@ChildContent
33
</td>
44

55
@code {
6+
[Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, object>? AdditionalAttributes { get; set; }
7+
68
[Parameter] public RenderFragment? ChildContent { get; set; }
79
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
<th class="px-1 font-semibold text-left" scope="col">
1+
<th @attributes="@AdditionalAttributes" class="px-1 font-semibold text-left @(AdditionalAttributes?.TryGetValue("class", out var @class) is true ? @class : null)" scope="col">
22
@ChildContent
33
</th>
44

55
@code {
6+
[Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, object>? AdditionalAttributes { get; set; }
7+
68
[Parameter] public RenderFragment? ChildContent { get; set; }
79
}

0 commit comments

Comments
 (0)