-
Notifications
You must be signed in to change notification settings - Fork 905
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(listitem): add noninteractive to list item
PiperOrigin-RevId: 532595788
- Loading branch information
1 parent
b1e9c4a
commit 57f7ae2
Showing
8 changed files
with
80 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
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,29 @@ | ||
/** | ||
* @license | ||
* Copyright 2023 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import {nothing} from 'lit'; | ||
import {property} from 'lit/decorators.js'; | ||
|
||
import {ListItemEl} from './list-item.js'; | ||
|
||
// tslint:disable-next-line:enforce-comments-on-exported-symbols | ||
export class ListItemOnly extends ListItemEl { | ||
/** | ||
* Removes the hover and click ripples from the item when true. | ||
*/ | ||
@property() noninteractive = false; | ||
|
||
override getRenderClasses() { | ||
return { | ||
...super.getRenderClasses(), | ||
'noninteractive': this.noninteractive, | ||
}; | ||
} | ||
|
||
override renderRipple() { | ||
return this.noninteractive ? nothing : super.renderRipple(); | ||
} | ||
} |
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,30 @@ | ||
/** | ||
* @license | ||
* Copyright 2023 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import {nothing} from 'lit'; | ||
import {property} from 'lit/decorators.js'; | ||
|
||
import {ListItemLink} from './list-item-link.js'; | ||
|
||
// tslint:disable-next-line:enforce-comments-on-exported-symbols | ||
export class ListItemLinkOnly extends ListItemLink { | ||
/** | ||
* Removes the hover and click ripples from the item when true. Clicking the | ||
* link will still cause link navigation. | ||
*/ | ||
@property() noninteractive = false; | ||
|
||
override getRenderClasses() { | ||
return { | ||
...super.getRenderClasses(), | ||
'noninteractive': this.noninteractive, | ||
}; | ||
} | ||
|
||
override renderRipple() { | ||
return this.noninteractive ? nothing : super.renderRipple(); | ||
} | ||
} |
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