@aquera/nile-elements 0.1.49-beta-1.4 → 0.1.50-beta-1.0
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 +3 -0
- package/demo/index.html +106 -29
- package/dist/nile-select/nile-select.cjs.js +1 -1
- package/dist/nile-select/nile-select.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.esm.js +2 -2
- 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 -1
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js.map +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.esm.js +2 -2
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js.map +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.test.esm.js +12 -12
- package/dist/nile-virtual-select/renderer.cjs.js +1 -1
- package/dist/nile-virtual-select/renderer.cjs.js.map +1 -1
- package/dist/nile-virtual-select/renderer.esm.js +8 -7
- package/dist/nile-virtual-select/search-manager.cjs.js +1 -1
- package/dist/nile-virtual-select/search-manager.cjs.js.map +1 -1
- package/dist/nile-virtual-select/search-manager.esm.js +1 -1
- package/dist/nile-virtual-select/selection-manager.cjs.js +1 -1
- package/dist/nile-virtual-select/selection-manager.cjs.js.map +1 -1
- package/dist/nile-virtual-select/selection-manager.esm.js +1 -1
- package/dist/src/nile-select/nile-select.d.ts +3 -1
- package/dist/src/nile-select/nile-select.js +1 -2
- package/dist/src/nile-select/nile-select.js.map +1 -1
- package/dist/src/nile-select/virtual-scroll-helper.js +1 -1
- package/dist/src/nile-select/virtual-scroll-helper.js.map +1 -1
- package/dist/src/nile-virtual-select/nile-virtual-select.d.ts +16 -4
- package/dist/src/nile-virtual-select/nile-virtual-select.js +35 -10
- package/dist/src/nile-virtual-select/nile-virtual-select.js.map +1 -1
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js +36 -12
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js.map +1 -1
- package/dist/src/nile-virtual-select/renderer.d.ts +2 -2
- package/dist/src/nile-virtual-select/renderer.js +8 -5
- package/dist/src/nile-virtual-select/renderer.js.map +1 -1
- package/dist/src/nile-virtual-select/search-manager.d.ts +1 -1
- package/dist/src/nile-virtual-select/search-manager.js +3 -2
- package/dist/src/nile-virtual-select/search-manager.js.map +1 -1
- package/dist/src/nile-virtual-select/selection-manager.d.ts +1 -1
- package/dist/src/nile-virtual-select/selection-manager.js +10 -3
- package/dist/src/nile-virtual-select/selection-manager.js.map +1 -1
- package/dist/src/nile-virtual-select/types.d.ts +6 -1
- package/dist/src/nile-virtual-select/types.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-select/nile-select.ts +3 -1
- package/src/nile-select/virtual-scroll-helper.ts +1 -1
- package/src/nile-virtual-select/nile-virtual-select.test.ts +36 -12
- package/src/nile-virtual-select/nile-virtual-select.ts +44 -10
- package/src/nile-virtual-select/renderer.ts +13 -5
- package/src/nile-virtual-select/search-manager.ts +4 -2
- package/src/nile-virtual-select/selection-manager.ts +16 -5
- package/src/nile-virtual-select/types.ts +7 -1
- package/vscode-html-custom-data.json +2 -2
@@ -2,48 +2,48 @@ import{f as t,a as e}from"../fixture-372df3b0.esm.js";import{html as l}from"lit/
|
|
2
2
|
<nile-virtual-select multiple max-options-visible="2">
|
3
3
|
<div slot="label">Test Select</div>
|
4
4
|
</nile-virtual-select>
|
5
|
-
`);i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"},{value:"option-3",label:"Option 3"},{value:"option-4",label:"Option 4"}],i.
|
5
|
+
`);i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"},{value:"option-3",label:"Option 3"},{value:"option-4",label:"Option 4"}],i.renderItemConfig={getDisplayText:t=>t.label},i.value=["option-1","option-2","option-3"],await i.updateComplete;const o=i.shadowRoot?.querySelector(".select__tags-count");e(o).to.exist,e(o?.textContent?.trim()).to.equal("+1 More")})),it('should not show "+n More" when selected options are within maxOptionsVisible limit',(async()=>{const i=await t(l`
|
6
6
|
<nile-virtual-select multiple max-options-visible="3">
|
7
7
|
<div slot="label">Test Select</div>
|
8
8
|
</nile-virtual-select>
|
9
|
-
`);i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"},{value:"option-3",label:"Option 3"}],i.
|
9
|
+
`);i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"},{value:"option-3",label:"Option 3"}],i.renderItemConfig={getDisplayText:t=>t.label},i.value=["option-1","option-2"],await i.updateComplete;const o=i.shadowRoot?.querySelector(".select__tags-count");e(o).to.not.exist})),it("should show all tags when maxOptionsVisible is 0",(async()=>{const i=await t(l`
|
10
10
|
<nile-virtual-select multiple max-options-visible="0">
|
11
11
|
<div slot="label">Test Select</div>
|
12
12
|
</nile-virtual-select>
|
13
|
-
`);i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"},{value:"option-3",label:"Option 3"},{value:"option-4",label:"Option 4"}],i.
|
13
|
+
`);i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"},{value:"option-3",label:"Option 3"},{value:"option-4",label:"Option 4"}],i.renderItemConfig={getDisplayText:t=>t.label},i.value=["option-1","option-2","option-3","option-4"],await i.updateComplete;const o=i.shadowRoot?.querySelector(".select__tags-count");e(o).to.not.exist;const n=i.shadowRoot?.querySelectorAll("nile-tag");e(n?.length).to.equal(4)}))})),describe("option width functionality",(()=>{it("should render options with full width",(async()=>{const i=await t(l`
|
14
14
|
<nile-virtual-select>
|
15
15
|
<div slot="label">Test Select</div>
|
16
16
|
</nile-virtual-select>
|
17
|
-
`);i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"},{value:"option-3",label:"Option 3"}],i.
|
17
|
+
`);i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"},{value:"option-3",label:"Option 3"}],i.renderItemConfig={getDisplayText:t=>t.label},i.open=!0,await i.updateComplete;const o=i.shadowRoot?.querySelector(".virtualized");e(o).to.exist;const n=i.shadowRoot?.querySelector(".select__options");e(n).to.exist;const a=i.shadowRoot?.querySelector(".select__listbox");e(a).to.exist,e(a?.querySelector(".select__options")).to.exist})),it("should render options with proper CSS classes for width",(async()=>{const i=await t(l`
|
18
18
|
<nile-virtual-select>
|
19
19
|
<div slot="label">Test Select</div>
|
20
20
|
</nile-virtual-select>
|
21
|
-
`);i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"}],i.
|
21
|
+
`);i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"}],i.renderItemConfig={getDisplayText:t=>t.label},i.open=!0,await i.updateComplete;const o=i.shadowRoot?.querySelector(".virtualized");e(o).to.exist;const n=i.shadowRoot?.querySelector(".select__options");e(n).to.exist;const a=i.shadowRoot?.querySelector("lit-virtualizer");e(a).to.exist})),it("should render virtualized options with full width structure",(async()=>{const i=await t(l`
|
22
22
|
<nile-virtual-select>
|
23
23
|
<div slot="label">Test Select</div>
|
24
24
|
</nile-virtual-select>
|
25
|
-
`);i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"},{value:"option-3",label:"Option 3"}],i.
|
25
|
+
`);i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"},{value:"option-3",label:"Option 3"}],i.renderItemConfig={getDisplayText:t=>t.label},i.open=!0,await i.updateComplete;const o=i.shadowRoot?.querySelector(".select__listbox");e(o).to.exist;const n=o?.querySelector(".select__options");e(n).to.exist;const a=n?.querySelector(".virtualized");e(a).to.exist,e(o?.contains(n||null)).to.be.true,e(n?.contains(a||null)).to.be.true}))})),describe("selected options highlighting",(()=>{it("should highlight selected options with red border in single select mode",(async()=>{const i=await t(l`
|
26
26
|
<nile-virtual-select>
|
27
27
|
<div slot="label">Test Select</div>
|
28
28
|
</nile-virtual-select>
|
29
|
-
`);i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"},{value:"option-3",label:"Option 3"}],i.
|
29
|
+
`);i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"},{value:"option-3",label:"Option 3"}],i.renderItemConfig={getDisplayText:t=>t.label},i.value="option-2",i.open=!0,await i.updateComplete;const o=i.shadowRoot?.querySelector("nile-option[selected]");e(o).to.exist,e(o?.getAttribute("value")).to.equal("option-2")})),it("should highlight selected options with red border in multiple select mode",(async()=>{const i=await t(l`
|
30
30
|
<nile-virtual-select multiple>
|
31
31
|
<div slot="label">Test Select</div>
|
32
32
|
</nile-virtual-select>
|
33
|
-
`);i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"},{value:"option-3",label:"Option 3"}],i.
|
33
|
+
`);i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"},{value:"option-3",label:"Option 3"}],i.renderItemConfig={getDisplayText:t=>t.label},i.value=["option-1","option-3"],i.open=!0,await i.updateComplete;const o=i.shadowRoot?.querySelectorAll("nile-option[selected]");e(o?.length).to.equal(2);const n=Array.from(o||[]).map((t=>t.getAttribute("value")));e(n).to.include("option-1"),e(n).to.include("option-3")})),it("should not highlight unselected options",(async()=>{const i=await t(l`
|
34
34
|
<nile-virtual-select>
|
35
35
|
<div slot="label">Test Select</div>
|
36
36
|
</nile-virtual-select>
|
37
|
-
`);i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"},{value:"option-3",label:"Option 3"}],i.
|
37
|
+
`);i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"},{value:"option-3",label:"Option 3"}],i.renderItemConfig={getDisplayText:t=>t.label},i.value="option-2",i.open=!0,await i.updateComplete;const o=i.shadowRoot?.querySelector('nile-option[value="option-1"]');e(o).to.exist,e(o?.hasAttribute("selected")).to.be.false})),it("should show tags for pre-selected values when data is set after value",(async()=>{const i=await t(l`
|
38
38
|
<nile-virtual-select multiple>
|
39
39
|
<div slot="label">Test Select</div>
|
40
40
|
</nile-virtual-select>
|
41
|
-
`);i.
|
41
|
+
`);i.renderItemConfig={getDisplayText:t=>t.label},i.value=["option-1","option-3"],await i.updateComplete;const o=i.shadowRoot?.querySelectorAll("nile-tag");e(o?.length).to.equal(0),i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"},{value:"option-3",label:"Option 3"}],await i.updateComplete;const n=i.shadowRoot?.querySelectorAll("nile-tag");e(n?.length).to.equal(2);const a=Array.from(n||[]).map((t=>t.textContent?.trim()));e(a).to.include("Option 1"),e(a).to.include("Option 3")})),it("should show tags immediately without opening dropdown",(async()=>{const i=await t(l`
|
42
42
|
<nile-virtual-select multiple>
|
43
43
|
<div slot="label">Test Select</div>
|
44
44
|
</nile-virtual-select>
|
45
|
-
`);i.
|
45
|
+
`);i.renderItemConfig={getDisplayText:t=>t.label},i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"},{value:"option-3",label:"Option 3"}],i.value=["option-1","option-3"],await i.updateComplete,i.open=!1,await i.updateComplete;const o=i.shadowRoot?.querySelectorAll("nile-tag");e(o?.length).to.equal(2);const n=Array.from(o||[]).map((t=>t.textContent?.trim()));e(n).to.include("Option 1"),e(n).to.include("Option 3")})),it("should show checkbox as checked for selected options in multiple mode",(async()=>{const i=await t(l`
|
46
46
|
<nile-virtual-select multiple>
|
47
47
|
<div slot="label">Test Select</div>
|
48
48
|
</nile-virtual-select>
|
49
|
-
`);i.
|
49
|
+
`);i.renderItemConfig={getDisplayText:t=>t.label},i.data=[{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"},{value:"option-3",label:"Option 3"}],i.value=["option-1","option-3"],i.open=!0,await i.updateComplete;const o=i.shadowRoot?.querySelectorAll("nile-option[selected]");e(o?.length).to.equal(2),o?.forEach((t=>{const l=t.shadowRoot?.querySelector("nile-checkbox");e(l).to.exist,e(l?.checked).to.be.true}));const n=i.shadowRoot?.querySelector('nile-option[value="option-2"]');e(n).to.exist;const a=n?.shadowRoot?.querySelector("nile-checkbox");e(a).to.exist,e(a?.checked).to.be.false}))}))}));
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["lit","../virtualize-b6a2fbe0.cjs.js","lit/directives/unsafe-html.js","lit/directive.js","lit/async-directive.js","lit/directives/repeat.js"],function(_export,_context){"use strict";var t,
|
1
|
+
System.register(["lit","../virtualize-b6a2fbe0.cjs.js","lit/directives/unsafe-html.js","lit/directive.js","lit/async-directive.js","lit/directives/repeat.js"],function(_export,_context){"use strict";var e,t,i,_templateObject,_templateObject2,r;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;},function(_virtualize001CjsJs){t=_virtualize001CjsJs.v;},function(_litDirectivesUnsafeHtmlJs){i=_litDirectivesUnsafeHtmlJs.unsafeHTML;},function(_litDirectiveJs){},function(_litAsyncDirectiveJs){},function(_litDirectivesRepeatJs){}],execute:function execute(){_export("V",r=/*#__PURE__*/function(){function r(){_classCallCheck(this,r);}return _createClass(r,null,[{key:"getVirtualizedContent",value:function getVirtualizedContent(i,s,l,o,a,c,n){return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"select__options ","\">\n <div\n class=\"virtualized\"\n >\n ","\n </div>\n </div>"])),s?"select__options__search-enabled":"",t({items:i,renderItem:function renderItem(e){return r.getItemRenderFunction(e,l,o,a,c,n);},scroller:!0}));}},{key:"getItemRenderFunction",value:function getItemRenderFunction(t,_r,s,l,o,a){var c=o||_r,n=a||function(e){return(e===null||e===void 0?void 0:e.value)||e;},d=n(t),m=c(t),p=t.disabled||!1;var v=!1;return v=l?Array.isArray(s)&&s.includes(d):(Array.isArray(s)?s[0]:s)===d,e(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-option \n value="," \n .selected="," \n .multiple=","\n .disabled=","\n .showCheckbox=","\n >\n ","\n </nile-option>\n "])),d,v,l,p,l,i(m));}}]);}());}};});
|
2
2
|
//# sourceMappingURL=renderer.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"renderer.cjs.js","sources":["../../../src/nile-virtual-select/renderer.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, type TemplateResult } from 'lit';\nimport { virtualize } from '@lit-labs/virtualizer/virtualize.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\n\nexport class VirtualSelectRenderer {\n static getVirtualizedContent(\n data: any[], \n searchEnabled: boolean, \n renderItemFunction: (item: any) => string,\n value: string | string[],\n multiple: boolean\n ): TemplateResult {\n return html`\n <div class=\"select__options ${\n searchEnabled ? 'select__options__search-enabled' : ``\n }\">\n <div\n class=\"virtualized\"\n >\n ${virtualize({\n items: data,\n renderItem: (item: any): TemplateResult =>\n VirtualSelectRenderer.getItemRenderFunction(item, renderItemFunction, value, multiple),\n scroller: true,\n })}\n </div>\n </div>`;\n }\n\n static getItemRenderFunction(\n item: any, \n renderItemFunction: (item: any) => string, \n value: string | string[], \n multiple: boolean\n ): TemplateResult {\n const
|
1
|
+
{"version":3,"file":"renderer.cjs.js","sources":["../../../src/nile-virtual-select/renderer.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, type TemplateResult } from 'lit';\nimport { virtualize } from '@lit-labs/virtualizer/virtualize.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\n\nexport class VirtualSelectRenderer {\n static getVirtualizedContent(\n data: any[], \n searchEnabled: boolean, \n renderItemFunction: (item: any) => string,\n value: string | string[],\n multiple: boolean,\n getDisplayText?: (item: any) => string,\n getItemValue?: (item: any) => string\n ): TemplateResult {\n return html`\n <div class=\"select__options ${\n searchEnabled ? 'select__options__search-enabled' : ``\n }\">\n <div\n class=\"virtualized\"\n >\n ${virtualize({\n items: data,\n renderItem: (item: any): TemplateResult =>\n VirtualSelectRenderer.getItemRenderFunction(item, renderItemFunction, value, multiple, getDisplayText, getItemValue),\n scroller: true,\n })}\n </div>\n </div>`;\n }\n\n static getItemRenderFunction(\n item: any, \n renderItemFunction: (item: any) => string, \n value: string | string[], \n multiple: boolean,\n getDisplayText?: (item: any) => string,\n getItemValue?: (item: any) => string\n ): TemplateResult {\n const displayTextFn = getDisplayText || renderItemFunction;\n const valueFn = getItemValue || ((item: any) => item?.value || item);\n \n const optionValue = valueFn(item);\n const displayText = displayTextFn(item);\n const isDisabled = item.disabled || false;\n \n let isSelected = false;\n if (multiple) {\n isSelected = Array.isArray(value) && value.includes(optionValue);\n } else {\n isSelected = (Array.isArray(value) ? value[0] : value) === optionValue;\n }\n \n return html`\n <nile-option \n value=${optionValue} \n .selected=${isSelected} \n .multiple=${multiple}\n .disabled=${isDisabled}\n .showCheckbox=${multiple}\n >\n ${unsafeHTML(displayText)}\n </nile-option>\n `;\n }\n} \n"],"names":["VirtualSelectRenderer","getVirtualizedContent","data","searchEnabled","renderItemFunction","value","multiple","getDisplayText","getItemValue","html","_templateObject","_taggedTemplateLiteral","virtualize","items","renderItem","item","getItemRenderFunction","scroller","key","displayTextFn","valueFn","optionValue","displayText","isDisabled","disabled","isSelected","Array","isArray","includes","_templateObject2","unsafeHTML"],"mappings":"2wDAWaA,CAAAA,kCAAAA,EAAAA,EAAAA,eAAAA,MAAAA,CAAAA,UAAAA,YAAAA,CAAAA,CAAAA,QAAAA,GAAAA,yBAAAA,KAAAA,CACX,8BAAOC,CACLC,CAAAA,CACAC,EACAC,CACAC,CAAAA,CAAAA,CACAC,EACAC,CACAC,CAAAA,CAAAA,CAAAA,CAEA,MAAOC,CAAAA,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,0JAEPR,CAAAA,CAAgB,iCAAoC,CAAA,EAAA,CAKhDS,CAAAA,CAAW,CACXC,KAAAA,CAAOX,CACPY,CAAAA,UAAAA,CAAaC,QAAbD,CAAAA,UAAAA,CAAaC,CACXf,QAAAA,CAAAA,CAAAA,CAAsBgB,qBAAsBD,CAAAA,CAAAA,CAAMX,CAAoBC,CAAAA,CAAAA,CAAOC,CAAUC,CAAAA,CAAAA,CAAgBC,KACzGS,QAAU,CAAA,CAAA,CAAA,CAAA,CAAA,EAInB,CAED,GAAAC,GAAA,yBAAAb,KAAA,SAAA,CAAAW,qBAAOA,CACLD,CACAX,CAAAA,EAAAA,CACAC,EACAC,CACAC,CAAAA,CAAAA,CACAC,CAEA,CAAA,CAAA,GAAMW,CAAAA,CAAgBZ,CAAAA,CAAAA,EAAkBH,GAClCgB,CAAUZ,CAAAA,CAAAA,EAAkBO,SAAAA,CAAcA,QAAAA,CAAAA,CAAAA,SAAAA,CAAAA,iBAAAA,CAAAA,CAAMV,QAASU,CAEzDM,EAAAA,CAAAA,CAAAA,CAAcD,CAAQL,CAAAA,CAAAA,CAAAA,CACtBO,CAAcH,CAAAA,CAAAA,CAAcJ,GAC5BQ,CAAaR,CAAAA,CAAAA,CAAKS,WAAY,CAEpC,CAAA,GAAIC,CAAAA,GAAa,CAOjB,CAAA,MALEA,CAAAA,CADEnB,CAAAA,CAAAA,CACWoB,KAAMC,CAAAA,OAAAA,CAAQtB,IAAUA,CAAMuB,CAAAA,QAAAA,CAASP,IAEtCK,KAAMC,CAAAA,OAAAA,CAAQtB,GAASA,CAAM,CAAA,CAAA,CAAA,CAAKA,CAAWgB,IAAAA,CAAAA,CAGtDZ,CAAI,CAAAoB,gBAAA,GAAAA,gBAAA,CAAAlB,sBAAA,oMAECU,CAAAA,CACII,CAAAA,CACAnB,CAAAA,CACAiB,CAAAA,CACIjB,CAAAA,CAEdwB,CAAWR,CAAAA,CAAAA,CAAAA,CAGlB"}
|
@@ -1,17 +1,18 @@
|
|
1
|
-
import{html as e}from"lit";import{v as t}from"../virtualize-a4a40d96.esm.js";import{unsafeHTML as i}from"lit/directives/unsafe-html.js";import"lit/directive.js";import"lit/async-directive.js";import"lit/directives/repeat.js";class r{static getVirtualizedContent(i,s,l,o,a){return e`
|
1
|
+
import{html as e}from"lit";import{v as t}from"../virtualize-a4a40d96.esm.js";import{unsafeHTML as i}from"lit/directives/unsafe-html.js";import"lit/directive.js";import"lit/async-directive.js";import"lit/directives/repeat.js";class r{static getVirtualizedContent(i,s,l,o,a,c,n){return e`
|
2
2
|
<div class="select__options ${s?"select__options__search-enabled":""}">
|
3
3
|
<div
|
4
4
|
class="virtualized"
|
5
5
|
>
|
6
|
-
${t({items:i,renderItem:e=>r.getItemRenderFunction(e,l,o,a),scroller:!0})}
|
6
|
+
${t({items:i,renderItem:e=>r.getItemRenderFunction(e,l,o,a,c,n),scroller:!0})}
|
7
7
|
</div>
|
8
|
-
</div>`}static getItemRenderFunction(t,r,s,l){const o=
|
8
|
+
</div>`}static getItemRenderFunction(t,r,s,l,o,a){const c=o||r,n=a||(e=>e?.value||e),d=n(t),m=c(t),p=t.disabled||!1;let v=!1;return v=l?Array.isArray(s)&&s.includes(d):(Array.isArray(s)?s[0]:s)===d,e`
|
9
9
|
<nile-option
|
10
|
-
value=${
|
11
|
-
.selected=${
|
10
|
+
value=${d}
|
11
|
+
.selected=${v}
|
12
12
|
.multiple=${l}
|
13
|
-
.disabled=${
|
13
|
+
.disabled=${p}
|
14
|
+
.showCheckbox=${l}
|
14
15
|
>
|
15
|
-
${i(
|
16
|
+
${i(m)}
|
16
17
|
</nile-option>
|
17
18
|
`}}export{r as V};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register([],function(_export,_context){"use strict";var t;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 _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}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:[],execute:function execute(){_export("V",t=/*#__PURE__*/function(){function t(){_classCallCheck(this,t);}return _createClass(t,null,[{key:"filterVirtualOptions",value:function filterVirtualOptions(_t,e,s,r){if(0===e.length&&s.length>0)return{filteredItems:_toConsumableArray(s),showNoResults:!1};if(!e||0===e.length)return{filteredItems:[],showNoResults:!0};if(!_t||""===_t.trim())return{filteredItems:_toConsumableArray(e),showNoResults:!1};var
|
1
|
+
System.register([],function(_export,_context){"use strict";var t;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 _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}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:[],execute:function execute(){_export("V",t=/*#__PURE__*/function(){function t(){_classCallCheck(this,t);}return _createClass(t,null,[{key:"filterVirtualOptions",value:function filterVirtualOptions(_t,e,s,r,i){if(0===e.length&&s.length>0)return{filteredItems:_toConsumableArray(s),showNoResults:!1};if(!e||0===e.length)return{filteredItems:[],showNoResults:!0};if(!_t||""===_t.trim())return{filteredItems:_toConsumableArray(e),showNoResults:!1};var l=_t.toLowerCase(),o=i||r,u=e.filter(function(_t2){return o(_t2).toLowerCase().includes(l);});return{filteredItems:u,showNoResults:0===u.length};}}]);}());}};});
|
2
2
|
//# sourceMappingURL=search-manager.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"search-manager.cjs.js","sources":["../../../src/nile-virtual-select/search-manager.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport class VirtualSelectSearchManager {\n static filterVirtualOptions(\n searchValue: string,\n originalOptionItems: any[],\n data: any[], \n renderItemFunction: (item: any) => string\n ): { filteredItems: any[], showNoResults: boolean } {\n if (originalOptionItems.length === 0 && data.length > 0) {\n return {\n filteredItems: [...data],\n showNoResults: false\n };\n }\n\n if (!originalOptionItems || originalOptionItems.length === 0) {\n return {\n filteredItems: [],\n showNoResults: true\n };\n }\n\n if (!searchValue || searchValue.trim() === '') {\n return {\n filteredItems: [...originalOptionItems],\n showNoResults: false\n };\n }\n\n const lowerCaseSearchValue = searchValue.toLowerCase();\n const filteredItems = originalOptionItems.filter((item: any) => {\n const itemValue =
|
1
|
+
{"version":3,"file":"search-manager.cjs.js","sources":["../../../src/nile-virtual-select/search-manager.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport class VirtualSelectSearchManager {\n static filterVirtualOptions(\n searchValue: string,\n originalOptionItems: any[],\n data: any[], \n renderItemFunction: (item: any) => string,\n getSearchText?: (item: any) => string\n ): { filteredItems: any[], showNoResults: boolean } {\n if (originalOptionItems.length === 0 && data.length > 0) {\n return {\n filteredItems: [...data],\n showNoResults: false\n };\n }\n\n if (!originalOptionItems || originalOptionItems.length === 0) {\n return {\n filteredItems: [],\n showNoResults: true\n };\n }\n\n if (!searchValue || searchValue.trim() === '') {\n return {\n filteredItems: [...originalOptionItems],\n showNoResults: false\n };\n }\n\n const lowerCaseSearchValue = searchValue.toLowerCase();\n const searchTextFn = getSearchText || renderItemFunction;\n const filteredItems = originalOptionItems.filter((item: any) => {\n const itemValue = searchTextFn(item);\n const lowerCaseItemValue = itemValue.toLowerCase();\n return lowerCaseItemValue.includes(lowerCaseSearchValue);\n });\n\n return {\n filteredItems,\n showNoResults: filteredItems.length === 0\n };\n }\n} \n"],"names":["VirtualSelectSearchManager","t","_classCallCheck","_createClass","key","value","filterVirtualOptions","searchValue","originalOptionItems","data","renderItemFunction","getSearchText","length","filteredItems","showNoResults","trim","lowerCaseSearchValue","toLowerCase","searchTextFn","filter","item","includes"],"mappings":"oqEAOaA,CACT,kCAAAC,EAAA,EAAAC,eAAA,MAAAD,CAAA,UAAAE,YAAA,CAAAF,CAAA,QAAAG,GAAA,wBAAAC,KAAA,CAAA,QAAA,CAAAC,oBAAOA,CACPC,EAAAA,CACAC,EACAC,CACAC,CAAAA,CAAAA,CACAC,CAEA,CAAA,CAAA,GAAmC,CAA/BH,GAAAA,CAAAA,CAAoBI,MAAgBH,EAAAA,CAAAA,CAAKG,OAAS,CACpD,CAAA,MAAO,CACLC,aAAAA,CAAAA,kBAAAA,CAAmBJ,CAAAA,CAAAA,CACnBK,aAAe,CAAA,CAAA,CAAA,CAAA,CAInB,IAAKN,CAAsD,EAAA,CAAA,GAA/BA,CAAoBI,CAAAA,MAAAA,CAC9C,MAAO,CACLC,aAAe,CAAA,EAAA,CACfC,eAAe,CAInB,CAAA,CAAA,GAAA,CAAKP,EAAsC,EAAA,EAAA,GAAvBA,EAAYQ,CAAAA,IAAAA,CAAAA,CAAAA,CAC9B,MAAO,CACLF,iCAAmBL,CAAAA,CAAAA,CACnBM,aAAe,CAAA,CAAA,CAAA,CAAA,CAInB,GAAME,CAAAA,CAAAA,CAAuBT,EAAYU,CAAAA,WAAAA,CAAAA,CAAAA,CACnCC,EAAeP,CAAiBD,EAAAA,CAAAA,CAChCG,CAAgBL,CAAAA,CAAAA,CAAoBW,MAAQC,CAAAA,SAAAA,GAAAA,QAC9BF,CAAAA,CAAaE,CAAAA,GAAAA,CAAAA,CACMH,cACXI,QAASL,CAAAA,CAAAA,CAAAA,EAAAA,CAAAA,CAGrC,MAAO,CACLH,aACAC,CAAAA,CAAAA,CAAAA,aAAAA,CAAwC,CAAzBD,GAAAA,CAAAA,CAAcD,OAEhC"}
|
@@ -1 +1 @@
|
|
1
|
-
class t{static filterVirtualOptions(t,e,s,r){if(0===e.length&&s.length>0)return{filteredItems:[...s],showNoResults:!1};if(!e||0===e.length)return{filteredItems:[],showNoResults:!0};if(!t||""===t.trim())return{filteredItems:[...e],showNoResults:!1};const
|
1
|
+
class t{static filterVirtualOptions(t,e,s,r,i){if(0===e.length&&s.length>0)return{filteredItems:[...s],showNoResults:!1};if(!e||0===e.length)return{filteredItems:[],showNoResults:!0};if(!t||""===t.trim())return{filteredItems:[...e],showNoResults:!1};const l=t.toLowerCase(),o=i||r,u=e.filter((t=>o(t).toLowerCase().includes(l)));return{filteredItems:u,showNoResults:0===u.length}}}export{t as V};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register([],function(_export,_context){"use strict";var t;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 _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:[],execute:function execute(){_export("V",t=/*#__PURE__*/function(){function t(){_classCallCheck(this,t);}return _createClass(t,null,[{key:"createVirtualOptionsFromValues",value:function createVirtualOptionsFromValues(_t,e,r){if(!_t||Array.isArray(_t)&&0===_t.length)return[];return(Array.isArray(_t)?_t:[_t]).map(function(_t2){var a=e.find(function(e){
|
1
|
+
System.register([],function(_export,_context){"use strict";var t;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 _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:[],execute:function execute(){_export("V",t=/*#__PURE__*/function(){function t(){_classCallCheck(this,t);}return _createClass(t,null,[{key:"createVirtualOptionsFromValues",value:function createVirtualOptionsFromValues(_t,e,r,a){if(!_t||Array.isArray(_t)&&0===_t.length)return[];return(Array.isArray(_t)?_t:[_t]).map(function(_t2){var n=r,s=a||function(_t3){return(_t3===null||_t3===void 0?void 0:_t3.value)||_t3;},u=e.find(function(e){var r=s(e),a=n(e);return r===_t2||a===_t2;}),i=u?n(u):_t2;return{value:_t2,selected:!0,getTextLabel:function getTextLabel(){if("string"==typeof i&&/<[^>]+>/.test(i)){var _t4=document.createElement("div");return _t4.innerHTML=i,_t4.textContent||_t4.innerText||"";}return i;},getOptionPrefix:function getOptionPrefix(){return"";}};});}},{key:"updateDisplayLabel",value:function updateDisplayLabel(_t5,e,r,a){if(r)return e&&0===_t5.length?"":_t5.length+" selected";{var _t5$;var _e=Array.isArray(a)?a[0]:a;return(_t5$=_t5[0])!==null&&_t5$!==void 0&&_t5$.getTextLabel()?_t5[0].getTextLabel():_e!==null&&_e!==void 0?_e:"";}}},{key:"updateValue",value:function updateValue(_t6,e){var _t6$0$value,_t6$;return e?_t6.map(function(_t7){return _t7.value;}):(_t6$0$value=(_t6$=_t6[0])===null||_t6$===void 0?void 0:_t6$.value)!==null&&_t6$0$value!==void 0?_t6$0$value:"";}}]);}());}};});
|
2
2
|
//# sourceMappingURL=selection-manager.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"selection-manager.cjs.js","sources":["../../../src/nile-virtual-select/selection-manager.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport type { VirtualOption } from './types.js';\n\nexport class VirtualSelectSelectionManager {\n static createVirtualOptionsFromValues(value: string | string[], data: any[],
|
1
|
+
{"version":3,"file":"selection-manager.cjs.js","sources":["../../../src/nile-virtual-select/selection-manager.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport type { VirtualOption } from './types.js';\n\nexport class VirtualSelectSelectionManager {\n static createVirtualOptionsFromValues(\n value: string | string[], \n data: any[], \n getDisplayText: (item: any) => string,\n getItemValue?: (item: any) => string\n ): VirtualOption[] {\n if (!value || (Array.isArray(value) && value.length === 0)) {\n return [];\n }\n\n const values = Array.isArray(value) ? value : [value];\n \n return values.map(valueItem => {\n // Use enhanced functions if available, otherwise fallback to basic logic\n const displayTextFn = getDisplayText;\n const valueFn = getItemValue || ((item: any) => item?.value || item);\n \n const item = data.find((item: any) => {\n const itemValue = valueFn(item);\n const itemDisplayText = displayTextFn(item);\n return itemValue === valueItem || itemDisplayText === valueItem;\n });\n \n const displayText = item ? displayTextFn(item) : valueItem;\n \n return {\n value: valueItem,\n selected: true,\n getTextLabel: () => {\n // If displayText contains HTML, strip tags\n if (typeof displayText === 'string' && /<[^>]+>/.test(displayText)) {\n const div = document.createElement('div');\n div.innerHTML = displayText;\n return div.textContent || div.innerText || '';\n }\n return displayText;\n },\n getOptionPrefix: () => '',\n };\n });\n }\n\n static updateDisplayLabel(selectedOptions: VirtualOption[], placeholder: string, multiple: boolean, value: string | string[]): string {\n if (multiple) {\n if (placeholder && selectedOptions.length === 0) {\n return '';\n } else {\n return selectedOptions.length + ' selected';\n }\n } else {\n const currentValue = Array.isArray(value) ? value[0] : value;\n return selectedOptions[0]?.getTextLabel()\n ? selectedOptions[0].getTextLabel()\n : currentValue ?? '';\n }\n }\n\n static updateValue(selectedOptions: VirtualOption[], multiple: boolean): string | string[] {\n if (multiple) {\n return selectedOptions.map(el => el.value);\n } else {\n return selectedOptions[0]?.value ?? '';\n }\n }\n} \n"],"names":["VirtualSelectSelectionManager","t","_classCallCheck","_createClass","key","value","createVirtualOptionsFromValues","data","getDisplayText","getItemValue","Array","isArray","length","map","valueItem","displayTextFn","valueFn","item","find","itemValue","itemDisplayText","displayText","selected","getTextLabel","test","div","document","createElement","innerHTML","textContent","innerText","getOptionPrefix","updateDisplayLabel","selectedOptions","placeholder","multiple","_t5$","currentValue","updateValue","el"],"mappings":"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"}
|
@@ -1 +1 @@
|
|
1
|
-
class t{static createVirtualOptionsFromValues(t,e,r){if(!t||Array.isArray(t)&&0===t.length)return[];return(Array.isArray(t)?t:[t]).map((t=>{const a=e.find((e=>
|
1
|
+
class t{static createVirtualOptionsFromValues(t,e,r,a){if(!t||Array.isArray(t)&&0===t.length)return[];return(Array.isArray(t)?t:[t]).map((t=>{const n=r,s=a||(t=>t?.value||t),u=e.find((e=>{const r=s(e),a=n(e);return r===t||a===t})),i=u?n(u):t;return{value:t,selected:!0,getTextLabel:()=>{if("string"==typeof i&&/<[^>]+>/.test(i)){const t=document.createElement("div");return t.innerHTML=i,t.textContent||t.innerText||""}return i},getOptionPrefix:()=>""}}))}static updateDisplayLabel(t,e,r,a){if(r)return e&&0===t.length?"":t.length+" selected";{const e=Array.isArray(a)?a[0]:a;return t[0]?.getTextLabel()?t[0].getTextLabel():e??""}}static updateValue(t,e){return e?t.map((t=>t.value)):t[0]?.value??""}}export{t as V};
|
@@ -12,6 +12,7 @@ import type { CSSResultGroup, PropertyValues } from 'lit';
|
|
12
12
|
import type { NileFormControl } from '../internal/nile-element';
|
13
13
|
import type NileOption from '../nile-option/nile-option';
|
14
14
|
import type NilePopup from '../nile-popup/nile-popup';
|
15
|
+
import type { RenderItemConfig } from '../nile-virtual-select/types.js';
|
15
16
|
import '../nile-virtual-select/nile-virtual-select';
|
16
17
|
/**
|
17
18
|
* Nile icon component.
|
@@ -154,7 +155,8 @@ export declare class NileSelect extends NileElement implements NileFormControl {
|
|
154
155
|
oldMaxOptionsVisible: number;
|
155
156
|
showNoResults: boolean;
|
156
157
|
noResultsMessage: string;
|
157
|
-
|
158
|
+
/** Enhanced configuration for rendering items with support for display text, value, and search text */
|
159
|
+
renderItemConfig?: RenderItemConfig;
|
158
160
|
data: any;
|
159
161
|
enableVirtualScroll: boolean;
|
160
162
|
/** Gets the validity state object */
|
@@ -167,7 +167,6 @@ let NileSelect = class NileSelect extends NileElement {
|
|
167
167
|
this.oldMaxOptionsVisible = 1;
|
168
168
|
this.showNoResults = false;
|
169
169
|
this.noResultsMessage = 'No results found';
|
170
|
-
this.renderItemFunction = (item) => item?.label || item?.name || item;
|
171
170
|
this.data = [];
|
172
171
|
this.enableVirtualScroll = false;
|
173
172
|
}
|
@@ -1252,7 +1251,7 @@ __decorate([
|
|
1252
1251
|
], NileSelect.prototype, "noResultsMessage", void 0);
|
1253
1252
|
__decorate([
|
1254
1253
|
property({ attribute: false })
|
1255
|
-
], NileSelect.prototype, "
|
1254
|
+
], NileSelect.prototype, "renderItemConfig", void 0);
|
1256
1255
|
__decorate([
|
1257
1256
|
property({ type: Array })
|
1258
1257
|
], NileSelect.prototype, "data", void 0);
|