@m3e/nav-menu 1.0.0-rc.3 → 1.0.0-rc.4
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/README.md +57 -5
- package/dist/css-custom-data.json +10 -0
- package/dist/custom-elements.json +132 -12
- package/dist/html-custom-data.json +8 -2
- package/dist/index.js +846 -662
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +81 -64
- package/dist/index.min.js.map +1 -1
- package/dist/src/NavMenuElement.d.ts +29 -2
- package/dist/src/NavMenuElement.d.ts.map +1 -1
- package/dist/src/NavMenuItemElement.d.ts +32 -3
- package/dist/src/NavMenuItemElement.d.ts.map +1 -1
- package/dist/src/NavMenuItemGroupElement.d.ts +63 -0
- package/dist/src/NavMenuItemGroupElement.d.ts.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.min.js
CHANGED
|
@@ -3,29 +3,29 @@
|
|
|
3
3
|
* Copyright (c) 2025 matraic
|
|
4
4
|
* See LICENSE file in the project root for full license text.
|
|
5
5
|
*/
|
|
6
|
-
import{LitElement as
|
|
6
|
+
import{LitElement as e,html as t,unsafeCSS as s,css as i}from"lit";import{Selected as n,Disabled as o,EventAttribute as r,AttachInternals as a,Role as l,DesignToken as h,hasAssignedNodes as c,scrollIntoViewIfNeeded as d,PressedController as m,FocusController as p}from"@m3e/core";import{selectionManager as u,SelectionManager as f}from"@m3e/core/a11y";function v(e,t,s,i){var n,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,s,r):n(t,s))||r);return o>3&&r&&Object.defineProperty(t,s,r),r}function g(e,t,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(e):i?i.value:t.get(e)}function $(e,t,s,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?n.call(e,s):n?n.value=s:t.set(e,s),s}"function"==typeof SuppressedError&&SuppressedError;
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
11
|
*/
|
|
12
|
-
const b=
|
|
12
|
+
const b=e=>(t,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},y=globalThis,_=y.ShadowRoot&&(void 0===y.ShadyCSS||y.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,A=Symbol(),w=new WeakMap;
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
|
15
15
|
* Copyright 2019 Google LLC
|
|
16
16
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
-
*/let E=class{constructor(t,
|
|
17
|
+
*/let E=class{constructor(e,t,s){if(this._$cssResult$=!0,s!==A)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(_&&void 0===e){const s=void 0!==t&&1===t.length;s&&(e=w.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&w.set(t,e))}return e}toString(){return this.cssText}};const S=_?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const s of e.cssRules)t+=s.cssText;return(e=>new E("string"==typeof e?e:e+"",void 0,A))(t)})(e):e,{is:C,defineProperty:k,getOwnPropertyDescriptor:x,getOwnPropertyNames:I,getOwnPropertySymbols:P,getPrototypeOf:M}=Object,T=globalThis,U=T.trustedTypes,O=U?U.emptyScript:"",H=T.reactiveElementPolyfillSupport,R=(e,t)=>e,L={toAttribute(e,t){switch(t){case Boolean:e=e?O:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let s=e;switch(t){case Boolean:s=null!==e;break;case Number:s=null===e?null:Number(e);break;case Object:case Array:try{s=JSON.parse(e)}catch(e){s=null}}return s}},N=(e,t)=>!C(e,t),j={attribute:!0,type:String,converter:L,reflect:!1,useDefault:!1,hasChanged:N};
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/Symbol.metadata??=Symbol("metadata"),T.litPropertyMetadata??=new WeakMap;class
|
|
22
|
+
*/Symbol.metadata??=Symbol("metadata"),T.litPropertyMetadata??=new WeakMap;class W extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=j){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(e,s,t);void 0!==i&&k(this.prototype,e,i)}}static getPropertyDescriptor(e,t,s){const{get:i,set:n}=x(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:i,set(t){const o=i?.call(this);n?.call(this,t),this.requestUpdate(e,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??j}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;const e=M(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){const e=this.properties,t=[...I(e),...P(e)];for(const s of t)this.createProperty(s,e[s])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,s]of t)this.elementProperties.set(e,s)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const s=this._$Eu(e,t);void 0!==s&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const e of s)t.unshift(S(e))}else void 0!==e&&t.push(S(e));return t}static _$Eu(e,t){const s=t.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const s of t.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(_)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const s of t){const t=document.createElement("style"),i=y.litNonce;void 0!==i&&t.setAttribute("nonce",i),t.textContent=s.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,s){this._$AK(e,s)}_$ET(e,t){const s=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,s);if(void 0!==i&&!0===s.reflect){const n=(void 0!==s.converter?.toAttribute?s.converter:L).toAttribute(t,s.type);this._$Em=e,null==n?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(e,t){const s=this.constructor,i=s._$Eh.get(e);if(void 0!==i&&this._$Em!==i){const e=s.getPropertyOptions(i),n="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:L;this._$Em=i;const o=n.fromAttribute(t,e.type);this[i]=o??this._$Ej?.get(i)??o,this._$Em=null}}requestUpdate(e,t,s){if(void 0!==e){const i=this.constructor,n=this[e];if(s??=i.getPropertyOptions(e),!((s.hasChanged??N)(n,t)||s.useDefault&&s.reflect&&n===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,s))))return;this.C(e,t,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:s,reflect:i,wrapped:n},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),!0!==n||void 0!==o)||(this._$AL.has(e)||(this.hasUpdated||s||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,s]of e){const{wrapped:e}=s,i=this[t];!0!==e||this._$AL.has(t)||void 0===i||this.C(t,void 0,s,i)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}}W.elementStyles=[],W.shadowRootOptions={mode:"open"},W[R("elementProperties")]=new Map,W[R("finalized")]=new Map,H?.({ReactiveElement:W}),(T.reactiveElementVersions??=[]).push("2.1.1");
|
|
23
23
|
/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
27
|
*/
|
|
28
|
-
const D={attribute:!0,type:String,converter:
|
|
28
|
+
const D={attribute:!0,type:String,converter:L,reflect:!1,hasChanged:N},z=(e=D,t,s)=>{const{kind:i,metadata:n}=s;let o=globalThis.litPropertyMetadata.get(n);if(void 0===o&&globalThis.litPropertyMetadata.set(n,o=new Map),"setter"===i&&((e=Object.create(e)).wrapped=!0),o.set(s.name,e),"accessor"===i){const{name:i}=s;return{set(s){const n=t.get.call(this);t.set.call(this,s),this.requestUpdate(i,n,e)},init(t){return void 0!==t&&this.C(i,void 0,e,t),t}}}if("setter"===i){const{name:i}=s;return function(s){const n=this[i];t.call(this,s),this.requestUpdate(i,n,e)}}throw Error("Unsupported decorator location: "+i)};function B(e){return(t,s)=>"object"==typeof s?z(e,t,s):((e,t,s)=>{const i=t.hasOwnProperty(s);return t.constructor.createProperty(s,e),i?Object.getOwnPropertyDescriptor(t,s):void 0})(e,t,s)}
|
|
29
29
|
/**
|
|
30
30
|
* @license
|
|
31
31
|
* Copyright 2017 Google LLC
|
|
@@ -36,38 +36,18 @@ const D={attribute:!0,type:String,converter:N,reflect:!1,hasChanged:L},W=(t=D,e,
|
|
|
36
36
|
* Copyright 2017 Google LLC
|
|
37
37
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
38
38
|
*/
|
|
39
|
-
function q(t
|
|
40
|
-
:host {
|
|
41
|
-
display: flex;
|
|
42
|
-
flex-direction: column;
|
|
43
|
-
outline: none;
|
|
44
|
-
overflow-y: auto;
|
|
45
|
-
overflow-x: hidden;
|
|
46
|
-
position: relative;
|
|
47
|
-
min-height: 0;
|
|
48
|
-
padding-block-start: var(--m3e-nav-menu-padding-top, 0.5rem);
|
|
49
|
-
padding-block-end: var(--m3e-nav-menu-padding-bottom, 0.5rem);
|
|
50
|
-
padding-inline-start: var(--m3e-nav-menu-padding-left, 0.75rem);
|
|
51
|
-
padding-inline-end: var(--m3e-nav-menu-padding-right, 0.75rem);
|
|
52
|
-
scrollbar-width: ${l.scrollbar.width};
|
|
53
|
-
scrollbar-color: ${l.scrollbar.color};
|
|
54
|
-
}
|
|
55
|
-
::slotted(m3e-divider) {
|
|
56
|
-
margin-block: var(--m3e-nav-menu-divider-margin, 0.25rem);
|
|
57
|
-
}
|
|
58
|
-
`,rt.__nextId=0,rt=ot=v([b("m3e-nav-menu")],rt);
|
|
39
|
+
function q(e,t){return(t,s,i)=>((e,t,s)=>(s.configurable=!0,s.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,s),s))(t,s,{get(){return(t=>t.renderRoot?.querySelector(e)??null)(this)}})}
|
|
59
40
|
/**
|
|
60
41
|
* @license
|
|
61
42
|
* Copyright 2017 Google LLC
|
|
62
43
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
63
|
-
*/
|
|
64
|
-
const at=globalThis,lt=at.trustedTypes,ht=lt?lt.createPolicy("lit-html",{createHTML:t=>t}):void 0,ct="$lit$",dt=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+dt,pt=`<${mt}>`,ut=document,ft=()=>ut.createComment(""),vt=t=>null===t||"object"!=typeof t&&"function"!=typeof t,gt=Array.isArray,$t="[ \t\n\f\r]",bt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,yt=/-->/g,_t=/>/g,At=RegExp(`>|${$t}(?:([^\\s"'>=/]+)(${$t}*=${$t}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),wt=/'/g,Et=/"/g,St=/^(?:script|style|textarea|title)$/i,Ct=Symbol.for("lit-noChange"),kt=Symbol.for("lit-nothing"),xt=new WeakMap,Pt=ut.createTreeWalker(ut,129);function It(t,e){if(!gt(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==ht?ht.createHTML(e):e}const Mt=(t,e)=>{const s=t.length-1,i=[];let n,o=2===e?"<svg>":3===e?"<math>":"",r=bt;for(let e=0;e<s;e++){const s=t[e];let a,l,h=-1,c=0;for(;c<s.length&&(r.lastIndex=c,l=r.exec(s),null!==l);)c=r.lastIndex,r===bt?"!--"===l[1]?r=yt:void 0!==l[1]?r=_t:void 0!==l[2]?(St.test(l[2])&&(n=RegExp("</"+l[2],"g")),r=At):void 0!==l[3]&&(r=At):r===At?">"===l[0]?(r=n??bt,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?At:'"'===l[3]?Et:wt):r===Et||r===wt?r=At:r===yt||r===_t?r=bt:(r=At,n=void 0);const d=r===At&&t[e+1].startsWith("/>")?" ":"";o+=r===bt?s+pt:h>=0?(i.push(a),s.slice(0,h)+ct+s.slice(h)+dt+d):s+dt+(-2===h?e:d)}return[It(t,o+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]};class Tt{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,o=0;const r=t.length-1,a=this.parts,[l,h]=Mt(t,e);if(this.el=Tt.createElement(l,s),Pt.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=Pt.nextNode())&&a.length<r;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(ct)){const e=h[o++],s=i.getAttribute(t).split(dt),r=/([.?@])?(.*)/.exec(e);a.push({type:1,index:n,name:r[2],strings:s,ctor:"."===r[1]?Nt:"?"===r[1]?Lt:"@"===r[1]?jt:Rt}),i.removeAttribute(t)}else t.startsWith(dt)&&(a.push({type:6,index:n}),i.removeAttribute(t));if(St.test(i.tagName)){const t=i.textContent.split(dt),e=t.length-1;if(e>0){i.textContent=lt?lt.emptyScript:"";for(let s=0;s<e;s++)i.append(t[s],ft()),Pt.nextNode(),a.push({type:2,index:++n});i.append(t[e],ft())}}}else if(8===i.nodeType)if(i.data===mt)a.push({type:2,index:n});else{let t=-1;for(;-1!==(t=i.data.indexOf(dt,t+1));)a.push({type:7,index:n}),t+=dt.length-1}n++}}static createElement(t,e){const s=ut.createElement("template");return s.innerHTML=t,s}}function Ut(t,e,s=t,i){if(e===Ct)return e;let n=void 0!==i?s._$Co?.[i]:s._$Cl;const o=vt(e)?void 0:e._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),void 0===o?n=void 0:(n=new o(t),n._$AT(t,s,i)),void 0!==i?(s._$Co??=[])[i]=n:s._$Cl=n),void 0!==n&&(e=Ut(t,n._$AS(t,e.values),n,i)),e}class Ot{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??ut).importNode(e,!0);Pt.currentNode=i;let n=Pt.nextNode(),o=0,r=0,a=s[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new Ht(n,n.nextSibling,this,t):1===a.type?e=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(e=new zt(n,this,t)),this._$AV.push(e),a=s[++r]}o!==a?.index&&(n=Pt.nextNode(),o++)}return Pt.currentNode=ut,i}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class Ht{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=kt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Ut(this,t,e),vt(t)?t===kt||null==t||""===t?(this._$AH!==kt&&this._$AR(),this._$AH=kt):t!==this._$AH&&t!==Ct&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>gt(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==kt&&vt(this._$AH)?this._$AA.nextSibling.data=t:this.T(ut.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,i="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=Tt.createElement(It(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new Ot(i,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=xt.get(t.strings);return void 0===e&&xt.set(t.strings,e=new Tt(t)),e}k(t){gt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const n of t)i===e.length?e.push(s=new Ht(this.O(ft()),this.O(ft()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class Rt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=kt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=kt}_$AI(t,e=this,s,i){const n=this.strings;let o=!1;if(void 0===n)t=Ut(this,t,e,0),o=!vt(t)||t!==this._$AH&&t!==Ct,o&&(this._$AH=t);else{const i=t;let r,a;for(t=n[0],r=0;r<n.length-1;r++)a=Ut(this,i[s+r],e,r),a===Ct&&(a=this._$AH[r]),o||=!vt(a)||a!==this._$AH[r],a===kt?t=kt:t!==kt&&(t+=(a??"")+n[r+1]),this._$AH[r]=a}o&&!i&&this.j(t)}j(t){t===kt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Nt extends Rt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===kt?void 0:t}}class Lt extends Rt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==kt)}}class jt extends Rt{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=Ut(this,t,e,0)??kt)===Ct)return;const s=this._$AH,i=t===kt&&s!==kt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==kt&&(s===kt||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class zt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){Ut(this,t)}}const Dt=at.litHtmlPolyfillSupport;Dt?.(Tt,Ht),(at.litHtmlVersions??=[]).push("3.3.1");var Wt,Bt,qt,Vt,Kt,Zt,Ft,Jt,Gt,Qt,Xt,Yt;let te=Yt=class extends(h(c(d(m(n(t,"treeitem"),!0),"opening","opened","closing","closed")))){constructor(){super(...arguments),Wt.add(this),this._hasChildItems=!1,Bt.set(this,[]),qt.set(this,null),Vt.set(this,new Array),Kt.set(this,null),this.open=!1}get link(){return g(this,Kt,"f")}get label(){return this._base??null}get visible(){return!g(this,Vt,"f").some(t=>!t.open)}get path(){return[...g(this,Vt,"f"),this]}get hasChildItems(){return this._hasChildItems}get parentItem(){return g(this,Vt,"f")[g(this,Vt,"f").length-1]??null}get childItems(){return g(this,Bt,"f")}get level(){return g(this,Vt,"f").length+1}expand(t=!1){this.hasChildItems&&(this.open=!0,t&&this.childItems.forEach(t=>t.expand(!0)))}collapse(t=!1){this.hasChildItems&&(this.open=!1,t&&this.childItems.forEach(t=>t.collapse(!0)))}toggle(){this.hasChildItems&&(this.open=!this.open)}connectedCallback(){super.connectedCallback(),g(this,Vt,"f").length=0;for(let t=this.parentElement?.closest("m3e-nav-menu-item");t;t=t.parentElement?.closest("m3e-nav-menu-item"))g(this,Vt,"f").push(t);g(this,Vt,"f").reverse(),this.style.setProperty("--_nav-menu-item-level",`${this.level}`),$(this,qt,this.closest("m3e-nav-menu"),"f")}disconnectedCallback(){super.disconnectedCallback(),g(this,Vt,"f").length=0}update(t){if(super.update(t),t.has("selected")){this.ariaCurrent=this.hasChildItems?null:`${this.selected}`;for(const t of this.querySelectorAll(":scope > m3e-icon[slot]"))t.toggleAttribute("filled",this.selected);g(this,Vt,"f").forEach(t=>t.selected=this.selected),this.selected&&!this.hasChildItems&&this.closest("m3e-nav-menu")?.[f].notifySelectionChange(this)}}firstUpdated(t){super.firstUpdated(t);const e=this._base;e&&[this.focusRing,this.stateLayer,this.ripple].forEach(t=>t?.attach(e))}render(){return e`<div class="base" @click="${g(this,Wt,"m",Qt)}">
|
|
44
|
+
*/const V=globalThis,K=V.trustedTypes,Z=K?K.createPolicy("lit-html",{createHTML:e=>e}):void 0,F="$lit$",J=`lit$${Math.random().toFixed(9).slice(2)}$`,G="?"+J,Q=`<${G}>`,X=document,Y=()=>X.createComment(""),ee=e=>null===e||"object"!=typeof e&&"function"!=typeof e,te=Array.isArray,se="[ \t\n\f\r]",ie=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ne=/-->/g,oe=/>/g,re=RegExp(`>|${se}(?:([^\\s"'>=/]+)(${se}*=${se}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),ae=/'/g,le=/"/g,he=/^(?:script|style|textarea|title)$/i,ce=Symbol.for("lit-noChange"),de=Symbol.for("lit-nothing"),me=new WeakMap,pe=X.createTreeWalker(X,129);function ue(e,t){if(!te(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==Z?Z.createHTML(t):t}const fe=(e,t)=>{const s=e.length-1,i=[];let n,o=2===t?"<svg>":3===t?"<math>":"",r=ie;for(let t=0;t<s;t++){const s=e[t];let a,l,h=-1,c=0;for(;c<s.length&&(r.lastIndex=c,l=r.exec(s),null!==l);)c=r.lastIndex,r===ie?"!--"===l[1]?r=ne:void 0!==l[1]?r=oe:void 0!==l[2]?(he.test(l[2])&&(n=RegExp("</"+l[2],"g")),r=re):void 0!==l[3]&&(r=re):r===re?">"===l[0]?(r=n??ie,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?re:'"'===l[3]?le:ae):r===le||r===ae?r=re:r===ne||r===oe?r=ie:(r=re,n=void 0);const d=r===re&&e[t+1].startsWith("/>")?" ":"";o+=r===ie?s+Q:h>=0?(i.push(a),s.slice(0,h)+F+s.slice(h)+J+d):s+J+(-2===h?t:d)}return[ue(e,o+(e[s]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),i]};class ve{constructor({strings:e,_$litType$:t},s){let i;this.parts=[];let n=0,o=0;const r=e.length-1,a=this.parts,[l,h]=fe(e,t);if(this.el=ve.createElement(l,s),pe.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(i=pe.nextNode())&&a.length<r;){if(1===i.nodeType){if(i.hasAttributes())for(const e of i.getAttributeNames())if(e.endsWith(F)){const t=h[o++],s=i.getAttribute(e).split(J),r=/([.?@])?(.*)/.exec(t);a.push({type:1,index:n,name:r[2],strings:s,ctor:"."===r[1]?_e:"?"===r[1]?Ae:"@"===r[1]?we:ye}),i.removeAttribute(e)}else e.startsWith(J)&&(a.push({type:6,index:n}),i.removeAttribute(e));if(he.test(i.tagName)){const e=i.textContent.split(J),t=e.length-1;if(t>0){i.textContent=K?K.emptyScript:"";for(let s=0;s<t;s++)i.append(e[s],Y()),pe.nextNode(),a.push({type:2,index:++n});i.append(e[t],Y())}}}else if(8===i.nodeType)if(i.data===G)a.push({type:2,index:n});else{let e=-1;for(;-1!==(e=i.data.indexOf(J,e+1));)a.push({type:7,index:n}),e+=J.length-1}n++}}static createElement(e,t){const s=X.createElement("template");return s.innerHTML=e,s}}function ge(e,t,s=e,i){if(t===ce)return t;let n=void 0!==i?s._$Co?.[i]:s._$Cl;const o=ee(t)?void 0:t._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),void 0===o?n=void 0:(n=new o(e),n._$AT(e,s,i)),void 0!==i?(s._$Co??=[])[i]=n:s._$Cl=n),void 0!==n&&(t=ge(e,n._$AS(e,t.values),n,i)),t}class $e{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:s}=this._$AD,i=(e?.creationScope??X).importNode(t,!0);pe.currentNode=i;let n=pe.nextNode(),o=0,r=0,a=s[0];for(;void 0!==a;){if(o===a.index){let t;2===a.type?t=new be(n,n.nextSibling,this,e):1===a.type?t=new a.ctor(n,a.name,a.strings,this,e):6===a.type&&(t=new Ee(n,this,e)),this._$AV.push(t),a=s[++r]}o!==a?.index&&(n=pe.nextNode(),o++)}return pe.currentNode=X,i}p(e){let t=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}}class be{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,s,i){this.type=2,this._$AH=de,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=ge(this,e,t),ee(e)?e===de||null==e||""===e?(this._$AH!==de&&this._$AR(),this._$AH=de):e!==this._$AH&&e!==ce&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>te(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==de&&ee(this._$AH)?this._$AA.nextSibling.data=e:this.T(X.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:s}=e,i="number"==typeof s?this._$AC(e):(void 0===s.el&&(s.el=ve.createElement(ue(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(t);else{const e=new $e(i,this),s=e.u(this.options);e.p(t),this.T(s),this._$AH=e}}_$AC(e){let t=me.get(e.strings);return void 0===t&&me.set(e.strings,t=new ve(e)),t}k(e){te(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let s,i=0;for(const n of e)i===t.length?t.push(s=new be(this.O(Y()),this.O(Y()),this,this.options)):s=t[i],s._$AI(n),i++;i<t.length&&(this._$AR(s&&s._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class ye{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,i,n){this.type=1,this._$AH=de,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=n,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=de}_$AI(e,t=this,s,i){const n=this.strings;let o=!1;if(void 0===n)e=ge(this,e,t,0),o=!ee(e)||e!==this._$AH&&e!==ce,o&&(this._$AH=e);else{const i=e;let r,a;for(e=n[0],r=0;r<n.length-1;r++)a=ge(this,i[s+r],t,r),a===ce&&(a=this._$AH[r]),o||=!ee(a)||a!==this._$AH[r],a===de?e=de:e!==de&&(e+=(a??"")+n[r+1]),this._$AH[r]=a}o&&!i&&this.j(e)}j(e){e===de?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class _e extends ye{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===de?void 0:e}}class Ae extends ye{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==de)}}class we extends ye{constructor(e,t,s,i,n){super(e,t,s,i,n),this.type=5}_$AI(e,t=this){if((e=ge(this,e,t,0)??de)===ce)return;const s=this._$AH,i=e===de&&s!==de||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,n=e!==de&&(s===de||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class Ee{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){ge(this,e)}}const Se=V.litHtmlPolyfillSupport;Se?.(ve,be),(V.litHtmlVersions??=[]).push("3.3.1");var Ce,ke,xe,Ie,Pe,Me,Te,Ue,Oe,He,Re,Le;let Ne=Le=class extends(n(o(r(a(l(e,"treeitem"),!0),"opening","opened","closing","closed")))){constructor(){super(...arguments),Ce.add(this),this._hasChildItems=!1,ke.set(this,[]),xe.set(this,null),Ie.set(this,new Array),Pe.set(this,null),this.open=!1}get link(){return g(this,Pe,"f")}get label(){return this._base??null}get visible(){return!g(this,Ie,"f").some(e=>!e.open)}get path(){return[...g(this,Ie,"f"),this]}get hasChildItems(){return this._hasChildItems}get parentItem(){return g(this,Ie,"f")[g(this,Ie,"f").length-1]??null}get childItems(){return g(this,ke,"f")}get level(){return g(this,Ie,"f").length+1}expand(e=!1){this.hasChildItems&&(this.open=!0,e&&this.childItems.forEach(e=>e.expand(!0)))}collapse(e=!1){this.hasChildItems&&(this.open=!1,e&&this.childItems.forEach(e=>e.collapse(!0)))}toggle(){this.hasChildItems&&(this.open=!this.open)}connectedCallback(){super.connectedCallback(),g(this,Ie,"f").length=0;for(let e=this.parentElement?.closest("m3e-nav-menu-item");e;e=e.parentElement?.closest("m3e-nav-menu-item"))g(this,Ie,"f").push(e);g(this,Ie,"f").reverse(),this.style.setProperty("--_nav-menu-item-level",`${this.level}`),$(this,xe,this.closest("m3e-nav-menu"),"f")}disconnectedCallback(){super.disconnectedCallback(),g(this,Ie,"f").length=0}update(e){if(super.update(e),e.has("selected")){this.ariaSelected=null,this.ariaCurrent=this.hasChildItems?null:`${this.selected}`;for(const e of this.querySelectorAll(":scope > m3e-icon[slot]"))e.toggleAttribute("filled",this.selected);g(this,Ie,"f").forEach(e=>e.selected=this.selected),this.selected&&!this.hasChildItems&&this.closest("m3e-nav-menu")?.[u].notifySelectionChange(this)}(e.has("open")||e.has("_hasChildItems"))&&(this.ariaExpanded=this._hasChildItems?`${this.open}`:null),(e.has("_hasChildItems")&&this.disabled||e.has("disabled"))&&g(this,ke,"f").forEach(e=>e.disabled=this.disabled)}firstUpdated(e){super.firstUpdated(e);const t=this._base;t&&[this.focusRing,this.stateLayer,this.ripple].forEach(e=>e?.attach(t))}render(){return t`<div class="base" @click="${g(this,Ce,"m",He)}">
|
|
65
45
|
<m3e-state-layer class="state-layer" ?disabled="${this.disabled}"></m3e-state-layer>
|
|
66
46
|
<m3e-focus-ring class="focus-ring" inward ?disabled="${this.disabled}"></m3e-focus-ring>
|
|
67
47
|
<m3e-ripple class="ripple" centered ?disabled="${this.disabled}"></m3e-ripple>
|
|
68
|
-
<div class="icon">${g(this,
|
|
48
|
+
<div class="icon" aria-hidden="true">${g(this,Ce,"m",Me).call(this)}</div>
|
|
69
49
|
<div class="label">
|
|
70
|
-
<slot name="label" @slotchange="${g(this,
|
|
50
|
+
<slot name="label" @slotchange="${g(this,Ce,"m",Ue)}"></slot>
|
|
71
51
|
</div>
|
|
72
52
|
<slot name="badge"></slot>
|
|
73
53
|
<div aria-hidden="true" class="toggle">
|
|
@@ -81,37 +61,37 @@ const at=globalThis,lt=at.trustedTypes,ht=lt?lt.createPolicy("lit-html",{createH
|
|
|
81
61
|
<m3e-collapsible
|
|
82
62
|
class="group"
|
|
83
63
|
role="group"
|
|
84
|
-
aria-hidden="${(
|
|
64
|
+
aria-hidden="${(e=>e??de)(this._hasChildItems?void 0:"true")}"
|
|
85
65
|
?open="${this._hasChildItems&&this.open}"
|
|
86
|
-
@opening="${g(this,
|
|
87
|
-
@opened="${g(this,
|
|
88
|
-
@closing="${g(this,
|
|
89
|
-
@closed="${g(this,
|
|
66
|
+
@opening="${g(this,Ce,"m",Re)}"
|
|
67
|
+
@opened="${g(this,Ce,"m",Re)}"
|
|
68
|
+
@closing="${g(this,Ce,"m",Re)}"
|
|
69
|
+
@closed="${g(this,Ce,"m",Re)}"
|
|
90
70
|
>
|
|
91
|
-
<slot @slotchange="${g(this,
|
|
92
|
-
</m3e-collapsible>`}};
|
|
71
|
+
<slot @slotchange="${g(this,Ce,"m",Oe)}"></slot>
|
|
72
|
+
</m3e-collapsible>`}};var je,We,De,ze,Be,qe,Ve,Ke,Ze,Fe,Je,Ge,Qe,Xe,Ye;ke=new WeakMap,xe=new WeakMap,Ie=new WeakMap,Pe=new WeakMap,Ce=new WeakSet,Me=function(){const e=t`<slot name="icon" @slotchange="${g(this,Ce,"m",Te)}"></slot>`;return this.selected&&!this.hasChildItems?t`<slot name="selected-icon" @slotchange="${g(this,Ce,"m",Te)}">${e}</slot>`:e},Te=function(e){this.classList.toggle("-with-icon",c(e.target))},Ue=function(e){$(this,Pe,e.target.assignedElements({flatten:!0}).find(e=>e instanceof HTMLAnchorElement)??null,"f"),g(this,Pe,"f")?.setAttribute("tabindex","-1")},Oe=function(e){$(this,ke,e.target.assignedElements({flatten:!0}).filter(e=>e instanceof Le),"f");const t=this._hasChildItems;this._hasChildItems=g(this,ke,"f").length>0,this.classList.toggle("-has-items",this._hasChildItems),(t||this._hasChildItems)&&(this.selected=g(this,ke,"f").some(e=>e.selected))},He=function(){if(!this.disabled)if(g(this,xe,"f")?.[u].setActiveItem(this),this._hasChildItems)this.toggle();else{g(this,xe,"f")?.[u].select(this),g(this,Ie,"f").forEach(e=>e.selected=this.selected),g(this,Pe,"f")?.click();const e=this.closest("m3e-drawer-container");if(e){const t=this.closest("[slot='start']")??this.closest("[slot='end')");t&&(e.classList.contains(`-${t.slot}-push`)||e.classList.contains(`-${t.slot}-over`))&&setTimeout(()=>e.removeAttribute(t.slot),300)}}},Re=function(e){e.stopPropagation(),this.dispatchEvent(new Event(e.type,{bubbles:!0}))},Ne.styles=i`
|
|
93
73
|
:host {
|
|
94
74
|
display: block;
|
|
95
75
|
flex: none;
|
|
96
76
|
outline: none;
|
|
97
77
|
position: relative;
|
|
98
|
-
font-size: var(--m3e-nav-menu-item-font-size, ${
|
|
99
|
-
font-weight: var(--m3e-nav-menu-item-font-weight, ${
|
|
100
|
-
line-height: var(--m3e-nav-menu-item-line-height, ${
|
|
101
|
-
letter-spacing: var(--m3e-nav-menu-item-tracking, ${
|
|
78
|
+
font-size: var(--m3e-nav-menu-item-font-size, ${h.typescale.standard.label.large.fontSize});
|
|
79
|
+
font-weight: var(--m3e-nav-menu-item-font-weight, ${h.typescale.standard.label.large.fontWeight});
|
|
80
|
+
line-height: var(--m3e-nav-menu-item-line-height, ${h.typescale.standard.label.large.lineHeight});
|
|
81
|
+
letter-spacing: var(--m3e-nav-menu-item-tracking, ${h.typescale.standard.label.large.tracking});
|
|
102
82
|
}
|
|
103
83
|
.base {
|
|
104
84
|
display: flex;
|
|
105
85
|
align-items: center;
|
|
106
86
|
position: relative;
|
|
107
87
|
padding-inline: var(--m3e-nav-menu-item-padding, 1.5rem);
|
|
108
|
-
height: calc(var(--m3e-nav-menu-item-height, 3.5rem) + ${
|
|
88
|
+
height: calc(var(--m3e-nav-menu-item-height, 3.5rem) + ${h.density.calc(-3)});
|
|
109
89
|
column-gap: var(--m3e-nav-menu-item-spacing, 0.75rem);
|
|
110
|
-
transition: ${
|
|
90
|
+
transition: ${s(`color ${h.motion.duration.short4} ${h.motion.easing.standard},\n background-color ${h.motion.duration.short4} ${h.motion.easing.standard}`)};
|
|
111
91
|
}
|
|
112
92
|
.base,
|
|
113
93
|
.focus-ring {
|
|
114
|
-
border-radius: var(--m3e-nav-menu-item-shape, ${
|
|
94
|
+
border-radius: var(--m3e-nav-menu-item-shape, ${h.shape.corner.full});
|
|
115
95
|
}
|
|
116
96
|
.label {
|
|
117
97
|
flex: 1 1 auto;
|
|
@@ -133,13 +113,13 @@ const at=globalThis,lt=at.trustedTypes,ht=lt?lt.createPolicy("lit-html",{createH
|
|
|
133
113
|
::slotted([slot="badge"]) {
|
|
134
114
|
flex: none;
|
|
135
115
|
position: relative;
|
|
136
|
-
font-size: var(--m3e-nav-menu-item-badge-font-size, ${
|
|
137
|
-
font-weight: var(--m3e-nav-menu-item-badge-font-weight, ${
|
|
138
|
-
line-height: var(--m3e-nav-menu-item-badge-line-height, ${
|
|
139
|
-
letter-spacing: var(--m3e-nav-menu-badge-item-tracking, ${
|
|
116
|
+
font-size: var(--m3e-nav-menu-item-badge-font-size, ${h.typescale.standard.label.large.fontSize});
|
|
117
|
+
font-weight: var(--m3e-nav-menu-item-badge-font-weight, ${h.typescale.standard.label.large.fontWeight});
|
|
118
|
+
line-height: var(--m3e-nav-menu-item-badge-line-height, ${h.typescale.standard.label.large.lineHeight});
|
|
119
|
+
letter-spacing: var(--m3e-nav-menu-badge-item-tracking, ${h.typescale.standard.label.large.tracking});
|
|
140
120
|
}
|
|
141
121
|
.toggle {
|
|
142
|
-
transition: ${
|
|
122
|
+
transition: ${s(`transform var(--m3e-collapsible-animation-duration, ${h.motion.duration.medium1})\n ${h.motion.easing.standard}`)};
|
|
143
123
|
}
|
|
144
124
|
:host(:not(.-with-icon)) .icon {
|
|
145
125
|
display: none;
|
|
@@ -173,54 +153,54 @@ const at=globalThis,lt=at.trustedTypes,ht=lt?lt.createPolicy("lit-html",{createH
|
|
|
173
153
|
cursor: pointer;
|
|
174
154
|
}
|
|
175
155
|
:host(:not(:disabled)) .base {
|
|
176
|
-
color: var(--m3e-nav-menu-item-label-color, ${
|
|
156
|
+
color: var(--m3e-nav-menu-item-label-color, ${h.color.onSurfaceVariant});
|
|
177
157
|
}
|
|
178
158
|
:host(:disabled) .base {
|
|
179
159
|
color: color-mix(
|
|
180
160
|
in srgb,
|
|
181
|
-
var(--m3e-nav-menu-item-disabled-color, ${
|
|
161
|
+
var(--m3e-nav-menu-item-disabled-color, ${h.color.onSurface})
|
|
182
162
|
var(--m3e-nav-menu-item-disabled-color-opacity, 38%),
|
|
183
163
|
transparent
|
|
184
164
|
);
|
|
185
165
|
}
|
|
186
166
|
:host([selected]:not(.-has-items):not(:disabled)) .base {
|
|
187
|
-
color: var(--m3e-nav-menu-item-selected-label-color, ${
|
|
188
|
-
background-color: var(--m3e-nav-menu-item-selected-container-color, ${
|
|
167
|
+
color: var(--m3e-nav-menu-item-selected-label-color, ${h.color.onSecondaryContainer});
|
|
168
|
+
background-color: var(--m3e-nav-menu-item-selected-container-color, ${h.color.secondaryContainer});
|
|
189
169
|
--m3e-state-layer-focus-color: var(
|
|
190
170
|
--m3e-nav-menu-item-selected-container-focus-color,
|
|
191
|
-
${
|
|
171
|
+
${h.color.onSecondaryContainer}
|
|
192
172
|
);
|
|
193
173
|
--m3e-state-layer-hover-color: var(
|
|
194
174
|
--m3e-nav-menu-item-selected-container-hover-color,
|
|
195
|
-
${
|
|
175
|
+
${h.color.onSecondaryContainer}
|
|
196
176
|
);
|
|
197
|
-
--m3e-ripple-color: var(--m3e-nav-menu-item-selected-ripple-color, ${
|
|
177
|
+
--m3e-ripple-color: var(--m3e-nav-menu-item-selected-ripple-color, ${h.color.onSecondaryContainer});
|
|
198
178
|
}
|
|
199
179
|
:host(:not([selected]):not(.-has-items):not(:disabled)) .base {
|
|
200
180
|
--m3e-state-layer-focus-color: var(
|
|
201
181
|
--m3e-nav-menu-item-unselected-container-focus-color,
|
|
202
|
-
${
|
|
182
|
+
${h.color.onSurface}
|
|
203
183
|
);
|
|
204
184
|
--m3e-state-layer-hover-color: var(
|
|
205
185
|
--m3e-nav-menu-item-unselected-container-hover-color,
|
|
206
|
-
${
|
|
186
|
+
${h.color.onSurface}
|
|
207
187
|
);
|
|
208
|
-
--m3e-ripple-color: var(--m3e-nav-menu-item-unselected-ripple-color, ${
|
|
188
|
+
--m3e-ripple-color: var(--m3e-nav-menu-item-unselected-ripple-color, ${h.color.onSurface});
|
|
209
189
|
}
|
|
210
190
|
.state-layer {
|
|
211
191
|
margin-inline: auto;
|
|
212
192
|
}
|
|
213
193
|
:host([selected].-has-items:not(:disabled)) .base {
|
|
214
|
-
background-color: var(--m3e-nav-menu-item-open-container-color, ${
|
|
194
|
+
background-color: var(--m3e-nav-menu-item-open-container-color, ${h.color.surfaceContainerHighest});
|
|
215
195
|
--m3e-state-layer-focus-color: var(
|
|
216
196
|
--m3e-nav-menu-item-open-container-focus-color,
|
|
217
|
-
${
|
|
197
|
+
${h.color.onSurface}
|
|
218
198
|
);
|
|
219
199
|
--m3e-state-layer-hover-color: var(
|
|
220
200
|
--m3e-nav-menu-item-open-container-hover-color,
|
|
221
|
-
${
|
|
201
|
+
${h.color.onSurface}
|
|
222
202
|
);
|
|
223
|
-
--m3e-ripple-color: var(--m3e-nav-menu-item-open-ripple-color, ${
|
|
203
|
+
--m3e-ripple-color: var(--m3e-nav-menu-item-open-ripple-color, ${h.color.onSurface});
|
|
224
204
|
}
|
|
225
205
|
::slotted(a[slot="label"]) {
|
|
226
206
|
all: unset;
|
|
@@ -263,10 +243,47 @@ const at=globalThis,lt=at.trustedTypes,ht=lt?lt.createPolicy("lit-html",{createH
|
|
|
263
243
|
color: ButtonText;
|
|
264
244
|
}
|
|
265
245
|
}
|
|
266
|
-
`,v([q(".state-layer")],
|
|
246
|
+
`,v([q(".state-layer")],Ne.prototype,"stateLayer",void 0),v([q(".focus-ring")],Ne.prototype,"focusRing",void 0),v([q(".ripple")],Ne.prototype,"ripple",void 0),v([q(".base")],Ne.prototype,"_base",void 0),v([function(e){return B({...e,state:!0,attribute:!1})}
|
|
267
247
|
/**
|
|
268
248
|
* @license
|
|
269
249
|
* Copyright 2017 Google LLC
|
|
270
250
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
271
|
-
*/()],
|
|
251
|
+
*/()],Ne.prototype,"_hasChildItems",void 0),v([B({type:Boolean,reflect:!0})],Ne.prototype,"open",void 0),Ne=Le=v([b("m3e-nav-menu-item")],Ne);let et=Ye=class extends(l(e,"tree")){constructor(){super(),je.add(this),We.set(this,!1),De.set(this,!1),this[Xe]=(new f).withVerticalOrientation().withHomeAndEnd().withTypeahead().withSkipPredicate(e=>e.disabled||!e.visible).disableRovingTabIndex().onActiveItemChange(()=>{this[u].activeItem&&g(this,je,"m",Je).call(this,this[u].activeItem)}).onSelectedItemsChange(()=>{const e=this.selected;for(const t of this.items)t!==e&&g(this,je,"m",Qe).call(this,t,!1,!1);e?.label&&d(e.label,this,{block:"start",behavior:"smooth"})}),ze.set(this,e=>g(this,je,"m",Ke).call(this,e)),Be.set(this,e=>g(this,je,"m",Ze).call(this,e)),qe.set(this,e=>g(this,je,"m",Fe).call(this,e)),new m(this,{callback:e=>$(this,De,e,"f")}),new p(this,{callback:()=>{g(this,De,"f")||g(this,je,"m",Ge).call(this)}})}get selected(){return this[u].selectedItems[0]??null}get items(){return this[u].items}expand(e){(e??this[u].items).forEach(e=>e.expand())}collapse(e){(e??this[u].items).forEach(e=>e.collapse());const t=this[u].activeItem;if(t&&!t.visible)for(let e=t.parentItem;e;e=e.parentItem)if(e.visible){this[u].setActiveItem(e);break}}connectedCallback(){super.connectedCallback(),this.setAttribute("tabindex","0"),this.addEventListener("keydown",g(this,ze,"f")),this.addEventListener("keyup",g(this,Be,"f")),this.addEventListener("pointerdown",g(this,qe,"f"))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",g(this,ze,"f")),this.removeEventListener("keyup",g(this,Be,"f")),this.removeEventListener("pointerdown",g(this,qe,"f"))}render(){return t`<slot @slotchange="${g(this,je,"m",Ve)}"></slot>`}};var tt,st,it,nt,ot;We=new WeakMap,De=new WeakMap,ze=new WeakMap,Be=new WeakMap,qe=new WeakMap,je=new WeakSet,Xe=u,Ve=function(){for(const e of this.querySelectorAll("m3e-divider"))e.ariaHidden="true";const{added:e}=this[u].setItems([...this.querySelectorAll("m3e-nav-menu-item")]);for(const t of e)t.id=t.id||"m3e-nav-menu-item-"+Ye.__nextId++;this[u].activeItem?(this.setAttribute("aria-activedescendant",this[u].activeItem.id),g(this,je,"m",Ge).call(this)):this.removeAttribute("aria-activedescendant")},Ke=function(e){$(this,We,!1,"f"),g(this,je,"m",Ge).call(this);const t=this[u].activeItem;if(!e.defaultPrevented&&t&&!t.disabled)switch(e.key){case"Enter":case" ":e.preventDefault(),t.ripple&&!t.ripple.visible&&t.ripple.show(0,0,!0),t.hasChildItems?t.toggle():t.selected||(this[u].select(t),t.link?.click());break;case"*":e.preventDefault(),t.expand(!0);break;case"Left":case"ArrowLeft":if(e.preventDefault(),t.hasChildItems&&t.open)t.collapse();else{const e=t.parentItem;e&&(e.collapse(),this[u].setActiveItem(e))}break;case"Right":case"ArrowRight":if(t.hasChildItems)if(t.open)try{this[u].vertical=!1,this[u].onKeyDown(e)}finally{this[u].vertical=!0}else e.preventDefault(),t.expand();else e.preventDefault();break;default:this[u].onKeyDown(e)}},Ze=function(e){const t=this[u].activeItem;if(!e.defaultPrevented&&t&&!t.disabled)switch(e.key){case"Enter":case" ":t.ripple?.hide()}},Fe=function(e){if(!e.defaultPrevented&&!g(this,We,"f")){$(this,We,!0,"f");const t=e.composedPath().reverse().find(e=>e instanceof Ne);t&&!t.disabled&&g(this,je,"m",Qe).call(this,t,!0,!1)}},Je=function(e){this.setAttribute("aria-activedescendant",e.id),e.label&&d(e.label,this,{block:"nearest",behavior:"smooth"}),g(this,je,"m",Ge).call(this)},Ge=function(){const e=this.matches(":focus")||this.matches(":focus-within"),t=!g(this,We,"f")&&this.matches(":focus-visible");this[u].items.forEach(s=>{const i=s===this[u].activeItem;g(this,je,"m",Qe).call(this,s,i&&e,i&&t)})},Qe=function(e,t,s){t?e.stateLayer?.show("focused"):e.stateLayer?.hide("focused"),s?e.focusRing?.show():e.focusRing?.hide()},et.styles=i`
|
|
252
|
+
:host {
|
|
253
|
+
display: flex;
|
|
254
|
+
flex-direction: column;
|
|
255
|
+
outline: none;
|
|
256
|
+
overflow-y: auto;
|
|
257
|
+
overflow-x: hidden;
|
|
258
|
+
position: relative;
|
|
259
|
+
min-height: 0;
|
|
260
|
+
padding-block-start: var(--m3e-nav-menu-padding-top, 0.5rem);
|
|
261
|
+
padding-block-end: var(--m3e-nav-menu-padding-bottom, 0.5rem);
|
|
262
|
+
padding-inline-start: var(--m3e-nav-menu-padding-left, 0.75rem);
|
|
263
|
+
padding-inline-end: var(--m3e-nav-menu-padding-right, 0.75rem);
|
|
264
|
+
scrollbar-width: ${h.scrollbar.width};
|
|
265
|
+
scrollbar-color: ${h.scrollbar.color};
|
|
266
|
+
}
|
|
267
|
+
::slotted(m3e-divider) {
|
|
268
|
+
margin-block: var(--m3e-nav-menu-divider-margin, 0.25rem);
|
|
269
|
+
flex: none;
|
|
270
|
+
}
|
|
271
|
+
`,et.__nextId=0,et=Ye=v([b("m3e-nav-menu")],et);let rt=ot=class extends(l(e,"group")){constructor(){super(...arguments),tt.add(this),st.set(this,"m3e-nav-menu-item-group-label-"+ot.__nextId++),it.set(this,void 0)}connectedCallback(){super.connectedCallback(),this.classList.toggle("-divided","M3E-DIVIDER"===this.previousElementSibling?.tagName)}disconnectedCallback(){super.disconnectedCallback(),this.classList.remove("-divided")}render(){return t`<slot name="label" @slotchange="${g(this,tt,"m",nt)}"></slot><slot></slot>`}};st=new WeakMap,it=new WeakMap,tt=new WeakSet,nt=function(e){const t=e.target.assignedElements({flatten:!0})[0];t!==g(this,it,"f")&&(g(this,it,"f")?.id===g(this,st,"f")&&(g(this,it,"f").id=""),$(this,it,t,"f"),g(this,it,"f")?(g(this,it,"f").role="none",g(this,it,"f").id=g(this,it,"f").id||g(this,st,"f"),this.setAttribute("aria-labelledby",g(this,it,"f").id)):this.removeAttribute("aria-labelledby"))},rt.styles=i`
|
|
272
|
+
:host {
|
|
273
|
+
display: contents;
|
|
274
|
+
}
|
|
275
|
+
::slotted([slot="label"]) {
|
|
276
|
+
margin-inline-start: var(--m3e-nav-menu-item-group-label-inset, 1rem);
|
|
277
|
+
margin-block-end: var(--m3e-nav-menu-item-group-label-space, 1rem);
|
|
278
|
+
flex: none;
|
|
279
|
+
}
|
|
280
|
+
:host(.-divided) ::slotted([slot="label"]) {
|
|
281
|
+
margin-block-start: calc(
|
|
282
|
+
var(--m3e-nav-menu-item-group-label-space, 1rem) - var(--m3e-nav-menu-divider-margin, 0.25rem)
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
:host(:not(.-divided)) ::slotted([slot="label"]) {
|
|
286
|
+
margin-block-start: var(--m3e-nav-menu-item-group-label-space, 1rem);
|
|
287
|
+
}
|
|
288
|
+
`,rt.__nextId=0,rt=ot=v([b("m3e-nav-menu-item-group")],rt);export{et as M3eNavMenuElement,Ne as M3eNavMenuItemElement,rt as M3eNavMenuItemGroupElement};
|
|
272
289
|
//# sourceMappingURL=index.min.js.map
|