-
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(autocomplete): Create autocomplete item and connect action to fi…
…ll value PiperOrigin-RevId: 471072998
- Loading branch information
1 parent
c47f800
commit c3aa552
Showing
4 changed files
with
61 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* @license | ||
* Copyright 2022 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import {customElement} from 'lit/decorators.js'; | ||
|
||
import {styles} from '../list/lib/listitem/list-item-styles.css.js'; | ||
|
||
import {AutocompleteItem} from './lib/autocompleteitem/autocomplete-item.js'; | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'md-autocomplete-item': MdAutocompleteItem; | ||
} | ||
} | ||
|
||
/** | ||
* @soyCompatible | ||
* @final | ||
* @suppress {visibility} | ||
*/ | ||
@customElement('md-autocomplete-item') | ||
export class MdAutocompleteItem extends AutocompleteItem { | ||
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
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.js'; | ||
import {ARIARole} from '@material/web/types/aria.js'; | ||
|
||
/** Base class for autocomplete item component. */ | ||
export class AutocompleteItem extends ListItem { | ||
override role: ARIARole = 'option'; | ||
} |
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.js'; | ||
|
||
/** | ||
* Test harness for autocomplete item. | ||
*/ | ||
export class AutocompleteItemHarness extends ListItemHarness {} |