@aquera/nile-elements 0.0.33 → 0.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.js +2 -2
  2. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
  3. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js +30 -13
  4. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
  5. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.d.ts +2 -0
  6. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +28 -7
  7. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js.map +1 -1
  8. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
  9. package/dist/index.iife.js +58 -29
  10. package/dist/nile-code-editor/extensionSetup.cjs.js +1 -1
  11. package/dist/nile-code-editor/extensionSetup.cjs.js.map +1 -1
  12. package/dist/nile-code-editor/extensionSetup.esm.js +1 -1
  13. package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
  14. package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
  15. package/dist/nile-code-editor/nile-code-editor.esm.js +2 -2
  16. package/dist/nile-switcher/index.cjs.js +1 -1
  17. package/dist/nile-switcher/index.esm.js +1 -1
  18. package/dist/nile-switcher/nile-switcher.cjs.js +1 -1
  19. package/dist/nile-switcher/nile-switcher.cjs.js.map +1 -1
  20. package/dist/nile-switcher/nile-switcher.css.cjs.js +1 -1
  21. package/dist/nile-switcher/nile-switcher.css.cjs.js.map +1 -1
  22. package/dist/nile-switcher/nile-switcher.css.esm.js +32 -15
  23. package/dist/nile-switcher/nile-switcher.esm.js +33 -21
  24. package/dist/src/nile-code-editor/nile-code-editor.js +2 -2
  25. package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
  26. package/dist/src/nile-switcher/nile-switcher.css.js +30 -13
  27. package/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
  28. package/dist/src/nile-switcher/nile-switcher.d.ts +2 -0
  29. package/dist/src/nile-switcher/nile-switcher.js +28 -7
  30. package/dist/src/nile-switcher/nile-switcher.js.map +1 -1
  31. package/dist/tsconfig.tsbuildinfo +1 -1
  32. package/package.json +4 -2
  33. package/src/nile-code-editor/nile-code-editor.ts +8 -3
  34. package/src/nile-switcher/nile-switcher.css.ts +30 -13
  35. package/src/nile-switcher/nile-switcher.ts +30 -7
