@fluentui/web-components 3.0.0-beta.101 → 3.0.0-beta.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -2
- package/dist/esm/menu/menu.js +4 -2
- package/dist/esm/menu/menu.js.map +1 -1
- package/dist/web-components.js +4 -2
- package/dist/web-components.min.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
# Change Log - @fluentui/web-components
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 21 May 2025 04:07:14 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [3.0.0-beta.102](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.0-beta.102)
|
|
8
|
+
|
|
9
|
+
Wed, 21 May 2025 04:07:14 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0-beta.101..@fluentui/web-components_v3.0.0-beta.102)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- manage focus only when menu is open ([PR #34486](https://github.com/microsoft/fluentui/pull/34486) by machi@microsoft.com)
|
|
15
|
+
|
|
7
16
|
## [3.0.0-beta.101](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.0-beta.101)
|
|
8
17
|
|
|
9
|
-
Tue, 20 May 2025 04:06:
|
|
18
|
+
Tue, 20 May 2025 04:06:48 GMT
|
|
10
19
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0-beta.100..@fluentui/web-components_v3.0.0-beta.101)
|
|
11
20
|
|
|
12
21
|
### Changes
|
package/dist/esm/menu/menu.js
CHANGED
|
@@ -111,10 +111,12 @@ export class Menu extends FASTElement {
|
|
|
111
111
|
// @ts-expect-error - Baseline 2024
|
|
112
112
|
if (e.type === 'toggle' && e.newState) {
|
|
113
113
|
// @ts-expect-error - Baseline 2024
|
|
114
|
-
const newState = e.newState === 'open'
|
|
114
|
+
const newState = e.newState === 'open';
|
|
115
115
|
this._trigger?.setAttribute('aria-expanded', `${newState}`);
|
|
116
116
|
this._open = newState;
|
|
117
|
-
this.
|
|
117
|
+
if (this._open) {
|
|
118
|
+
this.focusMenuList();
|
|
119
|
+
}
|
|
118
120
|
}
|
|
119
121
|
};
|
|
120
122
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../../../src/menu/menu.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAEtF,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,OAAO,IAAK,SAAQ,WAAW;IAArC;;QAoCE;;;WAGG;QAEI,oBAAe,GAAe,EAAE,CAAC;QAExC;;;WAGG;QAEI,oBAAe,GAAkB,EAAE,CAAC;QAS3C;;;WAGG;QACK,UAAK,GAAY,KAAK,CAAC;QAkD/B;;;WAGG;QACI,eAAU,GAAG,GAAG,EAAE;YACvB,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7C,CAAC,CAAC;QAEF;;;WAGG;QACI,cAAS,GAAG,CAAC,KAAa,EAAE,EAAE;YACnC,sEAAsE;YACtE,IACE,KAAK,EAAE,MAAM,YAAY,QAAQ;gBACjC,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CA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AAC,CAAiB,CAAC,YAAY,KAAK,IAAI,CAAC,aAAa,EACxE,CAAC;oBACD,IAAI,CAAC,YAAY,EAAE,CAAC;gBACtB,CAAC;qBAAM,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;oBACtB,OAAO,IAAI,CAAC;gBACd,CAAC;YACH;gBACE,OAAO,IAAI,CAAC;QAChB,CAAC;IACH,CAAC;CAmCF;AAnXQ;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;yCACzB;AAOtB;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;2CACzB;AAOxB;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;2CACzB;AAOxB;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;gDAC1B;AAO7B;IADN,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;mCACH;AAOhB;IADN,UAAU;6CAC6B;AAOjC;IADN,UAAU;6CACgC;AAOpC;IADN,UAAU;2CAC4B"}
|
package/dist/web-components.js
CHANGED
|
@@ -8922,10 +8922,12 @@ class Menu extends FASTElement {
|
|
|
8922
8922
|
*/
|
|
8923
8923
|
this.toggleHandler = e => {
|
|
8924
8924
|
if (e.type === "toggle" && e.newState) {
|
|
8925
|
-
const newState = e.newState === "open"
|
|
8925
|
+
const newState = e.newState === "open";
|
|
8926
8926
|
this._trigger?.setAttribute("aria-expanded", `${newState}`);
|
|
8927
8927
|
this._open = newState;
|
|
8928
|
-
this.
|
|
8928
|
+
if (this._open) {
|
|
8929
|
+
this.focusMenuList();
|
|
8930
|
+
}
|
|
8929
8931
|
}
|
|
8930
8932
|
};
|
|
8931
8933
|
/**
|
|
@@ -446,7 +446,7 @@ const p=Object.freeze({prefix:"fluent",shadowRootMode:"open",registry:customElem
|
|
|
446
446
|
:host(${ye}),:host(${ye}) ::slotted([slot='start']),:host(${ye}) ::slotted([slot='end']){color:GrayText}`)),Yp=b.partial('<svg class="indicator" fill="currentColor" aria-hidden="true" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.05 3.49c.28.3.27.77-.04 1.06l-7.93 7.47A.85.85 0 014.9 12L2.22 9.28a.75.75 0 111.06-1.06l2.24 2.27 7.47-7.04a.75.75 0 011.06.04z" fill="currentColor"></path></svg>'),Qp=b.partial('<svg class="submenu-glyph" fill="currentColor" aria-hidden="true" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M5.74 3.2a.75.75 0 00-.04 1.06L9.23 8 5.7 11.74a.75.75 0 101.1 1.02l4-4.25a.75.75 0 000-1.02l-4-4.25a.75.75 0 00-1.06-.04z" fill="currentColor"></path></svg>');function Zp(o={}){return b`<template @keydown="${(e,t)=>e.handleMenuItemKeyDown(t.event)}" @click="${(e,t)=>e.handleMenuItemClick(t.event)}" @mouseover="${(e,t)=>e.handleMouseOver(t.event)}" @mouseout="${(e,t)=>e.handleMouseOut(t.event)}" @toggle="${(e,t)=>e.toggleHandler(t.event)}"><slot name="indicator">${he(o.indicator)}</slot>${He(o)}<div part="content" class="content"><slot></slot></div>${ot(o)}<slot name="submenu-glyph">${he(o.submenuGlyph)}</slot><slot name="submenu" ${V({property:"slottedSubmenu"})}></slot></template>`}const Jp=Zp({indicator:Yp,submenuGlyph:Qp}),eb=Ae.compose({name:`${p.prefix}-menu-item`,template:Jp,styles:Kp});eb.define(p.registry);var tb=Object.defineProperty,ob=Object.getOwnPropertyDescriptor,ib=(o,e,t,i)=>{for(var r=i>1?void 0:i?ob(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&tb(e,t,r),r};const jr=class os extends ${constructor(){super(),this.elementInternals=this.attachInternals(),this.focusIndex=-1,this.isNestedMenu=()=>this.parentElement!==null&&sr(this.parentElement)&&this.parentElement.getAttribute("role")==="menuitem",this.handleFocusOut=e=>{if(!this.contains(e.relatedTarget)&&this.menuItems!==void 0){const t=this.menuItems.findIndex(this.isFocusableElement);this.menuItems[this.focusIndex].setAttribute("tabindex","-1"),this.menuItems[t].setAttribute("tabindex","0"),this.focusIndex=t}},this.handleItemFocus=e=>{const t=e.target;this.menuItems!==void 0&&t!==this.menuItems[this.focusIndex]&&(this.menuItems[this.focusIndex].setAttribute("tabindex","-1"),this.focusIndex=this.menuItems.indexOf(t),t.setAttribute("tabindex","0"))},this.changedMenuItemHandler=e=>{if(this.menuItems===void 0)return;const t=e.target,i=this.menuItems.indexOf(t);if(i!==-1&&t.role==="menuitemradio"&&t.checked===!0){for(let s=i-1;s>=0;--s){const n=this.menuItems[s],c=n.getAttribute("role");if(c===te.menuitemradio&&(n.checked=!1),c==="separator")break}const r=this.menuItems.length-1;for(let s=i+1;s<=r;++s){const n=this.menuItems[s],c=n.getAttribute("role");if(c===te.menuitemradio&&(n.checked=!1),c==="separator")break}}},this.isMenuItemElement=e=>e instanceof Ae||sr(e)&&e.getAttribute("role")in os.focusableElementRoles,this.isFocusableElement=e=>this.isMenuItemElement(e),this.elementInternals.role="menu"}itemsChanged(e,t){this.$fastController.isConnected&&this.menuItems!==void 0&&this.setItems()}connectedCallback(){super.connectedCallback(),Y.enqueue(()=>{this.setItems()}),this.addEventListener("change",this.changedMenuItemHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeItemListeners(),this.menuItems=void 0,this.removeEventListener("change",this.changedMenuItemHandler)}focus(){this.setFocus(0,1)}handleMenuKeyDown(e){if(!(e.defaultPrevented||this.menuItems===void 0))switch(e.key){case lo:this.setFocus(this.focusIndex+1,1);return;case uo:this.setFocus(this.focusIndex-1,-1);return;case po:this.setFocus(this.menuItems.length-1,-1);return;case go:this.setFocus(0,1);return;default:return!0}}removeItemListeners(e=this.items){e.forEach(t=>{t.removeEventListener("focus",this.handleItemFocus),m.getNotifier(t).unsubscribe(this,"hidden")})}static elementIndent(e){const t=e.getAttribute("role"),i=e.querySelector("[slot=start]");return t&&t!==te.menuitem?i?2:1:i?1:0}setItems(){const e=Array.from(this.children);this.removeItemListeners(e),e.forEach(n=>m.getNotifier(n).subscribe(this,"hidden"));const t=e.filter(n=>!n.hasAttribute("hidden"));this.menuItems=t;const i=this.menuItems.filter(this.isMenuItemElement);i.length&&(this.focusIndex=0),i.forEach((n,c)=>{n.setAttribute("tabindex",c===0?"0":"-1"),n.addEventListener("focus",this.handleItemFocus)});const r=this.menuItems?.filter(this.isMenuItemElement),s=r?.reduce((n,c)=>{const h=os.elementIndent(c);return Math.max(n,h)},0);r?.forEach(n=>{n instanceof Ae&&n.setAttribute("data-indent",`${s}`)})}handleChange(e,t){t==="hidden"&&this.setItems()}setFocus(e,t){if(this.menuItems!==void 0)for(;e>=0&&e<this.menuItems.length;){const i=this.menuItems[e];if(this.isFocusableElement(i)){this.focusIndex>-1&&this.menuItems.length>=this.focusIndex-1&&this.menuItems[this.focusIndex].setAttribute("tabindex","-1"),this.focusIndex=e,i.setAttribute("tabindex","0"),i.focus();break}e+=t}}};jr.focusableElementRoles=te,ib([g],jr.prototype,"items",2);let rb=jr;const sb=u`
|
|
447
447
|
${k("flex")}
|
|
448
448
|
|
|
449
|
-
:host{flex-direction:column;height:fit-content;max-width:300px;min-width:160px;width:auto;background-color:${I};border:1px solid ${J};border-radius:${C};box-shadow:${xr};padding:4px;row-gap:2px}`;function nb(){return b`<template slot="${o=>o.slot?o.slot:o.isNestedMenu()?"submenu":void 0}" @keydown="${(o,e)=>o.handleMenuKeyDown(e.event)}" @focusout="${(o,e)=>o.handleFocusOut(e.event)}"><slot ${V("items")}></slot></template>`}const ab=nb(),lb=rb.compose({name:`${p.prefix}-menu-list`,template:ab,styles:sb});lb.define(p.registry);var cb=Object.defineProperty,db=Object.getOwnPropertyDescriptor,dt=(o,e,t,i)=>{for(var r=i>1?void 0:i?db(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&cb(e,t,r),r};class Je extends ${constructor(){super(...arguments),this.slottedMenuList=[],this.slottedTriggers=[],this._open=!1,this.toggleMenu=()=>{this._menuList?.togglePopover(!this._open)},this.closeMenu=e=>{e?.target instanceof Ae&&(e.target.getAttribute("role")===te.menuitemcheckbox||e.target.getAttribute("role")===te.menuitemradio)||(this._menuList?.togglePopover(!1),this.closeOnScroll&&document.removeEventListener("scroll",this.closeMenu))},this.openMenu=e=>{this._menuList?.togglePopover(!0),e&&this.openOnContext&&e.preventDefault(),this.closeOnScroll&&document.addEventListener("scroll",this.closeMenu)},this.toggleHandler=e=>{if(e.type==="toggle"&&e.newState){const t=e.newState==="open";this._trigger?.setAttribute("aria-expanded",`${t}`),this._open=t,this.focusMenuList()}},this.triggerKeydownHandler=e=>{if(e.defaultPrevented)return;switch(e.key){case Yo:case bo:e.preventDefault(),this.toggleMenu();break;default:return!0}},this.documentClickHandler=e=>{e.composedPath().some(t=>t===this._trigger||t===this._menuList)||this.closeMenu()}}connectedCallback(){super.connectedCallback(),Y.enqueue(()=>this.setComponent())}disconnectedCallback(){super.disconnectedCallback(),this.removeListeners()}setComponent(){this.$fastController.isConnected&&this.slottedMenuList.length&&this.slottedTriggers.length&&(this._trigger=this.slottedTriggers[0],this._menuList=this.slottedMenuList[0],this._trigger.setAttribute("aria-haspopup","true"),this._trigger.setAttribute("aria-expanded",`${this._open}`),this._menuList.setAttribute("popover",this.openOnContext?"manual":""),this.addListeners())}focusMenuList(){Y.enqueue(()=>{this._menuList.focus()})}focusTrigger(){Y.enqueue(()=>{this._trigger.focus()})}openOnHoverChanged(e,t){t?this._trigger?.addEventListener("mouseover",this.openMenu):this._trigger?.removeEventListener("mouseover",this.openMenu)}persistOnItemClickChanged(e,t){t?this._menuList?.removeEventListener("change",this.closeMenu):this._menuList?.addEventListener("change",this.closeMenu)}openOnContextChanged(e,t){t?this._trigger?.addEventListener("contextmenu",this.openMenu):this._trigger?.removeEventListener("contextmenu",this.openMenu)}closeOnScrollChanged(e,t){t?document.addEventListener("scroll",this.closeMenu):document.removeEventListener("scroll",this.closeMenu)}addListeners(){this._menuList?.addEventListener("toggle",this.toggleHandler),this._trigger?.addEventListener("keydown",this.triggerKeydownHandler),this.persistOnItemClick||this._menuList?.addEventListener("change",this.closeMenu),this.openOnHover?this._trigger?.addEventListener("mouseover",this.openMenu):this.openOnContext?(this._trigger?.addEventListener("contextmenu",this.openMenu),document.addEventListener("click",this.documentClickHandler)):this._trigger?.addEventListener("click",this.toggleMenu)}removeListeners(){this._menuList?.removeEventListener("toggle",this.toggleHandler),this._trigger?.removeEventListener("keydown",this.triggerKeydownHandler),this.persistOnItemClick||this._menuList?.removeEventListener("change",this.closeMenu),this.openOnHover&&this._trigger?.removeEventListener("mouseover",this.openMenu),this.openOnContext?(this._trigger?.removeEventListener("contextmenu",this.openMenu),document.removeEventListener("click",this.documentClickHandler)):this._trigger?.removeEventListener("click",this.toggleMenu)}menuKeydownHandler(e){if(e.defaultPrevented)return;switch(e.key){case bl:e.preventDefault(),this._open&&(this.closeMenu(),this.focusTrigger());break;case gl:if(this._open&&this.closeMenu(),e.shiftKey&&e.composedPath()[0]!==this._trigger&&e.composedPath()[0].assignedSlot!==this.primaryAction)this.focusTrigger();else if(e.shiftKey)return!0;default:return!0}}}dt([a({attribute:"open-on-hover",mode:"boolean"})],Je.prototype,"openOnHover",2),dt([a({attribute:"open-on-context",mode:"boolean"})],Je.prototype,"openOnContext",2),dt([a({attribute:"close-on-scroll",mode:"boolean"})],Je.prototype,"closeOnScroll",2),dt([a({attribute:"persist-on-item-click",mode:"boolean"})],Je.prototype,"persistOnItemClick",2),dt([a({mode:"boolean"})],Je.prototype,"split",2),dt([g],Je.prototype,"slottedMenuList",2),dt([g],Je.prototype,"slottedTriggers",2),dt([g],Je.prototype,"primaryAction",2);const hb=u`
|
|
449
|
+
:host{flex-direction:column;height:fit-content;max-width:300px;min-width:160px;width:auto;background-color:${I};border:1px solid ${J};border-radius:${C};box-shadow:${xr};padding:4px;row-gap:2px}`;function nb(){return b`<template slot="${o=>o.slot?o.slot:o.isNestedMenu()?"submenu":void 0}" @keydown="${(o,e)=>o.handleMenuKeyDown(e.event)}" @focusout="${(o,e)=>o.handleFocusOut(e.event)}"><slot ${V("items")}></slot></template>`}const ab=nb(),lb=rb.compose({name:`${p.prefix}-menu-list`,template:ab,styles:sb});lb.define(p.registry);var cb=Object.defineProperty,db=Object.getOwnPropertyDescriptor,dt=(o,e,t,i)=>{for(var r=i>1?void 0:i?db(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&cb(e,t,r),r};class Je extends ${constructor(){super(...arguments),this.slottedMenuList=[],this.slottedTriggers=[],this._open=!1,this.toggleMenu=()=>{this._menuList?.togglePopover(!this._open)},this.closeMenu=e=>{e?.target instanceof Ae&&(e.target.getAttribute("role")===te.menuitemcheckbox||e.target.getAttribute("role")===te.menuitemradio)||(this._menuList?.togglePopover(!1),this.closeOnScroll&&document.removeEventListener("scroll",this.closeMenu))},this.openMenu=e=>{this._menuList?.togglePopover(!0),e&&this.openOnContext&&e.preventDefault(),this.closeOnScroll&&document.addEventListener("scroll",this.closeMenu)},this.toggleHandler=e=>{if(e.type==="toggle"&&e.newState){const t=e.newState==="open";this._trigger?.setAttribute("aria-expanded",`${t}`),this._open=t,this._open&&this.focusMenuList()}},this.triggerKeydownHandler=e=>{if(e.defaultPrevented)return;switch(e.key){case Yo:case bo:e.preventDefault(),this.toggleMenu();break;default:return!0}},this.documentClickHandler=e=>{e.composedPath().some(t=>t===this._trigger||t===this._menuList)||this.closeMenu()}}connectedCallback(){super.connectedCallback(),Y.enqueue(()=>this.setComponent())}disconnectedCallback(){super.disconnectedCallback(),this.removeListeners()}setComponent(){this.$fastController.isConnected&&this.slottedMenuList.length&&this.slottedTriggers.length&&(this._trigger=this.slottedTriggers[0],this._menuList=this.slottedMenuList[0],this._trigger.setAttribute("aria-haspopup","true"),this._trigger.setAttribute("aria-expanded",`${this._open}`),this._menuList.setAttribute("popover",this.openOnContext?"manual":""),this.addListeners())}focusMenuList(){Y.enqueue(()=>{this._menuList.focus()})}focusTrigger(){Y.enqueue(()=>{this._trigger.focus()})}openOnHoverChanged(e,t){t?this._trigger?.addEventListener("mouseover",this.openMenu):this._trigger?.removeEventListener("mouseover",this.openMenu)}persistOnItemClickChanged(e,t){t?this._menuList?.removeEventListener("change",this.closeMenu):this._menuList?.addEventListener("change",this.closeMenu)}openOnContextChanged(e,t){t?this._trigger?.addEventListener("contextmenu",this.openMenu):this._trigger?.removeEventListener("contextmenu",this.openMenu)}closeOnScrollChanged(e,t){t?document.addEventListener("scroll",this.closeMenu):document.removeEventListener("scroll",this.closeMenu)}addListeners(){this._menuList?.addEventListener("toggle",this.toggleHandler),this._trigger?.addEventListener("keydown",this.triggerKeydownHandler),this.persistOnItemClick||this._menuList?.addEventListener("change",this.closeMenu),this.openOnHover?this._trigger?.addEventListener("mouseover",this.openMenu):this.openOnContext?(this._trigger?.addEventListener("contextmenu",this.openMenu),document.addEventListener("click",this.documentClickHandler)):this._trigger?.addEventListener("click",this.toggleMenu)}removeListeners(){this._menuList?.removeEventListener("toggle",this.toggleHandler),this._trigger?.removeEventListener("keydown",this.triggerKeydownHandler),this.persistOnItemClick||this._menuList?.removeEventListener("change",this.closeMenu),this.openOnHover&&this._trigger?.removeEventListener("mouseover",this.openMenu),this.openOnContext?(this._trigger?.removeEventListener("contextmenu",this.openMenu),document.removeEventListener("click",this.documentClickHandler)):this._trigger?.removeEventListener("click",this.toggleMenu)}menuKeydownHandler(e){if(e.defaultPrevented)return;switch(e.key){case bl:e.preventDefault(),this._open&&(this.closeMenu(),this.focusTrigger());break;case gl:if(this._open&&this.closeMenu(),e.shiftKey&&e.composedPath()[0]!==this._trigger&&e.composedPath()[0].assignedSlot!==this.primaryAction)this.focusTrigger();else if(e.shiftKey)return!0;default:return!0}}}dt([a({attribute:"open-on-hover",mode:"boolean"})],Je.prototype,"openOnHover",2),dt([a({attribute:"open-on-context",mode:"boolean"})],Je.prototype,"openOnContext",2),dt([a({attribute:"close-on-scroll",mode:"boolean"})],Je.prototype,"closeOnScroll",2),dt([a({attribute:"persist-on-item-click",mode:"boolean"})],Je.prototype,"persistOnItemClick",2),dt([a({mode:"boolean"})],Je.prototype,"split",2),dt([g],Je.prototype,"slottedMenuList",2),dt([g],Je.prototype,"slottedTriggers",2),dt([g],Je.prototype,"primaryAction",2);const hb=u`
|
|
450
450
|
${k("inline-block")}
|
|
451
451
|
|
|
452
452
|
::slotted([slot='trigger']){anchor-name:--menu-trigger}::slotted([popover]){margin:0;max-height:var(--menu-max-height,auto);position-anchor:--menu-trigger;position-area:block-end span-inline-end;position-try-fallbacks:flip-block;position:absolute;z-index:1}:host([split]) ::slotted([popover]){position-area:block-end span-inline-start}::slotted([popover]:popover-open){inset:unset}::slotted([popover]:not(:popover-open)){display:none}:host([split]){display:inline-flex}:host([split]) ::slotted([slot='primary-action']){border-inline-end:${T} solid ${je};border-start-end-radius:0;border-end-end-radius:0}:host([split]) ::slotted([slot='primary-action']:focus-visible){z-index:1}:host([split]) ::slotted([slot='primary-action'][appearance='primary']){border-inline-end:${T} solid white}:host([split]) ::slotted([slot='trigger']){border-inline-start:0;border-start-start-radius:0;border-end-start-radius:0}`;function ub(){return b`<template ?open-on-hover="${o=>o.openOnHover}" ?open-on-context="${o=>o.openOnContext}" ?close-on-scroll="${o=>o.closeOnScroll}" ?persist-on-item-click="${o=>o.persistOnItemClick}" @keydown="${(o,e)=>o.menuKeydownHandler(e.event)}"><slot name="primary-action" ${W("primaryAction")}></slot><slot name="trigger" ${V({property:"slottedTriggers",filter:gt()})}></slot><slot ${V({property:"slottedMenuList",filter:gt()})}></slot></template>`}const pb=ub(),bb=Je.compose({name:`${p.prefix}-menu`,template:pb,styles:hb});bb.define(p.registry);var gb=Object.defineProperty,fb=Object.getOwnPropertyDescriptor,Rr=(o,e,t,i)=>{for(var r=i>1?void 0:i?fb(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&gb(e,t,r),r};class Ti extends ${constructor(){super(),this.elementInternals=this.attachInternals(),this.dismissMessageBar=()=>{this.$emit("dismiss",{})},this.elementInternals.role="status"}}Rr([a],Ti.prototype,"shape",2),Rr([a],Ti.prototype,"layout",2),Rr([a],Ti.prototype,"intent",2);const mb=u`
|