@aquera/nile-elements 0.0.34 → 0.0.36

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 (59) hide show
  1. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.css.js +5 -5
  2. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -1
  3. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.d.ts +4 -2
  4. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.js +64 -30
  5. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
  6. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/theme.d.ts +9 -0
  7. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/theme.js +10 -0
  8. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/theme.js.map +1 -0
  9. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js +42 -12
  10. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
  11. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.d.ts +1 -0
  12. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +27 -6
  13. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js.map +1 -1
  14. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
  15. package/dist/index.cjs.js +1 -1
  16. package/dist/index.esm.js +1 -1
  17. package/dist/index.iife.js +261 -214
  18. package/dist/nile-code-editor/extensionSetup.cjs.js +1 -1
  19. package/dist/nile-code-editor/extensionSetup.cjs.js.map +1 -1
  20. package/dist/nile-code-editor/extensionSetup.esm.js +1 -1
  21. package/dist/nile-code-editor/index.cjs.js +1 -1
  22. package/dist/nile-code-editor/index.esm.js +1 -1
  23. package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
  24. package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
  25. package/dist/nile-code-editor/nile-code-editor.css.cjs.js +1 -1
  26. package/dist/nile-code-editor/nile-code-editor.css.cjs.js.map +1 -1
  27. package/dist/nile-code-editor/nile-code-editor.css.esm.js +5 -5
  28. package/dist/nile-code-editor/nile-code-editor.esm.js +6 -3
  29. package/dist/nile-code-editor/theme.cjs.js +2 -0
  30. package/dist/nile-code-editor/theme.cjs.js.map +1 -0
  31. package/dist/nile-code-editor/theme.esm.js +1 -0
  32. package/dist/nile-switcher/index.cjs.js +1 -1
  33. package/dist/nile-switcher/index.esm.js +1 -1
  34. package/dist/nile-switcher/nile-switcher.cjs.js +1 -1
  35. package/dist/nile-switcher/nile-switcher.cjs.js.map +1 -1
  36. package/dist/nile-switcher/nile-switcher.css.cjs.js +1 -1
  37. package/dist/nile-switcher/nile-switcher.css.cjs.js.map +1 -1
  38. package/dist/nile-switcher/nile-switcher.css.esm.js +44 -14
  39. package/dist/nile-switcher/nile-switcher.esm.js +50 -36
  40. package/dist/src/nile-code-editor/nile-code-editor.css.js +5 -5
  41. package/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -1
  42. package/dist/src/nile-code-editor/nile-code-editor.d.ts +4 -2
  43. package/dist/src/nile-code-editor/nile-code-editor.js +64 -30
  44. package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
  45. package/dist/src/nile-code-editor/theme.d.ts +9 -0
  46. package/dist/src/nile-code-editor/theme.js +10 -0
  47. package/dist/src/nile-code-editor/theme.js.map +1 -0
  48. package/dist/src/nile-switcher/nile-switcher.css.js +42 -12
  49. package/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
  50. package/dist/src/nile-switcher/nile-switcher.d.ts +1 -0
  51. package/dist/src/nile-switcher/nile-switcher.js +27 -6
  52. package/dist/src/nile-switcher/nile-switcher.js.map +1 -1
  53. package/dist/tsconfig.tsbuildinfo +1 -1
  54. package/package.json +1 -1
  55. package/src/nile-code-editor/nile-code-editor.css.ts +5 -5
  56. package/src/nile-code-editor/nile-code-editor.ts +68 -30
  57. package/src/nile-code-editor/theme.ts +9 -0
  58. package/src/nile-switcher/nile-switcher.css.ts +42 -12
  59. package/src/nile-switcher/nile-switcher.ts +29 -6
