diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..972b1a7 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,148 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## [Unreleased] + +### Changed - Breaking Changes + +This release updates the Blazor wrapper to match the API changes from `igniteui-grid-lite` version `0.3.1`. + +#### From igniteui-grid-lite 0.3.1 +- **Removed `updateColumns` JavaScript function** - Columns can now be updated directly through property setters. The Blazor `UpdateColumnsAsync` method now uses the `updateGrid` function internally instead. + +#### From igniteui-grid-lite 0.3.0 - Column Property Renames +- `IgbColumnConfiguration.Key` → `Field` - The field from the data that the column references +- `IgbColumnConfiguration.Type` → `DataType` - The data type of the column's values +- `IgbColumnConfiguration.HeaderText` → `Header` - The header text of the column + +#### From igniteui-grid-lite 0.2.0 - Sort/Filter Property Changes +- Column `Sort` property (object) replaced with: + - `Sortable` (bool) - Enable/disable sorting + - `SortingCaseSensitive` (bool?) - Configure case-sensitive sorting +- Column `Filter` property (object) replaced with: + - `Filterable` (bool) - Enable/disable filtering + - `FilteringCaseSensitive` (bool?) - Configure case-sensitive filtering +- Removed `IgbColumnFilterConfiguration` type (use `FilteringCaseSensitive` boolean directly) +- Removed `IgbColumnSortConfiguration` type (use `Sortable` and `SortingCaseSensitive` directly) + +#### From igniteui-grid-lite 0.1.0 - Sorting API Renames +- `IgbGridLiteSortConfiguration` type → `IgbGridLiteSortingOptions` +- `IgbGridLite.SortConfiguration` property → `SortingOptions` +- `IgbGridLite.SortExpressions` property → `SortingExpressions` +- `IgbGridLiteSortExpression` type → `IgbGridLiteSortingExpression` +- `IgbGridLiteSortingExpression.Key` property → `Field` +- `IgbGridLiteFilterExpression.Key` property → `Field` +- `IgbGridLiteSortingOptions.Multiple` boolean → `Mode` property (accepts `"single"` or `"multiple"`) +- Removed `TriState` property (tri-state sorting is always enabled) +- Updated event args: + - `IgbGridLiteSortingEventArgs.Expression` now uses `IgbGridLiteSortingExpression` type + - `IgbGridLiteSortedEventArgs.Expression` now uses `IgbGridLiteSortingExpression` type + +### Migration Guide + +#### Updating Column Configurations + +**Before:** +```csharp +new IgbColumnConfiguration { + Key = nameof(Product.Name), + Type = GridLiteColumnDataType.String, + HeaderText = "Product Name", + Sort = true, + Filter = new IgbColumnFilterConfiguration { CaseSensitive = false } +} +``` + +**After:** +```csharp +new IgbColumnConfiguration { + Field = nameof(Product.Name), + DataType = GridLiteColumnDataType.String, + Header = "Product Name", + Sortable = true, + Filterable = true, + FilteringCaseSensitive = false +} +``` + +#### Updating Sort Configuration + +**Before:** +```csharp +private IgbGridLiteSortConfiguration sortConfig = new() { + Multiple = true, + TriState = false +}; + + +``` + +**After:** +```csharp +private IgbGridLiteSortingOptions sortingOptions = new() { + Mode = "multiple" +}; + + +``` + +#### Updating Sort Expressions + +**Before:** +```csharp +private List sortExpressions = new() { + new() { Key = nameof(Product.Name), Direction = GridLiteSortingDirection.Ascending } +}; + + +``` + +**After:** +```csharp +private List sortingExpressions = new() { + new() { Field = nameof(Product.Name), Direction = GridLiteSortingDirection.Ascending } +}; + + +``` + +#### Updating Filter Expressions + +**Before:** +```csharp +new IgbGridLiteFilterExpression { + Key = nameof(Product.Department), + Condition = "contains", + SearchTerm = "Sales" +} +``` + +**After:** +```csharp +new IgbGridLiteFilterExpression { + Field = nameof(Product.Department), + Condition = "contains", + SearchTerm = "Sales" +} +``` + +#### Updating Method Calls + +**Before:** +```csharp +await grid.UpdateColumnsAsync(newColumns); +await grid.SortAsync(new IgbGridLiteSortExpression { ... }); +``` + +**After:** +```csharp +// UpdateColumnsAsync still exists but now uses updateGrid internally +await grid.UpdateColumnsAsync(newColumns); +// Or use parameter binding directly +grid.Columns = newColumns; +await grid.SortAsync(new IgbGridLiteSortingExpression { ... }); +``` + +### Dependencies +- Updated `igniteui-grid-lite` from `~0.0.1` to `~0.3.1` diff --git a/README.md b/README.md index 0b38c32..4667df5 100644 --- a/README.md +++ b/README.md @@ -64,10 +64,10 @@ In your `App.razor` or layout file, include one of the available themes: columns = new List { - new() { Key = nameof(Employee.Id), HeaderText = "ID", Width = "100px", Type = GridLiteColumnDataType.Number }, - new() { Key = nameof(Employee.Name), HeaderText = "Employee Name", Type = GridLiteColumnDataType.String }, - new() { Key = nameof(Employee.Department), HeaderText = "Department", Type = GridLiteColumnDataType.String }, - new() { Key = nameof(Employee.Salary), HeaderText = "Salary", Width = "150px", Type = GridLiteColumnDataType.Number } + new() { Field = nameof(Employee.Id), Header = "ID", Width = "100px", DataType = GridLiteColumnDataType.Number }, + new() { Field = nameof(Employee.Name), Header = "Employee Name", DataType = GridLiteColumnDataType.String }, + new() { Field = nameof(Employee.Department), Header = "Department", DataType = GridLiteColumnDataType.String }, + new() { Field = nameof(Employee.Salary), Header = "Salary", Width = "150px", DataType = GridLiteColumnDataType.Number } }; } } @@ -78,18 +78,18 @@ In your `App.razor` or layout file, include one of the available themes: ```razor @code { - private List initialSort = new() + private List initialSort = new() { - new() { Key = nameof(Employee.Name), Direction = GridLiteSortingDirection.Ascending } + new() { Field = nameof(Employee.Name), Direction = GridLiteSortingDirection.Ascending } }; private List initialFilter = new() { - new() { Key = nameof(Employee.Department), Condition = "contains", SearchTerm = "Sales" } + new() { Field = nameof(Employee.Department), Condition = "contains", SearchTerm = "Sales" } }; } ``` @@ -103,10 +103,22 @@ Enable sorting on specific columns: ```csharp new IgbColumnConfiguration { - Key = nameof(Employee.Name), - HeaderText = "Name", + Field = nameof(Employee.Name), + Header = "Name", Resizable = true, - Sort = true // Enable sorting + Sortable = true // Enable sorting +} +``` + +Configure sorting case sensitivity: + +```csharp +new IgbColumnConfiguration +{ + Field = nameof(Employee.Name), + Header = "Name", + Sortable = true, + SortingCaseSensitive = false // Case-insensitive sorting } ``` @@ -117,12 +129,21 @@ Enable filtering on columns: ```csharp new IgbColumnConfiguration { - Key = nameof(Employee.Department), - HeaderText = "Department", - Filter = new IgbColumnFilterConfiguration - { - CaseSensitive = false - } + Field = nameof(Employee.Department), + Header = "Department", + Filterable = true +} +``` + +Configure filtering case sensitivity: + +```csharp +new IgbColumnConfiguration +{ + Field = nameof(Employee.Department), + Header = "Department", + Filterable = true, + FilteringCaseSensitive = false // Case-insensitive filtering } ``` @@ -165,14 +186,16 @@ Handle sorting and filtering events: The `IgbColumnConfiguration` class supports: -- `Key`: Property name to bind to (use `nameof()` for type safety) -- `HeaderText`: Column header display text +- `Field`: Property name to bind to (use `nameof()` for type safety) +- `Header`: Column header display text - `Width`: Column width (CSS value) -- `Type`: Data type (String, Number, Boolean, Date) +- `DataType`: Data type (String, Number, Boolean, Date) - `Hidden`: Hide column - `Resizable`: Allow column resizing -- `Sort`: Enable/configure sorting -- `Filter`: Enable/configure filtering +- `Sortable`: Enable sorting (boolean) +- `SortingCaseSensitive`: Configure case-sensitive sorting (nullable boolean) +- `Filterable`: Enable filtering (boolean) +- `FilteringCaseSensitive`: Configure case-sensitive filtering (nullable boolean) ## Building from Source diff --git a/demo/GridLite.DemoApp/Components/Pages/Home.razor b/demo/GridLite.DemoApp/Components/Pages/Home.razor index 714f867..1f32872 100644 --- a/demo/GridLite.DemoApp/Components/Pages/Home.razor +++ b/demo/GridLite.DemoApp/Components/Pages/Home.razor @@ -1,8 +1,8 @@ @page "/" @@ -15,13 +15,12 @@ @code { public IgbGridLite grid; - private IgbGridLiteSortConfiguration sortConfiguration = new IgbGridLiteSortConfiguration() + private IgbGridLiteSortingOptions sortingOptions = new IgbGridLiteSortingOptions() { - Multiple = true, - TriState = false + Mode = "multiple" }; - private List initialSort; + private List initialSort; private List initialFilter; private bool showUnitColumns = false; @@ -31,23 +30,23 @@ { new IgbGridLiteFilterExpression { - Key = nameof(NwindDataItem.ProductName), + Field = nameof(NwindDataItem.ProductName), Condition = "contains", SearchTerm = "a" }, new IgbGridLiteFilterExpression { - Key = nameof(NwindDataItem.ProductName), + Field = nameof(NwindDataItem.ProductName), Condition = "contains", SearchTerm = "b" } }; - initialSort = new List + initialSort = new List { - new IgbGridLiteSortExpression + new IgbGridLiteSortingExpression { - Key = nameof(NwindDataItem.ProductName), + Field = nameof(NwindDataItem.ProductName), Direction = GridLiteSortingDirection.Ascending } }; @@ -55,9 +54,9 @@ public async Task BtnClick() { - await this.grid.SortAsync(new List + await this.grid.SortAsync(new List { - new IgbGridLiteSortExpression() { Key = nameof(NwindDataItem.ProductName), Direction = GridLiteSortingDirection.Descending } + new IgbGridLiteSortingExpression() { Field = nameof(NwindDataItem.ProductName), Direction = GridLiteSortingDirection.Descending } } ); } @@ -70,25 +69,25 @@ cols = [ .. cols, new IgbColumnConfiguration { - Key = nameof(NwindDataItem.QuantityPerUnit), - Type = GridLiteColumnDataType.String, - Sort = true, - Filter = true, + Field = nameof(NwindDataItem.QuantityPerUnit), + DataType = GridLiteColumnDataType.String, + Sortable = true, + Filterable = true, Resizable = true }, new IgbColumnConfiguration { - Key = nameof(NwindDataItem.UnitPrice), - Type = GridLiteColumnDataType.Number, - Sort = true, - Filter = true, + Field = nameof(NwindDataItem.UnitPrice), + DataType = GridLiteColumnDataType.Number, + Sortable = true, + Filterable = true, Resizable = true } ]; initialSort = [ .. initialSort, - new IgbGridLiteSortExpression + new IgbGridLiteSortingExpression { - Key = nameof(NwindDataItem.QuantityPerUnit), + Field = nameof(NwindDataItem.QuantityPerUnit), Direction = GridLiteSortingDirection.Ascending } ]; @@ -135,19 +134,18 @@ public List cols = new List { new IgbColumnConfiguration { - Key = nameof(NwindDataItem.ProductID), - Type = GridLiteColumnDataType.Number, - Sort = new IgbColumnSortConfiguration { - CaseSensitive = false - }, - Filter = true, + Field = nameof(NwindDataItem.ProductID), + DataType = GridLiteColumnDataType.Number, + Sortable = true, + SortingCaseSensitive = false, + Filterable = true, Resizable = true }, new IgbColumnConfiguration { - Key = nameof(NwindDataItem.ProductName), - Type = GridLiteColumnDataType.String, - Sort = true, - Filter = true, + Field = nameof(NwindDataItem.ProductName), + DataType = GridLiteColumnDataType.String, + Sortable = true, + Filterable = true, Resizable = true }, }; diff --git a/src/IgniteUI.Blazor.GridLite/IgbGridLite.razor.cs b/src/IgniteUI.Blazor.GridLite/IgbGridLite.razor.cs index 019c8f9..7c2ca8a 100644 --- a/src/IgniteUI.Blazor.GridLite/IgbGridLite.razor.cs +++ b/src/IgniteUI.Blazor.GridLite/IgbGridLite.razor.cs @@ -45,13 +45,13 @@ public partial class IgbGridLite : ComponentBase, IDisposable where TItem /// Sort configuration property for the grid. /// [Parameter] - public IgbGridLiteSortConfiguration? SortConfiguration { get; set; } + public IgbGridLiteSortingOptions? SortingOptions { get; set; } /// /// Initial sort expressions to apply when the grid is rendered /// [Parameter] - public IEnumerable? SortExpressions { get; set; } + public IEnumerable? SortingExpressions { get; set; } /// /// Initial filter expressions to apply when the grid is rendered @@ -189,16 +189,16 @@ public override async Task SetParametersAsync(ParameterView parameters) updateConfig["autoGenerate"] = newAutoGenerate; } - if (parameters.TryGetValue(nameof(SortConfiguration), out var newSortConfig) - && !ReferenceEquals(SortConfiguration, newSortConfig)) + if (parameters.TryGetValue(nameof(SortingOptions), out var newSortConfig) + && !ReferenceEquals(SortingOptions, newSortConfig)) { - updateConfig["sortConfiguration"] = newSortConfig; + updateConfig["sortingOptions"] = newSortConfig; } - if (parameters.TryGetValue?>(nameof(SortExpressions), out var newSortExpressions) - && !ReferenceEquals(SortExpressions, newSortExpressions)) + if (parameters.TryGetValue?>(nameof(SortingExpressions), out var newSortExpressions) + && !ReferenceEquals(SortingExpressions, newSortExpressions)) { - updateConfig["sortExpressions"] = newSortExpressions; + updateConfig["sortingExpressions"] = newSortExpressions; } if (parameters.TryGetValue?>(nameof(FilterExpressions), out var newFilterExpressions) @@ -240,8 +240,8 @@ private async Task RenderGridAsync() data = Data, columns = Columns?.Select(c => c.ToJsConfig()).ToList() ?? [], autoGenerate = AutoGenerate, - sortConfiguration = SortConfiguration, - sortExpressions = SortExpressions, + sortingOptions = SortingOptions, + sortingExpressions = SortingExpressions, filterExpressions = FilterExpressions }; @@ -291,15 +291,19 @@ public virtual async Task UpdateDataAsync(IEnumerable newData) public virtual async Task UpdateColumnsAsync(List newColumns) { Columns = newColumns; - var json = JsonSerializer.Serialize(newColumns.Select(c => c.ToJsConfig()), GridJsonSerializerOptions); - await InvokeVoidJsAsync("blazor_igc_grid_lite.updateColumns", gridId, json); + var updateConfig = new Dictionary + { + ["columns"] = newColumns.Select(c => c.ToJsConfig()).ToList() + }; + var json = JsonSerializer.Serialize(updateConfig, GridJsonSerializerOptions); + await InvokeVoidJsAsync("blazor_igc_grid_lite.updateGrid", gridId, json); } /// /// Performs a sort operation in the grid based on the passed expression(s). /// /// The sort expression(s) to apply - public virtual async Task SortAsync(IgbGridLiteSortExpression expressions) + public virtual async Task SortAsync(IgbGridLiteSortingExpression expressions) { var json = JsonSerializer.Serialize(expressions, GridJsonSerializerOptions); await InvokeVoidJsAsync("blazor_igc_grid_lite.sort", gridId, json); @@ -309,7 +313,7 @@ public virtual async Task SortAsync(IgbGridLiteSortExpression expressions) /// Performs a sort operation in the grid based on the passed expression(s). /// /// The sort expression(s) to apply - public virtual async Task SortAsync(List expressions) + public virtual async Task SortAsync(List expressions) { var json = JsonSerializer.Serialize(expressions, GridJsonSerializerOptions); await InvokeVoidJsAsync("blazor_igc_grid_lite.sort", gridId, json); @@ -358,11 +362,11 @@ public virtual async Task ClearFilterAsync(string key = null) /// /// Returns a column configuration for a given column. /// - /// The column key to retrieve + /// The column field to retrieve /// The column configuration if found, otherwise null - public virtual IgbColumnConfiguration GetColumn(string key) + public virtual IgbColumnConfiguration GetColumn(string field) { - return Columns?.FirstOrDefault(c => c.Key == key); + return Columns?.FirstOrDefault(c => c.Field == field); } /// diff --git a/src/IgniteUI.Blazor.GridLite/Internal/JSHandler.cs b/src/IgniteUI.Blazor.GridLite/Internal/JSHandler.cs index 7c35508..4751dd2 100644 --- a/src/IgniteUI.Blazor.GridLite/Internal/JSHandler.cs +++ b/src/IgniteUI.Blazor.GridLite/Internal/JSHandler.cs @@ -39,7 +39,7 @@ public async Task JSSorting(JsonElement sortExpression) try { - var expression = JsonSerializer.Deserialize( + var expression = JsonSerializer.Deserialize( sortExpression.GetRawText()); var eventArgs = new IgbGridLiteSortingEventArgs @@ -74,7 +74,7 @@ public void JSSorted(JsonElement sortExpression) try { - var expression = JsonSerializer.Deserialize( + var expression = JsonSerializer.Deserialize( sortExpression.GetRawText()); var eventArgs = new IgbGridLiteSortedEventArgs diff --git a/src/IgniteUI.Blazor.GridLite/Models/Events/IgbGridLiteSortedEventArgs.cs b/src/IgniteUI.Blazor.GridLite/Models/Events/IgbGridLiteSortedEventArgs.cs index 3f304a8..36b9c26 100644 --- a/src/IgniteUI.Blazor.GridLite/Models/Events/IgbGridLiteSortedEventArgs.cs +++ b/src/IgniteUI.Blazor.GridLite/Models/Events/IgbGridLiteSortedEventArgs.cs @@ -11,5 +11,5 @@ public class IgbGridLiteSortedEventArgs /// The sort expression used for the operation. /// [JsonPropertyName("expression")] - public IgbGridLiteSortExpression Expression { get; set; } + public IgbGridLiteSortingExpression Expression { get; set; } } \ No newline at end of file diff --git a/src/IgniteUI.Blazor.GridLite/Models/Events/IgbGridLiteSortingEventArgs.cs b/src/IgniteUI.Blazor.GridLite/Models/Events/IgbGridLiteSortingEventArgs.cs index a75cf2d..6982526 100644 --- a/src/IgniteUI.Blazor.GridLite/Models/Events/IgbGridLiteSortingEventArgs.cs +++ b/src/IgniteUI.Blazor.GridLite/Models/Events/IgbGridLiteSortingEventArgs.cs @@ -11,7 +11,7 @@ public class IgbGridLiteSortingEventArgs /// The sort expression which will be used for the operation. /// [JsonPropertyName("expression")] - public IgbGridLiteSortExpression Expression { get; set; } + public IgbGridLiteSortingExpression Expression { get; set; } /// /// Set to true to cancel the operation. diff --git a/src/IgniteUI.Blazor.GridLite/Models/IgbColumnConfiguration.cs b/src/IgniteUI.Blazor.GridLite/Models/IgbColumnConfiguration.cs index 5ccc68a..5a4e537 100644 --- a/src/IgniteUI.Blazor.GridLite/Models/IgbColumnConfiguration.cs +++ b/src/IgniteUI.Blazor.GridLite/Models/IgbColumnConfiguration.cs @@ -5,16 +5,16 @@ namespace IgniteUI.Blazor.Controls; public class IgbColumnConfiguration { - [JsonPropertyName("key")] - public string Key { get; set; } + [JsonPropertyName("field")] + public string Field { get; set; } - [JsonPropertyName("type")] + [JsonPropertyName("dataType")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public GridLiteColumnDataType? Type { get; set; } + public GridLiteColumnDataType? DataType { get; set; } - [JsonPropertyName("headerText")] + [JsonPropertyName("header")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string HeaderText { get; set; } + public string Header { get; set; } [JsonPropertyName("width")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] @@ -28,13 +28,21 @@ public class IgbColumnConfiguration [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] public bool Resizable { get; set; } - [JsonPropertyName("sort")] + [JsonPropertyName("sortable")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public bool Sortable { get; set; } + + [JsonPropertyName("sortingCaseSensitive")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public object Sort { get; set; } + public bool? SortingCaseSensitive { get; set; } + + [JsonPropertyName("filterable")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public bool Filterable { get; set; } - [JsonPropertyName("filter")] + [JsonPropertyName("filteringCaseSensitive")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public object Filter { get; set; } + public bool? FilteringCaseSensitive { get; set; } [JsonIgnore] internal Func, object> HeaderTemplate { get; set; } @@ -50,45 +58,18 @@ internal object ToJsConfig() { return new { - key = Key, - type = Type?.ToString().ToLower(), - headerText = HeaderText, + field = Field, + dataType = DataType?.ToString().ToLower(), + header = Header, width = Width, hidden = Hidden, resizable = Resizable, - sort = ConvertSortConfig(Sort), - filter = ConvertFilterConfig(Filter) + sortable = Sortable, + sortingCaseSensitive = SortingCaseSensitive, + filterable = Filterable, + filteringCaseSensitive = FilteringCaseSensitive }; } - - private static object ConvertSortConfig(object sort) - { - if (sort == null) return null; - if (sort is bool b) return b; - if (sort is IgbColumnSortConfiguration config) - { - return new - { - caseSensitive = config.CaseSensitive - // Note: Comparer functions cannot be serialized - }; - } - return sort; - } - - private static object ConvertFilterConfig(object filter) - { - if (filter == null) return null; - if (filter is bool b) return b; - if (filter is IgbColumnFilterConfiguration config) - { - return new - { - caseSensitive = config.CaseSensitive - }; - } - return filter; - } } /// diff --git a/src/IgniteUI.Blazor.GridLite/Models/IgbColumnFilterConfiguration.cs b/src/IgniteUI.Blazor.GridLite/Models/IgbColumnFilterConfiguration.cs deleted file mode 100644 index 9e71480..0000000 --- a/src/IgniteUI.Blazor.GridLite/Models/IgbColumnFilterConfiguration.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Text.Json.Serialization; - -namespace IgniteUI.Blazor.Controls; - -/// -/// Extended filter configuration for a column. -/// -public class IgbColumnFilterConfiguration -{ - /// - /// Whether the filter operations will be case sensitive. - /// - [JsonPropertyName("caseSensitive")] - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? CaseSensitive { get; set; } -} \ No newline at end of file diff --git a/src/IgniteUI.Blazor.GridLite/Models/IgbColumnSortConfiguration.cs b/src/IgniteUI.Blazor.GridLite/Models/IgbColumnSortConfiguration.cs deleted file mode 100644 index 177b1b0..0000000 --- a/src/IgniteUI.Blazor.GridLite/Models/IgbColumnSortConfiguration.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Text.Json.Serialization; - -namespace IgniteUI.Blazor.Controls; - -/// -/// Extended sort configuration for a column. -/// -public class IgbColumnSortConfiguration -{ - /// - /// Whether the sort operations will be case sensitive. - /// - [JsonPropertyName("caseSensitive")] - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public bool? CaseSensitive { get; set; } - - /// - /// Custom comparer function for sort operations for this column. - /// Note: This is not directly supported in Blazor and would need JavaScript interop. - /// - [JsonIgnore] - internal Func Comparer { get; set; } -} \ No newline at end of file diff --git a/src/IgniteUI.Blazor.GridLite/Models/IgbGridLiteFilterExpression.cs b/src/IgniteUI.Blazor.GridLite/Models/IgbGridLiteFilterExpression.cs index dfdbe18..45e9507 100644 --- a/src/IgniteUI.Blazor.GridLite/Models/IgbGridLiteFilterExpression.cs +++ b/src/IgniteUI.Blazor.GridLite/Models/IgbGridLiteFilterExpression.cs @@ -10,8 +10,8 @@ public class IgbGridLiteFilterExpression /// /// The target column for the filter operation. /// - [JsonPropertyName("key")] - public string Key { get; set; } + [JsonPropertyName("field")] + public string Field { get; set; } /// /// The filter condition to apply. Can be a condition name (string) or a FilterOperation // TODO diff --git a/src/IgniteUI.Blazor.GridLite/Models/IgbGridLiteSortConfiguration.cs b/src/IgniteUI.Blazor.GridLite/Models/IgbGridLiteSortConfiguration.cs deleted file mode 100644 index b882c9e..0000000 --- a/src/IgniteUI.Blazor.GridLite/Models/IgbGridLiteSortConfiguration.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Text.Json.Serialization; - -namespace IgniteUI.Blazor.Controls; - -/// -/// Configures the sort behavior for the grid. -/// -public class IgbGridLiteSortConfiguration -{ - /// - /// Whether multiple sorting is enabled. - /// - [JsonPropertyName("multiple")] - public bool Multiple { get; set; } = true; - - /// - /// Whether tri-state sorting is enabled. - /// - [JsonPropertyName("triState")] - public bool TriState { get; set; } = true; -} \ No newline at end of file diff --git a/src/IgniteUI.Blazor.GridLite/Models/IgbGridLiteSortExpression.cs b/src/IgniteUI.Blazor.GridLite/Models/IgbGridLiteSortingExpression.cs similarity index 93% rename from src/IgniteUI.Blazor.GridLite/Models/IgbGridLiteSortExpression.cs rename to src/IgniteUI.Blazor.GridLite/Models/IgbGridLiteSortingExpression.cs index cfab65c..db92347 100644 --- a/src/IgniteUI.Blazor.GridLite/Models/IgbGridLiteSortExpression.cs +++ b/src/IgniteUI.Blazor.GridLite/Models/IgbGridLiteSortingExpression.cs @@ -6,13 +6,13 @@ namespace IgniteUI.Blazor.Controls; /// /// Represents a sort operation for a given column. /// -public class IgbGridLiteSortExpression +public class IgbGridLiteSortingExpression { /// /// The target column. /// - [JsonPropertyName("key")] - public string Key { get; set; } + [JsonPropertyName("field")] + public string Field { get; set; } /// /// Sort direction for this operation. diff --git a/src/IgniteUI.Blazor.GridLite/Models/IgbGridLiteSortingOptions.cs b/src/IgniteUI.Blazor.GridLite/Models/IgbGridLiteSortingOptions.cs new file mode 100644 index 0000000..be94d8d --- /dev/null +++ b/src/IgniteUI.Blazor.GridLite/Models/IgbGridLiteSortingOptions.cs @@ -0,0 +1,15 @@ +using System.Text.Json.Serialization; + +namespace IgniteUI.Blazor.Controls; + +/// +/// Configures the sort behavior for the grid. +/// +public class IgbGridLiteSortingOptions +{ + /// + /// Sorting mode - "single" or "multiple". + /// + [JsonPropertyName("mode")] + public string Mode { get; set; } = "multiple"; +} \ No newline at end of file diff --git a/src/IgniteUI.Blazor.GridLite/igc-grid-lite-entry.js b/src/IgniteUI.Blazor.GridLite/igc-grid-lite-entry.js index 18a6bdc..194f5c5 100644 --- a/src/IgniteUI.Blazor.GridLite/igc-grid-lite-entry.js +++ b/src/IgniteUI.Blazor.GridLite/igc-grid-lite-entry.js @@ -30,12 +30,12 @@ window.blazor_igc_grid_lite = { gridElement.autoGenerate = config.autoGenerate; } - if (config.sortConfiguration) { - gridElement.sortConfiguration = config.sortConfiguration; + if (config.sortingOptions) { + gridElement.sortingOptions = config.sortingOptions; } - if (config.sortExpressions) { - gridElement.sortExpressions = config.sortExpressions; + if (config.sortingExpressions) { + gridElement.sortingExpressions = config.sortingExpressions; } if (config.filterExpressions) { @@ -98,12 +98,12 @@ window.blazor_igc_grid_lite = { grid.autoGenerate = config.autoGenerate; } - if (config.sortConfiguration !== undefined) { - grid.sortConfiguration = config.sortConfiguration; + if (config.sortingOptions !== undefined) { + grid.sortingOptions = config.sortingOptions; } - if (config.sortExpressions !== undefined) { - grid.sortExpressions = config.sortExpressions; + if (config.sortingExpressions !== undefined) { + grid.sortingExpressions = config.sortingExpressions; } if (config.filterExpressions !== undefined) { @@ -122,13 +122,6 @@ window.blazor_igc_grid_lite = { } }, - updateColumns(id, columns) { - const grid = this.grids.get(id); - if (grid) { - grid.columns = JSON.parse(columns); - } - }, - sort(id, expressions) { const grid = this.grids.get(id); if (grid) { diff --git a/src/IgniteUI.Blazor.GridLite/package-lock.json b/src/IgniteUI.Blazor.GridLite/package-lock.json index 446842a..9378251 100644 --- a/src/IgniteUI.Blazor.GridLite/package-lock.json +++ b/src/IgniteUI.Blazor.GridLite/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0", "license": "MIT", "dependencies": { - "igniteui-grid-lite": "~0.0.1" + "igniteui-grid-lite": "~0.3.1" }, "devDependencies": { "terser": "^5.44.1", @@ -991,9 +991,9 @@ } }, "node_modules/igniteui-grid-lite": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/igniteui-grid-lite/-/igniteui-grid-lite-0.0.1.tgz", - "integrity": "sha512-QR+yu3lW8jtF5tfR+HChw+ksnTbMz8vIAEbPv0kJyNR0Dk2nCQSuw8z531psgl6ket2o1OoGDpkZJNgNNQ9T2g==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/igniteui-grid-lite/-/igniteui-grid-lite-0.3.1.tgz", + "integrity": "sha512-8uZNutfNtuqEmDtoCCqLBFSm6s7zpKbMX47kxgItq3T52u+JyUcKyloG+GGr4ywPKGdy1WwQlqT/B7nxFBbZjQ==", "license": "MIT", "dependencies": { "@lit-labs/virtualizer": "~2.1.0", diff --git a/src/IgniteUI.Blazor.GridLite/package.json b/src/IgniteUI.Blazor.GridLite/package.json index 5c9b7eb..4fd7e1f 100644 --- a/src/IgniteUI.Blazor.GridLite/package.json +++ b/src/IgniteUI.Blazor.GridLite/package.json @@ -16,6 +16,6 @@ "vite": "^7.2.2" }, "dependencies": { - "igniteui-grid-lite": "~0.0.1" + "igniteui-grid-lite": "~0.3.1" } }