@aquera/nile-elements 1.2.6-beta-1.1 → 1.2.6-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/README.md CHANGED
@@ -79,6 +79,9 @@ To run a local development server that serves the basic demo located in `demo/in
79
79
 
80
80
  In this section, you can find the updates for each release of `nile-elements`. It's a good practice to maintain detailed release notes to help users and developers understand what changes have been made from one version to another and how these changes might affect their projects.
81
81
 
82
+ #### Version 1.2.6
83
+ - Nile Virtual Select: Scroll Not going to Top while searching when Portal is true (UIF-1001).
84
+
82
85
  #### Version 1.2.5
83
86
  - Nile Virtual Select: search and scroll bar issue fixed (UIF-997, UIF-1000).
84
87
 
package/demo/index.html CHANGED
@@ -7,7 +7,32 @@
7
7
  <link rel="stylesheet" href="index.css" />
8
8
 
9
9
  <style>
10
+ nile-tag::part(content) {
11
+
10
12
 
13
+ text-overflow: ellipsis;
14
+ overflow: hidden;
15
+ white-space: nowrap;
16
+ display: block;
17
+ width: 50px;
18
+ }
19
+
20
+ nile-select::part(tag__content) {
21
+
22
+
23
+ text-overflow: ellipsis;
24
+ overflow: hidden;
25
+ white-space: nowrap;
26
+ display: block;
27
+ width: 50px;
28
+ background-color: red;
29
+ }
30
+
31
+ nile-tag::part(base) {
32
+ gap: 4px;
33
+ }
34
+
35
+
11
36
  </style>
12
37
  <script type="module" src="index.js"></script>
13
38
  </head>
@@ -25,21 +50,27 @@
25
50
  -->
26
51
 
27
52
 
28
- <nile-select class="virtual-scroll-string" placeholder="Please Select" multiple searchEnabled="true" enableVirtualScroll="true" portal >
29
- </nile-select>
30
-
31
- <script>
32
- const optionsString = Array.from({ length: 4}, (_, i) => `Option ${i + 1}`);
33
- const basicString = document.querySelector('nile-select.virtual-scroll-string');
34
- basicString.data = optionsString;
35
- document.addEventListener('nile-search', (event) => {
36
- console.log(event.detail);
37
- setTimeout(() => {
38
-
39
- console.log(basicString);
40
- }, 100);
41
- });
42
- </script>
53
+ <nile-chip
54
+ autoCompleteOptions='["React", "Angular", "Vue", "Tailwind"]'
55
+ acceptUserInput
56
+ ></nile-chip>
57
+
58
+
59
+ <nile-tag>Default Tag Lorem ipsum dolor sit amet consectetur adipisicing elit. Ad ipsam magnam dolor modi tempora numquam saepe, quo alias! Quae alias nisi voluptatum dolore itaque? Adipisci itaque doloremque, voluptas labore nemo debitis, quibusdam cupiditate dolorem dolores sequi impedit magni quia natus? Quis modi, sequi ipsa maiores ea voluptates. Qui sequi sed expedita natus nihil quod unde dolores laboriosam ad debitis odio impedit obcaecati perferendis eius, dolorum laudantium neque dignissimos totam repellat quo autem deserunt dolor? Dolor nam architecto vitae laborum aut repellat iusto dolore tempore possimus voluptatibus, eveniet mollitia hic odit eius deserunt nulla molestiae ipsum aspernatur sit dolorem perspiciatis voluptas!</nile-tag>
60
+
61
+
62
+ <script type="module" src="https://ui-cdn.dev.aqueralabs.com/nile-elements/latest/index.js"></script>
63
+
64
+
65
+
66
+ <nile-select class="virtual-scroll-string" placeholder="Please Select" searchEnabled="true" enableVirtualScroll="true" multiple>
67
+ </nile-select>
68
+
69
+ <script>
70
+ const optionsString = Array.from({ length: 100000 }, (_, i) => `Optiosdasndlkansdaskdnlasd asdn alsnda sdn asd asdasdn ${i + 1}`);
71
+ const basicString = document.querySelector('nile-select.virtual-scroll-string');
72
+ basicString.data = optionsString;
73
+ </script>
43
74
 
44
75
  </body>
45
76
  </html>
package/dist/index.js CHANGED
@@ -4715,6 +4715,7 @@ class mi{constructor(e){this._element=null;const t=e??window;this._node=t,e&&(th
4715
4715
  sync=${Ve(this.noWidthSync?void 0:"width")}
4716
4716
  auto-size="vertical"
4717
4717
  auto-size-padding="10"
4718
+ exportparts="tag__content"
4718
4719
  >
4719
4720
  ${this.renderCustomSelect(e)}
4720
4721
  ${this.renderCombobox(e,t)}
@@ -4970,7 +4971,8 @@ class mi{constructor(e){this._element=null;const t=e??window;this._node=t,e&&(th
4970
4971
  listbox,
4971
4972
  search,
4972
4973
  loader,
4973
- footer
4974
+ footer,
4975
+ tag__content
4974
4976
  "
4975
4977
  >
4976
4978
  <slot name="prefix" slot="prefix"></slot>
@@ -14090,7 +14092,7 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
14090
14092
 
14091
14093
 
14092
14094
 
14093
- `,IS={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 zS=class extends ae{constructor(){super(...arguments),this.value="",this.noStyles=!1,this.singleLineEditor=!1,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(),sS(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 M=t.getRangeAt(0);if(e.shiftKey){if(M.collapsed&&M.startContainer.nodeType===Node.TEXT_NODE){const e=M.startContainer,i=M.startOffset,n=e.data.slice(0,i),o=n.replace(/(\t|[ \u00a0]{2})$/,"");if(o.length!==n.length){e.data=o+e.data.slice(i);const M=document.createRange();M.setStart(e,o.length),M.collapse(!0),t.removeAllRanges(),t.addRange(M),this.updateContent(),this.updateToolbarState()}}return}M.deleteContents();const i=document.createTextNode("\t");M.insertNode(i);const n=document.createRange();n.setStartAfter(i),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(jS.cssText),this.ensureStructure(),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.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>")}unwrapMention(e,t=!0){const M=e.parentNode;if(!M)return;const i=t?(e.textContent??"").replace(/\u200B/g,""):"",n=document.createTextNode(i);M.insertBefore(n,e),M.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,M=t.getAttribute("data-mention-key"),i=t.getAttribute("data-mention-label"),n=t.getAttribute("data-mention-trigger")||"",o=(t.textContent??"").replace(/\u200B/g,"").trim(),r=!!M&&!!i&&o.length>0&&o.startsWith(n)&&o.includes(i);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 M=e.getAttribute("name")||"",i=e.getAttribute("label")||M,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="${i}"></nile-icon>`,e.innerHTML="";else if(o)t.innerHTML=e.innerHTML,e.innerHTML="";else{const n=IS[M];n?t.innerHTML=`<nile-icon name="${n}" size="20" color="black" aria-label="${i}"></nile-icon>`:t.textContent=i||M,e.innerHTML=""}if(!t.isConnected){const M=document.createElement("nile-tooltip");M.setAttribute("content",i),M.appendChild(t),e.appendChild(M)}t.setAttribute("aria-label",i),t.addEventListener("mousedown",(e=>e.preventDefault())),t.addEventListener("click",(()=>this.onToolbarCommand(M)));const r=this.buttonMap.get(M)??[];return r.push(t),void this.buttonMap.set(M,r)}if("nile-rte-select"!==t)"nile-rte-color"!==t||e.addEventListener("change",(e=>{this.focusAndRestore();const{mode:t,value:M}=e.detail;"backColor"===t?gS(this.editorEl,"backgroundColor",M,"data-rte-bg"):function(e,t){gS(e,"color",t,"data-rte-color")}(this.editorEl,M),this.updateContent(),this.updateToolbarState()}));else{const t=e.getAttribute("type")||"";e.addEventListener("change",(e=>{this.focusAndRestore();const M=e.detail;"heading"===t?function(e,t){const M=document.getSelection();if(!M||0===M.rangeCount)return;const i=oS(M.getRangeAt(0).startContainer,e);if(!i)return;if(i.tagName.toLowerCase()===t)return;const n=document.createElement(t);for(;i.firstChild;)n.appendChild(i.firstChild);i.replaceWith(n);const o=document.createRange();o.selectNodeContents(n),o.collapse(!0),M.removeAllRanges(),M.addRange(o)}(this.editorEl,M):"font"===t&&NS(this.editorEl,M),this.updateContent(),this.updateToolbarState()}))}}else e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;rS(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),M=this.lastRange.extractContents(),i=document.createElement("div");i.appendChild(M),Array.from(i.childNodes).forEach((e=>{if(e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim())return;const M=document.createElement("li");M.appendChild(e),t.appendChild(M)})),this.lastRange.insertNode(t),this.afterListEdit(t)}afterListEdit(e){const t=document.createRange();t.setStartAfter(e),t.collapse(!0);const M=window.getSelection();M?.removeAllRanges(),M?.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":sS(this.editorEl,"strong");break;case"italic":sS(this.editorEl,"em");break;case"underline":sS(this.editorEl,"u");break;case"left":rS(this.editorEl,"left");break;case"center":rS(this.editorEl,"center");break;case"right":rS(this.editorEl,"right");break;case"justify":rS(this.editorEl,"justify");break;case"ul":cS(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":cS(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 M=e.currentNode;M.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(M.tagName)&&t.push(M)}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 M=this.buttonMap.get(e);if(M)for(const e of M)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 M=function(e){for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e}(t.startContainer)||this.editorEl,i=getComputedStyle(M),n=oS(t.startContainer,this.editorEl)||this.editorEl,o=(()=>{let e=M;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("strong"===t||"b"===t)return!0;const M=getComputedStyle(e).fontWeight;if(parseInt(M,10)>=600)return!0}e=e.parentNode}return!1})(),r=(()=>{let e=M;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=M;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=!!M.closest("a"),N=n.style.textAlign||getComputedStyle(n).textAlign||"start",l="start"===N?"left":N,g=!!M.closest("li")&&M.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"===l&&!["center","right","justify"].includes(l)),this.setBtnActive("center","center"===l),this.setBtnActive("right","right"===l),this.setBtnActive("justify","justify"===l),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=(i.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=aS(i.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(M).backgroundColor;if(e&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e)){const t=aS(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.cloneNode(!0);if(this.noStyles)e.querySelectorAll("[style]").forEach((e=>e.removeAttribute("style")));else{const t=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),M=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),i=["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(;t.nextNode()&&M.nextNode();){const e=t.currentNode,n=M.currentNode,o=window.getComputedStyle(e),r=i.map((e=>`${e}:${o.getPropertyValue(e)}`)).join(";");r.trim()&&n.setAttribute("style",r)}}this.content=e.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}))}};e([ue({type:String,attribute:!0,reflect:!0})],zS.prototype,"value",void 0),e([ue({type:Boolean,attribute:!0,reflect:!0})],zS.prototype,"noStyles",void 0),e([ue({type:Boolean,attribute:"singlelineeditor",reflect:!0})],zS.prototype,"singleLineEditor",void 0),e([ue({attribute:"mentions",reflect:!0,converter:{fromAttribute:e=>{try{const t=JSON.parse(e),M={};for(const e of Object.keys(t)){const i=t[e];Array.isArray(i)&&(M[e]=i.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return M}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],zS.prototype,"mentions",void 0),e([ce()],zS.prototype,"content",void 0),zS=e([le("nile-rich-text-editor")],zS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.2.6-beta-1.1"',window.nileVersion="__NILE_VERSION__");const dS=r`
14095
+ `,IS={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 zS=class extends ae{constructor(){super(...arguments),this.value="",this.noStyles=!1,this.singleLineEditor=!1,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(),sS(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 M=t.getRangeAt(0);if(e.shiftKey){if(M.collapsed&&M.startContainer.nodeType===Node.TEXT_NODE){const e=M.startContainer,i=M.startOffset,n=e.data.slice(0,i),o=n.replace(/(\t|[ \u00a0]{2})$/,"");if(o.length!==n.length){e.data=o+e.data.slice(i);const M=document.createRange();M.setStart(e,o.length),M.collapse(!0),t.removeAllRanges(),t.addRange(M),this.updateContent(),this.updateToolbarState()}}return}M.deleteContents();const i=document.createTextNode("\t");M.insertNode(i);const n=document.createRange();n.setStartAfter(i),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(jS.cssText),this.ensureStructure(),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.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>")}unwrapMention(e,t=!0){const M=e.parentNode;if(!M)return;const i=t?(e.textContent??"").replace(/\u200B/g,""):"",n=document.createTextNode(i);M.insertBefore(n,e),M.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,M=t.getAttribute("data-mention-key"),i=t.getAttribute("data-mention-label"),n=t.getAttribute("data-mention-trigger")||"",o=(t.textContent??"").replace(/\u200B/g,"").trim(),r=!!M&&!!i&&o.length>0&&o.startsWith(n)&&o.includes(i);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 M=e.getAttribute("name")||"",i=e.getAttribute("label")||M,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="${i}"></nile-icon>`,e.innerHTML="";else if(o)t.innerHTML=e.innerHTML,e.innerHTML="";else{const n=IS[M];n?t.innerHTML=`<nile-icon name="${n}" size="20" color="black" aria-label="${i}"></nile-icon>`:t.textContent=i||M,e.innerHTML=""}if(!t.isConnected){const M=document.createElement("nile-tooltip");M.setAttribute("content",i),M.appendChild(t),e.appendChild(M)}t.setAttribute("aria-label",i),t.addEventListener("mousedown",(e=>e.preventDefault())),t.addEventListener("click",(()=>this.onToolbarCommand(M)));const r=this.buttonMap.get(M)??[];return r.push(t),void this.buttonMap.set(M,r)}if("nile-rte-select"!==t)"nile-rte-color"!==t||e.addEventListener("change",(e=>{this.focusAndRestore();const{mode:t,value:M}=e.detail;"backColor"===t?gS(this.editorEl,"backgroundColor",M,"data-rte-bg"):function(e,t){gS(e,"color",t,"data-rte-color")}(this.editorEl,M),this.updateContent(),this.updateToolbarState()}));else{const t=e.getAttribute("type")||"";e.addEventListener("change",(e=>{this.focusAndRestore();const M=e.detail;"heading"===t?function(e,t){const M=document.getSelection();if(!M||0===M.rangeCount)return;const i=oS(M.getRangeAt(0).startContainer,e);if(!i)return;if(i.tagName.toLowerCase()===t)return;const n=document.createElement(t);for(;i.firstChild;)n.appendChild(i.firstChild);i.replaceWith(n);const o=document.createRange();o.selectNodeContents(n),o.collapse(!0),M.removeAllRanges(),M.addRange(o)}(this.editorEl,M):"font"===t&&NS(this.editorEl,M),this.updateContent(),this.updateToolbarState()}))}}else e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;rS(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),M=this.lastRange.extractContents(),i=document.createElement("div");i.appendChild(M),Array.from(i.childNodes).forEach((e=>{if(e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim())return;const M=document.createElement("li");M.appendChild(e),t.appendChild(M)})),this.lastRange.insertNode(t),this.afterListEdit(t)}afterListEdit(e){const t=document.createRange();t.setStartAfter(e),t.collapse(!0);const M=window.getSelection();M?.removeAllRanges(),M?.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":sS(this.editorEl,"strong");break;case"italic":sS(this.editorEl,"em");break;case"underline":sS(this.editorEl,"u");break;case"left":rS(this.editorEl,"left");break;case"center":rS(this.editorEl,"center");break;case"right":rS(this.editorEl,"right");break;case"justify":rS(this.editorEl,"justify");break;case"ul":cS(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":cS(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 M=e.currentNode;M.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(M.tagName)&&t.push(M)}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 M=this.buttonMap.get(e);if(M)for(const e of M)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 M=function(e){for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e}(t.startContainer)||this.editorEl,i=getComputedStyle(M),n=oS(t.startContainer,this.editorEl)||this.editorEl,o=(()=>{let e=M;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("strong"===t||"b"===t)return!0;const M=getComputedStyle(e).fontWeight;if(parseInt(M,10)>=600)return!0}e=e.parentNode}return!1})(),r=(()=>{let e=M;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=M;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=!!M.closest("a"),N=n.style.textAlign||getComputedStyle(n).textAlign||"start",l="start"===N?"left":N,g=!!M.closest("li")&&M.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"===l&&!["center","right","justify"].includes(l)),this.setBtnActive("center","center"===l),this.setBtnActive("right","right"===l),this.setBtnActive("justify","justify"===l),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=(i.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=aS(i.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(M).backgroundColor;if(e&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e)){const t=aS(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.cloneNode(!0);if(this.noStyles)e.querySelectorAll("[style]").forEach((e=>e.removeAttribute("style")));else{const t=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),M=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),i=["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(;t.nextNode()&&M.nextNode();){const e=t.currentNode,n=M.currentNode,o=window.getComputedStyle(e),r=i.map((e=>`${e}:${o.getPropertyValue(e)}`)).join(";");r.trim()&&n.setAttribute("style",r)}}this.content=e.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}))}};e([ue({type:String,attribute:!0,reflect:!0})],zS.prototype,"value",void 0),e([ue({type:Boolean,attribute:!0,reflect:!0})],zS.prototype,"noStyles",void 0),e([ue({type:Boolean,attribute:"singlelineeditor",reflect:!0})],zS.prototype,"singleLineEditor",void 0),e([ue({attribute:"mentions",reflect:!0,converter:{fromAttribute:e=>{try{const t=JSON.parse(e),M={};for(const e of Object.keys(t)){const i=t[e];Array.isArray(i)&&(M[e]=i.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return M}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],zS.prototype,"mentions",void 0),e([ce()],zS.prototype,"content",void 0),zS=e([le("nile-rich-text-editor")],zS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.2.6-beta-1.4"',window.nileVersion="__NILE_VERSION__");const dS=r`
14094
14096
  :host {
14095
14097
  --sidebar-width: 240px;
14096
14098
  --sidebar-collapsed-width: 70px;
@@ -1,2 +1,2 @@
1
- System.register(["lit"],function(_export,_context){"use strict";var e,_templateObject,l;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);}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}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);}return{setters:[function(_lit){e=_lit.html;}],execute:function execute(){_export("V",l=/*#__PURE__*/function(){function l(e){_classCallCheck(this,l);this.component=e;}return _createClass(l,[{key:"renderVirtualizedContent",value:function renderVirtualizedContent(){var _l=this.component;return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"virtual-select\">\n <nile-virtual-select\n .name=","\n .value=","\n .autoResize=","\n .placeholder=","\n .size=","\n .searchEnabled=","\n .internalSearchPlaceHolder=","\n .disableLocalSearch=","\n .optionsLoading=","\n .multiple=","\n .helpText=","\n .errorMessage=","\n .warning=","\n .error=","\n .success=","\n .disabled=","\n .clearable=","\n .hoist=","\n .filled=","\n .pill=","\n .label=","\n .placement=","\n .form=","\n .required=","\n .showNoResults=","\n .noResultsMessage=","\n .renderItemConfig=","\n .blockValueChange=","\n .noWidthSync=","\n .maxOptionsVisible=","\n .data=","\n .open=","\n .loading=","\n .portal=","\n exportparts=\"\n select-options,\n select-no-results,\n virtualized,\n form-control,\n form-control-label,\n form-control-input,\n combobox,\n prefix,\n display-input,\n tags,\n tag,\n clear-button,\n suffix,\n expand-icon,\n listbox,\n search,\n loader,\n footer\n \"\n >\n <slot name=\"prefix\" slot=\"prefix\"></slot>\n </nile-virtual-select>\n </div>\n "])),_l.name,_l.value,_l.autoResize,_l.placeholder,_l.size,_l.searchEnabled,_l.internalSearchPlaceHolder,_l.disableLocalSearch,_l.optionsLoading,_l.multiple,_l.helpText,_l.errorMessage,_l.warning,_l.error,_l.success,_l.disabled,_l.clearable,_l.hoist,_l.filled,_l.pill,_l.label,_l.placement,_l.form,_l.required,_l.showNoResults,_l.noResultsMessage,_l.renderItemConfig,_l.blockValueChange,_l.noWidthSync,_l.maxOptionsVisible,_l.data,_l.open,_l.loading,_l.portal);}}]);}());}};});
1
+ System.register(["lit"],function(_export,_context){"use strict";var e,_templateObject,l;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);}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}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);}return{setters:[function(_lit){e=_lit.html;}],execute:function execute(){_export("V",l=/*#__PURE__*/function(){function l(e){_classCallCheck(this,l);this.component=e;}return _createClass(l,[{key:"renderVirtualizedContent",value:function renderVirtualizedContent(){var _l=this.component;return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"virtual-select\">\n <nile-virtual-select\n .name=","\n .value=","\n .autoResize=","\n .placeholder=","\n .size=","\n .searchEnabled=","\n .internalSearchPlaceHolder=","\n .disableLocalSearch=","\n .optionsLoading=","\n .multiple=","\n .helpText=","\n .errorMessage=","\n .warning=","\n .error=","\n .success=","\n .disabled=","\n .clearable=","\n .hoist=","\n .filled=","\n .pill=","\n .label=","\n .placement=","\n .form=","\n .required=","\n .showNoResults=","\n .noResultsMessage=","\n .renderItemConfig=","\n .blockValueChange=","\n .noWidthSync=","\n .maxOptionsVisible=","\n .data=","\n .open=","\n .loading=","\n .portal=","\n exportparts=\"\n select-options,\n select-no-results,\n virtualized,\n form-control,\n form-control-label,\n form-control-input,\n combobox,\n prefix,\n display-input,\n tags,\n tag,\n clear-button,\n suffix,\n expand-icon,\n listbox,\n search,\n loader,\n footer,\n tag__content \n \"\n >\n <slot name=\"prefix\" slot=\"prefix\"></slot>\n </nile-virtual-select>\n </div>\n "])),_l.name,_l.value,_l.autoResize,_l.placeholder,_l.size,_l.searchEnabled,_l.internalSearchPlaceHolder,_l.disableLocalSearch,_l.optionsLoading,_l.multiple,_l.helpText,_l.errorMessage,_l.warning,_l.error,_l.success,_l.disabled,_l.clearable,_l.hoist,_l.filled,_l.pill,_l.label,_l.placement,_l.form,_l.required,_l.showNoResults,_l.noResultsMessage,_l.renderItemConfig,_l.blockValueChange,_l.noWidthSync,_l.maxOptionsVisible,_l.data,_l.open,_l.loading,_l.portal);}}]);}());}};});
2
2
  //# sourceMappingURL=virtual-scroll-helper.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"virtual-scroll-helper.cjs.js","sources":["../../../src/nile-select/virtual-scroll-helper.ts"],"sourcesContent":["import { html } from 'lit';\nimport type NileElement from '../internal/nile-element';\n\n/**\n * Helper class to manage virtual scroll functionality for nile-select component\n */\nexport class VirtualScrollHelper {\n private component: NileElement;\n\n constructor(component: NileElement) {\n this.component = component;\n }\n\n renderVirtualizedContent(): any {\n const component = this.component as any;\n\n return html`\n <div class=\"virtual-select\">\n <nile-virtual-select\n .name=${component.name}\n .value=${component.value}\n .autoResize=${component.autoResize}\n .placeholder=${component.placeholder}\n .size=${component.size}\n .searchEnabled=${component.searchEnabled}\n .internalSearchPlaceHolder=${component.internalSearchPlaceHolder}\n .disableLocalSearch=${component.disableLocalSearch}\n .optionsLoading=${component.optionsLoading}\n .multiple=${component.multiple}\n .helpText=${component.helpText}\n .errorMessage=${component.errorMessage}\n .warning=${component.warning}\n .error=${component.error}\n .success=${component.success}\n .disabled=${component.disabled}\n .clearable=${component.clearable}\n .hoist=${component.hoist}\n .filled=${component.filled}\n .pill=${component.pill}\n .label=${component.label}\n .placement=${component.placement}\n .form=${component.form}\n .required=${component.required}\n .showNoResults=${component.showNoResults}\n .noResultsMessage=${component.noResultsMessage}\n .renderItemConfig=${component.renderItemConfig}\n .blockValueChange=${component.blockValueChange}\n .noWidthSync=${component.noWidthSync}\n .maxOptionsVisible=${component.maxOptionsVisible}\n .data=${component.data}\n .open=${component.open}\n .loading=${component.loading}\n .portal=${component.portal}\n exportparts=\"\n select-options,\n select-no-results,\n virtualized,\n form-control,\n form-control-label,\n form-control-input,\n combobox,\n prefix,\n display-input,\n tags,\n tag,\n clear-button,\n suffix,\n expand-icon,\n listbox,\n search,\n loader,\n footer\n \"\n >\n <slot name=\"prefix\" slot=\"prefix\"></slot>\n </nile-virtual-select>\n </div>\n `;\n }\n}\n"],"names":["VirtualScrollHelper","l","component","this","_createClass","key","value","renderVirtualizedContent","html","_templateObject","_taggedTemplateLiteral","name","autoResize","placeholder","size","searchEnabled","internalSearchPlaceHolder","disableLocalSearch","optionsLoading","multiple","helpText","errorMessage","warning","error","success","disabled","clearable","hoist","filled","pill","label","placement","form","required","showNoResults","noResultsMessage","renderItemConfig","blockValueChange","noWidthSync","maxOptionsVisible","data","open","loading","portal"],"mappings":"w4CAMaA,CAAAA,yBAGX,SAAAC,EAAYC,2BACVC,IAAKD,CAAAA,SAAAA,CAAYA,CAClB,EAED,OAAAE,YAAA,CAAAH,CAAA,GAAAI,GAAA,4BAAAC,KAAA,UAAAC,wBAAAA,CAAAA,CACE,CAAA,GAAML,CAAAA,GAAYC,IAAKD,CAAAA,SAAAA,CAEvB,MAAOM,CAAAA,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,4iDAGGR,EAAUS,CAAAA,IAAAA,CACTT,EAAUI,CAAAA,KAAAA,CACLJ,EAAUU,CAAAA,UAAAA,CACTV,EAAUW,CAAAA,WAAAA,CACjBX,EAAUY,CAAAA,IAAAA,CACDZ,EAAUa,CAAAA,aAAAA,CACEb,EAAUc,CAAAA,yBAAAA,CACjBd,EAAUe,CAAAA,kBAAAA,CACdf,EAAUgB,CAAAA,cAAAA,CAChBhB,EAAUiB,CAAAA,QAAAA,CACVjB,EAAUkB,CAAAA,QAAAA,CACNlB,EAAUmB,CAAAA,YAAAA,CACfnB,EAAUoB,CAAAA,OAAAA,CACZpB,EAAUqB,CAAAA,KAAAA,CACRrB,EAAUsB,CAAAA,OAAAA,CACTtB,EAAUuB,CAAAA,QAAAA,CACTvB,EAAUwB,CAAAA,SAAAA,CACdxB,EAAUyB,CAAAA,KAAAA,CACTzB,EAAU0B,CAAAA,MAAAA,CACZ1B,EAAU2B,CAAAA,IAAAA,CACT3B,EAAU4B,CAAAA,KAAAA,CACN5B,EAAU6B,CAAAA,SAAAA,CACf7B,EAAU8B,CAAAA,IAAAA,CACN9B,EAAU+B,CAAAA,QAAAA,CACL/B,EAAUgC,CAAAA,aAAAA,CACPhC,EAAUiC,CAAAA,gBAAAA,CACVjC,EAAUkC,CAAAA,gBAAAA,CACVlC,EAAUmC,CAAAA,gBAAAA,CACfnC,EAAUoC,CAAAA,WAAAA,CACJpC,EAAUqC,CAAAA,iBAAAA,CACvBrC,EAAUsC,CAAAA,IAAAA,CACVtC,EAAUuC,CAAAA,IAAAA,CACPvC,EAAUwC,CAAAA,OAAAA,CACXxC,EAAUyC,CAAAA,MAAAA,EA0B3B"}
