Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DataGrid] Alter rendering to use table elements #2664

Merged
merged 69 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
2e6c235
Replace grid web components with regular table elements
vnbaaij Aug 29, 2024
9cd10ac
Adjust styling
vnbaaij Sep 2, 2024
5212a8b
Resize rework
vnbaaij Sep 3, 2024
97d76c7
Merge branch 'dev' into users/vnbaaij/grid-work
vnbaaij Sep 4, 2024
f0904e5
- Rename example EventHandlers
vnbaaij Sep 4, 2024
dd494ce
- Redo AutoFit based on table-layout
vnbaaij Sep 4, 2024
c371bdd
- CSS cleanup
vnbaaij Sep 4, 2024
f8f4f0c
- Remove commented code
vnbaaij Sep 5, 2024
2c7f565
Update version
vnbaaij Sep 5, 2024
6dbfb85
- Fix verified files for DataGrid tests
vnbaaij Sep 5, 2024
cc4a77f
merge dev
vnbaaij Sep 6, 2024
41e8026
- Script optimization
vnbaaij Sep 10, 2024
c18d486
- Rename ShowSortIcon -> IsActiveSortColumn
vnbaaij Sep 12, 2024
0e1cacc
More optimizations and fixes
vnbaaij Sep 15, 2024
b995861
Merge branch 'dev' into users/vnbaaij/grid-work
vnbaaij Sep 15, 2024
13d62a3
Merge branch 'users/vnbaaij/grid-work' into users/vnbaaij/grid-work-p…
vnbaaij Sep 15, 2024
bf7c20d
- More fine-tunning.
vnbaaij Sep 16, 2024
2de45e3
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Sep 16, 2024
7ddb060
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Sep 17, 2024
3551ef6
Fix tests
vnbaaij Sep 17, 2024
c951377
- Styling updates
vnbaaij Sep 17, 2024
04c0a07
- Don't use dynamic row size for now.
vnbaaij Sep 17, 2024
36148e9
Fix tests
vnbaaij Sep 17, 2024
fb0a25d
More style updates
vnbaaij Sep 17, 2024
dfb6b7e
- Re-add separate header buttons
vnbaaij Sep 17, 2024
a254796
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Sep 18, 2024
e58feee
merge
vnbaaij Sep 18, 2024
b16868a
Fix merge issues
vnbaaij Sep 18, 2024
ea3eebf
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Sep 18, 2024
a26c1f9
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Sep 18, 2024
2001707
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Sep 24, 2024
74b00d8
merge dev
vnbaaij Sep 27, 2024
6034b0f
Fix merge error
vnbaaij Sep 27, 2024
4e1d24a
Change icons in grid to size 20 (nice in the middel of Aspire (16) an…
vnbaaij Sep 27, 2024
dab38e6
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Oct 2, 2024
13d0e11
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Oct 2, 2024
d6af544
Fix tests/verified files
vnbaaij Oct 2, 2024
5033c97
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Oct 9, 2024
05e77dd
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Oct 17, 2024
7060116
Fix virtualized grid row height
vnbaaij Oct 21, 2024
bca8540
Fix column resizing when in rtl mode
vnbaaij Oct 22, 2024
100072c
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Oct 29, 2024
26a1fb0
- Fix button width when no filter button
vnbaaij Oct 29, 2024
6cb33d2
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Nov 10, 2024
608c24f
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Nov 19, 2024
e29beec
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Nov 21, 2024
953b5be
Merge branch 'users/vnbaaij/grid-work-phase2' of https://github.com/m…
vnbaaij Nov 25, 2024
4772f61
- Update example,
vnbaaij Nov 25, 2024
d73e477
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Nov 25, 2024
3004965
Fix tests
vnbaaij Nov 25, 2024
10bcd05
Merge branch 'users/vnbaaij/grid-work-phase2' of https://github.com/m…
vnbaaij Nov 25, 2024
acadf41
- Process review comments
vnbaaij Nov 26, 2024
a6e7a67
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Nov 26, 2024
7e1b00f
Merge branch 'users/vnbaaij/grid-work-phase2' of https://github.com/m…
vnbaaij Nov 26, 2024
fe3da39
- Fix keyboard navigation in DataGrid
vnbaaij Nov 26, 2024
95d6ea9
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Nov 27, 2024
d0df3e3
Menu work
vnbaaij Nov 27, 2024
d8ff518
Merge
vnbaaij Nov 27, 2024
8134959
Fix DataGrid Header menu
vnbaaij Nov 27, 2024
c3d73a8
Add a start padding for the first header cell
vnbaaij Nov 28, 2024
9dbcaff
Process compiler hint
vnbaaij Nov 28, 2024
4d7b593
- Fix remote data example
vnbaaij Nov 28, 2024
98ca4ae
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Nov 28, 2024
7693cbe
Don't use AutoFocus on demo page
vnbaaij Nov 28, 2024
0765b31
Fix scroll on up/down arrow keypress
vnbaaij Nov 28, 2024
36a64ca
Fix Select All not aligned correctly
vnbaaij Nov 28, 2024
ae53eb6
Add Index to ColumnBase
vnbaaij Nov 29, 2024
be59c7d
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Nov 29, 2024
4bf7001
Fix tests
vnbaaij Nov 29, 2024
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: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<SolutionDir>$(MSBuildThisFileDirectory)</SolutionDir>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>

<VersionFile>4.10.1</VersionFile>
<VersionPrefix>4.10.1</VersionPrefix>
<VersionFile>4.11.0</VersionFile>
<VersionPrefix>4.11.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<AssemblyVersion>$(VersionFile)</AssemblyVersion>
<FileVersion>$(VersionFile)</FileVersion>
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ variables:
# File and Package version
# dev branch: 1.2.4-Preview-23282-1' (PackageSuffix is always ignored in Dev branch)
# main branch: 1.2.4-RC.1' (PackageSuffix is ignored, if empty, in Main branch)
FileVersion: '4.10.1' # Set the next final version here.
FileVersion: '4.11.0' # Set the next final version here.
PackageSuffix: ''
6 changes: 3 additions & 3 deletions examples/Demo/Shared/Components/ApiDocumentation.razor
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
string header = Properties.Any(x => x.IsParameter) ? "Parameters" : "Properties";
<h4 id="@(_id + "_properties")">@header</h4>
<div class="docgrid">
<FluentDataGrid Items="@this.Properties.AsQueryable()" GridTemplateColumns="1fr 1fr 0.7fr 2fr">
<FluentDataGrid Items="@this.Properties.AsQueryable()" GridTemplateColumns="1fr 1fr 0.7fr 2fr" MultiLine="true">
<TemplateColumn Title="Name"><code>@context.Name</code></TemplateColumn>
<TemplateColumn Title="Type">
@context.Type
Expand Down Expand Up @@ -82,7 +82,7 @@
{
<h4 id="@(_id)_callbacks">EventCallbacks</h4>
<div class="docgrid">
<FluentDataGrid Items="@this.Events.AsQueryable()" GridTemplateColumns="1fr 1fr 1fr">
<FluentDataGrid Items="@this.Events.AsQueryable()" GridTemplateColumns="1fr 1fr 1fr" MultiLine="true">
<TemplateColumn Title="Name"><code>@context.Name</code></TemplateColumn>
<PropertyColumn Property="@(c => c.Type)" />
<TemplateColumn Title="Description">
Expand All @@ -98,7 +98,7 @@
{
<h4 id="@(_id)_methods">Methods</h4>
<div class="docgrid">
<FluentDataGrid Items="@this.Methods.AsQueryable()" GridTemplateColumns="1fr 1fr 1fr 1fr">
<FluentDataGrid Items="@this.Methods.AsQueryable()" GridTemplateColumns="1fr 1fr 1fr 1fr" MultiLine="true">
<TemplateColumn Title="Name"><code>@context.Name</code></TemplateColumn>
<TemplateColumn Title="Parameters">
@foreach (var param in @context.Parameters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1838,6 +1838,14 @@
is small or if you are using pagination.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1.OverscanCount">
<summary>
This is applicable only when using <see cref="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1.Virtualize"/>. It defines how many additional items will be rendered
before and after the visible region to reduce rendering frequency during scrolling. While higher values can improve
scroll smoothness by rendering more items off-screen, they can also increase initial load times. Finding a balance
based on your data set size and user experience requirements is recommended. The default value is 3.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1.ItemSize">
<summary>
This is applicable only when using <see cref="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1.Virtualize"/>. It defines an expected height in pixels for
Expand Down Expand Up @@ -1874,11 +1882,6 @@
Labels used in the column options UI.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1.HeaderCellAsButtonWithMenu">
<summary>
If true, enables the new style of header cell that includes a button to display all column options through a menu.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1.ItemKey">
<summary>
Optionally defines a value for @key on each rendered row. Typically this should be used to specify a
Expand Down Expand Up @@ -2076,7 +2079,7 @@
Gets or sets the owning <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow`1"/> component.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridCell`1.GridContext">
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridCell`1.InternalGridContext">
<summary>
Gets or sets the owning <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1"/> component
</summary>
Expand All @@ -2086,6 +2089,11 @@
Gets a reference to the column that this cell belongs to.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridCell`1.Grid">
<summary>
Gets a reference to the enclosing <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1" />.
</summary>
</member>
<member name="M:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridCell`1.HandleOnCellClickAsync">
<summary />
</member>
Expand Down Expand Up @@ -2115,11 +2123,16 @@
Gets or sets the content to be rendered inside the component.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow`1.Owner">
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow`1.InternalGridContext">
<summary>
Gets or sets the owning <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1"/> component
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow`1.Grid">
<summary>
Gets a reference to the enclosing <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1" />.
</summary>
</member>
<member name="M:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow`1.HandleOnRowClickAsync(System.String)">
<summary />
</member>
Expand Down Expand Up @@ -8233,7 +8246,7 @@
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentSlider`1.JSRuntime">
<summary />
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentSlider`1._jsModule">
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentSlider`1.Module">
<summary />
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentSlider`1.Min">
Expand Down Expand Up @@ -13232,6 +13245,37 @@
Resize datagrid columns by exact pixel values
</summary>
</member>
<member name="T:Microsoft.FluentUI.AspNetCore.Components.DataGridRowSize">
<summary>
The height of each <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow`1"/> in a <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1"/>.
Values are in pixels.
</summary>
</member>
<member name="F:Microsoft.FluentUI.AspNetCore.Components.DataGridRowSize.Medium">
<summary>
Medium row height (default)
</summary>
</member>
<member name="F:Microsoft.FluentUI.AspNetCore.Components.DataGridRowSize.Small">
<summary>
Small row height
</summary>
</member>
<member name="F:Microsoft.FluentUI.AspNetCore.Components.DataGridRowSize.Smaller">
<summary>
Smaller row height
</summary>
</member>
<member name="F:Microsoft.FluentUI.AspNetCore.Components.DataGridRowSize.Large">
<summary>
Large row height
</summary>
</member>
<member name="F:Microsoft.FluentUI.AspNetCore.Components.DataGridRowSize.Dynamic">
<summary>
Dynamic row height
</summary>
</member>
<member name="T:Microsoft.FluentUI.AspNetCore.Components.DataGridRowType">
<summary>
The type of <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow`1"/> in a <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1"/>.
Expand Down
2 changes: 1 addition & 1 deletion examples/Demo/Shared/Pages/DataGrid/DataGridPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ fluent-data-grid-row:has([row-selected]) {

<DemoSection Title="Multiline text content" Component="@typeof(DataGridMultilineText)">
<Description>
Example of using the <code>Class</code> parameter to style parts of the grid. Note that the class used in the example (<code>multiline-text</code>) has been added to the FluentDataGridCell css.
Set the grid parameter <code>MultiLine</code> to true when you have cells in your data that will take up more than a single line.
</Description>
</DemoSection>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<FluentGrid Spacing="4">
<FluentGridItem xs="12">
<h4>With auto-fit</h4>
<FluentDataGrid Items="@people" AutoFit="true">
<FluentDataGrid Items="@people" Style="width: 100%;" AutoFit="true">
<PropertyColumn Property="@(p => p.PersonId)" Sortable="true" />
<PropertyColumn Property="@(p => p.Name)" Sortable="true" />
<PropertyColumn Property="@(p => p.BirthDate)" Format="yyyy-MM-dd" Sortable="true" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<FluentDataGrid Items="@people">
<FluentDataGrid Items="@people" MultiLine="true">
<PropertyColumn Property="@(p => p.PersonId)" Sortable="true" />
<PropertyColumn Property="@(p => p.Name)" Sortable="true" />
<PropertyColumn Property="@(p => p.Description)" Sortable="true" Class="multiline-text" />
<PropertyColumn Property="@(p => p.Description)" Sortable="true" />
</FluentDataGrid>

@code {
Expand All @@ -13,4 +13,4 @@
new Person(10944, "António Langa", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."),
new Person(11203, "Julie Smith","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."),
}.AsQueryable();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div style="height: 400px; overflow-y: scroll;">
<FluentDataGrid @ref="grid" Items=@items GridTemplateColumns="1fr 1fr 1fr 1fr" Style="height: 100%;">
<FluentDataGrid @ref="grid" Items=@items GridTemplateColumns="1fr 1fr 1fr 1fr">
<ChildContent>
<PropertyColumn Property="@(c => c.Item1)" Sortable="true" />
<PropertyColumn Property="@(c => c.Item2)" />
Expand Down Expand Up @@ -53,7 +53,7 @@
grid?.SetLoadingState(true);
items = null;

await Task.Delay(2500);
await Task.Delay(1500);

items = GenerateSampleGridData(100);
grid?.SetLoadingState(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<FluentDataGrid Style="min-width: max-content;" Items="@people">
<PropertyColumn Property="@(p => p.PersonId)" Sortable="true" />
<PropertyColumn Property="@(p => p.Name)" Sortable="true" />
<PropertyColumn Property="@(p => p.Description)" Sortable="true" Class="multiline-text" />
<PropertyColumn Property="@(p => p.Description)" Sortable="true" Style="text-overflow: unset; overflow: visible;" />
</FluentDataGrid>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<FluentDataGrid id="defaultGrid" Items=RowsGrid.AsQueryable() GridTemplateColumns="1fr 1fr" TGridItem=SampleGridData OnRowFocus="HandleRowFocus" OnCellFocus="HandleCellFocus">
<FluentDataGrid id="defaultGrid" Items=RowsGrid.AsQueryable() GridTemplateColumns="1fr 1fr" TGridItem=SampleGridData OnRowClick="HandleRowClick" OnCellClick="HandleCellClick">
<TemplateColumn Title="Name">
<FluentTextField @bind-Value="@context!.Name"/>
</TemplateColumn>
Expand All @@ -14,7 +14,7 @@
{
public string Name { get; set; }
public int Age { get; set; }

public SampleGridData(string name, int age)
{
Name = name;
Expand All @@ -30,12 +30,12 @@
new SampleGridData("Bob", 20 )
};

private void HandleRowFocus(FluentDataGridRow<SampleGridData> row)
private void HandleRowClick(FluentDataGridRow<SampleGridData> row)
{
DemoLogger.WriteLine($"Row focused: {row.RowIndex}");
}

private void HandleCellFocus(FluentDataGridCell<SampleGridData> cell)
private void HandleCellClick(FluentDataGridCell<SampleGridData> cell)
{
DemoLogger.WriteLine($"Cell focused: {cell.GridColumn}");
}
Expand Down
Loading
Loading