@@ -0,0 +1,2 @@
1
+ System.register([],function(_export,_context){"use strict";var o;return{setters:[],execute:function(){_export("T",o={"&":{fontSize:"14px",fontFamily:"Colfax-regular",fontWeight:"400"},".cm-content":{},".cm-scroller":{}});}};});
2
+ //# sourceMappingURL=theme.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.cjs.js","sources":["../../../src/nile-code-editor/theme.ts"],"sourcesContent":["export const Theme = {\n '&': {\n fontSize: '14px',\n fontFamily: 'Colfax-regular',\n fontWeight: '400',\n },\n '.cm-content': {},\n '.cm-scroller': {},\n};\n"],"names":["Theme","fontSize","fontFamily","fontWeight"],"mappings":"kHAAaA,CAAQ,CAAA,CACnB,GAAK,CAAA,CACHC,SAAU,MACVC,CAAAA,UAAAA,CAAY,gBACZC,CAAAA,UAAAA,CAAY,OAEd,aAAe,CAAA,CAAE,CACjB,CAAA,cAAA,CAAgB,CAAE"}
@@ -0,0 +1 @@
1
+ const o={"&":{fontSize:"14px",fontFamily:"Colfax-regular",fontWeight:"400"},".cm-content":{},".cm-scroller":{}};export{o as T};
@@ -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.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.customAutoCompletions,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 this.currentInput||this.setCurrentInput(),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,t,i,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){t=_index001CjsJs.x;},function(_litDecoratorsJs){i=_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,t){return t===_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 i=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 t(_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}),i,r,n,l,c,s,a,function(e){_this3.handleChange(e,d);});}},{key:"renderDropdown",value:function renderDropdown(e){var _this4=this;var i=e.options,r=e.multiple,s=e.placeholder,n=e.disabled,o=e.value,l=e.error,a=e.errorMessage,c=e.inputType;return t(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-select\n part=\"dropdown\"\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);},i===null||i===void 0?void 0:i.map(function(e){return t(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-option .value=\"","\">"," </nile-option>"])),e,e);}));}},{key:"renderNileTextArea",value:function renderNileTextArea(e){var _this5=this;var i=e.value,r=e.disabled,s=e.readonly,n=e.errorMessage,o=e.error,l=e.inputType;return t(_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>"])),i,r,s,o,n,function(e){_this5.handleChange(e,l);});}},{key:"renderNileCheckBox",value:function renderNileCheckBox(e){var _this6=this;var i=e.value,r=e.label,s=e.disabled,n=e.inputType;return t(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-checkbox\n class=\"switcher-checkbox\"\n .checked=","\n .label=","\n .disabled=","\n @valueChange=","\n ></nile-checkbox\n >; "])),i,r,s,function(e){_this6.handleChange(e,n);});}},{key:"renderNileRadio",value:function renderNileRadio(e){var _this7=this;var i=e.options,r=e.value,s=e.disabled,n=e.errorMessage,o=e.inputType,l=!!n;return t(_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);},i&&i.map(function(e){return t(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-radio .value=\"","\">"," </nile-radio>"])),e,e);}),l?this.renderErrorMessage(n):"");}},{key:"renderErrorMessage",value:function renderErrorMessage(e){return t(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["\n <nile-form-error-message>","</nile-form-error-message>\n "])),e);}},{key:"renderContentEditor",value:function renderContentEditor(e){var _this8=this;var i=e.options,r=e.inputType,s=e.errorMessage,n=e.type,o=e.readonly,l=e.noborder,a=e.value;return t(_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,i,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 i=this.currentInput.mode===$.CREATE?"Click to Create - Not Mapped":"Click to Edit";return t(_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}),i,function(e){return _this9.handleChange(e,u.OBJECT_MAPPER);});}},{key:"renderCodeEditor",value:function renderCodeEditor(e){var _this10=this;var i=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 t(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["<nile-code-editor\n part=\"code-editor\"\n class=","\n @nile-expand=\"","\"\n @nile-change=\"","\"\n .multiline=\"","\"\n .value=\"","\"\n .customOptions=\"","\"\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,i,s);}},{key:"handleExpand",value:function handleExpand(e,t){this.currentInput.expand=e.detail.expand,this.emit("nile-change",{input:this.currentInput});}},{key:"handleChange",value:function handleChange(e,t){switch(t){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,i=this.nileSwitchConfig.align===h.BLOCK?"top":"bottom";return t(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["\n <div part=\"icons-container\" class=\"switcher-icons-container\">\n ","\n </div>\n "])),l(e,function(e,r){return t(_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,i,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,t){this.nileSwitchConfig.confirmation&&(this.current=t),this.emit("nile-switch",{input:this.currentInput});}},{key:"singleFieldSwitcher",value:function singleFieldSwitcher(){var _this12=this;return this.currentInput||this.setCurrentInput(),t(_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"),i=this.nileSwitchConfig.align;return t(_templateObject15||(_templateObject15=_taggedTemplateLiteral(["<div\n part=\"base\"\n class=","\n >\n <div class=\"label-container\">\n ","\n ","\n </div>\n ","\n </div>"])),o({"switcher-block":i===h.BLOCK,"switcher-inline":i===h.INLINE,"switcher-container":!0}),e?t(_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([i("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 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 @property({ type: Object }) nileSwitchConfig: switchconfig;\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 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 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 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","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","singleFieldSwitcher","_templateObject14","choose","render","_templateObject15","NileElement","styles","__decorate","property","Object","prototype","Number","watch","waitUntilFirstUpdate","customElement"],"mappings":"s6JA0FYA,CArBZ,SAAYC,CACVA,CAAAA,CAAAA,CAAAA,CAAAC,OAAA,QACAD,CAAAA,CAAAA,CAAAE,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,CAAAA,CAAAA,CACVA,EAAAC,QAAA,CAAA,UAAA,CACAD,EAAAE,IAAA,CAAA,MAAA,CACAF,EAAAG,QAAA,CAAA,UAAA,CACAH,CAAA,CAAAI,QAAA,CAAA,YACAJ,CAAA,CAAAK,KAAA,CAAA,QACAL,CAAA,CAAAM,aAAA,CAAA,iBACAN,CAAA,CAAAO,aAAA,CAAA,gBACAP,CAAA,CAAAQ,WAAA,CAAA,aACD,EATD,CAAYR,IAAAA,CASX,CAAA,CAAA,IAED,SAAYP,CAAAA,CAAAA,CACVA,CAAA,CAAAgB,MAAA,CAAA,SACAhB,CAAA,CAAAiB,IAAA,CAAA,MACD,EAHD,CAAYjB,IAAAA,CAGX,CAAA,CAAA,CAGM,CAAA,CAAA,CAAAkB,OAAA,KAAMC,uEAAN,SAAAC,EAAA,uEAQuBC,KAAAA,CAAOC,OAAAA,CAAW,CAkV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.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 part=\"dropdown\"\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 : 'Click to Edit';\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 part=\"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 ></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 part=\"base\"\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,CAAAA,CAAAQ,YAAA,aACD,EATD,CAAYR,CAAAA,GAAAA,CAAAA,CASX,CAAA,CAED,CAAA,CAAA,CAAA,SAAYS,GACVA,CAAA,CAAAC,MAAA,CAAA,QACAD,CAAAA,CAAAA,CAAAE,KAAA,MACD,EAHD,CAAYF,CAAAA,GAAAA,CAAAA,CAGX,CAAA,CAGM,CAAA,CAAA,CAAAG,OAAA,KAAMC,uEAAN,SAAAC,EAAA,uEAOYC,KAAAA,CAAiBC,iBAAAA,CAAG,GAAIC,CAAAA,CAAkBF,CAAAA,sBAAAA,CAAAA,KAAAA,EAAM,SAIrCA,KAAAA,CAAOG,OAAAA,CAAW,CAqW/C,QAAAC,KAAA,EAjWCC,YAAA,CAAAN,CAAA,GAAAO,GAAA,qBAAAC,KAAA,UAAAC,kBAAA,EACEC,IAAAA,CAAAA,eAAAA,CAAA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A,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 .pointer-cursor {\n cursor: pointer;\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-object-mapper:hover {\n display: flex;\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-icon {\n display: none;\n }\n .switcher-object-mapper:hover > .switcher-object-mapper-icon {\n display: block;\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 .pointer-cursor {\n cursor: pointer;\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-object-mapper:hover {\n display: flex;\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-icon {\n display: none;\n }\n .switcher-object-mapper:hover > .switcher-object-mapper-icon {\n display: block;\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,34 @@
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 {
7
+ .pointer-cursor {
8
8
  cursor: pointer;
9
- justify-content: center;
9
+ }
10
+
11
+ .switcher__label {
10
12
  display: flex;
11
13
  align-items: center;
12
- margin-bottom: 6px;
13
- height: 28px;
14
- width: 28px;
15
- border-radius: 4px;
14
+ color: inherit;
15
+ color: var(--nile-colors-dark-900);
16
+ font-family: Colfax-regular;
17
+ font-size: 14px;
18
+ font-style: normal;
19
+ font-weight: 400;
20
+ line-height: 14px;
21
+ letter-spacing: 0.2px;
16
22
  }
17
23
 
24
+ switcher-object-mapper:hover {
25
+ display: flex;
26
+ }
18
27
  .switcher-icon-container.current {
19
28
  background: var(--nile-colors-blue-400);
20
29
  }
21
30
 
22
- .switcher-input-container {
31
+ .switcher-container {
23
32
  display: flex;
24
33
  }
25
34
 
@@ -31,21 +40,36 @@ import{i as r}from"../index-cd2f9c12.esm.js";const e=r`
31
40
  flex-direction: column;
32
41
  }
33
42
 
34
- .switcher-block > :first-child {
35
- align-self: end;
36
- }
37
-
38
43
  .switcher-inline > :nth-child(2) {
39
44
  flex: 1;
40
45
  }
41
46
 
42
- .switcher-input-container > :first-child {
47
+ .switcher-icons-container {
43
48
  display: flex;
49
+ margin-left: auto;
44
50
  gap: 0.5rem;
45
51
  max-height: 38px;
46
52
  align-items: center;
47
53
  }
48
54
 
55
+ .switcher-block > .switcher-icons-container {
56
+ margin-left: auto;
57
+ }
58
+
59
+ .label-container {
60
+ display: flex;
61
+ }
62
+
63
+ .switcher-icon-container {
64
+ cursor: pointer;
65
+ justify-content: center;
66
+ display: flex;
67
+ align-items: center;
68
+ margin-bottom: 6px;
69
+ height: 28px;
70
+ width: 28px;
71
+ border-radius: 4px;
72
+ }
49
73
  nile-radio {
50
74
  display: inline-block;
51
75
  padding-right: 10px;
@@ -62,6 +86,12 @@ import{i as r}from"../index-cd2f9c12.esm.js";const e=r`
62
86
  border: none;
63
87
  }
64
88
 
89
+ .switcher-object-mapper-icon {
90
+ display: none;
91
+ }
92
+ .switcher-object-mapper:hover > .switcher-object-mapper-icon {
93
+ display: block;
94
+ }
65
95
  .switcher-object-mapper::part(input) {
66
96
  color: var(--nile-colors-primary-600);
67
97
  cursor: pointer;
@@ -73,4 +103,4 @@ import{i as r}from"../index-cd2f9c12.esm.js";const e=r`
73
103
  .switcher-object-mapper--noborder::part(base) {
74
104
  border: none;
75
105
  }
76
- `;export{e as s};
106
+ `;export{r as s};
@@ -1,64 +1,65 @@
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.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 t}from"../index-cd2f9c12.esm.js";import{customElement as i}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,t)=>t===this.current))[0])}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}renderNileText(e){const{value:i,label:r,placeholder:s,disabled:n,required:l,error:a,errorMessage:c,inputType:d,noborder:h}=e;return t`<nile-input
2
2
  class=${o({"switcher-input":!0,"switcher-input--noborder":!!h})}
3
- .value=${t}
3
+ .value=${i}
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:i,multiple:r,placeholder:s,disabled:n,value:o,error:l,errorMessage:a,inputType:c}=e;return t`<nile-select
12
+ part="dropdown"
12
13
  class="switcher-dropdown"
13
14
  .placeholder=${s}
14
15
  .disabled="${n}"
15
16
  .multiple="${r}"
16
17
  .value="${o}"
17
18
  .error="${l}"
18
- .errorMessage="${c}"
19
- @nile-change=${e=>{this.handleChange(e,a)}}
19
+ .errorMessage="${a}"
20
+ @nile-change=${e=>{this.handleChange(e,c)}}
20
21
  >
21
- ${t?.map((e=>i`<nile-option .value="${e}">${e} </nile-option>`))}
22
- </nile-select>`}renderNileTextArea(e){const{value:t,disabled:r,readonly:s,errorMessage:n,error:o,inputType:l}=e;return i`<nile-textarea
22
+ ${i?.map((e=>t`<nile-option .value="${e}">${e} </nile-option>`))}
23
+ </nile-select>`}renderNileTextArea(e){const{value:i,disabled:r,readonly:s,errorMessage:n,error:o,inputType:l}=e;return t`<nile-textarea
23
24
  class="switcher-textarea"
24
- .value=${t}
25
+ .value=${i}
25
26
  .disabled=${r}
26
27
  ?readonly=${s}
27
28
  .error=${o}
28
29
  .errorMessage=${n}
29
30
  @nile-input=${e=>{this.handleChange(e,l)}}
30
- ></nile-textarea>`}renderNileCheckBox(e){const{value:t,label:r,disabled:s,inputType:n}=e;return i`<nile-checkbox
31
+ ></nile-textarea>`}renderNileCheckBox(e){const{value:i,label:r,disabled:s,inputType:n}=e;return t`<nile-checkbox
31
32
  class="switcher-checkbox"
32
- .checked=${t}
33
+ .checked=${i}
33
34
  .label=${r}
34
35
  .disabled=${s}
35
36
  @valueChange=${e=>{this.handleChange(e,n)}}
36
37
  ></nile-checkbox
37
- >; `}renderNileRadio(e){const{options:t,value:r,disabled:s,errorMessage:n,inputType:o}=e,l=!!n;return i`<nile-radio-group
38
+ >; `}renderNileRadio(e){const{options:i,value:r,disabled:s,errorMessage:n,inputType:o}=e,l=!!n;return t`<nile-radio-group
38
39
  class="switcher-radio-group"
39
40
  .value=${r}
40
41
  .disabled=${s}
41
42
  @change=${e=>{this.handleChange(e,o)}}
42
43
  >
43
- ${t&&t.map((e=>i`<nile-radio .value="${e}">${e} </nile-radio>`))}
44
+ ${i&&i.map((e=>t`<nile-radio .value="${e}">${e} </nile-radio>`))}
44
45
  ${l?this.renderErrorMessage(n):""}
45
- </nile-radio-group> `}renderErrorMessage(e){return i`
46
+ </nile-radio-group> `}renderErrorMessage(e){return t`
46
47
  <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
48
+ `}renderContentEditor(e){let{options:i,inputType:r,errorMessage:s,type:n,readonly:o,noborder:l,value:a}=e;return t`<nile-content-editor
48
49
  class="switcher-content-editor"
49
- .value=${c}
50
- .options=${t}
50
+ .value=${a}
51
+ .options=${i}
51
52
  .type=${n}
52
53
  .readonly=${o}
53
54
  .noborder=${l}
54
55
  .errorMessage=${s}
55
56
  @nile-change=${e=>{this.handleChange(e,r)}}
56
57
  >
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
58
+ </nile-content-editor>`}renderObjectMapper(){const e=this.currentInput.noborder;this.currentInput.mode;const i=this.currentInput.mode===$.CREATE?"Click to Create - Not Mapped":"Click to Edit";return t`<nile-input
58
59
  class=${o({"switcher-object-mapper":!0,"switcher-object-mapper--noborder":!!e})}
59
- .value=${t}
60
+ .value=${i}
60
61
  readonly="true"
61
- @click="${e=>this.handleChange(e,p.OBJECT_MAPPER)}"
62
+ @click="${e=>this.handleChange(e,u.OBJECT_MAPPER)}"
62
63
  >
63
64
  <nile-icon
64
65
  class="pointer-cursor switcher-object-mapper-icon"
@@ -68,20 +69,20 @@ import{__decorate as e}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";
68
69
  size="16"
69
70
  >
70
71
  </nile-icon>
71
- </nile-input>`}renderCodeEditor(e){const{value:t,multiLine:r,customAutoCompletions:s,disabled:n,readonly:l,errorMessage:c,error:a,inputType:d,noborder:h}=e;return i`<nile-code-editor
72
+ </nile-input>`}renderCodeEditor(e){const{value:i,multiLine:r,customAutoCompletions:s,disabled:n,readonly:l,errorMessage:a,error:c,inputType:d,noborder:h}=e;return t`<nile-code-editor
73
+ part="code-editor"
72
74
  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)}"
75
+ @nile-expand="${e=>this.handleExpand(e,u.CODE_EDITOR)}"
76
+ @nile-change="${e=>this.handleChange(e,u.CODE_EDITOR)}"
75
77
  .multiline="${r}"
76
- .value="${t}"
78
+ .value="${i}"
77
79
  .customOptions="${s}"
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">
81
- ${l(e,((e,r)=>i` <nile-tooltip
80
+ ></nile-code-editor> `}handleExpand(e,t){this.currentInput.expand=e.detail.expand,this.emit("nile-change",{input:this.currentInput})}handleChange(e,t){switch(t){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,i=this.nileSwitchConfig.align===h.BLOCK?"top":"bottom";return t`
81
+ <div part="icons-container" class="switcher-icons-container">
82
+ ${l(e,((e,r)=>t` <nile-tooltip
82
83
  class=${o({"switcher-tooltip-container":!0})}
83
84
  content=${e.helperText}
84
- placement=${t}
85
+ placement=${i}
85
86
  >
86
87
  <div class=${o({"switcher-icon-container":!0,current:r===this.current})}>
87
88
  <nile-icon
@@ -95,10 +96,23 @@ import{__decorate as e}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";
95
96
 
96
97
  </nile-tooltip>`))}
97
98
  </div>
98
- `}toggleField(e,i){this.current=i,this.emit("nile-switch",{input:this.currentInput})}singleFieldSwitcher(){return this.currentInput||this.setCurrentInput(),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})}
99
+ `}toggleField(e,t){this.nileSwitchConfig.confirmation&&(this.current=t),this.emit("nile-switch",{input:this.currentInput})}singleFieldSwitcher(){return this.currentInput||this.setCurrentInput(),t`
100
+ ${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)))}
101
+ `}render(){const e=this.hasSlotController.test("label"),i=this.nileSwitchConfig.align;return t`<div
102
+ part="base"
103
+ class=${o({"switcher-block":i===h.BLOCK,"switcher-inline":i===h.INLINE,"switcher-container":!0})}
102
104
  >
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};
105
+ <div class="label-container">
106
+ ${e?t`
107
+ <label
108
+ part="switcher-label"
109
+ class="switcher__label"
110
+ for="input"
111
+ >
112
+ <slot name="label"></slot>
113
+ </label>
114
+ </div> `:""}
115
+ ${this.renderIcon()}
116
+ </div>
117
+ ${this.singleFieldSwitcher()}
118
+ </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([i("nile-switcher")],m);export{m as N};
@@ -17,7 +17,6 @@ export const styles = css `
17
17
  display: flex;
18
18
  justify-content: flex-end;
19
19
  flex-direction: row-reverse;
20
- gap: 0.6rem;
21
20
  }
22
21
 
23
22
  .cm-editor {
@@ -31,11 +30,12 @@ export const styles = css `
31
30
  }
32
31
 
33
32
  .code-editor__icon__container {
34
- cursor: pointer;
33
+ display: none;
35
34
  }
36
-
37
- .code-editor__icon__container {
38
- padding-right: 5px;
35
+ .code-mirror:hover > .code-editor__icon__container {
36
+ cursor: pointer;
37
+ display: flex;
38
+ padding-right: 10px;
39
39
  }
40
40
  `;
41
41
  export default [styles];
@@ -1 +1 @@
1
- {"version":3,"file":"nile-code-editor.css.js","sourceRoot":"","sources":["../../../src/nile-code-editor/nile-code-editor.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BxB,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 * CodeEditor CSS\n */\nexport const styles = css`\n :host {\n display: block;\n }\n\n .code-mirror {\n display: flex;\n justify-content: flex-end;\n flex-direction: row-reverse;\n gap: 0.6rem;\n }\n\n .cm-editor {\n overflow: hidden;\n width: 100%;\n height: 100%;\n }\n\n .ͼ1.cm-focused {\n outline: none;\n }\n\n .code-editor__icon__container {\n cursor: pointer;\n }\n\n .code-editor__icon__container {\n padding-right: 5px;\n }\n`;\n\nexport default [styles];\n"]}
1
+ {"version":3,"file":"nile-code-editor.css.js","sourceRoot":"","sources":["../../../src/nile-code-editor/nile-code-editor.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BxB,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 * CodeEditor CSS\n */\nexport const styles = css`\n :host {\n display: block;\n }\n\n .code-mirror {\n display: flex;\n justify-content: flex-end;\n flex-direction: row-reverse;\n }\n\n .cm-editor {\n overflow: hidden;\n width: 100%;\n height: 100%;\n }\n\n .ͼ1.cm-focused {\n outline: none;\n }\n\n .code-editor__icon__container {\n display: none;\n }\n .code-mirror:hover > .code-editor__icon__container {\n cursor: pointer;\n display: flex;\n padding-right: 10px;\n }\n`;\n\nexport default [styles];\n"]}
@@ -8,6 +8,7 @@ import { CSSResultArray, TemplateResult } from 'lit-element';
8
8
  import { EditorView } from 'codemirror';
9
9
  import { Compartment } from '@codemirror/state';
10
10
  import NileElement from '../internal/nile-element';
11
+ import { PropertyValues } from 'lit';
11
12
  /**
12
13
  * Nile icon component.
13
14
  *
@@ -19,7 +20,6 @@ export declare class NileCodeEditor extends NileElement {
19
20
  multiline: true;
20
21
  value: true;
21
22
  customOptions: any;
22
- showLineNumbers: any;
23
23
  /**
24
24
  * The styles for CodeEditor
25
25
  * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
@@ -29,7 +29,9 @@ export declare class NileCodeEditor extends NileElement {
29
29
  view: EditorView;
30
30
  convertToSingleLine(code: any): any;
31
31
  lineNumbersComp: Compartment;
32
- updated(): void;
32
+ handleValueChange(): void;
33
+ updated(changedProperties: PropertyValues): void;
34
+ setTheme(): import("@codemirror/state").Extension;
33
35
  emitValues(value: string): void;
34
36
  expandCodeEditor(): void;
35
37
  restrictSingleLine(): import("@codemirror/state").Extension;