@aquera/nile-elements 0.0.1-beta.4 → 0.0.1-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/src/nile-auto-complete/nile-auto-complete.js +2 -2
- package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
- package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/src/nile-chip/nile-chip.d.ts +3 -1
- package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/src/nile-chip/nile-chip.js +18 -2
- package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/src/nile-chip/nile-chip.js.map +1 -1
- package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/src/nile-menu-item/nile-menu-item.js +2 -2
- package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/src/nile-menu-item/nile-menu-item.js.map +1 -1
- package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/src/nile-tag/nile-tag.js +1 -1
- package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/src/nile-tag/nile-tag.js.map +1 -1
- package/.rollup.cache/Users/ravisankar/aquera/nile/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.esm.js +1 -1
- package/dist/nile-chip/index.cjs.js +1 -1
- package/dist/nile-chip/index.esm.js +1 -1
- package/dist/nile-chip/nile-chip.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.cjs.js.map +1 -1
- package/dist/nile-chip/nile-chip.esm.js +2 -2
- package/dist/nile-menu-item/nile-menu-item.cjs.js +1 -1
- package/dist/nile-menu-item/nile-menu-item.cjs.js.map +1 -1
- package/dist/nile-menu-item/nile-menu-item.esm.js +2 -2
- package/dist/nile-tag/nile-tag.cjs.js +1 -1
- package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
- package/dist/nile-tag/nile-tag.esm.js +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.js +2 -2
- package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
- package/dist/src/nile-chip/nile-chip.d.ts +3 -1
- package/dist/src/nile-chip/nile-chip.js +18 -2
- package/dist/src/nile-chip/nile-chip.js.map +1 -1
- package/dist/src/nile-menu-item/nile-menu-item.js +2 -2
- package/dist/src/nile-menu-item/nile-menu-item.js.map +1 -1
- package/dist/src/nile-tag/nile-tag.js +1 -1
- package/dist/src/nile-tag/nile-tag.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-auto-complete/nile-auto-complete.ts +4 -4
- package/src/nile-chip/nile-chip.ts +16 -3
- package/src/nile-menu-item/nile-menu-item.ts +2 -2
- package/src/nile-tag/nile-tag.ts +1 -1
@@ -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){return e.text.toLowerCase().includes(_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.text.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,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);}};});
|
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:
|
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","waitUntilFirstUpdate","customElement"],"mappings":"67gBAcaA,uEAAbC,kFAE+BC,MAAcC,cAAAA,CAAAA,CAAY,CAE1BD,CAAAA,MAAWE,aAAY,CAExBF,CAAAA,MAAKG,KAAW,CAAA,EAAA,CAEhBH,MAAWI,WAAW,CAAA,cAAA,CAErBJ,MAAQK,QAAY,CAAA,CAAA,CAAA,CAExCL,MAASM,SAAQ,CAAA,EAAA,CAECN,MAAYO,YAAAA,CAAQ,EA+FhD,eA3FCC,2EAAAA,CACEC,uEACAT,KAAKM,SAAY,oBAAIN,IAAKO,CAAAA,YAAAA,CAC3B,EAIDG,2EACEV,CAAAA,IAAAA,CAAKM,SAAY,oBAAIN,KAAKO,YAC3B,CAAA,EAMDI,2SACQX,KAAAA,CAAKY,sBAEXZ,IAAKM,CAAAA,SAAAA,CAAYN,IAAKO,CAAAA,YAAAA,CAAaM,OAAQC,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EpCL,CAAA,CAAA,CAA5BE,CAAS,CAAA,CAAEC,KAAMC,OAAqCxC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAyC,SAAA,CAAA,UAAA,CAAA,IAAA,EAE9CL,CAAAA,CAAAA,CAAAA,CAAA,CAARO,CAA4B3C,EAAAA,CAAAA,CAAAA,CAAAA,CAAAyC,UAAA,WAAA,CAAA,IAAA,EAAA,CAAA,CAEFL,EAAA,CAA1BE,CAAAA,CAAS,CAAEC,IAAAA,CAAMK,KAAgC5C,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAyC,UAAA,cAAA,CAAA,IAAA,EAAA,CAAA,CAE1BL,CAAA,CAAA,CAAvBS,CAAM,CAAA,eAAA,CAAA,CAAA,CAAsC7C,EAAAyC,SAAA,CAAA,iBAAA,CAAA,IAAA,EAS7CL,CAAAA,CAAAA,CAAAA,CAAA,CADCU,CAAAA,CAAM,iBAGN9C,CAAAyC,CAAAA,SAAAA,CAAA,2BAAA,IAMDL,CAAAA,CAAAA,CAAAA,CAAA,CAHCU,CAAM,CAAA,OAAA,CAAS,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,4 +1,4 @@
|
|
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.
|
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`
|
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}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["./nile-chip.cjs.js","tslib","../index-adad7634.cjs.js","lit/decorators.js","./nile-chip.css.cjs.js","lit/directives/class-map.js","../internal/slot.cjs.js","../internal/nile-element.cjs.js","lit","../property-ec52a751.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileChipCjsJs){},function(_tslib){},function(_index001CjsJs){},function(_litDecoratorsJs){},function(_nileChipCssCjsJs){},function(_litDirectivesClassMapJs){},function(_internalSlotCjsJs){},function(_internalNileElementCjsJs){},function(_lit){},function(_property002CjsJs){}],execute:function(){}};});
|
1
|
+
System.register(["./nile-chip.cjs.js","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","lit","../property-ec52a751.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileChipCjsJs){},function(_tslib){},function(_index001CjsJs){},function(_litDecoratorsJs){},function(_nileChipCssCjsJs){},function(_litDirectivesClassMapJs){},function(_internalSlotCjsJs){},function(_internalWatchCjsJs){},function(_internalNileElementCjsJs){},function(_lit){},function(_property002CjsJs){}],execute:function(){}};});
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
import"./nile-chip.esm.js";import"tslib";import"../index-f1b94546.esm.js";import"lit/decorators.js";import"./nile-chip.css.esm.js";import"lit/directives/class-map.js";import"../internal/slot.esm.js";import"../internal/nile-element.esm.js";import"lit";import"../property-bf6307e2.esm.js";
|
1
|
+
import"./nile-chip.esm.js";import"tslib";import"../index-f1b94546.esm.js";import"lit/decorators.js";import"./nile-chip.css.esm.js";import"lit/directives/class-map.js";import"../internal/slot.esm.js";import"../internal/watch.esm.js";import"../internal/nile-element.esm.js";import"lit";import"../property-bf6307e2.esm.js";
|
@@ -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/nile-element.cjs.js","../property-ec52a751.cjs.js","lit"],function(_export,_context){"use strict";var t,e,i,s,l,o,h,
|
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);}};});
|
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 private autoCompleteOptions: string[] = [];\n\n private handleSelect(event: CustomEvent<CustomEventDetail>) {\n // Emit a custom event with the selected value\n this.emit('nile-chip-change', { value: event.detail.value });\n\n // Add the selected value to the tags array\n this.tags = [...this.tags, event.detail.value];\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 }\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 }\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","styles","handleSelect","event","emit","value","detail","resetInput","handleRemove","filter","tag","handleInputChange","handleInputKeydown","key","handleFocus","autoComplete","render","hasLabelSlot","test","hasHelpTextSlot","hasLabel","hasHelpText","html","classMap","map","__decorate","NileElement","state","prototype","query","property","type","Boolean","reflect","attribute","customElement"],"mappings":"wjKA2BaA,CAAb,sEAAAC,kFAMmBC,MAAiBC,iBAAAA,CAAG,GAAIC,EAAkBF,+BAAM,WAAa,CAAA,OAAA,CAAA,CAErEA,MAAIG,IAAa,CAAA,EAAA,CAEjBH,MAAUI,UAAW,CAAA,EAAA,CAErBJ,MAAcK,cAAY,CAAA,CAAA,CAAA,CAKvBL,MAAKM,KAAAA,CAAG,GAGSN,MAAeO,eAAAA,CAAAA,CAAG,EAGlBP,MAASQ,SAAAA,CAAAA,CAAG,EAG7BR,MAAWS,WAAAA,CAAG,EAGkBT,CAAAA,MAAQU,UAAG,CAGXV,CAAAA,MAAQW,UAAG,CAGjBX,CAAAA,MAAQY,SAAG,EAGzCZ,CAAAA,MAAmBa,mBAAa,CAAA,EA6GzC,eAjJmBC,0CAsCVC,sBAAaC,CAE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],"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,GAAAA,CAAAA,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AAA,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,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
|
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`
|
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})}
|
@@ -43,4 +43,4 @@ import{__decorate as t}from"tslib";import{y as e}from"../index-f1b94546.esm.js";
|
|
43
43
|
</slot>
|
44
44
|
</div>
|
45
45
|
</div>
|
46
|
-
`}};t([i()],
|
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);
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["tslib","../index-adad7634.cjs.js","lit/decorators.js","./nile-menu-item.css.cjs.js","../nile-icon/index.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","lit/directives/unsafe-svg.js","lit/directives/unsafe-html.js","../nile-icon/icons/svg/index.cjs.js","../nile-icon/icons/svg/access-review.cjs.js","../nile-icon/icons/svg/action.cjs.js","../nile-icon/icons/svg/actionworkflow.cjs.js","../nile-icon/icons/svg/agents.cjs.js","../nile-icon/icons/svg/aggregation.cjs.js","../nile-icon/icons/svg/allsearch.cjs.js","../nile-icon/icons/svg/application.cjs.js","../nile-icon/icons/svg/approve.cjs.js","../nile-icon/icons/svg/arrowdown.cjs.js","../nile-icon/icons/svg/arrowleft.cjs.js","../nile-icon/icons/svg/arrowright.cjs.js","../nile-icon/icons/svg/arrowup.cjs.js","../nile-icon/icons/svg/attributemap.cjs.js","../nile-icon/icons/svg/bell.cjs.js","../nile-icon/icons/svg/boolean.cjs.js","../nile-icon/icons/svg/bulk-sync.cjs.js","../nile-icon/icons/svg/button-loading-black.cjs.js","../nile-icon/icons/svg/button-loading-blue.cjs.js","../nile-icon/icons/svg/button-loading-white.cjs.js","../nile-icon/icons/svg/calendar.cjs.js","../nile-icon/icons/svg/caution.cjs.js","../nile-icon/icons/svg/close.cjs.js","../nile-icon/icons/svg/collapse-1.cjs.js","../nile-icon/icons/svg/collapse.cjs.js","../nile-icon/icons/svg/compact.cjs.js","../nile-icon/icons/svg/compare-tiles.cjs.js","../nile-icon/icons/svg/component-menu.cjs.js","../nile-icon/icons/svg/connect.cjs.js","../nile-icon/icons/svg/copy.cjs.js","../nile-icon/icons/svg/correlation.cjs.js","../nile-icon/icons/svg/dashboard.cjs.js","../nile-icon/icons/svg/database.cjs.js","../nile-icon/icons/svg/databaseview.cjs.js","../nile-icon/icons/svg/default-1.cjs.js","../nile-icon/icons/svg/default.cjs.js","../nile-icon/icons/svg/directory.cjs.js","../nile-icon/icons/svg/disabled.cjs.js","../nile-icon/icons/svg/document.cjs.js","../nile-icon/icons/svg/done.cjs.js","../nile-icon/icons/svg/download.cjs.js","../nile-icon/icons/svg/drag.cjs.js","../nile-icon/icons/svg/draglist.cjs.js","../nile-icon/icons/svg/enable.cjs.js","../nile-icon/icons/svg/entitlement.cjs.js","../nile-icon/icons/svg/error.cjs.js","../nile-icon/icons/svg/escalate.cjs.js","../nile-icon/icons/svg/event.cjs.js","../nile-icon/icons/svg/exactmatch.cjs.js","../nile-icon/icons/svg/expand-1.cjs.js","../nile-icon/icons/svg/expand.cjs.js","../nile-icon/icons/svg/eye.cjs.js","../nile-icon/icons/svg/eyeclosed.cjs.js","../nile-icon/icons/svg/filter.cjs.js","../nile-icon/icons/svg/firewall.cjs.js","../nile-icon/icons/svg/flow-h.cjs.js","../nile-icon/icons/svg/flow.cjs.js","../nile-icon/icons/svg/flowmap.cjs.js","../nile-icon/icons/svg/folder.cjs.js","../nile-icon/icons/svg/frequency.cjs.js","../nile-icon/icons/svg/fullscreen.cjs.js","../nile-icon/icons/svg/fullscreenshrink.cjs.js","../nile-icon/icons/svg/generation-phase.cjs.js","../nile-icon/icons/svg/global-search.cjs.js","../nile-icon/icons/svg/goto.cjs.js","../nile-icon/icons/svg/groupby.cjs.js","../nile-icon/icons/svg/guide.cjs.js","../nile-icon/icons/svg/helpsupport.cjs.js","../nile-icon/icons/svg/help-1.cjs.js","../nile-icon/icons/svg/help.cjs.js","../nile-icon/icons/svg/history.cjs.js","../nile-icon/icons/svg/identityledger.cjs.js","../nile-icon/icons/svg/ifelse.cjs.js","../nile-icon/icons/svg/image.cjs.js","../nile-icon/icons/svg/info.cjs.js","../nile-icon/icons/svg/info2.cjs.js","../nile-icon/icons/svg/js.cjs.js","../nile-icon/icons/svg/link.cjs.js","../nile-icon/icons/svg/loader.cjs.js","../nile-icon/icons/svg/loading.cjs.js","../nile-icon/icons/svg/loading2.cjs.js","../nile-icon/icons/svg/lock.cjs.js","../nile-icon/icons/svg/logs.cjs.js","../nile-icon/icons/svg/manage.cjs.js","../nile-icon/icons/svg/map.cjs.js","../nile-icon/icons/svg/mapcreate.cjs.js","../nile-icon/icons/svg/mapdont.cjs.js","../nile-icon/icons/svg/mapupdate.cjs.js","../nile-icon/icons/svg/maximize.cjs.js","../nile-icon/icons/svg/minus.cjs.js","../nile-icon/icons/svg/moveleft.cjs.js","../nile-icon/icons/svg/moveright.cjs.js","../nile-icon/icons/svg/mute.cjs.js","../nile-icon/icons/svg/nomatch.cjs.js","../nile-icon/icons/svg/not.cjs.js","../nile-icon/icons/svg/note.cjs.js","../nile-icon/icons/svg/notificationadd.cjs.js","../nile-icon/icons/svg/notificationadded.cjs.js","../nile-icon/icons/svg/null.cjs.js","../nile-icon/icons/svg/number.cjs.js","../nile-icon/icons/svg/options.cjs.js","../nile-icon/icons/svg/orchestration.cjs.js","../nile-icon/icons/svg/partner.cjs.js","../nile-icon/icons/svg/pencil.cjs.js","../nile-icon/icons/svg/people-task.cjs.js","../nile-icon/icons/svg/pin.cjs.js","../nile-icon/icons/svg/plus.cjs.js","../nile-icon/icons/svg/potentialmatch.cjs.js","../nile-icon/icons/svg/poweron.cjs.js","../nile-icon/icons/svg/privilage.cjs.js","../nile-icon/icons/svg/radio.cjs.js","../nile-icon/icons/svg/radioactive.cjs.js","../nile-icon/icons/svg/radiodone.cjs.js","../nile-icon/icons/svg/readexpression.cjs.js","../nile-icon/icons/svg/readonly.cjs.js","../nile-icon/icons/svg/redo.cjs.js","../nile-icon/icons/svg/refresh.cjs.js","../nile-icon/icons/svg/reminder.cjs.js","../nile-icon/icons/svg/resource.cjs.js","../nile-icon/icons/svg/revokation-cycle.cjs.js","../nile-icon/icons/svg/role.cjs.js","../nile-icon/icons/svg/run.cjs.js","../nile-icon/icons/svg/save.cjs.js","../nile-icon/icons/svg/schedule.cjs.js","../nile-icon/icons/svg/script.cjs.js","../nile-icon/icons/svg/search.cjs.js","../nile-icon/icons/svg/select.cjs.js","../nile-icon/icons/svg/selectapplication.cjs.js","../nile-icon/icons/svg/selectattributes.cjs.js","../nile-icon/icons/svg/selectuser.cjs.js","../nile-icon/icons/svg/send.cjs.js","../nile-icon/icons/svg/settings.cjs.js","../nile-icon/icons/svg/sort.cjs.js","../nile-icon/icons/svg/stop.cjs.js","../nile-icon/icons/svg/string.cjs.js","../nile-icon/icons/svg/sync.cjs.js","../nile-icon/icons/svg/test.cjs.js","../nile-icon/icons/svg/textarea-expander.cjs.js","../nile-icon/icons/svg/tick.cjs.js","../nile-icon/icons/svg/timeupdate.cjs.js","../nile-icon/icons/svg/timezone.cjs.js","../nile-icon/icons/svg/trash.cjs.js","../nile-icon/icons/svg/undo-1.cjs.js","../nile-icon/icons/svg/undo.cjs.js","../nile-icon/icons/svg/unmute.cjs.js","../nile-icon/icons/svg/upgrade.cjs.js","../nile-icon/icons/svg/upload.cjs.js","../nile-icon/icons/svg/user-group.cjs.js","../nile-icon/icons/svg/user.cjs.js","../nile-icon/icons/svg/useractive.cjs.js","../nile-icon/icons/svg/useradd.cjs.js","../nile-icon/icons/svg/useraddgroup.cjs.js","../nile-icon/icons/svg/userfind.cjs.js","../nile-icon/icons/svg/userimport.cjs.js","../nile-icon/icons/svg/userimportgroup.cjs.js","../nile-icon/icons/svg/usermixed.cjs.js","../nile-icon/icons/svg/userremove-1.cjs.js","../nile-icon/icons/svg/userremove-2.cjs.js","../nile-icon/icons/svg/userremove.cjs.js","../nile-icon/icons/svg/userremovegroup.cjs.js","../nile-icon/icons/svg/userupdate.cjs.js","../nile-icon/icons/svg/users.cjs.js","../nile-icon/icons/svg/validationexpression.cjs.js","../nile-icon/icons/svg/variable-new-1.cjs.js","../nile-icon/icons/svg/variable-new.cjs.js","../nile-icon/icons/svg/variable-global.cjs.js","../nile-icon/icons/svg/variable-local-1.cjs.js","../nile-icon/icons/svg/variable-local.cjs.js","../nile-icon/icons/svg/variable.cjs.js","../nile-icon/icons/svg/video.cjs.js","../nile-icon/icons/svg/warning.cjs.js","../nile-icon/icons/svg/whileloop.cjs.js","../nile-icon/icons/svg/workflow.cjs.js","../nile-icon/icons/svg/writeexpression.cjs.js","../nile-icon/icons/svg/back.cjs.js","../nile-icon/icons/svg/downgrade.cjs.js","../nile-icon/icons/svg/globe.cjs.js","../nile-icon/icons/svg/phone.cjs.js","../nile-icon/icons/svg/storybook.cjs.js","../nile-icon/icons/svg/swap.cjs.js"],function(_export,_context){"use strict";var i,s,o,n,c,e,t,j,r,l,_templateObject,m;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}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){i=_tslib.__decorate;},function(_index001CjsJs){s=_index001CjsJs.y;},function(_litDecoratorsJs){o=_litDecoratorsJs.query;n=_litDecoratorsJs.customElement;},function(_nileMenuItemCssCjsJs){c=_nileMenuItemCssCjsJs.s;},function(_nileIconIndexCjsJs){},function(_litDirectivesClassMapJs){e=_litDirectivesClassMapJs.classMap;},function(_internalSlotCjsJs){t=_internalSlotCjsJs.g;},function(_internalWatchCjsJs){j=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_property002CjsJs){l=_property002CjsJs.e;},function(_lit){},function(_litDirectivesUnsafeSvgJs){},function(_litDirectivesUnsafeHtmlJs){},function(_nileIconIconsSvgIndexCjsJs){},function(_nileIconIconsSvgAccessReviewCjsJs){},function(_nileIconIconsSvgActionCjsJs){},function(_nileIconIconsSvgActionworkflowCjsJs){},function(_nileIconIconsSvgAgentsCjsJs){},function(_nileIconIconsSvgAggregationCjsJs){},function(_nileIconIconsSvgAllsearchCjsJs){},function(_nileIconIconsSvgApplicationCjsJs){},function(_nileIconIconsSvgApproveCjsJs){},function(_nileIconIconsSvgArrowdownCjsJs){},function(_nileIconIconsSvgArrowleftCjsJs){},function(_nileIconIconsSvgArrowrightCjsJs){},function(_nileIconIconsSvgArrowupCjsJs){},function(_nileIconIconsSvgAttributemapCjsJs){},function(_nileIconIconsSvgBellCjsJs){},function(_nileIconIconsSvgBooleanCjsJs){},function(_nileIconIconsSvgBulkSyncCjsJs){},function(_nileIconIconsSvgButtonLoadingBlackCjsJs){},function(_nileIconIconsSvgButtonLoadingBlueCjsJs){},function(_nileIconIconsSvgButtonLoadingWhiteCjsJs){},function(_nileIconIconsSvgCalendarCjsJs){},function(_nileIconIconsSvgCautionCjsJs){},function(_nileIconIconsSvgCloseCjsJs){},function(_nileIconIconsSvgCollapse1CjsJs){},function(_nileIconIconsSvgCollapseCjsJs){},function(_nileIconIconsSvgCompactCjsJs){},function(_nileIconIconsSvgCompareTilesCjsJs){},function(_nileIconIconsSvgComponentMenuCjsJs){},function(_nileIconIconsSvgConnectCjsJs){},function(_nileIconIconsSvgCopyCjsJs){},function(_nileIconIconsSvgCorrelationCjsJs){},function(_nileIconIconsSvgDashboardCjsJs){},function(_nileIconIconsSvgDatabaseCjsJs){},function(_nileIconIconsSvgDatabaseviewCjsJs){},function(_nileIconIconsSvgDefault1CjsJs){},function(_nileIconIconsSvgDefaultCjsJs){},function(_nileIconIconsSvgDirectoryCjsJs){},function(_nileIconIconsSvgDisabledCjsJs){},function(_nileIconIconsSvgDocumentCjsJs){},function(_nileIconIconsSvgDoneCjsJs){},function(_nileIconIconsSvgDownloadCjsJs){},function(_nileIconIconsSvgDragCjsJs){},function(_nileIconIconsSvgDraglistCjsJs){},function(_nileIconIconsSvgEnableCjsJs){},function(_nileIconIconsSvgEntitlementCjsJs){},function(_nileIconIconsSvgErrorCjsJs){},function(_nileIconIconsSvgEscalateCjsJs){},function(_nileIconIconsSvgEventCjsJs){},function(_nileIconIconsSvgExactmatchCjsJs){},function(_nileIconIconsSvgExpand1CjsJs){},function(_nileIconIconsSvgExpandCjsJs){},function(_nileIconIconsSvgEyeCjsJs){},function(_nileIconIconsSvgEyeclosedCjsJs){},function(_nileIconIconsSvgFilterCjsJs){},function(_nileIconIconsSvgFirewallCjsJs){},function(_nileIconIconsSvgFlowHCjsJs){},function(_nileIconIconsSvgFlowCjsJs){},function(_nileIconIconsSvgFlowmapCjsJs){},function(_nileIconIconsSvgFolderCjsJs){},function(_nileIconIconsSvgFrequencyCjsJs){},function(_nileIconIconsSvgFullscreenCjsJs){},function(_nileIconIconsSvgFullscreenshrinkCjsJs){},function(_nileIconIconsSvgGenerationPhaseCjsJs){},function(_nileIconIconsSvgGlobalSearchCjsJs){},function(_nileIconIconsSvgGotoCjsJs){},function(_nileIconIconsSvgGroupbyCjsJs){},function(_nileIconIconsSvgGuideCjsJs){},function(_nileIconIconsSvgHelpsupportCjsJs){},function(_nileIconIconsSvgHelp1CjsJs){},function(_nileIconIconsSvgHelpCjsJs){},function(_nileIconIconsSvgHistoryCjsJs){},function(_nileIconIconsSvgIdentityledgerCjsJs){},function(_nileIconIconsSvgIfelseCjsJs){},function(_nileIconIconsSvgImageCjsJs){},function(_nileIconIconsSvgInfoCjsJs){},function(_nileIconIconsSvgInfo2CjsJs){},function(_nileIconIconsSvgJsCjsJs){},function(_nileIconIconsSvgLinkCjsJs){},function(_nileIconIconsSvgLoaderCjsJs){},function(_nileIconIconsSvgLoadingCjsJs){},function(_nileIconIconsSvgLoading2CjsJs){},function(_nileIconIconsSvgLockCjsJs){},function(_nileIconIconsSvgLogsCjsJs){},function(_nileIconIconsSvgManageCjsJs){},function(_nileIconIconsSvgMapCjsJs){},function(_nileIconIconsSvgMapcreateCjsJs){},function(_nileIconIconsSvgMapdontCjsJs){},function(_nileIconIconsSvgMapupdateCjsJs){},function(_nileIconIconsSvgMaximizeCjsJs){},function(_nileIconIconsSvgMinusCjsJs){},function(_nileIconIconsSvgMoveleftCjsJs){},function(_nileIconIconsSvgMoverightCjsJs){},function(_nileIconIconsSvgMuteCjsJs){},function(_nileIconIconsSvgNomatchCjsJs){},function(_nileIconIconsSvgNotCjsJs){},function(_nileIconIconsSvgNoteCjsJs){},function(_nileIconIconsSvgNotificationaddCjsJs){},function(_nileIconIconsSvgNotificationaddedCjsJs){},function(_nileIconIconsSvgNullCjsJs){},function(_nileIconIconsSvgNumberCjsJs){},function(_nileIconIconsSvgOptionsCjsJs){},function(_nileIconIconsSvgOrchestrationCjsJs){},function(_nileIconIconsSvgPartnerCjsJs){},function(_nileIconIconsSvgPencilCjsJs){},function(_nileIconIconsSvgPeopleTaskCjsJs){},function(_nileIconIconsSvgPinCjsJs){},function(_nileIconIconsSvgPlusCjsJs){},function(_nileIconIconsSvgPotentialmatchCjsJs){},function(_nileIconIconsSvgPoweronCjsJs){},function(_nileIconIconsSvgPrivilageCjsJs){},function(_nileIconIconsSvgRadioCjsJs){},function(_nileIconIconsSvgRadioactiveCjsJs){},function(_nileIconIconsSvgRadiodoneCjsJs){},function(_nileIconIconsSvgReadexpressionCjsJs){},function(_nileIconIconsSvgReadonlyCjsJs){},function(_nileIconIconsSvgRedoCjsJs){},function(_nileIconIconsSvgRefreshCjsJs){},function(_nileIconIconsSvgReminderCjsJs){},function(_nileIconIconsSvgResourceCjsJs){},function(_nileIconIconsSvgRevokationCycleCjsJs){},function(_nileIconIconsSvgRoleCjsJs){},function(_nileIconIconsSvgRunCjsJs){},function(_nileIconIconsSvgSaveCjsJs){},function(_nileIconIconsSvgScheduleCjsJs){},function(_nileIconIconsSvgScriptCjsJs){},function(_nileIconIconsSvgSearchCjsJs){},function(_nileIconIconsSvgSelectCjsJs){},function(_nileIconIconsSvgSelectapplicationCjsJs){},function(_nileIconIconsSvgSelectattributesCjsJs){},function(_nileIconIconsSvgSelectuserCjsJs){},function(_nileIconIconsSvgSendCjsJs){},function(_nileIconIconsSvgSettingsCjsJs){},function(_nileIconIconsSvgSortCjsJs){},function(_nileIconIconsSvgStopCjsJs){},function(_nileIconIconsSvgStringCjsJs){},function(_nileIconIconsSvgSyncCjsJs){},function(_nileIconIconsSvgTestCjsJs){},function(_nileIconIconsSvgTextareaExpanderCjsJs){},function(_nileIconIconsSvgTickCjsJs){},function(_nileIconIconsSvgTimeupdateCjsJs){},function(_nileIconIconsSvgTimezoneCjsJs){},function(_nileIconIconsSvgTrashCjsJs){},function(_nileIconIconsSvgUndo1CjsJs){},function(_nileIconIconsSvgUndoCjsJs){},function(_nileIconIconsSvgUnmuteCjsJs){},function(_nileIconIconsSvgUpgradeCjsJs){},function(_nileIconIconsSvgUploadCjsJs){},function(_nileIconIconsSvgUserGroupCjsJs){},function(_nileIconIconsSvgUserCjsJs){},function(_nileIconIconsSvgUseractiveCjsJs){},function(_nileIconIconsSvgUseraddCjsJs){},function(_nileIconIconsSvgUseraddgroupCjsJs){},function(_nileIconIconsSvgUserfindCjsJs){},function(_nileIconIconsSvgUserimportCjsJs){},function(_nileIconIconsSvgUserimportgroupCjsJs){},function(_nileIconIconsSvgUsermixedCjsJs){},function(_nileIconIconsSvgUserremove1CjsJs){},function(_nileIconIconsSvgUserremove2CjsJs){},function(_nileIconIconsSvgUserremoveCjsJs){},function(_nileIconIconsSvgUserremovegroupCjsJs){},function(_nileIconIconsSvgUserupdateCjsJs){},function(_nileIconIconsSvgUsersCjsJs){},function(_nileIconIconsSvgValidationexpressionCjsJs){},function(_nileIconIconsSvgVariableNew1CjsJs){},function(_nileIconIconsSvgVariableNewCjsJs){},function(_nileIconIconsSvgVariableGlobalCjsJs){},function(_nileIconIconsSvgVariableLocal1CjsJs){},function(_nileIconIconsSvgVariableLocalCjsJs){},function(_nileIconIconsSvgVariableCjsJs){},function(_nileIconIconsSvgVideoCjsJs){},function(_nileIconIconsSvgWarningCjsJs){},function(_nileIconIconsSvgWhileloopCjsJs){},function(_nileIconIconsSvgWorkflowCjsJs){},function(_nileIconIconsSvgWriteexpressionCjsJs){},function(_nileIconIconsSvgBackCjsJs){},function(_nileIconIconsSvgDowngradeCjsJs){},function(_nileIconIconsSvgGlobeCjsJs){},function(_nileIconIconsSvgPhoneCjsJs){},function(_nileIconIconsSvgStorybookCjsJs){},function(_nileIconIconsSvgSwapCjsJs){}],execute:function(){m=/*#__PURE__*/function(_r){_inherits(m,_r);var _super=_createSuper(m);function m(){var _this;_classCallCheck(this,m);_this=_super.apply(this,arguments),_this.type="normal",_this.checked=!1,_this.value="",_this.disabled=!1;return _this;}_createClass(m,[{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf(m.prototype),"connectedCallback",this).call(this),this.handleHostClick=this.handleHostClick.bind(this),this.addEventListener("click",this.handleHostClick);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_get(_getPrototypeOf(m.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("click",this.handleHostClick);}},{key:"handleDefaultSlotChange",value:function handleDefaultSlotChange(){var i=this.getTextLabel();void 0!==this.cachedTextLabel?i!==this.cachedTextLabel&&(this.cachedTextLabel=i,this.emit("slotchange",{bubbles:!0,composed:!1,cancelable:!1})):this.cachedTextLabel=i;}},{key:"handleHostClick",value:function handleHostClick(i){this.disabled&&(i.preventDefault(),i.stopImmediatePropagation());}},{key:"handleCheckedChange",value:function handleCheckedChange(){if(this.checked&&"checkbox"!==this.type)return this.checked=!1,void console.error('The checked attribute can only be used on menu items with type="checkbox"',this);"checkbox"===this.type?this.setAttribute("aria-checked",this.checked?"true":"false"):this.removeAttribute("aria-checked");}},{key:"handleDisabledChange",value:function handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false");}},{key:"handleTypeChange",value:function handleTypeChange(){"checkbox"===this.type?(this.setAttribute("role","menuitemcheckbox"),this.setAttribute("aria-checked",this.checked?"true":"false")):(this.setAttribute("role","menuitem"),this.removeAttribute("aria-checked"));}},{key:"getTextLabel",value:function getTextLabel(){return t(this.defaultSlot);}},{key:"render",value:function render(){return s(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"base\"\n class=","\n >\n <span part=\"checked-icon\" class=\"menu-item__check\">\n <nile-icon name=\"check\" library=\"system\" aria-hidden=\"true\"></nile-icon>\n </span>\n\n <slot name=\"prefix\" part=\"prefix\" class=\"menu-item__prefix\"></slot>\n\n <slot part=\"label\" class=\"menu-item__label\" @slotchange=","></slot>\n\n <slot name=\"suffix\" part=\"suffix\" class=\"menu-item__suffix\"></slot>\n\n <span part=\"submenu-icon\" class=\"menu-item__chevron\">\n <nile-icon name=\"chevron-right\" library=\"system\" aria-hidden=\"true\"></nile-icon>\n </span>\n </div>\n "])),e({"menu-item":!0,"menu-item--checked":this.checked,"menu-item--disabled":this.disabled,"menu-item--has-submenu":!1}),this.handleDefaultSlotChange);}}]);return m;}(r);m.styles=c,i([o("slot:not([name])")],m.prototype,"defaultSlot",void 0),i([o(".menu-item")],m.prototype,"menuItem",void 0),i([l()],m.prototype,"type",void 0),i([l({type:Boolean,reflect:!0})],m.prototype,"checked",void 0),i([l()],m.prototype,"value",void 0),i([l({type:Boolean,reflect:!0})],m.prototype,"disabled",void 0),i([j("checked")],m.prototype,"handleCheckedChange",null),i([j("disabled")],m.prototype,"handleDisabledChange",null),i([j("type")],m.prototype,"handleTypeChange",null),m=i([n("nile-menu-item")],m);}};});
|
1
|
+
System.register(["tslib","../index-adad7634.cjs.js","lit/decorators.js","./nile-menu-item.css.cjs.js","../nile-icon/index.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","lit/directives/unsafe-svg.js","lit/directives/unsafe-html.js","../nile-icon/icons/svg/index.cjs.js","../nile-icon/icons/svg/access-review.cjs.js","../nile-icon/icons/svg/action.cjs.js","../nile-icon/icons/svg/actionworkflow.cjs.js","../nile-icon/icons/svg/agents.cjs.js","../nile-icon/icons/svg/aggregation.cjs.js","../nile-icon/icons/svg/allsearch.cjs.js","../nile-icon/icons/svg/application.cjs.js","../nile-icon/icons/svg/approve.cjs.js","../nile-icon/icons/svg/arrowdown.cjs.js","../nile-icon/icons/svg/arrowleft.cjs.js","../nile-icon/icons/svg/arrowright.cjs.js","../nile-icon/icons/svg/arrowup.cjs.js","../nile-icon/icons/svg/attributemap.cjs.js","../nile-icon/icons/svg/bell.cjs.js","../nile-icon/icons/svg/boolean.cjs.js","../nile-icon/icons/svg/bulk-sync.cjs.js","../nile-icon/icons/svg/button-loading-black.cjs.js","../nile-icon/icons/svg/button-loading-blue.cjs.js","../nile-icon/icons/svg/button-loading-white.cjs.js","../nile-icon/icons/svg/calendar.cjs.js","../nile-icon/icons/svg/caution.cjs.js","../nile-icon/icons/svg/close.cjs.js","../nile-icon/icons/svg/collapse-1.cjs.js","../nile-icon/icons/svg/collapse.cjs.js","../nile-icon/icons/svg/compact.cjs.js","../nile-icon/icons/svg/compare-tiles.cjs.js","../nile-icon/icons/svg/component-menu.cjs.js","../nile-icon/icons/svg/connect.cjs.js","../nile-icon/icons/svg/copy.cjs.js","../nile-icon/icons/svg/correlation.cjs.js","../nile-icon/icons/svg/dashboard.cjs.js","../nile-icon/icons/svg/database.cjs.js","../nile-icon/icons/svg/databaseview.cjs.js","../nile-icon/icons/svg/default-1.cjs.js","../nile-icon/icons/svg/default.cjs.js","../nile-icon/icons/svg/directory.cjs.js","../nile-icon/icons/svg/disabled.cjs.js","../nile-icon/icons/svg/document.cjs.js","../nile-icon/icons/svg/done.cjs.js","../nile-icon/icons/svg/download.cjs.js","../nile-icon/icons/svg/drag.cjs.js","../nile-icon/icons/svg/draglist.cjs.js","../nile-icon/icons/svg/enable.cjs.js","../nile-icon/icons/svg/entitlement.cjs.js","../nile-icon/icons/svg/error.cjs.js","../nile-icon/icons/svg/escalate.cjs.js","../nile-icon/icons/svg/event.cjs.js","../nile-icon/icons/svg/exactmatch.cjs.js","../nile-icon/icons/svg/expand-1.cjs.js","../nile-icon/icons/svg/expand.cjs.js","../nile-icon/icons/svg/eye.cjs.js","../nile-icon/icons/svg/eyeclosed.cjs.js","../nile-icon/icons/svg/filter.cjs.js","../nile-icon/icons/svg/firewall.cjs.js","../nile-icon/icons/svg/flow-h.cjs.js","../nile-icon/icons/svg/flow.cjs.js","../nile-icon/icons/svg/flowmap.cjs.js","../nile-icon/icons/svg/folder.cjs.js","../nile-icon/icons/svg/frequency.cjs.js","../nile-icon/icons/svg/fullscreen.cjs.js","../nile-icon/icons/svg/fullscreenshrink.cjs.js","../nile-icon/icons/svg/generation-phase.cjs.js","../nile-icon/icons/svg/global-search.cjs.js","../nile-icon/icons/svg/goto.cjs.js","../nile-icon/icons/svg/groupby.cjs.js","../nile-icon/icons/svg/guide.cjs.js","../nile-icon/icons/svg/helpsupport.cjs.js","../nile-icon/icons/svg/help-1.cjs.js","../nile-icon/icons/svg/help.cjs.js","../nile-icon/icons/svg/history.cjs.js","../nile-icon/icons/svg/identityledger.cjs.js","../nile-icon/icons/svg/ifelse.cjs.js","../nile-icon/icons/svg/image.cjs.js","../nile-icon/icons/svg/info.cjs.js","../nile-icon/icons/svg/info2.cjs.js","../nile-icon/icons/svg/js.cjs.js","../nile-icon/icons/svg/link.cjs.js","../nile-icon/icons/svg/loader.cjs.js","../nile-icon/icons/svg/loading.cjs.js","../nile-icon/icons/svg/loading2.cjs.js","../nile-icon/icons/svg/lock.cjs.js","../nile-icon/icons/svg/logs.cjs.js","../nile-icon/icons/svg/manage.cjs.js","../nile-icon/icons/svg/map.cjs.js","../nile-icon/icons/svg/mapcreate.cjs.js","../nile-icon/icons/svg/mapdont.cjs.js","../nile-icon/icons/svg/mapupdate.cjs.js","../nile-icon/icons/svg/maximize.cjs.js","../nile-icon/icons/svg/minus.cjs.js","../nile-icon/icons/svg/moveleft.cjs.js","../nile-icon/icons/svg/moveright.cjs.js","../nile-icon/icons/svg/mute.cjs.js","../nile-icon/icons/svg/nomatch.cjs.js","../nile-icon/icons/svg/not.cjs.js","../nile-icon/icons/svg/note.cjs.js","../nile-icon/icons/svg/notificationadd.cjs.js","../nile-icon/icons/svg/notificationadded.cjs.js","../nile-icon/icons/svg/null.cjs.js","../nile-icon/icons/svg/number.cjs.js","../nile-icon/icons/svg/options.cjs.js","../nile-icon/icons/svg/orchestration.cjs.js","../nile-icon/icons/svg/partner.cjs.js","../nile-icon/icons/svg/pencil.cjs.js","../nile-icon/icons/svg/people-task.cjs.js","../nile-icon/icons/svg/pin.cjs.js","../nile-icon/icons/svg/plus.cjs.js","../nile-icon/icons/svg/potentialmatch.cjs.js","../nile-icon/icons/svg/poweron.cjs.js","../nile-icon/icons/svg/privilage.cjs.js","../nile-icon/icons/svg/radio.cjs.js","../nile-icon/icons/svg/radioactive.cjs.js","../nile-icon/icons/svg/radiodone.cjs.js","../nile-icon/icons/svg/readexpression.cjs.js","../nile-icon/icons/svg/readonly.cjs.js","../nile-icon/icons/svg/redo.cjs.js","../nile-icon/icons/svg/refresh.cjs.js","../nile-icon/icons/svg/reminder.cjs.js","../nile-icon/icons/svg/resource.cjs.js","../nile-icon/icons/svg/revokation-cycle.cjs.js","../nile-icon/icons/svg/role.cjs.js","../nile-icon/icons/svg/run.cjs.js","../nile-icon/icons/svg/save.cjs.js","../nile-icon/icons/svg/schedule.cjs.js","../nile-icon/icons/svg/script.cjs.js","../nile-icon/icons/svg/search.cjs.js","../nile-icon/icons/svg/select.cjs.js","../nile-icon/icons/svg/selectapplication.cjs.js","../nile-icon/icons/svg/selectattributes.cjs.js","../nile-icon/icons/svg/selectuser.cjs.js","../nile-icon/icons/svg/send.cjs.js","../nile-icon/icons/svg/settings.cjs.js","../nile-icon/icons/svg/sort.cjs.js","../nile-icon/icons/svg/stop.cjs.js","../nile-icon/icons/svg/string.cjs.js","../nile-icon/icons/svg/sync.cjs.js","../nile-icon/icons/svg/test.cjs.js","../nile-icon/icons/svg/textarea-expander.cjs.js","../nile-icon/icons/svg/tick.cjs.js","../nile-icon/icons/svg/timeupdate.cjs.js","../nile-icon/icons/svg/timezone.cjs.js","../nile-icon/icons/svg/trash.cjs.js","../nile-icon/icons/svg/undo-1.cjs.js","../nile-icon/icons/svg/undo.cjs.js","../nile-icon/icons/svg/unmute.cjs.js","../nile-icon/icons/svg/upgrade.cjs.js","../nile-icon/icons/svg/upload.cjs.js","../nile-icon/icons/svg/user-group.cjs.js","../nile-icon/icons/svg/user.cjs.js","../nile-icon/icons/svg/useractive.cjs.js","../nile-icon/icons/svg/useradd.cjs.js","../nile-icon/icons/svg/useraddgroup.cjs.js","../nile-icon/icons/svg/userfind.cjs.js","../nile-icon/icons/svg/userimport.cjs.js","../nile-icon/icons/svg/userimportgroup.cjs.js","../nile-icon/icons/svg/usermixed.cjs.js","../nile-icon/icons/svg/userremove-1.cjs.js","../nile-icon/icons/svg/userremove-2.cjs.js","../nile-icon/icons/svg/userremove.cjs.js","../nile-icon/icons/svg/userremovegroup.cjs.js","../nile-icon/icons/svg/userupdate.cjs.js","../nile-icon/icons/svg/users.cjs.js","../nile-icon/icons/svg/validationexpression.cjs.js","../nile-icon/icons/svg/variable-new-1.cjs.js","../nile-icon/icons/svg/variable-new.cjs.js","../nile-icon/icons/svg/variable-global.cjs.js","../nile-icon/icons/svg/variable-local-1.cjs.js","../nile-icon/icons/svg/variable-local.cjs.js","../nile-icon/icons/svg/variable.cjs.js","../nile-icon/icons/svg/video.cjs.js","../nile-icon/icons/svg/warning.cjs.js","../nile-icon/icons/svg/whileloop.cjs.js","../nile-icon/icons/svg/workflow.cjs.js","../nile-icon/icons/svg/writeexpression.cjs.js","../nile-icon/icons/svg/back.cjs.js","../nile-icon/icons/svg/downgrade.cjs.js","../nile-icon/icons/svg/globe.cjs.js","../nile-icon/icons/svg/phone.cjs.js","../nile-icon/icons/svg/storybook.cjs.js","../nile-icon/icons/svg/swap.cjs.js"],function(_export,_context){"use strict";var i,s,o,n,c,e,t,j,r,l,_templateObject,m;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}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){i=_tslib.__decorate;},function(_index001CjsJs){s=_index001CjsJs.y;},function(_litDecoratorsJs){o=_litDecoratorsJs.query;n=_litDecoratorsJs.customElement;},function(_nileMenuItemCssCjsJs){c=_nileMenuItemCssCjsJs.s;},function(_nileIconIndexCjsJs){},function(_litDirectivesClassMapJs){e=_litDirectivesClassMapJs.classMap;},function(_internalSlotCjsJs){t=_internalSlotCjsJs.g;},function(_internalWatchCjsJs){j=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_property002CjsJs){l=_property002CjsJs.e;},function(_lit){},function(_litDirectivesUnsafeSvgJs){},function(_litDirectivesUnsafeHtmlJs){},function(_nileIconIconsSvgIndexCjsJs){},function(_nileIconIconsSvgAccessReviewCjsJs){},function(_nileIconIconsSvgActionCjsJs){},function(_nileIconIconsSvgActionworkflowCjsJs){},function(_nileIconIconsSvgAgentsCjsJs){},function(_nileIconIconsSvgAggregationCjsJs){},function(_nileIconIconsSvgAllsearchCjsJs){},function(_nileIconIconsSvgApplicationCjsJs){},function(_nileIconIconsSvgApproveCjsJs){},function(_nileIconIconsSvgArrowdownCjsJs){},function(_nileIconIconsSvgArrowleftCjsJs){},function(_nileIconIconsSvgArrowrightCjsJs){},function(_nileIconIconsSvgArrowupCjsJs){},function(_nileIconIconsSvgAttributemapCjsJs){},function(_nileIconIconsSvgBellCjsJs){},function(_nileIconIconsSvgBooleanCjsJs){},function(_nileIconIconsSvgBulkSyncCjsJs){},function(_nileIconIconsSvgButtonLoadingBlackCjsJs){},function(_nileIconIconsSvgButtonLoadingBlueCjsJs){},function(_nileIconIconsSvgButtonLoadingWhiteCjsJs){},function(_nileIconIconsSvgCalendarCjsJs){},function(_nileIconIconsSvgCautionCjsJs){},function(_nileIconIconsSvgCloseCjsJs){},function(_nileIconIconsSvgCollapse1CjsJs){},function(_nileIconIconsSvgCollapseCjsJs){},function(_nileIconIconsSvgCompactCjsJs){},function(_nileIconIconsSvgCompareTilesCjsJs){},function(_nileIconIconsSvgComponentMenuCjsJs){},function(_nileIconIconsSvgConnectCjsJs){},function(_nileIconIconsSvgCopyCjsJs){},function(_nileIconIconsSvgCorrelationCjsJs){},function(_nileIconIconsSvgDashboardCjsJs){},function(_nileIconIconsSvgDatabaseCjsJs){},function(_nileIconIconsSvgDatabaseviewCjsJs){},function(_nileIconIconsSvgDefault1CjsJs){},function(_nileIconIconsSvgDefaultCjsJs){},function(_nileIconIconsSvgDirectoryCjsJs){},function(_nileIconIconsSvgDisabledCjsJs){},function(_nileIconIconsSvgDocumentCjsJs){},function(_nileIconIconsSvgDoneCjsJs){},function(_nileIconIconsSvgDownloadCjsJs){},function(_nileIconIconsSvgDragCjsJs){},function(_nileIconIconsSvgDraglistCjsJs){},function(_nileIconIconsSvgEnableCjsJs){},function(_nileIconIconsSvgEntitlementCjsJs){},function(_nileIconIconsSvgErrorCjsJs){},function(_nileIconIconsSvgEscalateCjsJs){},function(_nileIconIconsSvgEventCjsJs){},function(_nileIconIconsSvgExactmatchCjsJs){},function(_nileIconIconsSvgExpand1CjsJs){},function(_nileIconIconsSvgExpandCjsJs){},function(_nileIconIconsSvgEyeCjsJs){},function(_nileIconIconsSvgEyeclosedCjsJs){},function(_nileIconIconsSvgFilterCjsJs){},function(_nileIconIconsSvgFirewallCjsJs){},function(_nileIconIconsSvgFlowHCjsJs){},function(_nileIconIconsSvgFlowCjsJs){},function(_nileIconIconsSvgFlowmapCjsJs){},function(_nileIconIconsSvgFolderCjsJs){},function(_nileIconIconsSvgFrequencyCjsJs){},function(_nileIconIconsSvgFullscreenCjsJs){},function(_nileIconIconsSvgFullscreenshrinkCjsJs){},function(_nileIconIconsSvgGenerationPhaseCjsJs){},function(_nileIconIconsSvgGlobalSearchCjsJs){},function(_nileIconIconsSvgGotoCjsJs){},function(_nileIconIconsSvgGroupbyCjsJs){},function(_nileIconIconsSvgGuideCjsJs){},function(_nileIconIconsSvgHelpsupportCjsJs){},function(_nileIconIconsSvgHelp1CjsJs){},function(_nileIconIconsSvgHelpCjsJs){},function(_nileIconIconsSvgHistoryCjsJs){},function(_nileIconIconsSvgIdentityledgerCjsJs){},function(_nileIconIconsSvgIfelseCjsJs){},function(_nileIconIconsSvgImageCjsJs){},function(_nileIconIconsSvgInfoCjsJs){},function(_nileIconIconsSvgInfo2CjsJs){},function(_nileIconIconsSvgJsCjsJs){},function(_nileIconIconsSvgLinkCjsJs){},function(_nileIconIconsSvgLoaderCjsJs){},function(_nileIconIconsSvgLoadingCjsJs){},function(_nileIconIconsSvgLoading2CjsJs){},function(_nileIconIconsSvgLockCjsJs){},function(_nileIconIconsSvgLogsCjsJs){},function(_nileIconIconsSvgManageCjsJs){},function(_nileIconIconsSvgMapCjsJs){},function(_nileIconIconsSvgMapcreateCjsJs){},function(_nileIconIconsSvgMapdontCjsJs){},function(_nileIconIconsSvgMapupdateCjsJs){},function(_nileIconIconsSvgMaximizeCjsJs){},function(_nileIconIconsSvgMinusCjsJs){},function(_nileIconIconsSvgMoveleftCjsJs){},function(_nileIconIconsSvgMoverightCjsJs){},function(_nileIconIconsSvgMuteCjsJs){},function(_nileIconIconsSvgNomatchCjsJs){},function(_nileIconIconsSvgNotCjsJs){},function(_nileIconIconsSvgNoteCjsJs){},function(_nileIconIconsSvgNotificationaddCjsJs){},function(_nileIconIconsSvgNotificationaddedCjsJs){},function(_nileIconIconsSvgNullCjsJs){},function(_nileIconIconsSvgNumberCjsJs){},function(_nileIconIconsSvgOptionsCjsJs){},function(_nileIconIconsSvgOrchestrationCjsJs){},function(_nileIconIconsSvgPartnerCjsJs){},function(_nileIconIconsSvgPencilCjsJs){},function(_nileIconIconsSvgPeopleTaskCjsJs){},function(_nileIconIconsSvgPinCjsJs){},function(_nileIconIconsSvgPlusCjsJs){},function(_nileIconIconsSvgPotentialmatchCjsJs){},function(_nileIconIconsSvgPoweronCjsJs){},function(_nileIconIconsSvgPrivilageCjsJs){},function(_nileIconIconsSvgRadioCjsJs){},function(_nileIconIconsSvgRadioactiveCjsJs){},function(_nileIconIconsSvgRadiodoneCjsJs){},function(_nileIconIconsSvgReadexpressionCjsJs){},function(_nileIconIconsSvgReadonlyCjsJs){},function(_nileIconIconsSvgRedoCjsJs){},function(_nileIconIconsSvgRefreshCjsJs){},function(_nileIconIconsSvgReminderCjsJs){},function(_nileIconIconsSvgResourceCjsJs){},function(_nileIconIconsSvgRevokationCycleCjsJs){},function(_nileIconIconsSvgRoleCjsJs){},function(_nileIconIconsSvgRunCjsJs){},function(_nileIconIconsSvgSaveCjsJs){},function(_nileIconIconsSvgScheduleCjsJs){},function(_nileIconIconsSvgScriptCjsJs){},function(_nileIconIconsSvgSearchCjsJs){},function(_nileIconIconsSvgSelectCjsJs){},function(_nileIconIconsSvgSelectapplicationCjsJs){},function(_nileIconIconsSvgSelectattributesCjsJs){},function(_nileIconIconsSvgSelectuserCjsJs){},function(_nileIconIconsSvgSendCjsJs){},function(_nileIconIconsSvgSettingsCjsJs){},function(_nileIconIconsSvgSortCjsJs){},function(_nileIconIconsSvgStopCjsJs){},function(_nileIconIconsSvgStringCjsJs){},function(_nileIconIconsSvgSyncCjsJs){},function(_nileIconIconsSvgTestCjsJs){},function(_nileIconIconsSvgTextareaExpanderCjsJs){},function(_nileIconIconsSvgTickCjsJs){},function(_nileIconIconsSvgTimeupdateCjsJs){},function(_nileIconIconsSvgTimezoneCjsJs){},function(_nileIconIconsSvgTrashCjsJs){},function(_nileIconIconsSvgUndo1CjsJs){},function(_nileIconIconsSvgUndoCjsJs){},function(_nileIconIconsSvgUnmuteCjsJs){},function(_nileIconIconsSvgUpgradeCjsJs){},function(_nileIconIconsSvgUploadCjsJs){},function(_nileIconIconsSvgUserGroupCjsJs){},function(_nileIconIconsSvgUserCjsJs){},function(_nileIconIconsSvgUseractiveCjsJs){},function(_nileIconIconsSvgUseraddCjsJs){},function(_nileIconIconsSvgUseraddgroupCjsJs){},function(_nileIconIconsSvgUserfindCjsJs){},function(_nileIconIconsSvgUserimportCjsJs){},function(_nileIconIconsSvgUserimportgroupCjsJs){},function(_nileIconIconsSvgUsermixedCjsJs){},function(_nileIconIconsSvgUserremove1CjsJs){},function(_nileIconIconsSvgUserremove2CjsJs){},function(_nileIconIconsSvgUserremoveCjsJs){},function(_nileIconIconsSvgUserremovegroupCjsJs){},function(_nileIconIconsSvgUserupdateCjsJs){},function(_nileIconIconsSvgUsersCjsJs){},function(_nileIconIconsSvgValidationexpressionCjsJs){},function(_nileIconIconsSvgVariableNew1CjsJs){},function(_nileIconIconsSvgVariableNewCjsJs){},function(_nileIconIconsSvgVariableGlobalCjsJs){},function(_nileIconIconsSvgVariableLocal1CjsJs){},function(_nileIconIconsSvgVariableLocalCjsJs){},function(_nileIconIconsSvgVariableCjsJs){},function(_nileIconIconsSvgVideoCjsJs){},function(_nileIconIconsSvgWarningCjsJs){},function(_nileIconIconsSvgWhileloopCjsJs){},function(_nileIconIconsSvgWorkflowCjsJs){},function(_nileIconIconsSvgWriteexpressionCjsJs){},function(_nileIconIconsSvgBackCjsJs){},function(_nileIconIconsSvgDowngradeCjsJs){},function(_nileIconIconsSvgGlobeCjsJs){},function(_nileIconIconsSvgPhoneCjsJs){},function(_nileIconIconsSvgStorybookCjsJs){},function(_nileIconIconsSvgSwapCjsJs){}],execute:function(){m=/*#__PURE__*/function(_r){_inherits(m,_r);var _super=_createSuper(m);function m(){var _this;_classCallCheck(this,m);_this=_super.apply(this,arguments),_this.type="normal",_this.checked=!1,_this.value="",_this.disabled=!1;return _this;}_createClass(m,[{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf(m.prototype),"connectedCallback",this).call(this),this.handleHostClick=this.handleHostClick.bind(this),this.addEventListener("click",this.handleHostClick);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_get(_getPrototypeOf(m.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("click",this.handleHostClick);}},{key:"handleDefaultSlotChange",value:function handleDefaultSlotChange(){var i=this.getTextLabel();void 0!==this.cachedTextLabel?i!==this.cachedTextLabel&&(this.cachedTextLabel=i,this.emit("slotchange",{bubbles:!0,composed:!1,cancelable:!1})):this.cachedTextLabel=i;}},{key:"handleHostClick",value:function handleHostClick(i){this.disabled&&(i.preventDefault(),i.stopImmediatePropagation());}},{key:"handleCheckedChange",value:function handleCheckedChange(){if(this.checked&&"checkbox"!==this.type)return this.checked=!1,void console.error('The checked attribute can only be used on menu items with type="checkbox"',this);"checkbox"===this.type?this.setAttribute("aria-checked",this.checked?"true":"false"):this.removeAttribute("aria-checked");}},{key:"handleDisabledChange",value:function handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false");}},{key:"handleTypeChange",value:function handleTypeChange(){"checkbox"===this.type?(this.setAttribute("role","menuitemcheckbox"),this.setAttribute("aria-checked",this.checked?"true":"false")):(this.setAttribute("role","menuitem"),this.removeAttribute("aria-checked"));}},{key:"getTextLabel",value:function getTextLabel(){return t(this.defaultSlot);}},{key:"render",value:function render(){return s(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"base\"\n class=","\n >\n <span part=\"checked-icon\" class=\"menu-item__check\">\n <nile-icon name=\"tick\" library=\"system\" aria-hidden=\"true\"></nile-icon>\n </span>\n\n <slot name=\"prefix\" part=\"prefix\" class=\"menu-item__prefix\"></slot>\n\n <slot part=\"label\" class=\"menu-item__label\" @slotchange=","></slot>\n\n <slot name=\"suffix\" part=\"suffix\" class=\"menu-item__suffix\"></slot>\n\n <span part=\"submenu-icon\" class=\"menu-item__chevron\">\n <nile-icon name=\"arrowright\" library=\"system\" aria-hidden=\"true\"></nile-icon>\n </span>\n </div>\n "])),e({"menu-item":!0,"menu-item--checked":this.checked,"menu-item--disabled":this.disabled,"menu-item--has-submenu":!1}),this.handleDefaultSlotChange);}}]);return m;}(r);m.styles=c,i([o("slot:not([name])")],m.prototype,"defaultSlot",void 0),i([o(".menu-item")],m.prototype,"menuItem",void 0),i([l()],m.prototype,"type",void 0),i([l({type:Boolean,reflect:!0})],m.prototype,"checked",void 0),i([l()],m.prototype,"value",void 0),i([l({type:Boolean,reflect:!0})],m.prototype,"disabled",void 0),i([j("checked")],m.prototype,"handleCheckedChange",null),i([j("disabled")],m.prototype,"handleDisabledChange",null),i([j("type")],m.prototype,"handleTypeChange",null),m=i([n("nile-menu-item")],m);}};});
|
2
2
|
//# sourceMappingURL=nile-menu-item.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-menu-item.cjs.js","sources":["../../../src/nile-menu-item/nile-menu-item.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 {LitElement, html, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport {styles} from './nile-menu-item.css';\nimport '../nile-icon';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport { getTextContent } from '../internal/slot';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\n/**\n * Nile icon component.\n *\n * @tag nile-menu-item\n *\n * @summary Menu items provide options for the user to pick from in a menu.\n * @status stable\n * @since 2.0\n *\n * @dependency nile-icon\n *\n * @slot - The menu item's label.\n * @slot prefix - Used to prepend an icon or similar element to the menu item.\n * @slot suffix - Used to append an icon or similar element to the menu item.\n *\n * @csspart base - The component's base wrapper.\n * @csspart checked-icon - The checked icon, which is only visible when the menu item is checked.\n * @csspart prefix - The prefix container.\n * @csspart label - The menu item label.\n * @csspart suffix - The suffix container.\n * @csspart submenu-icon - The submenu icon, visible only when the menu item has a submenu (not yet implemented).\n */\n\n@customElement('nile-menu-item')\nexport class NileMenuItem extends NileElement {\n static styles: CSSResultGroup = styles;\n\n private cachedTextLabel: string;\n\n @query('slot:not([name])') defaultSlot: HTMLSlotElement;\n\n @query('.menu-item') menuItem: HTMLElement;\n\n /** The type of menu item to render. To use `checked`, this value must be set to `checkbox`. */\n @property() type: 'normal' | 'checkbox' = 'normal';\n\n /** Draws the item in a checked state. */\n @property({ type: Boolean, reflect: true }) checked = false;\n\n /** A unique value to store in the menu item. This can be used as a way to identify menu items when selected. */\n @property() value = '';\n\n /** Draws the menu item in a disabled state, preventing selection. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.handleHostClick = this.handleHostClick.bind(this);\n this.addEventListener('click', this.handleHostClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.handleHostClick);\n }\n\n private handleDefaultSlotChange() {\n const textLabel = this.getTextLabel();\n\n // Ignore the first time the label is set\n if (typeof this.cachedTextLabel === 'undefined') {\n this.cachedTextLabel = textLabel;\n return;\n }\n\n // When the label changes, emit a slotchange event so parent controls see it\n if (textLabel !== this.cachedTextLabel) {\n this.cachedTextLabel = textLabel;\n this.emit('slotchange', { bubbles: true, composed: false, cancelable: false });\n }\n }\n\n private handleHostClick(event: MouseEvent) {\n // Prevent the click event from being emitted when the button is disabled or loading\n if (this.disabled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n\n @watch('checked')\n handleCheckedChange() {\n // For proper accessibility, users have to use type=\"checkbox\" to use the checked attribute\n if (this.checked && this.type !== 'checkbox') {\n this.checked = false;\n console.error('The checked attribute can only be used on menu items with type=\"checkbox\"', this);\n return;\n }\n\n // Only checkbox types can receive the aria-checked attribute\n if (this.type === 'checkbox') {\n this.setAttribute('aria-checked', this.checked ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-checked');\n }\n }\n\n @watch('disabled')\n handleDisabledChange() {\n this.setAttribute('aria-disabled', this.disabled ? 'true' : 'false');\n }\n\n @watch('type')\n handleTypeChange() {\n if (this.type === 'checkbox') {\n this.setAttribute('role', 'menuitemcheckbox');\n this.setAttribute('aria-checked', this.checked ? 'true' : 'false');\n } else {\n this.setAttribute('role', 'menuitem');\n this.removeAttribute('aria-checked');\n }\n }\n\n /** Returns a text label based on the contents of the menu item's default slot. */\n getTextLabel() {\n return getTextContent(this.defaultSlot);\n }\n\n render() {\n return html`\n <div\n part=\"base\"\n class=${classMap({\n 'menu-item': true,\n 'menu-item--checked': this.checked,\n 'menu-item--disabled': this.disabled,\n 'menu-item--has-submenu': false // reserved for future use\n })}\n >\n <span part=\"checked-icon\" class=\"menu-item__check\">\n <nile-icon name=\"
|
1
|
+
{"version":3,"file":"nile-menu-item.cjs.js","sources":["../../../src/nile-menu-item/nile-menu-item.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 {LitElement, html, property, CSSResultArray, TemplateResult} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport {styles} from './nile-menu-item.css';\nimport '../nile-icon';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport { getTextContent } from '../internal/slot';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\n/**\n * Nile icon component.\n *\n * @tag nile-menu-item\n *\n * @summary Menu items provide options for the user to pick from in a menu.\n * @status stable\n * @since 2.0\n *\n * @dependency nile-icon\n *\n * @slot - The menu item's label.\n * @slot prefix - Used to prepend an icon or similar element to the menu item.\n * @slot suffix - Used to append an icon or similar element to the menu item.\n *\n * @csspart base - The component's base wrapper.\n * @csspart checked-icon - The checked icon, which is only visible when the menu item is checked.\n * @csspart prefix - The prefix container.\n * @csspart label - The menu item label.\n * @csspart suffix - The suffix container.\n * @csspart submenu-icon - The submenu icon, visible only when the menu item has a submenu (not yet implemented).\n */\n\n@customElement('nile-menu-item')\nexport class NileMenuItem extends NileElement {\n static styles: CSSResultGroup = styles;\n\n private cachedTextLabel: string;\n\n @query('slot:not([name])') defaultSlot: HTMLSlotElement;\n\n @query('.menu-item') menuItem: HTMLElement;\n\n /** The type of menu item to render. To use `checked`, this value must be set to `checkbox`. */\n @property() type: 'normal' | 'checkbox' = 'normal';\n\n /** Draws the item in a checked state. */\n @property({ type: Boolean, reflect: true }) checked = false;\n\n /** A unique value to store in the menu item. This can be used as a way to identify menu items when selected. */\n @property() value = '';\n\n /** Draws the menu item in a disabled state, preventing selection. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.handleHostClick = this.handleHostClick.bind(this);\n this.addEventListener('click', this.handleHostClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.handleHostClick);\n }\n\n private handleDefaultSlotChange() {\n const textLabel = this.getTextLabel();\n\n // Ignore the first time the label is set\n if (typeof this.cachedTextLabel === 'undefined') {\n this.cachedTextLabel = textLabel;\n return;\n }\n\n // When the label changes, emit a slotchange event so parent controls see it\n if (textLabel !== this.cachedTextLabel) {\n this.cachedTextLabel = textLabel;\n this.emit('slotchange', { bubbles: true, composed: false, cancelable: false });\n }\n }\n\n private handleHostClick(event: MouseEvent) {\n // Prevent the click event from being emitted when the button is disabled or loading\n if (this.disabled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n\n @watch('checked')\n handleCheckedChange() {\n // For proper accessibility, users have to use type=\"checkbox\" to use the checked attribute\n if (this.checked && this.type !== 'checkbox') {\n this.checked = false;\n console.error('The checked attribute can only be used on menu items with type=\"checkbox\"', this);\n return;\n }\n\n // Only checkbox types can receive the aria-checked attribute\n if (this.type === 'checkbox') {\n this.setAttribute('aria-checked', this.checked ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-checked');\n }\n }\n\n @watch('disabled')\n handleDisabledChange() {\n this.setAttribute('aria-disabled', this.disabled ? 'true' : 'false');\n }\n\n @watch('type')\n handleTypeChange() {\n if (this.type === 'checkbox') {\n this.setAttribute('role', 'menuitemcheckbox');\n this.setAttribute('aria-checked', this.checked ? 'true' : 'false');\n } else {\n this.setAttribute('role', 'menuitem');\n this.removeAttribute('aria-checked');\n }\n }\n\n /** Returns a text label based on the contents of the menu item's default slot. */\n getTextLabel() {\n return getTextContent(this.defaultSlot);\n }\n\n render() {\n return html`\n <div\n part=\"base\"\n class=${classMap({\n 'menu-item': true,\n 'menu-item--checked': this.checked,\n 'menu-item--disabled': this.disabled,\n 'menu-item--has-submenu': false // reserved for future use\n })}\n >\n <span part=\"checked-icon\" class=\"menu-item__check\">\n <nile-icon name=\"tick\" library=\"system\" aria-hidden=\"true\"></nile-icon>\n </span>\n\n <slot name=\"prefix\" part=\"prefix\" class=\"menu-item__prefix\"></slot>\n\n <slot part=\"label\" class=\"menu-item__label\" @slotchange=${this.handleDefaultSlotChange}></slot>\n\n <slot name=\"suffix\" part=\"suffix\" class=\"menu-item__suffix\"></slot>\n\n <span part=\"submenu-icon\" class=\"menu-item__chevron\">\n <nile-icon name=\"arrowright\" library=\"system\" aria-hidden=\"true\"></nile-icon>\n </span>\n </div>\n `;\n }\n}\n\nexport default NileMenuItem;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-menu-item': NileMenuItem;\n }\n}\n"],"names":["NileMenuItem","constructor","this","type","checked","value","disabled","connectedCallback","super","handleHostClick","bind","addEventListener","disconnectedCallback","removeEventListener","handleDefaultSlotChange","textLabel","getTextLabel","cachedTextLabel","emit","bubbles","composed","cancelable","event","preventDefault","stopImmediatePropagation","handleCheckedChange","console","error","setAttribute","removeAttribute","handleDisabledChange","handleTypeChange","getTextContent","defaultSlot","render","html","classMap","NileElement","styles","__decorate","query","prototype","property","Boolean","reflect","watch","customElement"],"mappings":"unnBAyCaA,uEAAbC,kFAUcC,MAAIC,IAAAA,CAA0B,SAGED,MAAOE,OAAAA,CAAAA,CAAG,EAG1CF,MAAKG,KAAAA,CAAG,GAGwBH,MAAQI,QAAAA,CAAAA,CAAG,CAsGxD,eApGCC,4EACEC,uEACAN,KAAKO,eAAkBP,CAAAA,IAAAA,CAAKO,gBAAgBC,IAAKR,CAAAA,IAAAA,CAAAA,CACjDA,IAAKS,CAAAA,gBAAAA,CAAiB,QAAST,IAAKO,CAAAA,eAAAA,CACrC,EAEDG,mEACEJ,CAAAA,0EACAN,IAAKW,CAAAA,mBAAAA,CAAoB,OAASX,CAAAA,IAAAA,CAAKO,gBACxC,EAEOK,yEAAAA,CACN,GAAMC,EAAYb,CAAAA,IAAAA,CAAKc,mBAGa,EAAzBd,GAAAA,IAAAA,CAAKe,gBAMZF,CAAcb,GAAAA,IAAAA,CAAKe,kBACrBf,IAAKe,CAAAA,eAAAA,CAAkBF,EACvBb,IAAKgB,CAAAA,IAAAA,CAAK,aAAc,CA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CADxBO,EAAc,gBACF9C,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
|
@@ -4,7 +4,7 @@ import{__decorate as i}from"tslib";import{y as s}from"../index-f1b94546.esm.js";
|
|
4
4
|
class=${c({"menu-item":!0,"menu-item--checked":this.checked,"menu-item--disabled":this.disabled,"menu-item--has-submenu":!1})}
|
5
5
|
>
|
6
6
|
<span part="checked-icon" class="menu-item__check">
|
7
|
-
<nile-icon name="
|
7
|
+
<nile-icon name="tick" library="system" aria-hidden="true"></nile-icon>
|
8
8
|
</span>
|
9
9
|
|
10
10
|
<slot name="prefix" part="prefix" class="menu-item__prefix"></slot>
|
@@ -14,7 +14,7 @@ import{__decorate as i}from"tslib";import{y as s}from"../index-f1b94546.esm.js";
|
|
14
14
|
<slot name="suffix" part="suffix" class="menu-item__suffix"></slot>
|
15
15
|
|
16
16
|
<span part="submenu-icon" class="menu-item__chevron">
|
17
|
-
<nile-icon name="
|
17
|
+
<nile-icon name="arrowright" library="system" aria-hidden="true"></nile-icon>
|
18
18
|
</span>
|
19
19
|
</div>
|
20
20
|
`}};p.styles=n,i([o("slot:not([name])")],p.prototype,"defaultSlot",void 0),i([o(".menu-item")],p.prototype,"menuItem",void 0),i([l()],p.prototype,"type",void 0),i([l({type:Boolean,reflect:!0})],p.prototype,"checked",void 0),i([l()],p.prototype,"value",void 0),i([l({type:Boolean,reflect:!0})],p.prototype,"disabled",void 0),i([t("checked")],p.prototype,"handleCheckedChange",null),i([t("disabled")],p.prototype,"handleDisabledChange",null),i([t("type")],p.prototype,"handleTypeChange",null),p=i([e("nile-menu-item")],p);
|