-
Notifications
You must be signed in to change notification settings - Fork 903
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 MdAutocompleteList to unset min-width.
PiperOrigin-RevId: 472863263
- Loading branch information
1 parent
ef9bdd1
commit e77d472
Showing
8 changed files
with
93 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* @license | ||
* Copyright 2022 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import {customElement} from 'lit/decorators.js'; | ||
|
||
import {styles} from '../list/lib/list-styles.css.js'; | ||
|
||
import {AutocompleteList} from './lib/autocompletelist/autocomplete-list.js'; | ||
import {styles as autocompleteStyles} from './lib/autocompletelist/autocomplete-list-styles.css.js'; | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'md-autocomplete-list': MdAutocompleteList; | ||
} | ||
} | ||
|
||
/** | ||
* @soyCompatible | ||
* @final | ||
* @suppress {visibility} | ||
*/ | ||
@customElement('md-autocomplete-list') | ||
export class MdAutocompleteList extends AutocompleteList { | ||
static override styles = [styles, autocompleteStyles]; | ||
} |
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,13 @@ | ||
// | ||
// Copyright 2022 Google LLC | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
// stylelint-disable selector-class-pattern -- | ||
// Selector '.md3-*' should only be used in this project. | ||
|
||
@mixin static-styles() { | ||
.md3-autocomplete-list { | ||
min-width: unset; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
autocomplete/lib/autocompletelist/autocomplete-list-styles.scss
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,8 @@ | ||
// | ||
// Copyright 2022 Google LLC | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
@use './autocomplete-list'; | ||
|
||
@include autocomplete-list.static-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
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 {List} from '@material/web/list/lib/list.js'; | ||
import {ARIARole} from '@material/web/types/aria.js'; | ||
import {ClassInfo} from 'lit/directives/class-map.js'; | ||
|
||
/** Base class for autocomplete list component. */ | ||
export class AutocompleteList extends List { | ||
override role: ARIARole = 'listbox'; | ||
|
||
/** @soyTemplate */ | ||
protected override getRenderClasses(): ClassInfo { | ||
return { | ||
...super.getRenderClasses(), | ||
'md3-autocomplete-list': true, | ||
}; | ||
} | ||
} |
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 {ListHarness} from '@material/web/list/harness.js'; | ||
|
||
/** | ||
* Test harness for autocomplete list. | ||
*/ | ||
export class AutocompleteListHarness extends ListHarness {} |
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