@aquera/nile-elements 0.0.1-beta.6 → 0.0.1-beta.8

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.
Files changed (41) hide show
  1. package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/src/nile-auto-complete/nile-auto-complete.d.ts +0 -1
  2. package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/src/nile-auto-complete/nile-auto-complete.js +0 -4
  3. package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
  4. package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/src/nile-chip/nile-chip.d.ts +6 -0
  5. package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/src/nile-chip/nile-chip.js +23 -1
  6. package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/src/nile-chip/nile-chip.js.map +1 -1
  7. package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/src/nile-select/nile-select.css.js +15 -9
  8. package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/src/nile-select/nile-select.css.js.map +1 -1
  9. package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/src/nile-select/nile-select.d.ts +3 -1
  10. package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/src/nile-select/nile-select.js +49 -22
  11. package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/src/nile-select/nile-select.js.map +1 -1
  12. package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
  13. package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
  14. package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
  15. package/dist/nile-auto-complete/nile-auto-complete.esm.js +2 -3
  16. package/dist/nile-chip/nile-chip.cjs.js +1 -1
  17. package/dist/nile-chip/nile-chip.cjs.js.map +1 -1
  18. package/dist/nile-chip/nile-chip.esm.js +8 -6
  19. package/dist/nile-select/nile-select.cjs.js +1 -1
  20. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  21. package/dist/nile-select/nile-select.css.cjs.js +1 -1
  22. package/dist/nile-select/nile-select.css.cjs.js.map +1 -1
  23. package/dist/nile-select/nile-select.css.esm.js +15 -9
  24. package/dist/nile-select/nile-select.esm.js +13 -8
  25. package/dist/src/nile-auto-complete/nile-auto-complete.d.ts +0 -1
  26. package/dist/src/nile-auto-complete/nile-auto-complete.js +0 -4
  27. package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
  28. package/dist/src/nile-chip/nile-chip.d.ts +6 -0
  29. package/dist/src/nile-chip/nile-chip.js +23 -1
  30. package/dist/src/nile-chip/nile-chip.js.map +1 -1
  31. package/dist/src/nile-select/nile-select.css.js +15 -9
  32. package/dist/src/nile-select/nile-select.css.js.map +1 -1
  33. package/dist/src/nile-select/nile-select.d.ts +3 -1
  34. package/dist/src/nile-select/nile-select.js +49 -22
  35. package/dist/src/nile-select/nile-select.js.map +1 -1
  36. package/dist/tsconfig.tsbuildinfo +1 -1
  37. package/package.json +1 -1
  38. package/src/nile-auto-complete/nile-auto-complete.ts +0 -5
  39. package/src/nile-chip/nile-chip.ts +18 -1
  40. package/src/nile-select/nile-select.css.ts +15 -9
  41. package/src/nile-select/nile-select.ts +48 -25