1
+ {"version":3,"file":"virtual-scroll-helper.cjs.js","sources":["../../../src/nile-select/virtual-scroll-helper.ts"],"sourcesContent":["import { html } from 'lit';\nimport type NileElement from '../internal/nile-element';\n\n/**\n * Helper class to manage virtual scroll functionality for nile-select component\n */\nexport class VirtualScrollHelper {\n private component: NileElement;\n\n constructor(component: NileElement) {\n this.component = component;\n }\n\n renderVirtualizedContent(): any {\n const component = this.component as any;\n\n return html`\n <div class=\"virtual-select\">\n <nile-virtual-select\n .name=${component.name}\n .value=${component.value}\n .autoResize=${component.autoResize}\n .placeholder=${component.placeholder}\n .size=${component.size}\n .searchEnabled=${component.searchEnabled}\n .internalSearchPlaceHolder=${component.internalSearchPlaceHolder}\n .disableLocalSearch=${component.disableLocalSearch}\n .optionsLoading=${component.optionsLoading}\n .multiple=${component.multiple}\n .helpText=${component.helpText}\n .errorMessage=${component.errorMessage}\n .warning=${component.warning}\n .error=${component.error}\n .success=${component.success}\n .disabled=${component.disabled}\n .clearable=${component.clearable}\n .hoist=${component.hoist}\n .filled=${component.filled}\n .pill=${component.pill}\n .label=${component.label}\n .placement=${component.placement}\n .form=${component.form}\n .required=${component.required}\n .showNoResults=${component.showNoResults}\n .noResultsMessage=${component.noResultsMessage}\n .renderItemConfig=${component.renderItemConfig}\n .blockValueChange=${component.blockValueChange}\n .noWidthSync=${component.noWidthSync}\n .maxOptionsVisible=${component.maxOptionsVisible}\n .data=${component.data}\n .open=${component.open}\n .loading=${component.loading}\n .portal=${component.portal}\n exportparts=\"\n select-options,\n select-no-results,\n virtualized,\n form-control,\n form-control-label,\n form-control-input,\n combobox,\n prefix,\n display-input,\n tags,\n tag,\n clear-button,\n suffix,\n expand-icon,\n listbox,\n search,\n loader,\n footer,\n tag__content \n \"\n >\n <slot name=\"prefix\" slot=\"prefix\"></slot>\n </nile-virtual-select>\n </div>\n `;\n }\n}\n"],"names":["VirtualScrollHelper","l","component","this","_createClass","key","value","renderVirtualizedContent","html","_templateObject","_taggedTemplateLiteral","name","autoResize","placeholder","size","searchEnabled","internalSearchPlaceHolder","disableLocalSearch","optionsLoading","multiple","helpText","errorMessage","warning","error","success","disabled","clearable","hoist","filled","pill","label","placement","form","required","showNoResults","noResultsMessage","renderItemConfig","blockValueChange","noWidthSync","maxOptionsVisible","data","open","loading","portal"],"mappings":"w4CAMaA,CAAAA,yBAGX,SAAAC,EAAYC,2BACVC,IAAKD,CAAAA,SAAAA,CAAYA,CAClB,EAED,OAAAE,YAAA,CAAAH,CAAA,GAAAI,GAAA,4BAAAC,KAAA,UAAAC,wBAAAA,CAAAA,CACE,CAAA,GAAML,CAAAA,GAAYC,IAAKD,CAAAA,SAAAA,CAEvB,MAAOM,CAAAA,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,wkDAGGR,EAAUS,CAAAA,IAAAA,CACTT,EAAUI,CAAAA,KAAAA,CACLJ,EAAUU,CAAAA,UAAAA,CACTV,EAAUW,CAAAA,WAAAA,CACjBX,EAAUY,CAAAA,IAAAA,CACDZ,EAAUa,CAAAA,aAAAA,CACEb,EAAUc,CAAAA,yBAAAA,CACjBd,EAAUe,CAAAA,kBAAAA,CACdf,EAAUgB,CAAAA,cAAAA,CAChBhB,EAAUiB,CAAAA,QAAAA,CACVjB,EAAUkB,CAAAA,QAAAA,CACNlB,EAAUmB,CAAAA,YAAAA,CACfnB,EAAUoB,CAAAA,OAAAA,CACZpB,EAAUqB,CAAAA,KAAAA,CACRrB,EAAUsB,CAAAA,OAAAA,CACTtB,EAAUuB,CAAAA,QAAAA,CACTvB,EAAUwB,CAAAA,SAAAA,CACdxB,EAAUyB,CAAAA,KAAAA,CACTzB,EAAU0B,CAAAA,MAAAA,CACZ1B,EAAU2B,CAAAA,IAAAA,CACT3B,EAAU4B,CAAAA,KAAAA,CACN5B,EAAU6B,CAAAA,SAAAA,CACf7B,EAAU8B,CAAAA,IAAAA,CACN9B,EAAU+B,CAAAA,QAAAA,CACL/B,EAAUgC,CAAAA,aAAAA,CACPhC,EAAUiC,CAAAA,gBAAAA,CACVjC,EAAUkC,CAAAA,gBAAAA,CACVlC,EAAUmC,CAAAA,gBAAAA,CACfnC,EAAUoC,CAAAA,WAAAA,CACJpC,EAAUqC,CAAAA,iBAAAA,CACvBrC,EAAUsC,CAAAA,IAAAA,CACVtC,EAAUuC,CAAAA,IAAAA,CACPvC,EAAUwC,CAAAA,OAAAA,CACXxC,EAAUyC,CAAAA,MAAAA,EA2B3B"}
@@ -53,7 +53,8 @@ import{html as e}from"lit";class l{constructor(e){this.component=e}renderVirtual
53
53
  listbox,
54
54
  search,
55
55
  loader,
56
- footer
56
+ footer,
57
+ tag__content
57
58
  "
58
59
  >
59
60
  <slot name="prefix" slot="prefix"></slot>
@@ -2,5 +2,5 @@ System.register(["tslib","lit","lit/decorators.js","./nile-virtual-select.css.cj
2
2
  * @license
3
3
  * Copyright 2021 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */_export("t",x=/*#__PURE__*/function(){function x(i,_ref){var _this=this;var s=_ref.target,n=_ref.config,o=_ref.callback,c=_ref.skipInitial;_classCallCheck(this,x);this.t=new Set(),this.o=!1,this.i=!1,this.h=i,null!==s&&this.t.add(s!==null&&s!==void 0?s:i),this.l=n,this.o=c!==null&&c!==void 0?c:this.o,this.callback=o,window.ResizeObserver?(this.u=new ResizeObserver(function(i){_this.handleChanges(i),_this.h.requestUpdate();}),i.addController(this)):console.warn("ResizeController error: browser does not support ResizeObserver.");}return _createClass(x,[{key:"handleChanges",value:function handleChanges(i){var _this$callback;this.value=(_this$callback=this.callback)===null||_this$callback===void 0?void 0:_this$callback.call(this,i,this.u);}},{key:"hostConnected",value:function hostConnected(){var _iterator=_createForOfIteratorHelper(this.t),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _i=_step.value;this.observe(_i);}}catch(err){_iterator.e(err);}finally{_iterator.f();}}},{key:"hostDisconnected",value:function hostDisconnected(){this.disconnect();}},{key:"hostUpdated",value:function(){var _hostUpdated=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:!this.o&&this.i&&this.handleChanges([]),this.i=!1;case 1:case"end":return _context2.stop();}},_callee,this);}));function hostUpdated(){return _hostUpdated.apply(this,arguments);}return hostUpdated;}()},{key:"observe",value:function observe(i){this.t.add(i),this.u.observe(i,this.l),this.i=!0,this.h.requestUpdate();}},{key:"unobserve",value:function unobserve(i){this.t["delete"](i),this.u.unobserve(i);}},{key:"disconnect",value:function disconnect(){this.u.disconnect();}}]);}());_export("N",k=/*#__PURE__*/function(_u){function k(){var _this2;_classCallCheck(this,k);_this2=_callSuper(this,k,arguments),_this2.formControlController=new p(_assertThisInitialized(_this2),{assumeInteractionOn:["nile-blur","nile-input"]}),_this2.hasSlotController=new h(_assertThisInitialized(_this2),"help-text","label"),_this2.portalManager=new _(_assertThisInitialized(_this2)),_this2.hasFocus=!1,_this2.displayLabel="",_this2.selectedOptions=[],_this2.oldValue="",_this2.scrolling=!1,_this2.name="",_this2.data=[],_this2.originalOptionItems=[],_this2.value="",_this2.defaultValue="",_this2.size="medium",_this2.placeholder="Select...",_this2.autoResize=!1,_this2.searchValue="",_this2.searchEnabled=!1,_this2.internalSearchPlaceHolder="Search...",_this2.disableLocalSearch=!1,_this2.optionsLoading=!1,_this2.loading=!1,_this2.multiple=!1,_this2.helpText="",_this2.errorMessage="",_this2.warning=!1,_this2.error=!1,_this2.success=!1,_this2.disabled=!1,_this2.clearable=!1,_this2.open=!1,_this2.hoist=!1,_this2.filled=!1,_this2.pill=!1,_this2.label="",_this2.placement="bottom",_this2.form="",_this2.required=!1,_this2.showNoResults=!1,_this2.noResultsMessage="No results found",_this2.showSelected=!1,_this2.blockValueChange=!1,_this2.noWidthSync=!1,_this2.portal=!1,_this2.maxOptionsVisible=3,_this2.oldMaxOptionsVisible=1,_this2.showListbox=!1,_this2.wasShowSelectedCheckedOnClose=!1,_this2.handleDocumentMouseDown=function(i){if(!_this2.open)return;var s=i.composedPath(),n=s.includes(_assertThisInitialized(_this2)),o=_this2.popup&&s.includes(_this2.popup),c=_this2.portal&&_this2.portalManager.portalContainerElement&&s.includes(_this2.portalManager.portalContainerElement);n||o||c||_this2.hide();},_this2.handleWindowError=function(i){var _i$error;(((_i$error=i.error)===null||_i$error===void 0?void 0:_i$error.message)||i.message||"").includes("Cannot read properties of null (reading 'insertBefore')")&&i.preventDefault();},_this2.handleWindowResize=function(){_this2.portalManager.updatePortalAppendPosition();},_this2.handleWindowScroll=function(){_this2.portalManager.updatePortalAppendPosition();},_this2.resizeController=new x(_assertThisInitialized(_this2),{callback:function callback(i){var _iterator2=_createForOfIteratorHelper(i),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _s=_step2.value;_s.target.classList.contains("select__tags")&&_this2.calculateTotalWidthOfTags();}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}});return _this2;}_inherits(k,_u);return _createClass(k,[{key:"validity",get:function get(){var _this$valueInput;return(_this$valueInput=this.valueInput)===null||_this$valueInput===void 0?void 0:_this$valueInput.validity;}},{key:"validationMessage",get:function get(){var _this$valueInput$vali,_this$valueInput2;return(_this$valueInput$vali=(_this$valueInput2=this.valueInput)===null||_this$valueInput2===void 0?void 0:_this$valueInput2.validationMessage)!==null&&_this$valueInput$vali!==void 0?_this$valueInput$vali:"";}},{key:"connectedCallback",value:function connectedCallback(){var _this3=this;_superPropGet(k,"connectedCallback",this,3)([]),this.initializeComponent(),this.setupEventListeners(),this.updateComplete.then(function(){_this3.value&&_this3.data.length>0&&_this3.selectionChanged();});}},{key:"disconnectedCallback",value:function disconnectedCallback(){this.removeOpenListeners(),this.scrollTimeout&&(clearTimeout(this.scrollTimeout),this.scrollTimeout=void 0),this.portalManager.cleanupPortalAppend();}},{key:"updated",value:function updated(i){if(i.has("value")&&this.selectionChanged(),i.has("autoResize")){var _this$shadowRoot;var _i2=(_this$shadowRoot=this.shadowRoot)===null||_this$shadowRoot===void 0?void 0:_this$shadowRoot.querySelector(".select__tags");this.autoResize&&_i2?this.resizeController.observe(_i2):_i2&&this.resizeController.unobserve(_i2);}}},{key:"initializeComponent",value:function initializeComponent(){this.open=!1,this.emit("nile-init");}},{key:"getDisplayText",value:function getDisplayText(i){var _this$renderItemConfi;return(_this$renderItemConfi=this.renderItemConfig)!==null&&_this$renderItemConfi!==void 0&&_this$renderItemConfi.getDisplayText?this.renderItemConfig.getDisplayText(i):(i===null||i===void 0?void 0:i.label)||(i===null||i===void 0?void 0:i.name)||(i===null||i===void 0?void 0:i.toString())||"";}},{key:"getItemValue",value:function getItemValue(i){var _this$renderItemConfi2;return(_this$renderItemConfi2=this.renderItemConfig)!==null&&_this$renderItemConfi2!==void 0&&_this$renderItemConfi2.getValue?this.renderItemConfig.getValue(i):(i===null||i===void 0?void 0:i.value)||i;}},{key:"getSearchText",value:function getSearchText(i){var _this$renderItemConfi3;return(_this$renderItemConfi3=this.renderItemConfig)!==null&&_this$renderItemConfi3!==void 0&&_this$renderItemConfi3.getSearchText?this.renderItemConfig.getSearchText(i):this.getDisplayText(i);}},{key:"setupEventListeners",value:function setupEventListeners(){this.handleDocumentFocusIn=this.handleDocumentFocusIn.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleWindowError=this.handleWindowError.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.handleWindowScroll=this.handleWindowScroll.bind(this);}},{key:"addOpenListeners",value:function addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown),window.addEventListener("error",this.handleWindowError),this.portal&&(window.addEventListener("resize",this.handleWindowResize),window.addEventListener("scroll",this.handleWindowScroll,!0));}},{key:"removeOpenListeners",value:function removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown),window.removeEventListener("error",this.handleWindowError),window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("scroll",this.handleWindowScroll,!0);}},{key:"handleFocus",value:function handleFocus(){this.hasFocus=!0,this.emit("nile-focus");}},{key:"handleBlur",value:function handleBlur(){this.hasFocus=!1,this.emit("nile-blur");}},{key:"handleDocumentFocusIn",value:function handleDocumentFocusIn(i){if(!this.open)return;var s=i.composedPath(),n=s.includes(this),o=this.popup&&s.includes(this.popup),c=this.portal&&this.portalManager.portalContainerElement&&s.includes(this.portalManager.portalContainerElement);n||o||c||this.hide();}},{key:"handleDocumentKeyDown",value:function handleDocumentKeyDown(i){this.shouldIgnoreKeyPress(i)||(this.isEscapeKey(i)&&this.handleEscapeKey(i),this.isEnterOrSpaceKey(i)&&this.handleEnterOrSpaceKey(i));}},{key:"shouldIgnoreKeyPress",value:function shouldIgnoreKeyPress(i){var s=i.target,n=null!==s.closest(".select__clear"),o=null!==s.closest("nile-icon-button");return n||o;}},{key:"isEscapeKey",value:function isEscapeKey(i){return"Escape"===i.key&&this.open;}},{key:"handleEscapeKey",value:function handleEscapeKey(i){i.preventDefault(),i.stopPropagation(),this.hide(),this.displayInput.focus({preventScroll:!0});}},{key:"isEnterOrSpaceKey",value:function isEnterOrSpaceKey(i){return"Enter"===i.key||" "===i.key;}},{key:"handleEnterOrSpaceKey",value:function handleEnterOrSpaceKey(i){i.preventDefault(),i.stopImmediatePropagation(),this.open?this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})):this.show();}},{key:"handleFooterClick",value:function handleFooterClick(i){i.stopPropagation(),i.preventDefault();}},{key:"toggleShowSelected",value:function toggleShowSelected(i){var _this$selectedOptions,_this4=this;if(i.stopPropagation(),i.preventDefault(),0!==((_this$selectedOptions=this.selectedOptions)===null||_this$selectedOptions===void 0?void 0:_this$selectedOptions.length)){if(this.showSelected=!this.showSelected,this.showSelected){this.searchValue="";var _i3=Array.isArray(this.value)?this.value:[this.value];this.data=this.originalOptionItems.filter(function(s){var n=_this4.getItemValue(s);return _i3.some(function(i){return String(i)===String(n);});});}else this.data=_toConsumableArray(this.originalOptionItems);this.portalManager.resetMeasuredHeight(),this.requestUpdate(),this.repaintOptionsContainer();}}},{key:"unSelectAll",value:function unSelectAll(){this.showSelected=!1,this.value=this.multiple?[]:"",this.data=_toConsumableArray(this.originalOptionItems),this.selectionChanged(),this.emit("nile-change",{value:this.value,name:this.name}),this.emit("nile-clear",{value:this.multiple?this.value:"",name:this.name}),this.resetScrollPosition();}},{key:"handleLabelClick",value:function handleLabelClick(){this.displayInput.focus(),this.hide();}},{key:"handleComboboxMouseDown",value:function handleComboboxMouseDown(i){this.shouldIgnoreComboboxClick(i)||(i.preventDefault(),this.displayInput.focus({preventScroll:!0}),this.open=!this.open);}},{key:"shouldIgnoreComboboxClick",value:function shouldIgnoreComboboxClick(i){var s=i.composedPath().some(function(i){return i instanceof Element&&"nile-icon-button"===i.tagName.toLowerCase();});return this.disabled||s;}},{key:"handleComboboxKeyDown",value:function handleComboboxKeyDown(i){this.isEnterOrSpaceKey(i)&&(i.preventDefault(),this.open=!this.open);}},{key:"handleClearClick",value:function handleClearClick(i){i.stopPropagation(),this.clearSelection();}},{key:"clearSelection",value:function clearSelection(){var _this5=this;this.value,this.value=this.multiple?[]:"",this.selectionChanged(),this.updateComplete.then(function(){_this5.nileInput({value:_this5.value,name:_this5.name}),_this5.nileChange({value:_this5.value,name:_this5.name}),_this5.emit("nile-clear");});}},{key:"handleClearMouseDown",value:function handleClearMouseDown(i){i.stopPropagation();}},{key:"handleOptionClick",value:function handleOptionClick(i){var s=i.target.closest("nile-option");if(this.shouldBlockValueChange(s))return;var n=this.value;this.oldValue=n,s&&!s.disabled&&this.handleOptionSelection(s);}},{key:"shouldBlockValueChange",value:function shouldBlockValueChange(i){return!(!this.blockValueChange||!i)&&(this.emit("nile-block-change",{value:i===null||i===void 0?void 0:i.value,name:this.name}),this.hide(),!0);}},{key:"handleOptionSelection",value:function handleOptionSelection(i){var _this6=this;var s=i.value;this.multiple?this.toggleOptionSelection(s):this.setSelectedOptions(s),this.updateComplete.then(function(){return _this6.displayInput.focus({preventScroll:!0});}),this.value!==this.oldValue&&this.updateComplete.then(function(){_this6.nileInput({value:_this6.value,name:_this6.name}),_this6.nileChange({value:_this6.value,name:_this6.name});}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0}));}},{key:"setSelectedOptions",value:function setSelectedOptions(i){this.value=i,this.selectionChanged();}},{key:"toggleOptionSelection",value:function toggleOptionSelection(i){var s=Array.isArray(this.value)?this.value:[];s.includes(i)?this.value=s.filter(function(s){return s!==i;}):this.value=[].concat(_toConsumableArray(s),[i]),this.selectionChanged();}},{key:"handleTagRemove",value:function handleTagRemove(i,s){i.stopPropagation(),this.disabled||(this.removeTagFromSelection(s),this.emitTagRemovalEvent(s));}},{key:"removeTagFromSelection",value:function removeTagFromSelection(i){var s=this.value;Array.isArray(s)||(s=s?[s]:[]);var n=s.filter(function(s){return s!==i.value;});this.value=n,this.selectionChanged();}},{key:"emitTagRemovalEvent",value:function emitTagRemovalEvent(i){var _this7=this;this.updateComplete.then(function(){_this7.nileInput({value:_this7.value,name:_this7.name}),_this7.nileChange({value:_this7.value,name:_this7.name}),_this7.emit("nile-tag-remove",{value:_this7.value,name:_this7.name,removedtagvalue:i.value});});}},{key:"selectionChanged",value:function selectionChanged(){var _this$renderItemConfi4,_this$originalOptionI;var i=this.originalOptionItems.length>0?this.originalOptionItems:this.data;if(this.selectedOptions=b.createVirtualOptionsFromValues(this.value,i,this.getDisplayText.bind(this),(_this$renderItemConfi4=this.renderItemConfig)===null||_this$renderItemConfi4===void 0?void 0:_this$renderItemConfi4.getValue),this.multiple)this.placeholder&&0===this.value.length?this.displayLabel="":this.displayLabel=this.selectedOptions.length+" selected";else{var _this$selectedOptions2;var _i4=Array.isArray(this.value)?this.value[0]:this.value,_s2=(_this$selectedOptions2=this.selectedOptions[0])===null||_this$selectedOptions2===void 0?void 0:_this$selectedOptions2.getTextLabel();this.displayLabel=_s2||(_i4!==null&&_i4!==void 0?_i4:"");}this.updateValidity(),0===this.selectedOptions.length&&(this.showSelected=!1,((_this$originalOptionI=this.originalOptionItems)===null||_this$originalOptionI===void 0?void 0:_this$originalOptionI.length)>0&&!this.searchValue&&(this.data=_toConsumableArray(this.originalOptionItems)),this.repaintOptionsContainer()),this.calculateTotalWidthOfTags();}},{key:"handleSearchFocus",value:function handleSearchFocus(){document.removeEventListener("keydown",this.handleDocumentKeyDown);}},{key:"handleSearchBlur",value:function handleSearchBlur(){document.addEventListener("keydown",this.handleDocumentKeyDown);}},{key:"handleSearchChange",value:function handleSearchChange(i){this.searchValue=i.detail.value,this.portal&&this.portalManager.updatePortalAppendPosition(),this.emit("nile-search",{query:this.searchValue,name:this.name}),this.disableLocalSearch||(this.filterVirtualOptions(this.searchValue),this.repaintOptionsContainer(),this.portalManager.resetMeasuredHeight());}},{key:"repaintOptionsContainer",value:function repaintOptionsContainer(){var _this8=this;this.resetScrollPosition(),this.updateComplete.then(function(){var _this8$shadowRoot;var i=(_this8$shadowRoot=_this8.shadowRoot)===null||_this8$shadowRoot===void 0?void 0:_this8$shadowRoot.querySelector(".virtualized");i&&(_this8.data.length<=5?i.classList.add("no-scroll"):i.classList.remove("no-scroll"));});}},{key:"handleScroll",value:function handleScroll(i){var _this9=this;if(this.showSelected)return;var s=i.target;this.emit("nile-scroll",{scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,name:this.name}),this.scrolling||(this.scrolling=!0,this.emit("nile-scroll-start",{scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,name:this.name})),clearTimeout(this.scrollTimeout),this.scrollTimeout=window.setTimeout(function(){_this9.scrolling&&(_this9.scrolling=!1);},300);Math.ceil(s.scrollTop)>=Math.floor(s.scrollHeight-s.offsetHeight)&&!this.searchValue&&this.emit("nile-scroll-end",{scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,name:this.name,isAtBottom:!0});}},{key:"filterVirtualOptions",value:function filterVirtualOptions(i){var _this$renderItemConfi5,_this10=this;var s=w.filterVirtualOptions(i,this.originalOptionItems,this.data,this.getDisplayText.bind(this),(_this$renderItemConfi5=this.renderItemConfig)===null||_this$renderItemConfi5===void 0?void 0:_this$renderItemConfi5.getSearchText);this.portal?(this.portalManager.updatePortalAppendPosition(),this.updateComplete.then(function(){requestAnimationFrame(function(){requestAnimationFrame(function(){_this10.resetScrollPosition();});});})):this.resetScrollPosition(),this.data=s.filteredItems,this.showNoResults=s.showNoResults,this.showSelected=!1,this.requestUpdate();}},{key:"handleInvalid",value:function handleInvalid(i){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(i);}},{key:"handleDisabledChange",value:function handleDisabledChange(){this.disabled&&(this.open=!1,this.handleOpenChange());}},{key:"handleValueChange",value:function handleValueChange(){this.selectionChanged(),this.requestUpdate(),this.portal&&this.portalManager.portalContainerElement&&this.portalManager.updatePortalAppendPosition();}},{key:"handleDataChange",value:function handleDataChange(){this.data.length>0&&this.open&&!this.showSelected&&!this.searchValue&&(this.originalOptionItems=_toConsumableArray(this.data)),this.selectionChanged(),this.optionsLoading||this.loading||0!==this.data.length?this.data.length>0&&(this.showNoResults=!1):this.showNoResults=!0,this.requestUpdate(),this.portalManager.resetMeasuredHeight(),this.portal&&this.portalManager.portalContainerElement&&this.portalManager.updatePortalAppendPosition();}},{key:"handleRenderItemConfigChange",value:function handleRenderItemConfigChange(){this.value&&this.data.length>0&&(this.selectionChanged(),this.requestUpdate());}},{key:"handleOptionsLoadingChange",value:function handleOptionsLoadingChange(){this.optionsLoading||0!==this.data.length||(this.showNoResults=!0),this.requestUpdate(),this.portal&&this.portalManager.portalContainerElement&&this.portalManager.updatePortalAppendPosition();}},{key:"handlePortalAppendChange",value:function handlePortalAppendChange(){this.open&&(this.portal?this.portalManager.setupPortalAppend():this.portalManager.cleanupPortalAppend());}},{key:"handleOpenChange",value:function(){var _handleOpenChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(!(this.open&&!this.disabled)){_context3.next=7;break;}_context3.next=3;return this.handleOpen();case 3:this.showListbox=!0;this.portal&&this.portalManager.setupPortalAppend();_context3.next=11;break;case 7:_context3.next=9;return this.handleClose();case 9:this.showListbox=!1;this.portal&&this.portalManager.cleanupPortalAppend();case 11:case"end":return _context3.stop();}},_callee2,this);}));function handleOpenChange(){return _handleOpenChange.apply(this,arguments);}return handleOpenChange;}()},{key:"handleOpen",value:function(){var _handleOpen=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _this$data;var _g,i,s;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:this.emit("nile-show",{value:this.value,name:this.name});this.addOpenListeners();this.showNoResults=!((_this$data=this.data)!==null&&_this$data!==void 0&&_this$data.length);_context4.next=5;return r(this);case 5:this.popup.active=!0;_g=g(this,"select.show",{dir:"ltr"}),i=_g.keyframes,s=_g.options;_context4.next=9;return l(this.popup.popup,i,s);case 9:this.wasShowSelectedCheckedOnClose&&(this.showSelected=!1,this.data=_toConsumableArray(this.originalOptionItems),this.wasShowSelectedCheckedOnClose=!1);this.filterVirtualOptions("");this.resetScrollPosition();this.emit("nile-after-show",{value:this.value,name:this.name});case 13:case"end":return _context4.stop();}},_callee3,this);}));function handleOpen(){return _handleOpen.apply(this,arguments);}return handleOpen;}()},{key:"handleClose",value:function(){var _handleClose=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _g2,i,s;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:this.emit("nile-hide",{value:this.value,name:this.name});this.removeOpenListeners();this.wasShowSelectedCheckedOnClose=this.showSelected;_context5.next=5;return r(this);case 5:_g2=g(this,"select.hide",{dir:"ltr"}),i=_g2.keyframes,s=_g2.options;_context5.next=8;return l(this.popup.popup,i,s);case 8:this.popup.active=!1;this.searchValue="";this.portalManager.resetMeasuredHeight();this.emit("nile-after-hide",{value:this.value,name:this.name});case 12:case"end":return _context5.stop();}},_callee4,this);}));function handleClose(){return _handleClose.apply(this,arguments);}return handleClose;}()},{key:"show",value:function(){var _show=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:if(!(!this.open&&!this.disabled)){_context6.next=2;break;}return _context6.abrupt("return",(this.open=!0,v(this,"nile-after-show")));case 2:this.open=!1;case 3:case"end":return _context6.stop();}},_callee5,this);}));function show(){return _show.apply(this,arguments);}return show;}()},{key:"hide",value:function(){var _hide=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:if(!(this.open&&!this.disabled)){_context7.next=2;break;}return _context7.abrupt("return",(this.open=!1,v(this,"nile-after-hide")));case 2:this.open=!1;case 3:case"end":return _context7.stop();}},_callee6,this);}));function hide(){return _hide.apply(this,arguments);}return hide;}()},{key:"checkValidity",value:function checkValidity(){return this.valueInput.checkValidity();}},{key:"getForm",value:function getForm(){return this.formControlController.getForm();}},{key:"reportValidity",value:function reportValidity(){return this.valueInput.reportValidity();}},{key:"setCustomValidity",value:function setCustomValidity(i){this.valueInput.setCustomValidity(i),this.formControlController.updateValidity();}},{key:"focus",value:function focus(i){this.displayInput.focus(i);}},{key:"blur",value:function blur(){this.displayInput.blur();}},{key:"onInputChange",value:function onInputChange(i){i.stopPropagation();}},{key:"render",value:function render(){var i=this.hasSlotController.test("label");this.hasSlotController.test("help-text");var n=this.hasSlotController.test("label-suffix"),o=this.hasSlotController.test("custom-select"),c=!!this.label||!!i,t=this.clearable&&!this.disabled&&this.value.length>0,e=!!this.placeholder&&0===this.value.length,r=!!this.helpText,l=!!this.errorMessage;return s(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"form-control\"\n class=","\n >\n ","\n ","\n </div>\n "])),j({"form-control":!0,"form-control--small":"small"===this.size,"form-control--medium":"medium"===this.size,"form-control--large":"large"===this.size,"form-control--has-label":c,"form-control--has-help-text":r}),this.renderLabel(c,n),this.renderFormControlInput(o,t,e,r,l));}},{key:"renderLabel",value:function renderLabel(i,n){return s(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <label\n id=\"label\"\n part=\"form-control-label\"\n class=\"form-control__label\"\n aria-hidden=","\n @click=","\n >\n <slot name=\"label\">","</slot>\n </label>\n\n ","\n "])),i?"false":"true",this.handleLabelClick,this.label,n?s(_templateObject3||(_templateObject3=_taggedTemplateLiteral([" <slot name=\"label-suffix\"></slot> "]))):"");}},{key:"renderFormControlInput",value:function renderFormControlInput(i,n,o,c,t){return s(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <div part=\"form-control-input\" class=\"form-control-input\">\n ","\n ","\n </div>\n "])),this.renderPopup(i,n,o),this.renderHelpText(c,t));}},{key:"renderPopup",value:function renderPopup(i,n,o){return s(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-popup\n class=","\n placement=","\n strategy=","\n distance=\"6\"\n ?flip=","\n ?shift=","\n sync=","\n auto-size=\"vertical\"\n auto-size-padding=\"10\"\n >\n ","\n ","\n ","\n </nile-popup>\n "])),j({select:!0,"select--warning":this.warning,"select--error":this.error,"select--success":this.success,"select--standard":!0,"select--filled":this.filled,"select--pill":this.pill,"select--open":this.open,"select--disabled":this.disabled,"select--multiple":this.multiple,"select--focused":this.hasFocus,"select--placeholder-visible":o,"select--top":"top"===this.placement,"select--bottom":"bottom"===this.placement,"select--small":"small"===this.size,"select--medium":"medium"===this.size,"select--large":"large"===this.size}),this.placement,this.portal||this.hoist?"fixed":"absolute",!this.portal,!this.portal,f(this.noWidthSync?void 0:"width"),this.renderCustomSelect(i),this.renderCombobox(i,n),this.showListbox?this.renderListbox():s(_templateObject6||(_templateObject6=_taggedTemplateLiteral([""]))));}},{key:"renderCustomSelect",value:function renderCustomSelect(i){return i?s(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<slot\n slot=\"anchor\"\n name=\"custom-select\"\n class=\"custom-select\"\n @keydown=","\n @mousedown=","\n ></slot>"])),this.handleComboboxKeyDown,this.handleComboboxMouseDown):s(_templateObject8||(_templateObject8=_taggedTemplateLiteral([""])));}},{key:"renderCombobox",value:function renderCombobox(i,n){return s(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["\n <div\n part=\"combobox\"\n class=","\n slot=\"anchor\"\n @keydown=","\n @mousedown=","\n >\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n </div>\n "])),j({select__combobox:!0,"select__hide-default":i}),this.handleComboboxKeyDown,this.handleComboboxMouseDown,this.renderPrefix(),this.renderDisplayInput(),this.renderTags(),this.renderValueInput(),this.renderClearButton(n),this.renderSuffix(),this.renderExpandIcon());}},{key:"renderPrefix",value:function renderPrefix(){return s(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["\n <slot\n part=\"prefix\"\n name=\"prefix\"\n class=","\n ></slot>\n "])),j({select__prefix:!0,multiple:this.multiple}));}},{key:"renderDisplayInput",value:function renderDisplayInput(){return s(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["\n <input\n part=\"display-input\"\n class=\"select__display-input\"\n type=\"text\"\n placeholder=","\n .disabled=","\n .value=","\n autocomplete=\"off\"\n spellcheck=\"false\"\n autocapitalize=\"off\"\n readonly\n aria-controls=\"listbox\"\n aria-expanded=","\n aria-haspopup=\"listbox\"\n aria-labelledby=\"label\"\n aria-disabled=","\n aria-describedby=\"help-text\"\n role=\"combobox\"\n tabindex=\"0\"\n />\n "])),this.placeholder,this.disabled,this.displayLabel,this.open?"true":"false",this.disabled?"true":"false");}},{key:"renderTags",value:function renderTags(){var _this11=this;return this.multiple?s(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["\n <div part=\"tags\" class=\"select__tags\">\n ","\n </div>\n "])),this.selectedOptions.map(function(i,n){if(n<_this11.maxOptionsVisible||_this11.maxOptionsVisible<=0){var _o={select__invisible:n+1>_this11.oldMaxOptionsVisible&&_this11.maxOptionsVisible===1/0};return s(_templateObject13||(_templateObject13=_taggedTemplateLiteral(["\n <nile-tag\n class=","\n part=\"tag\"\n exportparts=\"\n base:tag__base,\n content:tag__content,\n remove-button:tag__remove-button,\n remove-button__base:tag__remove-button__base\n \"\n ?pill=","\n size=","\n removable\n @nile-remove=","\n >\n ","\n </nile-tag>\n "])),j(_o),_this11.pill,_this11.size,function(s){return _this11.handleTagRemove(s,i);},i.getTextLabel());}return n===_this11.maxOptionsVisible?s(_templateObject14||(_templateObject14=_taggedTemplateLiteral(["\n <span class=\"select__tags-count\"\n >+"," More\n </span>\n "])),_this11.selectedOptions.length-n):null;})):s(_templateObject15||(_templateObject15=_taggedTemplateLiteral([""])));}},{key:"renderValueInput",value:function renderValueInput(){var _this12=this;return s(_templateObject16||(_templateObject16=_taggedTemplateLiteral(["\n <input\n class=\"select__value-input\"\n type=\"text\"\n ?disabled=","\n ?required=","\n .value=","\n tabindex=\"-1\"\n aria-hidden=\"true\"\n @focus=","\n @invalid=","\n />\n "])),this.disabled,this.required,Array.isArray(this.value)?this.value.join(", "):this.value,function(){return _this12.focus();},this.handleInvalid);}},{key:"renderClearButton",value:function renderClearButton(i){return i?s(_templateObject17||(_templateObject17=_taggedTemplateLiteral(["\n <button\n part=\"clear-button\"\n class=\"select__clear\"\n type=\"button\"\n aria-label=\"clearEntry\"\n @mousedown=","\n @click=","\n tabindex=\"-1\"\n >\n <slot name=\"clear-icon\">\n <nile-icon name=\"var(--nile-icon-close, var(--ng-icon-x-close))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" library=\"system\"></nile-icon>\n </slot>\n </button>\n "])),this.handleClearMouseDown,this.handleClearClick):s(_templateObject18||(_templateObject18=_taggedTemplateLiteral([""])));}},{key:"renderSuffix",value:function renderSuffix(){return s(_templateObject19||(_templateObject19=_taggedTemplateLiteral(["\n <slot\n part=\"suffix\"\n name=\"suffix\"\n class=","\n ></slot>\n "])),j({select__suffix:!0}));}},{key:"renderExpandIcon",value:function renderExpandIcon(){return s(_templateObject20||(_templateObject20=_taggedTemplateLiteral(["\n <slot\n name=\"expand-icon\"\n part=\"expand-icon\"\n class=\"select__expand-icon\"\n >\n <nile-icon library=\"system\" name=\"var(--nile-icon-arrow-down, var(--ng-icon-chevron-down))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\"></nile-icon>\n </slot>\n "])));}},{key:"renderListbox",value:function renderListbox(){return s(_templateObject21||(_templateObject21=_taggedTemplateLiteral(["\n <div\n id=\"listbox\"\n role=\"listbox\"\n aria-expanded=","\n aria-multiselectable=","\n aria-labelledby=\"label\"\n part=\"listbox\"\n class=\"select__listbox "," ","\"\n tabindex=\"-1\"\n @mouseup=","\n style=","\n >\n ","\n ","\n ","\n ","\n </div>\n "])),this.open?"true":"false",this.multiple?"true":"false",this.searchEnabled?"select__search-enabled ":"",this.portal?"select__portal-append-hidden":"",this.handleOptionClick,this.portal?"display: none;":"",this.renderSearch(),this.renderLoader(),this.getVirtualizedContent(),this.renderFooter());}},{key:"renderSearch",value:function renderSearch(){return this.searchEnabled?s(_templateObject22||(_templateObject22=_taggedTemplateLiteral(["\n <div part=\"search\" class=\"select__search\">\n <nile-input\n size=\"small\"\n clearable\n .value=","\n placeholder=\"","\"\n @nile-input=","\n @nile-focus=","\n @nile-change=\"","\"\n >\n <nile-icon name=\"var(--nile-icon-search, var(--ng-icon-search-lg))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" slot=\"suffix\"> </nile-icon>\n </nile-input>\n </div>\n "])),this.searchValue,this.internalSearchPlaceHolder,this.handleSearchChange,this.handleSearchFocus,this.onInputChange):s(_templateObject23||(_templateObject23=_taggedTemplateLiteral([""])));}},{key:"renderLoader",value:function renderLoader(){return this.loading?s(_templateObject24||(_templateObject24=_taggedTemplateLiteral(["\n <span part=\"loader\" class=\"virtual-select-loader\">\n <nile-loader size=\"sm\"></nile-loader>\n </span>\n "]))):this.optionsLoading?s(_templateObject25||(_templateObject25=_taggedTemplateLiteral(["\n <span part=\"loader\" class=\"select__loader\">\n <nile-icon\n class=\"select__loader--icon\"\n name=\"button-loading-blue\"\n ></nile-icon>\n </span>\n "]))):s(_templateObject26||(_templateObject26=_taggedTemplateLiteral([""])));}},{key:"renderFooter",value:function renderFooter(){return this.multiple?s(_templateObject27||(_templateObject27=_taggedTemplateLiteral(["\n <div\n part=\"footer\"\n class=\"select__footer ","\"\n @click=\"","\"\n >\n <span\n @click=\"","\"\n style=\"cursor: pointer;\"\n >\n <nile-checkbox\n ?disabled=\"","\"\n ?checked=\"","\"\n >\n &nbsp; Show Selected</nile-checkbox\n >\n </span>\n ","\n </div>\n "])),this.loading?"loading":"",this.handleFooterClick,this.toggleShowSelected,0===this.selectedOptions.length,this.showSelected,0!==this.selectedOptions.length?s(_templateObject28||(_templateObject28=_taggedTemplateLiteral(["\n <span\n class=\"select__clear\"\n @click=\"","\"\n >\n Clear All\n </span>\n "])),this.unSelectAll):""):s(_templateObject29||(_templateObject29=_taggedTemplateLiteral([""])));}},{key:"renderHelpText",value:function renderHelpText(i,n){return s(_templateObject30||(_templateObject30=_taggedTemplateLiteral(["\n ","\n ","\n "])),i?s(_templateObject31||(_templateObject31=_taggedTemplateLiteral([" <nile-form-help-text>","</nile-form-help-text> "])),this.helpText):"",n?s(_templateObject32||(_templateObject32=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"");}},{key:"getVirtualizedContent",value:function getVirtualizedContent(){var _this$renderItemConfi6,_this$renderItemConfi7;return y.getVirtualizedContent(this.data,this.searchEnabled,this.getDisplayText.bind(this),this.value,this.multiple,(_this$renderItemConfi6=this.renderItemConfig)===null||_this$renderItemConfi6===void 0?void 0:_this$renderItemConfi6.getDisplayText,(_this$renderItemConfi7=this.renderItemConfig)===null||_this$renderItemConfi7===void 0?void 0:_this$renderItemConfi7.getValue,this.showNoResults,this.noResultsMessage,this.optionsLoading||this.loading,this.handleScroll.bind(this));}},{key:"nileInput",value:function nileInput(i){this.emit("nile-input",i);}},{key:"nileChange",value:function nileChange(i){this.emit("nile-change",i);}},{key:"updateValidity",value:function updateValidity(){var _this13=this;this.updateComplete.then(function(){_this13.formControlController.updateValidity();});}},{key:"calculateWidthOfSelectTagsDiv",value:function calculateWidthOfSelectTagsDiv(){if(this.shadowRoot){var _i5=this.shadowRoot.querySelector(".select__tags");if(_i5){return _i5.offsetWidth-70;}}return null;}},{key:"calculateTotalWidthOfTags",value:function calculateTotalWidthOfTags(){var _this14=this;this.maxOptionsVisible!==1/0&&(this.oldMaxOptionsVisible=this.maxOptionsVisible),this.maxOptionsVisible=1/0,setTimeout(function(){var i=[];if(_this14.shadowRoot){_this14.shadowRoot.querySelectorAll("nile-tag").forEach(function(s){s instanceof HTMLElement&&i.push(s.offsetWidth);});}if(_this14.value.length!==i.length)return;var s=_this14.calculateWidthOfSelectTagsDiv();if(!s)return;var n=0,o=0;for(var _c=0;_c<i.length;_c++)if(n+=i[_c],n>s){o=_c;break;}_this14.maxOptionsVisible=o;},1);}},{key:"resetScrollPosition",value:function(){var _resetScrollPosition=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _this15=this;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return this.updateComplete;case 2:requestAnimationFrame(function(){requestAnimationFrame(function(){var _this15$shadowRoot;var i=null;if(i=_this15.portal&&_this15.portalManager.portalContainerElement?_this15.portalManager.portalContainerElement.querySelector("#listbox"):(_this15$shadowRoot=_this15.shadowRoot)===null||_this15$shadowRoot===void 0?void 0:_this15$shadowRoot.querySelector("#listbox"),!i||!i.isConnected)return;i.scrollTop=0;var s=i.querySelector(".virtualized");if(s&&s.isConnected){_this15.data.length<=5?(s.style.overflowY="hidden",s.style.maxHeight="none",i.style.overflowY="hidden",i.style.maxHeight="fit-content"):(s.style.overflowY="auto",s.style.maxHeight="",i.style.overflowY="auto",i.style.maxHeight=""),s.scrollTop=0;}var n=i.querySelector("lit-virtualizer");n&&n.isConnected&&(n.scrollTop=0);});});case 3:case"end":return _context8.stop();}},_callee7,this);}));function resetScrollPosition(){return _resetScrollPosition.apply(this,arguments);}return resetScrollPosition;}()}]);}(u));k.styles=e,i([n(".select")],k.prototype,"popup",void 0),i([n(".select__combobox")],k.prototype,"combobox",void 0),i([n(".select__display-input")],k.prototype,"displayInput",void 0),i([n(".select__value-input")],k.prototype,"valueInput",void 0),i([n(".virtualized")],k.prototype,"virtualizedContainer",void 0),i([o()],k.prototype,"hasFocus",void 0),i([o()],k.prototype,"displayLabel",void 0),i([o()],k.prototype,"selectedOptions",void 0),i([o()],k.prototype,"oldValue",void 0),i([c()],k.prototype,"name",void 0),i([c({type:Array})],k.prototype,"data",void 0),i([o()],k.prototype,"originalOptionItems",void 0),i([c({converter:{fromAttribute:function fromAttribute(i){return i.split(" ");},toAttribute:function toAttribute(i){return i.join(" ");}}})],k.prototype,"value",void 0),i([a()],k.prototype,"defaultValue",void 0),i([c()],k.prototype,"size",void 0),i([c()],k.prototype,"placeholder",void 0),i([c({type:Boolean})],k.prototype,"autoResize",void 0),i([o()],k.prototype,"searchValue",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"searchEnabled",void 0),i([c({attribute:"internal-search-placeholder"})],k.prototype,"internalSearchPlaceHolder",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"disableLocalSearch",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"optionsLoading",void 0),i([c({type:Boolean,reflect:!0,attribute:!0})],k.prototype,"loading",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"multiple",void 0),i([c({attribute:"help-text",reflect:!0})],k.prototype,"helpText",void 0),i([c({attribute:"error-message",reflect:!0})],k.prototype,"errorMessage",void 0),i([c({type:Boolean})],k.prototype,"warning",void 0),i([c({type:Boolean})],k.prototype,"error",void 0),i([c({type:Boolean})],k.prototype,"success",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"disabled",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"clearable",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"open",void 0),i([c({type:Boolean})],k.prototype,"hoist",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"filled",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"pill",void 0),i([c()],k.prototype,"label",void 0),i([c({reflect:!0})],k.prototype,"placement",void 0),i([c({reflect:!0})],k.prototype,"form",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"required",void 0),i([c({type:Boolean})],k.prototype,"showNoResults",void 0),i([c({type:String})],k.prototype,"noResultsMessage",void 0),i([c({type:Boolean})],k.prototype,"showSelected",void 0),i([c({attribute:!1})],k.prototype,"renderItemConfig",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"blockValueChange",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"noWidthSync",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"portal",void 0),i([c({attribute:"max-options-visible",type:Number})],k.prototype,"maxOptionsVisible",void 0),i([o()],k.prototype,"oldMaxOptionsVisible",void 0),i([o()],k.prototype,"showListbox",void 0),i([o()],k.prototype,"wasShowSelectedCheckedOnClose",void 0),i([d("disabled",{waitUntilFirstUpdate:!0})],k.prototype,"handleDisabledChange",null),i([d("value",{waitUntilFirstUpdate:!0})],k.prototype,"handleValueChange",null),i([d("data",{waitUntilFirstUpdate:!0})],k.prototype,"handleDataChange",null),i([d("renderItemConfig",{waitUntilFirstUpdate:!0})],k.prototype,"handleRenderItemConfigChange",null),i([d("optionsLoading",{waitUntilFirstUpdate:!0})],k.prototype,"handleOptionsLoadingChange",null),i([d("portal",{waitUntilFirstUpdate:!0})],k.prototype,"handlePortalAppendChange",null),i([d("open",{waitUntilFirstUpdate:!0})],k.prototype,"handleOpenChange",null),_export("N",k=i([t("nile-virtual-select")],k)),m("select.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),m("select.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});}};});
