/** @license Copyright (c) 2022 trading_peter This program is available under Apache License Version 2.0 */ import { LitElement, html, css } from 'lit'; /* Displays a action menu suitable to put into tp-popup. Sub menus can be defined. To hide the icons in from of the menu items use something like this in your application styles: tp-cmd-item::part(icon) { display: none; } Example: Pause More... Action 1 Action 2 Action a Action b Play */ class TpCmdMenu extends LitElement { static get styles() { return [ css` :host { display: block; border-radius: var(--tp-cmd-menu-border-radius, 4px); background: var(--tp-cmd-menu-background, #ffffff); } slot::slotted(:first-child) { border-radius: var(--tp-cmd-menu-border-radius, 4px) var(--tp-cmd-menu-border-radius, 4px) 0 0; } slot::slotted(:last-child) { border-radius: 0 0 var(--tp-cmd-menu-border-radius, 4px) var(--tp-cmd-menu-border-radius, 4px); } ` ]; } render() { return html`
`; } } window.customElements.define('tp-cmd-menu', TpCmdMenu);