@@ -1,2 +1,2 @@
1
- System.register(["./nile-switcher.cjs.js","tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-switcher.css.cjs.js","../internal/nile-element.cjs.js","lit","lit/directives/choose.js","lit/directives/class-map.js","lit/directives/repeat.js","../internal/watch.cjs.js","../property-0f6a51ec.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileSwitcherCjsJs){_export("NileSwitcher",_nileSwitcherCjsJs.N);},function(_tslib){},function(_index001CjsJs){},function(_litDecoratorsJs){},function(_nileSwitcherCssCjsJs){},function(_internalNileElementCjsJs){},function(_lit){},function(_litDirectivesChooseJs){},function(_litDirectivesClassMapJs){},function(_litDirectivesRepeatJs){},function(_internalWatchCjsJs){},function(_property002CjsJs){}],execute:function(){}};});
1
+ System.register(["./nile-switcher.cjs.js","tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-switcher.css.cjs.js","../internal/nile-element.cjs.js","lit","lit/directives/choose.js","lit/directives/class-map.js","lit/directives/repeat.js","../internal/watch.cjs.js","../internal/slot.cjs.js","../property-0f6a51ec.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileSwitcherCjsJs){_export("NileSwitcher",_nileSwitcherCjsJs.N);},function(_tslib){},function(_index001CjsJs){},function(_litDecoratorsJs){},function(_nileSwitcherCssCjsJs){},function(_internalNileElementCjsJs){},function(_lit){},function(_litDirectivesChooseJs){},function(_litDirectivesClassMapJs){},function(_litDirectivesRepeatJs){},function(_internalWatchCjsJs){},function(_internalSlotCjsJs){},function(_property002CjsJs){}],execute:function(){}};});
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- export{N as NileSwitcher}from"./nile-switcher.esm.js";import"tslib";import"../index-cd2f9c12.esm.js";import"lit/decorators.js";import"./nile-switcher.css.esm.js";import"../internal/nile-element.esm.js";import"lit";import"lit/directives/choose.js";import"lit/directives/class-map.js";import"lit/directives/repeat.js";import"../internal/watch.esm.js";import"../property-09139d3c.esm.js";
1
+ export{N as NileSwitcher}from"./nile-switcher.esm.js";import"tslib";import"../index-cd2f9c12.esm.js";import"lit/decorators.js";import"./nile-switcher.css.esm.js";import"../internal/nile-element.esm.js";import"lit";import"lit/directives/choose.js";import"lit/directives/class-map.js";import"lit/directives/repeat.js";import"../internal/watch.esm.js";import"../internal/slot.esm.js";import"../property-09139d3c.esm.js";
@@ -1,2 +1,2 @@
1
- System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-switcher.css.cjs.js","../internal/nile-element.cjs.js","lit/directives/choose.js","lit/directives/class-map.js","lit/directives/repeat.js","../internal/watch.cjs.js","../property-0f6a51ec.cjs.js","lit"],function(_export,_context){"use strict";var e,i,t,r,s,n,o,l,c,a,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_templateObject12,_templateObject13,_templateObject14,_templateObject15,d,h,p,u,$;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){e=_tslib.__decorate;},function(_index001CjsJs){i=_index001CjsJs.x;},function(_litDecoratorsJs){t=_litDecoratorsJs.customElement;},function(_nileSwitcherCssCjsJs){r=_nileSwitcherCssCjsJs.s;},function(_internalNileElementCjsJs){s=_internalNileElementCjsJs.N;},function(_litDirectivesChooseJs){n=_litDirectivesChooseJs.choose;},function(_litDirectivesClassMapJs){o=_litDirectivesClassMapJs.classMap;},function(_litDirectivesRepeatJs){l=_litDirectivesRepeatJs.repeat;},function(_internalWatchCjsJs){c=_internalWatchCjsJs.w;},function(_property002CjsJs){a=_property002CjsJs.n;},function(_lit){}],execute:function(){!function(e){e.INLINE="inline",e.BLOCK="block";}(d||(d={})),function(e){e.DEFAULT="defaultInput",e.SWITCH="switchInput";}(h||(h={})),function(e){e.DROPDOWN="dropdown",e.TEXT="text",e.CHECKBOX="checkbox",e.TEXTAREA="text-area",e.RADIO="radio",e.CONTENTEDITOR="content-editor",e.OBJECT_MAPPER="object-mapper",e.CODE_EDITOR="code-editor";}(p||(p={})),function(e){e.CREATE="create",e.EDIT="edit";}(u||(u={}));_export("N",$=/*#__PURE__*/function(_s){_inherits($,_s);var _super=_createSuper($);function $(){var _this;_classCallCheck(this,$);_this=_super.apply(this,arguments),_this.current=0;return _this;}_createClass($,[{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf($.prototype),"connectedCallback",this).call(this),this.setCurrentInput(),this.emit("nile-init");}},{key:"handleSwitcherChange",value:function handleSwitcherChange(){this.setCurrentInput();}},{key:"setCurrentInput",value:function setCurrentInput(){var _this$nileSwitchConfi,_this2=this;((_this$nileSwitchConfi=this.nileSwitchConfig)===null||_this$nileSwitchConfi===void 0?void 0:_this$nileSwitchConfi.inputs)&&(this.currentInput=this.nileSwitchConfig.inputs.filter(function(e,i){return i===_this2.current;})[0]);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_get(_getPrototypeOf($.prototype),"disconnectedCallback",this).call(this),this.emit("nile-destroy");}},{key:"renderNileText",value:function renderNileText(e){var _this3=this;var t=e.value,r=e.label,s=e.placeholder,n=e.disabled,l=e.required,c=e.error,a=e.errorMessage,d=e.inputType,h=e.noborder;return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-input\n class=","\n .value=","\n .label=","\n .disabled=","\n .required=","\n .errorMessage=","\n .placeholder=","\n .error=","\n @nile-input=","\n ></nile-input>"])),o({"switcher-input":!0,"switcher-input--noborder":!!h}),t,r,n,l,a,s,c,function(e){_this3.handleChange(e,d);});}},{key:"renderDropdown",value:function renderDropdown(e){var _this4=this;var t=e.options,r=e.multiple,s=e.placeholder,n=e.disabled,o=e.value,l=e.error,c=e.errorMessage,a=e.inputType;return i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-select\n class=\"switcher-dropdown\"\n .placeholder=","\n .disabled=\"","\"\n .multiple=\"","\"\n .value=\"","\"\n .error=\"","\"\n .errorMessage=\"","\"\n @nile-change=","\n >\n ","\n </nile-select>"])),s,n,r,o,l,c,function(e){_this4.handleChange(e,a);},t===null||t===void 0?void 0:t.map(function(e){return i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-option .value=\"","\">"," </nile-option>"])),e,e);}));}},{key:"renderNileTextArea",value:function renderNileTextArea(e){var _this5=this;var t=e.value,r=e.disabled,s=e.readonly,n=e.errorMessage,o=e.error,l=e.inputType;return i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-textarea\n class=\"switcher-textarea\"\n .value=","\n .disabled=","\n ?readonly=","\n .error=","\n .errorMessage=","\n @nile-input=","\n ></nile-textarea>"])),t,r,s,o,n,function(e){_this5.handleChange(e,l);});}},{key:"renderNileCheckBox",value:function renderNileCheckBox(e){var _this6=this;var t=e.value,r=e.label,s=e.disabled,n=e.inputType;return i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-checkbox\n class=\"switcher-checkbox\"\n .checked=","\n .label=","\n .disabled=","\n @valueChange=","\n ></nile-checkbox\n >; "])),t,r,s,function(e){_this6.handleChange(e,n);});}},{key:"renderNileRadio",value:function renderNileRadio(e){var _this7=this;var t=e.options,r=e.value,s=e.disabled,n=e.errorMessage,o=e.inputType,l=!!n;return i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-radio-group\n class=\"switcher-radio-group\"\n .value=","\n .disabled=","\n @change=","\n >\n ","\n ","\n </nile-radio-group> "])),r,s,function(e){_this7.handleChange(e,o);},t&&t.map(function(e){return i(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-radio .value=\"","\">"," </nile-radio>"])),e,e);}),l?this.renderErrorMessage(n):"");}},{key:"renderErrorMessage",value:function renderErrorMessage(e){return i(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["\n <nile-form-error-message>","</nile-form-error-message>\n "])),e);}},{key:"renderContentEditor",value:function renderContentEditor(e){var _this8=this;var t=e.options,r=e.inputType,s=e.errorMessage,n=e.type,o=e.readonly,l=e.noborder,c=e.value;return i(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["<nile-content-editor\n class=\"switcher-content-editor\"\n .value=","\n .options=","\n .type=","\n .readonly=","\n .noborder=","\n .errorMessage=","\n @nile-change=","\n >\n </nile-content-editor>"])),c,t,n,o,l,s,function(e){_this8.handleChange(e,r);});}},{key:"renderObjectMapper",value:function renderObjectMapper(){var _this9=this;var e=this.currentInput.noborder;this.currentInput.mode;var t=this.currentInput.mode===u.CREATE?"Click to Create - Not Mapped":"";return i(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<nile-input\n class=","\n .value=","\n readonly=\"true\"\n @click=\"","\"\n >\n <nile-icon\n class=\"pointer-cursor switcher-object-mapper-icon\"\n slot=\"suffix\"\n name=\"collapse\"\n color=\"#005EA6\"\n size=\"16\"\n >\n </nile-icon>\n </nile-input>"])),o({"switcher-object-mapper":!0,"switcher-object-mapper--noborder":!!e}),t,function(e){return _this9.handleChange(e,p.OBJECT_MAPPER);});}},{key:"renderCodeEditor",value:function renderCodeEditor(e){var _this10=this;var t=e.value,r=e.multiLine,s=e.options,n=e.disabled,l=e.readonly,c=e.errorMessage,a=e.error,d=e.inputType,h=e.noborder;return i(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["<nile-code-editor\n class=","\n @nile-expand=\"","\"\n @nile-change=\"","\"\n .multiline=\"","\"\n .value=\"","\"\n .customOptions=\"","\"\n .showLineNumbers=\"false\"\n ></nile-code-editor> "])),o({"code-editor":!0,"code-editor__no-border":!!h}),function(e){return _this10.handleExpand(e,p.CODE_EDITOR);},function(e){return _this10.handleChange(e,p.CODE_EDITOR);},r,t,s);}},{key:"handleExpand",value:function handleExpand(e,i){this.currentInput.expand=e.detail.expand,this.emit("nile-change",{input:this.currentInput});}},{key:"handleChange",value:function handleChange(e,i){switch(i){case p.OBJECT_MAPPER:this.currentInput.value="clicked";break;case p.CHECKBOX:this.currentInput.value=e.detail.checked;break;case p.CODE_EDITOR:default:this.currentInput.value=e.detail.value;}e.stopPropagation(),this.emit("nile-change",{input:this.currentInput});}},{key:"renderIcon",value:function renderIcon(){var _this11=this;var e=this.nileSwitchConfig.inputs,t=this.nileSwitchConfig.align===d.BLOCK?"top":"bottom";return i(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["\n <div class=\"switcher-icons-container\">\n ","\n </div>\n "])),l(e,function(e,r){return i(_templateObject13||(_templateObject13=_taggedTemplateLiteral([" <nile-tooltip\n class=","\n content=","\n placement=","\n >\n <div class=",">\n <nile-icon\n size=\"16\"\n class=","\n .name=","\n color=\"#000000\"\n @click=","\n ></nile-icon>\n <div>\n \n </nile-tooltip>"])),o({"switcher-tooltip-container":!0}),e.helperText,t,o({"switcher-icon-container":!0,current:r===_this11.current}),o({"pointer-cursor":!0}),e.icon,function(){return _this11.toggleField(e,r);});}));}},{key:"toggleField",value:function toggleField(e,i){this.current=i,this.emit("nile-switch",{input:this.currentInput});}},{key:"singleFieldSwitcher",value:function singleFieldSwitcher(){var _this12=this;return i(_templateObject14||(_templateObject14=_taggedTemplateLiteral(["\n ","\n "])),n(this.currentInput.inputType,[[p.TEXT,function(){return _this12.renderNileText(_this12.currentInput);}],[p.CHECKBOX,function(){return _this12.renderNileCheckBox(_this12.currentInput);}],[p.TEXTAREA,function(){return _this12.renderNileTextArea(_this12.currentInput);}],[p.RADIO,function(){return _this12.renderNileRadio(_this12.currentInput);}],[p.DROPDOWN,function(){return _this12.renderDropdown(_this12.currentInput);}],[p.CONTENTEDITOR,function(){return _this12.renderContentEditor(_this12.currentInput);}],[p.OBJECT_MAPPER,function(){return _this12.renderObjectMapper();}],[p.CODE_EDITOR,function(){return _this12.renderCodeEditor(_this12.currentInput);}]],function(){return _this12.renderNileText(_this12.currentInput);}));}},{key:"render",value:function render(){var e=this.nileSwitchConfig.align;return i(_templateObject15||(_templateObject15=_taggedTemplateLiteral(["<div\n class=","\n >\n "," ","\n </div>"])),o({"switcher-block":e===d.BLOCK,"switcher-inline":e===d.INLINE,"switcher-input-container":!0}),this.renderIcon(),this.singleFieldSwitcher());}}]);return $;}(s));$.styles=r,e([a({type:Object})],$.prototype,"nileSwitchConfig",void 0),e([a({type:Number})],$.prototype,"current",void 0),e([a({type:Object})],$.prototype,"currentInput",void 0),e([c(["current"],{waitUntilFirstUpdate:!0})],$.prototype,"handleSwitcherChange",null),_export("N",$=e([t("nile-switcher")],$));}};});
1
+ System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-switcher.css.cjs.js","../internal/nile-element.cjs.js","lit/directives/choose.js","lit/directives/class-map.js","lit/directives/repeat.js","../internal/watch.cjs.js","../internal/slot.cjs.js","../property-0f6a51ec.cjs.js","lit"],function(_export,_context){"use strict";var e,i,t,r,s,n,o,l,a,c,d,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_templateObject12,_templateObject13,_templateObject14,_templateObject15,_templateObject16,h,p,u,$,b;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){e=_tslib.__decorate;},function(_index001CjsJs){i=_index001CjsJs.x;},function(_litDecoratorsJs){t=_litDecoratorsJs.customElement;},function(_nileSwitcherCssCjsJs){r=_nileSwitcherCssCjsJs.s;},function(_internalNileElementCjsJs){s=_internalNileElementCjsJs.N;},function(_litDirectivesChooseJs){n=_litDirectivesChooseJs.choose;},function(_litDirectivesClassMapJs){o=_litDirectivesClassMapJs.classMap;},function(_litDirectivesRepeatJs){l=_litDirectivesRepeatJs.repeat;},function(_internalWatchCjsJs){a=_internalWatchCjsJs.w;},function(_internalSlotCjsJs){c=_internalSlotCjsJs.H;},function(_property002CjsJs){d=_property002CjsJs.n;},function(_lit){}],execute:function(){!function(e){e.INLINE="inline",e.BLOCK="block";}(h||(h={})),function(e){e.DEFAULT="defaultInput",e.SWITCH="switchInput";}(p||(p={})),function(e){e.DROPDOWN="dropdown",e.TEXT="text",e.CHECKBOX="checkbox",e.TEXTAREA="text-area",e.RADIO="radio",e.CONTENTEDITOR="content-editor",e.OBJECT_MAPPER="object-mapper",e.CODE_EDITOR="code-editor";}(u||(u={})),function(e){e.CREATE="create",e.EDIT="edit";}($||($={}));_export("N",b=/*#__PURE__*/function(_s){_inherits(b,_s);var _super=_createSuper(b);function b(){var _this;_classCallCheck(this,b);_this=_super.apply(this,arguments),_this.hasSlotController=new c(_assertThisInitialized(_this),"label"),_this.current=0;return _this;}_createClass(b,[{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf(b.prototype),"connectedCallback",this).call(this),this.emit("nile-init");}},{key:"handleSwitcherChange",value:function handleSwitcherChange(){this.setCurrentInput();}},{key:"setCurrentInput",value:function setCurrentInput(){var _this$nileSwitchConfi,_this2=this;((_this$nileSwitchConfi=this.nileSwitchConfig)===null||_this$nileSwitchConfi===void 0?void 0:_this$nileSwitchConfi.inputs)&&(this.currentInput=this.nileSwitchConfig.inputs.filter(function(e,i){return i===_this2.current;})[0]);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_get(_getPrototypeOf(b.prototype),"disconnectedCallback",this).call(this),this.emit("nile-destroy");}},{key:"renderNileText",value:function renderNileText(e){var _this3=this;var t=e.value,r=e.label,s=e.placeholder,n=e.disabled,l=e.required,a=e.error,c=e.errorMessage,d=e.inputType,h=e.noborder;return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-input\n class=","\n .value=","\n .label=","\n .disabled=","\n .required=","\n .errorMessage=","\n .placeholder=","\n .error=","\n @nile-input=","\n ></nile-input>"])),o({"switcher-input":!0,"switcher-input--noborder":!!h}),t,r,n,l,c,s,a,function(e){_this3.handleChange(e,d);});}},{key:"renderDropdown",value:function renderDropdown(e){var _this4=this;var t=e.options,r=e.multiple,s=e.placeholder,n=e.disabled,o=e.value,l=e.error,a=e.errorMessage,c=e.inputType;return i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-select\n class=\"switcher-dropdown\"\n .placeholder=","\n .disabled=\"","\"\n .multiple=\"","\"\n .value=\"","\"\n .error=\"","\"\n .errorMessage=\"","\"\n @nile-change=","\n >\n ","\n </nile-select>"])),s,n,r,o,l,a,function(e){_this4.handleChange(e,c);},t===null||t===void 0?void 0:t.map(function(e){return i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-option .value=\"","\">"," </nile-option>"])),e,e);}));}},{key:"renderNileTextArea",value:function renderNileTextArea(e){var _this5=this;var t=e.value,r=e.disabled,s=e.readonly,n=e.errorMessage,o=e.error,l=e.inputType;return i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-textarea\n class=\"switcher-textarea\"\n .value=","\n .disabled=","\n ?readonly=","\n .error=","\n .errorMessage=","\n @nile-input=","\n ></nile-textarea>"])),t,r,s,o,n,function(e){_this5.handleChange(e,l);});}},{key:"renderNileCheckBox",value:function renderNileCheckBox(e){var _this6=this;var t=e.value,r=e.label,s=e.disabled,n=e.inputType;return i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-checkbox\n class=\"switcher-checkbox\"\n .checked=","\n .label=","\n .disabled=","\n @valueChange=","\n ></nile-checkbox\n >; "])),t,r,s,function(e){_this6.handleChange(e,n);});}},{key:"renderNileRadio",value:function renderNileRadio(e){var _this7=this;var t=e.options,r=e.value,s=e.disabled,n=e.errorMessage,o=e.inputType,l=!!n;return i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-radio-group\n class=\"switcher-radio-group\"\n .value=","\n .disabled=","\n @change=","\n >\n ","\n ","\n </nile-radio-group> "])),r,s,function(e){_this7.handleChange(e,o);},t&&t.map(function(e){return i(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-radio .value=\"","\">"," </nile-radio>"])),e,e);}),l?this.renderErrorMessage(n):"");}},{key:"renderErrorMessage",value:function renderErrorMessage(e){return i(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["\n <nile-form-error-message>","</nile-form-error-message>\n "])),e);}},{key:"renderContentEditor",value:function renderContentEditor(e){var _this8=this;var t=e.options,r=e.inputType,s=e.errorMessage,n=e.type,o=e.readonly,l=e.noborder,a=e.value;return i(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["<nile-content-editor\n class=\"switcher-content-editor\"\n .value=","\n .options=","\n .type=","\n .readonly=","\n .noborder=","\n .errorMessage=","\n @nile-change=","\n >\n </nile-content-editor>"])),a,t,n,o,l,s,function(e){_this8.handleChange(e,r);});}},{key:"renderObjectMapper",value:function renderObjectMapper(){var _this9=this;var e=this.currentInput.noborder;this.currentInput.mode;var t=this.currentInput.mode===$.CREATE?"Click to Create - Not Mapped":"";return i(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<nile-input\n class=","\n .value=","\n readonly=\"true\"\n @click=\"","\"\n >\n <nile-icon\n class=\"pointer-cursor switcher-object-mapper-icon\"\n slot=\"suffix\"\n name=\"collapse\"\n color=\"#005EA6\"\n size=\"16\"\n >\n </nile-icon>\n </nile-input>"])),o({"switcher-object-mapper":!0,"switcher-object-mapper--noborder":!!e}),t,function(e){return _this9.handleChange(e,u.OBJECT_MAPPER);});}},{key:"renderCodeEditor",value:function renderCodeEditor(e){var _this10=this;var t=e.value,r=e.multiLine,s=e.customAutoCompletions,n=e.disabled,l=e.readonly,a=e.errorMessage,c=e.error,d=e.inputType,h=e.noborder;return i(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["<nile-code-editor\n class=","\n @nile-expand=\"","\"\n @nile-change=\"","\"\n .multiline=\"","\"\n .value=\"","\"\n .customOptions=\"","\"\n .showLineNumbers=\"false\"\n ></nile-code-editor> "])),o({"code-editor":!0,"code-editor__no-border":!!h}),function(e){return _this10.handleExpand(e,u.CODE_EDITOR);},function(e){return _this10.handleChange(e,u.CODE_EDITOR);},r,t,s);}},{key:"handleExpand",value:function handleExpand(e,i){this.currentInput.expand=e.detail.expand,this.emit("nile-change",{input:this.currentInput});}},{key:"handleChange",value:function handleChange(e,i){switch(i){case u.OBJECT_MAPPER:this.currentInput.value="clicked";break;case u.CHECKBOX:this.currentInput.value=e.detail.checked;break;case u.CODE_EDITOR:default:this.currentInput.value=e.detail.value;}e.stopPropagation(),this.emit("nile-change",{input:this.currentInput});}},{key:"renderIcon",value:function renderIcon(){var _this11=this;var e=this.nileSwitchConfig.inputs,t=this.nileSwitchConfig.align===h.BLOCK?"top":"bottom";return i(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["\n <div part=\"icons-container\" class=\"switcher-icons-container\">\n ","\n </div>\n "])),l(e,function(e,r){return i(_templateObject13||(_templateObject13=_taggedTemplateLiteral([" <nile-tooltip\n class=","\n content=","\n placement=","\n >\n <div class=",">\n <nile-icon\n size=\"16\"\n class=","\n .name=","\n color=\"#000000\"\n @click=","\n ></nile-icon>\n <div>\n \n </nile-tooltip>"])),o({"switcher-tooltip-container":!0}),e.helperText,t,o({"switcher-icon-container":!0,current:r===_this11.current}),o({"pointer-cursor":!0}),e.icon,function(){return _this11.toggleField(e,r);});}));}},{key:"toggleField",value:function toggleField(e,i){this.nileSwitchConfig.confirmation&&(this.current=i),this.emit("nile-switch",{input:this.currentInput});}},{key:"singleFieldSwitcher",value:function singleFieldSwitcher(){var _this12=this;return this.currentInput||this.setCurrentInput(),i(_templateObject14||(_templateObject14=_taggedTemplateLiteral(["\n ","\n "])),n(this.currentInput.inputType,[[u.TEXT,function(){return _this12.renderNileText(_this12.currentInput);}],[u.CHECKBOX,function(){return _this12.renderNileCheckBox(_this12.currentInput);}],[u.TEXTAREA,function(){return _this12.renderNileTextArea(_this12.currentInput);}],[u.RADIO,function(){return _this12.renderNileRadio(_this12.currentInput);}],[u.DROPDOWN,function(){return _this12.renderDropdown(_this12.currentInput);}],[u.CONTENTEDITOR,function(){return _this12.renderContentEditor(_this12.currentInput);}],[u.OBJECT_MAPPER,function(){return _this12.renderObjectMapper();}],[u.CODE_EDITOR,function(){return _this12.renderCodeEditor(_this12.currentInput);}]],function(){return _this12.renderNileText(_this12.currentInput);}));}},{key:"render",value:function render(){var e=this.hasSlotController.test("label"),t=this.nileSwitchConfig.align;return i(_templateObject15||(_templateObject15=_taggedTemplateLiteral(["<div\n class=","\n >\n <div class=\"label-container\">\n ","\n ","\n </div>\n ","\n </div>"])),o({"switcher-block":t===h.BLOCK,"switcher-inline":t===h.INLINE,"switcher-container":!0}),e?i(_templateObject16||(_templateObject16=_taggedTemplateLiteral(["\n <label\n part=\"switcher-label\"\n class=\"switcher__label\"\n for=\"input\"\n >\n <slot name=\"label\"></slot>\n </label>\n </div> "]))):"",this.renderIcon(),this.singleFieldSwitcher());}}]);return b;}(s));b.styles=r,e([d({type:Object})],b.prototype,"nileSwitchConfig",void 0),e([d({type:Number})],b.prototype,"current",void 0),e([d({type:Object})],b.prototype,"currentInput",void 0),e([a(["current"],{waitUntilFirstUpdate:!0})],b.prototype,"handleSwitcherChange",null),_export("N",b=e([t("nile-switcher")],b));}};});
2
2
  //# sourceMappingURL=nile-switcher.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-switcher.cjs.js","sources":["../../../src/nile-switcher/nile-switcher.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 { html, property, TemplateResult } from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-switcher.css';\nimport NileElement from '../internal/nile-element';\nimport { CSSResultGroup } from 'lit';\nimport { choose } from 'lit/directives/choose.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { watch } from '../internal/watch';\n\n/**\n * @summary Allows you to switch between nile elements\n *\n * @dependency nile-icon\n * @dependency nile-input\n * @dependency nile-checkbox\n * @dependency nile-dropdown\n * @dependency nile-textarea\n *\n * @event nile-change - Emitted when the control's value changes.\n * @event nile-switch - Emitted when the nile component is being switched.\n */\n\nexport interface switchconfig {\n [key: string]: any;\n toggleSwitch: boolean;\n disable?: boolean;\n confirmation?: boolean;\n align: 'block' | 'inline';\n inputs: switchInputType[];\n}\n\nexport interface switchInputType {\n inputType:\n | INPUT_TYPE_NAMES.DROPDOWN\n | INPUT_TYPE_NAMES.TEXT\n | INPUT_TYPE_NAMES.CHECKBOX\n | INPUT_TYPE_NAMES.TEXTAREA\n | INPUT_TYPE_NAMES.RADIO\n | INPUT_TYPE_NAMES.CONTENTEDITOR\n | INPUT_TYPE_NAMES.OBJECT_MAPPER\n | INPUT_TYPE_NAMES.CODE_EDITOR;\n value?: String | boolean;\n label?: String;\n readonly?: boolean;\n type?: string;\n icon: string;\n mode?: string;\n placeholder?: string;\n disabled?: boolean;\n required?: boolean;\n error?: boolean;\n errorMessage?: string;\n options?: Array<any>;\n helperText?: string;\n multiple?: boolean;\n noborder?: boolean;\n multiLine?: boolean;\n expand?: boolean;\n}\n\nexport enum POSITIONS {\n INLINE = 'inline',\n BLOCK = 'block',\n}\n\nexport enum INPUT_TYPE {\n DEFAULT = 'defaultInput',\n SWITCH = 'switchInput',\n}\n\nexport enum INPUT_TYPE_NAMES {\n DROPDOWN = 'dropdown',\n TEXT = 'text',\n CHECKBOX = 'checkbox',\n TEXTAREA = 'text-area',\n RADIO = 'radio',\n CONTENTEDITOR = 'content-editor',\n OBJECT_MAPPER = 'object-mapper',\n CODE_EDITOR = 'code-editor',\n}\n\nexport enum MODE {\n CREATE = 'create',\n EDIT = 'edit',\n}\n\n@customElement('nile-switcher')\nexport class NileSwitcher extends NileElement {\n /**\n * The styles for nile switcher\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n static styles: CSSResultGroup = styles;\n\n @property({ type: Object }) nileSwitchConfig: switchconfig;\n\n @property({ type: Number }) current: Number = 0;\n\n @property({ type: Object }) currentInput: switchInputType;\n\n connectedCallback() {\n super.connectedCallback();\n this.setCurrentInput();\n this.emit('nile-init');\n }\n\n @watch(['current'], { waitUntilFirstUpdate: true })\n handleSwitcherChange() {\n this.setCurrentInput();\n }\n\n setCurrentInput() {\n if (this.nileSwitchConfig?.inputs) {\n this.currentInput = this.nileSwitchConfig.inputs.filter(\n (input: switchInputType, index: Number) => {\n return index === this.current;\n }\n )[0];\n }\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n renderNileText(Input: switchInputType) {\n const {\n value,\n label,\n placeholder,\n disabled,\n required,\n error,\n errorMessage,\n inputType,\n noborder,\n } = Input;\n return html`<nile-input\n class=${classMap({\n 'switcher-input': true,\n 'switcher-input--noborder': !!noborder,\n })}\n .value=${value}\n .label=${label}\n .disabled=${disabled}\n .required=${required}\n .errorMessage=${errorMessage}\n .placeholder=${placeholder}\n .error=${error}\n @nile-input=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n ></nile-input>`;\n }\n\n renderDropdown(Input: switchInputType) {\n const {\n options,\n multiple,\n placeholder,\n disabled,\n value,\n error,\n errorMessage,\n inputType,\n } = Input;\n\n return html`<nile-select\n class=\"switcher-dropdown\"\n .placeholder=${placeholder}\n .disabled=\"${disabled}\"\n .multiple=\"${multiple}\"\n .value=\"${value}\"\n .error=\"${error}\"\n .errorMessage=\"${errorMessage}\"\n @nile-change=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n >\n ${options?.map((option: any) => {\n return html`<nile-option .value=\"${option}\">${option} </nile-option>`;\n })}\n </nile-select>`;\n }\n\n renderNileTextArea(Input: switchInputType) {\n const { value, disabled, readonly, errorMessage, error, inputType } = Input;\n\n return html`<nile-textarea\n class=\"switcher-textarea\"\n .value=${value}\n .disabled=${disabled}\n ?readonly=${readonly}\n .error=${error}\n .errorMessage=${errorMessage}\n @nile-input=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n ></nile-textarea>`;\n }\n\n renderNileCheckBox(Input: switchInputType) {\n const { value, label, disabled, inputType } = Input;\n\n return html`<nile-checkbox\n class=\"switcher-checkbox\"\n .checked=${value}\n .label=${label}\n .disabled=${disabled}\n @valueChange=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n ></nile-checkbox\n >; `;\n }\n\n renderNileRadio(Input: switchInputType) {\n const { options, value, disabled, errorMessage, inputType } = Input;\n\n const haserrorMessage = !!errorMessage;\n\n return html`<nile-radio-group\n class=\"switcher-radio-group\"\n .value=${value}\n .disabled=${disabled}\n @change=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n >\n ${options &&\n options.map((option: any) => {\n return html`<nile-radio .value=\"${option}\">${option} </nile-radio>`;\n })}\n ${haserrorMessage ? this.renderErrorMessage(errorMessage) : ''}\n </nile-radio-group> `;\n }\n\n renderErrorMessage(errorMessage: string) {\n return html`\n <nile-form-error-message>${errorMessage}</nile-form-error-message>\n `;\n }\n\n renderContentEditor(Input: switchInputType) {\n let { options, inputType, errorMessage, type, readonly, noborder, value } =\n Input;\n return html`<nile-content-editor\n class=\"switcher-content-editor\"\n .value=${value}\n .options=${options}\n .type=${type}\n .readonly=${readonly}\n .noborder=${noborder}\n .errorMessage=${errorMessage}\n @nile-change=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n >\n </nile-content-editor>`;\n }\n\n renderObjectMapper() {\n const noborder = this.currentInput.noborder;\n const mode = this.currentInput.mode;\n const value =\n this.currentInput.mode === MODE.CREATE\n ? 'Click to Create - Not Mapped'\n : '';\n\n return html`<nile-input\n class=${classMap({\n 'switcher-object-mapper': true,\n 'switcher-object-mapper--noborder': !!noborder,\n })}\n .value=${value}\n readonly=\"true\"\n @click=\"${(e: CustomEvent) =>\n this.handleChange(e, INPUT_TYPE_NAMES.OBJECT_MAPPER)}\"\n >\n <nile-icon\n class=\"pointer-cursor switcher-object-mapper-icon\"\n slot=\"suffix\"\n name=\"collapse\"\n color=\"#005EA6\"\n size=\"16\"\n >\n </nile-icon>\n </nile-input>`;\n }\n\n renderCodeEditor(Input: switchInputType) {\n const {\n value,\n multiLine,\n options,\n disabled,\n readonly,\n errorMessage,\n error,\n inputType,\n noborder,\n } = Input;\n return html`<nile-code-editor\n class=${classMap({\n 'code-editor': true,\n 'code-editor__no-border': !!noborder,\n })}\n @nile-expand=\"${(e: CustomEvent) =>\n this.handleExpand(e, INPUT_TYPE_NAMES.CODE_EDITOR)}\"\n @nile-change=\"${(e: CustomEvent) =>\n this.handleChange(e, INPUT_TYPE_NAMES.CODE_EDITOR)}\"\n .multiline=\"${multiLine}\"\n .value=\"${value}\"\n .customOptions=\"${options}\"\n .showLineNumbers=\"false\"\n ></nile-code-editor> `;\n }\n\n handleExpand(event: CustomEvent, inputType: string) {\n this.currentInput.expand = event.detail.expand;\n this.emit('nile-change', { input: this.currentInput });\n }\n\n handleChange(event: CustomEvent, inputType: string) {\n switch (inputType) {\n case INPUT_TYPE_NAMES.OBJECT_MAPPER:\n this.currentInput.value = 'clicked';\n break;\n case INPUT_TYPE_NAMES.CHECKBOX:\n this.currentInput.value = event.detail.checked;\n break;\n case INPUT_TYPE_NAMES.CODE_EDITOR:\n this.currentInput.value = event.detail.value;\n break;\n default:\n this.currentInput.value = event.detail.value;\n }\n event.stopPropagation();\n this.emit('nile-change', { input: this.currentInput });\n }\n\n renderIcon() {\n const inputs = this.nileSwitchConfig.inputs;\n const toolTipPosition =\n this.nileSwitchConfig.align === POSITIONS.BLOCK ? 'top' : 'bottom';\n\n return html`\n <div class=\"switcher-icons-container\">\n ${repeat(\n inputs,\n (input: any, index: number) => html` <nile-tooltip\n class=${classMap({\n 'switcher-tooltip-container': true,\n })}\n content=${input.helperText}\n placement=${toolTipPosition}\n >\n <div class=${classMap({\n 'switcher-icon-container': true,\n current: index === this.current,\n })}>\n <nile-icon\n size=\"16\"\n class=${classMap({\n 'pointer-cursor': true,\n })}\n .name=${input.icon}\n color=\"#000000\"\n @click=${() => this.toggleField(input, index)}\n ></nile-icon>\n <div>\n \n </nile-tooltip>`\n )}\n </div>\n `;\n }\n\n toggleField(currentInput: switchInputType, index: Number) {\n this.current = index;\n this.emit('nile-switch', { input: this.currentInput });\n }\n\n singleFieldSwitcher() {\n return html`\n ${choose(\n this.currentInput.inputType,\n [\n [INPUT_TYPE_NAMES.TEXT, () => this.renderNileText(this.currentInput)],\n [\n INPUT_TYPE_NAMES.CHECKBOX,\n () => this.renderNileCheckBox(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.TEXTAREA,\n () => this.renderNileTextArea(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.RADIO,\n () => this.renderNileRadio(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.DROPDOWN,\n () => this.renderDropdown(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.CONTENTEDITOR,\n () => this.renderContentEditor(this.currentInput),\n ],\n [INPUT_TYPE_NAMES.OBJECT_MAPPER, () => this.renderObjectMapper()],\n [\n INPUT_TYPE_NAMES.CODE_EDITOR,\n () => this.renderCodeEditor(this.currentInput),\n ],\n ],\n () => this.renderNileText(this.currentInput)\n )}\n `;\n }\n\n public render(): TemplateResult {\n const align = this.nileSwitchConfig.align;\n return html`<div\n class=${classMap({\n 'switcher-block': align === POSITIONS.BLOCK,\n 'switcher-inline': align === POSITIONS.INLINE,\n 'switcher-input-container': true,\n })}\n >\n ${this.renderIcon()} ${this.singleFieldSwitcher()}\n </div>`;\n }\n}\n\nexport default NileSwitcher;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-switcher': NileSwitcher;\n }\n}\n"],"names":["MODE","POSITIONS","INLINE","BLOCK","INPUT_TYPE","DEFAULT","SWITCH","INPUT_TYPE_NAMES","DROPDOWN","TEXT","CHECKBOX","TEXTAREA","RADIO","CONTENTEDITOR","OBJECT_MAPPER","CODE_EDITOR","CREATE","EDIT","_export","NileSwitcher","$","this","current","_this","_createClass","key","value","connectedCallback","super","setCurrentInput","emit","handleSwitcherChange","nileSwitchConfig","inputs","currentInput","filter","input","index","disconnectedCallback","renderNileText","Input","label","placeholder","disabled","required","error","errorMessage","inputType","noborder","html","_templateObject","_taggedTemplateLiteral","classMap","e","handleChange","renderDropdown","_this4","options","multiple","_templateObject2","map","option","_templateObject3","renderNileTextArea","readonly","_templateObject4","renderNileCheckBox","_this6","_templateObject5","renderNileRadio","haserrorMessage","_templateObject6","_templateObject7","renderErrorMessage","_templateObject8","renderContentEditor","_this8","type","_templateObject9","renderObjectMapper","mode","_templateObject10","renderCodeEditor","multiLine","_templateObject11","handleExpand","event","expand","detail","checked","stopPropagation","renderIcon","toolTipPosition","align","_templateObject12","repeat","_templateObject13","helperText","icon","toggleField","singleFieldSwitcher","_templateObject14","choose","render","_templateObject15","NileElement","styles","__decorate","property","Object","prototype","Number","watch","waitUntilFirstUpdate","customElement"],"mappings":"s6JAyFYA,CArBZ,SAAYC,CACVA,CAAAA,CAAAA,CAAAA,CAAAC,OAAA,QACAD,CAAAA,CAAAA,CAAAE,MAAA,OACD,EAHD,CAAYF,CAAAA,GAAAA,CAAAA,CAGX,CAAA,CAED,CAAA,CAAA,CAAA,SAAYG,GACVA,CAAA,CAAAC,OAAA,CAAA,cACAD,CAAAA,CAAAA,CAAAE,OAAA,aACD,EAHD,CAAYF,CAAAA,GAAAA,CAAAA,CAGX,CAAA,CAED,CAAA,CAAA,CAAA,SAAYG,CACVA,CAAAA,CAAAA,CAAAA,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A3BC,CAAAA,CAAS,CAAE/B,IAAAA,CAAMkC,UAA8B5F,CAAA2F,CAAAA,SAAAA,CAAA,SAAA,CAAA,IAAA,EAAA,CAAA,CAEpBH,CAAA,CAAA,CAA3BC,EAAS,CAAE/B,IAAAA,CAAMgC,UAAwC1F,CAAA2F,CAAAA,SAAAA,CAAA,mBAAA,EAS1DH,CAAAA,CAAAA,CAAAA,CAAA,CADCK,CAAAA,CAAM,CAAC,SAAA,CAAA,CAAY,CAAEC,oBAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAG3C9F,CAAA2F,CAAAA,SAAAA,CAAA,sBAAA,CAAA,IAAA,CAAA,CAAA5F,OAAA,KAtBUC,EAAYwF,CAAA,CAAA,CADxBO,CAAc,CAAA,eAAA,CAAA,CAAA,CACF/F"}
