From a6002f24f0db342859af288e273ae395d8fc9784 Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 5 Dec 2024 08:22:39 -0700 Subject: [PATCH] Add Et2Dropdown, just a wrapper around SlDropdown --- .../Layout/Et2Dropdown/Et2Dropdown.ts | 25 +++++++++++++++++++ api/js/etemplate/etemplate2.ts | 1 + 2 files changed, 26 insertions(+) create mode 100644 api/js/etemplate/Layout/Et2Dropdown/Et2Dropdown.ts diff --git a/api/js/etemplate/Layout/Et2Dropdown/Et2Dropdown.ts b/api/js/etemplate/Layout/Et2Dropdown/Et2Dropdown.ts new file mode 100644 index 0000000000..a3c8e4619a --- /dev/null +++ b/api/js/etemplate/Layout/Et2Dropdown/Et2Dropdown.ts @@ -0,0 +1,25 @@ +import {Et2Widget} from "../../Et2Widget/Et2Widget"; +import {SlDropdown} from "@shoelace-style/shoelace"; +import {customElement} from "lit/decorators/custom-element.js"; +import {css} from "lit"; + +@customElement("et2-dropdown") +export class Et2Dropdown extends Et2Widget(SlDropdown) +{ + static get styles() + { + return [ + ...super.styles, + css` + :host { + max-width: fit-content; + } + + .dropdown--open .dropdown__panel { + background-color: var(--sl-panel-background-color); + padding: var(--sl-spacing-medium); + } + ` + ]; + } +} \ No newline at end of file diff --git a/api/js/etemplate/etemplate2.ts b/api/js/etemplate/etemplate2.ts index e06be19314..916d8f8f76 100644 --- a/api/js/etemplate/etemplate2.ts +++ b/api/js/etemplate/etemplate2.ts @@ -24,6 +24,7 @@ import '../jsapi/egw_json.js'; import {egwIsMobile} from "../egw_action/egw_action_common"; import './Layout/Et2Box/Et2Box'; import './Layout/Et2Details/Et2Details'; +import './Layout/Et2Dropdown/Et2Dropdown'; import './Layout/Et2Groupbox/Et2Groupbox'; import './Layout/Et2Tabs/Et2Tab'; import './Layout/Et2Tabs/Et2Tabs';