Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Move and change column 'label resources' records
  • Loading branch information
vnbaaij committed Aug 27, 2024
commit bc91972e832fd828eb0efe5f82fb147d66283801
Original file line number Diff line number Diff line change
Expand Up @@ -1332,6 +1332,56 @@
Constructs an instance of <see cref="T:Microsoft.FluentUI.AspNetCore.Components.ColumnBase`1" />.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.ColumnOptionsLabels.OptionsMenu">
<summary>
Gets or sets the text shown in the column menu
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.ColumnOptionsLabels.Default">
<summary>
Gets the default labels for the options UI.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.ColumnResizeLabels.ResizeMenu">
<summary>
Gets or sets the text shown in the column menu
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.ColumnResizeLabels.DiscreteLabel">
<summary>
Gets or sets the label in the discrete mode resize UI
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.ColumnResizeLabels.ExactLabel">
<summary>
Gets or sets the label in the exact mode resize UI
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.ColumnResizeLabels.GrowAriaLabel">
<summary>
Gets or sets the aria label for the grow button in the discrete resize UI
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.ColumnResizeLabels.ShrinkAriaLabel">
<summary>
Gets or sets the aria label for the shrink button in the discrete resize UI
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.ColumnResizeLabels.ResetAriaLabel">
<summary>
Gets or sets the aria label for the reset button in the resize UI
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.ColumnResizeLabels.SubmitAriaLabel">
<summary>
Gets or sets the aria label for the submit button in the resize UI
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.ColumnResizeLabels.Default">
<summary>
Gets the default labels for the resize UI.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.ColumnResizeOptions`1.Grid">
<summary>
Gets a reference to the enclosing <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1" />.
Expand All @@ -1350,6 +1400,26 @@
The display of this component is dependant on a ResizeType being set
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.ColumnSortLabels.SortMenu">
<summary>
Gets or sets the text shown in the column menu
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.ColumnSortLabels.SortMenuAscendingLabel">
<summary>
Gets or sets the text shown in the column menu when in ascending order
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.ColumnSortLabels.SortMenuDescendingLabel">
<summary>
Gets or sets the text shown in the column menu when in descending order
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.ColumnSortLabels.Default">
<summary>
Gets the default labels for the sort UI.
</summary>
</member>
<member name="T:Microsoft.FluentUI.AspNetCore.Components.GridSort`1">
<summary>
Represents a sort order specification used within <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1"/>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
int minMedals;
int maxMedals = 130;

ColumnResizeLabels customLabels = new ColumnResizeLabels(DiscreteLabel: "Width (+/- 10px)", ResetAriaLabel: "restore");
ColumnResizeLabels customLabels = ColumnResizeLabels.Default with { DiscreteLabel = "Width (+/- 10px)", ResetAriaLabel = "Restore" };

GridSort<Country> rankSort = GridSort<Country>
.ByDescending(x => x.Medals.Gold)
Expand Down
3 changes: 1 addition & 2 deletions examples/Demo/Shared/Pages/Lab/IssueTester.razor
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
@page "/issue-tester"
@using FluentUI.Demo.Shared.Pages.DataGrid.Examples
<DataGridTypical />

