@aquera/nile-elements 1.2.0-beta-1.0 → 1.2.0-beta-1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/demo/index.html +1 -2
- package/dist/index.js +2 -1
- package/dist/nile-select/virtual-scroll-helper.cjs.js +1 -1
- package/dist/nile-select/virtual-scroll-helper.cjs.js.map +1 -1
- package/dist/nile-select/virtual-scroll-helper.esm.js +1 -0
- package/dist/src/nile-select/virtual-scroll-helper.js +1 -0
- package/dist/src/nile-select/virtual-scroll-helper.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-select/virtual-scroll-helper.ts +1 -0
package/demo/index.html
CHANGED
|
@@ -152,14 +152,13 @@
|
|
|
152
152
|
getSearchText: (item) => item.label,
|
|
153
153
|
getGroupKey: (item) => item.groupName,
|
|
154
154
|
getGroupDisplayText: (groupKey) => {
|
|
155
|
-
// Map group keys to display text (like nile-select)
|
|
156
155
|
const groupDisplayMap = {
|
|
157
156
|
'FRUITS': 'Fruits123',
|
|
158
157
|
'VEGETABLES': 'Vegetables123',
|
|
159
158
|
'ANIMALS': 'Animals123',
|
|
160
159
|
'COLORS': 'Colors123'
|
|
161
160
|
};
|
|
162
|
-
return groupDisplayMap[groupKey]
|
|
161
|
+
return groupDisplayMap[groupKey];
|
|
163
162
|
}
|
|
164
163
|
};
|
|
165
164
|
|
package/dist/index.js
CHANGED
|
@@ -4961,6 +4961,7 @@ class mi{constructor(e){this._element=null;const t=e??window;this._node=t,e&&(th
|
|
|
4961
4961
|
.open=${e.open}
|
|
4962
4962
|
.loading=${e.loading}
|
|
4963
4963
|
.portal=${e.portal}
|
|
4964
|
+
.enableGroupHeader=${e.enableGroupHeader}
|
|
4964
4965
|
exportparts="
|
|
4965
4966
|
select-options,
|
|
4966
4967
|
select-no-results,
|
|
@@ -14024,7 +14025,7 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
|
|
|
14024
14025
|
|
|
14025
14026
|
|
|
14026
14027
|
|
|
14027
|
-
`,oS={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 rS=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(),$p(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(nS.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=oS[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?eS(this.editorEl,"backgroundColor",M,"data-rte-bg"):function(e,t){eS(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=Hp(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&&qp(this.editorEl,M),this.updateContent(),this.updateToolbarState()}))}}else e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;Jp(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":$p(this.editorEl,"strong");break;case"italic":$p(this.editorEl,"em");break;case"underline":$p(this.editorEl,"u");break;case"left":Jp(this.editorEl,"left");break;case"center":Jp(this.editorEl,"center");break;case"right":Jp(this.editorEl,"right");break;case"justify":Jp(this.editorEl,"justify");break;case"ul":iS(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":iS(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=Hp(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=Xp(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=Xp(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})],rS.prototype,"value",void 0),e([ue({type:Boolean,attribute:!0,reflect:!0})],rS.prototype,"noStyles",void 0),e([ue({type:Boolean,attribute:"singlelineeditor",reflect:!0})],rS.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)}})],rS.prototype,"mentions",void 0),e([ce()],rS.prototype,"content",void 0),rS=e([le("nile-rich-text-editor")],rS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.2.0-beta-1.0"',window.nileVersion="__NILE_VERSION__");const sS=r`
|
|
14028
|
+
`,oS={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 rS=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(),$p(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(nS.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=oS[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?eS(this.editorEl,"backgroundColor",M,"data-rte-bg"):function(e,t){eS(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=Hp(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&&qp(this.editorEl,M),this.updateContent(),this.updateToolbarState()}))}}else e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;Jp(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":$p(this.editorEl,"strong");break;case"italic":$p(this.editorEl,"em");break;case"underline":$p(this.editorEl,"u");break;case"left":Jp(this.editorEl,"left");break;case"center":Jp(this.editorEl,"center");break;case"right":Jp(this.editorEl,"right");break;case"justify":Jp(this.editorEl,"justify");break;case"ul":iS(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":iS(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=Hp(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=Xp(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=Xp(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})],rS.prototype,"value",void 0),e([ue({type:Boolean,attribute:!0,reflect:!0})],rS.prototype,"noStyles",void 0),e([ue({type:Boolean,attribute:"singlelineeditor",reflect:!0})],rS.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)}})],rS.prototype,"mentions",void 0),e([ce()],rS.prototype,"content",void 0),rS=e([le("nile-rich-text-editor")],rS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.2.0-beta-1.1"',window.nileVersion="__NILE_VERSION__");const sS=r`
|
|
14028
14029
|
:host {
|
|
14029
14030
|
--sidebar-width: 240px;
|
|
14030
14031
|
--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 .enableGroupHeader=","\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,_l.enableGroupHeader);}}]);}());}};});
|
|
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,
|
|
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 .enableGroupHeader=${component.enableGroupHeader}\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","enableGroupHeader"],"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,8kDAGGR,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,CACCzC,EAAU0C,CAAAA,iBAAAA,EA0BtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-scroll-helper.js","sourceRoot":"","sources":["../../../src/nile-select/virtual-scroll-helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAG9B,YAAY,SAAsB;QAChC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,wBAAwB;QACtB,MAAM,SAAS,GAAG,IAAI,CAAC,SAAgB,CAAC;QAExC,OAAO,IAAI,CAAA;;;kBAGG,SAAS,CAAC,IAAI;mBACb,SAAS,CAAC,KAAK;wBACV,SAAS,CAAC,UAAU;yBACnB,SAAS,CAAC,WAAW;kBAC5B,SAAS,CAAC,IAAI;2BACL,SAAS,CAAC,aAAa;uCACX,SAAS,CAAC,yBAAyB;gCAC1C,SAAS,CAAC,kBAAkB;4BAChC,SAAS,CAAC,cAAc;sBAC9B,SAAS,CAAC,QAAQ;sBAClB,SAAS,CAAC,QAAQ;0BACd,SAAS,CAAC,YAAY;qBAC3B,SAAS,CAAC,OAAO;mBACnB,SAAS,CAAC,KAAK;qBACb,SAAS,CAAC,OAAO;sBAChB,SAAS,CAAC,QAAQ;uBACjB,SAAS,CAAC,SAAS;mBACvB,SAAS,CAAC,KAAK;oBACd,SAAS,CAAC,MAAM;kBAClB,SAAS,CAAC,IAAI;mBACb,SAAS,CAAC,KAAK;uBACX,SAAS,CAAC,SAAS;kBACxB,SAAS,CAAC,IAAI;sBACV,SAAS,CAAC,QAAQ;2BACb,SAAS,CAAC,aAAa;8BACpB,SAAS,CAAC,gBAAgB;8BAC1B,SAAS,CAAC,gBAAgB;8BAC1B,SAAS,CAAC,gBAAgB;yBAC/B,SAAS,CAAC,WAAW;+BACf,SAAS,CAAC,iBAAiB;kBACxC,SAAS,CAAC,IAAI;kBACd,SAAS,CAAC,IAAI;qBACX,SAAS,CAAC,OAAO;oBAClB,SAAS,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"virtual-scroll-helper.js","sourceRoot":"","sources":["../../../src/nile-select/virtual-scroll-helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAG9B,YAAY,SAAsB;QAChC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,wBAAwB;QACtB,MAAM,SAAS,GAAG,IAAI,CAAC,SAAgB,CAAC;QAExC,OAAO,IAAI,CAAA;;;kBAGG,SAAS,CAAC,IAAI;mBACb,SAAS,CAAC,KAAK;wBACV,SAAS,CAAC,UAAU;yBACnB,SAAS,CAAC,WAAW;kBAC5B,SAAS,CAAC,IAAI;2BACL,SAAS,CAAC,aAAa;uCACX,SAAS,CAAC,yBAAyB;gCAC1C,SAAS,CAAC,kBAAkB;4BAChC,SAAS,CAAC,cAAc;sBAC9B,SAAS,CAAC,QAAQ;sBAClB,SAAS,CAAC,QAAQ;0BACd,SAAS,CAAC,YAAY;qBAC3B,SAAS,CAAC,OAAO;mBACnB,SAAS,CAAC,KAAK;qBACb,SAAS,CAAC,OAAO;sBAChB,SAAS,CAAC,QAAQ;uBACjB,SAAS,CAAC,SAAS;mBACvB,SAAS,CAAC,KAAK;oBACd,SAAS,CAAC,MAAM;kBAClB,SAAS,CAAC,IAAI;mBACb,SAAS,CAAC,KAAK;uBACX,SAAS,CAAC,SAAS;kBACxB,SAAS,CAAC,IAAI;sBACV,SAAS,CAAC,QAAQ;2BACb,SAAS,CAAC,aAAa;8BACpB,SAAS,CAAC,gBAAgB;8BAC1B,SAAS,CAAC,gBAAgB;8BAC1B,SAAS,CAAC,gBAAgB;yBAC/B,SAAS,CAAC,WAAW;+BACf,SAAS,CAAC,iBAAiB;kBACxC,SAAS,CAAC,IAAI;kBACd,SAAS,CAAC,IAAI;qBACX,SAAS,CAAC,OAAO;oBAClB,SAAS,CAAC,MAAM;+BACL,SAAS,CAAC,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;KAyBrD,CAAC;IACJ,CAAC;CACF","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 .enableGroupHeader=${component.enableGroupHeader}\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"]}
|
package/dist/src/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Version utility - placeholders will be replaced during build
|
|
2
|
-
export const NILE_ELEMENTS_VERSION = '1.2.0-beta-1.
|
|
2
|
+
export const NILE_ELEMENTS_VERSION = '1.2.0-beta-1.1';
|
|
3
3
|
export const NILE_VERSION = '1.0.7';
|
|
4
4
|
// Set global versions for runtime access
|
|
5
5
|
if (typeof window !== 'undefined') {
|
package/dist/src/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,MAAM,CAAC,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AACjE,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAE/C,yCAAyC;AACzC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IACjC,MAAc,CAAC,mBAAmB,GAAG,qBAAqB,CAAC;IAC3D,MAAc,CAAC,WAAW,GAAG,YAAY,CAAC;AAC7C,CAAC","sourcesContent":["// Version utility - placeholders will be replaced during build\nexport const NILE_ELEMENTS_VERSION = '1.2.0-beta-1.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,MAAM,CAAC,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AACjE,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAE/C,yCAAyC;AACzC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IACjC,MAAc,CAAC,mBAAmB,GAAG,qBAAqB,CAAC;IAC3D,MAAc,CAAC,WAAW,GAAG,YAAY,CAAC;AAC7C,CAAC","sourcesContent":["// Version utility - placeholders will be replaced during build\nexport const NILE_ELEMENTS_VERSION = '1.2.0-beta-1.1';\nexport const NILE_VERSION = '1.0.7';\n\n// Set global versions for runtime access\nif (typeof window !== 'undefined') {\n (window as any).nileElementsVersion = NILE_ELEMENTS_VERSION;\n (window as any).nileVersion = NILE_VERSION;\n}\n"]}
|