@aquera/nile-elements 1.2.8-beta-1.7 → 1.2.8-beta-1.9
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 +54 -51
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +285 -274
- package/dist/nile-auto-complete/index.cjs.js +1 -1
- package/dist/nile-auto-complete/index.esm.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.esm.js +17 -13
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +1 -1
- package/dist/nile-auto-complete/portal-manager.cjs.js +2 -0
- package/dist/nile-auto-complete/portal-manager.cjs.js.map +1 -0
- package/dist/nile-auto-complete/portal-manager.esm.js +1 -0
- package/dist/nile-auto-complete/portal-utils.cjs.js +2 -0
- package/dist/nile-auto-complete/portal-utils.cjs.js.map +1 -0
- package/dist/nile-auto-complete/portal-utils.esm.js +1 -0
- package/dist/nile-chip/index.cjs.js +1 -1
- package/dist/nile-chip/index.esm.js +1 -1
- package/dist/nile-chip/nile-chip.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.cjs.js.map +1 -1
- package/dist/nile-chip/nile-chip.esm.js +14 -7
- package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.test.cjs.js.map +1 -1
- package/dist/nile-chip/nile-chip.test.esm.js +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js.map +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.esm.js +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.d.ts +18 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.js +131 -9
- package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
- package/dist/src/nile-auto-complete/portal-manager.d.ts +41 -0
- package/dist/src/nile-auto-complete/portal-manager.js +308 -0
- package/dist/src/nile-auto-complete/portal-manager.js.map +1 -0
- package/dist/src/nile-auto-complete/portal-utils.d.ts +31 -0
- package/dist/src/nile-auto-complete/portal-utils.js +166 -0
- package/dist/src/nile-auto-complete/portal-utils.js.map +1 -0
- package/dist/src/nile-chip/nile-chip.d.ts +7 -0
- package/dist/src/nile-chip/nile-chip.js +53 -10
- package/dist/src/nile-chip/nile-chip.js.map +1 -1
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.js.map +1 -1
- package/dist/src/version.js +2 -2
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-auto-complete/nile-auto-complete.ts +148 -13
- package/src/nile-auto-complete/portal-manager.ts +410 -0
- package/src/nile-auto-complete/portal-utils.ts +221 -0
- package/src/nile-chip/nile-chip.ts +54 -12
- package/src/nile-lite-tooltip/nile-lite-tooltip.ts +4 -3
- package/vscode-html-custom-data.json +17 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./nile-auto-complete.cjs.js","tslib","lit","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","../virtualize-b6a2fbe0.cjs.js","lit/directive.js","lit/async-directive.js","lit/directives/repeat.js"],function(_export,_context){"use strict";return{setters:[function(_nileAutoCompleteCjsJs){_export("NileAutoComplete",_nileAutoCompleteCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_nileAutoCompleteCssCjsJs){},function(_internalNileElementCjsJs){},function(_virtualize002CjsJs){},function(_litDirectiveJs){},function(_litAsyncDirectiveJs){},function(_litDirectivesRepeatJs){}],execute:function execute(){}};});
|
|
1
|
+
System.register(["./nile-auto-complete.cjs.js","tslib","lit","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","../internal/watch.cjs.js","./portal-manager.cjs.js","../floating-ui.dom-007bbe96.cjs.js","./portal-utils.cjs.js","../virtualize-b6a2fbe0.cjs.js","lit/directive.js","lit/async-directive.js","lit/directives/repeat.js","lit/directives/unsafe-html.js"],function(_export,_context){"use strict";return{setters:[function(_nileAutoCompleteCjsJs){_export("NileAutoComplete",_nileAutoCompleteCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_nileAutoCompleteCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalWatchCjsJs){},function(_portalManagerCjsJs){},function(_floatingUiDom001CjsJs){},function(_portalUtilsCjsJs){},function(_virtualize002CjsJs){},function(_litDirectiveJs){},function(_litAsyncDirectiveJs){},function(_litDirectivesRepeatJs){},function(_litDirectivesUnsafeHtmlJs){}],execute:function execute(){}};});
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{N as NileAutoComplete}from"./nile-auto-complete.esm.js";import"tslib";import"lit";import"lit/decorators.js";import"./nile-auto-complete.css.esm.js";import"../internal/nile-element.esm.js";import"../virtualize-a4a40d96.esm.js";import"lit/directive.js";import"lit/async-directive.js";import"lit/directives/repeat.js";
|
|
1
|
+
export{N as NileAutoComplete}from"./nile-auto-complete.esm.js";import"tslib";import"lit";import"lit/decorators.js";import"./nile-auto-complete.css.esm.js";import"../internal/nile-element.esm.js";import"../internal/watch.esm.js";import"./portal-manager.esm.js";import"../floating-ui.dom-cc9126da.esm.js";import"./portal-utils.esm.js";import"../virtualize-a4a40d96.esm.js";import"lit/directive.js";import"lit/async-directive.js";import"lit/directives/repeat.js";import"lit/directives/unsafe-html.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["tslib","lit","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","../virtualize-b6a2fbe0.cjs.js","lit/directive.js","lit/async-directive.js","lit/directives/repeat.js"],function(_export,_context){"use strict";var t,i,e,s,n,o,r,l,h,a,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,p;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);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;e=_lit.nothing;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;n=_litDecoratorsJs.property;o=_litDecoratorsJs.state;r=_litDecoratorsJs.customElement;},function(_nileAutoCompleteCssCjsJs){l=_nileAutoCompleteCssCjsJs.s;},function(_internalNileElementCjsJs){h=_internalNileElementCjsJs.N;},function(_virtualize002CjsJs){a=_virtualize002CjsJs.v;},function(_litDirectiveJs){},function(_litAsyncDirectiveJs){},function(_litDirectivesRepeatJs){}],execute:function execute(){_export("N",p=/*#__PURE__*/function(_h){function p(){var _this;_classCallCheck(this,p);_this=_callSuper(this,p,arguments),_this.disabled=!1,_this.isDropdownOpen=!1,_this.enableVirtualScroll=!1,_this.openOnFocus=!1,_this.value="",_this.placeholder="Type here ..",_this.noBorder=!1,_this.noOutline=!1,_this.noPadding=!1,_this.loading=!1,_this.filterFunction=function(t,i){return t.toLowerCase().includes(i.toLowerCase());},_this.renderItemFunction=function(t){return t;},_this.allMenuItems=[],_this.menuItems=[];return _this;}_inherits(p,_h);return _createClass(p,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(p,"connectedCallback",this,3)([]),this.renderItemFunction=function(t){return t;};}},{key:"updated",value:function updated(t){_superPropGet(p,"updated",this,3)([t]),t.has("allMenuItems")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.setVirtualMenuWidth()),t.has("isDropdownOpen")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction)),t.has("value")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction));}},{key:"render",value:function render(){var t=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-dropdown class=\"nile-dropdown--input\" ?open="," noOpenOnCLick exportparts=\"input, base\">\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=","\n ?no-outline=","\n ?no-padding=","\n .disabled=","\n .value=","\n @nile-input=","\n @focus=","\n @click=","\n slot=\"trigger\"\n placeholder=","\n exportparts=\"input, base\"\n >\n ","\n </nile-input>\n ","\n </nile-dropdown>\n "])),this.isDropdownOpen,this.noBorder,this.noOutline,this.noPadding,this.disabled,this.value,this.handleSearch,this.handleFocus,this.handleClick,this.placeholder,this.loading?i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-icon slot=\"suffix\" color=\"var(--nile-colors-primary-600)\" name=\"var(--nile-icon-button-loading-blue-animated, var(--ng-icon-button-loading-blue-animated))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" library=\"system\"></nile-icon>"]))):e,this.menuItems.length>0&&!this.loading?t:e);}},{key:"getVirtualizedContent",value:function getVirtualizedContent(){var _this2=this;return i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-menu class=\"virtualized__menu\" @nile-select="," id=\"content-menu\" exportparts=\"menu__items-wrapper:options__wrapper\">\n ","\n </nile-menu>\n "])),this.handleSelect,a({items:this.menuItems,renderItem:function renderItem(t){return _this2.getItemRenderFunction(t);},scroller:!0}));}},{key:"getContent",value:function getContent(){var _this3=this;return i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-menu id=\"content-menu\" @nile-select="," exportparts=\"menu__items-wrapper:options__wrapper\">\n ","\n </nile-menu>"])),this.handleSelect,this.menuItems.map(function(t){return _this3.getItemRenderFunction(t);}));}},{key:"getItemRenderFunction",value:function getItemRenderFunction(t){var e=this.renderItemFunction(t);return i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-menu-item value=",">\n ","\n </nile-menu-item>\n "])),e,e);}},{key:"handleSelect",value:function handleSelect(t){var _this$dropdownElement;this.value=t.detail.value,this.emit("nile-complete",{value:t.detail.value}),this.isDropdownOpen=!1,(_this$dropdownElement=this.dropdownElement)===null||_this$dropdownElement===void 0?void 0:_this$dropdownElement.hide();}},{key:"setVirtualMenuWidth",value:function setVirtualMenuWidth(){var _this4=this;var t=this.menuItems.reduce(function(t,i){var e=_this4.renderItemFunction(i).length;return t>e?t:e;},0),i=9.5*t<110?110:9.5*t;this.style.setProperty("--virtual-scroll-container-width",i+"px");}},{key:"handleSearch",value:function handleSearch(t){var _this$dropdownElement2;this.value=t.detail.value.toLowerCase(),this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&((_this$dropdownElement2=this.dropdownElement)===null||_this$dropdownElement2===void 0?void 0:_this$dropdownElement2.show());}},{key:"handleFocus",value:function handleFocus(){var _this5=this;this.openOnFocus&&setTimeout(function(){var _this5$dropdownElemen;_this5.isDropdownOpen=!0,(_this5$dropdownElemen=_this5.dropdownElement)===null||_this5$dropdownElemen===void 0?void 0:_this5$dropdownElemen.show();},300);}},{key:"handleClick",value:function handleClick(){var _this$dropdownElement3;this.isDropdownOpen=!0,(_this$dropdownElement3=this.dropdownElement)===null||_this$dropdownElement3===void 0?void 0:_this$dropdownElement3.show();}},{key:"applyFilter",value:function applyFilter(t,i){var _this6=this;if("object"!=_typeof(t))return[];var e=[];return t.forEach(function(t){return i(t,_this6.value)&&e.push(t);}),e;}}]);}(h));p.styles=l,t([s("nile-dropdown")],p.prototype,"dropdownElement",void 0),t([n({type:Boolean})],p.prototype,"disabled",void 0),t([n({type:Boolean})],p.prototype,"isDropdownOpen",void 0),t([n({type:Boolean})],p.prototype,"enableVirtualScroll",void 0),t([n({type:Boolean})],p.prototype,"openOnFocus",void 0),t([n({type:String})],p.prototype,"value",void 0),t([n({type:String})],p.prototype,"placeholder",void 0),t([n({type:Boolean})],p.prototype,"noBorder",void 0),t([n({type:Boolean})],p.prototype,"noOutline",void 0),t([n({type:Boolean})],p.prototype,"noPadding",void 0),t([n({type:Boolean})],p.prototype,"loading",void 0),t([n({attribute:!1})],p.prototype,"filterFunction",void 0),t([n({attribute:!1})],p.prototype,"renderItemFunction",void 0),t([n({type:Array})],p.prototype,"allMenuItems",void 0),t([o()],p.prototype,"menuItems",void 0),_export("N",p=t([r("nile-auto-complete")],p));}};});
|
|
1
|
+
System.register(["tslib","lit","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","../internal/watch.cjs.js","./portal-manager.cjs.js","../virtualize-b6a2fbe0.cjs.js","lit/directives/unsafe-html.js","../floating-ui.dom-007bbe96.cjs.js","./portal-utils.cjs.js","lit/directive.js","lit/async-directive.js","lit/directives/repeat.js"],function(_export,_context){"use strict";var t,i,e,s,n,o,h,l,r,a,p,d,u,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,c;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);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;e=_lit.nothing;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;n=_litDecoratorsJs.property;o=_litDecoratorsJs.state;h=_litDecoratorsJs.customElement;},function(_nileAutoCompleteCssCjsJs){l=_nileAutoCompleteCssCjsJs.s;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_internalWatchCjsJs){a=_internalWatchCjsJs.w;},function(_portalManagerCjsJs){p=_portalManagerCjsJs.A;},function(_virtualize002CjsJs){d=_virtualize002CjsJs.v;},function(_litDirectivesUnsafeHtmlJs){u=_litDirectivesUnsafeHtmlJs.unsafeHTML;},function(_floatingUiDom001CjsJs){},function(_portalUtilsCjsJs){},function(_litDirectiveJs){},function(_litAsyncDirectiveJs){},function(_litDirectivesRepeatJs){}],execute:function execute(){_export("N",c=/*#__PURE__*/function(_r){function c(){var _this;_classCallCheck(this,c);_this=_callSuper(this,c,arguments),_this.disabled=!1,_this.isDropdownOpen=!1,_this.portal=!1,_this.portalManager=new p(_assertThisInitialized(_this)),_this.enableVirtualScroll=!1,_this.openOnFocus=!1,_this.value="",_this.placeholder="Type here ..",_this.noBorder=!1,_this.noOutline=!1,_this.noPadding=!1,_this.loading=!1,_this.filterFunction=function(t,i){return t.toLowerCase().includes(i.toLowerCase());},_this.renderItemFunction=function(t){return t;},_this.allMenuItems=[],_this.menuItems=[],_this.handleWindowResize=function(){_this.portalManager.updatePortalAppendPosition();},_this.handleWindowScroll=function(){_this.portalManager.updatePortalAppendPosition();};return _this;}_inherits(c,_r);return _createClass(c,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(c,"connectedCallback",this,3)([]),this.renderItemFunction=function(t){return t;},this.handleDocumentFocusIn=this.handleDocumentFocusIn.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.handleWindowScroll=this.handleWindowScroll.bind(this);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(c,"disconnectedCallback",this,3)([]),this.removeOpenListeners(),this.portalManager.cleanupPortalAppend();}},{key:"updated",value:function updated(t){_superPropGet(c,"updated",this,3)([t]),t.has("allMenuItems")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.setVirtualMenuWidth(),this.portal&&this.isDropdownOpen&&this.portalManager.updatePortalOptions()),t.has("isDropdownOpen")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.handleDropdownOpenChange()),t.has("value")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.portal&&this.isDropdownOpen&&this.portalManager.updatePortalOptions()),t.has("portal")&&this.handlePortalChange();}},{key:"handlePortalChange",value:function handlePortalChange(){this.isDropdownOpen&&(this.portal?this.portalManager.setupPortalAppend():this.portalManager.cleanupPortalAppend());}},{key:"handleDropdownOpenChange",value:function handleDropdownOpenChange(){this.isDropdownOpen?(this.addOpenListeners(),this.portal&&this.portalManager.setupPortalAppend()):(this.removeOpenListeners(),this.portal&&this.portalManager.cleanupPortalAppend());}},{key:"addOpenListeners",value:function addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.portal&&(window.addEventListener("resize",this.handleWindowResize),window.addEventListener("scroll",this.handleWindowScroll,!0));}},{key:"removeOpenListeners",value:function removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("mousedown",this.handleDocumentMouseDown),window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("scroll",this.handleWindowScroll,!0);}},{key:"handleDocumentFocusIn",value:function handleDocumentFocusIn(t){var _this$dropdownElement;if(!this.isDropdownOpen)return;var i=t.composedPath(),e=i.includes(this),s=this.dropdownElement&&i.includes(this.dropdownElement),n=this.portal&&this.portalManager.portalContainerElement&&i.includes(this.portalManager.portalContainerElement);e||s||n||(this.isDropdownOpen=!1,(_this$dropdownElement=this.dropdownElement)===null||_this$dropdownElement===void 0?void 0:_this$dropdownElement.hide());}},{key:"handleDocumentMouseDown",value:function handleDocumentMouseDown(t){var _this$dropdownElement2;if(!this.isDropdownOpen)return;var i=t.composedPath(),e=i.includes(this),s=this.dropdownElement&&i.includes(this.dropdownElement),n=this.portal&&this.portalManager.portalContainerElement&&i.includes(this.portalManager.portalContainerElement);e||s||n||(this.isDropdownOpen=!1,(_this$dropdownElement2=this.dropdownElement)===null||_this$dropdownElement2===void 0?void 0:_this$dropdownElement2.hide());}},{key:"render",value:function render(){var t=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-dropdown class=\"nile-dropdown--input\" ?open="," noOpenOnCLick exportparts=\"input, base\">\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=","\n ?no-outline=","\n ?no-padding=","\n .disabled=","\n .value=","\n @nile-input=","\n @focus=","\n @click=","\n slot=\"trigger\"\n placeholder=","\n exportparts=\"input, base\"\n >\n ","\n </nile-input>\n ","\n </nile-dropdown>\n "])),this.isDropdownOpen,this.noBorder,this.noOutline,this.noPadding,this.disabled,this.value,this.handleSearch,this.handleFocus,this.handleClick,this.placeholder,this.loading?i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-icon slot=\"suffix\" color=\"var(--nile-colors-primary-600)\" name=\"var(--nile-icon-button-loading-blue-animated, var(--ng-icon-button-loading-blue-animated))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" library=\"system\"></nile-icon>"]))):e,this.menuItems.length>0&&!this.loading?t:e);}},{key:"getVirtualizedContent",value:function getVirtualizedContent(){var _this2=this;return i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-menu class=\"virtualized__menu\" @nile-select="," id=\"content-menu\" exportparts=\"menu__items-wrapper:options__wrapper\" style=",">\n ","\n </nile-menu>\n "])),this.handleSelect,this.portal?"display: none;":"",d({items:this.menuItems,renderItem:function renderItem(t){return _this2.getItemRenderFunction(t);},scroller:!0}));}},{key:"getContent",value:function getContent(){var _this3=this;return i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-menu id=\"content-menu\" @nile-select="," exportparts=\"menu__items-wrapper:options__wrapper\" style=",">\n ","\n </nile-menu>"])),this.handleSelect,this.portal?"display: none;":"",this.menuItems.map(function(t){return _this3.getItemRenderFunction(t);}));}},{key:"getItemRenderFunction",value:function getItemRenderFunction(t){var e=this.renderItemFunction(t),s=!!t.tooltip,n=s&&(!t.tooltip["for"]||"menu"===t.tooltip["for"]),o=s?t.tooltip.content:e;return n?i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-menu-item value=",">\n <nile-lite-tooltip allowHTML .content=",">\n <span class=\"menu-item-text\">","</span>\n </nile-lite-tooltip>\n </nile-menu-item>\n "])),e,o,u(e)):i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-menu-item value=",">","</nile-menu-item>\n "])),e,u(e));}},{key:"handleSelect",value:function handleSelect(t){var _this$dropdownElement3;this.value=t.detail.value,this.emit("nile-complete",{value:t.detail.value}),this.isDropdownOpen=!1,(_this$dropdownElement3=this.dropdownElement)===null||_this$dropdownElement3===void 0?void 0:_this$dropdownElement3.hide();}},{key:"setVirtualMenuWidth",value:function setVirtualMenuWidth(){var _this4=this;var t=this.menuItems.reduce(function(t,i){var e=_this4.renderItemFunction(i).length;return t>e?t:e;},0),i=9.5*t<110?110:9.5*t;this.style.setProperty("--virtual-scroll-container-width",i+"px");}},{key:"handleSearch",value:function handleSearch(t){var _this$dropdownElement4;this.value=t.detail.value.toLowerCase(),this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&((_this$dropdownElement4=this.dropdownElement)!==null&&_this$dropdownElement4!==void 0&&_this$dropdownElement4.show(),this.portal&&this.portalManager.updatePortalOptions());}},{key:"handleFocus",value:function handleFocus(){var _this$inputElement,_this5=this;this.openOnFocus&&(this.portal&&(_this$inputElement=this.inputElement)!==null&&_this$inputElement!==void 0&&_this$inputElement.focus(),setTimeout(function(){var _this5$dropdownElemen;_this5.isDropdownOpen=!0,(_this5$dropdownElemen=_this5.dropdownElement)===null||_this5$dropdownElemen===void 0?void 0:_this5$dropdownElemen.show();},300));}},{key:"handleClick",value:function handleClick(){var _this$dropdownElement5;this.isDropdownOpen=!0,(_this$dropdownElement5=this.dropdownElement)===null||_this$dropdownElement5===void 0?void 0:_this$dropdownElement5.show();}},{key:"applyFilter",value:function applyFilter(t,i){var _this6=this;if("object"!=_typeof(t))return[];var e=[];return t.forEach(function(t){return i(t,_this6.value)&&e.push(t);}),e;}}]);}(r));c.styles=l,t([s("nile-dropdown")],c.prototype,"dropdownElement",void 0),t([s("nile-input")],c.prototype,"inputElement",void 0),t([n({type:Boolean})],c.prototype,"disabled",void 0),t([n({type:Boolean})],c.prototype,"isDropdownOpen",void 0),t([n({type:Boolean,reflect:!0})],c.prototype,"portal",void 0),t([n({type:Boolean})],c.prototype,"enableVirtualScroll",void 0),t([n({type:Boolean})],c.prototype,"openOnFocus",void 0),t([n({type:String})],c.prototype,"value",void 0),t([n({type:String})],c.prototype,"placeholder",void 0),t([n({type:Boolean})],c.prototype,"noBorder",void 0),t([n({type:Boolean})],c.prototype,"noOutline",void 0),t([n({type:Boolean})],c.prototype,"noPadding",void 0),t([n({type:Boolean})],c.prototype,"loading",void 0),t([n({attribute:!1})],c.prototype,"filterFunction",void 0),t([n({attribute:!1})],c.prototype,"renderItemFunction",void 0),t([n({type:Array})],c.prototype,"allMenuItems",void 0),t([o()],c.prototype,"menuItems",void 0),t([a("portal",{waitUntilFirstUpdate:!0})],c.prototype,"handlePortalChange",null),_export("N",c=t([h("nile-auto-complete")],c));}};});
|
|
2
2
|
//# sourceMappingURL=nile-auto-complete.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-auto-complete.cjs.js","sources":["../../../src/nile-auto-complete/nile-auto-complete.ts"],"sourcesContent":["import {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n nothing,\n} from 'lit';\nimport { customElement, query, state, property } from 'lit/decorators.js';\nimport { styles } from './nile-auto-complete.css';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport { NileDropdown } from '../nile-dropdown';\n\nimport { virtualize } from '@lit-labs/virtualizer/virtualize.js';\n\n// Define the custom element 'nile-auto-complete'\n@customElement('nile-auto-complete')\nexport class NileAutoComplete extends NileElement {\n\n static styles: CSSResultGroup = styles;\n\n @query('nile-dropdown') dropdownElement: NileDropdown;\n\n // Define component properties\n\n @property({ type: Boolean }) disabled: boolean = false;\n\n @property({ type: Boolean }) isDropdownOpen: boolean = false;\n\n @property({ type: Boolean }) enableVirtualScroll: boolean = false;\n\n @property({ type: Boolean }) openOnFocus: boolean = false;\n\n @property({ type: String }) value: string = '';\n\n @property({ type: String }) placeholder: string = 'Type here ..';\n\n @property({ type: Boolean }) noBorder: boolean = false;\n \n @property({ type: Boolean }) noOutline: boolean = false;\n\n @property({ type: Boolean }) noPadding: boolean = false;\n\n @property({ type: Boolean }) loading: boolean = false;\n\n @property({ attribute:false}) filterFunction: (item:string,searchedValue:string)=>boolean=(item:string,searchedValue:string)=>item.toLowerCase().includes(searchedValue.toLowerCase());\n\n @property({ attribute:false}) renderItemFunction: (item:any)=>string = (item:any)=>item;\n\n @property({ type: Array }) allMenuItems: any = [];\n\n @state() menuItems: any = [];\n\n connectedCallback() {\n super.connectedCallback();\n this.renderItemFunction=(item:any)=>item;\n }\n\n protected updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has('allMenuItems')){\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n this.setVirtualMenuWidth();\n }\n if (changedProperties.has('isDropdownOpen')) this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n if (changedProperties.has('value')){\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n }\n }\n\n public render(): TemplateResult {\n const content=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();\n return html`\n <nile-dropdown class=\"nile-dropdown--input\" ?open=${this.isDropdownOpen} noOpenOnCLick exportparts=\"input, base\">\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=${this.noBorder}\n ?no-outline=${this.noOutline}\n ?no-padding=${this.noPadding}\n .disabled=${this.disabled}\n .value=${this.value}\n @nile-input=${this.handleSearch}\n @focus=${this.handleFocus}\n @click=${this.handleClick}\n slot=\"trigger\"\n placeholder=${this.placeholder}\n exportparts=\"input, base\"\n >\n ${this.loading?html`<nile-icon slot=\"suffix\" color=\"var(--nile-colors-primary-600)\" name=\"var(--nile-icon-button-loading-blue-animated, var(--ng-icon-button-loading-blue-animated))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" library=\"system\"></nile-icon>`:nothing}\n </nile-input>\n ${this.menuItems.length > 0 && !this.loading\n ? content\n : nothing}\n </nile-dropdown>\n `;\n } \n \n getVirtualizedContent():TemplateResult{\n return html`\n <nile-menu class=\"virtualized__menu\" @nile-select=${this.handleSelect} id=\"content-menu\" exportparts=\"menu__items-wrapper:options__wrapper\">\n ${virtualize({\n items: this.menuItems,\n renderItem: (item:any):TemplateResult=>this.getItemRenderFunction(item),\n\t\t\t\t\tscroller:true\n })}\n </nile-menu>\n `\n }\n\n getContent():TemplateResult{\n return html`\n <nile-menu id=\"content-menu\" @nile-select=${this.handleSelect} exportparts=\"menu__items-wrapper:options__wrapper\">\n ${this.menuItems.map((item: any) => this.getItemRenderFunction(item))}\n </nile-menu>`\n }\n\n getItemRenderFunction(item:any):TemplateResult{\n const value=this.renderItemFunction(item)\n return html`\n <nile-menu-item value=${value}>\n ${value}\n </nile-menu-item>\n `;\n }\n\n private handleSelect(event: CustomEvent) {\n this.value = event.detail.value;\n this.emit('nile-complete', { value: event.detail.value });\n this.isDropdownOpen = false;\n this.dropdownElement?.hide();\n }\n\n private setVirtualMenuWidth() {\n const maxLengthOption = this.menuItems\n .reduce((acc: number, curr: any) => {\n const currLength = this.renderItemFunction(curr).length\n return acc > currLength ? acc : currLength\n }, 0)\n const defaultWith = 110;\n const pixelMultiplier = 9.5;\n const menuWidth = maxLengthOption * pixelMultiplier < defaultWith ? defaultWith : maxLengthOption * pixelMultiplier;\n this.style.setProperty(\"--virtual-scroll-container-width\", menuWidth + \"px\");\n }\n\n private handleSearch(event: CustomEvent) {\n this.value = event.detail.value.toLowerCase();\n\n // Filter menu items based on the search value\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n\n this.isDropdownOpen = this.menuItems.length > 0;\n if (this.isDropdownOpen) this.dropdownElement?.show();\n }\n\n public handleFocus() {\n if (!this.openOnFocus) {\n return;\n }\n\n // Delay opening the dropdown to allow focus to take effect\n setTimeout(() => {\n this.isDropdownOpen = true;\n this.dropdownElement?.show();\n }, 300);\n }\n\n private handleClick() {\n this.isDropdownOpen = true;\n this.dropdownElement?.show();\n }\n\n applyFilter<T>(list: T[], filterFn: (item: T,searchValue?:string) => boolean): T[] {\n if(typeof(list)!=='object') return []\n const res:T[]=[]\n list.forEach( el=> filterFn(el,this.value) && res.push(el) )\n return res\n }\n\n}\n\nexport default NileAutoComplete;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-auto-complete': NileAutoComplete;\n }\n}\n"],"names":["NileAutoComplete","_h","p","constructor","this","disabled","isDropdownOpen","enableVirtualScroll","openOnFocus","value","placeholder","noBorder","noOutline","noPadding","loading","filterFunction","item","searchedValue","toLowerCase","includes","renderItemFunction","allMenuItems","menuItems","_this","_inherits","_createClass","key","connectedCallback","super","updated","changedProperties","has","applyFilter","setVirtualMenuWidth","render","content","getVirtualizedContent","getContent","html","_templateObject","_taggedTemplateLiteral","handleSearch","handleFocus","handleClick","_templateObject2","nothing","length","_this2","_templateObject3","handleSelect","virtualize","items","renderItem","getItemRenderFunction","scroller","_this3","_templateObject4","map","_templateObject5","event","detail","emit","dropdownElement","hide","maxLengthOption","reduce","acc","curr","currLength","menuWidth","style","setProperty","show","setTimeout","_this$dropdownElement3","list","filterFn","_this6","_typeof","t","res","forEach","el","push","NileElement","styles","__decorate","query","prototype","property","type","Boolean","String","attribute","Array","state","customElement"],"mappings":"uiIAiBaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAQwBC,KAAAA,CAAQC,QAAAA,CAAAA,CAAY,CAEpBD,CAAAA,KAAAA,CAAcE,gBAAY,CAE1BF,CAAAA,KAAAA,CAAmBG,mBAAY,CAAA,CAAA,CAAA,CAE/BH,KAAAA,CAAWI,WAAAA,CAAAA,CAAY,CAExBJ,CAAAA,KAAAA,CAAKK,MAAW,EAEhBL,CAAAA,KAAAA,CAAWM,WAAW,CAAA,cAAA,CAErBN,KAAAA,CAAQO,QAAAA,CAAAA,CAAY,CAEpBP,CAAAA,KAAAA,CAASQ,WAAY,CAErBR,CAAAA,KAAAA,CAASS,SAAY,CAAA,CAAA,CAAA,CAErBT,KAAAA,CAAOU,OAAAA,CAAAA,CAAY,CAElBV,CAAAA,KAAAA,CAAcW,eAA8C,SAACC,CAAAA,CAAYC,CAAuBD,QAAAA,CAAAA,CAAAA,CA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AAA,CAAA,IAAA,EAAA,CAAA,CAE7DF,CAAA,CAAA,CAA1BG,EAAS,CAAEC,IAAAA,CAAMI,KAAgC9F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAwF,SAAA,CAAA,cAAA,CAAA,IAAA,EAEzCF,CAAAA,CAAAA,CAAAA,CAAA,CAARS,CAA4B/F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAwF,SAAA,CAAA,WAAA,CAAA,IAAA,gBAlClBxF,CAAgBsF,CAAAA,CAAAA,CAAA,CAD5BU,CAAAA,CAAc,uBACFhG"}
|
|
1
|
+
{"version":3,"file":"nile-auto-complete.cjs.js","sources":["../../../src/nile-auto-complete/nile-auto-complete.ts"],"sourcesContent":["import {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n nothing,\n} from 'lit';\nimport { customElement, query, state, property } from 'lit/decorators.js';\nimport { styles } from './nile-auto-complete.css';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport { NileDropdown } from '../nile-dropdown';\nimport { watch } from '../internal/watch';\nimport { AutoCompletePortalManager } from './portal-manager';\nimport { NileInput } from '../nile-input';\n\nimport { virtualize } from '@lit-labs/virtualizer/virtualize.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\n\n// Define the custom element 'nile-auto-complete'\n@customElement('nile-auto-complete')\nexport class NileAutoComplete extends NileElement {\n\n static styles: CSSResultGroup = styles;\n\n @query('nile-dropdown') dropdownElement: NileDropdown;\n\n @query('nile-input') inputElement: NileInput;\n\n // Define component properties\n\n @property({ type: Boolean }) disabled: boolean = false;\n\n @property({ type: Boolean }) isDropdownOpen: boolean = false;\n\n /** \n * When true, the dropdown menu will be appended to the document body instead of the parent container.\n * This is useful when the parent has overflow: hidden, clip-path, or transform applied.\n */\n @property({ type: Boolean, reflect: true }) portal = false;\n\n private readonly portalManager = new AutoCompletePortalManager(this);\n\n @property({ type: Boolean }) enableVirtualScroll: boolean = false;\n\n @property({ type: Boolean }) openOnFocus: boolean = false;\n\n @property({ type: String }) value: string = '';\n\n @property({ type: String }) placeholder: string = 'Type here ..';\n\n @property({ type: Boolean }) noBorder: boolean = false;\n \n @property({ type: Boolean }) noOutline: boolean = false;\n\n @property({ type: Boolean }) noPadding: boolean = false;\n\n @property({ type: Boolean }) loading: boolean = false;\n\n @property({ attribute:false}) filterFunction: (item:string,searchedValue:string)=>boolean=(item:string,searchedValue:string)=>item.toLowerCase().includes(searchedValue.toLowerCase());\n\n @property({ attribute:false}) renderItemFunction: (item:any)=>string = (item:any)=>item;\n\n @property({ type: Array }) allMenuItems: any = [];\n\n @state() menuItems: any = [];\n\n connectedCallback() {\n super.connectedCallback();\n this.renderItemFunction=(item:any)=>item;\n this.handleDocumentFocusIn = this.handleDocumentFocusIn.bind(this);\n this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);\n this.handleWindowResize = this.handleWindowResize.bind(this);\n this.handleWindowScroll = this.handleWindowScroll.bind(this);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeOpenListeners();\n this.portalManager.cleanupPortalAppend();\n }\n\n protected updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has('allMenuItems')){\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n this.setVirtualMenuWidth();\n if (this.portal && this.isDropdownOpen) {\n this.portalManager.updatePortalOptions();\n }\n }\n if (changedProperties.has('isDropdownOpen')) {\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n this.handleDropdownOpenChange();\n }\n if (changedProperties.has('value')){\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n if (this.portal && this.isDropdownOpen) {\n this.portalManager.updatePortalOptions();\n }\n }\n if (changedProperties.has('portal')) {\n this.handlePortalChange();\n }\n }\n\n @watch('portal', { waitUntilFirstUpdate: true })\n handlePortalChange(): void {\n if (this.isDropdownOpen) {\n if (this.portal) {\n this.portalManager.setupPortalAppend();\n } else {\n this.portalManager.cleanupPortalAppend();\n }\n }\n }\n\n private handleDropdownOpenChange(): void {\n if (this.isDropdownOpen) {\n this.addOpenListeners();\n if (this.portal) {\n this.portalManager.setupPortalAppend();\n }\n } else {\n this.removeOpenListeners();\n if (this.portal) {\n this.portalManager.cleanupPortalAppend();\n }\n }\n }\n\n private addOpenListeners(): void {\n document.addEventListener('focusin', this.handleDocumentFocusIn);\n document.addEventListener('mousedown', this.handleDocumentMouseDown);\n \n if (this.portal) {\n window.addEventListener('resize', this.handleWindowResize);\n window.addEventListener('scroll', this.handleWindowScroll, true);\n }\n }\n\n private removeOpenListeners(): void {\n document.removeEventListener('focusin', this.handleDocumentFocusIn);\n document.removeEventListener('mousedown', this.handleDocumentMouseDown);\n window.removeEventListener('resize', this.handleWindowResize);\n window.removeEventListener('scroll', this.handleWindowScroll, true);\n }\n\n private handleDocumentFocusIn(event: FocusEvent) {\n if (!this.isDropdownOpen) return;\n const path = event.composedPath();\n const hitSelf = path.includes(this);\n const hitDropdown = this.dropdownElement && path.includes(this.dropdownElement);\n const hitPortalAppend = this.portal && this.portalManager.portalContainerElement && path.includes(this.portalManager.portalContainerElement);\n\n if (!hitSelf && !hitDropdown && !hitPortalAppend) {\n this.isDropdownOpen = false;\n this.dropdownElement?.hide();\n }\n }\n\n private handleDocumentMouseDown(event: MouseEvent) {\n if (!this.isDropdownOpen) return;\n \n const path = event.composedPath();\n const hitSelf = path.includes(this);\n const hitDropdown = this.dropdownElement && path.includes(this.dropdownElement);\n const hitPortalAppend = this.portal && this.portalManager.portalContainerElement && path.includes(this.portalManager.portalContainerElement);\n \n if (!hitSelf && !hitDropdown && !hitPortalAppend) {\n this.isDropdownOpen = false;\n this.dropdownElement?.hide();\n }\n }\n\n private handleWindowResize = (): void => {\n this.portalManager.updatePortalAppendPosition();\n };\n\n private handleWindowScroll = (): void => {\n this.portalManager.updatePortalAppendPosition();\n };\n\n public render(): TemplateResult {\n const content=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();\n return html`\n <nile-dropdown class=\"nile-dropdown--input\" ?open=${this.isDropdownOpen} noOpenOnCLick exportparts=\"input, base\">\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=${this.noBorder}\n ?no-outline=${this.noOutline}\n ?no-padding=${this.noPadding}\n .disabled=${this.disabled}\n .value=${this.value}\n @nile-input=${this.handleSearch}\n @focus=${this.handleFocus}\n @click=${this.handleClick}\n slot=\"trigger\"\n placeholder=${this.placeholder}\n exportparts=\"input, base\"\n >\n ${this.loading?html`<nile-icon slot=\"suffix\" color=\"var(--nile-colors-primary-600)\" name=\"var(--nile-icon-button-loading-blue-animated, var(--ng-icon-button-loading-blue-animated))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" library=\"system\"></nile-icon>`:nothing}\n </nile-input>\n ${this.menuItems.length > 0 && !this.loading\n ? content\n : nothing}\n </nile-dropdown>\n `;\n } \n \n getVirtualizedContent():TemplateResult{\n return html`\n <nile-menu class=\"virtualized__menu\" @nile-select=${this.handleSelect} id=\"content-menu\" exportparts=\"menu__items-wrapper:options__wrapper\" style=${this.portal ? 'display: none;' : ''}>\n ${virtualize({\n items: this.menuItems,\n renderItem: (item:any):TemplateResult=>this.getItemRenderFunction(item),\n\t\t\t\t\tscroller:true\n })}\n </nile-menu>\n `\n }\n\n getContent():TemplateResult{\n return html`\n <nile-menu id=\"content-menu\" @nile-select=${this.handleSelect} exportparts=\"menu__items-wrapper:options__wrapper\" style=${this.portal ? 'display: none;' : ''}>\n ${this.menuItems.map((item: any) => this.getItemRenderFunction(item))}\n </nile-menu>`\n }\n\n getItemRenderFunction(item: any): TemplateResult {\n const value = this.renderItemFunction(item);\n const hasTooltip = !!item.tooltip;\n const shouldShowTooltip =\n hasTooltip && (!item.tooltip.for || item.tooltip.for === 'menu');\n const tooltipContent = hasTooltip ? item.tooltip.content : value;\n\n return shouldShowTooltip\n ? html`\n <nile-menu-item value=${value}>\n <nile-lite-tooltip allowHTML .content=${tooltipContent}>\n <span class=\"menu-item-text\">${unsafeHTML(value)}</span>\n </nile-lite-tooltip>\n </nile-menu-item>\n `\n : html`\n <nile-menu-item value=${value}>${unsafeHTML(value)}</nile-menu-item>\n `;\n}\n\n \n\n handleSelect(event: CustomEvent) {\n this.value = event.detail.value;\n this.emit('nile-complete', { value: event.detail.value });\n this.isDropdownOpen = false;\n this.dropdownElement?.hide();\n }\n\n private setVirtualMenuWidth() {\n const maxLengthOption = this.menuItems\n .reduce((acc: number, curr: any) => {\n const currLength = this.renderItemFunction(curr).length\n return acc > currLength ? acc : currLength\n }, 0)\n const defaultWith = 110;\n const pixelMultiplier = 9.5;\n const menuWidth = maxLengthOption * pixelMultiplier < defaultWith ? defaultWith : maxLengthOption * pixelMultiplier;\n this.style.setProperty(\"--virtual-scroll-container-width\", menuWidth + \"px\");\n }\n\n private handleSearch(event: CustomEvent) {\n this.value = event.detail.value.toLowerCase();\n\n // Filter menu items based on the search value\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n\n this.isDropdownOpen = this.menuItems.length > 0;\n if (this.isDropdownOpen) {\n this.dropdownElement?.show();\n if (this.portal) {\n this.portalManager.updatePortalOptions();\n }\n }\n }\n\n public handleFocus() {\n if (!this.openOnFocus) {\n return;\n }\n\n if(this.portal) {\n this.inputElement?.focus();\n }\n\n // Delay opening the dropdown to allow focus to take effect\n setTimeout(() => {\n this.isDropdownOpen = true;\n this.dropdownElement?.show();\n }, 300);\n }\n\n private handleClick() {\n this.isDropdownOpen = true;\n this.dropdownElement?.show();\n }\n\n applyFilter<T>(list: T[], filterFn: (item: T,searchValue?:string) => boolean): T[] {\n if(typeof(list)!=='object') return []\n const res:T[]=[]\n list.forEach( el=> filterFn(el,this.value) && res.push(el) )\n return res\n }\n\n}\n\nexport default NileAutoComplete;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-auto-complete': NileAutoComplete;\n }\n}\n"],"names":["NileAutoComplete","c","this","disabled","isDropdownOpen","portal","portalManager","AutoCompletePortalManager","enableVirtualScroll","openOnFocus","value","placeholder","noBorder","noOutline","noPadding","loading","filterFunction","item","searchedValue","toLowerCase","includes","renderItemFunction","allMenuItems","menuItems","handleWindowResize","updatePortalAppendPosition","handleWindowScroll","_this","_inherits","_r","_createClass","key","connectedCallback","super","handleDocumentFocusIn","bind","handleDocumentMouseDown","disconnectedCallback","removeOpenListeners","cleanupPortalAppend","updated","changedProperties","has","applyFilter","setVirtualMenuWidth","updatePortalOptions","handleDropdownOpenChange","handlePortalChange","setupPortalAppend","addOpenListeners","document","addEventListener","window","removeEventListener","event","path","composedPath","hitSelf","hitDropdown","dropdownElement","hitPortalAppend","portalContainerElement","_this$dropdownElement","hide","_this$dropdownElement2","render","content","getVirtualizedContent","getContent","html","_templateObject","_taggedTemplateLiteral","handleSearch","handleFocus","handleClick","_templateObject2","nothing","length","_this2","_templateObject3","handleSelect","virtualize","items","renderItem","getItemRenderFunction","scroller","_this3","_templateObject4","map","hasTooltip","tooltip","shouldShowTooltip","for","tooltipContent","_templateObject5","unsafeHTML","_templateObject6","detail","emit","maxLengthOption","reduce","acc","curr","currLength","menuWidth","style","setProperty","show","inputElement","focus","setTimeout","_this5$dropdownElemen","list","filterFn","_typeof","t","res","forEach","el","push","NileElement","styles","__decorate","query","prototype","property","type","Boolean","reflect","String","attribute","Array","state","watch","waitUntilFirstUpdate","customElement"],"mappings":"g9IAqBaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,uEAUwBC,KAAAA,CAAQC,QAAY,CAAA,CAAA,CAAA,CAEpBD,KAAAA,CAAcE,cAAY,CAAA,CAAA,CAAA,CAMXF,KAAAA,CAAMG,MAAG,CAAA,CAAA,CAAA,CAEpCH,KAAAA,CAAAI,aAAAA,CAAgB,GAAIC,CAAAA,CAAAA,CAAAA,sBAAAA,CAAAA,KAAAA,GAERL,KAAAA,CAAmBM,mBAAAA,CAAAA,CAAY,EAE/BN,KAAAA,CAAWO,WAAAA,CAAAA,CAAY,EAExBP,KAAAA,CAA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A,CAAAA,CAAAA,CAAAA,CAAAA,CAAA4H,SAAA,CAAA,WAAA,CAAA,IAAA,IA0C7BF,CAAA,CAAA,CADCW,CAAM,CAAA,QAAA,CAAU,CAAEC,oBAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CASxCtI,CAAA4H,CAAAA,SAAAA,CAAA,qBAAA,IA9FU5H,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAgB0H,EAAA,CAD5Ba,CAAAA,CAAc,uBACFvI"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate as t}from"tslib";import{html as
|
|
1
|
+
import{__decorate as t}from"tslib";import{html as i,nothing as e}from"lit";import{query as s,property as n,state as o,customElement as h}from"lit/decorators.js";import{s as l}from"./nile-auto-complete.css.esm.js";import{N as r}from"../internal/nile-element.esm.js";import{w as a}from"../internal/watch.esm.js";import{A as p}from"./portal-manager.esm.js";import{v as d}from"../virtualize-a4a40d96.esm.js";import{unsafeHTML as u}from"lit/directives/unsafe-html.js";import"../floating-ui.dom-cc9126da.esm.js";import"./portal-utils.esm.js";import"lit/directive.js";import"lit/async-directive.js";import"lit/directives/repeat.js";let m=class extends r{constructor(){super(...arguments),this.disabled=!1,this.isDropdownOpen=!1,this.portal=!1,this.portalManager=new p(this),this.enableVirtualScroll=!1,this.openOnFocus=!1,this.value="",this.placeholder="Type here ..",this.noBorder=!1,this.noOutline=!1,this.noPadding=!1,this.loading=!1,this.filterFunction=(t,i)=>t.toLowerCase().includes(i.toLowerCase()),this.renderItemFunction=t=>t,this.allMenuItems=[],this.menuItems=[],this.handleWindowResize=()=>{this.portalManager.updatePortalAppendPosition()},this.handleWindowScroll=()=>{this.portalManager.updatePortalAppendPosition()}}connectedCallback(){super.connectedCallback(),this.renderItemFunction=t=>t,this.handleDocumentFocusIn=this.handleDocumentFocusIn.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.handleWindowScroll=this.handleWindowScroll.bind(this)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.portalManager.cleanupPortalAppend()}updated(t){super.updated(t),t.has("allMenuItems")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.setVirtualMenuWidth(),this.portal&&this.isDropdownOpen&&this.portalManager.updatePortalOptions()),t.has("isDropdownOpen")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.handleDropdownOpenChange()),t.has("value")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.portal&&this.isDropdownOpen&&this.portalManager.updatePortalOptions()),t.has("portal")&&this.handlePortalChange()}handlePortalChange(){this.isDropdownOpen&&(this.portal?this.portalManager.setupPortalAppend():this.portalManager.cleanupPortalAppend())}handleDropdownOpenChange(){this.isDropdownOpen?(this.addOpenListeners(),this.portal&&this.portalManager.setupPortalAppend()):(this.removeOpenListeners(),this.portal&&this.portalManager.cleanupPortalAppend())}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.portal&&(window.addEventListener("resize",this.handleWindowResize),window.addEventListener("scroll",this.handleWindowScroll,!0))}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("mousedown",this.handleDocumentMouseDown),window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("scroll",this.handleWindowScroll,!0)}handleDocumentFocusIn(t){if(!this.isDropdownOpen)return;const i=t.composedPath(),e=i.includes(this),s=this.dropdownElement&&i.includes(this.dropdownElement),n=this.portal&&this.portalManager.portalContainerElement&&i.includes(this.portalManager.portalContainerElement);e||s||n||(this.isDropdownOpen=!1,this.dropdownElement?.hide())}handleDocumentMouseDown(t){if(!this.isDropdownOpen)return;const i=t.composedPath(),e=i.includes(this),s=this.dropdownElement&&i.includes(this.dropdownElement),n=this.portal&&this.portalManager.portalContainerElement&&i.includes(this.portalManager.portalContainerElement);e||s||n||(this.isDropdownOpen=!1,this.dropdownElement?.hide())}render(){const t=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();return i`
|
|
2
2
|
<nile-dropdown class="nile-dropdown--input" ?open=${this.isDropdownOpen} noOpenOnCLick exportparts="input, base">
|
|
3
3
|
<nile-input class="nile-auto-complete--input"
|
|
4
4
|
?no-border=${this.noBorder}
|
|
@@ -13,19 +13,23 @@ import{__decorate as t}from"tslib";import{html as e,nothing as i}from"lit";impor
|
|
|
13
13
|
placeholder=${this.placeholder}
|
|
14
14
|
exportparts="input, base"
|
|
15
15
|
>
|
|
16
|
-
${this.loading?
|
|
16
|
+
${this.loading?i`<nile-icon slot="suffix" color="var(--nile-colors-primary-600)" name="var(--nile-icon-button-loading-blue-animated, var(--ng-icon-button-loading-blue-animated))" method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))" library="system"></nile-icon>`:e}
|
|
17
17
|
</nile-input>
|
|
18
|
-
${this.menuItems.length>0&&!this.loading?t:
|
|
18
|
+
${this.menuItems.length>0&&!this.loading?t:e}
|
|
19
19
|
</nile-dropdown>
|
|
20
|
-
`}getVirtualizedContent(){return
|
|
21
|
-
<nile-menu class="virtualized__menu" @nile-select=${this.handleSelect} id="content-menu" exportparts="menu__items-wrapper:options__wrapper">
|
|
22
|
-
${
|
|
20
|
+
`}getVirtualizedContent(){return i`
|
|
21
|
+
<nile-menu class="virtualized__menu" @nile-select=${this.handleSelect} id="content-menu" exportparts="menu__items-wrapper:options__wrapper" style=${this.portal?"display: none;":""}>
|
|
22
|
+
${d({items:this.menuItems,renderItem:t=>this.getItemRenderFunction(t),scroller:!0})}
|
|
23
23
|
</nile-menu>
|
|
24
|
-
`}getContent(){return
|
|
25
|
-
<nile-menu id="content-menu" @nile-select=${this.handleSelect} exportparts="menu__items-wrapper:options__wrapper">
|
|
24
|
+
`}getContent(){return i`
|
|
25
|
+
<nile-menu id="content-menu" @nile-select=${this.handleSelect} exportparts="menu__items-wrapper:options__wrapper" style=${this.portal?"display: none;":""}>
|
|
26
26
|
${this.menuItems.map((t=>this.getItemRenderFunction(t)))}
|
|
27
|
-
</nile-menu>`}getItemRenderFunction(t){const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
</nile-menu>`}getItemRenderFunction(t){const e=this.renderItemFunction(t),s=!!t.tooltip,n=s&&(!t.tooltip.for||"menu"===t.tooltip.for),o=s?t.tooltip.content:e;return n?i`
|
|
28
|
+
<nile-menu-item value=${e}>
|
|
29
|
+
<nile-lite-tooltip allowHTML .content=${o}>
|
|
30
|
+
<span class="menu-item-text">${u(e)}</span>
|
|
31
|
+
</nile-lite-tooltip>
|
|
32
|
+
</nile-menu-item>
|
|
33
|
+
`:i`
|
|
34
|
+
<nile-menu-item value=${e}>${u(e)}</nile-menu-item>
|
|
35
|
+
`}handleSelect(t){this.value=t.detail.value,this.emit("nile-complete",{value:t.detail.value}),this.isDropdownOpen=!1,this.dropdownElement?.hide()}setVirtualMenuWidth(){const t=this.menuItems.reduce(((t,i)=>{const e=this.renderItemFunction(i).length;return t>e?t:e}),0),i=9.5*t<110?110:9.5*t;this.style.setProperty("--virtual-scroll-container-width",i+"px")}handleSearch(t){this.value=t.detail.value.toLowerCase(),this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&(this.dropdownElement?.show(),this.portal&&this.portalManager.updatePortalOptions())}handleFocus(){this.openOnFocus&&(this.portal&&this.inputElement?.focus(),setTimeout((()=>{this.isDropdownOpen=!0,this.dropdownElement?.show()}),300))}handleClick(){this.isDropdownOpen=!0,this.dropdownElement?.show()}applyFilter(t,i){if("object"!=typeof t)return[];const e=[];return t.forEach((t=>i(t,this.value)&&e.push(t))),e}};m.styles=l,t([s("nile-dropdown")],m.prototype,"dropdownElement",void 0),t([s("nile-input")],m.prototype,"inputElement",void 0),t([n({type:Boolean})],m.prototype,"disabled",void 0),t([n({type:Boolean})],m.prototype,"isDropdownOpen",void 0),t([n({type:Boolean,reflect:!0})],m.prototype,"portal",void 0),t([n({type:Boolean})],m.prototype,"enableVirtualScroll",void 0),t([n({type:Boolean})],m.prototype,"openOnFocus",void 0),t([n({type:String})],m.prototype,"value",void 0),t([n({type:String})],m.prototype,"placeholder",void 0),t([n({type:Boolean})],m.prototype,"noBorder",void 0),t([n({type:Boolean})],m.prototype,"noOutline",void 0),t([n({type:Boolean})],m.prototype,"noPadding",void 0),t([n({type:Boolean})],m.prototype,"loading",void 0),t([n({attribute:!1})],m.prototype,"filterFunction",void 0),t([n({attribute:!1})],m.prototype,"renderItemFunction",void 0),t([n({type:Array})],m.prototype,"allMenuItems",void 0),t([o()],m.prototype,"menuItems",void 0),t([a("portal",{waitUntilFirstUpdate:!0})],m.prototype,"handlePortalChange",null),m=t([h("nile-auto-complete")],m);export{m as N};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-dff65c89.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-auto-complete.cjs.js","tslib","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","../virtualize-b6a2fbe0.cjs.js","lit/directive.js","lit/async-directive.js","lit/directives/repeat.js"],function(_export,_context){"use strict";var e,t,i,o,l,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture005CjsJs){e=_fixture005CjsJs.f;t=_fixture005CjsJs.a;i=_fixture005CjsJs.e;},function(_litStaticHtmlJs){o=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileAutoCompleteCjsJs){l=_nileAutoCompleteCjsJs.N;},function(_tslib){},function(_litDecoratorsJs){},function(_nileAutoCompleteCssCjsJs){},function(_internalNileElementCjsJs){},function(_virtualize002CjsJs){},function(_litDirectiveJs){},function(_litAsyncDirectiveJs){},function(_litDirectivesRepeatJs){}],execute:function execute(){describe("NileAutoComplete",function(){it("should render correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var i;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return e(o(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-auto-complete></nile-auto-complete>"]))));case 2:i=_context2.sent;t(i).to.be.instanceOf(l),t(i.shadowRoot).not.to.be["null"];case 4:case"end":return _context2.stop();}},_callee);}))),it("should have an empty value and dropdown closed by default",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var i;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return e(o(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-auto-complete></nile-auto-complete>"]))));case 2:i=_context3.sent;t(i.value).to.equal(""),t(i.isDropdownOpen).to.be["false"];case 4:case"end":return _context3.stop();}},_callee2);}))),it("should close the dropdown if no items match the search",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _l$shadowRoot;var l,a;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return e(o(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-auto-complete .allMenuItems=","></nile-auto-complete>\n "])),["Apple","Banana","Cherry"]));case 2:l=_context4.sent;a=(_l$shadowRoot=l.shadowRoot)===null||_l$shadowRoot===void 0?void 0:_l$shadowRoot.querySelector("nile-input");a!==null&&a!==void 0&&a.dispatchEvent(new CustomEvent("nile-input",{detail:{value:"Orange"}}));_context4.next=7;return i(l);case 7:t(l.menuItems).to.deep.equal([]);t(l.isDropdownOpen).to.be["false"];case 9:case"end":return _context4.stop();}},_callee3);}))),it("should apply the placeholder text to the input",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _i$shadowRoot;var i,l;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return e(o(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-auto-complete placeholder=\"Search items...\"></nile-auto-complete>\n "]))));case 2:i=_context5.sent;l=(_i$shadowRoot=i.shadowRoot)===null||_i$shadowRoot===void 0?void 0:_i$shadowRoot.querySelector("nile-input");t(l===null||l===void 0?void 0:l.getAttribute("placeholder")).to.equal("Search items...");case 5:case"end":return _context5.stop();}},_callee4);}))),it("should toggle border visibility based on the noBorder property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var _l$shadowRoot2;var l,a;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return e(o(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-auto-complete noBorder></nile-auto-complete>\n "]))));case 2:l=_context6.sent;a=(_l$shadowRoot2=l.shadowRoot)===null||_l$shadowRoot2===void 0?void 0:_l$shadowRoot2.querySelector("nile-input");t(a===null||a===void 0?void 0:a.hasAttribute("no-border")).to.be["true"];l.noBorder=!1;_context6.next=8;return i(l);case 8:t(a===null||a===void 0?void 0:a.hasAttribute("no-border")).to.be["false"];case 9:case"end":return _context6.stop();}},_callee5);}))),it("should handle an empty list of menu items",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var _l$shadowRoot3;var l,a;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return e(o(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-auto-complete .allMenuItems=","></nile-auto-complete>"])),[]));case 2:l=_context7.sent;a=(_l$shadowRoot3=l.shadowRoot)===null||_l$shadowRoot3===void 0?void 0:_l$shadowRoot3.querySelector("nile-input");a!==null&&a!==void 0&&a.dispatchEvent(new CustomEvent("nile-input",{detail:{value:"test"}}));_context7.next=7;return i(l);case 7:t(l.menuItems.length).to.equal(0);t(l.isDropdownOpen).to.be["false"];case 9:case"end":return _context7.stop();}},_callee6);}))),it("should hide the dropdown when no results are found",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _l$shadowRoot4;var l,a;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return e(o(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <nile-auto-complete .allMenuItems=","></nile-auto-complete>\n "])),["Apple","Banana","Cherry"]));case 2:l=_context8.sent;a=(_l$shadowRoot4=l.shadowRoot)===null||_l$shadowRoot4===void 0?void 0:_l$shadowRoot4.querySelector("nile-input");a!==null&&a!==void 0&&a.dispatchEvent(new CustomEvent("nile-input",{detail:{value:"NonMatchingValue"}}));_context8.next=7;return i(l);case 7:t(l.isDropdownOpen).to.be["false"];t(l.menuItems.length).to.equal(0);case 9:case"end":return _context8.stop();}},_callee7);})));});}};});
|
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-dff65c89.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-auto-complete.cjs.js","tslib","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","../internal/watch.cjs.js","./portal-manager.cjs.js","../floating-ui.dom-007bbe96.cjs.js","./portal-utils.cjs.js","../virtualize-b6a2fbe0.cjs.js","lit/directive.js","lit/async-directive.js","lit/directives/repeat.js"],function(_export,_context){"use strict";var t,e,i,o,l,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture005CjsJs){t=_fixture005CjsJs.f;e=_fixture005CjsJs.a;i=_fixture005CjsJs.e;},function(_litStaticHtmlJs){o=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileAutoCompleteCjsJs){l=_nileAutoCompleteCjsJs.N;},function(_tslib){},function(_litDecoratorsJs){},function(_nileAutoCompleteCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalWatchCjsJs){},function(_portalManagerCjsJs){},function(_floatingUiDom001CjsJs){},function(_portalUtilsCjsJs){},function(_virtualize002CjsJs){},function(_litDirectiveJs){},function(_litAsyncDirectiveJs){},function(_litDirectivesRepeatJs){}],execute:function execute(){describe("NileAutoComplete",function(){it("should render correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var i;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return t(o(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-auto-complete></nile-auto-complete>"]))));case 2:i=_context2.sent;e(i).to.be.instanceOf(l),e(i.shadowRoot).not.to.be["null"];case 4:case"end":return _context2.stop();}},_callee);}))),it("should have an empty value and dropdown closed by default",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var i;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return t(o(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-auto-complete></nile-auto-complete>"]))));case 2:i=_context3.sent;e(i.value).to.equal(""),e(i.isDropdownOpen).to.be["false"];case 4:case"end":return _context3.stop();}},_callee2);}))),it("should close the dropdown if no items match the search",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _l$shadowRoot;var l,a;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return t(o(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-auto-complete .allMenuItems=","></nile-auto-complete>\n "])),["Apple","Banana","Cherry"]));case 2:l=_context4.sent;a=(_l$shadowRoot=l.shadowRoot)===null||_l$shadowRoot===void 0?void 0:_l$shadowRoot.querySelector("nile-input");a!==null&&a!==void 0&&a.dispatchEvent(new CustomEvent("nile-input",{detail:{value:"Orange"}}));_context4.next=7;return i(l);case 7:e(l.menuItems).to.deep.equal([]);e(l.isDropdownOpen).to.be["false"];case 9:case"end":return _context4.stop();}},_callee3);}))),it("should apply the placeholder text to the input",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _i$shadowRoot;var i,l;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return t(o(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-auto-complete placeholder=\"Search items...\"></nile-auto-complete>\n "]))));case 2:i=_context5.sent;l=(_i$shadowRoot=i.shadowRoot)===null||_i$shadowRoot===void 0?void 0:_i$shadowRoot.querySelector("nile-input");e(l===null||l===void 0?void 0:l.getAttribute("placeholder")).to.equal("Search items...");case 5:case"end":return _context5.stop();}},_callee4);}))),it("should toggle border visibility based on the noBorder property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var _l$shadowRoot2;var l,a;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return t(o(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-auto-complete noBorder></nile-auto-complete>\n "]))));case 2:l=_context6.sent;a=(_l$shadowRoot2=l.shadowRoot)===null||_l$shadowRoot2===void 0?void 0:_l$shadowRoot2.querySelector("nile-input");e(a===null||a===void 0?void 0:a.hasAttribute("no-border")).to.be["true"];l.noBorder=!1;_context6.next=8;return i(l);case 8:e(a===null||a===void 0?void 0:a.hasAttribute("no-border")).to.be["false"];case 9:case"end":return _context6.stop();}},_callee5);}))),it("should handle an empty list of menu items",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var _l$shadowRoot3;var l,a;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return t(o(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-auto-complete .allMenuItems=","></nile-auto-complete>"])),[]));case 2:l=_context7.sent;a=(_l$shadowRoot3=l.shadowRoot)===null||_l$shadowRoot3===void 0?void 0:_l$shadowRoot3.querySelector("nile-input");a!==null&&a!==void 0&&a.dispatchEvent(new CustomEvent("nile-input",{detail:{value:"test"}}));_context7.next=7;return i(l);case 7:e(l.menuItems.length).to.equal(0);e(l.isDropdownOpen).to.be["false"];case 9:case"end":return _context7.stop();}},_callee6);}))),it("should hide the dropdown when no results are found",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _l$shadowRoot4;var l,a;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return t(o(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <nile-auto-complete .allMenuItems=","></nile-auto-complete>\n "])),["Apple","Banana","Cherry"]));case 2:l=_context8.sent;a=(_l$shadowRoot4=l.shadowRoot)===null||_l$shadowRoot4===void 0?void 0:_l$shadowRoot4.querySelector("nile-input");a!==null&&a!==void 0&&a.dispatchEvent(new CustomEvent("nile-input",{detail:{value:"NonMatchingValue"}}));_context8.next=7;return i(l);case 7:e(l.isDropdownOpen).to.be["false"];e(l.menuItems.length).to.equal(0);case 9:case"end":return _context8.stop();}},_callee7);})));});}};});
|
|
2
2
|
//# sourceMappingURL=nile-auto-complete.test.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-auto-complete.test.cjs.js","sources":["../../../src/nile-auto-complete/nile-auto-complete.test.ts"],"sourcesContent":["import { fixture, html, expect, oneEvent, elementUpdated } from '@open-wc/testing';\nimport './nile-auto-complete';\nimport { NileAutoComplete } from './nile-auto-complete';\n\nconst wait=(ms:number=50000)=>new Promise(resolve => setTimeout(resolve, ms))\n\ndescribe('NileAutoComplete', () => {\n it('should render correctly', async () => {\n const el = await fixture<NileAutoComplete>(html`<nile-auto-complete></nile-auto-complete>`);\n expect(el).to.be.instanceOf(NileAutoComplete);\n expect(el.shadowRoot).not.to.be.null;\n });\n\n it('should have an empty value and dropdown closed by default', async () => {\n const el = await fixture<NileAutoComplete>(html`<nile-auto-complete></nile-auto-complete>`);\n expect(el.value).to.equal('');\n expect(el.isDropdownOpen).to.be.false;\n });\n\n // it('should open the dropdown when input is focused and openOnFocus is true', async () => {\n // const el = await fixture<NileAutoComplete>(html`<nile-auto-complete openOnFocus></nile-auto-complete>`);\n\n // // Focus the input\n // const input = el.shadowRoot?.querySelector('nile-input');\n // input?.dispatchEvent(new Event('focus'));\n\t// \tawait wait()\n // await elementUpdated(el);\n\n // expect(el.isDropdownOpen).to.be.true;\n // });\n\n // it('should filter menu items based on the input value', async () => {\n // const el = await fixture<NileAutoComplete>(html`\n // <nile-auto-complete .allMenuItems=${['Apple', 'Banana', 'Cherry']}></nile-auto-complete>\n // `);\n\n // // Simulate typing in the input\n // const input = el.shadowRoot?.querySelector('nile-input');\n // input?.dispatchEvent(new CustomEvent('nile-input', { detail: { value: 'Ap' } }));\n // await elementUpdated(el);\n\n // expect(el.menuItems).to.deep.equal(['Apple']);\n // });\n\n it('should close the dropdown if no items match the search', async () => {\n const el = await fixture<NileAutoComplete>(html`\n <nile-auto-complete .allMenuItems=${['Apple', 'Banana', 'Cherry']}></nile-auto-complete>\n `);\n\n // Simulate typing in the input with a non-matching value\n const input = el.shadowRoot?.querySelector('nile-input');\n input?.dispatchEvent(new CustomEvent('nile-input', { detail: { value: 'Orange' } }));\n await elementUpdated(el);\n\n expect(el.menuItems).to.deep.equal([]);\n expect(el.isDropdownOpen).to.be.false;\n });\n\n // it('should select an item from the menu', async () => {\n // const el = await fixture<NileAutoComplete>(html`\n // <nile-auto-complete .allMenuItems=${['Apple', 'Banana', 'Cherry']}></nile-auto-complete>\n // `);\n\n // // Simulate typing in the input\n // const input = el.shadowRoot?.querySelector('nile-input');\n // input?.dispatchEvent(new CustomEvent('nile-input', { detail: { value: 'Ban' } }));\n // await elementUpdated(el);\n\n // const menuItem = el.shadowRoot?.querySelector('nile-menu-item[value=\"Banana\"]');\n // expect(menuItem).to.exist;\n\n // // Select the menu item\n // const selectEvent = new CustomEvent('nile-select', { detail: { value: 'Banana' } });\n // menuItem?.dispatchEvent(selectEvent);\n // await elementUpdated(el);\n\n // expect(el.value).to.equal('Banana');\n // expect(el.isDropdownOpen).to.be.false;\n // });\n\n // it('should emit nile-complete event when an item is selected', async () => {\n // const el = await fixture<NileAutoComplete>(html`\n // <nile-auto-complete .allMenuItems=${['Apple', 'Banana', 'Cherry']}></nile-auto-complete>\n // `);\n\n // // Simulate typing in the input\n // const input = el.shadowRoot?.querySelector('nile-input');\n // input?.dispatchEvent(new CustomEvent('nile-input', { detail: { value: 'App' } }));\n // await elementUpdated(el);\n\n // // Wait for the selection event\n // const selectEvent = oneEvent(el, 'nile-complete');\n\n // // Select an item\n // const menuItem = el.shadowRoot?.querySelector('nile-menu-item[value=\"Apple\"]');\n // const event = new CustomEvent('nile-select', { detail: { value: 'Apple' } });\n // menuItem?.dispatchEvent(event);\n\n // const { detail } = await selectEvent;\n // expect(detail.value).to.equal('Apple');\n // });\n\n it('should apply the placeholder text to the input', async () => {\n const el = await fixture<NileAutoComplete>(html`\n <nile-auto-complete placeholder=\"Search items...\"></nile-auto-complete>\n `);\n\n const input = el.shadowRoot?.querySelector('nile-input');\n expect(input?.getAttribute('placeholder')).to.equal('Search items...');\n });\n\n it('should toggle border visibility based on the noBorder property', async () => {\n const el = await fixture<NileAutoComplete>(html`\n <nile-auto-complete noBorder></nile-auto-complete>\n `);\n\n const input = el.shadowRoot?.querySelector('nile-input');\n expect(input?.hasAttribute('no-border')).to.be.true;\n\n el.noBorder = false;\n await elementUpdated(el);\n\n expect(input?.hasAttribute('no-border')).to.be.false;\n });\n\n it('should handle an empty list of menu items', async () => {\n const el = await fixture<NileAutoComplete>(html`<nile-auto-complete .allMenuItems=${[]}></nile-auto-complete>`);\n\n const input = el.shadowRoot?.querySelector('nile-input');\n input?.dispatchEvent(new CustomEvent('nile-input', { detail: { value: 'test' } }));\n await elementUpdated(el);\n\n expect(el.menuItems.length).to.equal(0);\n expect(el.isDropdownOpen).to.be.false;\n });\n\n it('should hide the dropdown when no results are found', async () => {\n const el = await fixture<NileAutoComplete>(html`\n <nile-auto-complete .allMenuItems=${['Apple', 'Banana', 'Cherry']}></nile-auto-complete>\n `);\n\n const input = el.shadowRoot?.querySelector('nile-input');\n input?.dispatchEvent(new CustomEvent('nile-input', { detail: { value: 'NonMatchingValue' } }));\n await elementUpdated(el);\n\n expect(el.isDropdownOpen).to.be.false;\n expect(el.menuItems.length).to.equal(0);\n });\n});\n"],"names":["_regeneratorRuntime","e","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","value","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","_typeof","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","_catch","delegateYield","_taggedTemplateLiteral","freeze","defineProperties","raw","asyncGeneratorStep","_asyncToGenerator","arguments","apply","_next","_throw","setters","_fixture005CjsJs","describe","it","fixture","html","_templateObject","el","expect","to","be","instanceOf","NileAutoComplete","shadowRoot","not","_context2","_callee","_templateObject2","equal","isDropdownOpen","_context3","_callee2","_templateObject3","input","querySelector","dispatchEvent","CustomEvent","detail","elementUpdated","menuItems","deep","_context4","_callee3","_templateObject4","getAttribute","_context5","_callee4","_templateObject5","hasAttribute","true","noBorder","_context6","_callee5","_templateObject6","_context7","_callee6","_templateObject7","_context8","false","_callee7"],"mappings":"q2BA8C0C,oJAAAA,mBAAA,UAAAA,oBAAA,SAAAC,CAAA,OAAAC,CAAA,CAAAD,CAAA,IAAAE,CAAA,CAAAC,MAAA,CAAAC,SAAA,CAAAC,CAAA,CAAAH,CAAA,CAAAI,cAAA,CAAAC,CAAA,CAAAJ,MAAA,CAAAK,cAAA,WAAAP,CAAA,CAAAD,CAAA,CAAAE,CAAA,EAAAD,CAAA,CAAAD,CAAA,EAAAE,CAAA,CAAAO,KAAA,GAAAC,CAAA,oBAAAC,MAAA,CAAAA,MAAA,IAAAC,CAAA,CAAAF,CAAA,CAAAG,QAAA,eAAAC,CAAA,CAAAJ,CAAA,CAAAK,aAAA,oBAAAC,CAAA,CAAAN,CAAA,CAAAO,WAAA,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AAA,UAAAA,SAAAA,iBAAAA,SAAAA,CAAAA,IAAAA,CAAAA,SAAAA,CAAAA,IAAAA,SAAAA,SAAAA,CAAAA,IAAAA,SACtC6B,CAAAA,EAA0BC,CAAI,CAAAyC,gBAAA,GAAAA,gBAAA,CAAAxD,sBAAA,iFACT,CAAC,QAAS,QAAU,CAAA,QAAA,CAAA,CAGpDiC,CAAAA,QAJAhB,CAAAA,CAAAA,SAAAA,CAAAA,IAAAA,CAIAgB,CAAAA,EAAAA,cAAAA,CAAQhB,CAAGM,CAAAA,UAAAA,UAAAA,cAAAA,iBAAHN,cAAAA,CAAeiB,aAAc,CAAA,YAAA,CAAA,CAC3CD,CAAOE,SAAPF,CAAOE,WAAPF,CAAOE,CAAAA,aAAAA,CAAc,GAAIC,CAAAA,WAAAA,CAAY,YAAc,CAAA,CAAEC,MAAQ,CAAA,CAAElI,KAAO,CAAA,kBAAA,CAAA,CAAA,CAAA,CAAA,CAAAsJ,SAAA,CAAA9F,IAAA,SAChE2E,CAAAA,CAAerB,CAAAA,CAAAA,CAAAA,QAErBC,CAAOD,CAAAA,CAAAA,CAAGY,cAAgBV,CAAAA,CAAAA,EAAAA,CAAGC,EAAGsC,SAAAA,CAChCxC,CAAOD,CAAAA,CAAAA,CAAGsB,SAAU/D,CAAAA,MAAAA,CAAAA,CAAQ2C,EAAGS,CAAAA,KAAAA,CAAM,EAAE,yBAAA6B,SAAA,CAAAhE,IAAA,MAAAkE,QAAA,GACvC,EAAA,CAAA,EAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"nile-auto-complete.test.cjs.js","sources":["../../../src/nile-auto-complete/nile-auto-complete.test.ts"],"sourcesContent":["import { fixture, html, expect, oneEvent, elementUpdated } from '@open-wc/testing';\nimport './nile-auto-complete';\nimport { NileAutoComplete } from './nile-auto-complete';\n\nconst wait=(ms:number=50000)=>new Promise(resolve => setTimeout(resolve, ms))\n\ndescribe('NileAutoComplete', () => {\n it('should render correctly', async () => {\n const el = await fixture<NileAutoComplete>(html`<nile-auto-complete></nile-auto-complete>`);\n expect(el).to.be.instanceOf(NileAutoComplete);\n expect(el.shadowRoot).not.to.be.null;\n });\n\n it('should have an empty value and dropdown closed by default', async () => {\n const el = await fixture<NileAutoComplete>(html`<nile-auto-complete></nile-auto-complete>`);\n expect(el.value).to.equal('');\n expect(el.isDropdownOpen).to.be.false;\n });\n\n // it('should open the dropdown when input is focused and openOnFocus is true', async () => {\n // const el = await fixture<NileAutoComplete>(html`<nile-auto-complete openOnFocus></nile-auto-complete>`);\n\n // // Focus the input\n // const input = el.shadowRoot?.querySelector('nile-input');\n // input?.dispatchEvent(new Event('focus'));\n\t// \tawait wait()\n // await elementUpdated(el);\n\n // expect(el.isDropdownOpen).to.be.true;\n // });\n\n // it('should filter menu items based on the input value', async () => {\n // const el = await fixture<NileAutoComplete>(html`\n // <nile-auto-complete .allMenuItems=${['Apple', 'Banana', 'Cherry']}></nile-auto-complete>\n // `);\n\n // // Simulate typing in the input\n // const input = el.shadowRoot?.querySelector('nile-input');\n // input?.dispatchEvent(new CustomEvent('nile-input', { detail: { value: 'Ap' } }));\n // await elementUpdated(el);\n\n // expect(el.menuItems).to.deep.equal(['Apple']);\n // });\n\n it('should close the dropdown if no items match the search', async () => {\n const el = await fixture<NileAutoComplete>(html`\n <nile-auto-complete .allMenuItems=${['Apple', 'Banana', 'Cherry']}></nile-auto-complete>\n `);\n\n // Simulate typing in the input with a non-matching value\n const input = el.shadowRoot?.querySelector('nile-input');\n input?.dispatchEvent(new CustomEvent('nile-input', { detail: { value: 'Orange' } }));\n await elementUpdated(el);\n\n expect(el.menuItems).to.deep.equal([]);\n expect(el.isDropdownOpen).to.be.false;\n });\n\n // it('should select an item from the menu', async () => {\n // const el = await fixture<NileAutoComplete>(html`\n // <nile-auto-complete .allMenuItems=${['Apple', 'Banana', 'Cherry']}></nile-auto-complete>\n // `);\n\n // // Simulate typing in the input\n // const input = el.shadowRoot?.querySelector('nile-input');\n // input?.dispatchEvent(new CustomEvent('nile-input', { detail: { value: 'Ban' } }));\n // await elementUpdated(el);\n\n // const menuItem = el.shadowRoot?.querySelector('nile-menu-item[value=\"Banana\"]');\n // expect(menuItem).to.exist;\n\n // // Select the menu item\n // const selectEvent = new CustomEvent('nile-select', { detail: { value: 'Banana' } });\n // menuItem?.dispatchEvent(selectEvent);\n // await elementUpdated(el);\n\n // expect(el.value).to.equal('Banana');\n // expect(el.isDropdownOpen).to.be.false;\n // });\n\n // it('should emit nile-complete event when an item is selected', async () => {\n // const el = await fixture<NileAutoComplete>(html`\n // <nile-auto-complete .allMenuItems=${['Apple', 'Banana', 'Cherry']}></nile-auto-complete>\n // `);\n\n // // Simulate typing in the input\n // const input = el.shadowRoot?.querySelector('nile-input');\n // input?.dispatchEvent(new CustomEvent('nile-input', { detail: { value: 'App' } }));\n // await elementUpdated(el);\n\n // // Wait for the selection event\n // const selectEvent = oneEvent(el, 'nile-complete');\n\n // // Select an item\n // const menuItem = el.shadowRoot?.querySelector('nile-menu-item[value=\"Apple\"]');\n // const event = new CustomEvent('nile-select', { detail: { value: 'Apple' } });\n // menuItem?.dispatchEvent(event);\n\n // const { detail } = await selectEvent;\n // expect(detail.value).to.equal('Apple');\n // });\n\n it('should apply the placeholder text to the input', async () => {\n const el = await fixture<NileAutoComplete>(html`\n <nile-auto-complete placeholder=\"Search items...\"></nile-auto-complete>\n `);\n\n const input = el.shadowRoot?.querySelector('nile-input');\n expect(input?.getAttribute('placeholder')).to.equal('Search items...');\n });\n\n it('should toggle border visibility based on the noBorder property', async () => {\n const el = await fixture<NileAutoComplete>(html`\n <nile-auto-complete noBorder></nile-auto-complete>\n `);\n\n const input = el.shadowRoot?.querySelector('nile-input');\n expect(input?.hasAttribute('no-border')).to.be.true;\n\n el.noBorder = false;\n await elementUpdated(el);\n\n expect(input?.hasAttribute('no-border')).to.be.false;\n });\n\n it('should handle an empty list of menu items', async () => {\n const el = await fixture<NileAutoComplete>(html`<nile-auto-complete .allMenuItems=${[]}></nile-auto-complete>`);\n\n const input = el.shadowRoot?.querySelector('nile-input');\n input?.dispatchEvent(new CustomEvent('nile-input', { detail: { value: 'test' } }));\n await elementUpdated(el);\n\n expect(el.menuItems.length).to.equal(0);\n expect(el.isDropdownOpen).to.be.false;\n });\n\n it('should hide the dropdown when no results are found', async () => {\n const el = await fixture<NileAutoComplete>(html`\n <nile-auto-complete .allMenuItems=${['Apple', 'Banana', 'Cherry']}></nile-auto-complete>\n `);\n\n const input = el.shadowRoot?.querySelector('nile-input');\n input?.dispatchEvent(new CustomEvent('nile-input', { detail: { value: 'NonMatchingValue' } }));\n await elementUpdated(el);\n\n expect(el.isDropdownOpen).to.be.false;\n expect(el.menuItems.length).to.equal(0);\n });\n});\n"],"names":["_regeneratorRuntime","e","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","value","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","_typeof","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","_catch","delegateYield","_taggedTemplateLiteral","freeze","defineProperties","raw","asyncGeneratorStep","_asyncToGenerator","arguments","apply","_next","_throw","setters","_fixture005CjsJs","describe","it","fixture","html","_templateObject","el","expect","to","be","instanceOf","NileAutoComplete","shadowRoot","not","null","_context2","_callee","_templateObject2","equal","isDropdownOpen","_context3","_callee2","_templateObject3","input","querySelector","dispatchEvent","CustomEvent","detail","elementUpdated","menuItems","deep","_context4","_callee3","_templateObject4","getAttribute","_context5","_callee4","_templateObject5","hasAttribute","true","noBorder","_context6","_callee5","_templateObject6","_context7","_callee6","_templateObject7","_context8","false","_callee7"],"mappings":"u9BA8C0C,oJAAAA,mBAAA,UAAAA,oBAAA,SAAAC,CAAA,OAAAC,CAAA,CAAAD,CAAA,IAAAE,CAAA,CAAAC,MAAA,CAAAC,SAAA,CAAAC,CAAA,CAAAH,CAAA,CAAAI,cAAA,CAAAC,CAAA,CAAAJ,MAAA,CAAAK,cAAA,WAAAP,CAAA,CAAAD,CAAA,CAAAE,CAAA,EAAAD,CAAA,CAAAD,CAAA,EAAAE,CAAA,CAAAO,KAAA,GAAAC,CAAA,oBAAAC,MAAA,CAAAA,MAAA,IAAAC,CAAA,CAAAF,CAAA,CAAAG,QAAA,eAAAC,CAAA,CAAAJ,CAAA,CAAAK,aAAA,oBAAAC,CAAA,CAAAN,CAAA,CAAAO,WAAA,2BAAAC,OAAAjB,CAAA,CAAAD,CAAA,CAAAE,CAAA,SAAAC,MAAA,CAAAK,cAAA,CAAAP,CAAA,CAAAD,CAAA,EAAAS,KAAA,CAAAP,CAAA,CAAAiB,UAAA,IAAAC,YAAA,IAAAC,QAAA,MAAApB,CAAA,CAAAD,CAAA,OAAAkB,MAAA,eAAAjB,CAAA,EAAAiB,MAAA,UAAAA,OAAAjB,CAAA,CAAAD,CAAA,CAAAE,CAAA,SAAAD,CAAA,CAAAD,CAAA,EAAAE,CAAA,aAAAoB,KAAArB,CAAA,CAAAD,CAAA,CAAAE,CAAA,CAAAG,CAAA,MAAAK,CAAA,CAAAV,CAAA,EAAAA,CAAA,CAAAI,SAAA,YAAAmB,SAAA,CAAAvB,CAAA,CAAAuB,SAAA,CAAAX,CAAA,CAAAT,MAAA,CAAAqB,MAAA,CAAAd,CAAA,CAAAN,SAAA,EAAAU,CAAA,KAAAW,OAAA,CAAApB,CAAA,aAAAE,CAAA,CAAAK,CAAA,YAAAH,KAAA,CAAAiB,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AAAA,CAAGa,cAAgBX,CAAAA,CAAAA,EAAAA,CAAGC,EAAGuC,SAAAA,CAChCzC,CAAOD,CAAAA,CAAAA,CAAGuB,SAAUhE,CAAAA,MAAAA,CAAAA,CAAQ2C,EAAGU,CAAAA,KAAAA,CAAM,EAAE,yBAAA6B,SAAA,CAAAjE,IAAA,MAAAmE,QAAA,GACvC,EAAA,CAAA,EAAA,CAAA,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as e,a as t,e as i}from"../fixture-985bba12.esm.js";import{html as o}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import{N as l}from"./nile-auto-complete.esm.js";import"tslib";import"lit/decorators.js";import"./nile-auto-complete.css.esm.js";import"../internal/nile-element.esm.js";import"../virtualize-a4a40d96.esm.js";import"lit/directive.js";import"lit/async-directive.js";import"lit/directives/repeat.js";describe("NileAutoComplete",(()=>{it("should render correctly",(async()=>{const i=await e(o`<nile-auto-complete></nile-auto-complete>`);t(i).to.be.instanceOf(l),t(i.shadowRoot).not.to.be.null})),it("should have an empty value and dropdown closed by default",(async()=>{const i=await e(o`<nile-auto-complete></nile-auto-complete>`);t(i.value).to.equal(""),t(i.isDropdownOpen).to.be.false})),it("should close the dropdown if no items match the search",(async()=>{const l=await e(o`
|
|
1
|
+
import{f as e,a as t,e as i}from"../fixture-985bba12.esm.js";import{html as o}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import{N as l}from"./nile-auto-complete.esm.js";import"tslib";import"lit/decorators.js";import"./nile-auto-complete.css.esm.js";import"../internal/nile-element.esm.js";import"../internal/watch.esm.js";import"./portal-manager.esm.js";import"../floating-ui.dom-cc9126da.esm.js";import"./portal-utils.esm.js";import"../virtualize-a4a40d96.esm.js";import"lit/directive.js";import"lit/async-directive.js";import"lit/directives/repeat.js";describe("NileAutoComplete",(()=>{it("should render correctly",(async()=>{const i=await e(o`<nile-auto-complete></nile-auto-complete>`);t(i).to.be.instanceOf(l),t(i.shadowRoot).not.to.be.null})),it("should have an empty value and dropdown closed by default",(async()=>{const i=await e(o`<nile-auto-complete></nile-auto-complete>`);t(i.value).to.equal(""),t(i.isDropdownOpen).to.be.false})),it("should close the dropdown if no items match the search",(async()=>{const l=await e(o`
|
|
2
2
|
<nile-auto-complete .allMenuItems=${["Apple","Banana","Cherry"]}></nile-auto-complete>
|
|
3
3
|
`),a=l.shadowRoot?.querySelector("nile-input");a?.dispatchEvent(new CustomEvent("nile-input",{detail:{value:"Orange"}})),await i(l),t(l.menuItems).to.deep.equal([]),t(l.isDropdownOpen).to.be.false})),it("should apply the placeholder text to the input",(async()=>{const i=await e(o`
|
|
4
4
|
<nile-auto-complete placeholder="Search items..."></nile-auto-complete>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["../floating-ui.dom-007bbe96.cjs.js","./portal-utils.cjs.js"],function(_export,_context){"use strict";var t,i,s,e,o,n,a,h,l,r,u;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 _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}return{setters:[function(_floatingUiDom001CjsJs){t=_floatingUiDom001CjsJs.c;i=_floatingUiDom001CjsJs.o;s=_floatingUiDom001CjsJs.s;e=_floatingUiDom001CjsJs.f;o=_floatingUiDom001CjsJs.a;n=_floatingUiDom001CjsJs.p;a=_floatingUiDom001CjsJs.b;},function(_portalUtilsCjsJs){h=_portalUtilsCjsJs.P;l=_portalUtilsCjsJs.a;r=_portalUtilsCjsJs.b;}],execute:function execute(){_export("A",u=/*#__PURE__*/function(){function u(t){_classCallCheck(this,u);this.portalContainer=null,this.originalMenuParent=null,this.measuredMenuHeight=null,this.clonedMenu=null,this.cleanupAutoUpdate=null,this.currentPlacement="bottom",this.currentMiddlewareData=null,this.component=t;}return _createClass(u,[{key:"createPortalAppendContainer",value:function createPortalAppendContainer(){var t=document.createElement("div");return t.style.position="absolute",t.style.zIndex="9999",t.style.pointerEvents="none",t.style.width="auto",t.style.minWidth="auto",t.className="nile-auto-complete-portal-append",t;}},{key:"positionPortalAppend",value:function positionPortalAppend(){this.portalContainer&&this.component.dropdownElement&&(this.measureMenuHeight(),this.computeFloatingUIPosition());}},{key:"measureMenuHeight",value:function measureMenuHeight(){!this.measuredMenuHeight&&this.portalContainer&&(this.portalContainer.style.position="absolute",this.portalContainer.style.visibility="hidden",this.portalContainer.style.top="0px",this.portalContainer.style.left="0px",this.portalContainer.offsetHeight,this.measuredMenuHeight=this.portalContainer.offsetHeight,this.portalContainer.style.visibility="");}},{key:"computeFloatingUIPosition",value:function(){var _computeFloatingUIPosition=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var t,i,_yield$this$calculate,_s,_e,_o,_n;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(this.portalContainer){_context2.next=2;break;}return _context2.abrupt("return");case 2:t=this.component.inputElement||this.component,i=this.portalContainer;_context2.prev=3;_context2.next=6;return this.calculateFloatingUIPosition(t,i);case 6:_yield$this$calculate=_context2.sent;_s=_yield$this$calculate.x;_e=_yield$this$calculate.y;_o=_yield$this$calculate.placement;_n=_yield$this$calculate.middlewareData;this.applyFloatingUIPosition(i,t,_s,_e,_o,_n);_context2.next=17;break;case 14:_context2.prev=14;_context2.t0=_context2["catch"](3);console.warn("Floating UI positioning failed, falling back to simple positioning:",_context2.t0),this.fallbackPositioning();case 17:case"end":return _context2.stop();}},_callee,this,[[3,14]]);}));function computeFloatingUIPosition(){return _computeFloatingUIPosition.apply(this,arguments);}return computeFloatingUIPosition;}()},{key:"calculateFloatingUIPosition",value:function(){var _calculateFloatingUIPosition=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(i,s){var e,o,n;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:e=h.findBoundaryElements(i),o="top"===h.getOptimalPlacement(i)?"top-start":"bottom-start",n=this.createFloatingUIMiddleware(e);_context3.next=3;return t(i,s,{placement:o,strategy:"fixed",middleware:n,platform:this.createCustomPlatform()});case 3:return _context3.abrupt("return",_context3.sent);case 4:case"end":return _context3.stop();}},_callee2,this);}));function calculateFloatingUIPosition(_x,_x2){return _calculateFloatingUIPosition.apply(this,arguments);}return calculateFloatingUIPosition;}()},{key:"createFloatingUIMiddleware",value:function createFloatingUIMiddleware(t){return[i(4),s({apply:this.handleSizeMiddleware.bind(this),padding:10,boundary:t}),e({fallbackPlacements:["bottom-start","top-start","bottom","top","bottom-end","top-end"],fallbackStrategy:"bestFit",padding:10,boundary:t}),o({padding:10,crossAxis:!0,boundary:t})];}},{key:"handleSizeMiddleware",value:function handleSizeMiddleware(_ref){var t=_ref.availableWidth,i=_ref.availableHeight,s=_ref.elements,e=_ref.rects;var o=h.calculateOptimalHeight(e.reference,window.innerHeight,this.currentPlacement);s.floating.style.maxHeight="".concat(o,"px"),s.floating.style.setProperty("--auto-size-available-width","".concat(t,"px")),s.floating.style.setProperty("--auto-size-available-height","".concat(o,"px"));}},{key:"createCustomPlatform",value:function createCustomPlatform(){return n;}},{key:"applyFloatingUIPosition",value:function applyFloatingUIPosition(t,i,s,e,o,n){var a=i.getBoundingClientRect();Object.assign(t.style,{left:"".concat(a.left,"px"),top:"".concat(e,"px"),position:"fixed",pointerEvents:"auto",width:"auto",minWidth:"auto"}),this.currentPlacement=o,this.currentMiddlewareData=n,h.applyCollisionData(t,n,o);var l=o.split("-")[0];t.className="nile-auto-complete-portal-append menu__listbox--".concat(l);}},{key:"fallbackPositioning",value:function fallbackPositioning(){if(!this.portalContainer)return;var t=(this.component.inputElement||this.component).getBoundingClientRect(),i=window.innerHeight;this.measuredMenuHeight;var s=i-t.bottom,e=t.top;var o,n,a;e>s?(a=Math.max(e-20,100),o=Math.max(t.top-a-4,10),n="top"):(a=Math.max(s-20,100),o=t.bottom+4,n="bottom"),this.portalContainer.style.left="".concat(t.left,"px"),this.portalContainer.style.top="".concat(o,"px"),this.portalContainer.style.width="auto",this.portalContainer.style.minWidth="auto",this.portalContainer.style.maxHeight="".concat(a,"px"),this.portalContainer.style.pointerEvents="auto",this.portalContainer.className="nile-auto-complete-portal-append menu__listbox--".concat(n),this.calculateAndSetAutoSizeProperties(t,o,n);}},{key:"calculateAndSetAutoSizeProperties",value:function calculateAndSetAutoSizeProperties(t,i,s){if(!this.portalContainer)return;var e=window.innerHeight,o=window.innerWidth;var n;n="top"===s?t.top-10:e-t.bottom-10;var a=Math.min(t.width,o-t.left-10);this.portalContainer.style.setProperty("--auto-size-available-height","".concat(Math.max(n,100),"px")),this.portalContainer.style.setProperty("--auto-size-available-width","".concat(Math.max(a,200),"px"));}},{key:"updatePortalAppendPosition",value:function updatePortalAppendPosition(){this.component.portal&&this.portalContainer&&this.positionPortalAppend();}},{key:"handleWindowResize",value:function handleWindowResize(){this.component.portal&&this.portalContainer&&this.positionPortalAppend();}},{key:"setupAutoUpdatePositioning",value:function setupAutoUpdatePositioning(){var _this=this;this.portalContainer&&this.component&&(this.cleanupAutoUpdatePositioning(),this.cleanupAutoUpdate=a(this.component,this.portalContainer,function(){_this.computeFloatingUIPosition();},{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0}));}},{key:"cleanupAutoUpdatePositioning",value:function cleanupAutoUpdatePositioning(){this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null);}},{key:"injectStylesToDocument",value:function injectStylesToDocument(){if(!this.portalContainer)return;var t=h.generateStyleId();if(document.getElementById(t))return;var i=this.component.constructor.styles;if(!i)return;var s=document.createElement("style");s.id=t,s.textContent=h.extractStylesAsCSS(i),document.head.appendChild(s),this.portalContainer.t=t;}},{key:"adoptStylesToPortalAppend",value:function adoptStylesToPortalAppend(){this.portalContainer&&this.injectStylesToDocument();}},{key:"setupPortalAppend",value:function setupPortalAppend(){var _this2=this;this.component.portal&&this.component.updateComplete.then(function(){setTimeout(function(){var _this2$component$shad;var t=((_this2$component$shad=_this2.component.shadowRoot)===null||_this2$component$shad===void 0?void 0:_this2$component$shad.querySelector("#content-menu"))||_this2.component.querySelector("#content-menu");t&&_this2.component.isDropdownOpen&&(_this2.originalMenuParent=t.parentElement,_this2.clonedMenu=_this2.createPortalMenu(),_this2.portalContainer=_this2.createPortalAppendContainer(),_this2.portalContainer.appendChild(_this2.clonedMenu),document.body.appendChild(_this2.portalContainer),_this2.adoptStylesToPortalAppend(),_this2.clonedMenu.style.display="",_this2.positionPortalAppend(),_this2.setupPortalEventListeners(),_this2.setupAutoUpdatePositioning(),window.addEventListener("resize",_this2.handleWindowResize.bind(_this2)));},10);});}},{key:"createPortalMenu",value:function createPortalMenu(){return l.createPortalMenu(this.component);}},{key:"setupPortalEventListeners",value:function setupPortalEventListeners(){r.setupPortalEventListeners(this.clonedMenu,this.component);}},{key:"cleanupPortalAppend",value:function cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){var _t=this.portalContainer.t;if(_t){var _i=document.getElementById(_t);_i&&_i.remove();}this.portalContainer.parentNode.removeChild(this.portalContainer);}window.removeEventListener("resize",this.handleWindowResize.bind(this)),this.portalContainer=null,this.originalMenuParent=null,this.clonedMenu=null,this.measuredMenuHeight=null,this.currentPlacement="bottom",this.currentMiddlewareData=null;}},{key:"portalContainerElement",get:function get(){return this.portalContainer;}},{key:"resetMeasuredHeight",value:function resetMeasuredHeight(){this.measuredMenuHeight=null;}},{key:"updatePortalOptions",value:function updatePortalOptions(){this.portalContainer&&this.clonedMenu&&(l.updatePortalMenuItems(this.clonedMenu,this.component),this.forceReposition());}},{key:"forceReposition",value:function forceReposition(){this.portalContainer&&this.computeFloatingUIPosition();}},{key:"getCurrentPlacement",value:function getCurrentPlacement(){return this.currentPlacement;}},{key:"getCurrentMiddlewareData",value:function getCurrentMiddlewareData(){return this.currentMiddlewareData;}},{key:"isUsingFloatingUI",value:function isUsingFloatingUI(){return null!==this.cleanupAutoUpdate;}},{key:"isPositioningOptimal",value:function isPositioningOptimal(){if(!this.portalContainer||!this.currentMiddlewareData)return!0;var t=(this.component.inputElement||this.component).getBoundingClientRect(),i=window.innerHeight-t.bottom,s=t.top,e=this.currentPlacement.startsWith("top"),o=this.currentPlacement.startsWith("bottom");return!(e&&i>s)&&!(o&&s>i);}}]);}());}};});
|
|
2
|
+
//# sourceMappingURL=portal-manager.cjs.js.map
|