5
+ */_export("t",x=/*#__PURE__*/function(){function x(i,_ref){var _this=this;var s=_ref.target,n=_ref.config,o=_ref.callback,c=_ref.skipInitial;_classCallCheck(this,x);this.t=new Set(),this.o=!1,this.i=!1,this.h=i,null!==s&&this.t.add(s!==null&&s!==void 0?s:i),this.l=n,this.o=c!==null&&c!==void 0?c:this.o,this.callback=o,window.ResizeObserver?(this.u=new ResizeObserver(function(i){_this.handleChanges(i),_this.h.requestUpdate();}),i.addController(this)):console.warn("ResizeController error: browser does not support ResizeObserver.");}return _createClass(x,[{key:"handleChanges",value:function handleChanges(i){var _this$callback;this.value=(_this$callback=this.callback)===null||_this$callback===void 0?void 0:_this$callback.call(this,i,this.u);}},{key:"hostConnected",value:function hostConnected(){var _iterator=_createForOfIteratorHelper(this.t),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _i=_step.value;this.observe(_i);}}catch(err){_iterator.e(err);}finally{_iterator.f();}}},{key:"hostDisconnected",value:function hostDisconnected(){this.disconnect();}},{key:"hostUpdated",value:function(){var _hostUpdated=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:!this.o&&this.i&&this.handleChanges([]),this.i=!1;case 1:case"end":return _context2.stop();}},_callee,this);}));function hostUpdated(){return _hostUpdated.apply(this,arguments);}return hostUpdated;}()},{key:"observe",value:function observe(i){this.t.add(i),this.u.observe(i,this.l),this.i=!0,this.h.requestUpdate();}},{key:"unobserve",value:function unobserve(i){this.t["delete"](i),this.u.unobserve(i);}},{key:"disconnect",value:function disconnect(){this.u.disconnect();}}]);}());_export("N",k=/*#__PURE__*/function(_u){function k(){var _this2;_classCallCheck(this,k);_this2=_callSuper(this,k,arguments),_this2.formControlController=new p(_assertThisInitialized(_this2),{assumeInteractionOn:["nile-blur","nile-input"]}),_this2.hasSlotController=new h(_assertThisInitialized(_this2),"help-text","label"),_this2.portalManager=new _(_assertThisInitialized(_this2)),_this2.hasFocus=!1,_this2.displayLabel="",_this2.selectedOptions=[],_this2.oldValue="",_this2.scrolling=!1,_this2.name="",_this2.data=[],_this2.originalOptionItems=[],_this2.value="",_this2.defaultValue="",_this2.size="medium",_this2.placeholder="Select...",_this2.autoResize=!1,_this2.searchValue="",_this2.searchEnabled=!1,_this2.internalSearchPlaceHolder="Search...",_this2.disableLocalSearch=!1,_this2.optionsLoading=!1,_this2.loading=!1,_this2.multiple=!1,_this2.helpText="",_this2.errorMessage="",_this2.warning=!1,_this2.error=!1,_this2.success=!1,_this2.disabled=!1,_this2.clearable=!1,_this2.open=!1,_this2.hoist=!1,_this2.filled=!1,_this2.pill=!1,_this2.label="",_this2.placement="bottom",_this2.form="",_this2.required=!1,_this2.showNoResults=!1,_this2.noResultsMessage="No results found",_this2.showSelected=!1,_this2.blockValueChange=!1,_this2.noWidthSync=!1,_this2.portal=!1,_this2.maxOptionsVisible=3,_this2.oldMaxOptionsVisible=1,_this2.showListbox=!1,_this2.wasShowSelectedCheckedOnClose=!1,_this2.handleDocumentMouseDown=function(i){if(!_this2.open)return;var s=i.composedPath(),n=s.includes(_assertThisInitialized(_this2)),o=_this2.popup&&s.includes(_this2.popup),c=_this2.portal&&_this2.portalManager.portalContainerElement&&s.includes(_this2.portalManager.portalContainerElement);n||o||c||_this2.hide();},_this2.handleWindowError=function(i){var _i$error;(((_i$error=i.error)===null||_i$error===void 0?void 0:_i$error.message)||i.message||"").includes("Cannot read properties of null (reading 'insertBefore')")&&i.preventDefault();},_this2.handleWindowResize=function(){_this2.portalManager.updatePortalAppendPosition();},_this2.handleWindowScroll=function(){_this2.portalManager.updatePortalAppendPosition();},_this2.resizeController=new x(_assertThisInitialized(_this2),{callback:function callback(i){var _iterator2=_createForOfIteratorHelper(i),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _s=_step2.value;_s.target.classList.contains("select__tags")&&_this2.calculateTotalWidthOfTags();}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}});return _this2;}_inherits(k,_u);return _createClass(k,[{key:"validity",get:function get(){var _this$valueInput;return(_this$valueInput=this.valueInput)===null||_this$valueInput===void 0?void 0:_this$valueInput.validity;}},{key:"validationMessage",get:function get(){var _this$valueInput$vali,_this$valueInput2;return(_this$valueInput$vali=(_this$valueInput2=this.valueInput)===null||_this$valueInput2===void 0?void 0:_this$valueInput2.validationMessage)!==null&&_this$valueInput$vali!==void 0?_this$valueInput$vali:"";}},{key:"connectedCallback",value:function connectedCallback(){var _this3=this;_superPropGet(k,"connectedCallback",this,3)([]),this.initializeComponent(),this.setupEventListeners(),this.updateComplete.then(function(){_this3.value&&_this3.data.length>0&&_this3.selectionChanged();});}},{key:"disconnectedCallback",value:function disconnectedCallback(){this.removeOpenListeners(),this.scrollTimeout&&(clearTimeout(this.scrollTimeout),this.scrollTimeout=void 0),this.portalManager.cleanupPortalAppend();}},{key:"updated",value:function updated(i){if(i.has("value")&&this.selectionChanged(),i.has("autoResize")){var _this$shadowRoot;var _i2=(_this$shadowRoot=this.shadowRoot)===null||_this$shadowRoot===void 0?void 0:_this$shadowRoot.querySelector(".select__tags");this.autoResize&&_i2?this.resizeController.observe(_i2):_i2&&this.resizeController.unobserve(_i2);}}},{key:"initializeComponent",value:function initializeComponent(){this.open=!1,this.emit("nile-init");}},{key:"getDisplayText",value:function getDisplayText(i){var _this$renderItemConfi;return(_this$renderItemConfi=this.renderItemConfig)!==null&&_this$renderItemConfi!==void 0&&_this$renderItemConfi.getDisplayText?this.renderItemConfig.getDisplayText(i):(i===null||i===void 0?void 0:i.label)||(i===null||i===void 0?void 0:i.name)||(i===null||i===void 0?void 0:i.toString())||"";}},{key:"getItemValue",value:function getItemValue(i){var _this$renderItemConfi2;return(_this$renderItemConfi2=this.renderItemConfig)!==null&&_this$renderItemConfi2!==void 0&&_this$renderItemConfi2.getValue?this.renderItemConfig.getValue(i):(i===null||i===void 0?void 0:i.value)||i;}},{key:"getSearchText",value:function getSearchText(i){var _this$renderItemConfi3;return(_this$renderItemConfi3=this.renderItemConfig)!==null&&_this$renderItemConfi3!==void 0&&_this$renderItemConfi3.getSearchText?this.renderItemConfig.getSearchText(i):this.getDisplayText(i);}},{key:"setupEventListeners",value:function setupEventListeners(){this.handleDocumentFocusIn=this.handleDocumentFocusIn.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleWindowError=this.handleWindowError.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.handleWindowScroll=this.handleWindowScroll.bind(this);}},{key:"addOpenListeners",value:function addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown),window.addEventListener("error",this.handleWindowError),this.portal&&(window.addEventListener("resize",this.handleWindowResize),window.addEventListener("scroll",this.handleWindowScroll,!0));}},{key:"removeOpenListeners",value:function removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown),window.removeEventListener("error",this.handleWindowError),window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("scroll",this.handleWindowScroll,!0);}},{key:"handleFocus",value:function handleFocus(){this.hasFocus=!0,this.emit("nile-focus");}},{key:"handleBlur",value:function handleBlur(){this.hasFocus=!1,this.emit("nile-blur");}},{key:"handleDocumentFocusIn",value:function handleDocumentFocusIn(i){if(!this.open)return;var s=i.composedPath(),n=s.includes(this),o=this.popup&&s.includes(this.popup),c=this.portal&&this.portalManager.portalContainerElement&&s.includes(this.portalManager.portalContainerElement);n||o||c||this.hide();}},{key:"handleDocumentKeyDown",value:function handleDocumentKeyDown(i){this.shouldIgnoreKeyPress(i)||(this.isEscapeKey(i)&&this.handleEscapeKey(i),this.isEnterOrSpaceKey(i)&&this.handleEnterOrSpaceKey(i));}},{key:"shouldIgnoreKeyPress",value:function shouldIgnoreKeyPress(i){var s=i.target,n=null!==s.closest(".select__clear"),o=null!==s.closest("nile-icon-button");return n||o;}},{key:"isEscapeKey",value:function isEscapeKey(i){return"Escape"===i.key&&this.open;}},{key:"handleEscapeKey",value:function handleEscapeKey(i){i.preventDefault(),i.stopPropagation(),this.hide(),this.displayInput.focus({preventScroll:!0});}},{key:"isEnterOrSpaceKey",value:function isEnterOrSpaceKey(i){return"Enter"===i.key||" "===i.key;}},{key:"handleEnterOrSpaceKey",value:function handleEnterOrSpaceKey(i){i.preventDefault(),i.stopImmediatePropagation(),this.open?this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})):this.show();}},{key:"handleFooterClick",value:function handleFooterClick(i){i.stopPropagation(),i.preventDefault();}},{key:"toggleShowSelected",value:function toggleShowSelected(i){var _this$selectedOptions,_this4=this;if(i.stopPropagation(),i.preventDefault(),0!==((_this$selectedOptions=this.selectedOptions)===null||_this$selectedOptions===void 0?void 0:_this$selectedOptions.length)){if(this.showSelected=!this.showSelected,this.showSelected){this.searchValue="";var _i3=Array.isArray(this.value)?this.value:[this.value];this.data=this.originalOptionItems.filter(function(s){var n=_this4.getItemValue(s);return _i3.some(function(i){return String(i)===String(n);});});}else this.data=_toConsumableArray(this.originalOptionItems);this.portalManager.resetMeasuredHeight(),this.requestUpdate(),this.repaintOptionsContainer();}}},{key:"unSelectAll",value:function unSelectAll(){this.showSelected=!1,this.value=this.multiple?[]:"",this.data=_toConsumableArray(this.originalOptionItems),this.selectionChanged(),this.emit("nile-change",{value:this.value,name:this.name}),this.emit("nile-clear",{value:this.multiple?this.value:"",name:this.name}),this.resetScrollPosition();}},{key:"handleLabelClick",value:function handleLabelClick(){this.displayInput.focus(),this.hide();}},{key:"handleComboboxMouseDown",value:function handleComboboxMouseDown(i){this.shouldIgnoreComboboxClick(i)||(i.preventDefault(),this.displayInput.focus({preventScroll:!0}),this.open=!this.open);}},{key:"shouldIgnoreComboboxClick",value:function shouldIgnoreComboboxClick(i){var s=i.composedPath().some(function(i){return i instanceof Element&&"nile-icon-button"===i.tagName.toLowerCase();});return this.disabled||s;}},{key:"handleComboboxKeyDown",value:function handleComboboxKeyDown(i){this.isEnterOrSpaceKey(i)&&(i.preventDefault(),this.open=!this.open);}},{key:"handleClearClick",value:function handleClearClick(i){i.stopPropagation(),this.clearSelection();}},{key:"clearSelection",value:function clearSelection(){var _this5=this;this.value,this.value=this.multiple?[]:"",this.selectionChanged(),this.updateComplete.then(function(){_this5.nileInput({value:_this5.value,name:_this5.name}),_this5.nileChange({value:_this5.value,name:_this5.name}),_this5.emit("nile-clear");});}},{key:"handleClearMouseDown",value:function handleClearMouseDown(i){i.stopPropagation();}},{key:"handleOptionClick",value:function handleOptionClick(i){var s=i.target.closest("nile-option");if(this.shouldBlockValueChange(s))return;var n=this.value;this.oldValue=n,s&&!s.disabled&&this.handleOptionSelection(s);}},{key:"shouldBlockValueChange",value:function shouldBlockValueChange(i){return!(!this.blockValueChange||!i)&&(this.emit("nile-block-change",{value:i===null||i===void 0?void 0:i.value,name:this.name}),this.hide(),!0);}},{key:"handleOptionSelection",value:function handleOptionSelection(i){var _this6=this;var s=i.value;this.multiple?this.toggleOptionSelection(s):this.setSelectedOptions(s),this.updateComplete.then(function(){return _this6.displayInput.focus({preventScroll:!0});}),this.value!==this.oldValue&&this.updateComplete.then(function(){_this6.nileInput({value:_this6.value,name:_this6.name}),_this6.nileChange({value:_this6.value,name:_this6.name});}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0}));}},{key:"setSelectedOptions",value:function setSelectedOptions(i){this.value=i,this.selectionChanged();}},{key:"toggleOptionSelection",value:function toggleOptionSelection(i){var s=Array.isArray(this.value)?this.value:[];s.includes(i)?this.value=s.filter(function(s){return s!==i;}):this.value=[].concat(_toConsumableArray(s),[i]),this.selectionChanged();}},{key:"handleTagRemove",value:function handleTagRemove(i,s){i.stopPropagation(),this.disabled||(this.removeTagFromSelection(s),this.emitTagRemovalEvent(s));}},{key:"removeTagFromSelection",value:function removeTagFromSelection(i){var s=this.value;Array.isArray(s)||(s=s?[s]:[]);var n=s.filter(function(s){return s!==i.value;});this.value=n,this.selectionChanged();}},{key:"emitTagRemovalEvent",value:function emitTagRemovalEvent(i){var _this7=this;this.updateComplete.then(function(){_this7.nileInput({value:_this7.value,name:_this7.name}),_this7.nileChange({value:_this7.value,name:_this7.name}),_this7.emit("nile-tag-remove",{value:_this7.value,name:_this7.name,removedtagvalue:i.value});});}},{key:"selectionChanged",value:function selectionChanged(){var _this$renderItemConfi4,_this$originalOptionI;var i=this.originalOptionItems.length>0?this.originalOptionItems:this.data;if(this.selectedOptions=b.createVirtualOptionsFromValues(this.value,i,this.getDisplayText.bind(this),(_this$renderItemConfi4=this.renderItemConfig)===null||_this$renderItemConfi4===void 0?void 0:_this$renderItemConfi4.getValue),this.multiple)this.placeholder&&0===this.value.length?this.displayLabel="":this.displayLabel=this.selectedOptions.length+" selected";else{var _this$selectedOptions2;var _i4=Array.isArray(this.value)?this.value[0]:this.value,_s2=(_this$selectedOptions2=this.selectedOptions[0])===null||_this$selectedOptions2===void 0?void 0:_this$selectedOptions2.getTextLabel();this.displayLabel=_s2||(_i4!==null&&_i4!==void 0?_i4:"");}this.updateValidity(),0===this.selectedOptions.length&&(this.showSelected=!1,((_this$originalOptionI=this.originalOptionItems)===null||_this$originalOptionI===void 0?void 0:_this$originalOptionI.length)>0&&!this.searchValue&&(this.data=_toConsumableArray(this.originalOptionItems)),this.repaintOptionsContainer()),this.calculateTotalWidthOfTags();}},{key:"handleSearchFocus",value:function handleSearchFocus(){document.removeEventListener("keydown",this.handleDocumentKeyDown);}},{key:"handleSearchBlur",value:function handleSearchBlur(){document.addEventListener("keydown",this.handleDocumentKeyDown);}},{key:"handleSearchChange",value:function handleSearchChange(i){this.searchValue=i.detail.value,this.portal&&this.portalManager.updatePortalAppendPosition(),this.emit("nile-search",{query:this.searchValue,name:this.name}),this.disableLocalSearch||(this.filterVirtualOptions(this.searchValue),this.repaintOptionsContainer(),this.portalManager.resetMeasuredHeight());}},{key:"repaintOptionsContainer",value:function repaintOptionsContainer(){var _this8=this;this.resetScrollPosition(),this.updateComplete.then(function(){var _this8$shadowRoot;var i=(_this8$shadowRoot=_this8.shadowRoot)===null||_this8$shadowRoot===void 0?void 0:_this8$shadowRoot.querySelector(".virtualized");i&&(_this8.data.length<=5?i.classList.add("no-scroll"):i.classList.remove("no-scroll"));});}},{key:"handleScroll",value:function handleScroll(i){var _this9=this;if(this.showSelected)return;var s=i.target;this.emit("nile-scroll",{scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,name:this.name}),this.scrolling||(this.scrolling=!0,this.emit("nile-scroll-start",{scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,name:this.name})),clearTimeout(this.scrollTimeout),this.scrollTimeout=window.setTimeout(function(){_this9.scrolling&&(_this9.scrolling=!1);},300);Math.ceil(s.scrollTop)>=Math.floor(s.scrollHeight-s.offsetHeight)&&!this.searchValue&&this.emit("nile-scroll-end",{scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,name:this.name,isAtBottom:!0});}},{key:"filterVirtualOptions",value:function filterVirtualOptions(i){var _this$renderItemConfi5,_this10=this;var s=w.filterVirtualOptions(i,this.originalOptionItems,this.data,this.getDisplayText.bind(this),(_this$renderItemConfi5=this.renderItemConfig)===null||_this$renderItemConfi5===void 0?void 0:_this$renderItemConfi5.getSearchText);this.portal?(this.portalManager.updatePortalAppendPosition(),this.updateComplete.then(function(){requestAnimationFrame(function(){requestAnimationFrame(function(){_this10.resetScrollPosition();});});})):this.resetScrollPosition(),this.data=s.filteredItems,this.showNoResults=s.showNoResults,this.showSelected=!1,this.requestUpdate();}},{key:"handleInvalid",value:function handleInvalid(i){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(i);}},{key:"handleDisabledChange",value:function handleDisabledChange(){this.disabled&&(this.open=!1,this.handleOpenChange());}},{key:"handleValueChange",value:function handleValueChange(){this.selectionChanged(),this.requestUpdate(),this.portal&&this.portalManager.portalContainerElement&&this.portalManager.updatePortalAppendPosition();}},{key:"handleDataChange",value:function handleDataChange(){this.data.length>0&&this.open&&!this.showSelected&&!this.searchValue&&(this.originalOptionItems=_toConsumableArray(this.data)),this.selectionChanged(),this.optionsLoading||this.loading||0!==this.data.length?this.data.length>0&&(this.showNoResults=!1):this.showNoResults=!0,this.requestUpdate(),this.portalManager.resetMeasuredHeight(),this.portal&&this.portalManager.portalContainerElement&&this.portalManager.updatePortalAppendPosition();}},{key:"handleRenderItemConfigChange",value:function handleRenderItemConfigChange(){this.value&&this.data.length>0&&(this.selectionChanged(),this.requestUpdate());}},{key:"handleOptionsLoadingChange",value:function handleOptionsLoadingChange(){this.optionsLoading||0!==this.data.length||(this.showNoResults=!0),this.requestUpdate(),this.portal&&this.portalManager.portalContainerElement&&this.portalManager.updatePortalAppendPosition();}},{key:"handlePortalAppendChange",value:function handlePortalAppendChange(){this.open&&(this.portal?this.portalManager.setupPortalAppend():this.portalManager.cleanupPortalAppend());}},{key:"handleOpenChange",value:function(){var _handleOpenChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(!(this.open&&!this.disabled)){_context3.next=7;break;}_context3.next=3;return this.handleOpen();case 3:this.showListbox=!0;this.portal&&this.portalManager.setupPortalAppend();_context3.next=11;break;case 7:_context3.next=9;return this.handleClose();case 9:this.showListbox=!1;this.portal&&this.portalManager.cleanupPortalAppend();case 11:case"end":return _context3.stop();}},_callee2,this);}));function handleOpenChange(){return _handleOpenChange.apply(this,arguments);}return handleOpenChange;}()},{key:"handleOpen",value:function(){var _handleOpen=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _this$data;var _g,i,s;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:this.emit("nile-show",{value:this.value,name:this.name});this.addOpenListeners();this.showNoResults=!((_this$data=this.data)!==null&&_this$data!==void 0&&_this$data.length);_context4.next=5;return r(this);case 5:this.popup.active=!0;_g=g(this,"select.show",{dir:"ltr"}),i=_g.keyframes,s=_g.options;_context4.next=9;return l(this.popup.popup,i,s);case 9:this.wasShowSelectedCheckedOnClose&&(this.showSelected=!1,this.data=_toConsumableArray(this.originalOptionItems),this.wasShowSelectedCheckedOnClose=!1);this.filterVirtualOptions("");this.resetScrollPosition();this.emit("nile-after-show",{value:this.value,name:this.name});case 13:case"end":return _context4.stop();}},_callee3,this);}));function handleOpen(){return _handleOpen.apply(this,arguments);}return handleOpen;}()},{key:"handleClose",value:function(){var _handleClose=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _g2,i,s;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:this.emit("nile-hide",{value:this.value,name:this.name});this.removeOpenListeners();this.wasShowSelectedCheckedOnClose=this.showSelected;_context5.next=5;return r(this);case 5:_g2=g(this,"select.hide",{dir:"ltr"}),i=_g2.keyframes,s=_g2.options;_context5.next=8;return l(this.popup.popup,i,s);case 8:this.popup.active=!1;this.searchValue="";this.portalManager.resetMeasuredHeight();this.emit("nile-after-hide",{value:this.value,name:this.name});case 12:case"end":return _context5.stop();}},_callee4,this);}));function handleClose(){return _handleClose.apply(this,arguments);}return handleClose;}()},{key:"show",value:function(){var _show=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:if(!(!this.open&&!this.disabled)){_context6.next=2;break;}return _context6.abrupt("return",(this.open=!0,v(this,"nile-after-show")));case 2:this.open=!1;case 3:case"end":return _context6.stop();}},_callee5,this);}));function show(){return _show.apply(this,arguments);}return show;}()},{key:"hide",value:function(){var _hide=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:if(!(this.open&&!this.disabled)){_context7.next=2;break;}return _context7.abrupt("return",(this.open=!1,v(this,"nile-after-hide")));case 2:this.open=!1;case 3:case"end":return _context7.stop();}},_callee6,this);}));function hide(){return _hide.apply(this,arguments);}return hide;}()},{key:"checkValidity",value:function checkValidity(){return this.valueInput.checkValidity();}},{key:"getForm",value:function getForm(){return this.formControlController.getForm();}},{key:"reportValidity",value:function reportValidity(){return this.valueInput.reportValidity();}},{key:"setCustomValidity",value:function setCustomValidity(i){this.valueInput.setCustomValidity(i),this.formControlController.updateValidity();}},{key:"focus",value:function focus(i){this.displayInput.focus(i);}},{key:"blur",value:function blur(){this.displayInput.blur();}},{key:"onInputChange",value:function onInputChange(i){i.stopPropagation();}},{key:"render",value:function render(){var i=this.hasSlotController.test("label");this.hasSlotController.test("help-text");var n=this.hasSlotController.test("label-suffix"),o=this.hasSlotController.test("custom-select"),c=!!this.label||!!i,t=this.clearable&&!this.disabled&&this.value.length>0,e=!!this.placeholder&&0===this.value.length,r=!!this.helpText,l=!!this.errorMessage;return s(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"form-control\"\n class=","\n >\n ","\n ","\n </div>\n "])),j({"form-control":!0,"form-control--small":"small"===this.size,"form-control--medium":"medium"===this.size,"form-control--large":"large"===this.size,"form-control--has-label":c,"form-control--has-help-text":r}),this.renderLabel(c,n),this.renderFormControlInput(o,t,e,r,l));}},{key:"renderLabel",value:function renderLabel(i,n){return s(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <label\n id=\"label\"\n part=\"form-control-label\"\n class=\"form-control__label\"\n aria-hidden=","\n @click=","\n >\n <slot name=\"label\">","</slot>\n </label>\n\n ","\n "])),i?"false":"true",this.handleLabelClick,this.label,n?s(_templateObject3||(_templateObject3=_taggedTemplateLiteral([" <slot name=\"label-suffix\"></slot> "]))):"");}},{key:"renderFormControlInput",value:function renderFormControlInput(i,n,o,c,t){return s(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <div part=\"form-control-input\" class=\"form-control-input\">\n ","\n ","\n </div>\n "])),this.renderPopup(i,n,o),this.renderHelpText(c,t));}},{key:"renderPopup",value:function renderPopup(i,n,o){return s(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-popup\n class=","\n placement=","\n strategy=","\n distance=\"6\"\n ?flip=","\n ?shift=","\n sync=","\n auto-size=\"vertical\"\n auto-size-padding=\"10\"\n exportparts=\"tag__content\"\n >\n ","\n ","\n ","\n </nile-popup>\n "])),j({select:!0,"select--warning":this.warning,"select--error":this.error,"select--success":this.success,"select--standard":!0,"select--filled":this.filled,"select--pill":this.pill,"select--open":this.open,"select--disabled":this.disabled,"select--multiple":this.multiple,"select--focused":this.hasFocus,"select--placeholder-visible":o,"select--top":"top"===this.placement,"select--bottom":"bottom"===this.placement,"select--small":"small"===this.size,"select--medium":"medium"===this.size,"select--large":"large"===this.size}),this.placement,this.portal||this.hoist?"fixed":"absolute",!this.portal,!this.portal,f(this.noWidthSync?void 0:"width"),this.renderCustomSelect(i),this.renderCombobox(i,n),this.showListbox?this.renderListbox():s(_templateObject6||(_templateObject6=_taggedTemplateLiteral([""]))));}},{key:"renderCustomSelect",value:function renderCustomSelect(i){return i?s(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<slot\n slot=\"anchor\"\n name=\"custom-select\"\n class=\"custom-select\"\n @keydown=","\n @mousedown=","\n ></slot>"])),this.handleComboboxKeyDown,this.handleComboboxMouseDown):s(_templateObject8||(_templateObject8=_taggedTemplateLiteral([""])));}},{key:"renderCombobox",value:function renderCombobox(i,n){return s(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["\n <div\n part=\"combobox\"\n class=","\n slot=\"anchor\"\n @keydown=","\n @mousedown=","\n >\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n </div>\n "])),j({select__combobox:!0,"select__hide-default":i}),this.handleComboboxKeyDown,this.handleComboboxMouseDown,this.renderPrefix(),this.renderDisplayInput(),this.renderTags(),this.renderValueInput(),this.renderClearButton(n),this.renderSuffix(),this.renderExpandIcon());}},{key:"renderPrefix",value:function renderPrefix(){return s(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["\n <slot\n part=\"prefix\"\n name=\"prefix\"\n class=","\n ></slot>\n "])),j({select__prefix:!0,multiple:this.multiple}));}},{key:"renderDisplayInput",value:function renderDisplayInput(){return s(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["\n <input\n part=\"display-input\"\n class=\"select__display-input\"\n type=\"text\"\n placeholder=","\n .disabled=","\n .value=","\n autocomplete=\"off\"\n spellcheck=\"false\"\n autocapitalize=\"off\"\n readonly\n aria-controls=\"listbox\"\n aria-expanded=","\n aria-haspopup=\"listbox\"\n aria-labelledby=\"label\"\n aria-disabled=","\n aria-describedby=\"help-text\"\n role=\"combobox\"\n tabindex=\"0\"\n />\n "])),this.placeholder,this.disabled,this.displayLabel,this.open?"true":"false",this.disabled?"true":"false");}},{key:"renderTags",value:function renderTags(){var _this11=this;return this.multiple?s(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["\n <div part=\"tags\" class=\"select__tags\">\n ","\n </div>\n "])),this.selectedOptions.map(function(i,n){if(n<_this11.maxOptionsVisible||_this11.maxOptionsVisible<=0){var _o={select__invisible:n+1>_this11.oldMaxOptionsVisible&&_this11.maxOptionsVisible===1/0};return s(_templateObject13||(_templateObject13=_taggedTemplateLiteral(["\n <nile-tag\n class=","\n part=\"tag\"\n exportparts=\"\n base:tag__base,\n content:tag__content,\n remove-button:tag__remove-button,\n remove-button__base:tag__remove-button__base\n \"\n ?pill=","\n size=","\n removable\n @nile-remove=","\n >\n ","\n </nile-tag>\n "])),j(_o),_this11.pill,_this11.size,function(s){return _this11.handleTagRemove(s,i);},i.getTextLabel());}return n===_this11.maxOptionsVisible?s(_templateObject14||(_templateObject14=_taggedTemplateLiteral(["\n <span class=\"select__tags-count\"\n >+"," More\n </span>\n "])),_this11.selectedOptions.length-n):null;})):s(_templateObject15||(_templateObject15=_taggedTemplateLiteral([""])));}},{key:"renderValueInput",value:function renderValueInput(){var _this12=this;return s(_templateObject16||(_templateObject16=_taggedTemplateLiteral(["\n <input\n class=\"select__value-input\"\n type=\"text\"\n ?disabled=","\n ?required=","\n .value=","\n tabindex=\"-1\"\n aria-hidden=\"true\"\n @focus=","\n @invalid=","\n />\n "])),this.disabled,this.required,Array.isArray(this.value)?this.value.join(", "):this.value,function(){return _this12.focus();},this.handleInvalid);}},{key:"renderClearButton",value:function renderClearButton(i){return i?s(_templateObject17||(_templateObject17=_taggedTemplateLiteral(["\n <button\n part=\"clear-button\"\n class=\"select__clear\"\n type=\"button\"\n aria-label=\"clearEntry\"\n @mousedown=","\n @click=","\n tabindex=\"-1\"\n >\n <slot name=\"clear-icon\">\n <nile-icon name=\"var(--nile-icon-close, var(--ng-icon-x-close))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" library=\"system\"></nile-icon>\n </slot>\n </button>\n "])),this.handleClearMouseDown,this.handleClearClick):s(_templateObject18||(_templateObject18=_taggedTemplateLiteral([""])));}},{key:"renderSuffix",value:function renderSuffix(){return s(_templateObject19||(_templateObject19=_taggedTemplateLiteral(["\n <slot\n part=\"suffix\"\n name=\"suffix\"\n class=","\n ></slot>\n "])),j({select__suffix:!0}));}},{key:"renderExpandIcon",value:function renderExpandIcon(){return s(_templateObject20||(_templateObject20=_taggedTemplateLiteral(["\n <slot\n name=\"expand-icon\"\n part=\"expand-icon\"\n class=\"select__expand-icon\"\n >\n <nile-icon library=\"system\" name=\"var(--nile-icon-arrow-down, var(--ng-icon-chevron-down))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\"></nile-icon>\n </slot>\n "])));}},{key:"renderListbox",value:function renderListbox(){return s(_templateObject21||(_templateObject21=_taggedTemplateLiteral(["\n <div\n id=\"listbox\"\n role=\"listbox\"\n aria-expanded=","\n aria-multiselectable=","\n aria-labelledby=\"label\"\n part=\"listbox\"\n class=\"select__listbox "," ","\"\n tabindex=\"-1\"\n @mouseup=","\n style=","\n >\n ","\n ","\n ","\n ","\n </div>\n "])),this.open?"true":"false",this.multiple?"true":"false",this.searchEnabled?"select__search-enabled ":"",this.portal?"select__portal-append-hidden":"",this.handleOptionClick,this.portal?"display: none;":"",this.renderSearch(),this.renderLoader(),this.getVirtualizedContent(),this.renderFooter());}},{key:"renderSearch",value:function renderSearch(){return this.searchEnabled?s(_templateObject22||(_templateObject22=_taggedTemplateLiteral(["\n <div part=\"search\" class=\"select__search\">\n <nile-input\n size=\"small\"\n clearable\n .value=","\n placeholder=\"","\"\n @nile-input=","\n @nile-focus=","\n @nile-change=\"","\"\n >\n <nile-icon name=\"var(--nile-icon-search, var(--ng-icon-search-lg))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" slot=\"suffix\"> </nile-icon>\n </nile-input>\n </div>\n "])),this.searchValue,this.internalSearchPlaceHolder,this.handleSearchChange,this.handleSearchFocus,this.onInputChange):s(_templateObject23||(_templateObject23=_taggedTemplateLiteral([""])));}},{key:"renderLoader",value:function renderLoader(){return this.loading?s(_templateObject24||(_templateObject24=_taggedTemplateLiteral(["\n <span part=\"loader\" class=\"virtual-select-loader\">\n <nile-loader size=\"sm\"></nile-loader>\n </span>\n "]))):this.optionsLoading?s(_templateObject25||(_templateObject25=_taggedTemplateLiteral(["\n <span part=\"loader\" class=\"select__loader\">\n <nile-icon\n class=\"select__loader--icon\"\n name=\"button-loading-blue\"\n ></nile-icon>\n </span>\n "]))):s(_templateObject26||(_templateObject26=_taggedTemplateLiteral([""])));}},{key:"renderFooter",value:function renderFooter(){return this.multiple?s(_templateObject27||(_templateObject27=_taggedTemplateLiteral(["\n <div\n part=\"footer\"\n class=\"select__footer ","\"\n @click=\"","\"\n >\n <span\n @click=\"","\"\n style=\"cursor: pointer;\"\n >\n <nile-checkbox\n ?disabled=\"","\"\n ?checked=\"","\"\n >\n &nbsp; Show Selected</nile-checkbox\n >\n </span>\n ","\n </div>\n "])),this.loading?"loading":"",this.handleFooterClick,this.toggleShowSelected,0===this.selectedOptions.length,this.showSelected,0!==this.selectedOptions.length?s(_templateObject28||(_templateObject28=_taggedTemplateLiteral(["\n <span\n class=\"select__clear\"\n @click=\"","\"\n >\n Clear All\n </span>\n "])),this.unSelectAll):""):s(_templateObject29||(_templateObject29=_taggedTemplateLiteral([""])));}},{key:"renderHelpText",value:function renderHelpText(i,n){return s(_templateObject30||(_templateObject30=_taggedTemplateLiteral(["\n ","\n ","\n "])),i?s(_templateObject31||(_templateObject31=_taggedTemplateLiteral([" <nile-form-help-text>","</nile-form-help-text> "])),this.helpText):"",n?s(_templateObject32||(_templateObject32=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"");}},{key:"getVirtualizedContent",value:function getVirtualizedContent(){var _this$renderItemConfi6,_this$renderItemConfi7;return y.getVirtualizedContent(this.data,this.searchEnabled,this.getDisplayText.bind(this),this.value,this.multiple,(_this$renderItemConfi6=this.renderItemConfig)===null||_this$renderItemConfi6===void 0?void 0:_this$renderItemConfi6.getDisplayText,(_this$renderItemConfi7=this.renderItemConfig)===null||_this$renderItemConfi7===void 0?void 0:_this$renderItemConfi7.getValue,this.showNoResults,this.noResultsMessage,this.optionsLoading||this.loading,this.handleScroll.bind(this));}},{key:"nileInput",value:function nileInput(i){this.emit("nile-input",i);}},{key:"nileChange",value:function nileChange(i){this.emit("nile-change",i);}},{key:"updateValidity",value:function updateValidity(){var _this13=this;this.updateComplete.then(function(){_this13.formControlController.updateValidity();});}},{key:"calculateWidthOfSelectTagsDiv",value:function calculateWidthOfSelectTagsDiv(){if(this.shadowRoot){var _i5=this.shadowRoot.querySelector(".select__tags");if(_i5){return _i5.offsetWidth-70;}}return null;}},{key:"calculateTotalWidthOfTags",value:function calculateTotalWidthOfTags(){var _this14=this;this.maxOptionsVisible!==1/0&&(this.oldMaxOptionsVisible=this.maxOptionsVisible),this.maxOptionsVisible=1/0,setTimeout(function(){var i=[];if(_this14.shadowRoot){_this14.shadowRoot.querySelectorAll("nile-tag").forEach(function(s){s instanceof HTMLElement&&i.push(s.offsetWidth);});}if(_this14.value.length!==i.length)return;var s=_this14.calculateWidthOfSelectTagsDiv();if(!s)return;var n=0,o=0;for(var _c=0;_c<i.length;_c++)if(n+=i[_c],n>s){o=_c;break;}_this14.maxOptionsVisible=o;},1);}},{key:"resetScrollPosition",value:function(){var _resetScrollPosition=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _this15=this;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return this.updateComplete;case 2:requestAnimationFrame(function(){requestAnimationFrame(function(){var _this15$shadowRoot;var i=null;if(i=_this15.portal&&_this15.portalManager.portalContainerElement?_this15.portalManager.portalContainerElement.querySelector("#listbox"):(_this15$shadowRoot=_this15.shadowRoot)===null||_this15$shadowRoot===void 0?void 0:_this15$shadowRoot.querySelector("#listbox"),!i||!i.isConnected)return;i.scrollTop=0;var s=i.querySelector(".virtualized");if(s&&s.isConnected){_this15.data.length<=5?(s.style.overflowY="hidden",s.style.maxHeight="none",i.style.overflowY="hidden",i.style.maxHeight="fit-content"):(s.style.overflowY="auto",s.style.maxHeight="",i.style.overflowY="auto",i.style.maxHeight=""),s.scrollTop=0;}var n=i.querySelector("lit-virtualizer");n&&n.isConnected&&(n.scrollTop=0);});});case 3:case"end":return _context8.stop();}},_callee7,this);}));function resetScrollPosition(){return _resetScrollPosition.apply(this,arguments);}return resetScrollPosition;}()}]);}(u));k.styles=e,i([n(".select")],k.prototype,"popup",void 0),i([n(".select__combobox")],k.prototype,"combobox",void 0),i([n(".select__display-input")],k.prototype,"displayInput",void 0),i([n(".select__value-input")],k.prototype,"valueInput",void 0),i([n(".virtualized")],k.prototype,"virtualizedContainer",void 0),i([o()],k.prototype,"hasFocus",void 0),i([o()],k.prototype,"displayLabel",void 0),i([o()],k.prototype,"selectedOptions",void 0),i([o()],k.prototype,"oldValue",void 0),i([c()],k.prototype,"name",void 0),i([c({type:Array})],k.prototype,"data",void 0),i([o()],k.prototype,"originalOptionItems",void 0),i([c({converter:{fromAttribute:function fromAttribute(i){return i.split(" ");},toAttribute:function toAttribute(i){return i.join(" ");}}})],k.prototype,"value",void 0),i([a()],k.prototype,"defaultValue",void 0),i([c()],k.prototype,"size",void 0),i([c()],k.prototype,"placeholder",void 0),i([c({type:Boolean})],k.prototype,"autoResize",void 0),i([o()],k.prototype,"searchValue",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"searchEnabled",void 0),i([c({attribute:"internal-search-placeholder"})],k.prototype,"internalSearchPlaceHolder",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"disableLocalSearch",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"optionsLoading",void 0),i([c({type:Boolean,reflect:!0,attribute:!0})],k.prototype,"loading",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"multiple",void 0),i([c({attribute:"help-text",reflect:!0})],k.prototype,"helpText",void 0),i([c({attribute:"error-message",reflect:!0})],k.prototype,"errorMessage",void 0),i([c({type:Boolean})],k.prototype,"warning",void 0),i([c({type:Boolean})],k.prototype,"error",void 0),i([c({type:Boolean})],k.prototype,"success",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"disabled",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"clearable",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"open",void 0),i([c({type:Boolean})],k.prototype,"hoist",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"filled",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"pill",void 0),i([c()],k.prototype,"label",void 0),i([c({reflect:!0})],k.prototype,"placement",void 0),i([c({reflect:!0})],k.prototype,"form",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"required",void 0),i([c({type:Boolean})],k.prototype,"showNoResults",void 0),i([c({type:String})],k.prototype,"noResultsMessage",void 0),i([c({type:Boolean})],k.prototype,"showSelected",void 0),i([c({attribute:!1})],k.prototype,"renderItemConfig",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"blockValueChange",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"noWidthSync",void 0),i([c({type:Boolean,reflect:!0})],k.prototype,"portal",void 0),i([c({attribute:"max-options-visible",type:Number})],k.prototype,"maxOptionsVisible",void 0),i([o()],k.prototype,"oldMaxOptionsVisible",void 0),i([o()],k.prototype,"showListbox",void 0),i([o()],k.prototype,"wasShowSelectedCheckedOnClose",void 0),i([d("disabled",{waitUntilFirstUpdate:!0})],k.prototype,"handleDisabledChange",null),i([d("value",{waitUntilFirstUpdate:!0})],k.prototype,"handleValueChange",null),i([d("data",{waitUntilFirstUpdate:!0})],k.prototype,"handleDataChange",null),i([d("renderItemConfig",{waitUntilFirstUpdate:!0})],k.prototype,"handleRenderItemConfigChange",null),i([d("optionsLoading",{waitUntilFirstUpdate:!0})],k.prototype,"handleOptionsLoadingChange",null),i([d("portal",{waitUntilFirstUpdate:!0})],k.prototype,"handlePortalAppendChange",null),i([d("open",{waitUntilFirstUpdate:!0})],k.prototype,"handleOpenChange",null),_export("N",k=i([t("nile-virtual-select")],k)),m("select.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),m("select.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});}};});
6
6
  //# sourceMappingURL=nile-virtual-select.cjs.js.map