-
Notifications
You must be signed in to change notification settings - Fork 904
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(menu): Add
aria-label
support in menu, and set `role=menu/menu…
…item` for menu and menu item components. PiperOrigin-RevId: 466359528
- Loading branch information
1 parent
8f63406
commit 7e35820
Showing
6 changed files
with
68 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* @license | ||
* Copyright 2022 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import {ListItemHarness} from '@material/web/list/lib/listitem/harness'; | ||
|
||
/** | ||
* Test harness for menu item. | ||
*/ | ||
export class MenuItemHarness extends ListItemHarness {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* @license | ||
* Copyright 2022 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import {ListItem} from '@material/web/list/lib/listitem/list-item'; | ||
import {ARIARole} from '@material/web/types/aria'; | ||
|
||
/** Base class for menu item component. */ | ||
export class MenuItem extends ListItem { | ||
override role: ARIARole = 'menuitem'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* @license | ||
* Copyright 2022 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import {customElement} from 'lit/decorators'; | ||
|
||
import {styles} from '../list/lib/listitem/list-item-styles.css'; | ||
|
||
import {MenuItem} from './lib/menuitem/menu-item'; | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'md-menu-item': MdMenuItem; | ||
} | ||
} | ||
|
||
@customElement('md-menu-item') | ||
export class MdMenuItem extends MenuItem { | ||
static override styles = [styles]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters