Skip to content

Commit a184397

Browse files
authored
refactor(multiple): remove aria classes (angular#32318)
# Conflicts: # src/aria/accordion/accordion.ts
1 parent 949c8ee commit a184397

File tree

6 files changed

+1
-23
lines changed

6 files changed

+1
-23
lines changed

src/aria/accordion/accordion.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ import {
5959
},
6060
],
6161
host: {
62-
'class': 'ng-accordion-panel',
6362
'role': 'region',
6463
'[attr.id]': '_pattern.id()',
6564
'[attr.aria-labelledby]': '_pattern.accordionTrigger()?.id()',
@@ -134,7 +133,6 @@ export class AccordionPanel {
134133
selector: '[ngAccordionTrigger]',
135134
exportAs: 'ngAccordionTrigger',
136135
host: {
137-
'class': 'ng-accordion-trigger',
138136
'[attr.data-active]': 'active()',
139137
'role': 'button',
140138
'[id]': '_pattern.id()',
@@ -235,7 +233,6 @@ export class AccordionTrigger {
235233
selector: '[ngAccordionGroup]',
236234
exportAs: 'ngAccordionGroup',
237235
host: {
238-
'class': 'ng-accordion-group',
239236
'(keydown)': '_pattern.onKeydown($event)',
240237
'(pointerdown)': '_pattern.onPointerdown($event)',
241238
'(focusin)': '_pattern.onFocus($event)',

src/aria/listbox/listbox.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ import {ComboboxPopup} from '../combobox';
4949
exportAs: 'ngListbox',
5050
host: {
5151
'role': 'listbox',
52-
'class': 'ng-listbox',
5352
'[attr.id]': 'id()',
5453
'[attr.tabindex]': '_pattern.tabIndex()',
5554
'[attr.aria-readonly]': '_pattern.readonly()',
@@ -226,7 +225,6 @@ export class Listbox<V> {
226225
exportAs: 'ngOption',
227226
host: {
228227
'role': 'option',
229-
'class': 'ng-option',
230228
'[attr.data-active]': '_pattern.active()',
231229
'[attr.id]': '_pattern.id()',
232230
'[attr.tabindex]': '_pattern.tabIndex()',

src/aria/menu/menu.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ import {Directionality} from '@angular/cdk/bidi';
5656
selector: 'button[ngMenuTrigger]',
5757
exportAs: 'ngMenuTrigger',
5858
host: {
59-
'class': 'ng-menu-trigger',
6059
'[attr.tabindex]': '_pattern.tabIndex()',
6160
'[attr.disabled]': '!softDisabled() && _pattern.disabled() ? true : null',
6261
'[attr.aria-disabled]': '_pattern.disabled()',
@@ -146,7 +145,6 @@ export class MenuTrigger<V> {
146145
exportAs: 'ngMenu',
147146
host: {
148147
'role': 'menu',
149-
'class': 'ng-menu',
150148
'[attr.id]': '_pattern.id()',
151149
'[attr.aria-disabled]': '_pattern.disabled()',
152150
'[attr.tabindex]': 'tabIndex()',
@@ -305,7 +303,6 @@ export class Menu<V> {
305303
exportAs: 'ngMenuBar',
306304
host: {
307305
'role': 'menubar',
308-
'class': 'ng-menu-bar',
309306
'[attr.disabled]': '!softDisabled() && _pattern.disabled() ? true : null',
310307
'[attr.aria-disabled]': '_pattern.disabled()',
311308
'[attr.tabindex]': '_pattern.tabIndex()',
@@ -405,7 +402,6 @@ export class MenuBar<V> {
405402
exportAs: 'ngMenuItem',
406403
host: {
407404
'role': 'menuitem',
408-
'class': 'ng-menu-item',
409405
'(focusin)': '_pattern.onFocusIn()',
410406
'[attr.tabindex]': '_pattern.tabIndex()',
411407
'[attr.data-active]': 'isActive()',

src/aria/tabs/tabs.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ function sortDirectives(a: HasElement, b: HasElement) {
7575
@Directive({
7676
selector: '[ngTabs]',
7777
exportAs: 'ngTabs',
78-
host: {
79-
'class': 'ng-tabs',
80-
},
8178
})
8279
export class Tabs {
8380
/** The TabList nested inside of the container. */
@@ -138,7 +135,6 @@ export class Tabs {
138135
exportAs: 'ngTabList',
139136
host: {
140137
'role': 'tablist',
141-
'class': 'ng-tablist',
142138
'[attr.tabindex]': '_pattern.tabIndex()',
143139
'[attr.aria-disabled]': '_pattern.disabled()',
144140
'[attr.aria-orientation]': '_pattern.orientation()',
@@ -278,7 +274,6 @@ export class TabList implements OnInit, OnDestroy {
278274
exportAs: 'ngTab',
279275
host: {
280276
'role': 'tab',
281-
'class': 'ng-tab',
282277
'[attr.data-active]': 'active()',
283278
'[attr.id]': '_pattern.id()',
284279
'[attr.tabindex]': '_pattern.tabIndex()',
@@ -367,7 +362,6 @@ export class Tab implements HasElement, OnInit, OnDestroy {
367362
exportAs: 'ngTabPanel',
368363
host: {
369364
'role': 'tabpanel',
370-
'class': 'ng-tabpanel',
371365
'[attr.id]': '_pattern.id()',
372366
'[attr.tabindex]': '_pattern.tabIndex()',
373367
'[attr.inert]': '!visible() ? true : null',

src/aria/toolbar/toolbar.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ function sortDirectives(a: HasElement, b: HasElement) {
6767
exportAs: 'ngToolbar',
6868
host: {
6969
'role': 'toolbar',
70-
'class': 'ng-toolbar',
7170
'[attr.tabindex]': '_pattern.tabIndex()',
7271
'[attr.aria-disabled]': '_pattern.disabled()',
7372
'[attr.aria-orientation]': '_pattern.orientation()',
@@ -157,7 +156,7 @@ export class Toolbar<V> {
157156

158157
/** Finds the toolbar item associated with a given element. */
159158
private _getItem(element: Element) {
160-
const widgetTarget = element.closest('.ng-toolbar-widget');
159+
const widgetTarget = element.closest('[ngToolbarWidget]');
161160
return this.items().find(widget => widget.element() === widgetTarget);
162161
}
163162
}
@@ -181,7 +180,6 @@ export class Toolbar<V> {
181180
selector: '[ngToolbarWidget]',
182181
exportAs: 'ngToolbarWidget',
183182
host: {
184-
'class': 'ng-toolbar-widget',
185183
'[attr.data-active]': 'active()',
186184
'[attr.tabindex]': '_pattern.tabIndex()',
187185
'[attr.inert]': 'hardDisabled() ? true : null',
@@ -253,9 +251,6 @@ export class ToolbarWidget<V> implements OnInit, OnDestroy {
253251
@Directive({
254252
selector: '[ngToolbarWidgetGroup]',
255253
exportAs: 'ngToolbarWidgetGroup',
256-
host: {
257-
'[class.ng-toolbar-widget-group]': '!!toolbar()',
258-
},
259254
})
260255
export class ToolbarWidgetGroup<V> {
261256
/** The parent Toolbar. */

src/aria/tree/tree.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ function sortDirectives(a: HasElement, b: HasElement) {
8484
selector: '[ngTree]',
8585
exportAs: 'ngTree',
8686
host: {
87-
'class': 'ng-tree',
8887
'role': 'tree',
8988
'[attr.id]': 'id()',
9089
'[attr.aria-orientation]': '_pattern.orientation()',
@@ -256,7 +255,6 @@ export class Tree<V> {
256255
selector: '[ngTreeItem]',
257256
exportAs: 'ngTreeItem',
258257
host: {
259-
'class': 'ng-treeitem',
260258
'[attr.data-active]': 'active()',
261259
'role': 'treeitem',
262260
'[id]': '_pattern.id()',

0 commit comments

Comments
 (0)