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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **BREAKING**: In the `Filtering` and `Filtered` events, `IgbGridLiteFilterExpression.SearchTerm` holds a `string`, `double` or `bool` instead of a `JsonElement`. Numbers are always `double`, as JavaScript has one number type, so a search term set as an `int` comes back as a `double`.
- **BREAKING**: `IgbGridLiteFilterExpression.Criteria` is a `GridLiteFilterCriteria?` (`And`, `Or`) instead of a `string?`, and `IgbGridLiteFilteringEventArgs.Type` is a `GridLiteFilteringType` (`Add`, `Modify`, `Remove`) instead of a `string`.
- **BREAKING**: `IgbGridLiteFilteringEventArgs.Expressions` and `IgbGridLiteFilteredEventArgs.State` are `IReadOnlyList<IgbGridLiteFilterExpression>` instead of `List<IgbGridLiteFilterExpression>`.
- **BREAKING**: Renamed `IgbColumnConfiguration` → `IgbGridLiteColumnConfiguration`, the only public type without `GridLite` in its name.
- **BREAKING**: `GetColumnsAsync` returns `Task<IgbGridLiteColumnConfiguration[]>` instead of a `ValueTask`, like the grid's other methods.
- **BREAKING**: The single-expression overload of `SortAsync` names its parameter `expression` instead of `expressions`. Only calls that name the argument are affected.
- **BREAKING**: `NavigateToAsync` takes its `row` index as an `int` instead of a `long`, like collection indexers and other grids' row-index APIs. Calls passing a `long` need a cast.

## 0.10.0 - 2026-09-29

