/** @license Copyright (c) 2022 trading_peter This program is available under Apache License Version 2.0 */ import '@tp/tp-icon/tp-icon.js' import { LitElement, html, css } from 'lit'; class TpCmdItem extends LitElement { static get styles() { return [ css` :host { display: block; cursor: pointer; position: relative; } :host(:hover) { background: var(--tp-cmd-item-hover, #c1c1c1); } :host([disabled]) { opacity: 0.4; pointer-events: none; } div { display: flex; align-items: center; } div[part="wrap"] { padding: 6px 12px; } div[part="icon"] { min-width: 20px; padding-right: 8px; --tp-icon-width: 18px; --tp-icon-height: 18px; } div[part="label"] { text-overflow: ellipsis; white-space: nowrap; } .sub { display: none; position: absolute; left: 0; top: 0; margin-left: calc(100% - 2px); } :host(:hover) .sub { display: block; } ` ]; } render() { return html`
${this.icon ? html`` : null}
`; } static get properties() { return { icon: { type: Object }, }; } } window.customElements.define('tp-cmd-item', TpCmdItem);