Skip to content

Commit

Permalink
Various AriaLabel properties added
Browse files Browse the repository at this point in the history
  • Loading branch information
enchev committed Dec 5, 2023
1 parent f042076 commit 93fc495
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Radzen.Blazor/RadzenDataGrid.razor
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
{
<div class="rz-group-header-item">
<span class="rz-group-header-item-title">@gd.GetTitle()</span>
<a href="javascript:void(0)" @onclick=@(args => RemoveGroupAsync(gd)) role="button" class="rz-dialog-titlebar-icon rz-dialog-titlebar-close">
<a aria-label="@RemoveGroupArialLabel" href="javascript:void(0)" @onclick=@(args => RemoveGroupAsync(gd)) role="button" class="rz-dialog-titlebar-icon rz-dialog-titlebar-close">
<span class="rzi rzi-times"></span>
</a>
</div>
Expand Down Expand Up @@ -508,7 +508,7 @@
@if (this.LoadChildData.HasDelegate && this.ShowExpandColumn && this.allColumns.IndexOf(column) == 0)
{
<span class="rz-cell-toggle">
<a class="@(getExpandIconCssClass(this, Item))" style="@(getExpandIconStyle(this, Item, rowArgs.Item1.Expandable))" href="javascript:void(0)" @onclick="_ => this.ExpandItem(Item)" @onclick:stopPropagation>
<a aria-label="@ExpandChildItemAriaLabel" class="@(getExpandIconCssClass(this, Item))" style="@(getExpandIconStyle(this, Item, rowArgs.Item1.Expandable))" href="javascript:void(0)" @onclick="_ => this.ExpandItem(Item)" @onclick:stopPropagation>
<span class="@(this.ExpandedItemStyle(Item))"></span>
</a>
<span class="rz-cell-data" @attributes="@spanAttributes">
Expand Down
21 changes: 21 additions & 0 deletions Radzen.Blazor/RadzenDataGrid.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,20 @@ internal void DrawGroupOrDataRows(Microsoft.AspNetCore.Components.Rendering.Rend
[Parameter]
public EventCallback<Radzen.DataGridLoadChildDataEventArgs<TItem>> LoadChildData { get; set; }

/// <summary>
/// Gets or sets the expand child item aria label text.
/// </summary>
/// <value>The expand child item aria label text.</value>
[Parameter]
public string ExpandChildItemAriaLabel { get; set; } = "Expand child item";

/// <summary>
/// Gets or sets the expand group aria label text.
/// </summary>
/// <value>The expand group aria label text.</value>
[Parameter]
public string ExpandGroupAriaLabel { get; set; } = "Expand group";

/// <summary>
/// Gets or sets a value indicating whether DataGrid data cells will follow the header cells structure in composite columns.
/// </summary>
Expand Down Expand Up @@ -1337,6 +1351,13 @@ public string EmptyText
[Parameter]
public string ColumnsText { get; set; } = "Columns";

/// <summary>
/// Gets or sets the remove group button aria label text.
/// </summary>
/// <value>The remove group button aria label text.</value>
[Parameter]
public string RemoveGroupArialLabel { get; set; } = "Remove group";

/// <summary>
/// Gets or sets a value indicating whether user can pick all columns in column picker.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Radzen.Blazor/RadzenDataGridGroupRow.razor
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
<td class="rz-col-icon">
<span class="rz-column-title"></span>
<a href="javascript:void(0)" @onclick="@(_ => Grid.ExpandGroupItem(this, rowArgs.Item1.Expanded))">
<a aria-label=@Grid.ExpandGroupAriaLabel href="javascript:void(0)" @onclick="@(_ => Grid.ExpandGroupItem(this, rowArgs.Item1.Expanded))">
<span class="@(Grid.ExpandedGroupItemStyle(this, Grid.allGroupsExpanded != null ? Grid.allGroupsExpanded : rowArgs.Item1.Expanded))"></span>
</a>
</td>
Expand Down
2 changes: 1 addition & 1 deletion Radzen.Blazor/RadzenDataGridRow.razor
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<span class="rz-column-title"></span>
@if (rowArgs.Item1.Expandable)
{
<a href="javascript:void(0)" @onclick="@(_ => Grid.ExpandItem(Item))" @onclick:stopPropagation>
<a aria-label="@Grid.ExpandChildItemAriaLabel" href="javascript:void(0)" @onclick="@(_ => Grid.ExpandItem(Item))" @onclick:stopPropagation>
<span class="@(Grid.ExpandedItemStyle(Item))"></span>
</a>
}
Expand Down
8 changes: 4 additions & 4 deletions Radzen.Blazor/RadzenDatePicker.razor
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
@if (!TimeOnly)
{
<div class="rz-datepicker-header">
<a href="javascript:void(0)" class="rz-datepicker-prev" @onclick="@(async () => { if (!Disabled) { try { if(CurrentDate.AddMonths(-1).Year >= YearFrom) {CurrentDate = CurrentDate.AddMonths(-1);}} catch (ArgumentOutOfRangeException) {}} })">
<a aria-label="@PrevMonthAriaLabel" href="javascript:void(0)" class="rz-datepicker-prev" @onclick="@(async () => { if (!Disabled) { try { if(CurrentDate.AddMonths(-1).Year >= YearFrom) {CurrentDate = CurrentDate.AddMonths(-1);}} catch (ArgumentOutOfRangeException) {}} })">
<span class="rz-datepicker-prev-icon rzi rzi-chevron-left"></span>
</a>
<a href="javascript:void(0)" class="rz-datepicker-next" @onclick="@(async () => { if (!Disabled) { try { if(CurrentDate.AddMonths(1).Year <= YearTo) {CurrentDate = CurrentDate.AddMonths(1);}} catch (ArgumentOutOfRangeException) {} } })">
<a aria-label="@NextMonthAriaLabel" href="javascript:void(0)" class="rz-datepicker-next" @onclick="@(async () => { if (!Disabled) { try { if(CurrentDate.AddMonths(1).Year <= YearTo) {CurrentDate = CurrentDate.AddMonths(1);}} catch (ArgumentOutOfRangeException) {} } })">
<span class="rz-datepicker-next-icon rzi rzi-chevron-right"></span>
</a>
<div class="rz-datepicker-title">
Expand Down Expand Up @@ -122,11 +122,11 @@
@if (HourFormat == "12")
{
<div class="rz-ampm-picker">
<a href="javascript:void(0)" @onclick="@ToggleAmPm">
<a aria-label="@ToggleAmPmAriaLabel" href="javascript:void(0)" @onclick="@ToggleAmPm">
<span class="rzi rzi-chevron-up"></span>
</a>
<span>@CurrentDate.ToString("tt")</span>
<a href="javascript:void(0)" @onclick="@ToggleAmPm">
<a aria-label="@ToggleAmPmAriaLabel" href="javascript:void(0)" @onclick="@ToggleAmPm">
<span class="rzi rzi-chevron-down"></span>
</a>
</div>
Expand Down
21 changes: 21 additions & 0 deletions Radzen.Blazor/RadzenDatePicker.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,27 @@ namespace Radzen.Blazor
/// </example>
public partial class RadzenDatePicker<TValue> : RadzenComponent, IRadzenFormComponent
{
/// <summary>
/// Gets or sets the previous month aria label text.
/// </summary>
/// <value>The previous month aria label text.</value>
[Parameter]
public string PrevMonthAriaLabel { get; set; } = "Previous month";

/// <summary>
/// Gets or sets the next month aria label text.
/// </summary>
/// <value>The next month aria label text.</value>
[Parameter]
public string NextMonthAriaLabel { get; set; } = "Next month";

/// <summary>
/// Gets or sets the toggle Am/Pm aria label text.
/// </summary>
/// <value>The toggle Am/Pm aria label text.</value>
[Parameter]
public string ToggleAmPmAriaLabel { get; set; } = "Toggle Am/Pm";

/// <summary>
/// Specifies additional custom attributes that will be rendered by the input.
/// </summary>
Expand Down
9 changes: 8 additions & 1 deletion Radzen.Blazor/RadzenDialog.razor
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<div class="rz-dialog-side-title" style="display: inline" id="rz-dialog-side-label">@((MarkupString)sideDialogOptions.Title)</div>
@if (sideDialogOptions.ShowClose)
{
<a href="javascript:void(0)" class="rz-dialog-side-titlebar-close" @onclick="@(_ => Service.CloseSide(null))" role="button" tabindex="@sideDialogOptions.CloseTabIndex">
<a aria-label="@CloseSideDialogAriaLabel" href="javascript:void(0)" class="rz-dialog-side-titlebar-close" @onclick="@(_ => Service.CloseSide(null))" role="button" tabindex="@sideDialogOptions.CloseTabIndex">
<span class="rzi rzi-times"></span>
</a>
}
Expand All @@ -49,6 +49,13 @@
[Inject]
DialogService Service { get; set; }

/// <summary>
/// Gets or sets the close side dialog aria label text.
/// </summary>
/// <value>The close side dialog aria label text.</value>
[Parameter]
public string CloseSideDialogAriaLabel { get; set; } = "Close side dialog";

List<Dialog> dialogs = new List<Dialog>();
bool isSideDialogOpen = false;
RenderFragment sideDialogContent;
Expand Down
6 changes: 3 additions & 3 deletions Radzen.Blazor/RadzenRating.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div @ref="@Element" @attributes="Attributes" class="@GetCssClass()" id="@GetId()">
@if (!ReadOnly)
{
<a href="javascript:void(0)" class="rz-rating-cancel" tabindex="@(Disabled ? "-1" : $"{TabIndex}")" @onclick="@(args => SetValue(0))" @onkeypress="@(async args => { if (args.Code == "Space") { await SetValue(0); } })">
<a aria-label="@ClearAriaLabel" href="javascript:void(0)" class="rz-rating-cancel" tabindex="@(Disabled ? "-1" : $"{TabIndex}")" @onclick="@(args => SetValue(0))" @onkeypress="@(async args => { if (args.Code == "Space") { await SetValue(0); } })">
<span class="rz-rating-icon rzi rzi-ban"></span>
</a>
}
Expand All @@ -15,13 +15,13 @@

@if (index <= Value)
{
<a href="javascript:void(0)" tabindex="@(Disabled ? "-1" : $"{TabIndex}")" @onclick="@(args => SetValue(index))" @onkeypress="@(async args => { if (args.Code == "Space") { await SetValue(index); } })">
<a aria-label="@RateAriaLabel" href="javascript:void(0)" tabindex="@(Disabled ? "-1" : $"{TabIndex}")" @onclick="@(args => SetValue(index))" @onkeypress="@(async args => { if (args.Code == "Space") { await SetValue(index); } })">
<span class="rz-rating-icon rzi rzi-star"></span>
</a>
}
else
{
<a href="javascript:void(0)" tabindex="@(Disabled ? "-1" : $"{TabIndex}")" @onclick="@(args => SetValue(index))" @onkeypress="@(async args => { if (args.Code == "Space") { await SetValue(index); } })">
<a aria-label="@RateAriaLabel" href="javascript:void(0)" tabindex="@(Disabled ? "-1" : $"{TabIndex}")" @onclick="@(args => SetValue(index))" @onkeypress="@(async args => { if (args.Code == "Space") { await SetValue(index); } })">
<span class="rz-rating-icon rzi rzi-star-o"></span>
</a>
}
Expand Down
14 changes: 14 additions & 0 deletions Radzen.Blazor/RadzenRating.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ protected override string GetComponentCssClass()
[Parameter]
public int Stars { get; set; } = 5;

/// <summary>
/// Gets or sets the clear aria label text.
/// </summary>
/// <value>The clear aria label text.</value>
[Parameter]
public string ClearAriaLabel { get; set; } = "Clear";

/// <summary>
/// Gets or sets the rate aria label text.
/// </summary>
/// <value>The rate aria label text.</value>
[Parameter]
public string RateAriaLabel { get; set; } = "Rate";

/// <summary>
/// Gets or sets a value indicating whether is read only.
/// </summary>
Expand Down

0 comments on commit 93fc495

Please sign in to comment.