103 lines
63 KiB
JavaScript
103 lines
63 KiB
JavaScript
|
import{l as t,o as e,f as i,i as s,h as n,e as o,t as r,j as a,R as d,y as c,k as l,d as h,n as m,M as p,B as u,p as g,q as f,u as y,v as _,x,z as v,A as E,C as b,D as I,_ as T,F as A,E as O,G as S}from"./main-85e087f9.js";import{o as R}from"./c.8e28b461.js";function C(i,s,n){let o,r=i;return"object"==typeof i?(r=i.slot,o=i):o={flatten:s},n?t({slot:r,flatten:s,selector:n}):e({descriptor:t=>({get(){var t,e;const i="slot"+(r?`[name=${r}]`:":not([name])"),s=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(i);return null!==(e=null==s?void 0:s.assignedNodes(o))&&void 0!==e?e:[]},enumerable:!0,configurable:!0})})}function w(t){const e=t.language||"en";return t.translationMetadata.translations[e]&&t.translationMetadata.translations[e].isRTL||!1}function F(t){return w(t)?"rtl":"ltr"}class N extends a{constructor(){super(...arguments),this.value="",this.group=null,this.tabindex=-1,this.disabled=!1,this.twoline=!1,this.activated=!1,this.graphic=null,this.multipleGraphics=!1,this.hasMeta=!1,this.noninteractive=!1,this.selected=!1,this.shouldRenderRipple=!1,this._managingList=null,this.boundOnClick=this.onClick.bind(this),this._firstChanged=!0,this._skipPropRequest=!1,this.rippleHandlers=new d((()=>(this.shouldRenderRipple=!0,this.ripple))),this.listeners=[{target:this,eventNames:["click"],cb:()=>{this.onClick()}},{target:this,eventNames:["mouseenter"],cb:this.rippleHandlers.startHover},{target:this,eventNames:["mouseleave"],cb:this.rippleHandlers.endHover},{target:this,eventNames:["focus"],cb:this.rippleHandlers.startFocus},{target:this,eventNames:["blur"],cb:this.rippleHandlers.endFocus},{target:this,eventNames:["mousedown","touchstart"],cb:t=>{const e=t.type;this.onDown("mousedown"===e?"mouseup":"touchend",t)}}]}get text(){const t=this.textContent;return t?t.trim():""}render(){const t=this.renderText(),e=this.graphic?this.renderGraphic():c``,i=this.hasMeta?this.renderMeta():c``;return c`
|
||
|
${this.renderRipple()}
|
||
|
${e}
|
||
|
${t}
|
||
|
${i}`}renderRipple(){return this.shouldRenderRipple?c`
|
||
|
<mwc-ripple
|
||
|
.activated=${this.activated}>
|
||
|
</mwc-ripple>`:this.activated?c`<div class="fake-activated-ripple"></div>`:""}renderGraphic(){const t={multi:this.multipleGraphics};return c`
|
||
|
<span class="mdc-deprecated-list-item__graphic material-icons ${l(t)}">
|
||
|
<slot name="graphic"></slot>
|
||
|
</span>`}renderMeta(){return c`
|
||
|
<span class="mdc-deprecated-list-item__meta material-icons">
|
||
|
<slot name="meta"></slot>
|
||
|
</span>`}renderText(){const t=this.twoline?this.renderTwoline():this.renderSingleLine();return c`
|
||
|
<span class="mdc-deprecated-list-item__text">
|
||
|
${t}
|
||
|
</span>`}renderSingleLine(){return c`<slot></slot>`}renderTwoline(){return c`
|
||
|
<span class="mdc-deprecated-list-item__primary-text">
|
||
|
<slot></slot>
|
||
|
</span>
|
||
|
<span class="mdc-deprecated-list-item__secondary-text">
|
||
|
<slot name="secondary"></slot>
|
||
|
</span>
|
||
|
`}onClick(){this.fireRequestSelected(!this.selected,"interaction")}onDown(t,e){const i=()=>{window.removeEventListener(t,i),this.rippleHandlers.endPress()};window.addEventListener(t,i),this.rippleHandlers.startPress(e)}fireRequestSelected(t,e){if(this.noninteractive)return;const i=new CustomEvent("request-selected",{bubbles:!0,composed:!0,detail:{source:e,selected:t}});this.dispatchEvent(i)}connectedCallback(){super.connectedCallback(),this.noninteractive||this.setAttribute("mwc-list-item","");for(const t of this.listeners)for(const e of t.eventNames)t.target.addEventListener(e,t.cb,{passive:!0})}disconnectedCallback(){super.disconnectedCallback();for(const t of this.listeners)for(const e of t.eventNames)t.target.removeEventListener(e,t.cb);this._managingList&&(this._managingList.debouncedLayout?this._managingList.debouncedLayout(!0):this._managingList.layout(!0))}firstUpdated(){const t=new Event("list-item-rendered",{bubbles:!0,composed:!0});this.dispatchEvent(t)}}i([s("slot")],N.prototype,"slotElement",void 0),i([n("mwc-ripple")],N.prototype,"ripple",void 0),i([o({type:String})],N.prototype,"value",void 0),i([o({type:String,reflect:!0})],N.prototype,"group",void 0),i([o({type:Number,reflect:!0})],N.prototype,"tabindex",void 0),i([o({type:Boolean,reflect:!0}),R((function(t){t?this.setAttribute("aria-disabled","true"):this.setAttribute("aria-disabled","false")}))],N.prototype,"disabled",void 0),i([o({type:Boolean,reflect:!0})],N.prototype,"twoline",void 0),i([o({type:Boolean,reflect:!0})],N.prototype,"activated",void 0),i([o({type:String,reflect:!0})],N.prototype,"graphic",void 0),i([o({type:Boolean})],N.prototype,"multipleGraphics",void 0),i([o({type:Boolean})],N.prototype,"hasMeta",void 0),i([o({type:Boolean,reflect:!0}),R((function(t){t?(this.removeAttribute("aria-checked"),this.removeAttribute("mwc-list-item"),this.selected=!1,this.activated=!1,this.tabIndex=-1):this.setAttribute("mwc-list-item","")}))],N.prototype,"noninteractive",void 0),i([o({type:Boolean,reflect:!0}),R((function(t){const e=this.getAttribute("role"),i="gridcell"===e||"option"===e||"row"===e||"tab"===e;i&&t?this.setAttribute("aria-selected","true"):i&&this.setAttribute("aria-selected","false"),this._firstChanged?this._firstChanged=!1:this._skipPropRequest||this.fireRequestSelected(t,"property")}))],N.prototype,"selected",void 0),i([r()],N.prototype,"shouldRenderRipple",void 0),i([r()],N.prototype,"_managingList",void 0);const M=h`:host{cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;height:48px;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;padding-left:var(--mdc-list-side-padding, 16px);padding-right:var(--mdc-list-side-padding, 16px);outline:none;height:48px;color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87))}:host:focus{outline:none}:host([activated]){color:#6200ee;color:var(--mdc-theme-primary, #6200ee);--mdc-ripple-color: var( --mdc-theme-primary, #6200ee )}:host([activated]) .mdc-deprecated-list-item__graphic{color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}:host([activated]) .fake-activated-ripple::before{position:absolute;display:block;top:0;bottom:0;left:0;right:0;width:100%;height:100%;pointer-events:none;z-index:1;content:"";opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12);background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-deprecated-list-item__graphic{flex-shrink:0;align-items:center;justify-content:center;fill:currentColor;display:inline-flex}.mdc-deprecated-list-item__graphic ::slotted(*){flex-shrink:0;align-items:center;justify-content:center;fill:currentColor;width:100%;height:100%;text-align:center}.mdc-deprecated-list-item__meta{width:var(--mdc-list-item-meta-size, 24px);height:var(--mdc-list-item-meta-size, 24px);margin-left:auto;margin-right:0;color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-hint-on-background, rgba(0, 0, 0, 0.38))}.mdc-deprecated-list-item__meta.multi{width:auto}.mdc-deprecated-list-item__meta ::slotted(*){widt
|
||
|
<!-- @ts-ignore -->
|
||
|
<ul
|
||
|
tabindex=${i}
|
||
|
role="${g(t)}"
|
||
|
aria-label="${g(e)}"
|
||
|
class="mdc-deprecated-list"
|
||
|
@keydown=${this.onKeydown}
|
||
|
@focusin=${this.onFocusIn}
|
||
|
@focusout=${this.onFocusOut}
|
||
|
@request-selected=${this.onRequestSelected}
|
||
|
@list-item-rendered=${this.onListItemConnected}>
|
||
|
<slot></slot>
|
||
|
${this.renderPlaceholder()}
|
||
|
</ul>
|
||
|
`}renderPlaceholder(){var t;const e=null!==(t=this.assignedElements)&&void 0!==t?t:[];return void 0!==this.emptyMessage&&0===e.length?c`
|
||
|
<mwc-list-item noninteractive>${this.emptyMessage}</mwc-list-item>
|
||
|
`:null}firstUpdated(){super.firstUpdated(),this.items.length||(this.mdcFoundation.setMulti(this.multi),this.layout())}onFocusIn(t){if(this.mdcFoundation&&this.mdcRoot){const e=this.getIndexOfTarget(t);this.mdcFoundation.handleFocusIn(t,e)}}onFocusOut(t){if(this.mdcFoundation&&this.mdcRoot){const e=this.getIndexOfTarget(t);this.mdcFoundation.handleFocusOut(t,e)}}onKeydown(t){if(this.mdcFoundation&&this.mdcRoot){const e=this.getIndexOfTarget(t),i=t.target,s=yt(i);this.mdcFoundation.handleKeydown(t,s,e)}}onRequestSelected(t){if(this.mdcFoundation){let e=this.getIndexOfTarget(t);if(-1===e&&(this.layout(),e=this.getIndexOfTarget(t),-1===e))return;if(this.items[e].disabled)return;const i=t.detail.selected,s=t.detail.source;this.mdcFoundation.handleSingleSelection(e,"interaction"===s,i),t.stopPropagation()}}getIndexOfTarget(t){const e=this.items,i=t.composedPath();for(const t of i){let i=-1;if(f(t)&&yt(t)&&(i=e.indexOf(t)),-1!==i)return i}return-1}createAdapter(){return this.mdcAdapter={getListItemCount:()=>this.mdcRoot?this.items.length:0,getFocusedElementIndex:this.getFocusedItemIndex,getAttributeForElementIndex:(t,e)=>{if(!this.mdcRoot)return"";const i=this.items[t];return i?i.getAttribute(e):""},setAttributeForElementIndex:(t,e,i)=>{if(!this.mdcRoot)return;const s=this.items[t];s&&s.setAttribute(e,i)},focusItemAtIndex:t=>{const e=this.items[t];e&&e.focus()},setTabIndexForElementIndex:(t,e)=>{const i=this.items[t];i&&(i.tabindex=e)},notifyAction:t=>{const e={bubbles:!0,composed:!0};e.detail={index:t};const i=new CustomEvent("action",e);this.dispatchEvent(i)},notifySelected:(t,e)=>{const i={bubbles:!0,composed:!0};i.detail={index:t,diff:e};const s=new CustomEvent("selected",i);this.dispatchEvent(s)},isFocusInsideList:()=>y(this),isRootFocused:()=>{const t=this.mdcRoot;return t.getRootNode().activeElement===t},setDisabledStateForElementIndex:(t,e)=>{const i=this.items[t];i&&(i.disabled=e)},getDisabledStateForElementIndex:t=>{const e=this.items[t];return!!e&&e.disabled},setSelectedStateForElementIndex:(t,e)=>{const i=this.items[t];i&&(i.selected=e)},getSelectedStateForElementIndex:t=>{const e=this.items[t];return!!e&&e.selected},setActivatedStateForElementIndex:(t,e)=>{const i=this.items[t];i&&(i.activated=e)}},this.mdcAdapter}selectUi(t,e=!1){const i=this.items[t];i&&(i.selected=!0,i.activated=e)}deselectUi(t){const e=this.items[t];e&&(e.selected=!1,e.activated=!1)}select(t){this.mdcFoundation&&this.mdcFoundation.setSelectedIndex(t)}toggle(t,e){this.multi&&this.mdcFoundation.toggleMultiAtIndex(t,e)}onListItemConnected(t){const e=t.target;this.layout(-1===this.items.indexOf(e))}layout(t=!0){t&&this.updateItems();const e=this.items[0];for(const t of this.items)t.tabindex=-1;e&&(this.noninteractive?this.previousTabindex||(this.previousTabindex=e):e.tabindex=0),this.itemsReadyResolver()}getFocusedItemIndex(){if(!this.mdcRoot)return-1;if(!this.items.length)return-1;const t=_();if(!t.length)return-1;for(let e=t.length-1;e>=0;e--){const i=t[e];if(yt(i))return this.items.indexOf(i)}return-1}focusItemAtIndex(t){for(const t of this.items)if(0===t.tabindex){t.tabindex=-1;break}this.items[t].tabindex=0,this.items[t].focus()}focus(){const t=this.mdcRoot;t&&t.focus()}blur(){const t=this.mdcRoot;t&&t.blur()}}i([o({type:String})],xt.prototype,"emptyMessage",void 0),i([s(".mdc-deprecated-list")],xt.prototype,"mdcRoot",void 0),i([C("",!0,"*")],xt.prototype,"assignedElements",void 0),i([C("",!0,'[tabindex="0"]')],xt.prototype,"tabbableElements",void 0),i([o({type:Boolean}),R((function(t){this.mdcFoundation&&this.mdcFoundation.setUseActivatedClass(t)}))],xt.prototype,"activatable",void 0),i([o({type:Boolean}),R((function(t,e){this.mdcFoundation&&this.mdcFoundation.setMulti(t),void 0!==e&&this.layout()}))],xt.prototype,"multi",void 0),i([o({type:Boolean}),R((function(t){this.mdcFoundation&&this.mdcFoundation.setWrapFocus(t)}))],xt.prototype,"wrapFocus",void 0),i([o({type:String}),R((function(t,e){void 0!==e&&this.updateItems()}))],xt.prototype,"itemRoles",void 0),i([o({type:String})],xt.prototype,"innerRole",void 0),i([o({type:String})],xt.
|
||
|
<div
|
||
|
class="mdc-menu-surface ${l(t)}"
|
||
|
style="${b(e)}"
|
||
|
@keydown=${this.onKeydown}
|
||
|
@opened=${this.registerBodyClick}
|
||
|
@closed=${this.deregisterBodyClick}>
|
||
|
<slot></slot>
|
||
|
</div>`}createAdapter(){return Object.assign(Object.assign({},I(this.mdcRoot)),{hasAnchor:()=>!!this.anchor,notifyClose:()=>{const t=new CustomEvent("closed",{bubbles:!0,composed:!0});this.open=!1,this.mdcRoot.dispatchEvent(t)},notifyClosing:()=>{const t=new CustomEvent("closing",{bubbles:!0,composed:!0});this.mdcRoot.dispatchEvent(t)},notifyOpen:()=>{const t=new CustomEvent("opened",{bubbles:!0,composed:!0});this.open=!0,this.mdcRoot.dispatchEvent(t)},isElementInContainer:()=>!1,isRtl:()=>!!this.mdcRoot&&"rtl"===getComputedStyle(this.mdcRoot).direction,setTransformOrigin:t=>{this.mdcRoot&&(this.styleTransformOrigin=t)},isFocused:()=>y(this),saveFocus:()=>{const t=_(),e=t.length;e||(this.previouslyFocused=null),this.previouslyFocused=t[e-1]},restoreFocus:()=>{this.previouslyFocused&&"focus"in this.previouslyFocused&&this.previouslyFocused.focus()},getInnerDimensions:()=>{const t=this.mdcRoot;return t?{width:t.offsetWidth,height:t.offsetHeight}:{width:0,height:0}},getAnchorDimensions:()=>{const t=this.anchor;return t?t.getBoundingClientRect():null},getBodyDimensions:()=>({width:document.body.clientWidth,height:document.body.clientHeight}),getWindowDimensions:()=>({width:window.innerWidth,height:window.innerHeight}),getWindowScroll:()=>({x:window.pageXOffset,y:window.pageYOffset}),setPosition:t=>{this.mdcRoot&&(this.styleLeft="left"in t?`${t.left}px`:"",this.styleRight="right"in t?`${t.right}px`:"",this.styleTop="top"in t?`${t.top}px`:"",this.styleBottom="bottom"in t?`${t.bottom}px`:"")},setMaxHeight:async t=>{this.mdcRoot&&(this.styleMaxHeight=t,await this.updateComplete,this.styleMaxHeight=`var(--mdc-menu-max-height, ${t})`)}})}onKeydown(t){this.mdcFoundation&&this.mdcFoundation.handleKeydown(t)}onBodyClick(t){if(this.stayOpenOnBodyClick)return;-1===t.composedPath().indexOf(this)&&this.close()}registerBodyClick(){this.onBodyClickBound=this.onBodyClick.bind(this),document.body.addEventListener("click",this.onBodyClickBound,{passive:!0,capture:!0})}deregisterBodyClick(){document.body.removeEventListener("click",this.onBodyClickBound,{capture:!0})}close(){this.open=!1}show(){this.open=!0}}i([s(".mdc-menu-surface")],wt.prototype,"mdcRoot",void 0),i([s("slot")],wt.prototype,"slotElement",void 0),i([o({type:Boolean}),R((function(t){this.mdcFoundation&&!this.fixed&&this.mdcFoundation.setIsHoisted(t)}))],wt.prototype,"absolute",void 0),i([o({type:Boolean})],wt.prototype,"fullwidth",void 0),i([o({type:Boolean}),R((function(t){this.mdcFoundation&&!this.absolute&&this.mdcFoundation.setFixedPosition(t)}))],wt.prototype,"fixed",void 0),i([o({type:Number}),R((function(t){this.mdcFoundation&&null!==this.y&&null!==t&&(this.mdcFoundation.setAbsolutePosition(t,this.y),this.mdcFoundation.setAnchorMargin({left:t,top:this.y,right:-t,bottom:this.y}))}))],wt.prototype,"x",void 0),i([o({type:Number}),R((function(t){this.mdcFoundation&&null!==this.x&&null!==t&&(this.mdcFoundation.setAbsolutePosition(this.x,t),this.mdcFoundation.setAnchorMargin({left:this.x,top:t,right:-this.x,bottom:t}))}))],wt.prototype,"y",void 0),i([o({type:Boolean}),R((function(t){this.mdcFoundation&&this.mdcFoundation.setQuickOpen(t)}))],wt.prototype,"quick",void 0),i([o({type:Boolean,reflect:!0}),R((function(t,e){this.mdcFoundation&&(t?this.mdcFoundation.open():void 0!==e&&this.mdcFoundation.close())}))],wt.prototype,"open",void 0),i([o({type:Boolean})],wt.prototype,"stayOpenOnBodyClick",void 0),i([r(),R((function(t){this.mdcFoundation&&this.mdcFoundation.setAnchorCorner(t)}))],wt.prototype,"bitwiseCorner",void 0),i([o({type:String}),R((function(t){if(this.mdcFoundation){const e="START"===t||"END"===t,i=null===this.previousMenuCorner,s=!i&&t!==this.previousMenuCorner;e&&(s||i&&"END"===t)&&(this.bitwiseCorner=this.bitwiseCorner^bt.RIGHT,this.mdcFoundation.flipCornerHorizontally(),this.previousMenuCorner=t)}}))],wt.prototype,"menuCorner",void 0),i([o({type:String}),R((function(t){if(this.mdcFoundation&&t){let e=Ct[t];"END"===this.menuCorner&&(e^=bt.RIGHT),this.bitwiseCorner=e}}))],wt.prototype,"corner",void 0),i([r()],wt.prototype,"styleTop",void 0),i([r()],wt.prototy
|
||
|
<mwc-menu-surface
|
||
|
?hidden=${!this.open}
|
||
|
.anchor=${this.anchor}
|
||
|
.open=${this.open}
|
||
|
.quick=${this.quick}
|
||
|
.corner=${this.corner}
|
||
|
.x=${this.x}
|
||
|
.y=${this.y}
|
||
|
.absolute=${this.absolute}
|
||
|
.fixed=${this.fixed}
|
||
|
.fullwidth=${this.fullwidth}
|
||
|
.menuCorner=${this.menuCorner}
|
||
|
?stayOpenOnBodyClick=${this.stayOpenOnBodyClick}
|
||
|
class="mdc-menu mdc-menu-surface"
|
||
|
@closed=${this.onClosed}
|
||
|
@opened=${this.onOpened}
|
||
|
@keydown=${this.onKeydown}>
|
||
|
<mwc-list
|
||
|
rootTabbable
|
||
|
.innerAriaLabel=${this.innerAriaLabel}
|
||
|
.innerRole=${this.innerRole}
|
||
|
.multi=${this.multi}
|
||
|
class="mdc-deprecated-list"
|
||
|
.itemRoles=${t}
|
||
|
.wrapFocus=${this.wrapFocus}
|
||
|
.activatable=${this.activatable}
|
||
|
@action=${this.onAction}>
|
||
|
<slot></slot>
|
||
|
</mwc-list>
|
||
|
</mwc-menu-surface>`}createAdapter(){return{addClassToElementAtIndex:(t,e)=>{const i=this.listElement;if(!i)return;const s=i.items[t];s&&("mdc-menu-item--selected"===e?this.forceGroupSelection&&!s.selected&&i.toggle(t,!0):s.classList.add(e))},removeClassFromElementAtIndex:(t,e)=>{const i=this.listElement;if(!i)return;const s=i.items[t];s&&("mdc-menu-item--selected"===e?s.selected&&i.toggle(t,!1):s.classList.remove(e))},addAttributeToElementAtIndex:(t,e,i)=>{const s=this.listElement;if(!s)return;const n=s.items[t];n&&n.setAttribute(e,i)},removeAttributeFromElementAtIndex:(t,e)=>{const i=this.listElement;if(!i)return;const s=i.items[t];s&&s.removeAttribute(e)},getAttributeFromElementAtIndex:(t,e)=>{const i=this.listElement;if(!i)return null;const s=i.items[t];return s?s.getAttribute(e):null},elementContainsClass:(t,e)=>t.classList.contains(e),closeSurface:()=>{this.open=!1},getElementIndex:t=>{const e=this.listElement;return e?e.items.indexOf(t):-1},notifySelected:()=>{},getMenuItemCount:()=>{const t=this.listElement;return t?t.items.length:0},focusItemAtIndex:t=>{const e=this.listElement;if(!e)return;const i=e.items[t];i&&i.focus()},focusListRoot:()=>{this.listElement&&this.listElement.focus()},getSelectedSiblingOfItemAtIndex:t=>{const e=this.listElement;if(!e)return-1;const i=e.items[t];if(!i||!i.group)return-1;for(let s=0;s<e.items.length;s++){if(s===t)continue;const n=e.items[s];if(n.selected&&n.group===i.group)return s}return-1},isSelectableItemAtIndex:t=>{const e=this.listElement;if(!e)return!1;const i=e.items[t];return!!i&&i.hasAttribute("group")}}}onKeydown(t){this.mdcFoundation&&this.mdcFoundation.handleKeydown(t)}onAction(t){const e=this.listElement;if(this.mdcFoundation&&e){const i=t.detail.index,s=e.items[i];s&&this.mdcFoundation.handleItemAction(s)}}onOpened(){this.open=!0,this.mdcFoundation&&this.mdcFoundation.handleMenuSurfaceOpened()}onClosed(){this.open=!1}async getUpdateComplete(){await this._listUpdateComplete;return await super.getUpdateComplete()}async firstUpdated(){super.firstUpdated();const t=this.listElement;t&&(this._listUpdateComplete=t.updateComplete,await this._listUpdateComplete)}select(t){const e=this.listElement;e&&e.select(t)}close(){this.open=!1}show(){this.open=!0}getFocusedItemIndex(){const t=this.listElement;return t?t.getFocusedItemIndex():-1}focusItemAtIndex(t){const e=this.listElement;e&&e.focusItemAtIndex(t)}layout(t=!0){const e=this.listElement;e&&e.layout(t)}}i([s(".mdc-menu")],Pt.prototype,"mdcRoot",void 0),i([s("slot")],Pt.prototype,"slotElement",void 0),i([o({type:Object})],Pt.prototype,"anchor",void 0),i([o({type:Boolean,reflect:!0})],Pt.prototype,"open",void 0),i([o({type:Boolean})],Pt.prototype,"quick",void 0),i([o({type:Boolean})],Pt.prototype,"wrapFocus",void 0),i([o({type:String})],Pt.prototype,"innerRole",void 0),i([o({type:String})],Pt.prototype,"innerAriaLabel",void 0),i([o({type:String})],Pt.prototype,"corner",void 0),i([o({type:Number})],Pt.prototype,"x",void 0),i([o({type:Number})],Pt.prototype,"y",void 0),i([o({type:Boolean})],Pt.prototype,"absolute",void 0),i([o({type:Boolean})],Pt.prototype,"multi",void 0),i([o({type:Boolean})],Pt.prototype,"activatable",void 0),i([o({type:Boolean})],Pt.prototype,"fixed",void 0),i([o({type:Boolean})],Pt.prototype,"forceGroupSelection",void 0),i([o({type:Boolean})],Pt.prototype,"fullwidth",void 0),i([o({type:String})],Pt.prototype,"menuCorner",void 0),i([o({type:Boolean})],Pt.prototype,"stayOpenOnBodyClick",void 0),i([o({type:String}),R((function(t){this.mdcFoundation&&this.mdcFoundation.setDefaultFocusState(Mt[t])}))],Pt.prototype,"defaultFocus",void 0);const Ht=h`mwc-list ::slotted([mwc-list-item]:not([twoline])),mwc-list ::slotted([noninteractive]:not([twoline])){height:var(--mdc-menu-item-height, 48px)}`;let zt=class extends Pt{};zt.styles=[Ht],zt=i([m("mwc-menu")],zt),T([m("ha-button-menu")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"field",key:A,value:void 0},{kind:"field",decorators:[o()],key:"corner",value:()=>"TOP_START"},{kind:"field",decorators:[o()],key:"menuCorner
|
||
|
<div @click=${this._handleClick}>
|
||
|
<slot name="trigger" @slotchange=${this._setTriggerAria}></slot>
|
||
|
</div>
|
||
|
<mwc-menu
|
||
|
.corner=${this.corner}
|
||
|
.menuCorner=${this.menuCorner}
|
||
|
.fixed=${this.fixed}
|
||
|
.multi=${this.multi}
|
||
|
.activatable=${this.activatable}
|
||
|
.y=${this.y}
|
||
|
.x=${this.x}
|
||
|
>
|
||
|
<slot></slot>
|
||
|
</mwc-menu>
|
||
|
`}},{kind:"method",key:"firstUpdated",value:function(t){O(S(i.prototype),"firstUpdated",this).call(this,t),"rtl"===document.dir&&this.updateComplete.then((()=>{this.querySelectorAll("mwc-list-item").forEach((t=>{const e=document.createElement("style");e.innerHTML="span.material-icons:first-of-type { margin-left: var(--mdc-list-item-graphic-margin, 32px) !important; margin-right: 0px !important;}",t.shadowRoot.appendChild(e)}))}))}},{kind:"method",key:"_handleClick",value:function(){this.disabled||(this._menu.anchor=this,this._menu.show())}},{kind:"get",key:"_triggerButton",value:function(){return this.querySelector('ha-icon-button[slot="trigger"], mwc-button[slot="trigger"]')}},{kind:"method",key:"_setTriggerAria",value:function(){this._triggerButton&&(this._triggerButton.ariaHasPopup="menu")}},{kind:"get",static:!0,key:"styles",value:function(){return h`
|
||
|
:host {
|
||
|
display: inline-block;
|
||
|
position: relative;
|
||
|
}
|
||
|
::slotted([disabled]) {
|
||
|
color: var(--disabled-text-color);
|
||
|
}
|
||
|
`}}]}}),a);export{It as C,B as K,N as L,et as a,F as b,w as c,ht as n,C as o,M as s};
|