Expand Down
10 changes: 5 additions & 5 deletions demo/GridLite.DemoApp/Components/Pages/Home.razor
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@
{
cols = [
.. cols,
new IgbColumnConfiguration {
new IgbGridLiteColumnConfiguration {
Field = nameof(NwindDataItem.QuantityPerUnit),
Header="Quantity Per Unit",
DataType = GridLiteColumnDataType.String,
Sortable = true,
Filterable = true,
Resizable = true
},
new IgbColumnConfiguration {
new IgbGridLiteColumnConfiguration {
Field = nameof(NwindDataItem.UnitPrice),
Header="Unit Price",
DataType = GridLiteColumnDataType.Number,
Expand Down Expand Up @@ -155,8 +155,8 @@

}

public List<IgbColumnConfiguration> cols = new List<IgbColumnConfiguration> {
new IgbColumnConfiguration {
public List<IgbGridLiteColumnConfiguration> cols = new List<IgbGridLiteColumnConfiguration> {
new IgbGridLiteColumnConfiguration {
Field = nameof(NwindDataItem.ProductID),
Header="Product ID",
DataType = GridLiteColumnDataType.Number,
Expand All @@ -165,7 +165,7 @@
Filterable = true,
Resizable = false
},
new IgbColumnConfiguration {
new IgbGridLiteColumnConfiguration {
Field = nameof(NwindDataItem.ProductName),
Header="Product Name",
DataType = GridLiteColumnDataType.String,
Expand Down
14 changes: 7 additions & 7 deletions src/IgniteUI.Blazor.GridLite/IgbGridLite.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,11 @@ public async Task UpdateDataAsync(IEnumerable<TItem> newData)
/// <summary>
/// Performs a sort operation in the grid based on the passed expression(s).
/// </summary>
/// <param name="expressions">The sort expression(s) to apply</param>
public async Task SortAsync(IgbGridLiteSortingExpression expressions)
/// <param name="expression">The sort expression to apply</param>
public async Task SortAsync(IgbGridLiteSortingExpression expression)
{
ArgumentNullException.ThrowIfNull(expressions);
var json = JsonSerializer.Serialize(expressions, GridLiteJsonContext.Default.IgbGridLiteSortingExpression);
ArgumentNullException.ThrowIfNull(expression);
var json = JsonSerializer.Serialize(expression, GridLiteJsonContext.Default.IgbGridLiteSortingExpression);
await InvokeGridAsync("blazor_igc_grid_lite.sort", gridId, json);
}

Expand Down Expand Up @@ -358,7 +358,7 @@ public async Task ClearFilterAsync(string? key = null)
/// Returns the current column configuration list.
/// </summary>
/// <returns>The column configurations</returns>
public async ValueTask<IgbColumnConfiguration[]> GetColumnsAsync()
public async Task<IgbGridLiteColumnConfiguration[]> GetColumnsAsync()
{
if (!await clientRender.Task)
{
Expand All @@ -367,7 +367,7 @@ public async ValueTask<IgbColumnConfiguration[]> GetColumnsAsync()

var columns = await InvokeJsAsync("blazor_igc_grid_lite.getColumns", gridId);
return columns is { ValueKind: JsonValueKind.Array } array
? array.Deserialize(GridLiteJsonContext.Default.IgbColumnConfigurationArray) ?? []
? array.Deserialize(GridLiteJsonContext.Default.IgbGridLiteColumnConfigurationArray) ?? []
: [];
}

Expand All @@ -377,7 +377,7 @@ public async ValueTask<IgbColumnConfiguration[]> GetColumnsAsync()
/// <param name="row">The row index to navigate to</param>
/// <param name="field">The column field to navigate to, if any</param>
/// <param name="activate">Optionally also activate the navigated cell</param>
public async Task NavigateToAsync(long row, string? field = null, bool activate = false)
public async Task NavigateToAsync(int row, string? field = null, bool activate = false)
{
await InvokeGridAsync("blazor_igc_grid_lite.navigateTo", gridId, row, field, activate);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace IgniteUI.Blazor.Controls.Internal;
[JsonSerializable(typeof(IEnumerable<IgbGridLiteSortingExpression>))]
[JsonSerializable(typeof(IgbGridLiteFilterExpression))]
[JsonSerializable(typeof(IEnumerable<IgbGridLiteFilterExpression>))]
[JsonSerializable(typeof(IgbColumnConfiguration[]))]
[JsonSerializable(typeof(IgbGridLiteColumnConfiguration[]))]
[JsonSerializable(typeof(IgbGridLiteFilteringEventArgs))]
[JsonSerializable(typeof(IgbGridLiteFilteredEventArgs))]
internal partial class GridLiteJsonContext : JsonSerializerContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace IgniteUI.Blazor.Controls;
/// <summary>
/// A column's configuration as the grid reports it, returned by <see cref="IgbGridLite{TItem}.GetColumnsAsync"/>.
/// </summary>
public class IgbColumnConfiguration
public class IgbGridLiteColumnConfiguration
{
/// <summary>
/// The field from the data that the column references.
Expand Down
10 changes: 5 additions & 5 deletions tests/IgniteUI.Blazor.GridLite.Tests/GridLiteJsInteropTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ public async Task NavigateToAsync_InvokesNavigateTo_WithAllArguments()

var invocation = GridApi.VerifyInvoke($"{Api}.navigateTo");
Assert.Equal(cut.Find("igc-grid-lite").GetAttribute("id"), invocation.Arguments[0]);
Assert.Equal(5L, invocation.Arguments[1]);
Assert.Equal(5, invocation.Arguments[1]);
Assert.Equal("Price", invocation.Arguments[2]);
Assert.True(Assert.IsType<bool>(invocation.Arguments[3]));
}
Expand Down Expand Up @@ -428,7 +428,7 @@ public async Task GetColumnsAsync_ReturnsEmpty_WhenJsReturnsNothing()
{
var cut = RenderGrid();

var columns = await cut.InvokeAsync(() => cut.Instance.GetColumnsAsync().AsTask());
var columns = await cut.InvokeAsync(() => cut.Instance.GetColumnsAsync());

Assert.Empty(columns);
}
Expand All @@ -439,12 +439,12 @@ public async Task GetColumnsAsync_ReturnsColumns_FromJsResult()
var cut = RenderGrid();
var expected = new[]
{
new IgbColumnConfiguration { Field = "Name", Sortable = true },
new IgbColumnConfiguration { Field = "Price", DataType = GridLiteColumnDataType.Number },
new IgbGridLiteColumnConfiguration { Field = "Name", Sortable = true },
new IgbGridLiteColumnConfiguration { Field = "Price", DataType = GridLiteColumnDataType.Number },
};
GridApi.Setup<JsonElement>($"{Api}.getColumns", _ => true).SetResult(JsonSerializer.SerializeToElement(expected));

var columns = await cut.InvokeAsync(() => cut.Instance.GetColumnsAsync().AsTask());
var columns = await cut.InvokeAsync(() => cut.Instance.GetColumnsAsync());

var invocation = GridApi.VerifyInvoke($"{Api}.getColumns");
Assert.Equal(cut.Find("igc-grid-lite").GetAttribute("id"), invocation.Arguments[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,13 @@ public void SortingOptions_SerializesMode(GridLiteSortingMode mode, string expec
[Fact]
public void ColumnConfiguration_SerializesWithCamelCaseKeys_OmittingDefaults()
{
var json = SerializeToElement(new IgbColumnConfiguration
var json = SerializeToElement(new IgbGridLiteColumnConfiguration
{
Field = "Price",
DataType = GridLiteColumnDataType.Number,
Header = "Unit Price",
Sortable = true,
}, Context.IgbColumnConfiguration);
}, Context.IgbGridLiteColumnConfiguration);

Assert.Equal("Price", json.GetProperty("field").GetString());
Assert.Equal("number", json.GetProperty("dataType").GetString());
Expand All @@ -198,7 +198,7 @@ public void ColumnConfiguration_DeserializesFromJsPayload()
"filterable":true,"filteringCaseSensitive":false}
""";

var column = JsonSerializer.Deserialize(payload, Context.IgbColumnConfiguration);
var column = JsonSerializer.Deserialize(payload, Context.IgbGridLiteColumnConfiguration);

Assert.NotNull(column);
Assert.Equal("ProductName", column.Field);
Expand Down
Loading