From 471d0e2abc173e7e2df41a5d7596c6bf438263ee Mon Sep 17 00:00:00 2001 From: Vikram Reddy Date: Mon, 7 Aug 2023 13:47:47 +0530 Subject: [PATCH] Docs update --- blazorbootstrap/Components/Grid/Grid.razor.cs | 4 +- .../blog/2023-08-12-blazorbootstrap-1.10.0.md | 57 +++++++++++++++++++ docs/docs/05-components/grid.md | 51 +++++++++++++---- docs/package.json | 2 +- 4 files changed, 100 insertions(+), 14 deletions(-) create mode 100644 docs/blog/2023-08-12-blazorbootstrap-1.10.0.md diff --git a/blazorbootstrap/Components/Grid/Grid.razor.cs b/blazorbootstrap/Components/Grid/Grid.razor.cs index 8c27d6b98..432f9b7d5 100644 --- a/blazorbootstrap/Components/Grid/Grid.razor.cs +++ b/blazorbootstrap/Components/Grid/Grid.razor.cs @@ -49,13 +49,13 @@ public partial class Grid : BaseComponent #region Methods - protected override async Task OnInitializedAsync() + protected override void OnInitialized() { headerCheckboxId = IdGenerator.Generate; pageSize = PageSize; - await base.OnInitializedAsync(); + base.OnInitialized(); } protected override Task OnParametersSetAsync() diff --git a/docs/blog/2023-08-12-blazorbootstrap-1.10.0.md b/docs/blog/2023-08-12-blazorbootstrap-1.10.0.md new file mode 100644 index 000000000..00a375694 --- /dev/null +++ b/docs/blog/2023-08-12-blazorbootstrap-1.10.0.md @@ -0,0 +1,57 @@ +--- +title: Blazor Bootstrap v1.10.0 +authors: + name: Vikram Reddy + title: Creator + url: https://github.com/gvreddy04 + image_url: https://avatars.githubusercontent.com/u/2337067 +tags: [v1.10.0, blazor, bootstrap, bootstrap5, blazorbootstrap, grid, blazorgrid] +--- + +We are excited to release 1.10.0 with new Table and Card component. Charts, Grid, Button, Tooltip, and Switch component updates!!! + +![image](https://i.imgur.com/qH7G1ZT.png "Blazor Bootstrap: Grid Component") + + + +## What's New + +- `Table` Component + - TODO: Update + +- `Card` Component + - TODO: Update + +## What's changed + +- `Bar Chart` component + - TODO: Update + +- `Doughnut Chart` component + - TODO: Update + +- `Line Chart` component + - TODO: Update + +- `Pie Chart` component + - TODO: Update + +- `Grid` component + - Grid: Filters translation support [#292](https://github.com/vikramlearning/blazorbootstrap/issues/292) + +- `Button` component + - Tooltip color support added + +- `Tooltip` component + - Tooltip color support added + - Tooltip on button problem [#296](https://github.com/vikramlearning/blazorbootstrap/issues/296) + +- `Switch` component + - Switch is invoking EditContext OnFieldChanged even the change was not from UI [#297](https://github.com/vikramlearning/blazorbootstrap/issues/297) + +## Links +- [Demo Website - Blazor Server](https://demos.blazorbootstrap.com/) +- [Demo Website - Blazor WebAssembly](https://demos.getblazorbootstrap.com/) +- [Blazor Line Chart Component Documentation](https://getblazorbootstrap.com/docs/components/charts) +- [Blazor Grid Component Documentation](https://getblazorbootstrap.com/docs/components/grid) +- [Blazor Switch Component Documentation](https://getblazorbootstrap.com/docs/forms/switch) diff --git a/docs/docs/05-components/grid.md b/docs/docs/05-components/grid.md index 3b2444f05..79c514b24 100644 --- a/docs/docs/05-components/grid.md +++ b/docs/docs/05-components/grid.md @@ -30,6 +30,7 @@ Use Blazor Bootstrap grid component to display tabular data from the data source | EmptyDataTemplate | RenderFragment | | ✔️ | Template to render when there are no rows to display. | 1.0.0 | | EmptyText | string | No records to display | | Shows text on no records. | 1.0.0 | | FiltersRowCssClass | string | | | Gets or sets the filters row css class. | 1.9.2 | +| FiltersTranslationProvider | `GridFiltersTranslationDelegate` | | | Filters transalation is for grid filters to render. The provider should always return a 'FilterOperatorInfo' collection, and 'null' is not allowed. | 1.10.0 | | HeaderRowCssClass | string | | | Gets or sets the header row css class but not the thead tag class. | 1.9.2 | | ItemsPerPageText | string | `Items per page` | ✔️ | Gets or sets the ItemsPerPageText. | 1.9.5 | | PageSize | int | 10 | | Gets or sets the page size of the grid. | 1.0.0 | @@ -2536,15 +2537,20 @@ Also, disable check the row level checkbox if the employee Id is less than 105. ### Translations -In the example below, you will see translations related to pagination in **Dutch**. +In the example below, you will see translations related to pagination and filters in **Dutch**. -Blazor Bootstrap: Grid Component - Translations +Blazor Bootstrap: Grid Component - Translations -```cshtml {8,9} showLineNumbers +```cshtml {8,13-14} showLineNumbers - + @context.Id - + @context.Name - + @context.Designation - + @context.DOJ - + @context.IsActive ``` -```cs {} showLineNumbers +```cs {4-25} showLineNumbers @code { private IEnumerable employees = default!; + private async Task> GridFiltersTranslationProvider() + { + var filtersTranslation = new List(); + + // number/date/boolean + filtersTranslation.Add(new("=", "gelijk aan", FilterOperator.Equals)); + filtersTranslation.Add(new("!=", "Niet gelijk", FilterOperator.NotEquals)); + // number/date + filtersTranslation.Add(new("<", "Minder dan", FilterOperator.LessThan)); + filtersTranslation.Add(new("<=", "Kleiner dan of gelijk aan", FilterOperator.LessThanOrEquals)); + filtersTranslation.Add(new(">", "Groter dan", FilterOperator.GreaterThan)); + filtersTranslation.Add(new(">=", "Groter dan of gelijk aan", FilterOperator.GreaterThanOrEquals)); + // string + filtersTranslation.Add(new("*a*", "Bevat", FilterOperator.Contains)); + filtersTranslation.Add(new("a**", "Begint met", FilterOperator.StartsWith)); + filtersTranslation.Add(new("**a", "Eindigt met", FilterOperator.EndsWith)); + filtersTranslation.Add(new("=", "gelijk aan", FilterOperator.Equals)); + // common + filtersTranslation.Add(new("x", "Duidelijk", FilterOperator.Clear)); + + return await Task.FromResult(filtersTranslation); + } + private async Task> EmployeesDataProvider(GridDataProviderRequest request) { if (employees is null) // pull employees only one time for client-side filtering, sorting, and paging diff --git a/docs/package.json b/docs/package.json index 49cd37a24..769d249d3 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "blazorbootstrap", - "version": "1.9.5", + "version": "1.10.0", "private": true, "scripts": { "docusaurus": "docusaurus",