@aquera/nile-elements 0.0.38-3 → 0.0.38-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.css.js +3 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.js +6 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js +9 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.d.ts +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +6 -2
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/index.iife.js +28 -16
- package/dist/nile-code-editor/nile-code-editor.cjs.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.cjs.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.esm.js +5 -2
- package/dist/nile-code-editor/nile-code-editor.esm.js +3 -3
- package/dist/nile-switcher/nile-switcher.cjs.js +1 -1
- package/dist/nile-switcher/nile-switcher.cjs.js.map +1 -1
- package/dist/nile-switcher/nile-switcher.css.cjs.js +1 -1
- package/dist/nile-switcher/nile-switcher.css.cjs.js.map +1 -1
- package/dist/nile-switcher/nile-switcher.css.esm.js +11 -3
- package/dist/nile-switcher/nile-switcher.esm.js +48 -47
- package/dist/src/nile-code-editor/nile-code-editor.css.js +3 -0
- package/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -1
- package/dist/src/nile-code-editor/nile-code-editor.d.ts +1 -0
- package/dist/src/nile-code-editor/nile-code-editor.js +6 -0
- package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
- package/dist/src/nile-switcher/nile-switcher.css.js +9 -1
- package/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
- package/dist/src/nile-switcher/nile-switcher.d.ts +1 -1
- package/dist/src/nile-switcher/nile-switcher.js +6 -2
- package/dist/src/nile-switcher/nile-switcher.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-code-editor/nile-code-editor.css.ts +3 -0
- package/src/nile-code-editor/nile-code-editor.ts +4 -0
- package/src/nile-switcher/nile-switcher.css.ts +9 -1
- package/src/nile-switcher/nile-switcher.ts +7 -2
@@ -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","../internal/slot.cjs.js","../property-0f6a51ec.cjs.js","lit"],function(_export,_context){"use strict";var e,t,r,i,s,n,o,l,a,c,d,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_templateObject12,_templateObject13,_templateObject14,_templateObject15,_templateObject16,_templateObject17,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){r=_litDecoratorsJs.customElement;},function(_nileSwitcherCssCjsJs){i=_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,_this.isToggleSwitch=function(e){return void 0===e||e;};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 r=e.value,i=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}),r,i,n,l,c,s,a,function(e){_this3.handleChange(e,d);});}},{key:"renderDropdown",value:function renderDropdown(e){var _this4=this;var r=e.options,i=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,i,o,l,a,function(e){_this4.handleChange(e,c);},r===null||r===void 0?void 0:r.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 r=e.value,i=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>"])),r,i,s,o,n,function(e){_this5.handleChange(e,l);});}},{key:"renderNileCheckBox",value:function renderNileCheckBox(e){var _this6=this;var r=e.value,i=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 >; "])),r,i,s,function(e){_this6.handleChange(e,n);});}},{key:"renderNileRadio",value:function renderNileRadio(e){var _this7=this;var r=e.options,i=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> "])),i,s,function(e){_this7.handleChange(e,o);},r&&r.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 r=e.options,i=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,r,n,o,l,s,function(e){_this8.handleChange(e,i);});}},{key:"renderObjectMapper",value:function renderObjectMapper(e){var _this9=this;var r=e.options,i=e.inputType,s=e.error,n=e.errorMessage,l=e.type,a=e.readonly,c=e.noborder;var d=this.currentInput.mode===$.CREATE?"Click to Create - Not Mapped":"Click to Edit";return t(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<nile-input\n class=","\n .value=","\n .errorMessage=","\n .error=","\n readonly=\"true\"\n @click=\"","\"\n >\n <nile-icon\n class=\"pointer-cursor switcher-object-mapper-icon\"\n slot=\"suffix\"\n name=\"expand-2\"\n color=\"#005EA6\"\n size=\"16\"\n >\n </nile-icon>\n </nile-input>"])),o({"switcher-object-mapper":!0,"switcher-object-mapper--noborder":!!c}),d,n,s,function(e){return _this9.handleChange(e,u.OBJECT_MAPPER);});}},{key:"renderCodeEditor",value:function renderCodeEditor(e){var _this10=this;var r=e.value,i=e.multiLine,s=e.customAutoCompletions,n=e.disabled,l=e.readonly,a=e.errorMessage,c=e.error,d=e.inputType,h=e.noborder,p=e.expand,$=e.updateValue;return t(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["<nile-code-editor\n part=\"switcher-code-editor\"\n class=","\n @nile-expand=\"","\"\n @nile-change=\"","\"\n .multiline=\"","\"\n .value=\"","\"\n .readonly=","\n .expandable=\"","\"\n .error=","\n .updateValue=","\n .errorMessage=","\n .customAutoCompletions=\"","\"\n ></nile-code-editor> "])),o({"code-editor":!0}),function(e){return _this10.handleExpand(e,u.CODE_EDITOR);},function(e){return _this10.handleChange(e,u.CODE_EDITOR);},i,r,l,p,c,$,a,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,r=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,i){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,r,o({"switcher-icon-container":!0,current:i===_this11.current}),o({"pointer-cursor":!0,"pointer-cursor-not-allowed":i===_this11.current}),e.icon,function(){return _this11.toggleField(e,i);});}));}},{key:"toggleField",value:function toggleField(e,t){this.emit("nile-switch",{inputClicked:t,currentInput:e});}},{key:"singleFieldSwitcher",value:function singleFieldSwitcher(){var _this12=this;return 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(_this12.currentInput);}],[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"),r=this.nileSwitchConfig.align,i=this.nileSwitchConfig.disable;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":r===h.BLOCK,"switcher-inline":r===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> "]))):"",i?"":t(_templateObject17||(_templateObject17=_taggedTemplateLiteral(["",""])),this.renderIcon()),this.singleFieldSwitcher());}}]);return b;}(s));b.styles=i,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([r("nile-switcher")],b));}};});
|
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,r,t,i,s,o,n,l,a,c,d,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_templateObject12,_templateObject13,_templateObject14,_templateObject15,_templateObject16,_templateObject17,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){r=_index001CjsJs.x;},function(_litDecoratorsJs){t=_litDecoratorsJs.customElement;},function(_nileSwitcherCssCjsJs){i=_nileSwitcherCssCjsJs.s;},function(_internalNileElementCjsJs){s=_internalNileElementCjsJs.N;},function(_litDirectivesChooseJs){o=_litDirectivesChooseJs.choose;},function(_litDirectivesClassMapJs){n=_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,_this.isToggleSwitch=function(e){return void 0===e||e;};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,r){return r===_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,i=e.label,s=e.placeholder,o=e.disabled,l=e.required,a=e.error,c=e.errorMessage,d=e.inputType,h=e.noborder;return r(_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>"])),n({"switcher-input":!0,"switcher-input--noborder":!!h}),t,i,o,l,c,s,a,function(e){_this3.handleChange(e,d);});}},{key:"renderDropdown",value:function renderDropdown(e){var _this4=this;var t=e.options,i=e.multiple,s=e.placeholder,o=e.disabled,l=e.value,a=e.error,c=e.errorMessage,d=e.inputType,h=e.noborder;return r(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-select\n part=\"dropdown\"\n class=","\n .placeholder=","\n .disabled=\"","\"\n .multiple=\"","\"\n .value=\"","\"\n .error=\"","\"\n .errorMessage=\"","\"\n @nile-change=","\n >\n ","\n </nile-select>"])),n({"switcher-dropdown":!0,"switcher-dropdown--noborder":!!h}),s,o,i,l,a,c,function(e){_this4.handleChange(e,d);},t===null||t===void 0?void 0:t.map(function(e){return r(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-option .value=\"","\">"," </nile-option>"])),e,e);}));}},{key:"renderNileTextArea",value:function renderNileTextArea(e){var _this5=this;var t=e.value,i=e.disabled,s=e.readonly,o=e.errorMessage,n=e.error,l=e.inputType;return r(_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,i,s,n,o,function(e){_this5.handleChange(e,l);});}},{key:"renderNileCheckBox",value:function renderNileCheckBox(e){var _this6=this;var t=e.value,i=e.label,s=e.disabled,o=e.inputType;return r(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-checkbox\n class=\"switcher-checkbox\"\n .checked=","\n .label=","\n .disabled=","\n @valueChange=","\n ></nile-checkbox\n >; "])),t,i,s,function(e){_this6.handleChange(e,o);});}},{key:"renderNileRadio",value:function renderNileRadio(e){var _this7=this;var t=e.options,i=e.value,s=e.disabled,o=e.errorMessage,n=e.inputType,l=!!o;return r(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-radio-group\n class=\"switcher-radio-group\"\n .value=","\n .disabled=","\n @change=","\n >\n ","\n ","\n </nile-radio-group> "])),i,s,function(e){_this7.handleChange(e,n);},t&&t.map(function(e){return r(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-radio .value=\"","\">"," </nile-radio>"])),e,e);}),l?this.renderErrorMessage(o):"");}},{key:"renderErrorMessage",value:function renderErrorMessage(e){return r(_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,i=e.inputType,s=e.errorMessage,o=e.type,n=e.readonly,l=e.noborder,a=e.value;return r(_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,o,n,l,s,function(e){_this8.handleChange(e,i);});}},{key:"renderObjectMapper",value:function renderObjectMapper(e){var _this9=this;var t=e.options,i=e.inputType,s=e.error,o=e.errorMessage,l=e.type,a=e.readonly,c=e.noborder;var d=this.currentInput.mode===$.CREATE?"Click to Create - Not Mapped":"Click to Edit";return r(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<nile-input\n class=","\n .value=","\n .errorMessage=","\n .error=","\n readonly=\"true\"\n @click=\"","\"\n >\n <nile-icon\n class=\"pointer-cursor switcher-object-mapper-icon\"\n slot=\"suffix\"\n name=\"expand-2\"\n color=\"#005EA6\"\n size=\"16\"\n >\n </nile-icon>\n </nile-input>"])),n({"switcher-object-mapper":!0,"switcher-object-mapper--noborder":!!c}),d,o,s,function(e){return _this9.handleChange(e,u.OBJECT_MAPPER);});}},{key:"renderCodeEditor",value:function renderCodeEditor(e){var _this10=this;var t=e.value,i=e.multiLine,s=e.customAutoCompletions,o=e.disabled,l=e.readonly,a=e.errorMessage,c=e.error,d=e.inputType,h=e.noborder,p=e.expand,$=e.updateValue;return r(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["<nile-code-editor\n part=\"switcher-code-editor\"\n class=","\n @nile-expand=\"","\"\n @nile-change=\"","\"\n .multiline=\"","\"\n .value=\"","\"\n .readonly=","\n .expandable=\"","\"\n .error=","\n .noborder=","\n .updateValue=","\n .errorMessage=","\n .customAutoCompletions=\"","\"\n ></nile-code-editor> "])),n({"code-editor":!0}),function(e){return _this10.handleExpand(e,u.CODE_EDITOR);},function(e){return _this10.handleChange(e,u.CODE_EDITOR);},i,t,l,p,c,h,$,a,s);}},{key:"handleExpand",value:function handleExpand(e,r){this.currentInput.expand=e.detail.expand,this.emit("nile-change",{input:this.currentInput});}},{key:"handleChange",value:function handleChange(e,r){switch(r){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 r(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["\n <div part=\"icons-container\" class=\"switcher-icons-container\">\n ","\n </div>\n "])),l(e,function(e,i){return r(_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>"])),n({"switcher-tooltip-container":!0}),e.helperText,t,n({"switcher-icon-container":!0,current:i===_this11.current}),n({"pointer-cursor":!0,"pointer-cursor-not-allowed":i===_this11.current}),e.icon,function(){return _this11.toggleField(e,i);});}));}},{key:"toggleField",value:function toggleField(e,r){this.emit("nile-switch",{inputClicked:r,currentInput:e});}},{key:"singleFieldSwitcher",value:function singleFieldSwitcher(){var _this12=this;return this.setCurrentInput(),r(_templateObject14||(_templateObject14=_taggedTemplateLiteral(["\n ","\n "])),o(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(_this12.currentInput);}],[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,i=this.nileSwitchConfig.disable;return r(_templateObject15||(_templateObject15=_taggedTemplateLiteral(["<div\n part=\"base\"\n class=","\n >\n <div class=\"label-container\">\n ","\n ","\n </div>\n ","\n </div>"])),n({"switcher-block":t===h.BLOCK,"switcher-inline":t===h.INLINE,"switcher-container":!0}),e?r(_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> "]))):"",i?"":r(_templateObject17||(_templateObject17=_taggedTemplateLiteral(["",""])),this.renderIcon()),this.singleFieldSwitcher());}}]);return b;}(s));b.styles=i,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';\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 updateValue: false;\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(Input: switchInputType) {\n let { options, inputType, error, errorMessage, type, readonly, noborder } =\n Input;\n\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 .errorMessage=${errorMessage}\n .error=${error}\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=\"expand-2\"\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 expand,\n updateValue,\n } = Input;\n return html`<nile-code-editor\n part=\"switcher-code-editor\"\n class=${classMap({\n 'code-editor': true,\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 .readonly=${readonly}\n .expandable=\"${expand}\"\n .error=${error}\n .updateValue=${updateValue}\n .errorMessage=${errorMessage}\n .customAutoCompletions=\"${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 'pointer-cursor-not-allowed': index === this.current,\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 isToggleSwitch = (item: any) => {\n return typeof item === 'undefined' || item;\n };\n\n toggleField(currentInput: switchInputType, index: Number) {\n this.emit('nile-switch', {\n inputClicked: index,\n currentInput: currentInput,\n });\n }\n\n singleFieldSwitcher() {\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 [\n INPUT_TYPE_NAMES.OBJECT_MAPPER,\n () => this.renderObjectMapper(this.currentInput),\n ],\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 const disable = this.nileSwitchConfig.disable;\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 ${!disable ? html`${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","isToggleSwitch","item","_this","_createClass","key","value","connectedCallback","super","emit","handleSwitcherChange","setCurrentInput","nileSwitchConfig","inputs","currentInput","filter","input","index","disconnectedCallback","renderNileText","Input","_this3","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","_this9","mode","_templateObject10","renderCodeEditor","_this10","multiLine","customAutoCompletions","expand","updateValue","_templateObject11","handleExpand","event","detail","checked","stopPropagation","renderIcon","toolTipPosition","align","_templateObject12","repeat","_templateObject13","helperText","icon","toggleField","inputClicked","singleFieldSwitcher","_templateObject14","choose","render","hasLabelSlot","test","disable","_templateObject15","_templateObject16","_templateObject17","NileElement","styles","__decorate","property","Object","prototype","Number","watch","waitUntilFirstUpdate","customElement"],"mappings":"4hKAuEA,CAAA,SAAYA,GACVA,CAAA,CAAAC,MAAA,CAAA,SACAD,CAAA,CAAAE,KAAA,CAAA,OACD,EAHD,CAAYF,IAAAA,CAGX,CAAA,CAAA,IAED,SAAYG,CAAAA,CAAAA,CACVA,EAAAC,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,SACAD,CAAA,CAAAE,IAAA,CAAA,MACD,EAHD,CAAYF,IAAAA,CAGX,CAAA,CAAA,IAGMG,OAAA,KAAMC,CAAAA,uBAAAA,EAAAA,EAAAA,SAAAA,CAAAA,CAAAA,CAAAA,EAAAA,MAAAA,MAAAA,CAAAA,YAAAA,CAAAA,CAAAA,EAAN,SAAAC,EAAA,uEAOYC,KAAAA,CAAiBC,iBAAG,CAAA,GAAIC,CAAAA,gCAAwB,OAAA,CAAA,CAIrCF,KAAAA,CAAOG,OAAW,CAAA,CAAA,CAoS9CH,KAAAA,CAAAI,cAAkBC,CAAAA,SAAAA,CAAAA,QAAAA,KACO,KAATA,CAAwBA,EAAAA,CAiFzC,UAAAC,KAAA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AAAA,CAAyCzG,CAAA0G,CAAAA,SAAAA,CAAA,uBAAA,EAE/BH,CAAAA,CAAAA,CAAAA,CAAA,CAA3BC,CAAAA,CAAS,CAAEzC,IAAAA,CAAM4C,UAA8B3G,CAAA0G,CAAAA,SAAAA,CAAA,SAAA,CAAA,IAAA,EAAA,CAAA,CAEpBH,CAAA,CAAA,CAA3BC,EAAS,CAAEzC,IAAAA,CAAM0C,UAAwCzG,CAAA0G,CAAAA,SAAAA,CAAA,mBAAA,EAQ1DH,CAAAA,CAAAA,CAAAA,CAAA,CADCK,CAAAA,CAAM,CAAC,SAAA,CAAA,CAAY,CAAEC,oBAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAG3C7G,CAAA0G,CAAAA,SAAAA,CAAA,sBAAA,CAAA,IAAA,CAAA,CAAA3G,OAAA,KAvBUC,EAAYuG,CAAA,CAAA,CADxBO,CAAc,CAAA,eAAA,CAAA,CAAA,CACF9G"}
|
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 updateValue?: false;\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 noborder,\n } = Input;\n\n return html`<nile-select\n part=\"dropdown\"\n class=${classMap({\n 'switcher-dropdown': true,\n 'switcher-dropdown--noborder': !!noborder,\n })}\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(Input: switchInputType) {\n let { options, inputType, error, errorMessage, type, readonly, noborder } =\n Input;\n\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 .errorMessage=${errorMessage}\n .error=${error}\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=\"expand-2\"\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 expand,\n updateValue,\n } = Input;\n return html`<nile-code-editor\n part=\"switcher-code-editor\"\n class=${classMap({\n 'code-editor': true,\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 .readonly=${readonly}\n .expandable=\"${expand}\"\n .error=${error}\n .noborder=${noborder}\n .updateValue=${updateValue}\n .errorMessage=${errorMessage}\n .customAutoCompletions=\"${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 'pointer-cursor-not-allowed': index === this.current,\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 isToggleSwitch = (item: any) => {\n return typeof item === 'undefined' || item;\n };\n\n toggleField(currentInput: switchInputType, index: Number) {\n this.emit('nile-switch', {\n inputClicked: index,\n currentInput: currentInput,\n });\n }\n\n singleFieldSwitcher() {\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 [\n INPUT_TYPE_NAMES.OBJECT_MAPPER,\n () => this.renderObjectMapper(this.currentInput),\n ],\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 const disable = this.nileSwitchConfig.disable;\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 ${!disable ? html`${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","isToggleSwitch","item","_this","_createClass","key","value","connectedCallback","super","emit","handleSwitcherChange","setCurrentInput","nileSwitchConfig","inputs","currentInput","filter","input","index","disconnectedCallback","renderNileText","Input","_this3","label","placeholder","disabled","required","error","errorMessage","inputType","noborder","html","_templateObject","_taggedTemplateLiteral","classMap","e","handleChange","renderDropdown","options","multiple","_templateObject2","map","option","_templateObject3","renderNileTextArea","readonly","_templateObject4","renderNileCheckBox","_this6","_templateObject5","renderNileRadio","haserrorMessage","_templateObject6","_templateObject7","renderErrorMessage","_templateObject8","renderContentEditor","_this8","type","_templateObject9","renderObjectMapper","_this9","mode","_templateObject10","renderCodeEditor","_this10","multiLine","customAutoCompletions","expand","updateValue","_templateObject11","handleExpand","event","detail","checked","stopPropagation","renderIcon","toolTipPosition","align","_templateObject12","repeat","_templateObject13","helperText","icon","toggleField","inputClicked","singleFieldSwitcher","_templateObject14","choose","render","hasLabelSlot","test","disable","_templateObject15","_templateObject16","_templateObject17","NileElement","styles","__decorate","property","Object","prototype","Number","watch","waitUntilFirstUpdate","customElement"],"mappings":"4hKAuEA,CAAA,SAAYA,GACVA,CAAA,CAAAC,MAAA,CAAA,SACAD,CAAA,CAAAE,KAAA,CAAA,OACD,EAHD,CAAYF,IAAAA,CAGX,C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,CAAAA,CAAAA,CAAAA,CAAA,CAA3BC,CAAAA,CAAS,CAAEzC,IAAAA,CAAM4C,UAA8B1G,CAAAyG,CAAAA,SAAAA,CAAA,SAAA,CAAA,IAAA,EAAA,CAAA,CAEpBH,CAAA,CAAA,CAA3BC,EAAS,CAAEzC,IAAAA,CAAM0C,UAAwCxG,CAAAyG,CAAAA,SAAAA,CAAA,mBAAA,EAQ1DH,CAAAA,CAAAA,CAAAA,CAAA,CADCK,CAAAA,CAAM,CAAC,SAAA,CAAA,CAAY,CAAEC,oBAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAG3C5G,CAAAyG,CAAAA,SAAAA,CAAA,sBAAA,CAAA,IAAA,CAAA,CAAA1G,OAAA,KAvBUC,EAAYsG,CAAA,CAAA,CADxBO,CAAc,CAAA,eAAA,CAAA,CAAA,CACF7G"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["../index-cd83c5c8.cjs.js"],function(_export,_context){"use strict";var
|
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 .pointer-cursor {\n cursor: pointer;\n }\n .pointer-cursor-not-allowed {\n cursor: default;\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\n .switcher-icon-container.current {\n background: var(--nile-colors-primary-100);\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 min-width: 0;\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 .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 .switcher-dropdown--noborder::part(combobox) {\n border: none;\n }\n\n .switcher-dropdown--noborder::part(expand-icon) {\n display: 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 .pointer-cursor {\n cursor: pointer;\n }\n .pointer-cursor-not-allowed {\n cursor: default;\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\n .switcher-icon-container.current {\n background: var(--nile-colors-primary-100);\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
|
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 .pointer-cursor-not-allowed {\n cursor: default;\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\n .switcher-icon-container.current {\n background: var(--nile-colors-primary-100);\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 min-width: 0;\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 .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 .switcher-dropdown--noborder::part(combobox) {\n border: none;\n }\n\n .switcher-dropdown--noborder::part(expand-icon) {\n display: 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,4 +1,4 @@
|
|
1
|
-
import{i as
|
1
|
+
import{i as r}from"../index-cd2f9c12.esm.js";const e=r`
|
2
2
|
:host {
|
3
3
|
width: 100%;
|
4
4
|
box-sizing: border-box;
|
@@ -46,7 +46,7 @@ import{i as e}from"../index-cd2f9c12.esm.js";const r=e`
|
|
46
46
|
|
47
47
|
.switcher-inline > :nth-child(2) {
|
48
48
|
flex: 1;
|
49
|
-
|
49
|
+
min-width: 0;
|
50
50
|
}
|
51
51
|
|
52
52
|
.switcher-icons-container {
|
@@ -97,4 +97,12 @@ import{i as e}from"../index-cd2f9c12.esm.js";const r=e`
|
|
97
97
|
.switcher-object-mapper--noborder::part(base) {
|
98
98
|
border: none;
|
99
99
|
}
|
100
|
-
|
100
|
+
|
101
|
+
.switcher-dropdown--noborder::part(combobox) {
|
102
|
+
border: none;
|
103
|
+
}
|
104
|
+
|
105
|
+
.switcher-dropdown--noborder::part(expand-icon) {
|
106
|
+
display: none;
|
107
|
+
}
|
108
|
+
`;export{e as s};
|
@@ -1,64 +1,64 @@
|
|
1
|
-
import{__decorate as e}from"tslib";import{x as
|
2
|
-
class=${
|
3
|
-
.value=${
|
1
|
+
import{__decorate as e}from"tslib";import{x as r}from"../index-cd2f9c12.esm.js";import{customElement as t}from"lit/decorators.js";import{s as i}from"./nile-switcher.css.esm.js";import{N as s}from"../internal/nile-element.esm.js";import{choose as o}from"lit/directives/choose.js";import{classMap as n}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 b=class extends s{constructor(){super(...arguments),this.hasSlotController=new c(this,"label"),this.current=0,this.isToggleSwitch=e=>void 0===e||e}connectedCallback(){super.connectedCallback(),this.emit("nile-init")}handleSwitcherChange(){this.setCurrentInput()}setCurrentInput(){this.nileSwitchConfig?.inputs&&(this.currentInput=this.nileSwitchConfig.inputs.filter(((e,r)=>r===this.current))[0])}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}renderNileText(e){const{value:t,label:i,placeholder:s,disabled:o,required:l,error:a,errorMessage:c,inputType:d,noborder:h}=e;return r`<nile-input
|
2
|
+
class=${n({"switcher-input":!0,"switcher-input--noborder":!!h})}
|
3
|
+
.value=${t}
|
4
4
|
.label=${i}
|
5
|
-
.disabled=${
|
5
|
+
.disabled=${o}
|
6
6
|
.required=${l}
|
7
7
|
.errorMessage=${c}
|
8
8
|
.placeholder=${s}
|
9
9
|
.error=${a}
|
10
10
|
@nile-input=${e=>{this.handleChange(e,d)}}
|
11
|
-
></nile-input>`}renderDropdown(e){const{options:
|
11
|
+
></nile-input>`}renderDropdown(e){const{options:t,multiple:i,placeholder:s,disabled:o,value:l,error:a,errorMessage:c,inputType:d,noborder:h}=e;return r`<nile-select
|
12
12
|
part="dropdown"
|
13
|
-
class
|
13
|
+
class=${n({"switcher-dropdown":!0,"switcher-dropdown--noborder":!!h})}
|
14
14
|
.placeholder=${s}
|
15
|
-
.disabled="${
|
15
|
+
.disabled="${o}"
|
16
16
|
.multiple="${i}"
|
17
|
-
.value="${
|
18
|
-
.error="${
|
19
|
-
.errorMessage="${
|
20
|
-
@nile-change=${e=>{this.handleChange(e,
|
17
|
+
.value="${l}"
|
18
|
+
.error="${a}"
|
19
|
+
.errorMessage="${c}"
|
20
|
+
@nile-change=${e=>{this.handleChange(e,d)}}
|
21
21
|
>
|
22
|
-
${
|
23
|
-
</nile-select>`}renderNileTextArea(e){const{value:
|
22
|
+
${t?.map((e=>r`<nile-option .value="${e}">${e} </nile-option>`))}
|
23
|
+
</nile-select>`}renderNileTextArea(e){const{value:t,disabled:i,readonly:s,errorMessage:o,error:n,inputType:l}=e;return r`<nile-textarea
|
24
24
|
class="switcher-textarea"
|
25
|
-
.value=${
|
25
|
+
.value=${t}
|
26
26
|
.disabled=${i}
|
27
27
|
?readonly=${s}
|
28
|
-
.error=${
|
29
|
-
.errorMessage=${
|
28
|
+
.error=${n}
|
29
|
+
.errorMessage=${o}
|
30
30
|
@nile-input=${e=>{this.handleChange(e,l)}}
|
31
|
-
></nile-textarea>`}renderNileCheckBox(e){const{value:
|
31
|
+
></nile-textarea>`}renderNileCheckBox(e){const{value:t,label:i,disabled:s,inputType:o}=e;return r`<nile-checkbox
|
32
32
|
class="switcher-checkbox"
|
33
|
-
.checked=${
|
33
|
+
.checked=${t}
|
34
34
|
.label=${i}
|
35
35
|
.disabled=${s}
|
36
|
-
@valueChange=${e=>{this.handleChange(e,
|
36
|
+
@valueChange=${e=>{this.handleChange(e,o)}}
|
37
37
|
></nile-checkbox
|
38
|
-
>; `}renderNileRadio(e){const{options:
|
38
|
+
>; `}renderNileRadio(e){const{options:t,value:i,disabled:s,errorMessage:o,inputType:n}=e,l=!!o;return r`<nile-radio-group
|
39
39
|
class="switcher-radio-group"
|
40
40
|
.value=${i}
|
41
41
|
.disabled=${s}
|
42
|
-
@change=${e=>{this.handleChange(e,
|
42
|
+
@change=${e=>{this.handleChange(e,n)}}
|
43
43
|
>
|
44
|
-
${
|
45
|
-
${l?this.renderErrorMessage(
|
46
|
-
</nile-radio-group> `}renderErrorMessage(e){return
|
44
|
+
${t&&t.map((e=>r`<nile-radio .value="${e}">${e} </nile-radio>`))}
|
45
|
+
${l?this.renderErrorMessage(o):""}
|
46
|
+
</nile-radio-group> `}renderErrorMessage(e){return r`
|
47
47
|
<nile-form-error-message>${e}</nile-form-error-message>
|
48
|
-
`}renderContentEditor(e){let{options:
|
48
|
+
`}renderContentEditor(e){let{options:t,inputType:i,errorMessage:s,type:o,readonly:n,noborder:l,value:a}=e;return r`<nile-content-editor
|
49
49
|
class="switcher-content-editor"
|
50
50
|
.value=${a}
|
51
|
-
.options=${
|
52
|
-
.type=${
|
53
|
-
.readonly=${
|
51
|
+
.options=${t}
|
52
|
+
.type=${o}
|
53
|
+
.readonly=${n}
|
54
54
|
.noborder=${l}
|
55
55
|
.errorMessage=${s}
|
56
56
|
@nile-change=${e=>{this.handleChange(e,i)}}
|
57
57
|
>
|
58
|
-
</nile-content-editor>`}renderObjectMapper(e){let{options:
|
59
|
-
class=${
|
58
|
+
</nile-content-editor>`}renderObjectMapper(e){let{options:t,inputType:i,error:s,errorMessage:o,type:l,readonly:a,noborder:c}=e;const d=this.currentInput.mode===$.CREATE?"Click to Create - Not Mapped":"Click to Edit";return r`<nile-input
|
59
|
+
class=${n({"switcher-object-mapper":!0,"switcher-object-mapper--noborder":!!c})}
|
60
60
|
.value=${d}
|
61
|
-
.errorMessage=${
|
61
|
+
.errorMessage=${o}
|
62
62
|
.error=${s}
|
63
63
|
readonly="true"
|
64
64
|
@click="${e=>this.handleChange(e,u.OBJECT_MAPPER)}"
|
@@ -71,30 +71,31 @@ import{__decorate as e}from"tslib";import{x as t}from"../index-cd2f9c12.esm.js";
|
|
71
71
|
size="16"
|
72
72
|
>
|
73
73
|
</nile-icon>
|
74
|
-
</nile-input>`}renderCodeEditor(e){const{value:
|
74
|
+
</nile-input>`}renderCodeEditor(e){const{value:t,multiLine:i,customAutoCompletions:s,disabled:o,readonly:l,errorMessage:a,error:c,inputType:d,noborder:h,expand:p,updateValue:$}=e;return r`<nile-code-editor
|
75
75
|
part="switcher-code-editor"
|
76
|
-
class=${
|
76
|
+
class=${n({"code-editor":!0})}
|
77
77
|
@nile-expand="${e=>this.handleExpand(e,u.CODE_EDITOR)}"
|
78
78
|
@nile-change="${e=>this.handleChange(e,u.CODE_EDITOR)}"
|
79
79
|
.multiline="${i}"
|
80
|
-
.value="${
|
80
|
+
.value="${t}"
|
81
81
|
.readonly=${l}
|
82
82
|
.expandable="${p}"
|
83
83
|
.error=${c}
|
84
|
+
.noborder=${h}
|
84
85
|
.updateValue=${$}
|
85
86
|
.errorMessage=${a}
|
86
87
|
.customAutoCompletions="${s}"
|
87
|
-
></nile-code-editor> `}handleExpand(e,
|
88
|
+
></nile-code-editor> `}handleExpand(e,r){this.currentInput.expand=e.detail.expand,this.emit("nile-change",{input:this.currentInput})}handleChange(e,r){switch(r){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 r`
|
88
89
|
<div part="icons-container" class="switcher-icons-container">
|
89
|
-
${l(e,((e,i)=>
|
90
|
-
class=${
|
90
|
+
${l(e,((e,i)=>r` <nile-tooltip
|
91
|
+
class=${n({"switcher-tooltip-container":!0})}
|
91
92
|
content=${e.helperText}
|
92
|
-
placement=${
|
93
|
+
placement=${t}
|
93
94
|
>
|
94
|
-
<div class=${
|
95
|
+
<div class=${n({"switcher-icon-container":!0,current:i===this.current})}>
|
95
96
|
<nile-icon
|
96
97
|
size="16"
|
97
|
-
class=${
|
98
|
+
class=${n({"pointer-cursor":!0,"pointer-cursor-not-allowed":i===this.current})}
|
98
99
|
.name=${e.icon}
|
99
100
|
color="#000000"
|
100
101
|
@click=${()=>this.toggleField(e,i)}
|
@@ -103,14 +104,14 @@ import{__decorate as e}from"tslib";import{x as t}from"../index-cd2f9c12.esm.js";
|
|
103
104
|
|
104
105
|
</nile-tooltip>`))}
|
105
106
|
</div>
|
106
|
-
`}toggleField(e,
|
107
|
-
${
|
108
|
-
`}render(){const e=this.hasSlotController.test("label"),
|
107
|
+
`}toggleField(e,r){this.emit("nile-switch",{inputClicked:r,currentInput:e})}singleFieldSwitcher(){return this.setCurrentInput(),r`
|
108
|
+
${o(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(this.currentInput)],[u.CODE_EDITOR,()=>this.renderCodeEditor(this.currentInput)]],(()=>this.renderNileText(this.currentInput)))}
|
109
|
+
`}render(){const e=this.hasSlotController.test("label"),t=this.nileSwitchConfig.align,i=this.nileSwitchConfig.disable;return r`<div
|
109
110
|
part="base"
|
110
|
-
class=${
|
111
|
+
class=${n({"switcher-block":t===h.BLOCK,"switcher-inline":t===h.INLINE,"switcher-container":!0})}
|
111
112
|
>
|
112
113
|
<div class="label-container">
|
113
|
-
${e?
|
114
|
+
${e?r`
|
114
115
|
<label
|
115
116
|
part="switcher-label"
|
116
117
|
class="switcher__label"
|
@@ -119,7 +120,7 @@ import{__decorate as e}from"tslib";import{x as t}from"../index-cd2f9c12.esm.js";
|
|
119
120
|
<slot name="label"></slot>
|
120
121
|
</label>
|
121
122
|
</div> `:""}
|
122
|
-
${i?"":
|
123
|
+
${i?"":r`${this.renderIcon()}`}
|
123
124
|
</div>
|
124
125
|
${this.singleFieldSwitcher()}
|
125
|
-
</div>`}};
|
126
|
+
</div>`}};b.styles=i,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),b=e([t("nile-switcher")],b);export{b as N};
|
@@ -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
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCxB,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 padding: 5px;\n border-radius: 5px;\n border: 1px solid rgb(204, 204, 204);\n }\n\n .error {\n border-color: #e5434d;\n }\n\n .noborder {\n border: none;\n }\n .cm-editor {\n flex: 1;\n min-width: 0;\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 align-self: start;\n padding: 5px 5px 0px 0px;\n }\n`;\n\nexport default [styles];\n"]}
|
@@ -33,6 +33,7 @@ let NileCodeEditor = class NileCodeEditor extends NileElement {
|
|
33
33
|
this.updateValue = false;
|
34
34
|
this.errorMessage = '';
|
35
35
|
this.error = false;
|
36
|
+
this.noborder = false;
|
36
37
|
this.expandable = false;
|
37
38
|
this.readonly = false;
|
38
39
|
this.lineNumbersComp = new Compartment();
|
@@ -124,10 +125,12 @@ let NileCodeEditor = class NileCodeEditor extends NileElement {
|
|
124
125
|
render() {
|
125
126
|
const hasErrorMessage = !!this.errorMessage;
|
126
127
|
const hasError = !!this.error;
|
128
|
+
const noborder = !!this.noborder;
|
127
129
|
return html `<div
|
128
130
|
part="code-editor-base"
|
129
131
|
class=${classMap({
|
130
132
|
'code-mirror': true,
|
133
|
+
noborder: noborder,
|
131
134
|
error: hasError || hasErrorMessage,
|
132
135
|
'code-mirror__singleline': !this.multiline,
|
133
136
|
})}
|
@@ -172,6 +175,9 @@ __decorate([
|
|
172
175
|
__decorate([
|
173
176
|
property({ attribute: 'error' })
|
174
177
|
], NileCodeEditor.prototype, "error", void 0);
|
178
|
+
__decorate([
|
179
|
+
property({ attribute: 'noborder' })
|
180
|
+
], NileCodeEditor.prototype, "noborder", void 0);
|
175
181
|
__decorate([
|
176
182
|
property({ type: Boolean })
|
177
183
|
], NileCodeEditor.prototype, "expandable", void 0);
|
@@ -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,GAIT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE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ADC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;uDAC3B;AAtCX,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA4I1B;SA5IY,cAAc;AA8I3B,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 PropertyValueMap,\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';\nimport { watch } from '../internal/watch';\nimport { PropertyValues } from 'lit';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { Theme } from './theme';\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, reflect: true }) multiline = false;\n @property({ type: String }) value = '';\n @property({ type: String }) customAutoCompletions: any = {};\n @property({ type: Boolean }) updateValue: any = false;\n @property({ attribute: 'error-message' }) errorMessage = '';\n @property({ attribute: 'error' }) error = false;\n @property({ type: Boolean }) expandable: any = false;\n @property({ type: Boolean }) readonly: any = false;\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 this.emit('nile-init');\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.emit('nile-destroy');\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 @watch(['value'], { waitUntilFirstUpdate: true })\n handleValueChange() {}\n\n updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n if (changedProperties.has('value')) {\n const customAutoCompletions = javascriptLanguage.data.of({\n autocomplete: scopeCompletionSource(this.customAutoCompletions),\n });\n if (!this.view) {\n let startState = EditorState.create({\n doc: !this.multiline\n ? this.convertToSingleLine(this.value)\n : this.value,\n extensions: [\n basicSetup({\n lineNumbers: !!this.multiline,\n highlightActiveLine: false,\n foldGutter: !!this.multiline,\n }),\n EditorState.readOnly.of(this.readonly),\n customAutoCompletions,\n autocompletion(),\n javascript(),\n this.setTheme(),\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 } else {\n if (this.updateValue) {\n // Editor has already been initialized, update its state\n this.view.dispatch({\n changes: {\n from: 0,\n to: this.view.state.doc.length,\n insert: !this.multiline\n ? this.convertToSingleLine(this.value)\n : this.value,\n },\n });\n }\n }\n }\n }\n\n setTheme() {\n return EditorView.theme(Theme);\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 const hasErrorMessage = !!this.errorMessage;\n const hasError = !!this.error;\n return html`<div\n part=\"code-editor-base\"\n class=${classMap({\n 'code-mirror': true,\n error: hasError || hasErrorMessage,\n 'code-mirror__singleline': !this.multiline,\n })}\n >\n ${this.expandable\n ? html` <nile-icon\n name=\"expand-2\"\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 ${hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``}`;\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,GAIT,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;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,gDAAgD;AAEhD;;;;;GAKG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ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,CAAC,IAAI,CAAA;;iBAEG,IAAI,CAAC,YAAY;;WAEvB;YACH,CAAC,CAAC,EAAE,EAAE,CAAC;IACb,CAAC;CAGF,CAAA;AA/IwB;IAAtB,KAAK,CAAC,cAAc,CAAC;kDAA8B;AACR;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAAmB;AAClC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAY;AACX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6DAAiC;AAC/B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mDAA0B;AACZ;IAAzC,QAAQ,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;oDAAmB;AAC1B;IAAjC,QAAQ,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;6CAAe;AACX;IAApC,QAAQ,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;gDAAkB;AAEzB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDAAyB;AACxB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;gDAAuB;AA6BnD;IADC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;uDAC3B;AAxCX,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAgJ1B;SAhJY,cAAc;AAkJ3B,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 PropertyValueMap,\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';\nimport { watch } from '../internal/watch';\nimport { PropertyValues } from 'lit';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { Theme } from './theme';\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, reflect: true }) multiline = false;\n @property({ type: String }) value = '';\n @property({ type: String }) customAutoCompletions: any = {};\n @property({ type: Boolean }) updateValue: any = false;\n @property({ attribute: 'error-message' }) errorMessage = '';\n @property({ attribute: 'error' }) error = false;\n @property({ attribute: 'noborder' }) noborder = false;\n\n @property({ type: Boolean }) expandable: any = false;\n @property({ type: Boolean }) readonly: any = false;\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 this.emit('nile-init');\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.emit('nile-destroy');\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 @watch(['value'], { waitUntilFirstUpdate: true })\n handleValueChange() {}\n\n updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n if (changedProperties.has('value')) {\n const customAutoCompletions = javascriptLanguage.data.of({\n autocomplete: scopeCompletionSource(this.customAutoCompletions),\n });\n if (!this.view) {\n let startState = EditorState.create({\n doc: !this.multiline\n ? this.convertToSingleLine(this.value)\n : this.value,\n extensions: [\n basicSetup({\n lineNumbers: !!this.multiline,\n highlightActiveLine: false,\n foldGutter: !!this.multiline,\n }),\n EditorState.readOnly.of(this.readonly),\n customAutoCompletions,\n autocompletion(),\n javascript(),\n this.setTheme(),\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 } else {\n if (this.updateValue) {\n // Editor has already been initialized, update its state\n this.view.dispatch({\n changes: {\n from: 0,\n to: this.view.state.doc.length,\n insert: !this.multiline\n ? this.convertToSingleLine(this.value)\n : this.value,\n },\n });\n }\n }\n }\n }\n\n setTheme() {\n return EditorView.theme(Theme);\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 const hasErrorMessage = !!this.errorMessage;\n const hasError = !!this.error;\n const noborder = !!this.noborder;\n return html`<div\n part=\"code-editor-base\"\n class=${classMap({\n 'code-mirror': true,\n noborder: noborder,\n error: hasError || hasErrorMessage,\n 'code-mirror__singleline': !this.multiline,\n })}\n >\n ${this.expandable\n ? html` <nile-icon\n name=\"expand-2\"\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 ${hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``}`;\n }\n\n /* #endregion */\n}\n\nexport default NileCodeEditor;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-code-editor': NileCodeEditor;\n }\n}\n"]}
|
@@ -56,7 +56,7 @@ export const styles = css `
|
|
56
56
|
|
57
57
|
.switcher-inline > :nth-child(2) {
|
58
58
|
flex: 1;
|
59
|
-
|
59
|
+
min-width: 0;
|
60
60
|
}
|
61
61
|
|
62
62
|
.switcher-icons-container {
|
@@ -107,6 +107,14 @@ export const styles = css `
|
|
107
107
|
.switcher-object-mapper--noborder::part(base) {
|
108
108
|
border: none;
|
109
109
|
}
|
110
|
+
|
111
|
+
.switcher-dropdown--noborder::part(combobox) {
|
112
|
+
border: none;
|
113
|
+
}
|
114
|
+
|
115
|
+
.switcher-dropdown--noborder::part(expand-icon) {
|
116
|
+
display: none;
|
117
|
+
}
|
110
118
|
`;
|
111
119
|
export default [styles];
|
112
120
|
//# sourceMappingURL=nile-switcher.css.js.map
|