ModeratorElection/frontend/generated/jar-resources/vaadin-dev-tools/assets/vaadin-menu-bar-3f5ab096.js
2024-06-06 17:45:46 +02:00

1 line
2 KiB
JavaScript

import{s as o,E as a,p as i,f as s,t as n,e as d}from"../vaadin-dev-tools.js";import"construct-style-sheets-polyfill";import"lit";import"lit/decorators.js";import"lit/directives/class-map.js";import"lit/static-html.js";const v={tagName:"vaadin-menu-bar",displayName:"Menu Bar",elements:[{selector:"vaadin-menu-bar vaadin-menu-bar-button",displayName:"Buttons",properties:[o.backgroundColor,o.borderColor,o.borderWidth,o.borderRadius,{propertyName:"--lumo-button-size",displayName:"Size",editorType:a.range,presets:i.lumoSize,icon:"square"},s.paddingInline]},{selector:"vaadin-menu-bar vaadin-menu-bar-button vaadin-menu-bar-item",displayName:"Button labels",properties:[n.textColor,n.fontSize,n.fontWeight]},{selector:"vaadin-menu-bar-overlay::part(overlay)",displayName:"Overlay",properties:[o.backgroundColor,o.borderColor,o.borderWidth,o.borderRadius,o.padding]},{selector:"vaadin-menu-bar-overlay vaadin-menu-bar-item",displayName:"Menu Items",properties:[n.textColor,n.fontSize,n.fontWeight]}],async setupElement(t){t.overlayClass=t.getAttribute("class");const r=document.createElement("vaadin-menu-bar-item");t.items=[{component:r,children:[{text:"Sub item"}]}],await new Promise(e=>setTimeout(e,10))},async cleanupElement(t){t._close()},openOverlay(t){t.element.querySelector("vaadin-menu-bar-button").click();const r=t.element.shadowRoot.querySelector("vaadin-menu-bar-submenu");if(!r)return;const e=r.$.overlay;e&&(e._storedModeless=e.modeless,e.modeless=!0,document._themeEditorDocClickListener=d(r,e),document.addEventListener("click",document._themeEditorDocClickListener),document.documentElement.removeEventListener("click",r.__itemsOutsideClickListener))},hideOverlay(t){const r=t.element.shadowRoot.querySelector("vaadin-menu-bar-submenu");if(!r)return;const e=r.$.overlay;e&&(e.close(),e.modeless=e._storedModeless,delete e._storedModeless,document.removeEventListener("click",document._themeEditorDocClickListener),document.documentElement.addEventListener("click",r.__itemsOutsideClickListener),delete document._themeEditorDocClickListener)}};export{v as default};