@@ -1,2 +1,2 @@
1
- System.register(["tslib","../index-adad7634.cjs.js","lit/decorators.js","../internal/nile-element.cjs.js","../watch.cjs.js","../property-ec52a751.cjs.js","lit"],function(_export,_context){"use strict";var e,t,i,s,n,l,o,h,_templateObject,_templateObject2,_templateObject3,r;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function(){return exports;};var exports={},Op=Object.prototype,hasOwn=Op.hasOwnProperty,defineProperty=Object.defineProperty||function(obj,key,desc){obj[key]=desc.value;},$Symbol="function"==typeof Symbol?Symbol:{},iteratorSymbol=$Symbol.iterator||"@@iterator",asyncIteratorSymbol=$Symbol.asyncIterator||"@@asyncIterator",toStringTagSymbol=$Symbol.toStringTag||"@@toStringTag";function define(obj,key,value){return Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}),obj[key];}try{define({},"");}catch(err){define=function(obj,key,value){return obj[key]=value;};}function wrap(innerFn,outerFn,self,tryLocsList){var protoGenerator=outerFn&&outerFn.prototype instanceof Generator?outerFn:Generator,generator=Object.create(protoGenerator.prototype),context=new Context(tryLocsList||[]);return defineProperty(generator,"_invoke",{value:makeInvokeMethod(innerFn,self,context)}),generator;}function tryCatch(fn,obj,arg){try{return{type:"normal",arg:fn.call(obj,arg)};}catch(err){return{type:"throw",arg:err};}}exports.wrap=wrap;var ContinueSentinel={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var IteratorPrototype={};define(IteratorPrototype,iteratorSymbol,function(){return this;});var getProto=Object.getPrototypeOf,NativeIteratorPrototype=getProto&&getProto(getProto(values([])));NativeIteratorPrototype&&NativeIteratorPrototype!==Op&&hasOwn.call(NativeIteratorPrototype,iteratorSymbol)&&(IteratorPrototype=NativeIteratorPrototype);var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(IteratorPrototype);function defineIteratorMethods(prototype){["next","throw","return"].forEach(function(method){define(prototype,method,function(arg){return this._invoke(method,arg);});});}function AsyncIterator(generator,PromiseImpl){function invoke(method,arg,resolve,reject){var record=tryCatch(generator[method],generator,arg);if("throw"!==record.type){var result=record.arg,value=result.value;return value&&"object"==typeof value&&hasOwn.call(value,"__await")?PromiseImpl.resolve(value.__await).then(function(value){invoke("next",value,resolve,reject);},function(err){invoke("throw",err,resolve,reject);}):PromiseImpl.resolve(value).then(function(unwrapped){result.value=unwrapped,resolve(result);},function(error){return invoke("throw",error,resolve,reject);});}reject(record.arg);}var previousPromise;defineProperty(this,"_invoke",{value:function(method,arg){function callInvokeWithMethodAndArg(){return new PromiseImpl(function(resolve,reject){invoke(method,arg,resolve,reject);});}return previousPromise=previousPromise?previousPromise.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(innerFn,self,context){var state="suspendedStart";return function(method,arg){if("executing"===state)throw new Error("Generator is already running");if("completed"===state){if("throw"===method)throw arg;return doneResult();}for(context.method=method,context.arg=arg;;){var delegate=context.delegate;if(delegate){var delegateResult=maybeInvokeDelegate(delegate,context);if(delegateResult){if(delegateResult===ContinueSentinel)continue;return delegateResult;}}if("next"===context.method)context.sent=context._sent=context.arg;else if("throw"===context.method){if("suspendedStart"===state)throw state="completed",context.arg;context.dispatchException(context.arg);}else"return"===context.method&&context.abrupt("return",context.arg);state="executing";var record=tryCatch(innerFn,self,context);if("normal"===record.type){if(state=context.done?"completed":"suspendedYield",record.arg===ContinueSentinel)continue;return{value:record.arg,done:context.done};}"throw"===record.type&&(state="completed",context.method="throw",context.arg=record.arg);}};}function maybeInvokeDelegate(delegate,context){var methodName=context.method,method=delegate.iterator[methodName];if(undefined===method)return context.delegate=null,"throw"===methodName&&delegate.iterator.return&&(context.method="return",context.arg=undefined,maybeInvokeDelegate(delegate,context),"throw"===context.method)||"return"!==methodName&&(context.method="throw",context.arg=new TypeError("The iterator does not provide a '"+methodName+"' method")),ContinueSentinel;var record=tryCatch(method,delegate.iterator,context.arg);if("throw"===record.type)return context.method="throw",context.arg=record.arg,context.delegate=null,ContinueSentinel;var info=record.arg;return info?info.done?(context[delegate.resultName]=info.value,context.next=delegate.nextLoc,"return"!==context.method&&(context.method="next",context.arg=undefined),context.delegate=null,ContinueSentinel):info:(context.method="throw",context.arg=new TypeError("iterator result is not an object"),context.delegate=null,ContinueSentinel);}function pushTryEntry(locs){var entry={tryLoc:locs[0]};1 in locs&&(entry.catchLoc=locs[1]),2 in locs&&(entry.finallyLoc=locs[2],entry.afterLoc=locs[3]),this.tryEntries.push(entry);}function resetTryEntry(entry){var record=entry.completion||{};record.type="normal",delete record.arg,entry.completion=record;}function Context(tryLocsList){this.tryEntries=[{tryLoc:"root"}],tryLocsList.forEach(pushTryEntry,this),this.reset(!0);}function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod)return iteratorMethod.call(iterable);if("function"==typeof iterable.next)return iterable;if(!isNaN(iterable.length)){var i=-1,next=function next(){for(;++i<iterable.length;)if(hasOwn.call(iterable,i))return next.value=iterable[i],next.done=!1,next;return next.value=undefined,next.done=!0,next;};return next.next=next;}}return{next:doneResult};}function doneResult(){return{value:undefined,done:!0};}return GeneratorFunction.prototype=GeneratorFunctionPrototype,defineProperty(Gp,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),defineProperty(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,toStringTagSymbol,"GeneratorFunction"),exports.isGeneratorFunction=function(genFun){var ctor="function"==typeof genFun&&genFun.constructor;return!!ctor&&(ctor===GeneratorFunction||"GeneratorFunction"===(ctor.displayName||ctor.name));},exports.mark=function(genFun){return Object.setPrototypeOf?Object.setPrototypeOf(genFun,GeneratorFunctionPrototype):(genFun.__proto__=GeneratorFunctionPrototype,define(genFun,toStringTagSymbol,"GeneratorFunction")),genFun.prototype=Object.create(Gp),genFun;},exports.awrap=function(arg){return{__await:arg};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,asyncIteratorSymbol,function(){return this;}),exports.AsyncIterator=AsyncIterator,exports.async=function(innerFn,outerFn,self,tryLocsList,PromiseImpl){void 0===PromiseImpl&&(PromiseImpl=Promise);var iter=new AsyncIterator(wrap(innerFn,outerFn,self,tryLocsList),PromiseImpl);return exports.isGeneratorFunction(outerFn)?iter:iter.next().then(function(result){return result.done?result.value:iter.next();});},defineIteratorMethods(Gp),define(Gp,toStringTagSymbol,"Generator"),define(Gp,iteratorSymbol,function(){return this;}),define(Gp,"toString",function(){return"[object Generator]";}),exports.keys=function(val){var object=Object(val),keys=[];for(var key in object)keys.push(key);return keys.reverse(),function next(){for(;keys.length;){var key=keys.pop();if(key in object)return next.value=key,next.done=!1,next;}return next.done=!0,next;};},exports.values=values,Context.prototype={constructor:Context,reset:function(skipTempReset){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(resetTryEntry),!skipTempReset)for(var name in this)"t"===name.charAt(0)&&hasOwn.call(this,name)&&!isNaN(+name.slice(1))&&(this[name]=undefined);},stop:function(){this.done=!0;var rootRecord=this.tryEntries[0].completion;if("throw"===rootRecord.type)throw rootRecord.arg;return this.rval;},dispatchException:function(exception){if(this.done)throw exception;var context=this;function handle(loc,caught){return record.type="throw",record.arg=exception,context.next=loc,caught&&(context.method="next",context.arg=undefined),!!caught;}for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i],record=entry.completion;if("root"===entry.tryLoc)return handle("end");if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc"),hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0);if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc);}else if(hasCatch){if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0);}else{if(!hasFinally)throw new Error("try statement without catch or finally");if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc);}}}},abrupt:function(type,arg){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&this.prev<entry.finallyLoc){var finallyEntry=entry;break;}}finallyEntry&&("break"===type||"continue"===type)&&finallyEntry.tryLoc<=arg&&arg<=finallyEntry.finallyLoc&&(finallyEntry=null);var record=finallyEntry?finallyEntry.completion:{};return record.type=type,record.arg=arg,finallyEntry?(this.method="next",this.next=finallyEntry.finallyLoc,ContinueSentinel):this.complete(record);},complete:function(record,afterLoc){if("throw"===record.type)throw record.arg;return"break"===record.type||"continue"===record.type?this.next=record.arg:"return"===record.type?(this.rval=this.arg=record.arg,this.method="return",this.next="end"):"normal"===record.type&&afterLoc&&(this.next=afterLoc),ContinueSentinel;},finish:function(finallyLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.finallyLoc===finallyLoc)return this.complete(entry.completion,entry.afterLoc),resetTryEntry(entry),ContinueSentinel;}},catch:function(tryLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc===tryLoc){var record=entry.completion;if("throw"===record.type){var thrown=record.arg;resetTryEntry(entry);}return thrown;}}throw new Error("illegal catch attempt");},delegateYield:function(iterable,resultName,nextLoc){return this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc},"next"===this.method&&(this.arg=undefined),ContinueSentinel;}},exports;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_index001CjsJs){t=_index001CjsJs.y;},function(_litDecoratorsJs){i=_litDecoratorsJs.state;s=_litDecoratorsJs.query;n=_litDecoratorsJs.customElement;},function(_internalNileElementCjsJs){l=_internalNileElementCjsJs.N;},function(_watchCjsJs){o=_watchCjsJs.w;},function(_property002CjsJs){h=_property002CjsJs.e;},function(_lit){}],execute:function(){r=/*#__PURE__*/function(_l){_inherits(r,_l);var _super=_createSuper(r);function r(){var _this;_classCallCheck(this,r);_this=_super.apply(this,arguments),_this.isDropdownOpen=!1,_this.openOnFocus=!1,_this.value="",_this.placeholder="Type here ..",_this.noBorder=!1,_this.menuItems=[],_this.allMenuItems=[];return _this;}_createClass(r,[{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf(r.prototype),"connectedCallback",this).call(this),this.menuItems=_toConsumableArray(this.allMenuItems);}},{key:"handleAllMenuItemsChange",value:function handleAllMenuItemsChange(){this.menuItems=_toConsumableArray(this.allMenuItems);}},{key:"handleValueChange",value:function(){var _handleValueChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _this2=this;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return this.updateComplete;case 2:this.menuItems=this.allMenuItems.filter(function(e){var _this2$value;return e.toLowerCase().includes((_this2$value=_this2.value)===null||_this2$value===void 0?void 0:_this2$value.toLowerCase());});case 3:case"end":return _context2.stop();}},_callee,this);}));function handleValueChange(){return _handleValueChange.apply(this,arguments);}return handleValueChange;}()},{key:"handleSelect",value:function handleSelect(e){var _this$dropdownElement;this.value=e.detail.value,this.emit("nile-complete",{value:e.detail.value}),this.isDropdownOpen=!1,(_this$dropdownElement=this.dropdownElement)===null||_this$dropdownElement===void 0?void 0:_this$dropdownElement.hide();}},{key:"handleSearch",value:function handleSearch(e){var _this$dropdownElement2;var t=e.detail.value.toLowerCase();this.value=t,this.menuItems=this.allMenuItems.filter(function(e){return e===null||e===void 0?void 0:e.toLowerCase().includes(t);}),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 _this3=this;this.openOnFocus&&setTimeout(function(){var _this3$dropdownElemen;_this3.isDropdownOpen=!0,(_this3$dropdownElemen=_this3.dropdownElement)===null||_this3$dropdownElemen===void 0?void 0:_this3$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:"handleBlur",value:function handleBlur(){this.menuItems=this.allMenuItems;}},{key:"render",value:function render(){return t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-dropdown class=\"nile-dropdown--input\" ?open="," noOpenOnCLick>\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=","\n .value=","\n @nile-input=","\n @focus=","\n @blur=","\n @click=","\n slot=\"trigger\"\n placeholder=","\n ></nile-input>\n ","\n </nile-dropdown>\n "])),this.isDropdownOpen,this.noBorder,this.value,this.handleSearch,this.handleFocus,this.handleBlur,this.handleClick,this.placeholder,this.menuItems.length>0?t(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-menu @nile-select=",">\n ","\n </nile-menu>\n "])),this.handleSelect,this.menuItems.map(function(e){return t(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-menu-item value=",">","</nile-menu-item>\n "])),e,e);})):"");}}]);return r;}(l);e([h({type:Boolean})],r.prototype,"isDropdownOpen",void 0),e([h({type:Boolean})],r.prototype,"openOnFocus",void 0),e([h({type:String})],r.prototype,"value",void 0),e([h({type:String})],r.prototype,"placeholder",void 0),e([h({type:Boolean})],r.prototype,"noBorder",void 0),e([i()],r.prototype,"menuItems",void 0),e([h({type:Array})],r.prototype,"allMenuItems",void 0),e([s("nile-dropdown")],r.prototype,"dropdownElement",void 0),e([o("allMenuItems")],r.prototype,"handleAllMenuItemsChange",null),e([o("value",{waitUntilFirstUpdate:!0}),o("isDropdownOpen",{waitUntilFirstUpdate:!0})],r.prototype,"handleValueChange",null),r=e([n("nile-auto-complete")],r);}};});
1
+ System.register(["tslib","../index-adad7634.cjs.js","lit/decorators.js","../internal/nile-element.cjs.js","../watch.cjs.js","../property-ec52a751.cjs.js","lit"],function(_export,_context){"use strict";var e,t,i,n,s,l,o,h,_templateObject,_templateObject2,_templateObject3,r;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function(){return exports;};var exports={},Op=Object.prototype,hasOwn=Op.hasOwnProperty,defineProperty=Object.defineProperty||function(obj,key,desc){obj[key]=desc.value;},$Symbol="function"==typeof Symbol?Symbol:{},iteratorSymbol=$Symbol.iterator||"@@iterator",asyncIteratorSymbol=$Symbol.asyncIterator||"@@asyncIterator",toStringTagSymbol=$Symbol.toStringTag||"@@toStringTag";function define(obj,key,value){return Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}),obj[key];}try{define({},"");}catch(err){define=function(obj,key,value){return obj[key]=value;};}function wrap(innerFn,outerFn,self,tryLocsList){var protoGenerator=outerFn&&outerFn.prototype instanceof Generator?outerFn:Generator,generator=Object.create(protoGenerator.prototype),context=new Context(tryLocsList||[]);return defineProperty(generator,"_invoke",{value:makeInvokeMethod(innerFn,self,context)}),generator;}function tryCatch(fn,obj,arg){try{return{type:"normal",arg:fn.call(obj,arg)};}catch(err){return{type:"throw",arg:err};}}exports.wrap=wrap;var ContinueSentinel={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var IteratorPrototype={};define(IteratorPrototype,iteratorSymbol,function(){return this;});var getProto=Object.getPrototypeOf,NativeIteratorPrototype=getProto&&getProto(getProto(values([])));NativeIteratorPrototype&&NativeIteratorPrototype!==Op&&hasOwn.call(NativeIteratorPrototype,iteratorSymbol)&&(IteratorPrototype=NativeIteratorPrototype);var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(IteratorPrototype);function defineIteratorMethods(prototype){["next","throw","return"].forEach(function(method){define(prototype,method,function(arg){return this._invoke(method,arg);});});}function AsyncIterator(generator,PromiseImpl){function invoke(method,arg,resolve,reject){var record=tryCatch(generator[method],generator,arg);if("throw"!==record.type){var result=record.arg,value=result.value;return value&&"object"==typeof value&&hasOwn.call(value,"__await")?PromiseImpl.resolve(value.__await).then(function(value){invoke("next",value,resolve,reject);},function(err){invoke("throw",err,resolve,reject);}):PromiseImpl.resolve(value).then(function(unwrapped){result.value=unwrapped,resolve(result);},function(error){return invoke("throw",error,resolve,reject);});}reject(record.arg);}var previousPromise;defineProperty(this,"_invoke",{value:function(method,arg){function callInvokeWithMethodAndArg(){return new PromiseImpl(function(resolve,reject){invoke(method,arg,resolve,reject);});}return previousPromise=previousPromise?previousPromise.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(innerFn,self,context){var state="suspendedStart";return function(method,arg){if("executing"===state)throw new Error("Generator is already running");if("completed"===state){if("throw"===method)throw arg;return doneResult();}for(context.method=method,context.arg=arg;;){var delegate=context.delegate;if(delegate){var delegateResult=maybeInvokeDelegate(delegate,context);if(delegateResult){if(delegateResult===ContinueSentinel)continue;return delegateResult;}}if("next"===context.method)context.sent=context._sent=context.arg;else if("throw"===context.method){if("suspendedStart"===state)throw state="completed",context.arg;context.dispatchException(context.arg);}else"return"===context.method&&context.abrupt("return",context.arg);state="executing";var record=tryCatch(innerFn,self,context);if("normal"===record.type){if(state=context.done?"completed":"suspendedYield",record.arg===ContinueSentinel)continue;return{value:record.arg,done:context.done};}"throw"===record.type&&(state="completed",context.method="throw",context.arg=record.arg);}};}function maybeInvokeDelegate(delegate,context){var methodName=context.method,method=delegate.iterator[methodName];if(undefined===method)return context.delegate=null,"throw"===methodName&&delegate.iterator.return&&(context.method="return",context.arg=undefined,maybeInvokeDelegate(delegate,context),"throw"===context.method)||"return"!==methodName&&(context.method="throw",context.arg=new TypeError("The iterator does not provide a '"+methodName+"' method")),ContinueSentinel;var record=tryCatch(method,delegate.iterator,context.arg);if("throw"===record.type)return context.method="throw",context.arg=record.arg,context.delegate=null,ContinueSentinel;var info=record.arg;return info?info.done?(context[delegate.resultName]=info.value,context.next=delegate.nextLoc,"return"!==context.method&&(context.method="next",context.arg=undefined),context.delegate=null,ContinueSentinel):info:(context.method="throw",context.arg=new TypeError("iterator result is not an object"),context.delegate=null,ContinueSentinel);}function pushTryEntry(locs){var entry={tryLoc:locs[0]};1 in locs&&(entry.catchLoc=locs[1]),2 in locs&&(entry.finallyLoc=locs[2],entry.afterLoc=locs[3]),this.tryEntries.push(entry);}function resetTryEntry(entry){var record=entry.completion||{};record.type="normal",delete record.arg,entry.completion=record;}function Context(tryLocsList){this.tryEntries=[{tryLoc:"root"}],tryLocsList.forEach(pushTryEntry,this),this.reset(!0);}function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod)return iteratorMethod.call(iterable);if("function"==typeof iterable.next)return iterable;if(!isNaN(iterable.length)){var i=-1,next=function next(){for(;++i<iterable.length;)if(hasOwn.call(iterable,i))return next.value=iterable[i],next.done=!1,next;return next.value=undefined,next.done=!0,next;};return next.next=next;}}return{next:doneResult};}function doneResult(){return{value:undefined,done:!0};}return GeneratorFunction.prototype=GeneratorFunctionPrototype,defineProperty(Gp,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),defineProperty(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,toStringTagSymbol,"GeneratorFunction"),exports.isGeneratorFunction=function(genFun){var ctor="function"==typeof genFun&&genFun.constructor;return!!ctor&&(ctor===GeneratorFunction||"GeneratorFunction"===(ctor.displayName||ctor.name));},exports.mark=function(genFun){return Object.setPrototypeOf?Object.setPrototypeOf(genFun,GeneratorFunctionPrototype):(genFun.__proto__=GeneratorFunctionPrototype,define(genFun,toStringTagSymbol,"GeneratorFunction")),genFun.prototype=Object.create(Gp),genFun;},exports.awrap=function(arg){return{__await:arg};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,asyncIteratorSymbol,function(){return this;}),exports.AsyncIterator=AsyncIterator,exports.async=function(innerFn,outerFn,self,tryLocsList,PromiseImpl){void 0===PromiseImpl&&(PromiseImpl=Promise);var iter=new AsyncIterator(wrap(innerFn,outerFn,self,tryLocsList),PromiseImpl);return exports.isGeneratorFunction(outerFn)?iter:iter.next().then(function(result){return result.done?result.value:iter.next();});},defineIteratorMethods(Gp),define(Gp,toStringTagSymbol,"Generator"),define(Gp,iteratorSymbol,function(){return this;}),define(Gp,"toString",function(){return"[object Generator]";}),exports.keys=function(val){var object=Object(val),keys=[];for(var key in object)keys.push(key);return keys.reverse(),function next(){for(;keys.length;){var key=keys.pop();if(key in object)return next.value=key,next.done=!1,next;}return next.done=!0,next;};},exports.values=values,Context.prototype={constructor:Context,reset:function(skipTempReset){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(resetTryEntry),!skipTempReset)for(var name in this)"t"===name.charAt(0)&&hasOwn.call(this,name)&&!isNaN(+name.slice(1))&&(this[name]=undefined);},stop:function(){this.done=!0;var rootRecord=this.tryEntries[0].completion;if("throw"===rootRecord.type)throw rootRecord.arg;return this.rval;},dispatchException:function(exception){if(this.done)throw exception;var context=this;function handle(loc,caught){return record.type="throw",record.arg=exception,context.next=loc,caught&&(context.method="next",context.arg=undefined),!!caught;}for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i],record=entry.completion;if("root"===entry.tryLoc)return handle("end");if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc"),hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0);if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc);}else if(hasCatch){if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0);}else{if(!hasFinally)throw new Error("try statement without catch or finally");if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc);}}}},abrupt:function(type,arg){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&this.prev<entry.finallyLoc){var finallyEntry=entry;break;}}finallyEntry&&("break"===type||"continue"===type)&&finallyEntry.tryLoc<=arg&&arg<=finallyEntry.finallyLoc&&(finallyEntry=null);var record=finallyEntry?finallyEntry.completion:{};return record.type=type,record.arg=arg,finallyEntry?(this.method="next",this.next=finallyEntry.finallyLoc,ContinueSentinel):this.complete(record);},complete:function(record,afterLoc){if("throw"===record.type)throw record.arg;return"break"===record.type||"continue"===record.type?this.next=record.arg:"return"===record.type?(this.rval=this.arg=record.arg,this.method="return",this.next="end"):"normal"===record.type&&afterLoc&&(this.next=afterLoc),ContinueSentinel;},finish:function(finallyLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.finallyLoc===finallyLoc)return this.complete(entry.completion,entry.afterLoc),resetTryEntry(entry),ContinueSentinel;}},catch:function(tryLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc===tryLoc){var record=entry.completion;if("throw"===record.type){var thrown=record.arg;resetTryEntry(entry);}return thrown;}}throw new Error("illegal catch attempt");},delegateYield:function(iterable,resultName,nextLoc){return this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc},"next"===this.method&&(this.arg=undefined),ContinueSentinel;}},exports;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_index001CjsJs){t=_index001CjsJs.y;},function(_litDecoratorsJs){i=_litDecoratorsJs.state;n=_litDecoratorsJs.query;s=_litDecoratorsJs.customElement;},function(_internalNileElementCjsJs){l=_internalNileElementCjsJs.N;},function(_watchCjsJs){o=_watchCjsJs.w;},function(_property002CjsJs){h=_property002CjsJs.e;},function(_lit){}],execute:function(){r=/*#__PURE__*/function(_l){_inherits(r,_l);var _super=_createSuper(r);function r(){var _this;_classCallCheck(this,r);_this=_super.apply(this,arguments),_this.isDropdownOpen=!1,_this.openOnFocus=!1,_this.value="",_this.placeholder="Type here ..",_this.noBorder=!1,_this.menuItems=[],_this.allMenuItems=[];return _this;}_createClass(r,[{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf(r.prototype),"connectedCallback",this).call(this),this.menuItems=_toConsumableArray(this.allMenuItems);}},{key:"handleAllMenuItemsChange",value:function handleAllMenuItemsChange(){this.menuItems=_toConsumableArray(this.allMenuItems);}},{key:"handleValueChange",value:function(){var _handleValueChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _this2=this;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return this.updateComplete;case 2:this.menuItems=this.allMenuItems.filter(function(e){var _this2$value;return e.toLowerCase().includes((_this2$value=_this2.value)===null||_this2$value===void 0?void 0:_this2$value.toLowerCase());});case 3:case"end":return _context2.stop();}},_callee,this);}));function handleValueChange(){return _handleValueChange.apply(this,arguments);}return handleValueChange;}()},{key:"handleSelect",value:function handleSelect(e){var _this$dropdownElement;this.value=e.detail.value,this.emit("nile-complete",{value:e.detail.value}),this.isDropdownOpen=!1,(_this$dropdownElement=this.dropdownElement)===null||_this$dropdownElement===void 0?void 0:_this$dropdownElement.hide();}},{key:"handleSearch",value:function handleSearch(e){var _this$dropdownElement2;var t=e.detail.value.toLowerCase();this.value=t,this.menuItems=this.allMenuItems.filter(function(e){return e===null||e===void 0?void 0:e.toLowerCase().includes(t);}),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 _this3=this;this.openOnFocus&&setTimeout(function(){var _this3$dropdownElemen;_this3.isDropdownOpen=!0,(_this3$dropdownElemen=_this3.dropdownElement)===null||_this3$dropdownElemen===void 0?void 0:_this3$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:"render",value:function render(){return t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-dropdown class=\"nile-dropdown--input\" ?open="," noOpenOnCLick>\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=","\n .value=","\n @nile-input=","\n @focus=","\n @click=","\n slot=\"trigger\"\n placeholder=","\n ></nile-input>\n ","\n </nile-dropdown>\n "])),this.isDropdownOpen,this.noBorder,this.value,this.handleSearch,this.handleFocus,this.handleClick,this.placeholder,this.menuItems.length>0?t(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-menu @nile-select=",">\n ","\n </nile-menu>\n "])),this.handleSelect,this.menuItems.map(function(e){return t(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-menu-item value=",">","</nile-menu-item>\n "])),e,e);})):"");}}]);return r;}(l);e([h({type:Boolean})],r.prototype,"isDropdownOpen",void 0),e([h({type:Boolean})],r.prototype,"openOnFocus",void 0),e([h({type:String})],r.prototype,"value",void 0),e([h({type:String})],r.prototype,"placeholder",void 0),e([h({type:Boolean})],r.prototype,"noBorder",void 0),e([i()],r.prototype,"menuItems",void 0),e([h({type:Array})],r.prototype,"allMenuItems",void 0),e([n("nile-dropdown")],r.prototype,"dropdownElement",void 0),e([o("allMenuItems")],r.prototype,"handleAllMenuItemsChange",null),e([o("value",{waitUntilFirstUpdate:!0}),o("isDropdownOpen",{waitUntilFirstUpdate:!0})],r.prototype,"handleValueChange",null),r=e([s("nile-auto-complete")],r);}};});
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 property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement, query, state } from 'lit/decorators.js';\nimport { styles } from './nile-auto-complete.css';\nimport NileElement from '../internal/nile-element';\nimport { watch } from '../watch';\n\n// Define the custom element 'nile-auto-complete'\n@customElement('nile-auto-complete')\nexport class NileAutoComplete extends NileElement {\n // Define component properties\n @property({ type: Boolean }) isDropdownOpen: 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 @state() menuItems: any = [];\n\n @property({ type: Array }) allMenuItems: any = [];\n\n @query('nile-dropdown') dropdownElement: any;\n\n connectedCallback() {\n super.connectedCallback();\n this.menuItems = [...this.allMenuItems];\n }\n\n // Watch for changes in 'allMenuItems' property\n @watch('allMenuItems')\n handleAllMenuItemsChange() {\n this.menuItems = [...this.allMenuItems];\n }\n\n // Watch for changes in 'value' and 'isDropdownOpen' properties\n @watch('value', { waitUntilFirstUpdate: true })\n\n @watch('isDropdownOpen', { waitUntilFirstUpdate: true })\n async handleValueChange() {\n await this.updateComplete;\n // Filter menu items based on the search value\n this.menuItems = this.allMenuItems.filter((item: string) =>\n item.toLowerCase().includes(this.value?.toLowerCase())\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 handleSearch(event: CustomEvent) {\n const searchValue = event.detail.value.toLowerCase();\n this.value = searchValue;\n\n // Filter menu items based on the search value\n this.menuItems = this.allMenuItems.filter((item: string) =>\n item?.toLowerCase().includes(searchValue)\n );\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 private handleBlur() {\n this.menuItems = this.allMenuItems;\n }\n\n public render(): TemplateResult {\n return html`\n <nile-dropdown class=\"nile-dropdown--input\" ?open=${this.isDropdownOpen} noOpenOnCLick>\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=${this.noBorder}\n .value=${this.value}\n @nile-input=${this.handleSearch}\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n @click=${this.handleClick}\n slot=\"trigger\"\n placeholder=${this.placeholder}\n ></nile-input>\n ${this.menuItems.length > 0\n ? html`\n <nile-menu @nile-select=${this.handleSelect}>\n ${this.menuItems.map(\n (item: unknown) => html`\n <nile-menu-item value=${item}>${item}</nile-menu-item>\n `\n )}\n </nile-menu>\n `\n : ''}\n </nile-dropdown>\n `;\n }\n}\n\nexport default NileAutoComplete;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-auto-complete': NileAutoComplete;\n }\n}\n"],"names":["NileAutoComplete","constructor","this","isDropdownOpen","openOnFocus","value","placeholder","noBorder","menuItems","allMenuItems","connectedCallback","super","handleAllMenuItemsChange","async","updateComplete","filter","item","toLowerCase","includes","handleSelect","event","detail","emit","dropdownElement","hide","handleSearch","searchValue","length","show","handleFocus","setTimeout","handleClick","handleBlur","render","html","map","__decorate","NileElement","property","type","Boolean","prototype","String","state","Array","query","watch","wait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CAAEC,oBAAAA,CAAAA,CAAsB,CAEvCD,CAAAA,CAAAA,CAAAA,CAAAA,CAAM,iBAAkB,CAAEC,oBAAAA,CAAAA,CAAsB,CAOhD/C,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAyC,SAAA,CAAA,mBAAA,CAAA,MAvCUzC,CAAgBoC,CAAAA,CAAAA,CAAA,CAD5BY,CAAAA,CAAc,oBACFhD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
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 property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement, query, state } from 'lit/decorators.js';\nimport { styles } from './nile-auto-complete.css';\nimport NileElement from '../internal/nile-element';\nimport { watch } from '../watch';\n\n// Define the custom element 'nile-auto-complete'\n@customElement('nile-auto-complete')\nexport class NileAutoComplete extends NileElement {\n // Define component properties\n @property({ type: Boolean }) isDropdownOpen: 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 @state() menuItems: any = [];\n\n @property({ type: Array }) allMenuItems: any = [];\n\n @query('nile-dropdown') dropdownElement: any;\n\n connectedCallback() {\n super.connectedCallback();\n this.menuItems = [...this.allMenuItems];\n }\n\n // Watch for changes in 'allMenuItems' property\n @watch('allMenuItems')\n handleAllMenuItemsChange() {\n this.menuItems = [...this.allMenuItems];\n }\n\n // Watch for changes in 'value' and 'isDropdownOpen' properties\n @watch('value', { waitUntilFirstUpdate: true })\n\n @watch('isDropdownOpen', { waitUntilFirstUpdate: true })\n async handleValueChange() {\n await this.updateComplete;\n // Filter menu items based on the search value\n this.menuItems = this.allMenuItems.filter((item: string) =>\n item.toLowerCase().includes(this.value?.toLowerCase())\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 handleSearch(event: CustomEvent) {\n const searchValue = event.detail.value.toLowerCase();\n this.value = searchValue;\n\n // Filter menu items based on the search value\n this.menuItems = this.allMenuItems.filter((item: string) =>\n item?.toLowerCase().includes(searchValue)\n );\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 public render(): TemplateResult {\n return html`\n <nile-dropdown class=\"nile-dropdown--input\" ?open=${this.isDropdownOpen} noOpenOnCLick>\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=${this.noBorder}\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 ></nile-input>\n ${this.menuItems.length > 0\n ? html`\n <nile-menu @nile-select=${this.handleSelect}>\n ${this.menuItems.map(\n (item: unknown) => html`\n <nile-menu-item value=${item}>${item}</nile-menu-item>\n `\n )}\n </nile-menu>\n `\n : ''}\n </nile-dropdown>\n `;\n }\n}\n\nexport default NileAutoComplete;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-auto-complete': NileAutoComplete;\n }\n}\n"],"names":["NileAutoComplete","constructor","this","isDropdownOpen","openOnFocus","value","placeholder","noBorder","menuItems","allMenuItems","connectedCallback","super","handleAllMenuItemsChange","async","updateComplete","filter","item","toLowerCase","includes","handleSelect","event","detail","emit","dropdownElement","hide","handleSearch","searchValue","length","show","handleFocus","setTimeout","handleClick","render","html","map","__decorate","NileElement","property","type","Boolean","prototype","String","state","Array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CAAAA,CAAM,iBAAkB,CAAEC,oBAAAA,CAAAA,CAAsB,CAOhD9C,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAwC,SAAA,CAAA,mBAAA,CAAA,MAvCUxC,CAAgBmC,CAAAA,CAAAA,CAAA,CAD5BY,CAAAA,CAAc,oBACF/C,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
@@ -1,11 +1,10 @@
1
- import{__decorate as e}from"tslib";import{y as t}from"../index-f1b94546.esm.js";import{state as i,query as s,customElement as n}from"lit/decorators.js";import{N as l}from"../internal/nile-element.esm.js";import{w as o}from"../watch.esm.js";import{e as h}from"../property-bf6307e2.esm.js";import"lit";let r=class extends l{constructor(){super(...arguments),this.isDropdownOpen=!1,this.openOnFocus=!1,this.value="",this.placeholder="Type here ..",this.noBorder=!1,this.menuItems=[],this.allMenuItems=[]}connectedCallback(){super.connectedCallback(),this.menuItems=[...this.allMenuItems]}handleAllMenuItemsChange(){this.menuItems=[...this.allMenuItems]}async handleValueChange(){await this.updateComplete,this.menuItems=this.allMenuItems.filter((e=>e.toLowerCase().includes(this.value?.toLowerCase())))}handleSelect(e){this.value=e.detail.value,this.emit("nile-complete",{value:e.detail.value}),this.isDropdownOpen=!1,this.dropdownElement?.hide()}handleSearch(e){const t=e.detail.value.toLowerCase();this.value=t,this.menuItems=this.allMenuItems.filter((e=>e?.toLowerCase().includes(t))),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&this.dropdownElement?.show()}handleFocus(){this.openOnFocus&&setTimeout((()=>{this.isDropdownOpen=!0,this.dropdownElement?.show()}),300)}handleClick(){this.isDropdownOpen=!0,this.dropdownElement?.show()}handleBlur(){this.menuItems=this.allMenuItems}render(){return t`
1
+ import{__decorate as e}from"tslib";import{y as t}from"../index-f1b94546.esm.js";import{state as i,query as n,customElement as s}from"lit/decorators.js";import{N as l}from"../internal/nile-element.esm.js";import{w as o}from"../watch.esm.js";import{e as h}from"../property-bf6307e2.esm.js";import"lit";let r=class extends l{constructor(){super(...arguments),this.isDropdownOpen=!1,this.openOnFocus=!1,this.value="",this.placeholder="Type here ..",this.noBorder=!1,this.menuItems=[],this.allMenuItems=[]}connectedCallback(){super.connectedCallback(),this.menuItems=[...this.allMenuItems]}handleAllMenuItemsChange(){this.menuItems=[...this.allMenuItems]}async handleValueChange(){await this.updateComplete,this.menuItems=this.allMenuItems.filter((e=>e.toLowerCase().includes(this.value?.toLowerCase())))}handleSelect(e){this.value=e.detail.value,this.emit("nile-complete",{value:e.detail.value}),this.isDropdownOpen=!1,this.dropdownElement?.hide()}handleSearch(e){const t=e.detail.value.toLowerCase();this.value=t,this.menuItems=this.allMenuItems.filter((e=>e?.toLowerCase().includes(t))),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&this.dropdownElement?.show()}handleFocus(){this.openOnFocus&&setTimeout((()=>{this.isDropdownOpen=!0,this.dropdownElement?.show()}),300)}handleClick(){this.isDropdownOpen=!0,this.dropdownElement?.show()}render(){return t`
2
2
  <nile-dropdown class="nile-dropdown--input" ?open=${this.isDropdownOpen} noOpenOnCLick>
3
3
  <nile-input class="nile-auto-complete--input"
4
4
  ?no-border=${this.noBorder}
5
5
  .value=${this.value}
6
6
  @nile-input=${this.handleSearch}
7
7
  @focus=${this.handleFocus}
8
- @blur=${this.handleBlur}
9
8
  @click=${this.handleClick}
10
9
  slot="trigger"
11
10
  placeholder=${this.placeholder}
@@ -18,4 +17,4 @@ import{__decorate as e}from"tslib";import{y as t}from"../index-f1b94546.esm.js";
18
17
  </nile-menu>
19
18
  `:""}
20
19
  </nile-dropdown>
21
- `}};e([h({type:Boolean})],r.prototype,"isDropdownOpen",void 0),e([h({type:Boolean})],r.prototype,"openOnFocus",void 0),e([h({type:String})],r.prototype,"value",void 0),e([h({type:String})],r.prototype,"placeholder",void 0),e([h({type:Boolean})],r.prototype,"noBorder",void 0),e([i()],r.prototype,"menuItems",void 0),e([h({type:Array})],r.prototype,"allMenuItems",void 0),e([s("nile-dropdown")],r.prototype,"dropdownElement",void 0),e([o("allMenuItems")],r.prototype,"handleAllMenuItemsChange",null),e([o("value",{waitUntilFirstUpdate:!0}),o("isDropdownOpen",{waitUntilFirstUpdate:!0})],r.prototype,"handleValueChange",null),r=e([n("nile-auto-complete")],r);
20
+ `}};e([h({type:Boolean})],r.prototype,"isDropdownOpen",void 0),e([h({type:Boolean})],r.prototype,"openOnFocus",void 0),e([h({type:String})],r.prototype,"value",void 0),e([h({type:String})],r.prototype,"placeholder",void 0),e([h({type:Boolean})],r.prototype,"noBorder",void 0),e([i()],r.prototype,"menuItems",void 0),e([h({type:Array})],r.prototype,"allMenuItems",void 0),e([n("nile-dropdown")],r.prototype,"dropdownElement",void 0),e([o("allMenuItems")],r.prototype,"handleAllMenuItemsChange",null),e([o("value",{waitUntilFirstUpdate:!0}),o("isDropdownOpen",{waitUntilFirstUpdate:!0})],r.prototype,"handleValueChange",null),r=e([s("nile-auto-complete")],r);
@@ -1,2 +1,2 @@
1
- System.register(["tslib","../index-adad7634.cjs.js","lit/decorators.js","./nile-chip.css.cjs.js","lit/directives/class-map.js","../internal/slot.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../property-ec52a751.cjs.js","lit"],function(_export,_context){"use strict";var t,e,i,s,l,o,h,a,n,r,p,_templateObject,_templateObject2,c;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_index001CjsJs){e=_index001CjsJs.y;},function(_litDecoratorsJs){i=_litDecoratorsJs.state;s=_litDecoratorsJs.query;l=_litDecoratorsJs.customElement;},function(_nileChipCssCjsJs){o=_nileChipCssCjsJs.s;},function(_litDirectivesClassMapJs){h=_litDirectivesClassMapJs.classMap;},function(_internalSlotCjsJs){a=_internalSlotCjsJs.H;},function(_internalWatchCjsJs){n=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_property002CjsJs){p=_property002CjsJs.e;},function(_lit){}],execute:function(){c=/*#__PURE__*/function(_r){_inherits(c,_r);var _super=_createSuper(c);function c(){var _this;_classCallCheck(this,c);_this=_super.apply(this,arguments),_this.hasSlotController=new a(_assertThisInitialized(_this),"help-text","label"),_this.tags=[],_this.inputValue="",_this.isDropdownOpen=!1,_this.label="",_this.acceptUserInput=!1,_this.clearable=!1,_this.placeholder="",_this.readonly=!1,_this.disabled=!1,_this.helpText="",_this.autoCompleteOptions=[],_this.value=[];return _this;}_createClass(c,[{key:"onValueChanged",value:function onValueChanged(){this.tags=_toConsumableArray(this.value);}},{key:"handleSelect",value:function handleSelect(t){this.tags=[].concat(_toConsumableArray(this.tags),[t.detail.value]),this.emit("nile-chip-change",{value:this.tags}),this.resetInput();}},{key:"handleRemove",value:function handleRemove(t){this.tags=this.tags.filter(function(e){return e!==t;}),this.emit("nile-chip-change",{value:this.tags});}},{key:"handleInputChange",value:function handleInputChange(t){this.inputValue=t.detail.value;}},{key:"handleInputKeydown",value:function handleInputKeydown(t){this.acceptUserInput&&"Enter"===t.key&&this.inputValue&&(this.tags=[].concat(_toConsumableArray(this.tags),[this.inputValue]),this.resetInput(),this.emit("nile-chip-change",{value:this.tags}));}},{key:"handleFocus",value:function handleFocus(){this.isDropdownOpen=!0;}},{key:"resetInput",value:function resetInput(){this.inputValue="",this.isDropdownOpen=!1,this.autoComplete.value="",this.autoComplete.handleFocus();}},{key:"render",value:function render(){var _this2=this;var t=this.hasSlotController.test("label"),i=this.hasSlotController.test("help-text"),s=!!this.label||!!t,l=!!this.helpText||!!i;return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"form-control\"\n class=","\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=","\n >\n <slot name=\"label\">","</slot>\n </label>\n\n <div class=\"nile-chip\">\n ","\n <div class=\"nile-chip__auto-complete\">\n <nile-auto-complete\n .allMenuItems=","\n .value=","\n ?isDropdownOpen=","\n .noBorder=","\n openOnFocus\n .placeholder=","\n @nile-input=","\n @keydown=","\n @nile-focus=","\n @nile-complete=","\n ></nile-auto-complete>\n </div>\n <slot\n name=\"help-text\"\n part=\"form-control-help-text\"\n id=\"help-text\"\n class=\"form-control__help-text\"\n aria-hidden=","\n >\n ","\n </slot>\n </div>\n </div>\n "])),h({"form-control":!0,"form-control--medium":!0,"form-control--has-label":s,"form-control--has-help-text":l,"nile-chip--disabled":this.disabled}),s?"false":"true",this.label,this.tags.map(function(t){return e(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-tag class=\"nile-chip__tags\" @nile-remove="," removable pill>\n ","\n </nile-tag>\n "])),function(){return _this2.handleRemove(t);},t);}),this.autoCompleteOptions,this.inputValue,this.isDropdownOpen,!0,this.placeholder,this.handleInputChange,this.handleInputKeydown,this.handleFocus,this.handleSelect,l?"false":"true",this.helpText);}}],[{key:"styles",get:function get(){return[o];}}]);return c;}(r);t([i()],c.prototype,"tags",void 0),t([i()],c.prototype,"inputValue",void 0),t([i()],c.prototype,"isDropdownOpen",void 0),t([s("nile-auto-complete")],c.prototype,"autoComplete",void 0),t([p()],c.prototype,"label",void 0),t([p({type:Boolean})],c.prototype,"acceptUserInput",void 0),t([p({type:Boolean})],c.prototype,"clearable",void 0),t([p()],c.prototype,"placeholder",void 0),t([p({type:Boolean,reflect:!0})],c.prototype,"readonly",void 0),t([p({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),t([p({attribute:"help-text"})],c.prototype,"helpText",void 0),t([p({type:Array})],c.prototype,"autoCompleteOptions",void 0),t([p({type:Array})],c.prototype,"value",void 0),t([n("value")],c.prototype,"onValueChanged",null),c=t([l("nile-chip")],c);}};});
1
+ System.register(["tslib","../index-adad7634.cjs.js","lit/decorators.js","./nile-chip.css.cjs.js","lit/directives/class-map.js","../internal/slot.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../property-ec52a751.cjs.js","lit"],function(_export,_context){"use strict";var t,e,i,s,l,o,h,n,a,r,p,_templateObject,_templateObject2,c;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_index001CjsJs){e=_index001CjsJs.y;},function(_litDecoratorsJs){i=_litDecoratorsJs.state;s=_litDecoratorsJs.query;l=_litDecoratorsJs.customElement;},function(_nileChipCssCjsJs){o=_nileChipCssCjsJs.s;},function(_litDirectivesClassMapJs){h=_litDirectivesClassMapJs.classMap;},function(_internalSlotCjsJs){n=_internalSlotCjsJs.H;},function(_internalWatchCjsJs){a=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_property002CjsJs){p=_property002CjsJs.e;},function(_lit){}],execute:function(){c=/*#__PURE__*/function(_r){_inherits(c,_r);var _super=_createSuper(c);function c(){var _this;_classCallCheck(this,c);_this=_super.apply(this,arguments),_this.hasSlotController=new n(_assertThisInitialized(_this),"help-text","label"),_this.tags=[],_this.inputValue="",_this.isDropdownOpen=!1,_this.warning=!1,_this.error=!1,_this.success=!1,_this.label="",_this.acceptUserInput=!1,_this.clearable=!1,_this.placeholder="",_this.readonly=!1,_this.disabled=!1,_this.helpText="",_this.autoCompleteOptions=[],_this.value=[];return _this;}_createClass(c,[{key:"onValueChanged",value:function onValueChanged(){this.tags=_toConsumableArray(this.value);}},{key:"handleSelect",value:function handleSelect(t){this.tags=[].concat(_toConsumableArray(this.tags),[t.detail.value]),this.emit("nile-chip-change",{value:this.tags}),this.resetInput();}},{key:"handleRemove",value:function handleRemove(t){this.tags=this.tags.filter(function(e){return e!==t;}),this.emit("nile-chip-change",{value:this.tags});}},{key:"handleInputChange",value:function handleInputChange(t){this.inputValue=t.detail.value;}},{key:"handleInputKeydown",value:function handleInputKeydown(t){this.acceptUserInput&&"Enter"===t.key&&this.inputValue&&(this.tags=[].concat(_toConsumableArray(this.tags),[this.inputValue]),this.resetInput(),this.emit("nile-chip-change",{value:this.tags}));}},{key:"handleFocus",value:function handleFocus(){this.isDropdownOpen=!0;}},{key:"resetInput",value:function resetInput(){this.inputValue="",this.isDropdownOpen=!1,this.autoComplete.value="",this.autoComplete.handleFocus();}},{key:"render",value:function render(){var _this2=this;var t=this.hasSlotController.test("label"),i=this.hasSlotController.test("help-text"),s=!!this.label||!!t,l=!!this.helpText||!!i;return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"form-control\"\n class=","\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=","\n >\n <slot name=\"label\">","</slot>\n </label>\n\n <div\n class=","\n >\n ","\n <div class=\"nile-chip__auto-complete\">\n <nile-auto-complete\n .allMenuItems=","\n .value=","\n ?isDropdownOpen=","\n .noBorder=","\n openOnFocus\n .placeholder=","\n @nile-input=","\n @keydown=","\n @nile-focus=","\n @nile-complete=","\n ></nile-auto-complete>\n </div>\n <slot\n name=\"help-text\"\n part=\"form-control-help-text\"\n id=\"help-text\"\n class=\"form-control__help-text\"\n aria-hidden=","\n >\n ","\n </slot>\n </div>\n </div>\n "])),h({"form-control":!0,"form-control--medium":!0,"form-control--has-label":s,"form-control--has-help-text":l,"nile-chip--disabled":this.disabled}),s?"false":"true",this.label,h({"nile-chip":!0,"nile-chip--warning":this.warning,"nile-chip--error":this.error,"nile-chip--success":this.success}),this.tags.map(function(t){return e(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-tag class=\"nile-chip__tags\" @nile-remove="," removable pill>\n ","\n </nile-tag>\n "])),function(){return _this2.handleRemove(t);},t);}),this.autoCompleteOptions,this.inputValue,this.isDropdownOpen,!0,this.placeholder,this.handleInputChange,this.handleInputKeydown,this.handleFocus,this.handleSelect,l?"false":"true",this.helpText);}}],[{key:"styles",get:function get(){return[o];}}]);return c;}(r);t([i()],c.prototype,"tags",void 0),t([i()],c.prototype,"inputValue",void 0),t([i()],c.prototype,"isDropdownOpen",void 0),t([s("nile-auto-complete")],c.prototype,"autoComplete",void 0),t([p({type:Boolean})],c.prototype,"warning",void 0),t([p({type:Boolean})],c.prototype,"error",void 0),t([p({type:Boolean})],c.prototype,"success",void 0),t([p()],c.prototype,"label",void 0),t([p({type:Boolean})],c.prototype,"acceptUserInput",void 0),t([p({type:Boolean})],c.prototype,"clearable",void 0),t([p()],c.prototype,"placeholder",void 0),t([p({type:Boolean,reflect:!0})],c.prototype,"readonly",void 0),t([p({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),t([p({attribute:"help-text"})],c.prototype,"helpText",void 0),t([p({type:Array})],c.prototype,"autoCompleteOptions",void 0),t([p({type:Array})],c.prototype,"value",void 0),t([a("value")],c.prototype,"onValueChanged",null),c=t([l("nile-chip")],c);}};});
2
2
  //# sourceMappingURL=nile-chip.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-chip.cjs.js","sources":["../../../src/nile-chip/nile-chip.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult\n} from 'lit-element';\nimport { customElement, query, state } from 'lit/decorators.js';\nimport { styles } from './nile-chip.css';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { HasSlotController } from '../internal/slot';\nimport { watch } from '../internal/watch';\nimport NileElement, { NileFormControl } from '../internal/nile-element';\n\n\ninterface CustomEventDetail {\n value: string;\n}\n\n@customElement('nile-chip')\nexport class NileChip extends NileElement {\n\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private readonly hasSlotController = new HasSlotController(this, 'help-text', 'label');\n\n @state() tags: string[] = [];\n\n @state() inputValue: string = '';\n\n @state() isDropdownOpen: boolean = false;\n\n @query('nile-auto-complete') autoComplete!: any;\n\n /** The input's label. If you need to display HTML, use the `label` slot instead. */\n @property() label = '';\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) acceptUserInput = false;\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) clearable = false;\n\n /** Placeholder text to show as a hint when the input is empty. */\n @property() placeholder = '';\n\n /** Makes the input readonly. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /** Disables the input. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** The input's help text. If you need to display HTML, use the `help-text` slot instead. */\n @property({ attribute: 'help-text' }) helpText = '';\n\n // Auto-complete options\n @property({ type: Array }) autoCompleteOptions : any[] = [];\n\n @property({ type: Array }) value : any[] = [];\n\n @watch('value')\n onValueChanged() {\n this.tags = [...this.value];\n }\n\n private handleSelect(event: CustomEvent<CustomEventDetail>) {\n\n // Add the selected value to the tags array\n this.tags = [...this.tags, event.detail.value];\n\n // Emit a custom event with the selected value\n this.emit('nile-chip-change', { value: this.tags });\n\n // Reset the input field\n this.resetInput();\n }\n\n private handleRemove(value: string) {\n // Remove the tag from the tags array\n this.tags = this.tags.filter(tag => tag !== value);\n this.emit('nile-chip-change', { value: this.tags });\n\n }\n\n private handleInputChange(event: CustomEvent<CustomEventDetail>) {\n // Update the input value\n this.inputValue = event.detail.value;\n }\n\n private handleInputKeydown(event: KeyboardEvent) {\n if (!this.acceptUserInput) {\n return;\n }\n\n if (event.key === 'Enter' && this.inputValue) {\n this.tags = [...this.tags, this.inputValue];\n\n this.resetInput();\n this.emit('nile-chip-change', { value: this.tags });\n }\n\n\n }\n\n private handleFocus() {\n this.isDropdownOpen = true;\n }\n\n private resetInput() {\n // Reset the input-related properties\n this.inputValue = '';\n this.isDropdownOpen = false;\n this.autoComplete.value = '';\n this.autoComplete.handleFocus();\n }\n\n render() {\n // Check if slots are present\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n\n // Check if label and help text are present\n const hasLabel = this.label ? true : !!hasLabelSlot;\n const hasHelpText = this.helpText ? true : !!hasHelpTextSlot;\n\n return html`\n <div\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--medium': true,\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText,\n 'nile-chip--disabled': this.disabled,\n })}\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n <div class=\"nile-chip\">\n ${this.tags.map(tag => html`\n <nile-tag class=\"nile-chip__tags\" @nile-remove=${() => this.handleRemove(tag)} removable pill>\n ${tag}\n </nile-tag>\n `)}\n <div class=\"nile-chip__auto-complete\">\n <nile-auto-complete\n .allMenuItems=${this.autoCompleteOptions}\n .value=${this.inputValue}\n ?isDropdownOpen=${this.isDropdownOpen}\n .noBorder=${true}\n openOnFocus\n .placeholder=${this.placeholder}\n @nile-input=${this.handleInputChange}\n @keydown=${this.handleInputKeydown}\n @nile-focus=${this.handleFocus}\n @nile-complete=${this.handleSelect}\n ></nile-auto-complete>\n </div>\n <slot\n name=\"help-text\"\n part=\"form-control-help-text\"\n id=\"help-text\"\n class=\"form-control__help-text\"\n aria-hidden=${hasHelpText ? 'false' : 'true'}\n >\n ${this.helpText}\n </slot>\n </div>\n </div>\n `;\n }\n}\n\nexport default NileChip;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-chip': NileChip;\n }\n}\n"],"names":["NileChip","constructor","this","hasSlotController","HasSlotController","tags","inputValue","isDropdownOpen","label","acceptUserInput","clearable","placeholder","readonly","disabled","helpText","autoCompleteOptions","value","styles","onValueChanged","handleSelect","event","detail","emit","resetInput","handleRemove","filter","tag","handleInputChange","handleInputKeydown","key","handleFocus","autoComplete","render","hasLabelSlot","test","hasHelpTextSlot","hasLabel","hasHelpText","html","classMap","map","NileElement","__decorate","state","prototype","query","property","type","Boolean","reflect","attribute","Array","watch","customElement"],"mappings":"6oKA2BaA,CAAb,sEAAAC,kFAMmBC,MAAiBC,iBAAAA,CAAG,GAAIC,EAAkBF,+BAAM,YAAa,OAErEA,CAAAA,CAAAA,MAAIG,KAAa,EAEjBH,CAAAA,MAAUI,WAAW,EAErBJ,CAAAA,MAAcK,gBAAY,CAKvBL,CAAAA,MAAKM,KAAG,CAAA,EAAA,CAGSN,MAAeO,eAAAA,CAAAA,CAAG,EAGlBP,MAASQ,SAAAA,CAAAA,CAAG,EAG7BR,MAAWS,WAAAA,CAAG,GAGkBT,MAAQU,QAAAA,CAAAA,CAAG,EAGXV,MAAQW,QAAAA,CAAAA,CAAG,EAGjBX,MAAQY,QAAAA,CAAG,GAGtBZ,MAAmBa,mBAAAA,CAAW,GAE9Bb,MAAKc,KAAAA,CAAW,EAwH5C,eA9JmBC,4CAyClBC,0BACEhB,IAAKG,CAAAA,IAAAA,oBAAWH,IAAKc,CAAAA,KAAAA,CACtB,EAEOG,kDAAaC,CAAAA,CAAAA,CAGnBlB,KAAKG,IAAO,8BAAIH,KAAKG,IAAMe,GAAA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CAAEI,SAAAA,CAAW,WAA6BlD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA4C,UAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CAGzBF,CAAA,CAAA,CAA1BI,CAAS,CAAA,CAAEC,IAAMI,CAAAA,KAAAA,CAAAA,CAAAA,CAAAA,CAA0CnD,CAAA4C,CAAAA,SAAAA,CAAA,qBAAA,CAAA,IAAA,EAAA,CAAA,CAEjCF,CAAA,CAAA,CAA1BI,CAAS,CAAA,CAAEC,KAAMI,KAA4BnD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA4C,SAAA,CAAA,OAAA,CAAA,IAAA,EAG9CF,CAAAA,CAAAA,CAAAA,CAAA,CADCU,CAAAA,CAAM,OAGNpD,CAAAA,CAAAA,CAAAA,CAAAA,CAAA4C,SAAA,CAAA,gBAAA,CAAA,IA7CU5C,CAAAA,CAAAA,CAAAA,CAAQ0C,CAAA,CAAA,CADpBW,EAAc,WACFrD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