2 changes: 1 addition & 1 deletion src/Core/Components/DataGrid/Columns/ColumnBase.razor
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}
}
</FluentButton>
<FluentMenu Style="min-width: 200px !important; max-width: 400px;" Anchor="@_columnId" @bind-Open="@_isMenuOpen" HorizontalViewportLock="false" HorizontalScaling="@AxisScalingMode.Anchor">
<FluentMenu Anchor="@_columnId" @bind-Open="@_isMenuOpen" HorizontalViewportLock="false" HorizontalScaling="@AxisScalingMode.Anchor">
@if (Sortable.HasValue ? Sortable.Value : IsSortableByDefault())
{
<FluentMenuItem OnClick="@(async () => await Grid.SortByColumnAsync(this))" @onkeydown="HandleSortMenuKeyDownAsync">
Expand Down
19 changes: 19 additions & 0 deletions src/Core/Components/DataGrid/Columns/ColumnOptionsLabels.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// ------------------------------------------------------------------------
// MIT License - Copyright (c) Microsoft Corporation. All rights reserved.
// ------------------------------------------------------------------------
namespace Microsoft.FluentUI.AspNetCore.Components;

public record ColumnOptionsLabels
{
/// <summary>
/// Gets or sets the text shown in the column menu
/// </summary>
public string OptionsMenu { get; set; } = "Filter";

/// <summary>
/// Gets the default labels for the options UI.
/// </summary>
public static ColumnOptionsLabels Default => new();

}

48 changes: 48 additions & 0 deletions src/Core/Components/DataGrid/Columns/ColumnResizeLabels.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// ------------------------------------------------------------------------
// MIT License - Copyright (c) Microsoft Corporation. All rights reserved.
// ------------------------------------------------------------------------

namespace Microsoft.FluentUI.AspNetCore.Components;

public record ColumnResizeLabels
{
/// <summary>
/// Gets or sets the text shown in the column menu
/// </summary>
public string ResizeMenu { get; set; } = "Resize";

/// <summary>
/// Gets or sets the label in the discrete mode resize UI
/// </summary>
public string DiscreteLabel { get; set; } = "Column width";

/// <summary>
/// Gets or sets the label in the exact mode resize UI
/// </summary>
public string ExactLabel { get; set; } = "Column width (in pixels)";

/// <summary>
/// Gets or sets the aria label for the grow button in the discrete resize UI
/// </summary>
public string? GrowAriaLabel { get; set; } = "Grow column width";

/// <summary>
/// Gets or sets the aria label for the shrink button in the discrete resize UI
/// </summary>
public string? ShrinkAriaLabel { get; set; } = "Shrink column width";

/// <summary>
/// Gets or sets the aria label for the reset button in the resize UI
/// </summary>
public string? ResetAriaLabel { get; set; } = "Reset column widths";

/// <summary>
/// Gets or sets the aria label for the submit button in the resize UI
/// </summary>
public string? SubmitAriaLabel { get; set; } = "Set column widths";

/// <summary>
/// Gets the default labels for the resize UI.
/// </summary>
public static ColumnResizeLabels Default => new();
}
29 changes: 29 additions & 0 deletions src/Core/Components/DataGrid/Columns/ColumnSortLabels.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// ------------------------------------------------------------------------
// MIT License - Copyright (c) Microsoft Corporation. All rights reserved.
// ------------------------------------------------------------------------
namespace Microsoft.FluentUI.AspNetCore.Components;

public record ColumnSortLabels
{
/// <summary>
/// Gets or sets the text shown in the column menu
/// </summary>
public string SortMenu { get; set; } = "Sort";

/// <summary>
/// Gets or sets the text shown in the column menu when in ascending order
/// </summary>
public string SortMenuAscendingLabel { get; set; } = "Sort (ascending)";

/// <summary>
/// Gets or sets the text shown in the column menu when in descending order
/// </summary>
public string SortMenuDescendingLabel { get; set; } = "Sort (descending)";

/// <summary>
/// Gets the default labels for the sort UI.
/// </summary>
public static ColumnSortLabels Default => new();

}

6 changes: 3 additions & 3 deletions src/Core/Components/DataGrid/FluentDataGrid.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,19 @@ public partial class FluentDataGrid<TGridItem> : FluentComponentBase, IHandleEve
/// (Aria) Labels used in the column resize UI.
/// </summary>
[Parameter]
public ColumnResizeLabels ColumnResizeLabels { get; set; } = new();
public ColumnResizeLabels ColumnResizeLabels { get; set; } = ColumnResizeLabels.Default;

/// <summary>
/// Labels used in the column sort UI.
/// </summary>
[Parameter]
public ColumnSortLabels ColumnSortLabels { get; set; } = new();
public ColumnSortLabels ColumnSortLabels { get; set; } = ColumnSortLabels.Default;

/// <summary>
/// Labels used in the column options UI.
/// </summary>
[Parameter]
public ColumnOptionsLabels ColumnOptionsLabels { get; set; } = new();
public ColumnOptionsLabels ColumnOptionsLabels { get; set; } = ColumnOptionsLabels.Default;

/// <summary>
/// If true, enables the new style of header cell that includes a button to display all column options through a menu.
Expand Down
4 changes: 4 additions & 0 deletions src/Core/Components/DataGrid/FluentDataGridCell.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ fluent-data-grid-cell {
text-overflow: ellipsis;
}

::deep .col-sort-button.disabled::part(control) {
opacity: 1 !important;
}

.col-justify-center ::deep .col-sort-button::part(control) {
justify-content: center;
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.