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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
![License](https://img.shields.io/github/license/bitfoundation/bitplatform.svg)
![Release CI Status](https://github.com/bitfoundation/bitplatform/actions/workflows/bit.ci.release.yml/badge.svg)
![NuGet version](https://img.shields.io/nuget/v/bit.blazorui.svg?logo=nuget)
[![Nuget downloads](https://img.shields.io/badge/packages_download-8.2M-blue.svg?logo=nuget)](https://www.nuget.org/profiles/bit-foundation)
[![Nuget downloads](https://img.shields.io/badge/packages_download-8.8M-blue.svg?logo=nuget)](https://www.nuget.org/profiles/bit-foundation)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/bitfoundation/bitplatform.svg)](http://isitmaintained.com/project/bitfoundation/bitplatform "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/bitfoundation/bitplatform.svg)](http://isitmaintained.com/project/bitfoundation/bitplatform "Percentage of issues still open")
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/bitfoundation/bitplatform)
Expand Down
2 changes: 1 addition & 1 deletion src/Besql/Bit.Besql/wwwroot/bit-besql.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var BitBesql = window.BitBesql || {};
BitBesql.version = window['bit-besql version'] = '10.4.1';
BitBesql.version = window['bit-besql version'] = '10.4.2';

BitBesql.persist = async function besqlPersist(fileName) {

Expand Down
2 changes: 1 addition & 1 deletion src/Bit.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<PackageProjectUrl>https://github.com/bitfoundation/bitplatform</PackageProjectUrl>

<!-- Version -->
<ReleaseVersion>10.4.1</ReleaseVersion>
<ReleaseVersion>10.4.2</ReleaseVersion>
<PackageVersion>$(ReleaseVersion)</PackageVersion>
<PackageReleaseNotes>https://github.com/bitfoundation/bitplatform/releases/tag/v-$(ReleaseVersion)</PackageReleaseNotes>
<Version Condition=" '$(Configuration)' == 'Release' ">$([System.String]::Copy($(ReleaseVersion)).Replace('-pre-', '.'))</Version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project>
<ItemGroup>
<Content Remove="$(NuGetPackageRoot)/bit.blazores2019/10.4.1/contentFiles/any/net9.0/wwwroot/_framework/*.js" Condition="$(TargetFramework.Contains('net9.0'))" />
<Content Include="$(NuGetPackageRoot)/bit.blazores2019/10.4.1/contentFiles/any/net9.0/wwwroot/_framework/*.js" Condition="$(TargetFramework.Contains('net9.0'))">
<Content Remove="$(NuGetPackageRoot)/bit.blazores2019/10.4.2/contentFiles/any/net9.0/wwwroot/_framework/*.js" Condition="$(TargetFramework.Contains('net9.0'))" />
<Content Include="$(NuGetPackageRoot)/bit.blazores2019/10.4.2/contentFiles/any/net9.0/wwwroot/_framework/*.js" Condition="$(TargetFramework.Contains('net9.0'))">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
<Link>wwwroot\_framework\%(Filename)%(Extension)</Link>
</Content>
<Content Remove="$(NuGetPackageRoot)/bit.blazores2019/10.4.1/contentFiles/any/net10.0/wwwroot/_framework/*.js" Condition="$(TargetFramework.Contains('net10.0'))" />
<Content Include="$(NuGetPackageRoot)/bit.blazores2019/10.4.1/contentFiles/any/net10.0/wwwroot/_framework/*.js" Condition="$(TargetFramework.Contains('net10.0'))">
<Content Remove="$(NuGetPackageRoot)/bit.blazores2019/10.4.2/contentFiles/any/net10.0/wwwroot/_framework/*.js" Condition="$(TargetFramework.Contains('net10.0'))" />
<Content Include="$(NuGetPackageRoot)/bit.blazores2019/10.4.2/contentFiles/any/net10.0/wwwroot/_framework/*.js" Condition="$(TargetFramework.Contains('net10.0'))">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
<Link>wwwroot\_framework\%(Filename)%(Extension)</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
TItem="(int RowIndex, TGridItem Data)"
ItemsProvider="@ProvideVirtualizedItems"
ItemContent="@(item => builder => RenderRow(builder, item.RowIndex, item.Data))"
Placeholder="@(placeholderContext => builder => RenderPlaceholderRow(builder, placeholderContext))" />
Placeholder="@(placeholderContext => builder => RenderPlaceholderRow(builder, placeholderContext))" />
}
else
{
Expand Down Expand Up @@ -71,6 +71,24 @@
}

private void RenderRow(RenderTreeBuilder __builder, int rowIndex, TGridItem item)
{
if (RowTemplate is null)
{
RenderOriginalRow(__builder, rowIndex, item);
}
else
{
var args = new BitDataGridRowTemplateArgs<TGridItem>
{
RowIndex = rowIndex,
RowItem = item,
OriginalRow = (builder) => RenderOriginalRow(builder, rowIndex, item)
};
__builder.AddContent(0, RowTemplate(args));
}
}

private void RenderOriginalRow(RenderTreeBuilder __builder, int rowIndex, TGridItem item)
{
<tr @key="@(ItemKey(item))" aria-rowindex="@rowIndex" class="@GetRowClass(item)" style="@GetRowStyle(item)">
@foreach (var col in _columns)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ public BitDataGrid()
/// </summary>
[Parameter] public Func<TGridItem, string>? RowStyleSelector { get; set; }

/// <summary>
/// Optional template to customize row rendering. Receives <see cref="BitDataGridRowTemplateArgs{TGridItem}"/> with
/// <see cref="BitDataGridRowTemplateArgs{T}.OriginalRow"/> set to the default row content; call it to render the original cells or replace with custom content.
/// </summary>
[Parameter] public RenderFragment<BitDataGridRowTemplateArgs<TGridItem>>? RowTemplate { get; set; }

/// <summary>
/// A theme name, with default value "default". This affects which styling rules match the table.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace Bit.BlazorUI;

/// <summary>
/// Arguments passed to the <see cref="BitDataGrid{T}.RowTemplate"/> render fragment.
/// </summary>
/// <typeparam name="T">The type of data represented by each row in the grid.</typeparam>
public class BitDataGridRowTemplateArgs<T>
{
/// <summary>
/// A render fragment that produces the original row markup (the default <c>&lt;tr&gt;</c> with all column cells).
/// Render this in your custom template to include the default row, or omit it to replace entirely.
/// </summary>
public required RenderFragment OriginalRow { get; set; }

/// <summary>
/// The 1-based row index used for accessibility (e.g. aria-rowindex).
/// </summary>
public int RowIndex { get; set; }

/// <summary>
/// The data item for this row.
/// </summary>
public T RowItem { get; set; } = default!;
}
Loading
Loading