1
+ {"version":3,"file":"nile-chip.cjs.js","sources":["../../../src/nile-chip/nile-chip.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult\n} from 'lit-element';\nimport { customElement, query, state } from 'lit/decorators.js';\nimport { styles } from './nile-chip.css';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { HasSlotController } from '../internal/slot';\nimport { watch } from '../internal/watch';\nimport NileElement, { NileFormControl } from '../internal/nile-element';\n\n\ninterface CustomEventDetail {\n value: string;\n}\n\n@customElement('nile-chip')\nexport class NileChip extends NileElement {\n\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private readonly hasSlotController = new HasSlotController(this, 'help-text', 'label');\n\n @state() tags: string[] = [];\n\n @state() inputValue: string = '';\n\n @state() isDropdownOpen: boolean = false;\n\n @query('nile-auto-complete') autoComplete!: any;\n\n /** Sets the input to a warning state, changing its visual appearance. */\n @property({ type: Boolean }) warning = false;\n\n /** Sets the input to an error state, changing its visual appearance. */\n @property({ type: Boolean }) error = false;\n\n /** Sets the input to a success state, changing its visual appearance. */\n @property({ type: Boolean }) success = false;\n\n /** The input's label. If you need to display HTML, use the `label` slot instead. */\n @property() label = '';\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) acceptUserInput = false;\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) clearable = false;\n\n /** Placeholder text to show as a hint when the input is empty. */\n @property() placeholder = '';\n\n /** Makes the input readonly. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /** Disables the input. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** The input's help text. If you need to display HTML, use the `help-text` slot instead. */\n @property({ attribute: 'help-text' }) helpText = '';\n\n // Auto-complete options\n @property({ type: Array }) autoCompleteOptions : any[] = [];\n\n @property({ type: Array }) value : any[] = [];\n\n @watch('value')\n onValueChanged() {\n this.tags = [...this.value];\n }\n\n private handleSelect(event: CustomEvent<CustomEventDetail>) {\n\n // Add the selected value to the tags array\n this.tags = [...this.tags, event.detail.value];\n\n // Emit a custom event with the selected value\n this.emit('nile-chip-change', { value: this.tags });\n\n // Reset the input field\n this.resetInput();\n }\n\n private handleRemove(value: string) {\n // Remove the tag from the tags array\n this.tags = this.tags.filter(tag => tag !== value);\n this.emit('nile-chip-change', { value: this.tags });\n\n }\n\n private handleInputChange(event: CustomEvent<CustomEventDetail>) {\n // Update the input value\n this.inputValue = event.detail.value;\n }\n\n private handleInputKeydown(event: KeyboardEvent) {\n if (!this.acceptUserInput) {\n return;\n }\n\n if (event.key === 'Enter' && this.inputValue) {\n this.tags = [...this.tags, this.inputValue];\n\n this.resetInput();\n this.emit('nile-chip-change', { value: this.tags });\n }\n\n\n }\n\n private handleFocus() {\n this.isDropdownOpen = true;\n }\n\n private resetInput() {\n // Reset the input-related properties\n this.inputValue = '';\n this.isDropdownOpen = false;\n this.autoComplete.value = '';\n this.autoComplete.handleFocus();\n }\n\n render() {\n // Check if slots are present\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n\n // Check if label and help text are present\n const hasLabel = this.label ? true : !!hasLabelSlot;\n const hasHelpText = this.helpText ? true : !!hasHelpTextSlot;\n\n return html`\n <div\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--medium': true,\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText,\n 'nile-chip--disabled': this.disabled,\n })}\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n <div\n class=${classMap({\n 'nile-chip': true,\n 'nile-chip--warning': this.warning,\n 'nile-chip--error': this.error,\n 'nile-chip--success': this.success,\n\n })}\n >\n ${this.tags.map(tag => html`\n <nile-tag class=\"nile-chip__tags\" @nile-remove=${() => this.handleRemove(tag)} removable pill>\n ${tag}\n </nile-tag>\n `)}\n <div class=\"nile-chip__auto-complete\">\n <nile-auto-complete\n .allMenuItems=${this.autoCompleteOptions}\n .value=${this.inputValue}\n ?isDropdownOpen=${this.isDropdownOpen}\n .noBorder=${true}\n openOnFocus\n .placeholder=${this.placeholder}\n @nile-input=${this.handleInputChange}\n @keydown=${this.handleInputKeydown}\n @nile-focus=${this.handleFocus}\n @nile-complete=${this.handleSelect}\n ></nile-auto-complete>\n </div>\n <slot\n name=\"help-text\"\n part=\"form-control-help-text\"\n id=\"help-text\"\n class=\"form-control__help-text\"\n aria-hidden=${hasHelpText ? 'false' : 'true'}\n >\n ${this.helpText}\n </slot>\n </div>\n </div>\n `;\n }\n}\n\nexport default NileChip;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-chip': NileChip;\n }\n}\n"],"names":["NileChip","constructor","this","hasSlotController","HasSlotController","tags","inputValue","isDropdownOpen","warning","error","success","label","acceptUserInput","clearable","placeholder","readonly","disabled","helpText","autoCompleteOptions","value","styles","onValueChanged","handleSelect","event","detail","emit","resetInput","handleRemove","filter","tag","handleInputChange","handleInputKeydown","key","handleFocus","autoComplete","render","hasLabelSlot","test","hasHelpTextSlot","hasLabel","hasHelpText","html","classMap","map","NileElement","__decorate","state","prototype","query","property","type","Boolean","reflect","attribute","Array","watch","customElement"],"mappings":"6oKA2BaA,CAAAA,sEAAbC,kFAMmBC,MAAiBC,iBAAG,CAAA,GAAIC,iCAAwB,WAAA,CAAa,OAErEF,CAAAA,CAAAA,MAAIG,IAAa,CAAA,EAAA,CAEjBH,MAAUI,UAAW,CAAA,EAAA,CAErBJ,MAAcK,cAAY,CAAA,CAAA,CAAA,CAKNL,MAAOM,OAAG,CAAA,CAAA,CAAA,CAGVN,MAAKO,KAAAA,CAAAA,CAAG,CAGRP,CAAAA,MAAOQ,SAAG,CAG3BR,CAAAA,MAAKS,MAAG,EAGST,CAAAA,MAAeU,iBAAG,CAGlBV,CAAAA,MAASW,SAAG,CAAA,CAAA,CAAA,CAG7BX,MAAWY,WAAAA,CAAG,GAGkBZ,MAAQa,QAAAA,CAAAA,CAAG,EAGXb,MAAQc,QAAAA,CAAAA,CAAG,EAGjBd,MAAQe,QAAAA,CAAG,EAGtBf,CAAAA,MAAmBgB,mBAAW,CAAA,EAAA,CAE9BhB,MAAKiB,KAAW,CAAA,EAgI5C,eA/KmBC,4CAkDlBC,yBACEnB,CAAAA,IAAAA,CAAKG,IAAO,oBAAIH,KAAKiB,KACtB,CAAA,EAEOG,kDAAaC,CAGnBrB,CAAAA,CAAAA,IAAAA,CAAKG,kCAAWH,IAAAA,CAAKG,IAAMkB,GAAAA,CAAAA,CAAMC,MAAOL,CAAAA,KAAAA,EAAAA,CAGxCjB,KAAKuB,IAAK,CAAA,kBAAA,CAAoB,CAAEN,KAAOjB,CAAAA,IAAAA,CAAKG,OAG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CAAAA,CAAAA,CAAA,CAA3CI,CAAAA,CAAS,CAAEC,IAAMC,CAAAA,OAAAA,CAASC,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAyBpD,EAAA+C,SAAA,CAAA,UAAA,CAAA,IAAA,EAGjBF,CAAAA,CAAAA,CAAAA,CAAA,CAA3CI,CAAS,CAAA,CAAEC,IAAMC,CAAAA,OAAAA,CAASC,SAAS,CAAyBpD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA+C,UAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CAGvBF,EAAA,CAArCI,CAAAA,CAAS,CAAEI,SAAAA,CAAW,eAA6BrD,CAAA+C,CAAAA,SAAAA,CAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CAGzBF,EAAA,CAA1BI,CAAAA,CAAS,CAAEC,IAAAA,CAAMI,SAA0CtD,CAAA+C,CAAAA,SAAAA,CAAA,qBAAA,CAAA,IAAA,EAAA,CAAA,CAEjCF,EAAA,CAA1BI,CAAAA,CAAS,CAAEC,IAAAA,CAAMI,SAA4BtD,CAAA+C,CAAAA,SAAAA,CAAA,OAAA,CAAA,IAAA,EAAA,CAAA,CAG9CF,EAAA,CADCU,CAAAA,CAAM,OAGNvD,CAAAA,CAAAA,CAAAA,CAAAA,CAAA+C,UAAA,gBAAA,CAAA,IAAA,CAAA,CAtDU/C,EAAQ6C,CAAA,CAAA,CADpBW,EAAc,WACFxD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
@@ -1,4 +1,4 @@
1
- import{__decorate as t}from"tslib";import{y as e}from"../index-f1b94546.esm.js";import{state as i,query as s,customElement as l}from"lit/decorators.js";import{s as o}from"./nile-chip.css.esm.js";import{classMap as h}from"lit/directives/class-map.js";import{H as a}from"../internal/slot.esm.js";import{w as n}from"../internal/watch.esm.js";import{N as r}from"../internal/nile-element.esm.js";import{e as p}from"../property-bf6307e2.esm.js";import"lit";let c=class extends r{constructor(){super(...arguments),this.hasSlotController=new a(this,"help-text","label"),this.tags=[],this.inputValue="",this.isDropdownOpen=!1,this.label="",this.acceptUserInput=!1,this.clearable=!1,this.placeholder="",this.readonly=!1,this.disabled=!1,this.helpText="",this.autoCompleteOptions=[],this.value=[]}static get styles(){return[o]}onValueChanged(){this.tags=[...this.value]}handleSelect(t){this.tags=[...this.tags,t.detail.value],this.emit("nile-chip-change",{value:this.tags}),this.resetInput()}handleRemove(t){this.tags=this.tags.filter((e=>e!==t)),this.emit("nile-chip-change",{value:this.tags})}handleInputChange(t){this.inputValue=t.detail.value}handleInputKeydown(t){this.acceptUserInput&&"Enter"===t.key&&this.inputValue&&(this.tags=[...this.tags,this.inputValue],this.resetInput(),this.emit("nile-chip-change",{value:this.tags}))}handleFocus(){this.isDropdownOpen=!0}resetInput(){this.inputValue="",this.isDropdownOpen=!1,this.autoComplete.value="",this.autoComplete.handleFocus()}render(){const t=this.hasSlotController.test("label"),i=this.hasSlotController.test("help-text"),s=!!this.label||!!t,l=!!this.helpText||!!i;return e`
1
+ import{__decorate as e}from"tslib";import{y as t}from"../index-f1b94546.esm.js";import{state as i,query as s,customElement as l}from"lit/decorators.js";import{s as o}from"./nile-chip.css.esm.js";import{classMap as h}from"lit/directives/class-map.js";import{H as n}from"../internal/slot.esm.js";import{w as a}from"../internal/watch.esm.js";import{N as r}from"../internal/nile-element.esm.js";import{e as p}from"../property-bf6307e2.esm.js";import"lit";let c=class extends r{constructor(){super(...arguments),this.hasSlotController=new n(this,"help-text","label"),this.tags=[],this.inputValue="",this.isDropdownOpen=!1,this.warning=!1,this.error=!1,this.success=!1,this.label="",this.acceptUserInput=!1,this.clearable=!1,this.placeholder="",this.readonly=!1,this.disabled=!1,this.helpText="",this.autoCompleteOptions=[],this.value=[]}static get styles(){return[o]}onValueChanged(){this.tags=[...this.value]}handleSelect(e){this.tags=[...this.tags,e.detail.value],this.emit("nile-chip-change",{value:this.tags}),this.resetInput()}handleRemove(e){this.tags=this.tags.filter((t=>t!==e)),this.emit("nile-chip-change",{value:this.tags})}handleInputChange(e){this.inputValue=e.detail.value}handleInputKeydown(e){this.acceptUserInput&&"Enter"===e.key&&this.inputValue&&(this.tags=[...this.tags,this.inputValue],this.resetInput(),this.emit("nile-chip-change",{value:this.tags}))}handleFocus(){this.isDropdownOpen=!0}resetInput(){this.inputValue="",this.isDropdownOpen=!1,this.autoComplete.value="",this.autoComplete.handleFocus()}render(){const e=this.hasSlotController.test("label"),i=this.hasSlotController.test("help-text"),s=!!this.label||!!e,l=!!this.helpText||!!i;return t`
2
2
  <div
3
3
  part="form-control"
4
4
  class=${h({"form-control":!0,"form-control--medium":!0,"form-control--has-label":s,"form-control--has-help-text":l,"nile-chip--disabled":this.disabled})}
@@ -12,10 +12,12 @@ import{__decorate as t}from"tslib";import{y as e}from"../index-f1b94546.esm.js";
12
12
  <slot name="label">${this.label}</slot>
13
13
  </label>
14
14
 
15
- <div class="nile-chip">
16
- ${this.tags.map((t=>e`
17
- <nile-tag class="nile-chip__tags" @nile-remove=${()=>this.handleRemove(t)} removable pill>
18
- ${t}
15
+ <div
16
+ class=${h({"nile-chip":!0,"nile-chip--warning":this.warning,"nile-chip--error":this.error,"nile-chip--success":this.success})}
17
+ >
18
+ ${this.tags.map((e=>t`
19
+ <nile-tag class="nile-chip__tags" @nile-remove=${()=>this.handleRemove(e)} removable pill>
20
+ ${e}
19
21
  </nile-tag>
20
22
  `))}
21
23
  <div class="nile-chip__auto-complete">
@@ -43,4 +45,4 @@ import{__decorate as t}from"tslib";import{y as e}from"../index-f1b94546.esm.js";
43
45
  </slot>
44
46
  </div>
45
47
  </div>
46
- `}};t([i()],c.prototype,"tags",void 0),t([i()],c.prototype,"inputValue",void 0),t([i()],c.prototype,"isDropdownOpen",void 0),t([s("nile-auto-complete")],c.prototype,"autoComplete",void 0),t([p()],c.prototype,"label",void 0),t([p({type:Boolean})],c.prototype,"acceptUserInput",void 0),t([p({type:Boolean})],c.prototype,"clearable",void 0),t([p()],c.prototype,"placeholder",void 0),t([p({type:Boolean,reflect:!0})],c.prototype,"readonly",void 0),t([p({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),t([p({attribute:"help-text"})],c.prototype,"helpText",void 0),t([p({type:Array})],c.prototype,"autoCompleteOptions",void 0),t([p({type:Array})],c.prototype,"value",void 0),t([n("value")],c.prototype,"onValueChanged",null),c=t([l("nile-chip")],c);
48
+ `}};e([i()],c.prototype,"tags",void 0),e([i()],c.prototype,"inputValue",void 0),e([i()],c.prototype,"isDropdownOpen",void 0),e([s("nile-auto-complete")],c.prototype,"autoComplete",void 0),e([p({type:Boolean})],c.prototype,"warning",void 0),e([p({type:Boolean})],c.prototype,"error",void 0),e([p({type:Boolean})],c.prototype,"success",void 0),e([p()],c.prototype,"label",void 0),e([p({type:Boolean})],c.prototype,"acceptUserInput",void 0),e([p({type:Boolean})],c.prototype,"clearable",void 0),e([p()],c.prototype,"placeholder",void 0),e([p({type:Boolean,reflect:!0})],c.prototype,"readonly",void 0),e([p({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),e([p({attribute:"help-text"})],c.prototype,"helpText",void 0),e([p({type:Array})],c.prototype,"autoCompleteOptions",void 0),e([p({type:Array})],c.prototype,"value",void 0),e([a("value")],c.prototype,"onValueChanged",null),c=e([l("nile-chip")],c);