1
+ {"version":3,"file":"nile-switcher.cjs.js","sources":["../../../src/nile-switcher/nile-switcher.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 { html, property, TemplateResult } from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-switcher.css';\nimport NileElement from '../internal/nile-element';\nimport { CSSResultGroup } from 'lit';\nimport { choose } from 'lit/directives/choose.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { watch } from '../internal/watch';\nimport { HasSlotController } from '../internal/slot';\n\n/**\n * @summary Allows you to switch between nile elements\n *\n * @dependency nile-icon\n * @dependency nile-input\n * @dependency nile-checkbox\n * @dependency nile-dropdown\n * @dependency nile-textarea\n *\n * @event nile-change - Emitted when the control's value changes.\n * @event nile-switch - Emitted when the nile component is being switched.\n */\n\nexport interface switchconfig {\n [key: string]: any;\n toggleSwitch: boolean;\n disable?: boolean;\n confirmation?: boolean;\n align: 'block' | 'inline';\n inputs: switchInputType[];\n}\n\nexport interface switchInputType {\n inputType:\n | INPUT_TYPE_NAMES.DROPDOWN\n | INPUT_TYPE_NAMES.TEXT\n | INPUT_TYPE_NAMES.CHECKBOX\n | INPUT_TYPE_NAMES.TEXTAREA\n | INPUT_TYPE_NAMES.RADIO\n | INPUT_TYPE_NAMES.CONTENTEDITOR\n | INPUT_TYPE_NAMES.OBJECT_MAPPER\n | INPUT_TYPE_NAMES.CODE_EDITOR;\n value?: String | boolean;\n label?: String;\n readonly?: boolean;\n type?: string;\n icon: string;\n mode?: string;\n placeholder?: string;\n disabled?: boolean;\n required?: boolean;\n error?: boolean;\n errorMessage?: string;\n options?: Array<any>;\n customAutoCompletions?: any;\n helperText?: string;\n multiple?: boolean;\n noborder?: boolean;\n multiLine?: boolean;\n expand?: boolean;\n}\n\nexport enum POSITIONS {\n INLINE = 'inline',\n BLOCK = 'block',\n}\n\nexport enum INPUT_TYPE {\n DEFAULT = 'defaultInput',\n SWITCH = 'switchInput',\n}\n\nexport enum INPUT_TYPE_NAMES {\n DROPDOWN = 'dropdown',\n TEXT = 'text',\n CHECKBOX = 'checkbox',\n TEXTAREA = 'text-area',\n RADIO = 'radio',\n CONTENTEDITOR = 'content-editor',\n OBJECT_MAPPER = 'object-mapper',\n CODE_EDITOR = 'code-editor',\n}\n\nexport enum MODE {\n CREATE = 'create',\n EDIT = 'edit',\n}\n\n@customElement('nile-switcher')\nexport class NileSwitcher extends NileElement {\n /**\n * The styles for nile switcher\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n static styles: CSSResultGroup = styles;\n\n private readonly hasSlotController = new HasSlotController(this, 'label');\n\n @property({ type: Object }) nileSwitchConfig: switchconfig;\n\n @property({ type: Number }) current: Number = 0;\n\n @property({ type: Object }) currentInput: switchInputType;\n\n connectedCallback() {\n super.connectedCallback();\n this.emit('nile-init');\n }\n\n @watch(['current'], { waitUntilFirstUpdate: true })\n handleSwitcherChange() {\n this.setCurrentInput();\n }\n\n setCurrentInput() {\n if (this.nileSwitchConfig?.inputs) {\n this.currentInput = this.nileSwitchConfig.inputs.filter(\n (input: switchInputType, index: Number) => {\n return index === this.current;\n }\n )[0];\n }\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n renderNileText(Input: switchInputType) {\n const {\n value,\n label,\n placeholder,\n disabled,\n required,\n error,\n errorMessage,\n inputType,\n noborder,\n } = Input;\n return html`<nile-input\n class=${classMap({\n 'switcher-input': true,\n 'switcher-input--noborder': !!noborder,\n })}\n .value=${value}\n .label=${label}\n .disabled=${disabled}\n .required=${required}\n .errorMessage=${errorMessage}\n .placeholder=${placeholder}\n .error=${error}\n @nile-input=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n ></nile-input>`;\n }\n\n renderDropdown(Input: switchInputType) {\n const {\n options,\n multiple,\n placeholder,\n disabled,\n value,\n error,\n errorMessage,\n inputType,\n } = Input;\n\n return html`<nile-select\n class=\"switcher-dropdown\"\n .placeholder=${placeholder}\n .disabled=\"${disabled}\"\n .multiple=\"${multiple}\"\n .value=\"${value}\"\n .error=\"${error}\"\n .errorMessage=\"${errorMessage}\"\n @nile-change=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n >\n ${options?.map((option: any) => {\n return html`<nile-option .value=\"${option}\">${option} </nile-option>`;\n })}\n </nile-select>`;\n }\n\n renderNileTextArea(Input: switchInputType) {\n const { value, disabled, readonly, errorMessage, error, inputType } = Input;\n\n return html`<nile-textarea\n class=\"switcher-textarea\"\n .value=${value}\n .disabled=${disabled}\n ?readonly=${readonly}\n .error=${error}\n .errorMessage=${errorMessage}\n @nile-input=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n ></nile-textarea>`;\n }\n\n renderNileCheckBox(Input: switchInputType) {\n const { value, label, disabled, inputType } = Input;\n\n return html`<nile-checkbox\n class=\"switcher-checkbox\"\n .checked=${value}\n .label=${label}\n .disabled=${disabled}\n @valueChange=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n ></nile-checkbox\n >; `;\n }\n\n renderNileRadio(Input: switchInputType) {\n const { options, value, disabled, errorMessage, inputType } = Input;\n\n const haserrorMessage = !!errorMessage;\n\n return html`<nile-radio-group\n class=\"switcher-radio-group\"\n .value=${value}\n .disabled=${disabled}\n @change=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n >\n ${options &&\n options.map((option: any) => {\n return html`<nile-radio .value=\"${option}\">${option} </nile-radio>`;\n })}\n ${haserrorMessage ? this.renderErrorMessage(errorMessage) : ''}\n </nile-radio-group> `;\n }\n\n renderErrorMessage(errorMessage: string) {\n return html`\n <nile-form-error-message>${errorMessage}</nile-form-error-message>\n `;\n }\n\n renderContentEditor(Input: switchInputType) {\n let { options, inputType, errorMessage, type, readonly, noborder, value } =\n Input;\n return html`<nile-content-editor\n class=\"switcher-content-editor\"\n .value=${value}\n .options=${options}\n .type=${type}\n .readonly=${readonly}\n .noborder=${noborder}\n .errorMessage=${errorMessage}\n @nile-change=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n >\n </nile-content-editor>`;\n }\n\n renderObjectMapper() {\n const noborder = this.currentInput.noborder;\n const mode = this.currentInput.mode;\n const value =\n this.currentInput.mode === MODE.CREATE\n ? 'Click to Create - Not Mapped'\n : '';\n\n return html`<nile-input\n class=${classMap({\n 'switcher-object-mapper': true,\n 'switcher-object-mapper--noborder': !!noborder,\n })}\n .value=${value}\n readonly=\"true\"\n @click=\"${(e: CustomEvent) =>\n this.handleChange(e, INPUT_TYPE_NAMES.OBJECT_MAPPER)}\"\n >\n <nile-icon\n class=\"pointer-cursor switcher-object-mapper-icon\"\n slot=\"suffix\"\n name=\"collapse\"\n color=\"#005EA6\"\n size=\"16\"\n >\n </nile-icon>\n </nile-input>`;\n }\n\n renderCodeEditor(Input: switchInputType) {\n const {\n value,\n multiLine,\n customAutoCompletions,\n disabled,\n readonly,\n errorMessage,\n error,\n inputType,\n noborder,\n } = Input;\n return html`<nile-code-editor\n class=${classMap({\n 'code-editor': true,\n 'code-editor__no-border': !!noborder,\n })}\n @nile-expand=\"${(e: CustomEvent) =>\n this.handleExpand(e, INPUT_TYPE_NAMES.CODE_EDITOR)}\"\n @nile-change=\"${(e: CustomEvent) =>\n this.handleChange(e, INPUT_TYPE_NAMES.CODE_EDITOR)}\"\n .multiline=\"${multiLine}\"\n .value=\"${value}\"\n .customOptions=\"${customAutoCompletions}\"\n .showLineNumbers=\"false\"\n ></nile-code-editor> `;\n }\n\n handleExpand(event: CustomEvent, inputType: string) {\n this.currentInput.expand = event.detail.expand;\n this.emit('nile-change', { input: this.currentInput });\n }\n\n handleChange(event: CustomEvent, inputType: string) {\n switch (inputType) {\n case INPUT_TYPE_NAMES.OBJECT_MAPPER:\n this.currentInput.value = 'clicked';\n break;\n case INPUT_TYPE_NAMES.CHECKBOX:\n this.currentInput.value = event.detail.checked;\n break;\n case INPUT_TYPE_NAMES.CODE_EDITOR:\n this.currentInput.value = event.detail.value;\n break;\n default:\n this.currentInput.value = event.detail.value;\n }\n event.stopPropagation();\n this.emit('nile-change', { input: this.currentInput });\n }\n\n renderIcon() {\n const inputs = this.nileSwitchConfig.inputs;\n const toolTipPosition =\n this.nileSwitchConfig.align === POSITIONS.BLOCK ? 'top' : 'bottom';\n\n return html`\n <div part=\"icons-container\" class=\"switcher-icons-container\">\n ${repeat(\n inputs,\n (input: any, index: number) => html` <nile-tooltip\n class=${classMap({\n 'switcher-tooltip-container': true,\n })}\n content=${input.helperText}\n placement=${toolTipPosition}\n >\n <div class=${classMap({\n 'switcher-icon-container': true,\n current: index === this.current,\n })}>\n <nile-icon\n size=\"16\"\n class=${classMap({\n 'pointer-cursor': true,\n })}\n .name=${input.icon}\n color=\"#000000\"\n @click=${() => this.toggleField(input, index)}\n ></nile-icon>\n <div>\n \n </nile-tooltip>`\n )}\n </div>\n `;\n }\n\n toggleField(currentInput: switchInputType, index: Number) {\n if (this.nileSwitchConfig.confirmation) {\n this.current = index;\n }\n this.emit('nile-switch', { input: this.currentInput });\n }\n\n singleFieldSwitcher() {\n if (!this.currentInput) {\n this.setCurrentInput();\n }\n return html`\n ${choose(\n this.currentInput.inputType,\n [\n [INPUT_TYPE_NAMES.TEXT, () => this.renderNileText(this.currentInput)],\n [\n INPUT_TYPE_NAMES.CHECKBOX,\n () => this.renderNileCheckBox(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.TEXTAREA,\n () => this.renderNileTextArea(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.RADIO,\n () => this.renderNileRadio(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.DROPDOWN,\n () => this.renderDropdown(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.CONTENTEDITOR,\n () => this.renderContentEditor(this.currentInput),\n ],\n [INPUT_TYPE_NAMES.OBJECT_MAPPER, () => this.renderObjectMapper()],\n [\n INPUT_TYPE_NAMES.CODE_EDITOR,\n () => this.renderCodeEditor(this.currentInput),\n ],\n ],\n () => this.renderNileText(this.currentInput)\n )}\n `;\n }\n\n public render(): TemplateResult {\n const hasLabelSlot = this.hasSlotController.test('label');\n const align = this.nileSwitchConfig.align;\n return html`<div\n class=${classMap({\n 'switcher-block': align === POSITIONS.BLOCK,\n 'switcher-inline': align === POSITIONS.INLINE,\n 'switcher-container': true,\n })}\n >\n <div class=\"label-container\">\n ${hasLabelSlot\n ? html`\n <label\n part=\"switcher-label\"\n class=\"switcher__label\"\n for=\"input\"\n >\n <slot name=\"label\"></slot>\n </label>\n </div> `\n : ''}\n ${this.renderIcon()}\n </div>\n ${this.singleFieldSwitcher()}\n </div>`;\n }\n}\n\nexport default NileSwitcher;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-switcher': NileSwitcher;\n }\n}\n"],"names":["POSITIONS","INLINE","BLOCK","INPUT_TYPE","DEFAULT","SWITCH","INPUT_TYPE_NAMES","DROPDOWN","TEXT","CHECKBOX","TEXTAREA","RADIO","CONTENTEDITOR","OBJECT_MAPPER","CODE_EDITOR","MODE","CREATE","EDIT","_export","NileSwitcher","b","this","hasSlotController","HasSlotController","current","_this","_createClass","key","value","connectedCallback","super","emit","handleSwitcherChange","setCurrentInput","nileSwitchConfig","inputs","currentInput","filter","input","index","disconnectedCallback","renderNileText","Input","label","placeholder","disabled","required","error","errorMessage","inputType","noborder","html","_templateObject","_taggedTemplateLiteral","classMap","e","handleChange","renderDropdown","_this4","options","multiple","_templateObject2","map","option","_templateObject3","renderNileTextArea","readonly","_templateObject4","renderNileCheckBox","_this6","_templateObject5","renderNileRadio","haserrorMessage","_templateObject6","_templateObject7","renderErrorMessage","_templateObject8","renderContentEditor","_this8","type","_templateObject9","renderObjectMapper","mode","_templateObject10","renderCodeEditor","multiLine","customAutoCompletions","_templateObject11","handleExpand","event","expand","detail","checked","stopPropagation","renderIcon","toolTipPosition","align","_templateObject12","repeat","_templateObject13","helperText","icon","toggleField","confirmation","singleFieldSwitcher","_this12","_templateObject14","choose","render","hasLabelSlot","test","_templateObject15","_templateObject16","NileElement","styles","__decorate","property","Object","prototype","Number","watch","waitUntilFirstUpdate","customElement"],"mappings":"2gKAsEA,SAAYA,CAAAA,CAAAA,CACVA,EAAAC,MAAA,CAAA,QAAA,CACAD,EAAAE,KAAA,CAAA,OACD,EAHD,CAAYF,CAAAA,GAAAA,EAGX,CAAA,CAAA,CAAA,CAAA,CAED,SAAYG,CACVA,CAAAA,CAAAA,CAAAA,CAAAC,OAAA,CAAA,cAAA,CACAD,EAAAE,MAAA,CAAA,aACD,EAHD,CAAYF,CAAAA,GAAAA,EAGX,CAAA,CAAA,CAAA,CAAA,CAED,SAAYG,CACVA,CAAAA,CAAAA,CAAAA,CAAAC,SAAA,UACAD,CAAAA,CAAAA,CAAAE,KAAA,MACAF,CAAAA,CAAAA,CAAAG,SAAA,UACAH,CAAAA,CAAAA,CAAAI,SAAA,WACAJ,CAAAA,CAAAA,CAAAK,MAAA,OACAL,CAAAA,CAAAA,CAAAM,cAAA,gBACAN,CAAAA,CAAAA,CAAAO,cAAA,eACAP,CAAAA,CA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AAA,uBAAA,EAE/BH,CAAAA,CAAAA,CAAAA,CAAA,CAA3BC,CAAAA,CAAS,CAAErC,IAAAA,CAAMwC,UAA8BpG,CAAAmG,CAAAA,SAAAA,CAAA,SAAA,CAAA,IAAA,EAAA,CAAA,CAEpBH,CAAA,CAAA,CAA3BC,EAAS,CAAErC,IAAAA,CAAMsC,UAAwClG,CAAAmG,CAAAA,SAAAA,CAAA,mBAAA,EAQ1DH,CAAAA,CAAAA,CAAAA,CAAA,CADCK,CAAAA,CAAM,CAAC,SAAA,CAAA,CAAY,CAAEC,oBAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAG3CtG,CAAAmG,CAAAA,SAAAA,CAAA,sBAAA,CAAA,IAAA,CAAA,CAAApG,OAAA,KAvBUC,EAAYgG,CAAA,CAAA,CADxBO,CAAc,CAAA,eAAA,CAAA,CAAA,CACFvG"}
@@ -1,2 +1,2 @@
1
- System.register(["../index-cd83c5c8.cjs.js"],function(_export,_context){"use strict";var r,_templateObject,e;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}return{setters:[function(_index001CjsJs){r=_index001CjsJs.i;}],execute:function(){_export("s",e=r(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n width: 100%;\n box-sizing: border-box;\n }\n\n .switcher-icon-container {\n cursor: pointer;\n justify-content: center;\n display: flex;\n align-items: center;\n margin-bottom: 6px;\n height: 28px;\n width: 28px;\n border-radius: 4px;\n }\n\n .switcher-icon-container.current {\n background: var(--nile-colors-blue-400);\n }\n\n .switcher-input-container {\n display: flex;\n }\n\n .switcher-inline {\n gap: 0.5rem;\n }\n\n .switcher-block {\n flex-direction: column;\n }\n\n .switcher-block > :first-child {\n align-self: end;\n }\n\n .switcher-inline > :nth-child(2) {\n flex: 1;\n }\n\n .switcher-input-container > :first-child {\n display: flex;\n gap: 0.5rem;\n max-height: 38px;\n align-items: center;\n }\n\n nile-radio {\n display: inline-block;\n padding-right: 10px;\n }\n\n nile-code-editor {\n overflow: hidden;\n padding-top: 2px;\n border-radius: 5px;\n border: 1px solid rgb(204, 204, 204);\n }\n\n .code-editor__no-border {\n border: none;\n }\n\n .switcher-object-mapper::part(input) {\n color: var(--nile-colors-primary-600);\n cursor: pointer;\n }\n\n .switcher-input--noborder::part(base) {\n border: none;\n }\n .switcher-object-mapper--noborder::part(base) {\n border: none;\n }\n"]))));}};});
1
+ System.register(["../index-cd83c5c8.cjs.js"],function(_export,_context){"use strict";var e,_templateObject,r;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}return{setters:[function(_index001CjsJs){e=_index001CjsJs.i;}],execute:function(){_export("s",r=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n width: 100%;\n box-sizing: border-box;\n }\n\n .switcher__label {\n display: flex;\n align-items: center;\n color: inherit;\n color: var(--nile-colors-dark-900);\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .switcher-icon-container.current {\n background: var(--nile-colors-blue-400);\n }\n\n .switcher-container {\n display: flex;\n }\n\n .switcher-inline {\n gap: 0.5rem;\n }\n\n .switcher-block {\n flex-direction: column;\n }\n\n .switcher-inline > :nth-child(2) {\n flex: 1;\n }\n\n .switcher-icons-container {\n display: flex;\n margin-left: auto;\n gap: 0.5rem;\n max-height: 38px;\n align-items: center;\n }\n\n .switcher-block > .switcher-icons-container {\n margin-left: auto;\n }\n\n .label-container {\n display: flex;\n }\n\n .switcher-icon-container {\n cursor: pointer;\n justify-content: center;\n display: flex;\n align-items: center;\n margin-bottom: 6px;\n height: 28px;\n width: 28px;\n border-radius: 4px;\n }\n nile-radio {\n display: inline-block;\n padding-right: 10px;\n }\n\n nile-code-editor {\n overflow: hidden;\n padding-top: 2px;\n border-radius: 5px;\n border: 1px solid rgb(204, 204, 204);\n }\n\n .code-editor__no-border {\n border: none;\n }\n\n .switcher-object-mapper::part(input) {\n color: var(--nile-colors-primary-600);\n cursor: pointer;\n }\n\n .switcher-input--noborder::part(base) {\n border: none;\n }\n .switcher-object-mapper--noborder::part(base) {\n border: none;\n }\n"]))));}};});
2
2
  //# sourceMappingURL=nile-switcher.css.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-switcher.css.cjs.js","sources":["../../../src/nile-switcher/nile-switcher.css.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 { css } from 'lit-element';\n\n/**\n * FieldGenerator CSS\n */\nexport const styles = css`\n :host {\n width: 100%;\n box-sizing: border-box;\n }\n\n .switcher-icon-container {\n cursor: pointer;\n justify-content: center;\n display: flex;\n align-items: center;\n margin-bottom: 6px;\n height: 28px;\n width: 28px;\n border-radius: 4px;\n }\n\n .switcher-icon-container.current {\n background: var(--nile-colors-blue-400);\n }\n\n .switcher-input-container {\n display: flex;\n }\n\n .switcher-inline {\n gap: 0.5rem;\n }\n\n .switcher-block {\n flex-direction: column;\n }\n\n .switcher-block > :first-child {\n align-self: end;\n }\n\n .switcher-inline > :nth-child(2) {\n flex: 1;\n }\n\n .switcher-input-container > :first-child {\n display: flex;\n gap: 0.5rem;\n max-height: 38px;\n align-items: center;\n }\n\n nile-radio {\n display: inline-block;\n padding-right: 10px;\n }\n\n nile-code-editor {\n overflow: hidden;\n padding-top: 2px;\n border-radius: 5px;\n border: 1px solid rgb(204, 204, 204);\n }\n\n .code-editor__no-border {\n border: none;\n }\n\n .switcher-object-mapper::part(input) {\n color: var(--nile-colors-primary-600);\n cursor: pointer;\n }\n\n .switcher-input--noborder::part(base) {\n border: none;\n }\n .switcher-object-mapper--noborder::part(base) {\n border: none;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"gXAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
1
+ {"version":3,"file":"nile-switcher.css.cjs.js","sources":["../../../src/nile-switcher/nile-switcher.css.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 { css } from 'lit-element';\n\n/**\n * FieldGenerator CSS\n */\nexport const styles = css`\n :host {\n width: 100%;\n box-sizing: border-box;\n }\n\n .switcher__label {\n display: flex;\n align-items: center;\n color: inherit;\n color: var(--nile-colors-dark-900);\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .switcher-icon-container.current {\n background: var(--nile-colors-blue-400);\n }\n\n .switcher-container {\n display: flex;\n }\n\n .switcher-inline {\n gap: 0.5rem;\n }\n\n .switcher-block {\n flex-direction: column;\n }\n\n .switcher-inline > :nth-child(2) {\n flex: 1;\n }\n\n .switcher-icons-container {\n display: flex;\n margin-left: auto;\n gap: 0.5rem;\n max-height: 38px;\n align-items: center;\n }\n\n .switcher-block > .switcher-icons-container {\n margin-left: auto;\n }\n\n .label-container {\n display: flex;\n }\n\n .switcher-icon-container {\n cursor: pointer;\n justify-content: center;\n display: flex;\n align-items: center;\n margin-bottom: 6px;\n height: 28px;\n width: 28px;\n border-radius: 4px;\n }\n nile-radio {\n display: inline-block;\n padding-right: 10px;\n }\n\n nile-code-editor {\n overflow: hidden;\n padding-top: 2px;\n border-radius: 5px;\n border: 1px solid rgb(204, 204, 204);\n }\n\n .code-editor__no-border {\n border: none;\n }\n\n .switcher-object-mapper::part(input) {\n color: var(--nile-colors-primary-600);\n cursor: pointer;\n }\n\n .switcher-input--noborder::part(base) {\n border: none;\n }\n .switcher-object-mapper--noborder::part(base) {\n border: none;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"gXAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
@@ -1,25 +1,27 @@
1
- import{i as r}from"../index-cd2f9c12.esm.js";const e=r`
1
+ import{i as e}from"../index-cd2f9c12.esm.js";const r=e`
2
2
  :host {
3
3
  width: 100%;
4
4
  box-sizing: border-box;
5
5
  }
6
6
 
7
- .switcher-icon-container {
8
- cursor: pointer;
9
- justify-content: center;
7
+ .switcher__label {
10
8
  display: flex;
11
9
  align-items: center;
12
- margin-bottom: 6px;
13
- height: 28px;
14
- width: 28px;
15
- border-radius: 4px;
10
+ color: inherit;
11
+ color: var(--nile-colors-dark-900);
12
+ font-family: Colfax-regular;
13
+ font-size: 14px;
14
+ font-style: normal;
15
+ font-weight: 400;
16
+ line-height: 14px;
17
+ letter-spacing: 0.2px;
16
18
  }
17
19
 
18
20
  .switcher-icon-container.current {
19
21
  background: var(--nile-colors-blue-400);
20
22
  }
21
23
 
22
- .switcher-input-container {
24
+ .switcher-container {
23
25
  display: flex;
24
26
  }
25
27
 
@@ -31,21 +33,36 @@ import{i as r}from"../index-cd2f9c12.esm.js";const e=r`
31
33
  flex-direction: column;
32
34
  }
33
35
 
34
- .switcher-block > :first-child {
35
- align-self: end;
36
- }
37
-
38
36
  .switcher-inline > :nth-child(2) {
39
37
  flex: 1;
40
38
  }
41
39
 
42
- .switcher-input-container > :first-child {
40
+ .switcher-icons-container {
43
41
  display: flex;
42
+ margin-left: auto;
44
43
  gap: 0.5rem;
45
44
  max-height: 38px;
46
45
  align-items: center;
47
46
  }
48
47
 
48
+ .switcher-block > .switcher-icons-container {
49
+ margin-left: auto;
50
+ }
51
+
52
+ .label-container {
53
+ display: flex;
54
+ }
55
+
56
+ .switcher-icon-container {
57
+ cursor: pointer;
58
+ justify-content: center;
59
+ display: flex;
60
+ align-items: center;
61
+ margin-bottom: 6px;
62
+ height: 28px;
63
+ width: 28px;
64
+ border-radius: 4px;
65
+ }
49
66
  nile-radio {
50
67
  display: inline-block;
51
68
  padding-right: 10px;
@@ -73,4 +90,4 @@ import{i as r}from"../index-cd2f9c12.esm.js";const e=r`
73
90
  .switcher-object-mapper--noborder::part(base) {
74
91
  border: none;
75
92
  }
76
- `;export{e as s};
93
+ `;export{r as s};
@@ -1,22 +1,22 @@
1
- import{__decorate as e}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";import{customElement as t}from"lit/decorators.js";import{s as r}from"./nile-switcher.css.esm.js";import{N as s}from"../internal/nile-element.esm.js";import{choose as n}from"lit/directives/choose.js";import{classMap as o}from"lit/directives/class-map.js";import{repeat as l}from"lit/directives/repeat.js";import{w as c}from"../internal/watch.esm.js";import{n as a}from"../property-09139d3c.esm.js";import"lit";var d,h,p,u;!function(e){e.INLINE="inline",e.BLOCK="block"}(d||(d={})),function(e){e.DEFAULT="defaultInput",e.SWITCH="switchInput"}(h||(h={})),function(e){e.DROPDOWN="dropdown",e.TEXT="text",e.CHECKBOX="checkbox",e.TEXTAREA="text-area",e.RADIO="radio",e.CONTENTEDITOR="content-editor",e.OBJECT_MAPPER="object-mapper",e.CODE_EDITOR="code-editor"}(p||(p={})),function(e){e.CREATE="create",e.EDIT="edit"}(u||(u={}));let $=class extends s{constructor(){super(...arguments),this.current=0}connectedCallback(){super.connectedCallback(),this.setCurrentInput(),this.emit("nile-init")}handleSwitcherChange(){this.setCurrentInput()}setCurrentInput(){this.nileSwitchConfig?.inputs&&(this.currentInput=this.nileSwitchConfig.inputs.filter(((e,i)=>i===this.current))[0])}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}renderNileText(e){const{value:t,label:r,placeholder:s,disabled:n,required:l,error:c,errorMessage:a,inputType:d,noborder:h}=e;return i`<nile-input
1
+ import{__decorate as e}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";import{customElement as t}from"lit/decorators.js";import{s as r}from"./nile-switcher.css.esm.js";import{N as s}from"../internal/nile-element.esm.js";import{choose as n}from"lit/directives/choose.js";import{classMap as o}from"lit/directives/class-map.js";import{repeat as l}from"lit/directives/repeat.js";import{w as a}from"../internal/watch.esm.js";import{H as c}from"../internal/slot.esm.js";import{n as d}from"../property-09139d3c.esm.js";import"lit";var h,p,u,$;!function(e){e.INLINE="inline",e.BLOCK="block"}(h||(h={})),function(e){e.DEFAULT="defaultInput",e.SWITCH="switchInput"}(p||(p={})),function(e){e.DROPDOWN="dropdown",e.TEXT="text",e.CHECKBOX="checkbox",e.TEXTAREA="text-area",e.RADIO="radio",e.CONTENTEDITOR="content-editor",e.OBJECT_MAPPER="object-mapper",e.CODE_EDITOR="code-editor"}(u||(u={})),function(e){e.CREATE="create",e.EDIT="edit"}($||($={}));let m=class extends s{constructor(){super(...arguments),this.hasSlotController=new c(this,"label"),this.current=0}connectedCallback(){super.connectedCallback(),this.emit("nile-init")}handleSwitcherChange(){this.setCurrentInput()}setCurrentInput(){this.nileSwitchConfig?.inputs&&(this.currentInput=this.nileSwitchConfig.inputs.filter(((e,i)=>i===this.current))[0])}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}renderNileText(e){const{value:t,label:r,placeholder:s,disabled:n,required:l,error:a,errorMessage:c,inputType:d,noborder:h}=e;return i`<nile-input
2
2
  class=${o({"switcher-input":!0,"switcher-input--noborder":!!h})}
3
3
  .value=${t}
4
4
  .label=${r}
5
5
  .disabled=${n}
6
6
  .required=${l}
7
- .errorMessage=${a}
7
+ .errorMessage=${c}
8
8
  .placeholder=${s}
9
- .error=${c}
9
+ .error=${a}
10
10
  @nile-input=${e=>{this.handleChange(e,d)}}
11
- ></nile-input>`}renderDropdown(e){const{options:t,multiple:r,placeholder:s,disabled:n,value:o,error:l,errorMessage:c,inputType:a}=e;return i`<nile-select
11
+ ></nile-input>`}renderDropdown(e){const{options:t,multiple:r,placeholder:s,disabled:n,value:o,error:l,errorMessage:a,inputType:c}=e;return i`<nile-select
12
12
  class="switcher-dropdown"
13
13
  .placeholder=${s}
14
14
  .disabled="${n}"
15
15
  .multiple="${r}"
16
16
  .value="${o}"
17
17
  .error="${l}"
18
- .errorMessage="${c}"
19
- @nile-change=${e=>{this.handleChange(e,a)}}
18
+ .errorMessage="${a}"
19
+ @nile-change=${e=>{this.handleChange(e,c)}}
20
20
  >
21
21
  ${t?.map((e=>i`<nile-option .value="${e}">${e} </nile-option>`))}
22
22
  </nile-select>`}renderNileTextArea(e){const{value:t,disabled:r,readonly:s,errorMessage:n,error:o,inputType:l}=e;return i`<nile-textarea
@@ -44,9 +44,9 @@ import{__decorate as e}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";
44
44
  ${l?this.renderErrorMessage(n):""}
45
45
  </nile-radio-group> `}renderErrorMessage(e){return i`
46
46
  <nile-form-error-message>${e}</nile-form-error-message>
47
- `}renderContentEditor(e){let{options:t,inputType:r,errorMessage:s,type:n,readonly:o,noborder:l,value:c}=e;return i`<nile-content-editor
47
+ `}renderContentEditor(e){let{options:t,inputType:r,errorMessage:s,type:n,readonly:o,noborder:l,value:a}=e;return i`<nile-content-editor
48
48
  class="switcher-content-editor"
49
- .value=${c}
49
+ .value=${a}
50
50
  .options=${t}
51
51
  .type=${n}
52
52
  .readonly=${o}
@@ -54,11 +54,11 @@ import{__decorate as e}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";
54
54
  .errorMessage=${s}
55
55
  @nile-change=${e=>{this.handleChange(e,r)}}
56
56
  >
57
- </nile-content-editor>`}renderObjectMapper(){const e=this.currentInput.noborder;this.currentInput.mode;const t=this.currentInput.mode===u.CREATE?"Click to Create - Not Mapped":"";return i`<nile-input
57
+ </nile-content-editor>`}renderObjectMapper(){const e=this.currentInput.noborder;this.currentInput.mode;const t=this.currentInput.mode===$.CREATE?"Click to Create - Not Mapped":"";return i`<nile-input
58
58
  class=${o({"switcher-object-mapper":!0,"switcher-object-mapper--noborder":!!e})}
59
59
  .value=${t}
60
60
  readonly="true"
61
- @click="${e=>this.handleChange(e,p.OBJECT_MAPPER)}"
61
+ @click="${e=>this.handleChange(e,u.OBJECT_MAPPER)}"
62
62
  >
63
63
  <nile-icon
64
64
  class="pointer-cursor switcher-object-mapper-icon"
@@ -68,16 +68,16 @@ import{__decorate as e}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";
68
68
  size="16"
69
69
  >
70
70
  </nile-icon>
71
- </nile-input>`}renderCodeEditor(e){const{value:t,multiLine:r,options:s,disabled:n,readonly:l,errorMessage:c,error:a,inputType:d,noborder:h}=e;return i`<nile-code-editor
71
+ </nile-input>`}renderCodeEditor(e){const{value:t,multiLine:r,customAutoCompletions:s,disabled:n,readonly:l,errorMessage:a,error:c,inputType:d,noborder:h}=e;return i`<nile-code-editor
72
72
  class=${o({"code-editor":!0,"code-editor__no-border":!!h})}
73
- @nile-expand="${e=>this.handleExpand(e,p.CODE_EDITOR)}"
74
- @nile-change="${e=>this.handleChange(e,p.CODE_EDITOR)}"
73
+ @nile-expand="${e=>this.handleExpand(e,u.CODE_EDITOR)}"
74
+ @nile-change="${e=>this.handleChange(e,u.CODE_EDITOR)}"
75
75
  .multiline="${r}"
76
76
  .value="${t}"
77
77
  .customOptions="${s}"
78
78
  .showLineNumbers="false"
79
- ></nile-code-editor> `}handleExpand(e,i){this.currentInput.expand=e.detail.expand,this.emit("nile-change",{input:this.currentInput})}handleChange(e,i){switch(i){case p.OBJECT_MAPPER:this.currentInput.value="clicked";break;case p.CHECKBOX:this.currentInput.value=e.detail.checked;break;case p.CODE_EDITOR:default:this.currentInput.value=e.detail.value}e.stopPropagation(),this.emit("nile-change",{input:this.currentInput})}renderIcon(){const e=this.nileSwitchConfig.inputs,t=this.nileSwitchConfig.align===d.BLOCK?"top":"bottom";return i`
80
- <div class="switcher-icons-container">
79
+ ></nile-code-editor> `}handleExpand(e,i){this.currentInput.expand=e.detail.expand,this.emit("nile-change",{input:this.currentInput})}handleChange(e,i){switch(i){case u.OBJECT_MAPPER:this.currentInput.value="clicked";break;case u.CHECKBOX:this.currentInput.value=e.detail.checked;break;case u.CODE_EDITOR:default:this.currentInput.value=e.detail.value}e.stopPropagation(),this.emit("nile-change",{input:this.currentInput})}renderIcon(){const e=this.nileSwitchConfig.inputs,t=this.nileSwitchConfig.align===h.BLOCK?"top":"bottom";return i`
80
+ <div part="icons-container" class="switcher-icons-container">
81
81
  ${l(e,((e,r)=>i` <nile-tooltip
82
82
  class=${o({"switcher-tooltip-container":!0})}
83
83
  content=${e.helperText}
@@ -95,10 +95,22 @@ import{__decorate as e}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";
95
95
 
96
96
  </nile-tooltip>`))}
97
97
  </div>
98
- `}toggleField(e,i){this.current=i,this.emit("nile-switch",{input:this.currentInput})}singleFieldSwitcher(){return i`
99
- ${n(this.currentInput.inputType,[[p.TEXT,()=>this.renderNileText(this.currentInput)],[p.CHECKBOX,()=>this.renderNileCheckBox(this.currentInput)],[p.TEXTAREA,()=>this.renderNileTextArea(this.currentInput)],[p.RADIO,()=>this.renderNileRadio(this.currentInput)],[p.DROPDOWN,()=>this.renderDropdown(this.currentInput)],[p.CONTENTEDITOR,()=>this.renderContentEditor(this.currentInput)],[p.OBJECT_MAPPER,()=>this.renderObjectMapper()],[p.CODE_EDITOR,()=>this.renderCodeEditor(this.currentInput)]],(()=>this.renderNileText(this.currentInput)))}
100
- `}render(){const e=this.nileSwitchConfig.align;return i`<div
101
- class=${o({"switcher-block":e===d.BLOCK,"switcher-inline":e===d.INLINE,"switcher-input-container":!0})}
98
+ `}toggleField(e,i){this.nileSwitchConfig.confirmation&&(this.current=i),this.emit("nile-switch",{input:this.currentInput})}singleFieldSwitcher(){return this.currentInput||this.setCurrentInput(),i`
99
+ ${n(this.currentInput.inputType,[[u.TEXT,()=>this.renderNileText(this.currentInput)],[u.CHECKBOX,()=>this.renderNileCheckBox(this.currentInput)],[u.TEXTAREA,()=>this.renderNileTextArea(this.currentInput)],[u.RADIO,()=>this.renderNileRadio(this.currentInput)],[u.DROPDOWN,()=>this.renderDropdown(this.currentInput)],[u.CONTENTEDITOR,()=>this.renderContentEditor(this.currentInput)],[u.OBJECT_MAPPER,()=>this.renderObjectMapper()],[u.CODE_EDITOR,()=>this.renderCodeEditor(this.currentInput)]],(()=>this.renderNileText(this.currentInput)))}
100
+ `}render(){const e=this.hasSlotController.test("label"),t=this.nileSwitchConfig.align;return i`<div
101
+ class=${o({"switcher-block":t===h.BLOCK,"switcher-inline":t===h.INLINE,"switcher-container":!0})}
102
102
  >
103
- ${this.renderIcon()} ${this.singleFieldSwitcher()}
104
- </div>`}};$.styles=r,e([a({type:Object})],$.prototype,"nileSwitchConfig",void 0),e([a({type:Number})],$.prototype,"current",void 0),e([a({type:Object})],$.prototype,"currentInput",void 0),e([c(["current"],{waitUntilFirstUpdate:!0})],$.prototype,"handleSwitcherChange",null),$=e([t("nile-switcher")],$);export{$ as N};
103
+ <div class="label-container">
104
+ ${e?i`
105
+ <label
106
+ part="switcher-label"
107
+ class="switcher__label"
108
+ for="input"
109
+ >
110
+ <slot name="label"></slot>
111
+ </label>
112
+ </div> `:""}
113
+ ${this.renderIcon()}
114
+ </div>
115
+ ${this.singleFieldSwitcher()}
116
+ </div>`}};m.styles=r,e([d({type:Object})],m.prototype,"nileSwitchConfig",void 0),e([d({type:Number})],m.prototype,"current",void 0),e([d({type:Object})],m.prototype,"currentInput",void 0),e([a(["current"],{waitUntilFirstUpdate:!0})],m.prototype,"handleSwitcherChange",null),m=e([t("nile-switcher")],m);export{m as N};
@@ -10,7 +10,7 @@ import { customElement, query } from 'lit/decorators.js';
10
10
  import { styles } from './nile-code-editor.css';
11
11
  import { EditorView } from 'codemirror';
12
12
  import { EditorState, Compartment } from '@codemirror/state';
13
- import { javascript, javascriptLanguage } from '@codemirror/lang-javascript';
13
+ import { javascript, javascriptLanguage, scopeCompletionSource, } from '@codemirror/lang-javascript';
14
14
  import { autocompletion } from '@codemirror/autocomplete';
15
15
  import NileElement from '../internal/nile-element';
16
16
  import { basicSetup } from './extensionSetup';
@@ -43,7 +43,7 @@ let NileCodeEditor = class NileCodeEditor extends NileElement {
43
43
  }
44
44
  updated() {
45
45
  const customAutoCompletions = javascriptLanguage.data.of({
46
- autocomplete: this.customOptions,
46
+ autocomplete: scopeCompletionSource(this.customOptions),
47
47
  });
48
48
  let startState = EditorState.create({
49
49
  doc: !this.multiline ? this.convertToSingleLine(this.value) : this.value,
@@ -1 +1 @@
1
- {"version":3,"file":"nile-code-editor.js","sourceRoot":"","sources":["../../../src/nile-code-editor/nile-code-editor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,EACJ,QAAQ,GAGT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,gDAAgD;AAEhD;;;;;GAKG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,WAAW;IAAxC;;QAyBL,oBAAe,GAAG,IAAI,WAAW,EAAE,CAAC;QA0DpC,gBAAgB;IAClB,CAAC;IA7EC;;;OAGG;IACI,MAAM,KAAK,MAAM;QACtB,OAAO,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAED,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;IAC5B,CAAC;IAID,mBAAmB,CAAC,IAAS;QAC3B,gDAAgD;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI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CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,kBAAkB;QAChB,OAAO,WAAW,CAAC,iBAAiB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAC3C,EAAE,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAC9B,CAAC;IACJ,CAAC;IACM,MAAM;QACX,OAAO,IAAI,CAAA;QACP,CAAC,IAAI,CAAC,SAAS;YACf,CAAC,CAAC,IAAI,CAAA;;;;;sBAKQ,CAAC,CAAc,EAAE,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE;wBACzC;YAChB,CAAC,CAAC,EAAE;WACD,CAAC;IACV,CAAC;CAGF,CAAA;AAnFwB;IAAtB,KAAK,CAAC,cAAc,CAAC;kDAA8B;AACvB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDAAiB;AACjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAa;AACZ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAAoB;AACnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAAsB;AALtC,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAoF1B;SApFY,cAAc;AAsF3B,eAAe,cAAc,CAAC","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 } from 'lit/decorators.js';\nimport { styles } from './nile-code-editor.css';\nimport { EditorView } from 'codemirror';\nimport { ViewUpdate } from '@codemirror/view';\nimport { EditorState, Compartment } from '@codemirror/state';\nimport { javascript, javascriptLanguage } from '@codemirror/lang-javascript';\nimport { autocompletion } from '@codemirror/autocomplete';\nimport { CompletionContext } from '@codemirror/autocomplete';\nimport NileElement from '../internal/nile-element';\nimport { basicSetup } from './extensionSetup';\n\n// Choose the appropriate mode for your use case\n\n/**\n * Nile icon component.\n *\n * @tag nile-code-editor\n *\n */\n@customElement('nile-code-editor')\nexport class NileCodeEditor extends NileElement {\n @query('.code-mirror') codeEditor: HTMLInputElement;\n @property({ type: Boolean }) multiline: true;\n @property({ type: String }) value: true;\n @property({ type: String }) customOptions: any;\n @property({ type: String }) showLineNumbers: any;\n\n /**\n * The styles for CodeEditor\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n }\n\n view: EditorView;\n\n convertToSingleLine(code: any) {\n // Remove line breaks and unnecessary whitespace\n return code.replace(/\\s+/g, ' ').trim();\n }\n lineNumbersComp = new Compartment();\n\n updated() {\n const customAutoCompletions = javascriptLanguage.data.of({\n autocomplete: this.customOptions,\n });\n let startState = EditorState.create({\n doc: !this.multiline ? this.convertToSingleLine(this.value) : this.value,\n extensions: [\n basicSetup({\n lineNumbers: !!this.showLineNumbers,\n foldGutter: !this.multiline ? false : true,\n }),\n customAutoCompletions,\n autocompletion(),\n javascript(),\n !this.multiline ? this.restrictSingleLine() : [],\n EditorView.updateListener.of((v: ViewUpdate) => {\n if (v.docChanged) {\n this.emitValues(this.view.state.doc.toString());\n }\n }),\n ],\n });\n\n this.view = new EditorView({\n state: startState,\n parent: this.codeEditor,\n });\n }\n\n emitValues(value: string) {\n this.emit('nile-change', { value: value });\n }\n\n expandCodeEditor() {\n this.emit('nile-expand', { expand: true });\n }\n\n restrictSingleLine() {\n return EditorState.transactionFilter.of(tr =>\n tr.newDoc.lines > 1 ? [] : tr\n );\n }\n public render(): TemplateResult {\n return html`<div class=\"code-mirror\">\n ${!this.multiline\n ? html`<nile-icon\n name=\"fullscreenshrink\"\n class=\"code-editor__icon__container\"\n size=\"16\"\n color=\"black\"\n @click=\"${(e: CustomEvent) => this.expandCodeEditor()}\"\n ></nile-icon>`\n : ''}\n </div>`;\n }\n\n /* #endregion */\n}\n\nexport default NileCodeEditor;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-code-editor': NileCodeEditor;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-code-editor.js","sourceRoot":"","sources":["../../../src/nile-code-editor/nile-code-editor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,EACJ,QAAQ,GAGT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,qBAAqB,GAEtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,gDAAgD;AAEhD;;;;;GAKG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,WAAW;IAAxC;;QAyBL,oBAAe,GAAG,IAAI,WAAW,EAAE,CAAC;QA0DpC,gBAAgB;IAClB,CAAC;IA7EC;;;OAGG;IACI,MAAM,KAAK,MAAM;QACtB,OAAO,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAED,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;IAC5B,CAAC;IAID,mBAAmB,CAAC,IAAS;QAC3B,gDAAgD;Q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AAa,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,gBAAgB;QACd,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,kBAAkB;QAChB,OAAO,WAAW,CAAC,iBAAiB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAC3C,EAAE,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAC9B,CAAC;IACJ,CAAC;IACM,MAAM;QACX,OAAO,IAAI,CAAA;QACP,CAAC,IAAI,CAAC,SAAS;YACf,CAAC,CAAC,IAAI,CAAA;;;;;sBAKQ,CAAC,CAAc,EAAE,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE;wBACzC;YAChB,CAAC,CAAC,EAAE;WACD,CAAC;IACV,CAAC;CAGF,CAAA;AAnFwB;IAAtB,KAAK,CAAC,cAAc,CAAC;kDAA8B;AACvB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;iDAAiB;AACjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAa;AACZ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAAoB;AACnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAAsB;AALtC,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAoF1B;SApFY,cAAc;AAsF3B,eAAe,cAAc,CAAC","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 } from 'lit/decorators.js';\nimport { styles } from './nile-code-editor.css';\nimport { EditorView } from 'codemirror';\nimport { ViewUpdate } from '@codemirror/view';\nimport { EditorState, Compartment } from '@codemirror/state';\nimport {\n javascript,\n javascriptLanguage,\n scopeCompletionSource,\n completionPath,\n} from '@codemirror/lang-javascript';\nimport { autocompletion } from '@codemirror/autocomplete';\nimport { CompletionContext, Completion } from '@codemirror/autocomplete';\nimport NileElement from '../internal/nile-element';\nimport { basicSetup } from './extensionSetup';\n\n// Choose the appropriate mode for your use case\n\n/**\n * Nile icon component.\n *\n * @tag nile-code-editor\n *\n */\n@customElement('nile-code-editor')\nexport class NileCodeEditor extends NileElement {\n @query('.code-mirror') codeEditor: HTMLInputElement;\n @property({ type: Boolean }) multiline: true;\n @property({ type: String }) value: true;\n @property({ type: String }) customOptions: any;\n @property({ type: String }) showLineNumbers: any;\n\n /**\n * The styles for CodeEditor\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n }\n\n view: EditorView;\n\n convertToSingleLine(code: any) {\n // Remove line breaks and unnecessary whitespace\n return code.replace(/\\s+/g, ' ').trim();\n }\n lineNumbersComp = new Compartment();\n\n updated() {\n const customAutoCompletions = javascriptLanguage.data.of({\n autocomplete: scopeCompletionSource(this.customOptions),\n });\n let startState = EditorState.create({\n doc: !this.multiline ? this.convertToSingleLine(this.value) : this.value,\n extensions: [\n basicSetup({\n lineNumbers: !!this.showLineNumbers,\n foldGutter: !this.multiline ? false : true,\n }),\n customAutoCompletions,\n autocompletion(),\n javascript(),\n !this.multiline ? this.restrictSingleLine() : [],\n EditorView.updateListener.of((v: ViewUpdate) => {\n if (v.docChanged) {\n this.emitValues(this.view.state.doc.toString());\n }\n }),\n ],\n });\n\n this.view = new EditorView({\n state: startState,\n parent: this.codeEditor,\n });\n }\n\n emitValues(value: string) {\n this.emit('nile-change', { value: value });\n }\n\n expandCodeEditor() {\n this.emit('nile-expand', { expand: true });\n }\n\n restrictSingleLine() {\n return EditorState.transactionFilter.of(tr =>\n tr.newDoc.lines > 1 ? [] : tr\n );\n }\n public render(): TemplateResult {\n return html`<div class=\"code-mirror\">\n ${!this.multiline\n ? html`<nile-icon\n name=\"fullscreenshrink\"\n class=\"code-editor__icon__container\"\n size=\"16\"\n color=\"black\"\n @click=\"${(e: CustomEvent) => this.expandCodeEditor()}\"\n ></nile-icon>`\n : ''}\n </div>`;\n }\n\n /* #endregion */\n}\n\nexport default NileCodeEditor;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-code-editor': NileCodeEditor;\n }\n}\n"]}
@@ -14,22 +14,24 @@ export const styles = css `
14
14
  box-sizing: border-box;
15
15
  }
16
16
 
17
- .switcher-icon-container {
18
- cursor: pointer;
19
- justify-content: center;
17
+ .switcher__label {
20
18
  display: flex;
21
19
  align-items: center;
22
- margin-bottom: 6px;
23
- height: 28px;
24
- width: 28px;
25
- border-radius: 4px;
20
+ color: inherit;
21
+ color: var(--nile-colors-dark-900);
22
+ font-family: Colfax-regular;
23
+ font-size: 14px;
24
+ font-style: normal;
25
+ font-weight: 400;
26
+ line-height: 14px;
27
+ letter-spacing: 0.2px;
26
28
  }
27
29
 
28
30
  .switcher-icon-container.current {
29
31
  background: var(--nile-colors-blue-400);
30
32
  }
31
33
 
32
- .switcher-input-container {
34
+ .switcher-container {
33
35
  display: flex;
34
36
  }
35
37
 
@@ -41,21 +43,36 @@ export const styles = css `
41
43
  flex-direction: column;
42
44
  }
43
45
 
44
- .switcher-block > :first-child {
45
- align-self: end;
46
- }
47
-
48
46
  .switcher-inline > :nth-child(2) {
49
47
  flex: 1;
50
48
  }
51
49
 
52
- .switcher-input-container > :first-child {
50
+ .switcher-icons-container {
53
51
  display: flex;
52
+ margin-left: auto;
54
53
  gap: 0.5rem;
55
54
  max-height: 38px;
56
55
  align-items: center;
57
56
  }
58
57
 
58
+ .switcher-block > .switcher-icons-container {
59
+ margin-left: auto;
60
+ }
61
+
62
+ .label-container {
63
+ display: flex;
64
+ }
65
+
66
+ .switcher-icon-container {
67
+ cursor: pointer;
68
+ justify-content: center;
69
+ display: flex;
70
+ align-items: center;
71
+ margin-bottom: 6px;
72
+ height: 28px;
73
+ width: 28px;
74
+ border-radius: 4px;
75
+ }
59
76
  nile-radio {
60
77
  display: inline-block;
61
78
  padding-right: 10px;
@@ -1 +1 @@
1
- {"version":3,"file":"nile-switcher.css.js","sourceRoot":"","sources":["../../../src/nile-switcher/nile-switcher.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2ExB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","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 { css } from 'lit-element';\n\n/**\n * FieldGenerator CSS\n */\nexport const styles = css`\n :host {\n width: 100%;\n box-sizing: border-box;\n }\n\n .switcher-icon-container {\n cursor: pointer;\n justify-content: center;\n display: flex;\n align-items: center;\n margin-bottom: 6px;\n height: 28px;\n width: 28px;\n border-radius: 4px;\n }\n\n .switcher-icon-container.current {\n background: var(--nile-colors-blue-400);\n }\n\n .switcher-input-container {\n display: flex;\n }\n\n .switcher-inline {\n gap: 0.5rem;\n }\n\n .switcher-block {\n flex-direction: column;\n }\n\n .switcher-block > :first-child {\n align-self: end;\n }\n\n .switcher-inline > :nth-child(2) {\n flex: 1;\n }\n\n .switcher-input-container > :first-child {\n display: flex;\n gap: 0.5rem;\n max-height: 38px;\n align-items: center;\n }\n\n nile-radio {\n display: inline-block;\n padding-right: 10px;\n }\n\n nile-code-editor {\n overflow: hidden;\n padding-top: 2px;\n border-radius: 5px;\n border: 1px solid rgb(204, 204, 204);\n }\n\n .code-editor__no-border {\n border: none;\n }\n\n .switcher-object-mapper::part(input) {\n color: var(--nile-colors-primary-600);\n cursor: pointer;\n }\n\n .switcher-input--noborder::part(base) {\n border: none;\n }\n .switcher-object-mapper--noborder::part(base) {\n border: none;\n }\n`;\n\nexport default [styles];\n"]}
1
+ {"version":3,"file":"nile-switcher.css.js","sourceRoot":"","sources":["../../../src/nile-switcher/nile-switcher.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4FxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","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 { css } from 'lit-element';\n\n/**\n * FieldGenerator CSS\n */\nexport const styles = css`\n :host {\n width: 100%;\n box-sizing: border-box;\n }\n\n .switcher__label {\n display: flex;\n align-items: center;\n color: inherit;\n color: var(--nile-colors-dark-900);\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .switcher-icon-container.current {\n background: var(--nile-colors-blue-400);\n }\n\n .switcher-container {\n display: flex;\n }\n\n .switcher-inline {\n gap: 0.5rem;\n }\n\n .switcher-block {\n flex-direction: column;\n }\n\n .switcher-inline > :nth-child(2) {\n flex: 1;\n }\n\n .switcher-icons-container {\n display: flex;\n margin-left: auto;\n gap: 0.5rem;\n max-height: 38px;\n align-items: center;\n }\n\n .switcher-block > .switcher-icons-container {\n margin-left: auto;\n }\n\n .label-container {\n display: flex;\n }\n\n .switcher-icon-container {\n cursor: pointer;\n justify-content: center;\n display: flex;\n align-items: center;\n margin-bottom: 6px;\n height: 28px;\n width: 28px;\n border-radius: 4px;\n }\n nile-radio {\n display: inline-block;\n padding-right: 10px;\n }\n\n nile-code-editor {\n overflow: hidden;\n padding-top: 2px;\n border-radius: 5px;\n border: 1px solid rgb(204, 204, 204);\n }\n\n .code-editor__no-border {\n border: none;\n }\n\n .switcher-object-mapper::part(input) {\n color: var(--nile-colors-primary-600);\n cursor: pointer;\n }\n\n .switcher-input--noborder::part(base) {\n border: none;\n }\n .switcher-object-mapper--noborder::part(base) {\n border: none;\n }\n`;\n\nexport default [styles];\n"]}