-
Notifications
You must be signed in to change notification settings - Fork 460
[DataGrid] Add parameter to provide labels to resize UI #2585
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
Conversation
|
✅ All tests passed successfully Details on your Workflow / Core Tests page. |
Summary - Unit Tests Code CoverageSummary
CoverageMicrosoft.FluentUI.AspNetCore.Components - 61.2%
|
| [Parameter] | ||
| public string ResizeLabel { get; set; } = "Column width (in pixels)"; | ||
|
|
||
| /// <summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid these multiple parameters, and group all this information in a single object, how about using something like this :
public record ResizeAria
{
public string? GrowLabel { get; set; }
public string? ShrinkLabel { get; set; }
public string? ResetLabel { get; set; }
public string? SubmitLabel { get; set; }
public static ResizeAria Default => new ResizeAria();
}The usage will be:
<FluentDataGrid ResizeAria="@(ResizeAria.Default with { GrowLabel = "...", ShrinkLabel = "..." } )">Do you find it too complex ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about something like that as well (but then with a dictionary of some sorts)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A record has been added. See updates in PR message above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
I find the syntax for defining the record clearer using property declarations (as above). And using your syntax, we don't have XML comments / property documentation.
-
Why did you put this class in the
Infrastructurefolder and not in theDataGrid/Columnsfolder? -
I think we need a static property
Defaultto create an instance of this object. Thus, the developer can initialize the parameter usingResizeAria.Default with { GrowLabel = “ ...”, ShrinkLabel = “ ...” } -
⚠️ You can't force RPs to merge: without explicit approval, we can continue discussing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- By doing it this way, the developer does not have to do anything to use the default values. I think we can put the comments about the fields of the record in the parameter declaration in the Grid
- Yes, that is a mistake. Will move them
I could not get your variant to work with implemented defaults. I don't want to force the developer to have to supply values in the default caseI figured it out. Will change it in the other PR- I know but I wanted this in because (and was too impatient). I need it in the other grid thing I'm working on (PR inbound) (mea culpa). We can still discuss and change because we are the end bosses.
…dand can now be set throught the record as well
* Add resize buttons aria labels * Use a record to group resize aria labels. ResizeLabel has been removedand can now be set throught the record as well * Adjust example to new 2024 dataset
Fix #2507 by adding a new
ColumnResizeLabelsrecord which contains the following properties:DiscreteLabelExactLabelGrowAriaLabelShrinkAriaLabelResetAriaLabelSubmitAriaLabelAll properties are assigned default values. A parameter of this type with name
ColumnResizeLabelsis added to DataGid. This can be used to supply custom strings for the mentioned properties which will then show up in the resize options UINOTE the DataGrid parameter
ResizeLabelhas been superseded by this new parameter. If you were using a custom text for this, then change this to use theDiscreteLabeland/orExactLabel(depending on theResizeTypeyou are using)