@aquera/nile-elements 1.3.1-beta-1.2 → 1.3.1-beta-1.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/demo/index.html +3 -2
- package/dist/index.js +7 -3
- package/dist/nile-side-bar-action/index.cjs.js +1 -1
- package/dist/nile-side-bar-action/index.esm.js +1 -1
- package/dist/nile-side-bar-action/nile-side-bar-action.cjs.js +1 -1
- package/dist/nile-side-bar-action/nile-side-bar-action.cjs.js.map +1 -1
- package/dist/nile-side-bar-action/nile-side-bar-action.esm.js +2 -2
- package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.css.cjs.js +1 -1
- package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.css.cjs.js.map +1 -1
- package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.css.esm.js +6 -2
- package/dist/src/nile-side-bar-action/nile-side-bar-action.d.ts +5 -2
- package/dist/src/nile-side-bar-action/nile-side-bar-action.js +37 -1
- package/dist/src/nile-side-bar-action/nile-side-bar-action.js.map +1 -1
- package/dist/src/nile-side-bar-footer-item/nile-side-bar-footer-item.css.js +4 -0
- package/dist/src/nile-side-bar-footer-item/nile-side-bar-footer-item.css.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-side-bar-action/nile-side-bar-action.ts +37 -3
- package/src/nile-side-bar-footer-item/nile-side-bar-footer-item.css.ts +4 -0
- package/vscode-html-custom-data.json +11 -1
package/demo/index.html
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
-->
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
<div style="width: 100px; height: 100px; background-color: #333;">
|
|
29
30
|
<div style="width: 400px; height: 100vh; overflow-y: auto; background-color: #333;">
|
|
30
31
|
<nile-side-bar>
|
|
31
32
|
<nile-side-bar-header slot="header">
|
|
@@ -88,7 +89,7 @@
|
|
|
88
89
|
<nile-side-bar-footer-item type="support" triggerFor="support" >
|
|
89
90
|
<span slot="icon"><nile-icon name="helpandsupport"></nile-icon></span>
|
|
90
91
|
<nile-side-bar-footer-text text="Help and Support" slot="text"></nile-side-bar-footer-text>
|
|
91
|
-
<nile-side-bar-action
|
|
92
|
+
<nile-side-bar-action enableVisibilityEffect enableTabClose slot="action" placement="right" hoist distance="20" skidding="-25">
|
|
92
93
|
<nile-icon name="arrowright" slot="trigger" triggerName="support"></nile-icon>
|
|
93
94
|
<nile-side-bar-action-menu>
|
|
94
95
|
<nile-side-bar-action-menu-item>Help Center</nile-side-bar-action-menu-item>
|
|
@@ -108,7 +109,7 @@
|
|
|
108
109
|
<nile-avatar name="James Albert" variant="text" size="lg" bg-color="#005EA6" text-color="white"></nile-avatar>
|
|
109
110
|
</span>
|
|
110
111
|
<nile-side-bar-footer-text text="James Albert" subtext="Aquera Internals" slot="text"></nile-side-bar-footer-text>
|
|
111
|
-
<nile-side-bar-action class="nile-sidebar-action" slot="action" placement="right" hoist distance="2" skidding="-22">
|
|
112
|
+
<nile-side-bar-action enableVisibilityEffect enableTabClose class="nile-sidebar-action" slot="action" placement="right" hoist distance="2" skidding="-22">
|
|
112
113
|
<nile-icon name="arrowright" slot="trigger"></nile-icon>
|
|
113
114
|
<nile-side-bar-action-menu searchEnabled>
|
|
114
115
|
<!-- PRE-HEADER (Profile Section) -->
|
package/dist/index.js
CHANGED
|
@@ -14701,7 +14701,7 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
|
|
|
14701
14701
|
|
|
14702
14702
|
|
|
14703
14703
|
|
|
14704
|
-
`,bS={bold:"format_bold",italic:"format_italic",underline:"format_underline",link:"link_2",left:"format_align_left",center:"format_align_middle",right:"format_align_right",justify:"format_align_justify",ul:"format_list_bulleted",ol:"format_list_numbered",clear:"format_clear"};let fS=class extends ae{constructor(){super(...arguments),this.value="",this.noStyles=!1,this.singleLineEditor=!1,this.placeholder="",this.mentions={},this.content="",this.previewEl=null,this.toolbarEl=null,this.lastRange=null,this.buttonMap=new Map,this.headingSelect=null,this.fontSelect=null,this.colorInput=null,this.bgColorInput=null,this.colorSwatchEl=null,this.bgSwatchEl=null,this.containerEl=null,this.mentionsEl=null,this.onEditorKeydown=e=>{if(this.singleLineEditor&&"Enter"===e.key&&e.shiftKey)return void e.preventDefault();if(e.ctrlKey&&"i"===e.key.toLowerCase()&&(e.preventDefault(),xS(this.editorEl,"em"),this.updateContent(),this.updateToolbarState()),this.singleLineEditor&&"Enter"===e.key)return void e.preventDefault();if("Tab"!==e.key)return;e.preventDefault(),this.focusAndRestore();const t=window.getSelection();if(!t||0===t.rangeCount)return;const i=t.getRangeAt(0);if(e.shiftKey){if(i.collapsed&&i.startContainer.nodeType===Node.TEXT_NODE){const e=i.startContainer,M=i.startOffset,n=e.data.slice(0,M),o=n.replace(/(\t|[ \u00a0]{2})$/,"");if(o.length!==n.length){e.data=o+e.data.slice(M);const i=document.createRange();i.setStart(e,o.length),i.collapse(!0),t.removeAllRanges(),t.addRange(i),this.updateContent(),this.updateToolbarState()}}return}i.deleteContents();const M=document.createTextNode("\t");i.insertNode(M);const n=document.createRange();n.setStartAfter(M),n.collapse(!0),t.removeAllRanges(),t.addRange(n),this.updateContent(),this.updateToolbarState()},this.onSelectionChange=()=>{if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);this.editorEl.contains(t.commonAncestorContainer)&&(this.lastRange=t.cloneRange(),this.updateToolbarState())}}createRenderRoot(){return this}injectCss(e){if(this.querySelector("style[data-rte-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}connectedCallback(){super.connectedCallback(),this.injectCss(CS.cssText),this.ensureStructure(),this.placeholder&&this.editorEl&&(this.editorEl.dataset.placeholder=this.placeholder),this.value&&!this.editorEl.innerHTML.trim()&&(this.editorEl.innerHTML=this.value),this.content=this.editorEl.innerHTML,this.toolbarEl&&this.wireAuthoredToolbar(this.toolbarEl),this.mentionsEl=this.querySelector("nile-rte-mentions"),this.mentionsEl&&(this.mentionsEl.attach?.(this.editorEl,this),this.mentionsEl.setExternalConfig?.(this.mentions)),this.wireEditor(),document.addEventListener("selectionchange",this.onSelectionChange,{passive:!0}),this.updateToolbarState(),this.syncPreview()}ensureStructure(){this.toolbarEl=this.querySelector("nile-rte-toolbar"),this.previewEl=this.querySelector("nile-rte-preview"),this.containerEl=this.querySelector(".rte-container"),this.containerEl||(this.containerEl=document.createElement("div"),this.containerEl.className="rte-container",this.appendChild(this.containerEl)),this.ensureEditor(),this.toolbarEl&&this.toolbarEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.toolbarEl),this.editorEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.editorEl),this.previewEl&&(this.previewEl.parentElement!==this&&this.appendChild(this.previewEl),this.previewEl.previousElementSibling!==this.containerEl&&this.insertBefore(this.previewEl,this.containerEl.nextSibling))}updateContentWithMention(e){this.updateContent(),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content,mention:e},bubbles:!0,composed:!0}))}disconnectedCallback(){document.removeEventListener("selectionchange",this.onSelectionChange),this.mentionsEl&&this.mentionsEl.detach&&this.mentionsEl.detach(),super.disconnectedCallback()}updated(e){e.has("value")&&this.editorEl&&this.value!==this.editorEl.innerHTML&&(this.editorEl.innerHTML=this.value||"<p><br></p>",this.content=this.editorEl.innerHTML,this.syncPreview()),e.has("singleLineEditor")&&(this.editorEl&&this.editorEl.classList.toggle("single-line",this.singleLineEditor),this.previewEl&&this.previewEl.classList.toggle("single-line",this.singleLineEditor))}ensureEditor(){if(this.editorEl=this.querySelector(".editor"),!this.editorEl){const e=document.createElement("article");e.className="editor",e.setAttribute("contenteditable","true"),this.editorEl=e}this.placeholder&&(this.editorEl.dataset.placeholder=this.placeholder),this.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>")}unwrapMention(e,t=!0){const i=e.parentNode;if(!i)return;const M=t?(e.textContent??"").replace(/\u200B/g,""):"",n=document.createTextNode(M);i.insertBefore(n,e),i.removeChild(e);const o=document.createRange();o.setStartAfter(n),o.collapse(!0);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(o)}scrubBrokenMentions(){if(!this.editorEl)return;this.editorEl.querySelectorAll("span.mention").forEach((e=>{const t=e,i=t.getAttribute("data-mention-key"),M=t.getAttribute("data-mention-label"),n=t.getAttribute("data-mention-trigger")||"",o=(t.textContent??"").replace(/\u200B/g,"").trim(),r=!!i&&!!M&&o.length>0&&o.startsWith(n)&&o.includes(M);o&&r||this.unwrapMention(t,!0)}))}wireEditor(){this.editorEl.addEventListener("input",(()=>{this.ensureAtLeastOneParagraph(),this.scrubBrokenMentions(),this.updateContent(),this.updateToolbarState()})),this.editorEl.addEventListener("mouseup",(()=>{this.saveSelection(),this.updateToolbarState()})),this.editorEl.addEventListener("keyup",(e=>{this.saveSelection(),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)&&this.updateToolbarState()})),this.editorEl.addEventListener("keydown",this.onEditorKeydown)}wireAuthoredToolbar(e){this.buttonMap.clear(),this.headingSelect=null,this.fontSelect=null,this.colorInput=null,Array.from(e.children).forEach((e=>{const t=e.tagName.toLowerCase();if("nile-rte-select"!==t||"align"!==e.getAttribute("type")){if("nile-rte-link"===t)return e.editorEl=this.editorEl,void e.addEventListener("link-changed",(()=>{this.updateContent(),this.updateToolbarState()}));if("nile-rte-toolbar-item"===t){let t=e.querySelector(":scope > nile-button");const i=e.getAttribute("name")||"",M=e.getAttribute("label")||i,n=e.getAttribute("icon"),o=e.innerHTML.trim().length>0;if(t||(t=document.createElement("nile-button"),t.variant="tertiary",t.size="small"),n)t.innerHTML=`<nile-icon name="${n}" aria-label="${M}"></nile-icon>`,e.innerHTML="";else if(o)t.innerHTML=e.innerHTML,e.innerHTML="";else{const n=bS[i];n?t.innerHTML=`<nile-icon name="${n}" size="20" color="black" aria-label="${M}"></nile-icon>`:t.textContent=M||i,e.innerHTML=""}if(!t.isConnected){const i=document.createElement("nile-tooltip");i.setAttribute("content",M),i.appendChild(t),e.appendChild(i)}t.setAttribute("aria-label",M),t.addEventListener("mousedown",(e=>e.preventDefault())),t.addEventListener("click",(()=>this.onToolbarCommand(i)));const r=this.buttonMap.get(i)??[];return r.push(t),void this.buttonMap.set(i,r)}if("nile-rte-select"!==t)"nile-rte-color"!==t||e.addEventListener("change",(e=>{this.focusAndRestore();const{mode:t,value:i}=e.detail;"backColor"===t?ES(this.editorEl,"backgroundColor",i,"data-rte-bg"):function(e,t){ES(e,"color",t,"data-rte-color")}(this.editorEl,i),this.updateContent(),this.updateToolbarState()}));else{const t=e.getAttribute("type")||"";e.addEventListener("change",(e=>{this.focusAndRestore();const i=e.detail;"heading"===t?function(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const M=OS(i.getRangeAt(0).startContainer,e);if(!M)return;if(M.tagName.toLowerCase()===t)return;const n=document.createElement(t);for(;M.firstChild;)n.appendChild(M.firstChild);M.replaceWith(n);const o=document.createRange();o.selectNodeContents(n),o.collapse(!0),i.removeAllRanges(),i.addRange(o)}(this.editorEl,i):"font"===t&&SS(this.editorEl,i),this.updateContent(),this.updateToolbarState()}))}}else e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;pS(this.editorEl,t),this.updateContent(),this.updateToolbarState()}))}))}saveSelection(){const e=window.getSelection();e&&e.rangeCount&&(this.lastRange=e.getRangeAt(0).cloneRange())}restoreSelection(){if(!this.lastRange)return;const e=document.getSelection();e&&(e.removeAllRanges(),e.addRange(this.lastRange))}focusAndRestore(){this.editorEl?.focus(),this.restoreSelection()}getCleanContent(){const e=this.editorEl.cloneNode(!0);return e.querySelectorAll("*").forEach((e=>{e.removeAttribute("style")})),e.innerHTML}insertList(e){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement(e),i=this.lastRange.extractContents(),M=document.createElement("div");M.appendChild(i),Array.from(M.childNodes).forEach((e=>{if(e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim())return;const i=document.createElement("li");i.appendChild(e),t.appendChild(i)})),this.lastRange.insertNode(t),this.afterListEdit(t)}afterListEdit(e){const t=document.createRange();t.setStartAfter(e),t.collapse(!0);const i=window.getSelection();i?.removeAllRanges(),i?.addRange(t),this.saveSelection(),this.updateContent(),this.updateToolbarState()}ensureAtLeastOneParagraph(){const e=this.editorEl;if(!e)return;const t=""===(e.textContent??"").replace(/\u200B/g,"").trim();if(0===e.childNodes.length||t)return void(e.innerHTML="<p><br></p>");if(!e.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,table,blockquote,pre")){const t=document.createElement("p");for(;e.firstChild;)t.appendChild(e.firstChild);return t.hasChildNodes()||t.appendChild(document.createElement("br")),void e.appendChild(t)}e.querySelectorAll("p").forEach((e=>{""===(e.textContent??"").replace(/\u200B/g,"")&&(e.innerHTML.toLowerCase().includes("<br")||(e.innerHTML="<br>"))}))}onToolbarCommand(e){switch(this.focusAndRestore(),e){case"bold":xS(this.editorEl,"strong");break;case"italic":xS(this.editorEl,"em");break;case"underline":xS(this.editorEl,"u");break;case"left":pS(this.editorEl,"left");break;case"center":pS(this.editorEl,"center");break;case"right":pS(this.editorEl,"right");break;case"justify":pS(this.editorEl,"justify");break;case"ul":kS(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":kS(this.editorEl,"ol"),this.updateContent(),this.updateToolbarState();break;case"link":break;case"clear":const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),t=[];for(;e.nextNode();){const i=e.currentNode;i.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(i.tagName)&&t.push(i)}for(const e of t){for(;e.firstChild;)e.parentNode?.insertBefore(e.firstChild,e);e.remove()}this.ensureAtLeastOneParagraph()}this.updateContent(),this.updateToolbarState()}setBtnActive(e,t){const i=this.buttonMap.get(e);if(i)for(const e of i)e.toggleAttribute("data-active",!!t)}updateToolbarState(){if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);if(!this.editorEl.contains(t.commonAncestorContainer))return;const i=function(e){for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e}(t.startContainer)||this.editorEl,M=getComputedStyle(i),n=OS(t.startContainer,this.editorEl)||this.editorEl,o=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("strong"===t||"b"===t)return!0;const i=getComputedStyle(e).fontWeight;if(parseInt(i,10)>=600)return!0}e=e.parentNode}return!1})(),r=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("em"===t||"i"===t)return!0;if("italic"===getComputedStyle(e).fontStyle)return!0}e=e.parentNode}return!1})(),s=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=getComputedStyle(e).textDecorationLine;if(t&&t.includes("underline"))return!0;if("u"===e.tagName.toLowerCase())return!0}e=e.parentNode}return!1})(),a=!!i.closest("a"),l=n.style.textAlign||getComputedStyle(n).textAlign||"start",N="start"===l?"left":l,g=!!i.closest("li")&&i.closest("ul,ol")?.tagName.toLowerCase()||"";if(this.setBtnActive("bold",o),this.setBtnActive("italic",r),this.setBtnActive("underline",s),this.setBtnActive("link",a),this.setBtnActive("left","left"===N&&!["center","right","justify"].includes(N)),this.setBtnActive("center","center"===N),this.setBtnActive("right","right"===N),this.setBtnActive("justify","justify"===N),this.setBtnActive("ul","ul"===g),this.setBtnActive("ol","ol"===g),this.headingSelect){const e=n.tagName.toLowerCase(),t=["h1","h2","h3"].includes(e)?e:"p";this.headingSelect.value!==t&&(this.headingSelect.value=t)}if(this.fontSelect){const e=(M.fontFamily||"").replace(/["']/g,"").split(",")[0].trim().toLowerCase();if(e)for(const t of Array.from(this.fontSelect.options))if(t.value.toLowerCase()===e){this.fontSelect.value=t.value;break}}if(this.colorInput){const e=LS(M.color);e&&this.colorInput.value.toLowerCase()!==e.toLowerCase()&&(this.colorInput.value=e),this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=this.colorInput.value)}if(this.bgColorInput){const e=getComputedStyle(i).backgroundColor;if(e&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e)){const t=LS(e);t&&this.bgColorInput.value.toLowerCase()!==t.toLowerCase()&&(this.bgColorInput.value=t)}this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=this.bgColorInput.value)}}syncPreview(){this.updateContent()}updateContent(){if(!this.editorEl)return;this.ensureAtLeastOneParagraph();const e=""===(this.editorEl.textContent??"").trim();this.editorEl.classList.toggle("empty",e);const t=this.editorEl.cloneNode(!0);if(this.noStyles)t.querySelectorAll("[style]").forEach((e=>e.removeAttribute("style")));else{const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),M=["font-weight","font-style","text-decoration","color","background-color","font-size","font-family","text-align","line-height","letter-spacing","white-space","vertical-align","list-style-position","padding-inline-start"];for(;e.nextNode()&&i.nextNode();){const t=e.currentNode,n=i.currentNode,o=window.getComputedStyle(t),r=M.map((e=>`${e}:${o.getPropertyValue(e)}`)).join(";");r.trim()&&n.setAttribute("style",r)}}this.content=t.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}))}};e([ce({type:String,attribute:!0,reflect:!0})],fS.prototype,"value",void 0),e([ce({type:Boolean,attribute:!0,reflect:!0})],fS.prototype,"noStyles",void 0),e([ce({type:Boolean,attribute:"singlelineeditor",reflect:!0})],fS.prototype,"singleLineEditor",void 0),e([ce({type:String})],fS.prototype,"placeholder",void 0),e([ce({attribute:"mentions",reflect:!0,converter:{fromAttribute:e=>{try{const t=JSON.parse(e),i={};for(const e of Object.keys(t)){const M=t[e];Array.isArray(M)&&(i[e]=M.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return i}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],fS.prototype,"mentions",void 0),e([De()],fS.prototype,"content",void 0),fS=e([Ne("nile-rich-text-editor")],fS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.3.1-beta-1.2"',window.nileVersion="__NILE_VERSION__",window.process=window.process||{env:{NODE_ENV:"production"}});const vS=r`
|
|
14704
|
+
`,bS={bold:"format_bold",italic:"format_italic",underline:"format_underline",link:"link_2",left:"format_align_left",center:"format_align_middle",right:"format_align_right",justify:"format_align_justify",ul:"format_list_bulleted",ol:"format_list_numbered",clear:"format_clear"};let fS=class extends ae{constructor(){super(...arguments),this.value="",this.noStyles=!1,this.singleLineEditor=!1,this.placeholder="",this.mentions={},this.content="",this.previewEl=null,this.toolbarEl=null,this.lastRange=null,this.buttonMap=new Map,this.headingSelect=null,this.fontSelect=null,this.colorInput=null,this.bgColorInput=null,this.colorSwatchEl=null,this.bgSwatchEl=null,this.containerEl=null,this.mentionsEl=null,this.onEditorKeydown=e=>{if(this.singleLineEditor&&"Enter"===e.key&&e.shiftKey)return void e.preventDefault();if(e.ctrlKey&&"i"===e.key.toLowerCase()&&(e.preventDefault(),xS(this.editorEl,"em"),this.updateContent(),this.updateToolbarState()),this.singleLineEditor&&"Enter"===e.key)return void e.preventDefault();if("Tab"!==e.key)return;e.preventDefault(),this.focusAndRestore();const t=window.getSelection();if(!t||0===t.rangeCount)return;const i=t.getRangeAt(0);if(e.shiftKey){if(i.collapsed&&i.startContainer.nodeType===Node.TEXT_NODE){const e=i.startContainer,M=i.startOffset,n=e.data.slice(0,M),o=n.replace(/(\t|[ \u00a0]{2})$/,"");if(o.length!==n.length){e.data=o+e.data.slice(M);const i=document.createRange();i.setStart(e,o.length),i.collapse(!0),t.removeAllRanges(),t.addRange(i),this.updateContent(),this.updateToolbarState()}}return}i.deleteContents();const M=document.createTextNode("\t");i.insertNode(M);const n=document.createRange();n.setStartAfter(M),n.collapse(!0),t.removeAllRanges(),t.addRange(n),this.updateContent(),this.updateToolbarState()},this.onSelectionChange=()=>{if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);this.editorEl.contains(t.commonAncestorContainer)&&(this.lastRange=t.cloneRange(),this.updateToolbarState())}}createRenderRoot(){return this}injectCss(e){if(this.querySelector("style[data-rte-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}connectedCallback(){super.connectedCallback(),this.injectCss(CS.cssText),this.ensureStructure(),this.placeholder&&this.editorEl&&(this.editorEl.dataset.placeholder=this.placeholder),this.value&&!this.editorEl.innerHTML.trim()&&(this.editorEl.innerHTML=this.value),this.content=this.editorEl.innerHTML,this.toolbarEl&&this.wireAuthoredToolbar(this.toolbarEl),this.mentionsEl=this.querySelector("nile-rte-mentions"),this.mentionsEl&&(this.mentionsEl.attach?.(this.editorEl,this),this.mentionsEl.setExternalConfig?.(this.mentions)),this.wireEditor(),document.addEventListener("selectionchange",this.onSelectionChange,{passive:!0}),this.updateToolbarState(),this.syncPreview()}ensureStructure(){this.toolbarEl=this.querySelector("nile-rte-toolbar"),this.previewEl=this.querySelector("nile-rte-preview"),this.containerEl=this.querySelector(".rte-container"),this.containerEl||(this.containerEl=document.createElement("div"),this.containerEl.className="rte-container",this.appendChild(this.containerEl)),this.ensureEditor(),this.toolbarEl&&this.toolbarEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.toolbarEl),this.editorEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.editorEl),this.previewEl&&(this.previewEl.parentElement!==this&&this.appendChild(this.previewEl),this.previewEl.previousElementSibling!==this.containerEl&&this.insertBefore(this.previewEl,this.containerEl.nextSibling))}updateContentWithMention(e){this.updateContent(),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content,mention:e},bubbles:!0,composed:!0}))}disconnectedCallback(){document.removeEventListener("selectionchange",this.onSelectionChange),this.mentionsEl&&this.mentionsEl.detach&&this.mentionsEl.detach(),super.disconnectedCallback()}updated(e){e.has("value")&&this.editorEl&&this.value!==this.editorEl.innerHTML&&(this.editorEl.innerHTML=this.value||"<p><br></p>",this.content=this.editorEl.innerHTML,this.syncPreview()),e.has("singleLineEditor")&&(this.editorEl&&this.editorEl.classList.toggle("single-line",this.singleLineEditor),this.previewEl&&this.previewEl.classList.toggle("single-line",this.singleLineEditor))}ensureEditor(){if(this.editorEl=this.querySelector(".editor"),!this.editorEl){const e=document.createElement("article");e.className="editor",e.setAttribute("contenteditable","true"),this.editorEl=e}this.placeholder&&(this.editorEl.dataset.placeholder=this.placeholder),this.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>")}unwrapMention(e,t=!0){const i=e.parentNode;if(!i)return;const M=t?(e.textContent??"").replace(/\u200B/g,""):"",n=document.createTextNode(M);i.insertBefore(n,e),i.removeChild(e);const o=document.createRange();o.setStartAfter(n),o.collapse(!0);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(o)}scrubBrokenMentions(){if(!this.editorEl)return;this.editorEl.querySelectorAll("span.mention").forEach((e=>{const t=e,i=t.getAttribute("data-mention-key"),M=t.getAttribute("data-mention-label"),n=t.getAttribute("data-mention-trigger")||"",o=(t.textContent??"").replace(/\u200B/g,"").trim(),r=!!i&&!!M&&o.length>0&&o.startsWith(n)&&o.includes(M);o&&r||this.unwrapMention(t,!0)}))}wireEditor(){this.editorEl.addEventListener("input",(()=>{this.ensureAtLeastOneParagraph(),this.scrubBrokenMentions(),this.updateContent(),this.updateToolbarState()})),this.editorEl.addEventListener("mouseup",(()=>{this.saveSelection(),this.updateToolbarState()})),this.editorEl.addEventListener("keyup",(e=>{this.saveSelection(),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)&&this.updateToolbarState()})),this.editorEl.addEventListener("keydown",this.onEditorKeydown)}wireAuthoredToolbar(e){this.buttonMap.clear(),this.headingSelect=null,this.fontSelect=null,this.colorInput=null,Array.from(e.children).forEach((e=>{const t=e.tagName.toLowerCase();if("nile-rte-select"!==t||"align"!==e.getAttribute("type")){if("nile-rte-link"===t)return e.editorEl=this.editorEl,void e.addEventListener("link-changed",(()=>{this.updateContent(),this.updateToolbarState()}));if("nile-rte-toolbar-item"===t){let t=e.querySelector(":scope > nile-button");const i=e.getAttribute("name")||"",M=e.getAttribute("label")||i,n=e.getAttribute("icon"),o=e.innerHTML.trim().length>0;if(t||(t=document.createElement("nile-button"),t.variant="tertiary",t.size="small"),n)t.innerHTML=`<nile-icon name="${n}" aria-label="${M}"></nile-icon>`,e.innerHTML="";else if(o)t.innerHTML=e.innerHTML,e.innerHTML="";else{const n=bS[i];n?t.innerHTML=`<nile-icon name="${n}" size="20" color="black" aria-label="${M}"></nile-icon>`:t.textContent=M||i,e.innerHTML=""}if(!t.isConnected){const i=document.createElement("nile-tooltip");i.setAttribute("content",M),i.appendChild(t),e.appendChild(i)}t.setAttribute("aria-label",M),t.addEventListener("mousedown",(e=>e.preventDefault())),t.addEventListener("click",(()=>this.onToolbarCommand(i)));const r=this.buttonMap.get(i)??[];return r.push(t),void this.buttonMap.set(i,r)}if("nile-rte-select"!==t)"nile-rte-color"!==t||e.addEventListener("change",(e=>{this.focusAndRestore();const{mode:t,value:i}=e.detail;"backColor"===t?ES(this.editorEl,"backgroundColor",i,"data-rte-bg"):function(e,t){ES(e,"color",t,"data-rte-color")}(this.editorEl,i),this.updateContent(),this.updateToolbarState()}));else{const t=e.getAttribute("type")||"";e.addEventListener("change",(e=>{this.focusAndRestore();const i=e.detail;"heading"===t?function(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const M=OS(i.getRangeAt(0).startContainer,e);if(!M)return;if(M.tagName.toLowerCase()===t)return;const n=document.createElement(t);for(;M.firstChild;)n.appendChild(M.firstChild);M.replaceWith(n);const o=document.createRange();o.selectNodeContents(n),o.collapse(!0),i.removeAllRanges(),i.addRange(o)}(this.editorEl,i):"font"===t&&SS(this.editorEl,i),this.updateContent(),this.updateToolbarState()}))}}else e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;pS(this.editorEl,t),this.updateContent(),this.updateToolbarState()}))}))}saveSelection(){const e=window.getSelection();e&&e.rangeCount&&(this.lastRange=e.getRangeAt(0).cloneRange())}restoreSelection(){if(!this.lastRange)return;const e=document.getSelection();e&&(e.removeAllRanges(),e.addRange(this.lastRange))}focusAndRestore(){this.editorEl?.focus(),this.restoreSelection()}getCleanContent(){const e=this.editorEl.cloneNode(!0);return e.querySelectorAll("*").forEach((e=>{e.removeAttribute("style")})),e.innerHTML}insertList(e){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement(e),i=this.lastRange.extractContents(),M=document.createElement("div");M.appendChild(i),Array.from(M.childNodes).forEach((e=>{if(e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim())return;const i=document.createElement("li");i.appendChild(e),t.appendChild(i)})),this.lastRange.insertNode(t),this.afterListEdit(t)}afterListEdit(e){const t=document.createRange();t.setStartAfter(e),t.collapse(!0);const i=window.getSelection();i?.removeAllRanges(),i?.addRange(t),this.saveSelection(),this.updateContent(),this.updateToolbarState()}ensureAtLeastOneParagraph(){const e=this.editorEl;if(!e)return;const t=""===(e.textContent??"").replace(/\u200B/g,"").trim();if(0===e.childNodes.length||t)return void(e.innerHTML="<p><br></p>");if(!e.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,table,blockquote,pre")){const t=document.createElement("p");for(;e.firstChild;)t.appendChild(e.firstChild);return t.hasChildNodes()||t.appendChild(document.createElement("br")),void e.appendChild(t)}e.querySelectorAll("p").forEach((e=>{""===(e.textContent??"").replace(/\u200B/g,"")&&(e.innerHTML.toLowerCase().includes("<br")||(e.innerHTML="<br>"))}))}onToolbarCommand(e){switch(this.focusAndRestore(),e){case"bold":xS(this.editorEl,"strong");break;case"italic":xS(this.editorEl,"em");break;case"underline":xS(this.editorEl,"u");break;case"left":pS(this.editorEl,"left");break;case"center":pS(this.editorEl,"center");break;case"right":pS(this.editorEl,"right");break;case"justify":pS(this.editorEl,"justify");break;case"ul":kS(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":kS(this.editorEl,"ol"),this.updateContent(),this.updateToolbarState();break;case"link":break;case"clear":const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),t=[];for(;e.nextNode();){const i=e.currentNode;i.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(i.tagName)&&t.push(i)}for(const e of t){for(;e.firstChild;)e.parentNode?.insertBefore(e.firstChild,e);e.remove()}this.ensureAtLeastOneParagraph()}this.updateContent(),this.updateToolbarState()}setBtnActive(e,t){const i=this.buttonMap.get(e);if(i)for(const e of i)e.toggleAttribute("data-active",!!t)}updateToolbarState(){if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);if(!this.editorEl.contains(t.commonAncestorContainer))return;const i=function(e){for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e}(t.startContainer)||this.editorEl,M=getComputedStyle(i),n=OS(t.startContainer,this.editorEl)||this.editorEl,o=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("strong"===t||"b"===t)return!0;const i=getComputedStyle(e).fontWeight;if(parseInt(i,10)>=600)return!0}e=e.parentNode}return!1})(),r=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("em"===t||"i"===t)return!0;if("italic"===getComputedStyle(e).fontStyle)return!0}e=e.parentNode}return!1})(),s=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=getComputedStyle(e).textDecorationLine;if(t&&t.includes("underline"))return!0;if("u"===e.tagName.toLowerCase())return!0}e=e.parentNode}return!1})(),a=!!i.closest("a"),l=n.style.textAlign||getComputedStyle(n).textAlign||"start",N="start"===l?"left":l,g=!!i.closest("li")&&i.closest("ul,ol")?.tagName.toLowerCase()||"";if(this.setBtnActive("bold",o),this.setBtnActive("italic",r),this.setBtnActive("underline",s),this.setBtnActive("link",a),this.setBtnActive("left","left"===N&&!["center","right","justify"].includes(N)),this.setBtnActive("center","center"===N),this.setBtnActive("right","right"===N),this.setBtnActive("justify","justify"===N),this.setBtnActive("ul","ul"===g),this.setBtnActive("ol","ol"===g),this.headingSelect){const e=n.tagName.toLowerCase(),t=["h1","h2","h3"].includes(e)?e:"p";this.headingSelect.value!==t&&(this.headingSelect.value=t)}if(this.fontSelect){const e=(M.fontFamily||"").replace(/["']/g,"").split(",")[0].trim().toLowerCase();if(e)for(const t of Array.from(this.fontSelect.options))if(t.value.toLowerCase()===e){this.fontSelect.value=t.value;break}}if(this.colorInput){const e=LS(M.color);e&&this.colorInput.value.toLowerCase()!==e.toLowerCase()&&(this.colorInput.value=e),this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=this.colorInput.value)}if(this.bgColorInput){const e=getComputedStyle(i).backgroundColor;if(e&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e)){const t=LS(e);t&&this.bgColorInput.value.toLowerCase()!==t.toLowerCase()&&(this.bgColorInput.value=t)}this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=this.bgColorInput.value)}}syncPreview(){this.updateContent()}updateContent(){if(!this.editorEl)return;this.ensureAtLeastOneParagraph();const e=""===(this.editorEl.textContent??"").trim();this.editorEl.classList.toggle("empty",e);const t=this.editorEl.cloneNode(!0);if(this.noStyles)t.querySelectorAll("[style]").forEach((e=>e.removeAttribute("style")));else{const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),M=["font-weight","font-style","text-decoration","color","background-color","font-size","font-family","text-align","line-height","letter-spacing","white-space","vertical-align","list-style-position","padding-inline-start"];for(;e.nextNode()&&i.nextNode();){const t=e.currentNode,n=i.currentNode,o=window.getComputedStyle(t),r=M.map((e=>`${e}:${o.getPropertyValue(e)}`)).join(";");r.trim()&&n.setAttribute("style",r)}}this.content=t.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}))}};e([ce({type:String,attribute:!0,reflect:!0})],fS.prototype,"value",void 0),e([ce({type:Boolean,attribute:!0,reflect:!0})],fS.prototype,"noStyles",void 0),e([ce({type:Boolean,attribute:"singlelineeditor",reflect:!0})],fS.prototype,"singleLineEditor",void 0),e([ce({type:String})],fS.prototype,"placeholder",void 0),e([ce({attribute:"mentions",reflect:!0,converter:{fromAttribute:e=>{try{const t=JSON.parse(e),i={};for(const e of Object.keys(t)){const M=t[e];Array.isArray(M)&&(i[e]=M.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return i}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],fS.prototype,"mentions",void 0),e([De()],fS.prototype,"content",void 0),fS=e([Ne("nile-rich-text-editor")],fS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.3.1-beta-1.4"',window.nileVersion="__NILE_VERSION__",window.process=window.process||{env:{NODE_ENV:"production"}});const vS=r`
|
|
14705
14705
|
:host {
|
|
14706
14706
|
--sidebar-width: 240px;
|
|
14707
14707
|
--sidebar-collapsed-width: 70px;
|
|
@@ -15235,6 +15235,10 @@ justify-content: center;
|
|
|
15235
15235
|
background: var(--nile-colors-neutral-400);
|
|
15236
15236
|
height: 38px;
|
|
15237
15237
|
}
|
|
15238
|
+
:host([type='support']) .footer-item:hover{
|
|
15239
|
+
background: var(--nile-colors-neutral-500);
|
|
15240
|
+
}
|
|
15241
|
+
|
|
15238
15242
|
:host([type='support'][active]) .footer-item {
|
|
15239
15243
|
background: var(--nile-colors-neutral-500);
|
|
15240
15244
|
}
|
|
@@ -15316,7 +15320,7 @@ justify-content: center;
|
|
|
15316
15320
|
max-width: var(--auto-size-available-width) !important;
|
|
15317
15321
|
max-height: var(--auto-size-available-height) !important;
|
|
15318
15322
|
}
|
|
15319
|
-
`;let Mm=class extends Re{constructor(){super(...arguments),this.open=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.skidding=0,this.hoist=!1,this.triggerDropdown="click"}connectedCallback(){super.connectedCallback(),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleTriggerMouseEnter=this.handleTriggerMouseEnter.bind(this),this.handleTriggerMouseLeave=this.handleTriggerMouseLeave.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init")}firstUpdated(){if(this.panel.hidden=!this.open,"hover"===this.triggerDropdown){const e=this.trigger;e&&(e.addEventListener("mouseenter",this.handleTriggerMouseEnter),e.addEventListener("mouseleave",this.handleTriggerMouseLeave)),this.panel&&(this.panel.addEventListener("mouseenter",this.handleTriggerMouseEnter),this.panel.addEventListener("mouseleave",this.handleTriggerMouseLeave))}this.open&&(this.addOpenListeners(),this.popup.active=!0)}handleTriggerMouseEnter(){clearTimeout(this.hoverTimeout),this.show()}handleTriggerMouseLeave(){clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),200)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide(),this.emit("nile-destroy")}focusOnTrigger(){const e=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof e?.focus&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((e=>"nile-menu"===e.tagName.toLowerCase()))}handleKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){if("Escape"===e.key&&this.open)return e.stopPropagation(),this.focusOnTrigger(),void this.hide();"Tab"===e.key&&setTimeout((()=>{const e=this.containingElement?.getRootNode()instanceof ShadowRoot?document.activeElement?.shadowRoot?.activeElement:document.activeElement;this.containingElement&&e?.closest(this.containingElement.tagName.toLowerCase())===this.containingElement||this.hide()}))}handleDocumentMouseDown(e){const t=e.composedPath();this.containingElement&&!t.includes(this.containingElement)&&this.hide()}handlePanelSelect(e){const t=e.target;this.stayOpenOnSelect||"nile-menu"!==t.tagName.toLowerCase()||(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.open?this.hide():(this.show(),this.focusOnTrigger())}handleTriggerKeyDown(e){const t=this.getMenu();if(t){const i=t.getAllItems(),M=i[0],n=i[i.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),i.length>0&&this.updateComplete.then((()=>{"ArrowDown"!==e.key&&"Home"!==e.key||(t.setCurrentItem(M),M.focus()),"ArrowUp"!==e.key&&"End"!==e.key||(t.setCurrentItem(n),n.focus())})))}}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.assignedElements({flatten:!0}).find((e=>Et(e).start));let t;if(e){switch(e.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":t=e.button;break;default:t=e}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,St(this,"nile-after-show")}async hide(){if(this.open)return this.open=!1,St(this,"nile-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}async handleOpenChange(){if(this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){this.emit("nile-show"),this.addOpenListeners(),await jt(this),this.panel.hidden=!1,this.popup.active=!0;const{keyframes:e,options:t}=yt(this,"dropdown.show",{dir:""});await ut(this.popup.popup,e,t),this.emit("nile-after-show")}else{this.emit("nile-hide"),this.removeOpenListeners(),await jt(this);const{keyframes:e,options:t}=yt(this,"dropdown.hide",{dir:""});await ut(this.popup.popup,e,t),this.panel.hidden=!0,this.popup.active=!1,this.emit("nile-after-hide")}}render(){return R`
|
|
15323
|
+
`;let Mm=class extends Re{constructor(){super(...arguments),this.open=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.skidding=0,this.hoist=!1,this.triggerDropdown="click",this.enableVisibilityEffect=!1,this.enableTabClose=!1}connectedCallback(){super.connectedCallback(),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleTriggerMouseEnter=this.handleTriggerMouseEnter.bind(this),this.handleTriggerMouseLeave=this.handleTriggerMouseLeave.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init")}async firstUpdated(e){if(this.panel.hidden=!this.open,"hover"===this.triggerDropdown){const e=this.trigger;e&&(e.addEventListener("mouseenter",this.handleTriggerMouseEnter),e.addEventListener("mouseleave",this.handleTriggerMouseLeave)),this.panel&&(this.panel.addEventListener("mouseenter",this.handleTriggerMouseEnter),this.panel.addEventListener("mouseleave",this.handleTriggerMouseLeave))}this.open&&(this.addOpenListeners(),this.popup.active=!0),await this.updateComplete;const t=this.trigger.assignedElements({flatten:!0})[0];this.visibilityManager=new tM({host:this,target:t||null,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:()=>this.open,onAnchorOutOfView:()=>{this.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"})},onDocumentHidden:()=>{this.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"})},emit:(e,t)=>this.emit(`nile-${e}`,t)})}handleTriggerMouseEnter(){clearTimeout(this.hoverTimeout),this.show()}handleTriggerMouseLeave(){clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),200)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.visibilityManager?.cleanup(),this.hide(),this.emit("nile-destroy")}focusOnTrigger(){const e=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof e?.focus&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((e=>"nile-menu"===e.tagName.toLowerCase()))}handleKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){if("Escape"===e.key&&this.open)return e.stopPropagation(),this.focusOnTrigger(),void this.hide();"Tab"===e.key&&setTimeout((()=>{const e=this.containingElement?.getRootNode()instanceof ShadowRoot?document.activeElement?.shadowRoot?.activeElement:document.activeElement;this.containingElement&&e?.closest(this.containingElement.tagName.toLowerCase())===this.containingElement||this.hide()}))}handleDocumentMouseDown(e){const t=e.composedPath();this.containingElement&&!t.includes(this.containingElement)&&this.hide()}handlePanelSelect(e){const t=e.target;this.stayOpenOnSelect||"nile-menu"!==t.tagName.toLowerCase()||(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.open?this.hide():(this.show(),this.focusOnTrigger())}handleTriggerKeyDown(e){const t=this.getMenu();if(t){const i=t.getAllItems(),M=i[0],n=i[i.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),i.length>0&&this.updateComplete.then((()=>{"ArrowDown"!==e.key&&"Home"!==e.key||(t.setCurrentItem(M),M.focus()),"ArrowUp"!==e.key&&"End"!==e.key||(t.setCurrentItem(n),n.focus())})))}}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.assignedElements({flatten:!0}).find((e=>Et(e).start));let t;if(e){switch(e.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":t=e.button;break;default:t=e}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,St(this,"nile-after-show")}async hide(){if(this.open)return this.open=!1,St(this,"nile-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}async handleOpenChange(){if(this.visibilityManager?.setup(),this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){this.emit("nile-show"),this.addOpenListeners(),await jt(this),this.panel.hidden=!1,this.popup.active=!0;const{keyframes:e,options:t}=yt(this,"dropdown.show",{dir:""});await ut(this.popup.popup,e,t),this.emit("nile-after-show")}else{this.emit("nile-hide"),this.removeOpenListeners(),this.visibilityManager?.cleanup(),await jt(this);const{keyframes:e,options:t}=yt(this,"dropdown.hide",{dir:""});await ut(this.popup.popup,e,t),this.panel.hidden=!0,this.popup.active=!1,this.emit("nile-after-hide")}}render(){return R`
|
|
15320
15324
|
<nile-popup
|
|
15321
15325
|
part="base"
|
|
15322
15326
|
id="sidebar-action-dropdown"
|
|
@@ -15349,7 +15353,7 @@ justify-content: center;
|
|
|
15349
15353
|
aria-labelledby="sidebar-action-dropdown"
|
|
15350
15354
|
></slot>
|
|
15351
15355
|
</nile-popup>
|
|
15352
|
-
`}};Mm.styles=[im],e([Ie(".dropdown")],Mm.prototype,"popup",void 0),e([Ie(".dropdown__trigger")],Mm.prototype,"trigger",void 0),e([Ie(".dropdown__panel")],Mm.prototype,"panel",void 0),e([ce({type:Boolean,reflect:!0})],Mm.prototype,"open",void 0),e([ce({reflect:!0})],Mm.prototype,"placement",void 0),e([ce({type:Boolean,reflect:!0})],Mm.prototype,"disabled",void 0),e([ce({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],Mm.prototype,"stayOpenOnSelect",void 0),e([ce({attribute:!1})],Mm.prototype,"containingElement",void 0),e([ce({type:Number})],Mm.prototype,"distance",void 0),e([ce({type:Number})],Mm.prototype,"skidding",void 0),e([ce()],Mm.prototype,"sync",void 0),e([ce({type:Boolean})],Mm.prototype,"hoist",void 0),e([ce({reflect:!0})],Mm.prototype,"triggerDropdown",void 0),e([We("open",{waitUntilFirstUpdate:!0})],Mm.prototype,"handleOpenChange",null),Mm=e([Ne("nile-side-bar-action")],Mm),Tt("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),Tt("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});const nm=r`
|
|
15356
|
+
`}};Mm.styles=[im],e([Ie(".dropdown")],Mm.prototype,"popup",void 0),e([Ie(".dropdown__trigger")],Mm.prototype,"trigger",void 0),e([Ie(".dropdown__panel")],Mm.prototype,"panel",void 0),e([ce({type:Boolean,reflect:!0})],Mm.prototype,"open",void 0),e([ce({reflect:!0})],Mm.prototype,"placement",void 0),e([ce({type:Boolean,reflect:!0})],Mm.prototype,"disabled",void 0),e([ce({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],Mm.prototype,"stayOpenOnSelect",void 0),e([ce({attribute:!1})],Mm.prototype,"containingElement",void 0),e([ce({type:Number})],Mm.prototype,"distance",void 0),e([ce({type:Number})],Mm.prototype,"skidding",void 0),e([ce()],Mm.prototype,"sync",void 0),e([ce({type:Boolean})],Mm.prototype,"hoist",void 0),e([ce({reflect:!0})],Mm.prototype,"triggerDropdown",void 0),e([ce({type:Boolean,reflect:!0})],Mm.prototype,"enableVisibilityEffect",void 0),e([ce({type:Boolean,reflect:!0})],Mm.prototype,"enableTabClose",void 0),e([We("open",{waitUntilFirstUpdate:!0})],Mm.prototype,"handleOpenChange",null),Mm=e([Ne("nile-side-bar-action")],Mm),Tt("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),Tt("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});const nm=r`
|
|
15353
15357
|
:host {
|
|
15354
15358
|
display: block;
|
|
15355
15359
|
line-height: 1.2;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./nile-side-bar-action.cjs.js","tslib","lit","lit/decorators.js","lit/directives/class-map.js","./nile-side-bar-action.css.cjs.js","../internal/nile-element.cjs.js","../internal/animate.cjs.js","../utilities/animation-registry.cjs.js","../internal/tabbable.cjs.js","../internal/event.cjs.js","../internal/watch.cjs.js","../nile-popup/nile-popup.cjs.js","../floating-ui.dom-007bbe96.cjs.js","../nile-popup/nile-popup.css.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileSideBarActionCjsJs){_export("NileSideBarAction",_nileSideBarActionCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_litDirectivesClassMapJs){},function(_nileSideBarActionCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalAnimateCjsJs){},function(_utilitiesAnimationRegistryCjsJs){},function(_internalTabbableCjsJs){},function(_internalEventCjsJs){},function(_internalWatchCjsJs){},function(_nilePopupNilePopupCjsJs){},function(_floatingUiDom001CjsJs){},function(_nilePopupNilePopupCssCjsJs){}],execute:function execute(){}};});
|
|
1
|
+
System.register(["./nile-side-bar-action.cjs.js","tslib","lit","lit/decorators.js","lit/directives/class-map.js","./nile-side-bar-action.css.cjs.js","../internal/nile-element.cjs.js","../internal/animate.cjs.js","../utilities/animation-registry.cjs.js","../internal/tabbable.cjs.js","../internal/event.cjs.js","../internal/watch.cjs.js","../nile-popup/nile-popup.cjs.js","../floating-ui.dom-007bbe96.cjs.js","../nile-popup/nile-popup.css.cjs.js","../utilities/visibility-manager.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileSideBarActionCjsJs){_export("NileSideBarAction",_nileSideBarActionCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_litDirectivesClassMapJs){},function(_nileSideBarActionCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalAnimateCjsJs){},function(_utilitiesAnimationRegistryCjsJs){},function(_internalTabbableCjsJs){},function(_internalEventCjsJs){},function(_internalWatchCjsJs){},function(_nilePopupNilePopupCjsJs){},function(_floatingUiDom001CjsJs){},function(_nilePopupNilePopupCssCjsJs){},function(_utilitiesVisibilityManagerCjsJs){}],execute:function execute(){}};});
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{N as NileSideBarAction}from"./nile-side-bar-action.esm.js";import"tslib";import"lit";import"lit/decorators.js";import"lit/directives/class-map.js";import"./nile-side-bar-action.css.esm.js";import"../internal/nile-element.esm.js";import"../internal/animate.esm.js";import"../utilities/animation-registry.esm.js";import"../internal/tabbable.esm.js";import"../internal/event.esm.js";import"../internal/watch.esm.js";import"../nile-popup/nile-popup.esm.js";import"../floating-ui.dom-cc9126da.esm.js";import"../nile-popup/nile-popup.css.esm.js";
|
|
1
|
+
export{N as NileSideBarAction}from"./nile-side-bar-action.esm.js";import"tslib";import"lit";import"lit/decorators.js";import"lit/directives/class-map.js";import"./nile-side-bar-action.css.esm.js";import"../internal/nile-element.esm.js";import"../internal/animate.esm.js";import"../utilities/animation-registry.esm.js";import"../internal/tabbable.esm.js";import"../internal/event.esm.js";import"../internal/watch.esm.js";import"../nile-popup/nile-popup.esm.js";import"../floating-ui.dom-cc9126da.esm.js";import"../nile-popup/nile-popup.css.esm.js";import"../utilities/visibility-manager.esm.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","lit/directives/class-map.js","./nile-side-bar-action.css.cjs.js","../internal/nile-element.cjs.js","../internal/animate.cjs.js","../utilities/animation-registry.cjs.js","../internal/tabbable.cjs.js","../internal/event.cjs.js","../internal/watch.cjs.js","../nile-popup/nile-popup.cjs.js","../floating-ui.dom-007bbe96.cjs.js","../nile-popup/nile-popup.css.cjs.js"],function(_export,_context){"use strict";var t,i,s,e,o,n,h,a,r,d,l,p,c,m,u,_templateObject,w;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;e=_litDecoratorsJs.property;o=_litDecoratorsJs.customElement;},function(_litDirectivesClassMapJs){n=_litDirectivesClassMapJs.classMap;},function(_nileSideBarActionCssCjsJs){h=_nileSideBarActionCssCjsJs.s;},function(_internalNileElementCjsJs){a=_internalNileElementCjsJs.N;},function(_internalAnimateCjsJs){r=_internalAnimateCjsJs.s;d=_internalAnimateCjsJs.a;},function(_utilitiesAnimationRegistryCjsJs){l=_utilitiesAnimationRegistryCjsJs.s;p=_utilitiesAnimationRegistryCjsJs.g;},function(_internalTabbableCjsJs){c=_internalTabbableCjsJs.g;},function(_internalEventCjsJs){m=_internalEventCjsJs.w;},function(_internalWatchCjsJs){u=_internalWatchCjsJs.w;},function(_nilePopupNilePopupCjsJs){},function(_floatingUiDom001CjsJs){},function(_nilePopupNilePopupCssCjsJs){}],execute:function execute(){_export("N",w=/*#__PURE__*/function(_a){function w(){var _this;_classCallCheck(this,w);_this=_callSuper(this,w,arguments),_this.open=!1,_this.placement="bottom-start",_this.disabled=!1,_this.stayOpenOnSelect=!1,_this.distance=0,_this.skidding=0,_this.hoist=!1,_this.triggerDropdown="click";return _this;}_inherits(w,_a);return _createClass(w,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(w,"connectedCallback",this,3)([]),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleTriggerMouseEnter=this.handleTriggerMouseEnter.bind(this),this.handleTriggerMouseLeave=this.handleTriggerMouseLeave.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init");}},{key:"firstUpdated",value:function firstUpdated(){if(this.panel.hidden=!this.open,"hover"===this.triggerDropdown){var _t=this.trigger;_t&&(_t.addEventListener("mouseenter",this.handleTriggerMouseEnter),_t.addEventListener("mouseleave",this.handleTriggerMouseLeave)),this.panel&&(this.panel.addEventListener("mouseenter",this.handleTriggerMouseEnter),this.panel.addEventListener("mouseleave",this.handleTriggerMouseLeave));}this.open&&(this.addOpenListeners(),this.popup.active=!0);}},{key:"handleTriggerMouseEnter",value:function handleTriggerMouseEnter(){clearTimeout(this.hoverTimeout),this.show();}},{key:"handleTriggerMouseLeave",value:function handleTriggerMouseLeave(){var _this2=this;clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(function(){return _this2.hide();},200);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(w,"disconnectedCallback",this,3)([]),this.removeOpenListeners(),this.hide(),this.emit("nile-destroy");}},{key:"focusOnTrigger",value:function focusOnTrigger(){var t=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof(t===null||t===void 0?void 0:t.focus)&&t.focus();}},{key:"getMenu",value:function getMenu(){return this.panel.assignedElements({flatten:!0}).find(function(t){return"nile-menu"===t.tagName.toLowerCase();});}},{key:"handleKeyDown",value:function handleKeyDown(t){this.open&&"Escape"===t.key&&(t.stopPropagation(),this.hide(),this.focusOnTrigger());}},{key:"handleDocumentKeyDown",value:function handleDocumentKeyDown(t){var _this3=this;if("Escape"===t.key&&this.open)return t.stopPropagation(),this.focusOnTrigger(),void this.hide();"Tab"===t.key&&setTimeout(function(){var _this3$containingElem,_document$activeEleme;var t=((_this3$containingElem=_this3.containingElement)===null||_this3$containingElem===void 0?void 0:_this3$containingElem.getRootNode())instanceof ShadowRoot?(_document$activeEleme=document.activeElement)===null||_document$activeEleme===void 0||(_document$activeEleme=_document$activeEleme.shadowRoot)===null||_document$activeEleme===void 0?void 0:_document$activeEleme.activeElement:document.activeElement;_this3.containingElement&&(t===null||t===void 0?void 0:t.closest(_this3.containingElement.tagName.toLowerCase()))===_this3.containingElement||_this3.hide();});}},{key:"handleDocumentMouseDown",value:function handleDocumentMouseDown(t){var i=t.composedPath();this.containingElement&&!i.includes(this.containingElement)&&this.hide();}},{key:"handlePanelSelect",value:function handlePanelSelect(t){var i=t.target;this.stayOpenOnSelect||"nile-menu"!==i.tagName.toLowerCase()||(this.hide(),this.focusOnTrigger());}},{key:"handleTriggerClick",value:function handleTriggerClick(){this.open?this.hide():(this.show(),this.focusOnTrigger());}},{key:"handleTriggerKeyDown",value:function handleTriggerKeyDown(t){var i=this.getMenu();if(i){var _s=i.getAllItems(),_e=_s[0],_o=_s[_s.length-1];["ArrowDown","ArrowUp","Home","End"].includes(t.key)&&(t.preventDefault(),this.open||this.show(),_s.length>0&&this.updateComplete.then(function(){"ArrowDown"!==t.key&&"Home"!==t.key||(i.setCurrentItem(_e),_e.focus()),"ArrowUp"!==t.key&&"End"!==t.key||(i.setCurrentItem(_o),_o.focus());}));}}},{key:"handleTriggerKeyUp",value:function handleTriggerKeyUp(t){" "===t.key&&t.preventDefault();}},{key:"handleTriggerSlotChange",value:function handleTriggerSlotChange(){this.updateAccessibleTrigger();}},{key:"updateAccessibleTrigger",value:function updateAccessibleTrigger(){var t=this.trigger.assignedElements({flatten:!0}).find(function(t){return c(t).start;});var i;if(t){switch(t.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":i=t.button;break;default:i=t;}i.setAttribute("aria-haspopup","true"),i.setAttribute("aria-expanded",this.open?"true":"false");}}},{key:"show",value:function(){var _show=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(this.open){_context2.next=2;break;}return _context2.abrupt("return",(this.open=!0,m(this,"nile-after-show")));case 2:case"end":return _context2.stop();}},_callee,this);}));function show(){return _show.apply(this,arguments);}return show;}()},{key:"hide",value:function(){var _hide=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(!this.open){_context3.next=2;break;}return _context3.abrupt("return",(this.open=!1,m(this,"nile-after-hide")));case 2:case"end":return _context3.stop();}},_callee2,this);}));function hide(){return _hide.apply(this,arguments);}return hide;}()},{key:"reposition",value:function reposition(){this.popup.reposition();}},{key:"addOpenListeners",value:function addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown);}},{key:"removeOpenListeners",value:function removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown);}},{key:"handleOpenChange",value:function(){var _handleOpenChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _p,_t2,_i,_p2,_t3,_i2;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:if(!this.disabled){_context4.next=4;break;}this.open=!1;_context4.next=27;break;case 4:if(!(this.updateAccessibleTrigger(),this.open)){_context4.next=17;break;}this.emit("nile-show");this.addOpenListeners();_context4.next=9;return r(this);case 9:this.panel.hidden=!1;this.popup.active=!0;_p=p(this,"dropdown.show",{dir:""}),_t2=_p.keyframes,_i=_p.options;_context4.next=14;return d(this.popup.popup,_t2,_i);case 14:this.emit("nile-after-show");_context4.next=27;break;case 17:this.emit("nile-hide");this.removeOpenListeners();_context4.next=21;return r(this);case 21:_p2=p(this,"dropdown.hide",{dir:""}),_t3=_p2.keyframes,_i2=_p2.options;_context4.next=24;return d(this.popup.popup,_t3,_i2);case 24:this.panel.hidden=!0;this.popup.active=!1;this.emit("nile-after-hide");case 27:case"end":return _context4.stop();}},_callee3,this);}));function handleOpenChange(){return _handleOpenChange.apply(this,arguments);}return handleOpenChange;}()},{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-popup\n part=\"base\"\n id=\"sidebar-action-dropdown\"\n placement=","\n distance=","\n skidding=","\n strategy=","\n sync=","\n flip\n shift\n auto-size=\"both\"\n auto-size-padding=\"10\"\n class=","\n >\n <slot\n name=\"trigger\"\n slot=\"anchor\"\n part=\"trigger\"\n class=\"dropdown__trigger\"\n @click=","\n @keydown=","\n @keyup=","\n @slotchange=","\n ></slot>\n\n <slot\n part=\"panel\"\n class=\"dropdown__panel\"\n aria-hidden=","\n aria-labelledby=\"sidebar-action-dropdown\"\n ></slot>\n </nile-popup>\n "])),this.placement,this.distance,this.skidding,this.hoist?"fixed":"absolute",this.sync,n({dropdown:!0,"dropdown--open":this.open}),this.handleTriggerClick,this.handleTriggerKeyDown,this.handleTriggerKeyUp,this.handleTriggerSlotChange,this.open?"false":"true");}}]);}(a));w.styles=[h],t([s(".dropdown")],w.prototype,"popup",void 0),t([s(".dropdown__trigger")],w.prototype,"trigger",void 0),t([s(".dropdown__panel")],w.prototype,"panel",void 0),t([e({type:Boolean,reflect:!0})],w.prototype,"open",void 0),t([e({reflect:!0})],w.prototype,"placement",void 0),t([e({type:Boolean,reflect:!0})],w.prototype,"disabled",void 0),t([e({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],w.prototype,"stayOpenOnSelect",void 0),t([e({attribute:!1})],w.prototype,"containingElement",void 0),t([e({type:Number})],w.prototype,"distance",void 0),t([e({type:Number})],w.prototype,"skidding",void 0),t([e()],w.prototype,"sync",void 0),t([e({type:Boolean})],w.prototype,"hoist",void 0),t([e({reflect:!0})],w.prototype,"triggerDropdown",void 0),t([u("open",{waitUntilFirstUpdate:!0})],w.prototype,"handleOpenChange",null),_export("N",w=t([o("nile-side-bar-action")],w)),l("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),l("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});}};});
|
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","lit/directives/class-map.js","./nile-side-bar-action.css.cjs.js","../internal/nile-element.cjs.js","../internal/animate.cjs.js","../utilities/animation-registry.cjs.js","../internal/tabbable.cjs.js","../internal/event.cjs.js","../internal/watch.cjs.js","../nile-popup/nile-popup.cjs.js","../utilities/visibility-manager.cjs.js","../floating-ui.dom-007bbe96.cjs.js","../nile-popup/nile-popup.css.cjs.js"],function(_export,_context){"use strict";var i,t,s,e,o,n,h,a,r,l,d,c,p,m,u,f,_templateObject,w;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){i=_tslib.__decorate;},function(_lit){t=_lit.html;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;e=_litDecoratorsJs.property;o=_litDecoratorsJs.customElement;},function(_litDirectivesClassMapJs){n=_litDirectivesClassMapJs.classMap;},function(_nileSideBarActionCssCjsJs){h=_nileSideBarActionCssCjsJs.s;},function(_internalNileElementCjsJs){a=_internalNileElementCjsJs.N;},function(_internalAnimateCjsJs){r=_internalAnimateCjsJs.s;l=_internalAnimateCjsJs.a;},function(_utilitiesAnimationRegistryCjsJs){d=_utilitiesAnimationRegistryCjsJs.s;c=_utilitiesAnimationRegistryCjsJs.g;},function(_internalTabbableCjsJs){p=_internalTabbableCjsJs.g;},function(_internalEventCjsJs){m=_internalEventCjsJs.w;},function(_internalWatchCjsJs){u=_internalWatchCjsJs.w;},function(_nilePopupNilePopupCjsJs){},function(_utilitiesVisibilityManagerCjsJs){f=_utilitiesVisibilityManagerCjsJs.V;},function(_floatingUiDom001CjsJs){},function(_nilePopupNilePopupCssCjsJs){}],execute:function execute(){_export("N",w=/*#__PURE__*/function(_a){function w(){var _this;_classCallCheck(this,w);_this=_callSuper(this,w,arguments),_this.open=!1,_this.placement="bottom-start",_this.disabled=!1,_this.stayOpenOnSelect=!1,_this.distance=0,_this.skidding=0,_this.hoist=!1,_this.triggerDropdown="click",_this.enableVisibilityEffect=!1,_this.enableTabClose=!1;return _this;}_inherits(w,_a);return _createClass(w,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(w,"connectedCallback",this,3)([]),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleTriggerMouseEnter=this.handleTriggerMouseEnter.bind(this),this.handleTriggerMouseLeave=this.handleTriggerMouseLeave.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init");}},{key:"firstUpdated",value:function(){var _firstUpdated=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(i){var _this2=this;var _i,t;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(this.panel.hidden=!this.open,"hover"===this.triggerDropdown){_i=this.trigger;_i&&(_i.addEventListener("mouseenter",this.handleTriggerMouseEnter),_i.addEventListener("mouseleave",this.handleTriggerMouseLeave)),this.panel&&(this.panel.addEventListener("mouseenter",this.handleTriggerMouseEnter),this.panel.addEventListener("mouseleave",this.handleTriggerMouseLeave));}this.open&&(this.addOpenListeners(),this.popup.active=!0);_context2.next=4;return this.updateComplete;case 4:t=this.trigger.assignedElements({flatten:!0})[0];this.visibilityManager=new f({host:this,target:t||null,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:function isOpen(){return _this2.open;},onAnchorOutOfView:function onAnchorOutOfView(){_this2.hide(),_this2.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"});},onDocumentHidden:function onDocumentHidden(){_this2.hide(),_this2.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"});},emit:function emit(i,t){return _this2.emit("nile-".concat(i),t);}});case 6:case"end":return _context2.stop();}},_callee,this);}));function firstUpdated(_x){return _firstUpdated.apply(this,arguments);}return firstUpdated;}()},{key:"handleTriggerMouseEnter",value:function handleTriggerMouseEnter(){clearTimeout(this.hoverTimeout),this.show();}},{key:"handleTriggerMouseLeave",value:function handleTriggerMouseLeave(){var _this3=this;clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(function(){return _this3.hide();},200);}},{key:"disconnectedCallback",value:function disconnectedCallback(){var _this$visibilityManag;_superPropGet(w,"disconnectedCallback",this,3)([]),this.removeOpenListeners(),(_this$visibilityManag=this.visibilityManager)!==null&&_this$visibilityManag!==void 0&&_this$visibilityManag.cleanup(),this.hide(),this.emit("nile-destroy");}},{key:"focusOnTrigger",value:function focusOnTrigger(){var i=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof(i===null||i===void 0?void 0:i.focus)&&i.focus();}},{key:"getMenu",value:function getMenu(){return this.panel.assignedElements({flatten:!0}).find(function(i){return"nile-menu"===i.tagName.toLowerCase();});}},{key:"handleKeyDown",value:function handleKeyDown(i){this.open&&"Escape"===i.key&&(i.stopPropagation(),this.hide(),this.focusOnTrigger());}},{key:"handleDocumentKeyDown",value:function handleDocumentKeyDown(i){var _this4=this;if("Escape"===i.key&&this.open)return i.stopPropagation(),this.focusOnTrigger(),void this.hide();"Tab"===i.key&&setTimeout(function(){var _this4$containingElem,_document$activeEleme;var i=((_this4$containingElem=_this4.containingElement)===null||_this4$containingElem===void 0?void 0:_this4$containingElem.getRootNode())instanceof ShadowRoot?(_document$activeEleme=document.activeElement)===null||_document$activeEleme===void 0||(_document$activeEleme=_document$activeEleme.shadowRoot)===null||_document$activeEleme===void 0?void 0:_document$activeEleme.activeElement:document.activeElement;_this4.containingElement&&(i===null||i===void 0?void 0:i.closest(_this4.containingElement.tagName.toLowerCase()))===_this4.containingElement||_this4.hide();});}},{key:"handleDocumentMouseDown",value:function handleDocumentMouseDown(i){var t=i.composedPath();this.containingElement&&!t.includes(this.containingElement)&&this.hide();}},{key:"handlePanelSelect",value:function handlePanelSelect(i){var t=i.target;this.stayOpenOnSelect||"nile-menu"!==t.tagName.toLowerCase()||(this.hide(),this.focusOnTrigger());}},{key:"handleTriggerClick",value:function handleTriggerClick(){this.open?this.hide():(this.show(),this.focusOnTrigger());}},{key:"handleTriggerKeyDown",value:function handleTriggerKeyDown(i){var t=this.getMenu();if(t){var _s=t.getAllItems(),_e=_s[0],_o=_s[_s.length-1];["ArrowDown","ArrowUp","Home","End"].includes(i.key)&&(i.preventDefault(),this.open||this.show(),_s.length>0&&this.updateComplete.then(function(){"ArrowDown"!==i.key&&"Home"!==i.key||(t.setCurrentItem(_e),_e.focus()),"ArrowUp"!==i.key&&"End"!==i.key||(t.setCurrentItem(_o),_o.focus());}));}}},{key:"handleTriggerKeyUp",value:function handleTriggerKeyUp(i){" "===i.key&&i.preventDefault();}},{key:"handleTriggerSlotChange",value:function handleTriggerSlotChange(){this.updateAccessibleTrigger();}},{key:"updateAccessibleTrigger",value:function updateAccessibleTrigger(){var i=this.trigger.assignedElements({flatten:!0}).find(function(i){return p(i).start;});var t;if(i){switch(i.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":t=i.button;break;default:t=i;}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false");}}},{key:"show",value:function(){var _show=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(this.open){_context3.next=2;break;}return _context3.abrupt("return",(this.open=!0,m(this,"nile-after-show")));case 2:case"end":return _context3.stop();}},_callee2,this);}));function show(){return _show.apply(this,arguments);}return show;}()},{key:"hide",value:function(){var _hide=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:if(!this.open){_context4.next=2;break;}return _context4.abrupt("return",(this.open=!1,m(this,"nile-after-hide")));case 2:case"end":return _context4.stop();}},_callee3,this);}));function hide(){return _hide.apply(this,arguments);}return hide;}()},{key:"reposition",value:function reposition(){this.popup.reposition();}},{key:"addOpenListeners",value:function addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown);}},{key:"removeOpenListeners",value:function removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown);}},{key:"handleOpenChange",value:function(){var _handleOpenChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _this$visibilityManag2;var _c,_i2,_t,_this$visibilityManag3,_c2,_i3,_t2;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:if(!((_this$visibilityManag2=this.visibilityManager)!==null&&_this$visibilityManag2!==void 0&&_this$visibilityManag2.setup(),this.disabled)){_context5.next=4;break;}this.open=!1;_context5.next=28;break;case 4:if(!(this.updateAccessibleTrigger(),this.open)){_context5.next=17;break;}this.emit("nile-show");this.addOpenListeners();_context5.next=9;return r(this);case 9:this.panel.hidden=!1;this.popup.active=!0;_c=c(this,"dropdown.show",{dir:""}),_i2=_c.keyframes,_t=_c.options;_context5.next=14;return l(this.popup.popup,_i2,_t);case 14:this.emit("nile-after-show");_context5.next=28;break;case 17:this.emit("nile-hide");this.removeOpenListeners();(_this$visibilityManag3=this.visibilityManager)!==null&&_this$visibilityManag3!==void 0&&_this$visibilityManag3.cleanup();_context5.next=22;return r(this);case 22:_c2=c(this,"dropdown.hide",{dir:""}),_i3=_c2.keyframes,_t2=_c2.options;_context5.next=25;return l(this.popup.popup,_i3,_t2);case 25:this.panel.hidden=!0;this.popup.active=!1;this.emit("nile-after-hide");case 28:case"end":return _context5.stop();}},_callee4,this);}));function handleOpenChange(){return _handleOpenChange.apply(this,arguments);}return handleOpenChange;}()},{key:"render",value:function render(){return t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-popup\n part=\"base\"\n id=\"sidebar-action-dropdown\"\n placement=","\n distance=","\n skidding=","\n strategy=","\n sync=","\n flip\n shift\n auto-size=\"both\"\n auto-size-padding=\"10\"\n class=","\n >\n <slot\n name=\"trigger\"\n slot=\"anchor\"\n part=\"trigger\"\n class=\"dropdown__trigger\"\n @click=","\n @keydown=","\n @keyup=","\n @slotchange=","\n ></slot>\n\n <slot\n part=\"panel\"\n class=\"dropdown__panel\"\n aria-hidden=","\n aria-labelledby=\"sidebar-action-dropdown\"\n ></slot>\n </nile-popup>\n "])),this.placement,this.distance,this.skidding,this.hoist?"fixed":"absolute",this.sync,n({dropdown:!0,"dropdown--open":this.open}),this.handleTriggerClick,this.handleTriggerKeyDown,this.handleTriggerKeyUp,this.handleTriggerSlotChange,this.open?"false":"true");}}]);}(a));w.styles=[h],i([s(".dropdown")],w.prototype,"popup",void 0),i([s(".dropdown__trigger")],w.prototype,"trigger",void 0),i([s(".dropdown__panel")],w.prototype,"panel",void 0),i([e({type:Boolean,reflect:!0})],w.prototype,"open",void 0),i([e({reflect:!0})],w.prototype,"placement",void 0),i([e({type:Boolean,reflect:!0})],w.prototype,"disabled",void 0),i([e({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],w.prototype,"stayOpenOnSelect",void 0),i([e({attribute:!1})],w.prototype,"containingElement",void 0),i([e({type:Number})],w.prototype,"distance",void 0),i([e({type:Number})],w.prototype,"skidding",void 0),i([e()],w.prototype,"sync",void 0),i([e({type:Boolean})],w.prototype,"hoist",void 0),i([e({reflect:!0})],w.prototype,"triggerDropdown",void 0),i([e({type:Boolean,reflect:!0})],w.prototype,"enableVisibilityEffect",void 0),i([e({type:Boolean,reflect:!0})],w.prototype,"enableTabClose",void 0),i([u("open",{waitUntilFirstUpdate:!0})],w.prototype,"handleOpenChange",null),_export("N",w=i([o("nile-side-bar-action")],w)),d("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),d("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});}};});
|
|
2
2
|
//# sourceMappingURL=nile-side-bar-action.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-side-bar-action.cjs.js","sources":["../../../src/nile-side-bar-action/nile-side-bar-action.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, CSSResultArray, TemplateResult } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styles } from './nile-side-bar-action.css';\nimport NileElement from '../internal/nile-element';\n\nimport { animateTo, stopAnimations } from '../internal/animate';\nimport { getAnimation, setDefaultAnimation } from '../utilities/animation-registry';\nimport { getTabbableBoundary } from '../internal/tabbable';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\n\nimport type NileButton from '../nile-button/nile-button';\nimport type NileIconButton from '../nile-icon-button/nile-icon-button';\nimport type { NileMenu } from '../nile-menu';\nimport type { NilePopup } from '../nile-popup';\nimport '../nile-popup';\n\n/**\n * Nile side-bar-action component.\n *\n * @tag nile-side-bar-action\n *\n * @slot trigger - The clickable trigger (icon/button).\n * @slot - The dropdown panel content (menu, custom content).\n *\n * @event nile-show - Fired when dropdown opens.\n * @event nile-after-show - Fired after dropdown + animations.\n * @event nile-hide - Fired when dropdown closes.\n * @event nile-after-hide - Fired after dropdown closes + animations.\n */\n@customElement('nile-side-bar-action')\nexport class NileSideBarAction extends NileElement {\n static styles: CSSResultArray = [styles];\n\n @query('.dropdown') popup: NilePopup;\n @query('.dropdown__trigger') trigger: HTMLSlotElement;\n @query('.dropdown__panel') panel: HTMLSlotElement;\n\n /** Whether the dropdown is open */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /** Preferred placement relative to trigger */\n @property({ reflect: true }) placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'bottom-start';\n\n /** Disable interaction */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Keep open on select */\n @property({ attribute: 'stay-open-on-select', type: Boolean, reflect: true })\n stayOpenOnSelect = false;\n\n /** External containing element (default: self) */\n @property({ attribute: false }) containingElement?: HTMLElement;\n\n /** Offsets */\n @property({ type: Number }) distance = 0;\n @property({ type: Number }) skidding = 0;\n\n /** Sync size with trigger */\n @property() sync: 'width' | 'height' | 'both';\n\n /** Hoist above scroll containers */\n @property({ type: Boolean }) hoist = false;\n\n @property({ reflect: true }) triggerDropdown: 'click' | 'hover' = 'click';\n private hoverTimeout: number | undefined;\n\n connectedCallback() {\n super.connectedCallback();\n this.handlePanelSelect = this.handlePanelSelect.bind(this);\n this.handleKeyDown = this.handleKeyDown.bind(this);\n this.handleDocumentKeyDown = this.handleDocumentKeyDown.bind(this);\n this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);\n this.handleTriggerMouseEnter = this.handleTriggerMouseEnter.bind(this);\n this.handleTriggerMouseLeave = this.handleTriggerMouseLeave.bind(this);\n \n if (!this.containingElement) {\n this.containingElement = this;\n }\n this.emit('nile-init');\n }\n \n \n \n firstUpdated() {\n this.panel.hidden = !this.open;\n \n if (this.triggerDropdown === 'hover') {\n const triggerEl = this.trigger;\n if (triggerEl) {\n triggerEl.addEventListener('mouseenter', this.handleTriggerMouseEnter);\n triggerEl.addEventListener('mouseleave', this.handleTriggerMouseLeave);\n }\n if (this.panel) {\n this.panel.addEventListener('mouseenter', this.handleTriggerMouseEnter);\n this.panel.addEventListener('mouseleave', this.handleTriggerMouseLeave);\n }\n } else {\n }\n \n if (this.open) {\n this.addOpenListeners();\n this.popup.active = true;\n }\n }\n \n handleTriggerMouseEnter() {\n clearTimeout(this.hoverTimeout);\n this.show();\n }\n \n handleTriggerMouseLeave() {\n clearTimeout(this.hoverTimeout);\n this.hoverTimeout = window.setTimeout(() => this.hide(), 200);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeOpenListeners();\n this.hide();\n this.emit('nile-destroy');\n }\n\n focusOnTrigger() {\n const trigger = this.trigger.assignedElements({ flatten: true })[0] as HTMLElement | undefined;\n if (typeof trigger?.focus === 'function') {\n trigger.focus();\n }\n }\n\n getMenu() {\n return this.panel.assignedElements({ flatten: true }).find(el =>\n el.tagName.toLowerCase() === 'nile-menu'\n ) as NileMenu | undefined;\n }\n\n handleKeyDown(event: KeyboardEvent) {\n if (this.open && event.key === 'Escape') {\n event.stopPropagation();\n this.hide();\n this.focusOnTrigger();\n }\n }\n\n handleDocumentKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.open) {\n event.stopPropagation();\n this.focusOnTrigger();\n this.hide();\n return;\n }\n if (event.key === 'Tab') {\n setTimeout(() => {\n const activeElement =\n this.containingElement?.getRootNode() instanceof ShadowRoot\n ? document.activeElement?.shadowRoot?.activeElement\n : document.activeElement;\n\n if (\n !this.containingElement ||\n activeElement?.closest(this.containingElement.tagName.toLowerCase()) !==\n this.containingElement\n ) {\n this.hide();\n }\n });\n }\n }\n\n handleDocumentMouseDown(event: MouseEvent) {\n const path = event.composedPath();\n if (this.containingElement && !path.includes(this.containingElement)) {\n this.hide();\n }\n }\n\n handlePanelSelect(event: any) {\n const target = event.target as HTMLElement;\n if (!this.stayOpenOnSelect && target.tagName.toLowerCase() === 'nile-menu') {\n this.hide();\n this.focusOnTrigger();\n }\n }\n\n handleTriggerClick() {\n if (this.open) {\n this.hide();\n } else {\n this.show();\n this.focusOnTrigger();\n }\n }\n\n handleTriggerKeyDown(event: KeyboardEvent) {\n const menu = this.getMenu();\n if (menu) {\n const menuItems = menu.getAllItems();\n const firstMenuItem = menuItems[0];\n const lastMenuItem = menuItems[menuItems.length - 1];\n\n if (['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key)) {\n event.preventDefault();\n if (!this.open) this.show();\n if (menuItems.length > 0) {\n this.updateComplete.then(() => {\n if (event.key === 'ArrowDown' || event.key === 'Home') {\n menu.setCurrentItem(firstMenuItem);\n firstMenuItem.focus();\n }\n if (event.key === 'ArrowUp' || event.key === 'End') {\n menu.setCurrentItem(lastMenuItem);\n lastMenuItem.focus();\n }\n });\n }\n }\n }\n }\n\n handleTriggerKeyUp(event: KeyboardEvent) {\n if (event.key === ' ') {\n event.preventDefault();\n }\n }\n\n handleTriggerSlotChange() {\n this.updateAccessibleTrigger();\n }\n\n updateAccessibleTrigger() {\n const assignedElements = this.trigger.assignedElements({ flatten: true }) as HTMLElement[];\n const accessibleTrigger = assignedElements.find(el => getTabbableBoundary(el).start);\n let target: HTMLElement;\n\n if (accessibleTrigger) {\n switch (accessibleTrigger.tagName.toLowerCase()) {\n case 'nile-button':\n case 'nile-icon-button':\n target = (accessibleTrigger as NileButton | NileIconButton).button;\n break;\n default:\n target = accessibleTrigger;\n }\n\n target.setAttribute('aria-haspopup', 'true');\n target.setAttribute('aria-expanded', this.open ? 'true' : 'false');\n }\n }\n\n /** Public methods */\n async show() {\n if (this.open) return;\n this.open = true;\n return waitForEvent(this, 'nile-after-show');\n }\n\n async hide() {\n if (!this.open) return;\n this.open = false;\n return waitForEvent(this, 'nile-after-hide');\n }\n\n reposition() {\n this.popup.reposition();\n }\n\n addOpenListeners() {\n this.panel.addEventListener('nile-select', this.handlePanelSelect);\n this.panel.addEventListener('keydown', this.handleKeyDown);\n document.addEventListener('keydown', this.handleDocumentKeyDown);\n document.addEventListener('mousedown', this.handleDocumentMouseDown);\n }\n\n removeOpenListeners() {\n if (this.panel) {\n this.panel.removeEventListener('nile-select', this.handlePanelSelect);\n this.panel.removeEventListener('keydown', this.handleKeyDown);\n }\n document.removeEventListener('keydown', this.handleDocumentKeyDown);\n document.removeEventListener('mousedown', this.handleDocumentMouseDown);\n }\n\n @watch('open', { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.disabled) {\n this.open = false;\n return;\n }\n this.updateAccessibleTrigger();\n\n if (this.open) {\n this.emit('nile-show');\n this.addOpenListeners();\n\n await stopAnimations(this);\n this.panel.hidden = false;\n this.popup.active = true;\n const { keyframes, options } = getAnimation(this, 'dropdown.show', { dir: '' });\n await animateTo(this.popup.popup, keyframes, options);\n this.emit('nile-after-show');\n } else {\n this.emit('nile-hide');\n this.removeOpenListeners();\n\n await stopAnimations(this);\n const { keyframes, options } = getAnimation(this, 'dropdown.hide', { dir: '' });\n await animateTo(this.popup.popup, keyframes, options);\n this.panel.hidden = true;\n this.popup.active = false;\n this.emit('nile-after-hide');\n }\n }\n\n render(): TemplateResult {\n return html`\n <nile-popup\n part=\"base\"\n id=\"sidebar-action-dropdown\"\n placement=${this.placement}\n distance=${this.distance}\n skidding=${this.skidding}\n strategy=${this.hoist ? 'fixed' : 'absolute'}\n sync=${this.sync}\n flip\n shift\n auto-size=\"both\"\n auto-size-padding=\"10\"\n class=${classMap({\n dropdown: true,\n 'dropdown--open': this.open\n })}\n >\n <slot\n name=\"trigger\"\n slot=\"anchor\"\n part=\"trigger\"\n class=\"dropdown__trigger\"\n @click=${this.handleTriggerClick}\n @keydown=${this.handleTriggerKeyDown}\n @keyup=${this.handleTriggerKeyUp}\n @slotchange=${this.handleTriggerSlotChange}\n ></slot>\n\n <slot\n part=\"panel\"\n class=\"dropdown__panel\"\n aria-hidden=${this.open ? 'false' : 'true'}\n aria-labelledby=\"sidebar-action-dropdown\"\n ></slot>\n </nile-popup>\n `;\n }\n}\n\n/* Default animations */\nsetDefaultAnimation('dropdown.show', {\n keyframes: [\n { opacity: 0, scale: 0.9 },\n { opacity: 1, scale: 1 }\n ],\n options: { duration: 100, easing: 'ease' }\n});\n\nsetDefaultAnimation('dropdown.hide', {\n keyframes: [\n { opacity: 1, scale: 1 },\n { opacity: 0, scale: 0.9 }\n ],\n options: { duration: 100, easing: 'ease' }\n});\n\nexport default NileSideBarAction;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-side-bar-action': NileSideBarAction;\n }\n}\n"],"names":["NileSideBarAction","w","this","open","placement","disabled","stayOpenOnSelect","distance","skidding","hoist","triggerDropdown","_this","_inherits","_a","_createClass","key","value","connectedCallback","super","handlePanelSelect","bind","handleKeyDown","handleDocumentKeyDown","handleDocumentMouseDown","handleTriggerMouseEnter","handleTriggerMouseLeave","containingElement","emit","firstUpdated","panel","hidden","triggerEl","trigger","addEventListener","addOpenListeners","popup","active","clearTimeout","hoverTimeout","show","window","setTimeout","hide","disconnectedCallback","removeOpenListeners","focusOnTrigger","assignedElements","flatten","focus","getMenu","find","el","tagName","toLowerCase","event","stopPropagation","_this3$containingElem","_document$activeEleme","activeElement","getRootNode","ShadowRoot","document","shadowRoot","closest","path","composedPath","includes","target","handleTriggerClick","handleTriggerKeyDown","menu","menuItems","getAllItems","firstMenuItem","lastMenuItem","length","preventDefault","updateComplete","then","setCurrentItem","handleTriggerKeyUp","handleTriggerSlotChange","updateAccessibleTrigger","accessibleTrigger","getTabbableBoundary","start","button","setAttribute","_show","_asyncToGenerator","_regeneratorRuntime","mark","_callee","wrap","_callee$","_context2","prev","next","waitForEvent","stop","_callee2","_callee2$","_context3","reposition","removeEventListener","_handleOpenChange","_callee3","_p","_t2","_i","_p2","_t3","_i2","_callee3$","_context4","stopAnimations","getAnimation","dir","keyframes","options","animateTo","handleOpenChange","render","html","_templateObject","_taggedTemplateLiteral","sync","classMap","dropdown","NileElement","styles","__decorate","query","prototype","property","type","Boolean","reflect","attribute","Number","watch","waitUntilFirstUpdate","_export","customElement","setDefaultAnimation","opacity","scale","duration","easing"],"mappings":"+hZAuCaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,uEAQuCC,KAAAA,CAAIC,IAAAA,CAAAA,CAAG,CAGtBD,CAAAA,KAAAA,CAASE,UAYrB,cAG2BF,CAAAA,KAAAA,CAAQG,QAAG,CAAA,CAAA,CAAA,CAIvDH,KAAAA,CAAgBI,gBAAG,CAAA,CAAA,CAAA,CAMSJ,KAAAA,CAAQK,QAAAA,CAAG,EACXL,KAAAA,CAAQM,QAAAA,CAAG,CAMVN,CAAAA,KAAAA,CAAKO,OAAG,CAERP,CAAAA,KAAAA,CAAeQ,eAAsB,CAAA,OAgSnE,QAAAC,KAAA,EA7RCC,SAAA,CAAAX,CAAA,CAAAY,EAAA,SAAAC,YAAA,CAAAb,CAAA,GAAAc,GAAA,qBAAAC,KAAA,UAAAC,iBAAAA,CAAAA,CAAAA,CACEC,aAAAA,CAAAA,CAAAA,iCACAhB,KAAKiB,iBAAoBjB,CAAAA,IAAAA,CAAKiB,iBAAkBC,CAAAA,IAAAA,CAAKlB,MACrDA,IAAKmB,CAAAA,aAAAA,CAAgBnB,IAAKmB,CAAAA,aAAAA,CAAcD,KAAKlB,IAC7CA,CAAAA,CAAAA,IAAAA,CAAKoB,qBAAwBpB,CAAAA,IAAAA,CAAKoB,sBAAsBF,IAAKlB,CAAAA,IAAAA,CAAAA,CAC7DA,IAAKqB,CAAAA,uBAAAA,CAA0BrB,KAAKqB,uBAAwBH,CAAAA,IAAAA,CAAKlB,IACjEA,CAAAA,CAAAA,IAAAA,CAAKsB,wBAA0BtB,IAAKsB,CAAAA,uBAAAA,CAAwBJ,IAAKlB,CAAAA,IAAAA,CAAAA,CACjEA,KAAKuB,uBAA0BvB,CAAAA,IAAAA,CAAKuB,uBAAwBL,CAAAA,IAAAA,CAAKlB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SU9I,EAAiBmI,CAAA,CAAA,CAD7BY,EAAc,sBACF/I,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAgVbgJ,EAAoB,eAAiB,CAAA,CACnC1B,UAAW,CACT,CAAE2B,QAAS,CAAGC,CAAAA,KAAAA,CAAO,IACrB,CAAED,OAAAA,CAAS,EAAGC,KAAO,CAAA,CAAA,CAAA,CAAA,CAEvB3B,QAAS,CAAE4B,QAAAA,CAAU,IAAKC,MAAQ,CAAA,MAAA,CAAA,CAAA,CAAA,CAGpCJ,EAAoB,eAAiB,CAAA,CACnC1B,UAAW,CACT,CAAE2B,QAAS,CAAGC,CAAAA,KAAAA,CAAO,GACrB,CAAED,OAAAA,CAAS,EAAGC,KAAO,CAAA,EAAA,CAAA,CAAA,CAEvB3B,QAAS,CAAE4B,QAAAA,CAAU,GAAKC,CAAAA,MAAAA,CAAQ"}
|
|
1
|
+
{"version":3,"file":"nile-side-bar-action.cjs.js","sources":["../../../src/nile-side-bar-action/nile-side-bar-action.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, CSSResultArray, TemplateResult, PropertyValues } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styles } from './nile-side-bar-action.css';\nimport NileElement from '../internal/nile-element';\n\nimport { animateTo, stopAnimations } from '../internal/animate';\nimport { getAnimation, setDefaultAnimation } from '../utilities/animation-registry';\nimport { getTabbableBoundary } from '../internal/tabbable';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\n\nimport type NileButton from '../nile-button/nile-button';\nimport type NileIconButton from '../nile-icon-button/nile-icon-button';\nimport type { NileMenu } from '../nile-menu';\nimport type { NilePopup } from '../nile-popup';\nimport '../nile-popup';\nimport { VisibilityManager } from '../utilities/visibility-manager.js';\n\n/**\n * Nile side-bar-action component.\n *\n * @tag nile-side-bar-action\n *\n * @slot trigger - The clickable trigger (icon/button).\n * @slot - The dropdown panel content (menu, custom content).\n *\n * @event nile-show - Fired when dropdown opens.\n * @event nile-after-show - Fired after dropdown + animations.\n * @event nile-hide - Fired when dropdown closes.\n * @event nile-after-hide - Fired after dropdown closes + animations.\n */\n@customElement('nile-side-bar-action')\nexport class NileSideBarAction extends NileElement {\n static styles: CSSResultArray = [styles];\n\n @query('.dropdown') popup: NilePopup;\n @query('.dropdown__trigger') trigger: HTMLSlotElement;\n @query('.dropdown__panel') panel: HTMLSlotElement;\n\n /** Whether the dropdown is open */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /** Preferred placement relative to trigger */\n @property({ reflect: true }) placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'bottom-start';\n\n /** Disable interaction */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Keep open on select */\n @property({ attribute: 'stay-open-on-select', type: Boolean, reflect: true })\n stayOpenOnSelect = false;\n\n /** External containing element (default: self) */\n @property({ attribute: false }) containingElement?: HTMLElement;\n\n /** Offsets */\n @property({ type: Number }) distance = 0;\n @property({ type: Number }) skidding = 0;\n\n /** Sync size with trigger */\n @property() sync: 'width' | 'height' | 'both';\n\n /** Hoist above scroll containers */\n @property({ type: Boolean }) hoist = false;\n\n @property({ reflect: true }) triggerDropdown: 'click' | 'hover' = 'click';\n private hoverTimeout: number | undefined;\n\n @property({ type: Boolean, reflect: true }) enableVisibilityEffect = false;\n\n @property({ type: Boolean, reflect: true }) enableTabClose = false;\n\n private visibilityManager?: VisibilityManager;\n\n connectedCallback() {\n super.connectedCallback();\n this.handlePanelSelect = this.handlePanelSelect.bind(this);\n this.handleKeyDown = this.handleKeyDown.bind(this);\n this.handleDocumentKeyDown = this.handleDocumentKeyDown.bind(this);\n this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);\n this.handleTriggerMouseEnter = this.handleTriggerMouseEnter.bind(this);\n this.handleTriggerMouseLeave = this.handleTriggerMouseLeave.bind(this);\n \n if (!this.containingElement) {\n this.containingElement = this;\n }\n this.emit('nile-init');\n }\n \n \n \n protected async firstUpdated(_changed: PropertyValues) {\n this.panel.hidden = !this.open;\n \n if (this.triggerDropdown === 'hover') {\n const triggerEl = this.trigger;\n if (triggerEl) {\n triggerEl.addEventListener('mouseenter', this.handleTriggerMouseEnter);\n triggerEl.addEventListener('mouseleave', this.handleTriggerMouseLeave);\n }\n if (this.panel) {\n this.panel.addEventListener('mouseenter', this.handleTriggerMouseEnter);\n this.panel.addEventListener('mouseleave', this.handleTriggerMouseLeave);\n }\n } else {\n }\n \n if (this.open) {\n this.addOpenListeners();\n this.popup.active = true;\n }\n await this.updateComplete;\n const triggerNode = this.trigger.assignedElements({ flatten: true })[0] as HTMLElement | undefined;\n \n this.visibilityManager = new VisibilityManager({\n host: this,\n target: triggerNode || null,\n enableVisibilityEffect: this.enableVisibilityEffect,\n enableTabClose: this.enableTabClose,\n isOpen: () => this.open,\n onAnchorOutOfView: () => {\n this.hide();\n this.emit('nile-visibility-change', {\n visible: false,\n reason: 'anchor-out-of-view',\n });\n },\n onDocumentHidden: () => {\n this.hide();\n this.emit('nile-visibility-change', {\n visible: false,\n reason: 'document-hidden',\n });\n },\n emit: (event, detail) => this.emit(`nile-${event}`, detail),\n });\n }\n \n handleTriggerMouseEnter() {\n clearTimeout(this.hoverTimeout);\n this.show();\n }\n \n handleTriggerMouseLeave() {\n clearTimeout(this.hoverTimeout);\n this.hoverTimeout = window.setTimeout(() => this.hide(), 200);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeOpenListeners();\n this.visibilityManager?.cleanup();\n this.hide();\n this.emit('nile-destroy');\n }\n\n focusOnTrigger() {\n const trigger = this.trigger.assignedElements({ flatten: true })[0] as HTMLElement | undefined;\n if (typeof trigger?.focus === 'function') {\n trigger.focus();\n }\n }\n\n getMenu() {\n return this.panel.assignedElements({ flatten: true }).find(el =>\n el.tagName.toLowerCase() === 'nile-menu'\n ) as NileMenu | undefined;\n }\n\n handleKeyDown(event: KeyboardEvent) {\n if (this.open && event.key === 'Escape') {\n event.stopPropagation();\n this.hide();\n this.focusOnTrigger();\n }\n }\n\n handleDocumentKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.open) {\n event.stopPropagation();\n this.focusOnTrigger();\n this.hide();\n return;\n }\n if (event.key === 'Tab') {\n setTimeout(() => {\n const activeElement =\n this.containingElement?.getRootNode() instanceof ShadowRoot\n ? document.activeElement?.shadowRoot?.activeElement\n : document.activeElement;\n\n if (\n !this.containingElement ||\n activeElement?.closest(this.containingElement.tagName.toLowerCase()) !==\n this.containingElement\n ) {\n this.hide();\n }\n });\n }\n }\n\n handleDocumentMouseDown(event: MouseEvent) {\n const path = event.composedPath();\n if (this.containingElement && !path.includes(this.containingElement)) {\n this.hide();\n }\n }\n\n handlePanelSelect(event: any) {\n const target = event.target as HTMLElement;\n if (!this.stayOpenOnSelect && target.tagName.toLowerCase() === 'nile-menu') {\n this.hide();\n this.focusOnTrigger();\n }\n }\n\n handleTriggerClick() {\n if (this.open) {\n this.hide();\n } else {\n this.show();\n this.focusOnTrigger();\n }\n }\n\n handleTriggerKeyDown(event: KeyboardEvent) {\n const menu = this.getMenu();\n if (menu) {\n const menuItems = menu.getAllItems();\n const firstMenuItem = menuItems[0];\n const lastMenuItem = menuItems[menuItems.length - 1];\n\n if (['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key)) {\n event.preventDefault();\n if (!this.open) this.show();\n if (menuItems.length > 0) {\n this.updateComplete.then(() => {\n if (event.key === 'ArrowDown' || event.key === 'Home') {\n menu.setCurrentItem(firstMenuItem);\n firstMenuItem.focus();\n }\n if (event.key === 'ArrowUp' || event.key === 'End') {\n menu.setCurrentItem(lastMenuItem);\n lastMenuItem.focus();\n }\n });\n }\n }\n }\n }\n\n handleTriggerKeyUp(event: KeyboardEvent) {\n if (event.key === ' ') {\n event.preventDefault();\n }\n }\n\n handleTriggerSlotChange() {\n this.updateAccessibleTrigger();\n }\n\n updateAccessibleTrigger() {\n const assignedElements = this.trigger.assignedElements({ flatten: true }) as HTMLElement[];\n const accessibleTrigger = assignedElements.find(el => getTabbableBoundary(el).start);\n let target: HTMLElement;\n\n if (accessibleTrigger) {\n switch (accessibleTrigger.tagName.toLowerCase()) {\n case 'nile-button':\n case 'nile-icon-button':\n target = (accessibleTrigger as NileButton | NileIconButton).button;\n break;\n default:\n target = accessibleTrigger;\n }\n\n target.setAttribute('aria-haspopup', 'true');\n target.setAttribute('aria-expanded', this.open ? 'true' : 'false');\n }\n }\n\n /** Public methods */\n async show() {\n if (this.open) return;\n this.open = true;\n return waitForEvent(this, 'nile-after-show');\n }\n\n async hide() {\n if (!this.open) return;\n this.open = false;\n return waitForEvent(this, 'nile-after-hide');\n }\n\n reposition() {\n this.popup.reposition();\n }\n\n addOpenListeners() {\n this.panel.addEventListener('nile-select', this.handlePanelSelect);\n this.panel.addEventListener('keydown', this.handleKeyDown);\n document.addEventListener('keydown', this.handleDocumentKeyDown);\n document.addEventListener('mousedown', this.handleDocumentMouseDown);\n }\n\n removeOpenListeners() {\n if (this.panel) {\n this.panel.removeEventListener('nile-select', this.handlePanelSelect);\n this.panel.removeEventListener('keydown', this.handleKeyDown);\n }\n document.removeEventListener('keydown', this.handleDocumentKeyDown);\n document.removeEventListener('mousedown', this.handleDocumentMouseDown);\n }\n\n @watch('open', { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n this.visibilityManager?.setup();\n if (this.disabled) {\n this.open = false;\n return;\n }\n this.updateAccessibleTrigger();\n\n if (this.open) {\n this.emit('nile-show');\n this.addOpenListeners();\n\n await stopAnimations(this);\n this.panel.hidden = false;\n this.popup.active = true;\n const { keyframes, options } = getAnimation(this, 'dropdown.show', { dir: '' });\n await animateTo(this.popup.popup, keyframes, options);\n this.emit('nile-after-show');\n } else {\n this.emit('nile-hide');\n this.removeOpenListeners();\n this.visibilityManager?.cleanup();\n await stopAnimations(this);\n const { keyframes, options } = getAnimation(this, 'dropdown.hide', { dir: '' });\n await animateTo(this.popup.popup, keyframes, options);\n this.panel.hidden = true;\n this.popup.active = false;\n this.emit('nile-after-hide');\n }\n }\n\n render(): TemplateResult {\n return html`\n <nile-popup\n part=\"base\"\n id=\"sidebar-action-dropdown\"\n placement=${this.placement}\n distance=${this.distance}\n skidding=${this.skidding}\n strategy=${this.hoist ? 'fixed' : 'absolute'}\n sync=${this.sync}\n flip\n shift\n auto-size=\"both\"\n auto-size-padding=\"10\"\n class=${classMap({\n dropdown: true,\n 'dropdown--open': this.open\n })}\n >\n <slot\n name=\"trigger\"\n slot=\"anchor\"\n part=\"trigger\"\n class=\"dropdown__trigger\"\n @click=${this.handleTriggerClick}\n @keydown=${this.handleTriggerKeyDown}\n @keyup=${this.handleTriggerKeyUp}\n @slotchange=${this.handleTriggerSlotChange}\n ></slot>\n\n <slot\n part=\"panel\"\n class=\"dropdown__panel\"\n aria-hidden=${this.open ? 'false' : 'true'}\n aria-labelledby=\"sidebar-action-dropdown\"\n ></slot>\n </nile-popup>\n `;\n }\n}\n\n/* Default animations */\nsetDefaultAnimation('dropdown.show', {\n keyframes: [\n { opacity: 0, scale: 0.9 },\n { opacity: 1, scale: 1 }\n ],\n options: { duration: 100, easing: 'ease' }\n});\n\nsetDefaultAnimation('dropdown.hide', {\n keyframes: [\n { opacity: 1, scale: 1 },\n { opacity: 0, scale: 0.9 }\n ],\n options: { duration: 100, easing: 'ease' }\n});\n\nexport default NileSideBarAction;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-side-bar-action': NileSideBarAction;\n }\n}\n"],"names":["NileSideBarAction","w","this","open","placement","disabled","stayOpenOnSelect","distance","skidding","hoist","triggerDropdown","enableVisibilityEffect","enableTabClose","_this","_inherits","_a","_createClass","key","value","connectedCallback","super","handlePanelSelect","bind","handleKeyDown","handleDocumentKeyDown","handleDocumentMouseDown","handleTriggerMouseEnter","handleTriggerMouseLeave","containingElement","emit","_firstUpdated","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_changed","_this2","_i","t","wrap","_callee$","_context2","prev","next","panel","hidden","triggerEl","trigger","addEventListener","addOpenListeners","popup","active","updateComplete","triggerNode","assignedElements","flatten","visibilityManager","VisibilityManager","host","target","isOpen","onAnchorOutOfView","hide","visible","reason","onDocumentHidden","event","detail","concat","stop","firstUpdated","clearTimeout","hoverTimeout","show","window","setTimeout","disconnectedCallback","removeOpenListeners","cleanup","focusOnTrigger","focus","getMenu","find","el","tagName","toLowerCase","stopPropagation","activeElement","getRootNode","ShadowRoot","document","shadowRoot","closest","path","composedPath","includes","handleTriggerClick","handleTriggerKeyDown","menu","menuItems","getAllItems","firstMenuItem","lastMenuItem","length","preventDefault","then","setCurrentItem","handleTriggerKeyUp","handleTriggerSlotChange","updateAccessibleTrigger","accessibleTrigger","getTabbableBoundary","start","button","setAttribute","_show","_callee2","_callee2$","_context3","abrupt","waitForEvent","_callee3","_callee3$","_context4","reposition","removeEventListener","_handleOpenChange","_callee4","_this$visibilityManag2","_c","_i2","_t","_this$visibilityManag3","_c2","_i3","_t2","_callee4$","_context5","setup","stopAnimations","getAnimation","dir","animateTo","keyframes","options","handleOpenChange","render","html","_templateObject","_taggedTemplateLiteral","sync","classMap","dropdown","NileElement","styles","__decorate","query","prototype","property","type","Boolean","reflect","attribute","Number","watch","waitUntilFirstUpdate","_export","customElement","setDefaultAnimation","opacity","scale","duration","easing"],"mappings":"4pZAwCaA,4BAAN,SAAAC,EAAA,uEAQuCC,KAAAA,CAAIC,IAAAA,CAAAA,CAAG,EAGtBD,KAAAA,CAASE,SAAAA,CAYrB,cAG2BF,CAAAA,KAAAA,CAAQG,UAAG,CAIvDH,CAAAA,KAAAA,CAAgBI,kBAAG,CAMSJ,CAAAA,KAAAA,CAAQK,SAAG,CACXL,CAAAA,KAAAA,CAAQM,SAAG,CAMVN,CAAAA,KAAAA,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Ac,CAAA,sBAAA,CAAA,CAAA,CACFvK,CAiXbwK,CAAAA,EAAAA,CAAAA,CAAoB,gBAAiB,CACnCzB,SAAAA,CAAW,CACT,CAAE0B,OAAS,CAAA,CAAA,CAAGC,MAAO,EACrB,CAAA,CAAA,CAAED,OAAS,CAAA,CAAA,CAAGC,KAAO,CAAA,CAAA,CAAA,CAAA,CAEvB1B,QAAS,CAAE2B,QAAAA,CAAU,GAAKC,CAAAA,MAAAA,CAAQ,MAGpCJ,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAoB,gBAAiB,CACnCzB,SAAAA,CAAW,CACT,CAAE0B,OAAS,CAAA,CAAA,CAAGC,MAAO,CACrB,CAAA,CAAA,CAAED,OAAS,CAAA,CAAA,CAAGC,KAAO,CAAA,EAAA,CAAA,CAAA,CAEvB1B,QAAS,CAAE2B,QAAAA,CAAU,GAAKC,CAAAA,MAAAA,CAAQ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate as
|
|
1
|
+
import{__decorate as i}from"tslib";import{html as t}from"lit";import{query as e,property as s,customElement as o}from"lit/decorators.js";import{classMap as n}from"lit/directives/class-map.js";import{s as h}from"./nile-side-bar-action.css.esm.js";import{N as a}from"../internal/nile-element.esm.js";import{s as r,a as l}from"../internal/animate.esm.js";import{s as d,g as p}from"../utilities/animation-registry.esm.js";import{g as c}from"../internal/tabbable.esm.js";import{w as m}from"../internal/event.esm.js";import{w as u}from"../internal/watch.esm.js";import"../nile-popup/nile-popup.esm.js";import{V as f}from"../utilities/visibility-manager.esm.js";import"../floating-ui.dom-cc9126da.esm.js";import"../nile-popup/nile-popup.css.esm.js";let w=class extends a{constructor(){super(...arguments),this.open=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.skidding=0,this.hoist=!1,this.triggerDropdown="click",this.enableVisibilityEffect=!1,this.enableTabClose=!1}connectedCallback(){super.connectedCallback(),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleTriggerMouseEnter=this.handleTriggerMouseEnter.bind(this),this.handleTriggerMouseLeave=this.handleTriggerMouseLeave.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init")}async firstUpdated(i){if(this.panel.hidden=!this.open,"hover"===this.triggerDropdown){const i=this.trigger;i&&(i.addEventListener("mouseenter",this.handleTriggerMouseEnter),i.addEventListener("mouseleave",this.handleTriggerMouseLeave)),this.panel&&(this.panel.addEventListener("mouseenter",this.handleTriggerMouseEnter),this.panel.addEventListener("mouseleave",this.handleTriggerMouseLeave))}this.open&&(this.addOpenListeners(),this.popup.active=!0),await this.updateComplete;const t=this.trigger.assignedElements({flatten:!0})[0];this.visibilityManager=new f({host:this,target:t||null,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:()=>this.open,onAnchorOutOfView:()=>{this.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"})},onDocumentHidden:()=>{this.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"})},emit:(i,t)=>this.emit(`nile-${i}`,t)})}handleTriggerMouseEnter(){clearTimeout(this.hoverTimeout),this.show()}handleTriggerMouseLeave(){clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),200)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.visibilityManager?.cleanup(),this.hide(),this.emit("nile-destroy")}focusOnTrigger(){const i=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof i?.focus&&i.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((i=>"nile-menu"===i.tagName.toLowerCase()))}handleKeyDown(i){this.open&&"Escape"===i.key&&(i.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(i){if("Escape"===i.key&&this.open)return i.stopPropagation(),this.focusOnTrigger(),void this.hide();"Tab"===i.key&&setTimeout((()=>{const i=this.containingElement?.getRootNode()instanceof ShadowRoot?document.activeElement?.shadowRoot?.activeElement:document.activeElement;this.containingElement&&i?.closest(this.containingElement.tagName.toLowerCase())===this.containingElement||this.hide()}))}handleDocumentMouseDown(i){const t=i.composedPath();this.containingElement&&!t.includes(this.containingElement)&&this.hide()}handlePanelSelect(i){const t=i.target;this.stayOpenOnSelect||"nile-menu"!==t.tagName.toLowerCase()||(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.open?this.hide():(this.show(),this.focusOnTrigger())}handleTriggerKeyDown(i){const t=this.getMenu();if(t){const e=t.getAllItems(),s=e[0],o=e[e.length-1];["ArrowDown","ArrowUp","Home","End"].includes(i.key)&&(i.preventDefault(),this.open||this.show(),e.length>0&&this.updateComplete.then((()=>{"ArrowDown"!==i.key&&"Home"!==i.key||(t.setCurrentItem(s),s.focus()),"ArrowUp"!==i.key&&"End"!==i.key||(t.setCurrentItem(o),o.focus())})))}}handleTriggerKeyUp(i){" "===i.key&&i.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const i=this.trigger.assignedElements({flatten:!0}).find((i=>c(i).start));let t;if(i){switch(i.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":t=i.button;break;default:t=i}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,m(this,"nile-after-show")}async hide(){if(this.open)return this.open=!1,m(this,"nile-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}async handleOpenChange(){if(this.visibilityManager?.setup(),this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){this.emit("nile-show"),this.addOpenListeners(),await r(this),this.panel.hidden=!1,this.popup.active=!0;const{keyframes:i,options:t}=p(this,"dropdown.show",{dir:""});await l(this.popup.popup,i,t),this.emit("nile-after-show")}else{this.emit("nile-hide"),this.removeOpenListeners(),this.visibilityManager?.cleanup(),await r(this);const{keyframes:i,options:t}=p(this,"dropdown.hide",{dir:""});await l(this.popup.popup,i,t),this.panel.hidden=!0,this.popup.active=!1,this.emit("nile-after-hide")}}render(){return t`
|
|
2
2
|
<nile-popup
|
|
3
3
|
part="base"
|
|
4
4
|
id="sidebar-action-dropdown"
|
|
@@ -31,4 +31,4 @@ import{__decorate as t}from"tslib";import{html as i}from"lit";import{query as s,
|
|
|
31
31
|
aria-labelledby="sidebar-action-dropdown"
|
|
32
32
|
></slot>
|
|
33
33
|
</nile-popup>
|
|
34
|
-
`}};w.styles=[h],
|
|
34
|
+
`}};w.styles=[h],i([e(".dropdown")],w.prototype,"popup",void 0),i([e(".dropdown__trigger")],w.prototype,"trigger",void 0),i([e(".dropdown__panel")],w.prototype,"panel",void 0),i([s({type:Boolean,reflect:!0})],w.prototype,"open",void 0),i([s({reflect:!0})],w.prototype,"placement",void 0),i([s({type:Boolean,reflect:!0})],w.prototype,"disabled",void 0),i([s({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],w.prototype,"stayOpenOnSelect",void 0),i([s({attribute:!1})],w.prototype,"containingElement",void 0),i([s({type:Number})],w.prototype,"distance",void 0),i([s({type:Number})],w.prototype,"skidding",void 0),i([s()],w.prototype,"sync",void 0),i([s({type:Boolean})],w.prototype,"hoist",void 0),i([s({reflect:!0})],w.prototype,"triggerDropdown",void 0),i([s({type:Boolean,reflect:!0})],w.prototype,"enableVisibilityEffect",void 0),i([s({type:Boolean,reflect:!0})],w.prototype,"enableTabClose",void 0),i([u("open",{waitUntilFirstUpdate:!0})],w.prototype,"handleOpenChange",null),w=i([o("nile-side-bar-action")],w),d("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),d("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});export{w as N};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["lit"],function(_export,_context){"use strict";var
|
|
1
|
+
System.register(["lit"],function(_export,_context){"use strict";var o,_templateObject,t;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){o=_lit.css;}],execute:function execute(){_export("s",t=o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n display: block;\n width: 100%;\n }\n\n .footer-item {\n display: flex;\n align-items: center;\n\tjustify-content: flex-start;\n padding-top: var(--nile-spacing-md);\n padding-bottom: var(--nile-spacing-md);\n padding-left: var(--nile-spacing-lg);\n padding-right: var(--nile-spacing-lg);\n font-size: var(--nile-type-scale-3);\n color: var(--nile-side-bar-footer-color, #374151);\n cursor: pointer;\n border-radius: var(--nile-side-bar-footer-radius, 0.375rem);\n transition: background 0.2s ease;\n width: 100%;\n box-sizing: border-box;\n overflow: hidden;\n line-height: 0;\n }\n\n .footer-item:hover {\n background: var(--nile-side-bar-footer-hover-bg, #f3f4f6);\n }\n\n /* left: icon */\n ::slotted([slot='icon']) {\n flex-shrink: 0;\n font-size: 1.25rem;\n margin-right: 0.5rem;\n }\n\n /* middle: text */\n ::slotted([slot='text']) {\n flex-grow: 1;\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n /* right: action */\n ::slotted([slot='action']) {\n flex-shrink: 0;\n font-size: 1.25rem;\n color: var(--nile-side-bar-footer-icon-color, #6b7280);\n margin-left: auto;\n }\n\n \n :host([type='support']) .footer-item {\n background: var(--nile-colors-neutral-400);\n height: 38px;\n }\n :host([type='support']) .footer-item:hover{\n background: var(--nile-colors-neutral-500); \n }\n\n :host([type='support'][active]) .footer-item {\n background: var(--nile-colors-neutral-500);\n}\n \n \n \n :host([collapsed][type='avatar']) .footer-item {\n padding: 3px;\n \n}\n \n:host([collapsed][type='avatar']) ::slotted([slot='text']),\n:host([collapsed][type='avatar']) ::slotted([slot='action']) {\n display: none;\n}\n\n:host([collapsed]) .footer-item{\n height: 38px;\n width: 38px;\n}\n\n\n\n\n\n"]))));}};});
|
|
2
2
|
//# sourceMappingURL=nile-side-bar-footer-item.css.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-side-bar-footer-item.css.cjs.js","sources":["../../../src/nile-side-bar-footer-item/nile-side-bar-footer-item.css.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n :host {\n display: block;\n width: 100%;\n }\n\n .footer-item {\n display: flex;\n align-items: center;\n\tjustify-content: flex-start;\n padding-top: var(--nile-spacing-md);\n padding-bottom: var(--nile-spacing-md);\n padding-left: var(--nile-spacing-lg);\n padding-right: var(--nile-spacing-lg);\n font-size: var(--nile-type-scale-3);\n color: var(--nile-side-bar-footer-color, #374151);\n cursor: pointer;\n border-radius: var(--nile-side-bar-footer-radius, 0.375rem);\n transition: background 0.2s ease;\n width: 100%;\n box-sizing: border-box;\n overflow: hidden;\n line-height: 0;\n }\n\n .footer-item:hover {\n background: var(--nile-side-bar-footer-hover-bg, #f3f4f6);\n }\n\n /* left: icon */\n ::slotted([slot='icon']) {\n flex-shrink: 0;\n font-size: 1.25rem;\n margin-right: 0.5rem;\n }\n\n /* middle: text */\n ::slotted([slot='text']) {\n flex-grow: 1;\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n /* right: action */\n ::slotted([slot='action']) {\n flex-shrink: 0;\n font-size: 1.25rem;\n color: var(--nile-side-bar-footer-icon-color, #6b7280);\n margin-left: auto;\n }\n\n \n :host([type='support']) .footer-item {\n background: var(--nile-colors-neutral-400);\n height: 38px;\n }\n :host([type='support'][active]) .footer-item {\n background: var(--nile-colors-neutral-500);\n}\n \n \n \n :host([collapsed][type='avatar']) .footer-item {\n padding: 3px;\n \n}\n \n:host([collapsed][type='avatar']) ::slotted([slot='text']),\n:host([collapsed][type='avatar']) ::slotted([slot='action']) {\n display: none;\n}\n\n:host([collapsed]) .footer-item{\n height: 38px;\n width: 38px;\n}\n\n\n\n\n\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAEaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
|
1
|
+
{"version":3,"file":"nile-side-bar-footer-item.css.cjs.js","sources":["../../../src/nile-side-bar-footer-item/nile-side-bar-footer-item.css.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n :host {\n display: block;\n width: 100%;\n }\n\n .footer-item {\n display: flex;\n align-items: center;\n\tjustify-content: flex-start;\n padding-top: var(--nile-spacing-md);\n padding-bottom: var(--nile-spacing-md);\n padding-left: var(--nile-spacing-lg);\n padding-right: var(--nile-spacing-lg);\n font-size: var(--nile-type-scale-3);\n color: var(--nile-side-bar-footer-color, #374151);\n cursor: pointer;\n border-radius: var(--nile-side-bar-footer-radius, 0.375rem);\n transition: background 0.2s ease;\n width: 100%;\n box-sizing: border-box;\n overflow: hidden;\n line-height: 0;\n }\n\n .footer-item:hover {\n background: var(--nile-side-bar-footer-hover-bg, #f3f4f6);\n }\n\n /* left: icon */\n ::slotted([slot='icon']) {\n flex-shrink: 0;\n font-size: 1.25rem;\n margin-right: 0.5rem;\n }\n\n /* middle: text */\n ::slotted([slot='text']) {\n flex-grow: 1;\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n /* right: action */\n ::slotted([slot='action']) {\n flex-shrink: 0;\n font-size: 1.25rem;\n color: var(--nile-side-bar-footer-icon-color, #6b7280);\n margin-left: auto;\n }\n\n \n :host([type='support']) .footer-item {\n background: var(--nile-colors-neutral-400);\n height: 38px;\n }\n :host([type='support']) .footer-item:hover{\n background: var(--nile-colors-neutral-500); \n }\n\n :host([type='support'][active]) .footer-item {\n background: var(--nile-colors-neutral-500);\n}\n \n \n \n :host([collapsed][type='avatar']) .footer-item {\n padding: 3px;\n \n}\n \n:host([collapsed][type='avatar']) ::slotted([slot='text']),\n:host([collapsed][type='avatar']) ::slotted([slot='action']) {\n display: none;\n}\n\n:host([collapsed]) .footer-item{\n height: 38px;\n width: 38px;\n}\n\n\n\n\n\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAEaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{css as
|
|
1
|
+
import{css as o}from"lit";const t=o`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
width: 100%;
|
|
@@ -56,6 +56,10 @@ import{css as t}from"lit";const o=t`
|
|
|
56
56
|
background: var(--nile-colors-neutral-400);
|
|
57
57
|
height: 38px;
|
|
58
58
|
}
|
|
59
|
+
:host([type='support']) .footer-item:hover{
|
|
60
|
+
background: var(--nile-colors-neutral-500);
|
|
61
|
+
}
|
|
62
|
+
|
|
59
63
|
:host([type='support'][active]) .footer-item {
|
|
60
64
|
background: var(--nile-colors-neutral-500);
|
|
61
65
|
}
|
|
@@ -81,4 +85,4 @@ import{css as t}from"lit";const o=t`
|
|
|
81
85
|
|
|
82
86
|
|
|
83
87
|
|
|
84
|
-
`;export{
|
|
88
|
+
`;export{t as s};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import { CSSResultArray, TemplateResult } from 'lit';
|
|
7
|
+
import { CSSResultArray, TemplateResult, PropertyValues } from 'lit';
|
|
8
8
|
import NileElement from '../internal/nile-element';
|
|
9
9
|
import type { NileMenu } from '../nile-menu';
|
|
10
10
|
import type { NilePopup } from '../nile-popup';
|
|
@@ -46,8 +46,11 @@ export declare class NileSideBarAction extends NileElement {
|
|
|
46
46
|
hoist: boolean;
|
|
47
47
|
triggerDropdown: 'click' | 'hover';
|
|
48
48
|
private hoverTimeout;
|
|
49
|
+
enableVisibilityEffect: boolean;
|
|
50
|
+
enableTabClose: boolean;
|
|
51
|
+
private visibilityManager?;
|
|
49
52
|
connectedCallback(): void;
|
|
50
|
-
firstUpdated(): void
|
|
53
|
+
protected firstUpdated(_changed: PropertyValues): Promise<void>;
|
|
51
54
|
handleTriggerMouseEnter(): void;
|
|
52
55
|
handleTriggerMouseLeave(): void;
|
|
53
56
|
disconnectedCallback(): void;
|