mirror of
https://github.com/material-components/material-web.git
synced 2026-01-09 07:21:09 +08:00
Moving decorators from getters -> setters. Wrapping inherited properties with the same decorators as base class.
34 lines
800 B
TypeScript
34 lines
800 B
TypeScript
/**
|
|
* @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({type: Boolean}) accessor noninteractive = false;
|
|
|
|
override getRenderClasses() {
|
|
return {
|
|
...super.getRenderClasses(),
|
|
'noninteractive': this.noninteractive,
|
|
};
|
|
}
|
|
|
|
override renderRipple() {
|
|
return this.noninteractive ? nothing : super.renderRipple();
|
|
}
|
|
|
|
override renderFocusRing() {
|
|
return this.noninteractive ? nothing : super.renderFocusRing();
|
|
}
|
|
}
|