Skip to content

Commit

Permalink
Revert "fix: aria labels for checkboxes"
Browse files Browse the repository at this point in the history
This reverts commit 6a1e6ab.
  • Loading branch information
chintankavathia committed Nov 21, 2024
1 parent 732f85b commit 6bb156f
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import { AsyncPipe, NgTemplateOutlet } from '@angular/common';
<label class="datatable-checkbox">
<input
type="checkbox"
[attr.aria-label]="ariaLabelSelectRow"
[disabled]="disable$ | async"
[checked]="isSelected"
(click)="onCheckboxChange($event)"
Expand Down Expand Up @@ -218,8 +217,6 @@ export class DataTableBodyCellComponent<TRow extends { level?: number } = any>

@Input() ghostLoadingIndicator = false;

@Input() ariaLabelSelectRow = 'Select/Deselect row';

@Output() activate: EventEmitter<ActivateEvent<TRow>> = new EventEmitter();

@Output() treeAction: EventEmitter<any> = new EventEmitter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ import { DatatableRowDetailDirective } from '../row-detail/row-detail.directive'
<input
#select
type="checkbox"
[attr.aria-label]="ariaLabelSelectGroup"
[checked]="selectedGroupRows.length === group.value.length"
[checked]="selectedGroupRows().length === group().value.length"
(change)="onCheckboxChange(select.checked)"
/>
</label>
Expand Down Expand Up @@ -88,8 +87,6 @@ export class DataTableRowWrapperComponent<TRow = any> implements DoCheck, OnInit
@Input() groupedRows: Group<TRow>[];
@Input() disableCheck: (row: RowOrGroup<TRow>) => boolean;
@Input() selected: TRow[];
@Input() ariaLabelSelectGroup = 'Select/Deselect group';

@Output() rowContextmenu = new EventEmitter<{
event: MouseEvent;
row: RowOrGroup<TRow>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import { DataTableBodyCellComponent } from './body-cell.component';
[disable$]="disable$"
[treeStatus]="treeStatus"
[ghostLoadingIndicator]="ghostLoadingIndicator"
[ariaLabelSelectRow]="ariaLabelSelectRow"
(activate)="onActivate($event, ii)"
(treeAction)="onTreeAction()"
>
Expand Down Expand Up @@ -98,7 +97,6 @@ export class DataTableBodyRowComponent<TRow = any> implements DoCheck, OnChanges
@Input() treeStatus?: TreeStatus = 'collapsed';
@Input() ghostLoadingIndicator = false;
@Input() verticalScrollVisible = false;
@Input() ariaLabelSelectRow = 'Select/Deselect row';

@Input() disable$: BehaviorSubject<boolean>;
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ import { ProgressBarComponent } from './progress-bar.component';
[expanded]="getRowExpanded(group)"
[rowIndex]="getRowIndex(group && group[i])"
[selected]="selected"
[ariaLabelSelectGroup]="ariaLabelSelectGroup"
(rowContextmenu)="rowContextmenu.emit($event)"
>
@if (rowDefTemplate) {
Expand Down Expand Up @@ -211,7 +210,6 @@ import { ProgressBarComponent } from './progress-bar.component';
[ghostLoadingIndicator]="ghostLoadingIndicator"
[draggable]="rowDraggable"
[verticalScrollVisible]="verticalScrollVisible"
[ariaLabelSelectRow]="ariaLabelSelectRow"
(activate)="selector.onActivate($event, i)"
(drop)="drop($event, row, rowElement)"
(dragover)="dragOver($event, row)"
Expand Down Expand Up @@ -303,8 +301,6 @@ export class DataTableBodyComponent<TRow extends { treeStatus?: TreeStatus } = a
@Input() rowDraggable: boolean;
@Input() rowDragEvents: EventEmitter<DragEventData>;
@Input() disableRowCheck: (row: TRow) => boolean;
@Input() ariaLabelSelectRow = 'Select/Deselect row';
@Input() ariaLabelSelectGroup = 'Select/Deselect group';

@Input() set pageSize(val: number) {
if (val !== this._pageSize) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
[selectionType]="selectionType"
[verticalScrollVisible]="verticalScrollVisible"
[enableClearingSortState]="enableClearingSortState"
[ariaLabelSelectAll]="ariaLabelSelectAll"
(sort)="onColumnSort($event)"
(resize)="onColumnResize($event)"
(resizing)="onColumnResizing($event)"
Expand Down Expand Up @@ -64,8 +63,6 @@
[summaryHeight]="summaryHeight"
[summaryPosition]="summaryPosition"
[verticalScrollVisible]="verticalScrollVisible"
[ariaLabelSelectRow]="ariaLabelSelectRow"
[ariaLabelSelectGroup]="ariaLabelSelectGroup"
(page)="onBodyPage($event)"
(activate)="activate.emit($event)"
(rowContextmenu)="onRowContextmenu($event)"
Expand Down
18 changes: 0 additions & 18 deletions projects/ngx-datatable/src/lib/components/datatable.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,24 +481,6 @@ export class DatatableComponent<TRow = any>
*/
@Input({ transform: booleanAttribute }) enableClearingSortState = false;

/**
* ARIA label for the "Select/Deselect all rows" action, used to improve accessibility for screen readers.
* This label provides context for users interacting with the control.
*/
@Input() ariaLabelSelectAll = 'Select/Deselect all rows';

/**
* ARIA label for the "Select/Deselect row" action, used to improve accessibility for screen readers.
* This label ensures each row's selection control is clearly described.
*/
@Input() ariaLabelSelectRow = 'Select/Deselect row';

/**
* ARIA label for the "Select/Deselect group" action, used to improve accessibility for screen readers.
* This label describes the selection control for grouped rows.
*/
@Input() ariaLabelSelectGroup = 'Select/Deselect group';

/**
* Body was scrolled typically in a `scrollbarV:true` scenario.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@ import { NgTemplateOutlet } from '@angular/common';
}
@if (isCheckboxable) {
<label class="datatable-checkbox">
<input
type="checkbox"
[attr.aria-label]="ariaLabelSelectAll"
[checked]="allRowsSelected"
(change)="select.emit()"
/>
<input type="checkbox" [checked]="allRowsSelected" (change)="select.emit()" />
</label>
}
@if (column.headerTemplate) {
Expand Down Expand Up @@ -78,7 +73,6 @@ export class DataTableHeaderCellComponent implements OnInit {
@Input() targetMarkerTemplate: TemplateRef<any>;
@Input() targetMarkerContext: any;
@Input() enableClearingSortState = false;
@Input() ariaLabelSelectAll = 'Select/Deselect all rows';

_allRowsSelected: boolean;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ import { OrderableDirective } from '../../directives/orderable.directive';
[sortUnsetIcon]="sortUnsetIcon"
[allRowsSelected]="allRowsSelected"
[enableClearingSortState]="enableClearingSortState"
[ariaLabelSelectAll]="ariaLabelSelectAll"
(sort)="onSort($event)"
(select)="select.emit($event)"
(columnContextmenu)="columnContextmenu.emit($event)"
Expand Down Expand Up @@ -138,7 +137,6 @@ export class DataTableHeaderComponent implements OnDestroy, OnChanges {
@Input() selectionType: SelectionType;
@Input() reorderable: boolean;
@Input() verticalScrollVisible = false;
@Input() ariaLabelSelectAll = 'Select/Deselect all rows';

dragEventTarget?: MouseEvent;

Expand Down

0 comments on commit 6bb156f

Please sign in to comment.