@aquera/nile-elements 0.0.34 → 0.0.36-1
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 +12 -5
- 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 +9 -4
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.js +98 -39
- 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-code-editor/theme.d.ts +9 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/theme.js +10 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/theme.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js +41 -18
- 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 +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +36 -9
- 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.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.iife.js +279 -227
- package/dist/nile-code-editor/extensionSetup.cjs.js +1 -1
- package/dist/nile-code-editor/extensionSetup.cjs.js.map +1 -1
- package/dist/nile-code-editor/extensionSetup.esm.js +1 -1
- package/dist/nile-code-editor/index.cjs.js +1 -1
- package/dist/nile-code-editor/index.esm.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
- 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 +14 -7
- package/dist/nile-code-editor/nile-code-editor.esm.js +17 -9
- package/dist/nile-code-editor/theme.cjs.js +2 -0
- package/dist/nile-code-editor/theme.cjs.js.map +1 -0
- package/dist/nile-code-editor/theme.esm.js +1 -0
- package/dist/nile-switcher/index.cjs.js +1 -1
- package/dist/nile-switcher/index.esm.js +1 -1
- 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 +43 -20
- package/dist/nile-switcher/nile-switcher.esm.js +51 -37
- package/dist/src/nile-code-editor/nile-code-editor.css.js +12 -5
- 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 +9 -4
- package/dist/src/nile-code-editor/nile-code-editor.js +98 -39
- package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
- package/dist/src/nile-code-editor/theme.d.ts +9 -0
- package/dist/src/nile-code-editor/theme.js +10 -0
- package/dist/src/nile-code-editor/theme.js.map +1 -0
- package/dist/src/nile-switcher/nile-switcher.css.js +41 -18
- package/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
- package/dist/src/nile-switcher/nile-switcher.d.ts +2 -0
- package/dist/src/nile-switcher/nile-switcher.js +36 -9
- 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 +12 -5
- package/src/nile-code-editor/nile-code-editor.ts +93 -42
- package/src/nile-code-editor/theme.ts +9 -0
- package/src/nile-switcher/nile-switcher.css.ts +41 -18
- package/src/nile-switcher/nile-switcher.ts +38 -9
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"theme.cjs.js","sources":["../../../src/nile-code-editor/theme.ts"],"sourcesContent":["export const Theme = {\n '&': {\n fontSize: '14px',\n fontFamily: 'Colfax-regular',\n fontWeight: '400',\n },\n '.cm-content': {},\n '.cm-scroller': {},\n};\n"],"names":["Theme","fontSize","fontFamily","fontWeight"],"mappings":"kHAAaA,CAAQ,CAAA,CACnB,GAAK,CAAA,CACHC,SAAU,MACVC,CAAAA,UAAAA,CAAY,gBACZC,CAAAA,UAAAA,CAAY,OAEd,aAAe,CAAA,CAAE,CACjB,CAAA,cAAA,CAAgB,CAAE"}
|
@@ -0,0 +1 @@
|
|
1
|
+
const o={"&":{fontSize:"14px",fontFamily:"Colfax-regular",fontWeight:"400"},".cm-content":{},".cm-scroller":{}};export{o as T};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["./nile-switcher.cjs.js","tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-switcher.css.cjs.js","../internal/nile-element.cjs.js","lit","lit/directives/choose.js","lit/directives/class-map.js","lit/directives/repeat.js","../internal/watch.cjs.js","../property-0f6a51ec.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileSwitcherCjsJs){_export("NileSwitcher",_nileSwitcherCjsJs.N);},function(_tslib){},function(_index001CjsJs){},function(_litDecoratorsJs){},function(_nileSwitcherCssCjsJs){},function(_internalNileElementCjsJs){},function(_lit){},function(_litDirectivesChooseJs){},function(_litDirectivesClassMapJs){},function(_litDirectivesRepeatJs){},function(_internalWatchCjsJs){},function(_property002CjsJs){}],execute:function(){}};});
|
1
|
+
System.register(["./nile-switcher.cjs.js","tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-switcher.css.cjs.js","../internal/nile-element.cjs.js","lit","lit/directives/choose.js","lit/directives/class-map.js","lit/directives/repeat.js","../internal/watch.cjs.js","../internal/slot.cjs.js","../property-0f6a51ec.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileSwitcherCjsJs){_export("NileSwitcher",_nileSwitcherCjsJs.N);},function(_tslib){},function(_index001CjsJs){},function(_litDecoratorsJs){},function(_nileSwitcherCssCjsJs){},function(_internalNileElementCjsJs){},function(_lit){},function(_litDirectivesChooseJs){},function(_litDirectivesClassMapJs){},function(_litDirectivesRepeatJs){},function(_internalWatchCjsJs){},function(_internalSlotCjsJs){},function(_property002CjsJs){}],execute:function(){}};});
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
export{N as NileSwitcher}from"./nile-switcher.esm.js";import"tslib";import"../index-cd2f9c12.esm.js";import"lit/decorators.js";import"./nile-switcher.css.esm.js";import"../internal/nile-element.esm.js";import"lit";import"lit/directives/choose.js";import"lit/directives/class-map.js";import"lit/directives/repeat.js";import"../internal/watch.esm.js";import"../property-09139d3c.esm.js";
|
1
|
+
export{N as NileSwitcher}from"./nile-switcher.esm.js";import"tslib";import"../index-cd2f9c12.esm.js";import"lit/decorators.js";import"./nile-switcher.css.esm.js";import"../internal/nile-element.esm.js";import"lit";import"lit/directives/choose.js";import"lit/directives/class-map.js";import"lit/directives/repeat.js";import"../internal/watch.esm.js";import"../internal/slot.esm.js";import"../property-09139d3c.esm.js";
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-switcher.css.cjs.js","../internal/nile-element.cjs.js","lit/directives/choose.js","lit/directives/class-map.js","lit/directives/repeat.js","../internal/watch.cjs.js","../property-0f6a51ec.cjs.js","lit"],function(_export,_context){"use strict";var e,i,t,r,s,n,o,l,c,a,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_templateObject12,_templateObject13,_templateObject14,_templateObject15,d,h,p,u,$;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_index001CjsJs){i=_index001CjsJs.x;},function(_litDecoratorsJs){t=_litDecoratorsJs.customElement;},function(_nileSwitcherCssCjsJs){r=_nileSwitcherCssCjsJs.s;},function(_internalNileElementCjsJs){s=_internalNileElementCjsJs.N;},function(_litDirectivesChooseJs){n=_litDirectivesChooseJs.choose;},function(_litDirectivesClassMapJs){o=_litDirectivesClassMapJs.classMap;},function(_litDirectivesRepeatJs){l=_litDirectivesRepeatJs.repeat;},function(_internalWatchCjsJs){c=_internalWatchCjsJs.w;},function(_property002CjsJs){a=_property002CjsJs.n;},function(_lit){}],execute:function(){!function(e){e.INLINE="inline",e.BLOCK="block";}(d||(d={})),function(e){e.DEFAULT="defaultInput",e.SWITCH="switchInput";}(h||(h={})),function(e){e.DROPDOWN="dropdown",e.TEXT="text",e.CHECKBOX="checkbox",e.TEXTAREA="text-area",e.RADIO="radio",e.CONTENTEDITOR="content-editor",e.OBJECT_MAPPER="object-mapper",e.CODE_EDITOR="code-editor";}(p||(p={})),function(e){e.CREATE="create",e.EDIT="edit";}(u||(u={}));_export("N",$=/*#__PURE__*/function(_s){_inherits($,_s);var _super=_createSuper($);function $(){var _this;_classCallCheck(this,$);_this=_super.apply(this,arguments),_this.current=0;return _this;}_createClass($,[{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf($.prototype),"connectedCallback",this).call(this),this.emit("nile-init");}},{key:"handleSwitcherChange",value:function handleSwitcherChange(){this.setCurrentInput();}},{key:"setCurrentInput",value:function setCurrentInput(){var _this$nileSwitchConfi,_this2=this;((_this$nileSwitchConfi=this.nileSwitchConfig)===null||_this$nileSwitchConfi===void 0?void 0:_this$nileSwitchConfi.inputs)&&(this.currentInput=this.nileSwitchConfig.inputs.filter(function(e,i){return i===_this2.current;})[0]);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_get(_getPrototypeOf($.prototype),"disconnectedCallback",this).call(this),this.emit("nile-destroy");}},{key:"renderNileText",value:function renderNileText(e){var _this3=this;var t=e.value,r=e.label,s=e.placeholder,n=e.disabled,l=e.required,c=e.error,a=e.errorMessage,d=e.inputType,h=e.noborder;return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-input\n class=","\n .value=","\n .label=","\n .disabled=","\n .required=","\n .errorMessage=","\n .placeholder=","\n .error=","\n @nile-input=","\n ></nile-input>"])),o({"switcher-input":!0,"switcher-input--noborder":!!h}),t,r,n,l,a,s,c,function(e){_this3.handleChange(e,d);});}},{key:"renderDropdown",value:function renderDropdown(e){var _this4=this;var t=e.options,r=e.multiple,s=e.placeholder,n=e.disabled,o=e.value,l=e.error,c=e.errorMessage,a=e.inputType;return i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-select\n class=\"switcher-dropdown\"\n .placeholder=","\n .disabled=\"","\"\n .multiple=\"","\"\n .value=\"","\"\n .error=\"","\"\n .errorMessage=\"","\"\n @nile-change=","\n >\n ","\n </nile-select>"])),s,n,r,o,l,c,function(e){_this4.handleChange(e,a);},t===null||t===void 0?void 0:t.map(function(e){return i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-option .value=\"","\">"," </nile-option>"])),e,e);}));}},{key:"renderNileTextArea",value:function renderNileTextArea(e){var _this5=this;var t=e.value,r=e.disabled,s=e.readonly,n=e.errorMessage,o=e.error,l=e.inputType;return i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-textarea\n class=\"switcher-textarea\"\n .value=","\n .disabled=","\n ?readonly=","\n .error=","\n .errorMessage=","\n @nile-input=","\n ></nile-textarea>"])),t,r,s,o,n,function(e){_this5.handleChange(e,l);});}},{key:"renderNileCheckBox",value:function renderNileCheckBox(e){var _this6=this;var t=e.value,r=e.label,s=e.disabled,n=e.inputType;return i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-checkbox\n class=\"switcher-checkbox\"\n .checked=","\n .label=","\n .disabled=","\n @valueChange=","\n ></nile-checkbox\n >; "])),t,r,s,function(e){_this6.handleChange(e,n);});}},{key:"renderNileRadio",value:function renderNileRadio(e){var _this7=this;var t=e.options,r=e.value,s=e.disabled,n=e.errorMessage,o=e.inputType,l=!!n;return i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-radio-group\n class=\"switcher-radio-group\"\n .value=","\n .disabled=","\n @change=","\n >\n ","\n ","\n </nile-radio-group> "])),r,s,function(e){_this7.handleChange(e,o);},t&&t.map(function(e){return i(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-radio .value=\"","\">"," </nile-radio>"])),e,e);}),l?this.renderErrorMessage(n):"");}},{key:"renderErrorMessage",value:function renderErrorMessage(e){return i(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["\n <nile-form-error-message>","</nile-form-error-message>\n "])),e);}},{key:"renderContentEditor",value:function renderContentEditor(e){var _this8=this;var t=e.options,r=e.inputType,s=e.errorMessage,n=e.type,o=e.readonly,l=e.noborder,c=e.value;return i(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["<nile-content-editor\n class=\"switcher-content-editor\"\n .value=","\n .options=","\n .type=","\n .readonly=","\n .noborder=","\n .errorMessage=","\n @nile-change=","\n >\n </nile-content-editor>"])),c,t,n,o,l,s,function(e){_this8.handleChange(e,r);});}},{key:"renderObjectMapper",value:function renderObjectMapper(){var _this9=this;var e=this.currentInput.noborder;this.currentInput.mode;var t=this.currentInput.mode===u.CREATE?"Click to Create - Not Mapped":"";return i(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<nile-input\n class=","\n .value=","\n readonly=\"true\"\n @click=\"","\"\n >\n <nile-icon\n class=\"pointer-cursor switcher-object-mapper-icon\"\n slot=\"suffix\"\n name=\"collapse\"\n color=\"#005EA6\"\n size=\"16\"\n >\n </nile-icon>\n </nile-input>"])),o({"switcher-object-mapper":!0,"switcher-object-mapper--noborder":!!e}),t,function(e){return _this9.handleChange(e,p.OBJECT_MAPPER);});}},{key:"renderCodeEditor",value:function renderCodeEditor(e){var _this10=this;var t=e.value,r=e.multiLine,s=e.customAutoCompletions,n=e.disabled,l=e.readonly,c=e.errorMessage,a=e.error,d=e.inputType,h=e.noborder;return i(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["<nile-code-editor\n class=","\n @nile-expand=\"","\"\n @nile-change=\"","\"\n .multiline=\"","\"\n .value=\"","\"\n .customOptions=\"","\"\n .showLineNumbers=\"false\"\n ></nile-code-editor> "])),o({"code-editor":!0,"code-editor__no-border":!!h}),function(e){return _this10.handleExpand(e,p.CODE_EDITOR);},function(e){return _this10.handleChange(e,p.CODE_EDITOR);},r,t,s);}},{key:"handleExpand",value:function handleExpand(e,i){this.currentInput.expand=e.detail.expand,this.emit("nile-change",{input:this.currentInput});}},{key:"handleChange",value:function handleChange(e,i){switch(i){case p.OBJECT_MAPPER:this.currentInput.value="clicked";break;case p.CHECKBOX:this.currentInput.value=e.detail.checked;break;case p.CODE_EDITOR:default:this.currentInput.value=e.detail.value;}e.stopPropagation(),this.emit("nile-change",{input:this.currentInput});}},{key:"renderIcon",value:function renderIcon(){var _this11=this;var e=this.nileSwitchConfig.inputs,t=this.nileSwitchConfig.align===d.BLOCK?"top":"bottom";return i(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["\n <div class=\"switcher-icons-container\">\n ","\n </div>\n "])),l(e,function(e,r){return i(_templateObject13||(_templateObject13=_taggedTemplateLiteral([" <nile-tooltip\n class=","\n content=","\n placement=","\n >\n <div class=",">\n <nile-icon\n size=\"16\"\n class=","\n .name=","\n color=\"#000000\"\n @click=","\n ></nile-icon>\n <div>\n \n </nile-tooltip>"])),o({"switcher-tooltip-container":!0}),e.helperText,t,o({"switcher-icon-container":!0,current:r===_this11.current}),o({"pointer-cursor":!0}),e.icon,function(){return _this11.toggleField(e,r);});}));}},{key:"toggleField",value:function toggleField(e,i){this.current=i,this.emit("nile-switch",{input:this.currentInput});}},{key:"singleFieldSwitcher",value:function singleFieldSwitcher(){var _this12=this;return this.currentInput||this.setCurrentInput(),i(_templateObject14||(_templateObject14=_taggedTemplateLiteral(["\n ","\n "])),n(this.currentInput.inputType,[[p.TEXT,function(){return _this12.renderNileText(_this12.currentInput);}],[p.CHECKBOX,function(){return _this12.renderNileCheckBox(_this12.currentInput);}],[p.TEXTAREA,function(){return _this12.renderNileTextArea(_this12.currentInput);}],[p.RADIO,function(){return _this12.renderNileRadio(_this12.currentInput);}],[p.DROPDOWN,function(){return _this12.renderDropdown(_this12.currentInput);}],[p.CONTENTEDITOR,function(){return _this12.renderContentEditor(_this12.currentInput);}],[p.OBJECT_MAPPER,function(){return _this12.renderObjectMapper();}],[p.CODE_EDITOR,function(){return _this12.renderCodeEditor(_this12.currentInput);}]],function(){return _this12.renderNileText(_this12.currentInput);}));}},{key:"render",value:function render(){var e=this.nileSwitchConfig.align;return i(_templateObject15||(_templateObject15=_taggedTemplateLiteral(["<div\n class=","\n >\n "," ","\n </div>"])),o({"switcher-block":e===d.BLOCK,"switcher-inline":e===d.INLINE,"switcher-input-container":!0}),this.renderIcon(),this.singleFieldSwitcher());}}]);return $;}(s));$.styles=r,e([a({type:Object})],$.prototype,"nileSwitchConfig",void 0),e([a({type:Number})],$.prototype,"current",void 0),e([a({type:Object})],$.prototype,"currentInput",void 0),e([c(["current"],{waitUntilFirstUpdate:!0})],$.prototype,"handleSwitcherChange",null),_export("N",$=e([t("nile-switcher")],$));}};});
|
1
|
+
System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-switcher.css.cjs.js","../internal/nile-element.cjs.js","lit/directives/choose.js","lit/directives/class-map.js","lit/directives/repeat.js","../internal/watch.cjs.js","../internal/slot.cjs.js","../property-0f6a51ec.cjs.js","lit"],function(_export,_context){"use strict";var e,t,i,r,s,n,o,l,a,c,d,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_templateObject12,_templateObject13,_templateObject14,_templateObject15,_templateObject16,h,p,u,$,b;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_index001CjsJs){t=_index001CjsJs.x;},function(_litDecoratorsJs){i=_litDecoratorsJs.customElement;},function(_nileSwitcherCssCjsJs){r=_nileSwitcherCssCjsJs.s;},function(_internalNileElementCjsJs){s=_internalNileElementCjsJs.N;},function(_litDirectivesChooseJs){n=_litDirectivesChooseJs.choose;},function(_litDirectivesClassMapJs){o=_litDirectivesClassMapJs.classMap;},function(_litDirectivesRepeatJs){l=_litDirectivesRepeatJs.repeat;},function(_internalWatchCjsJs){a=_internalWatchCjsJs.w;},function(_internalSlotCjsJs){c=_internalSlotCjsJs.H;},function(_property002CjsJs){d=_property002CjsJs.n;},function(_lit){}],execute:function(){!function(e){e.INLINE="inline",e.BLOCK="block";}(h||(h={})),function(e){e.DEFAULT="defaultInput",e.SWITCH="switchInput";}(p||(p={})),function(e){e.DROPDOWN="dropdown",e.TEXT="text",e.CHECKBOX="checkbox",e.TEXTAREA="text-area",e.RADIO="radio",e.CONTENTEDITOR="content-editor",e.OBJECT_MAPPER="object-mapper",e.CODE_EDITOR="code-editor";}(u||(u={})),function(e){e.CREATE="create",e.EDIT="edit";}($||($={}));_export("N",b=/*#__PURE__*/function(_s){_inherits(b,_s);var _super=_createSuper(b);function b(){var _this;_classCallCheck(this,b);_this=_super.apply(this,arguments),_this.hasSlotController=new c(_assertThisInitialized(_this),"label"),_this.current=1,_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 i=e.value,r=e.label,s=e.placeholder,n=e.disabled,l=e.required,a=e.error,c=e.errorMessage,d=e.inputType,h=e.noborder;return t(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-input\n class=","\n .value=","\n .label=","\n .disabled=","\n .required=","\n .errorMessage=","\n .placeholder=","\n .error=","\n @nile-input=","\n ></nile-input>"])),o({"switcher-input":!0,"switcher-input--noborder":!!h}),i,r,n,l,c,s,a,function(e){_this3.handleChange(e,d);});}},{key:"renderDropdown",value:function renderDropdown(e){var _this4=this;var i=e.options,r=e.multiple,s=e.placeholder,n=e.disabled,o=e.value,l=e.error,a=e.errorMessage,c=e.inputType;return t(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-select\n part=\"dropdown\"\n class=\"switcher-dropdown\"\n .placeholder=","\n .disabled=\"","\"\n .multiple=\"","\"\n .value=\"","\"\n .error=\"","\"\n .errorMessage=\"","\"\n @nile-change=","\n >\n ","\n </nile-select>"])),s,n,r,o,l,a,function(e){_this4.handleChange(e,c);},i===null||i===void 0?void 0:i.map(function(e){return t(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-option .value=\"","\">"," </nile-option>"])),e,e);}));}},{key:"renderNileTextArea",value:function renderNileTextArea(e){var _this5=this;var i=e.value,r=e.disabled,s=e.readonly,n=e.errorMessage,o=e.error,l=e.inputType;return t(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-textarea\n class=\"switcher-textarea\"\n .value=","\n .disabled=","\n ?readonly=","\n .error=","\n .errorMessage=","\n @nile-input=","\n ></nile-textarea>"])),i,r,s,o,n,function(e){_this5.handleChange(e,l);});}},{key:"renderNileCheckBox",value:function renderNileCheckBox(e){var _this6=this;var i=e.value,r=e.label,s=e.disabled,n=e.inputType;return t(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-checkbox\n class=\"switcher-checkbox\"\n .checked=","\n .label=","\n .disabled=","\n @valueChange=","\n ></nile-checkbox\n >; "])),i,r,s,function(e){_this6.handleChange(e,n);});}},{key:"renderNileRadio",value:function renderNileRadio(e){var _this7=this;var i=e.options,r=e.value,s=e.disabled,n=e.errorMessage,o=e.inputType,l=!!n;return t(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-radio-group\n class=\"switcher-radio-group\"\n .value=","\n .disabled=","\n @change=","\n >\n ","\n ","\n </nile-radio-group> "])),r,s,function(e){_this7.handleChange(e,o);},i&&i.map(function(e){return t(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-radio .value=\"","\">"," </nile-radio>"])),e,e);}),l?this.renderErrorMessage(n):"");}},{key:"renderErrorMessage",value:function renderErrorMessage(e){return t(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["\n <nile-form-error-message>","</nile-form-error-message>\n "])),e);}},{key:"renderContentEditor",value:function renderContentEditor(e){var _this8=this;var i=e.options,r=e.inputType,s=e.errorMessage,n=e.type,o=e.readonly,l=e.noborder,a=e.value;return t(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["<nile-content-editor\n class=\"switcher-content-editor\"\n .value=","\n .options=","\n .type=","\n .readonly=","\n .noborder=","\n .errorMessage=","\n @nile-change=","\n >\n </nile-content-editor>"])),a,i,n,o,l,s,function(e){_this8.handleChange(e,r);});}},{key:"renderObjectMapper",value:function renderObjectMapper(){var _this9=this;var e=this.currentInput.noborder;this.currentInput.mode;var i=this.currentInput.mode===$.CREATE?"Click to Create - Not Mapped":"Click to Edit";return t(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<nile-input\n class=","\n .value=","\n readonly=\"true\"\n @click=\"","\"\n >\n <nile-icon\n class=\"pointer-cursor switcher-object-mapper-icon\"\n slot=\"suffix\"\n name=\"collapse\"\n color=\"#005EA6\"\n size=\"16\"\n >\n </nile-icon>\n </nile-input>"])),o({"switcher-object-mapper":!0,"switcher-object-mapper--noborder":!!e}),i,function(e){return _this9.handleChange(e,u.OBJECT_MAPPER);});}},{key:"renderCodeEditor",value:function renderCodeEditor(e){var _this10=this;var i=e.value,r=e.multiLine,s=e.customAutoCompletions,n=e.disabled,l=e.readonly,a=e.errorMessage,c=e.error,d=e.inputType,h=e.noborder;return t(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["<nile-code-editor\n part=\"switcher-code-editor\"\n class=","\n @nile-expand=\"","\"\n @nile-change=\"","\"\n .multiline=\"","\"\n .value=\"","\"\n .customOptions=\"","\"\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);},r,i,s);}},{key:"handleExpand",value:function handleExpand(e,t){this.currentInput.expand=e.detail.expand,this.emit("nile-change",{input:this.currentInput});}},{key:"handleChange",value:function handleChange(e,t){switch(t){case u.OBJECT_MAPPER:this.currentInput.value="clicked";break;case u.CHECKBOX:this.currentInput.value=e.detail.checked;break;case u.CODE_EDITOR:default:this.currentInput.value=e.detail.value;}e.stopPropagation(),this.emit("nile-change",{input:this.currentInput});}},{key:"renderIcon",value:function renderIcon(){var _this11=this;var e=this.nileSwitchConfig.inputs,i=this.nileSwitchConfig.align===h.BLOCK?"top":"bottom";return t(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["\n <div part=\"icons-container\" class=\"switcher-icons-container\">\n ","\n </div>\n "])),l(e,function(e,r){return t(_templateObject13||(_templateObject13=_taggedTemplateLiteral([" <nile-tooltip\n class=","\n content=","\n placement=","\n >\n <div class=",">\n <nile-icon\n size=\"16\"\n class=","\n .name=","\n color=\"#000000\"\n @click=","\n ></nile-icon>\n <div>\n \n </nile-tooltip>"])),o({"switcher-tooltip-container":!0}),e.helperText,i,o({"switcher-icon-container":!0,current:r===_this11.current}),o({"pointer-cursor":!0}),e.icon,function(){return _this11.toggleField(e,r);});}));}},{key:"toggleField",value:function toggleField(e,t){var _this12=this;this.isToggleSwitch(this.nileSwitchConfig.confirmation)&&(this.current=t),this.updateComplete.then(function(e){e&&_this12.emit("nile-switch",{input:_this12.currentInput});});}},{key:"singleFieldSwitcher",value:function singleFieldSwitcher(){var _this13=this;return this.currentInput||this.setCurrentInput(),t(_templateObject14||(_templateObject14=_taggedTemplateLiteral(["\n ","\n "])),n(this.currentInput.inputType,[[u.TEXT,function(){return _this13.renderNileText(_this13.currentInput);}],[u.CHECKBOX,function(){return _this13.renderNileCheckBox(_this13.currentInput);}],[u.TEXTAREA,function(){return _this13.renderNileTextArea(_this13.currentInput);}],[u.RADIO,function(){return _this13.renderNileRadio(_this13.currentInput);}],[u.DROPDOWN,function(){return _this13.renderDropdown(_this13.currentInput);}],[u.CONTENTEDITOR,function(){return _this13.renderContentEditor(_this13.currentInput);}],[u.OBJECT_MAPPER,function(){return _this13.renderObjectMapper();}],[u.CODE_EDITOR,function(){return _this13.renderCodeEditor(_this13.currentInput);}]],function(){return _this13.renderNileText(_this13.currentInput);}));}},{key:"render",value:function render(){var e=this.hasSlotController.test("label"),i=this.nileSwitchConfig.align;return t(_templateObject15||(_templateObject15=_taggedTemplateLiteral(["<div\n part=\"base\"\n class=","\n >\n <div class=\"label-container\">\n ","\n ","\n </div>\n ","\n </div>"])),o({"switcher-block":i===h.BLOCK,"switcher-inline":i===h.INLINE,"switcher-container":!0}),e?t(_templateObject16||(_templateObject16=_taggedTemplateLiteral(["\n <label\n part=\"switcher-label\"\n class=\"switcher__label\"\n for=\"input\"\n >\n <slot name=\"label\"></slot>\n </label>\n </div> "]))):"",this.renderIcon(),this.singleFieldSwitcher());}}]);return b;}(s));b.styles=r,e([d({type:Object})],b.prototype,"nileSwitchConfig",void 0),e([d({type:Number})],b.prototype,"current",void 0),e([d({type:Object})],b.prototype,"currentInput",void 0),e([a(["current"],{waitUntilFirstUpdate:!0})],b.prototype,"handleSwitcherChange",null),_export("N",b=e([i("nile-switcher")],b));}};});
|
2
2
|
//# sourceMappingURL=nile-switcher.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-switcher.cjs.js","sources":["../../../src/nile-switcher/nile-switcher.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, TemplateResult } from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-switcher.css';\nimport NileElement from '../internal/nile-element';\nimport { CSSResultGroup } from 'lit';\nimport { choose } from 'lit/directives/choose.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { watch } from '../internal/watch';\n\n/**\n * @summary Allows you to switch between nile elements\n *\n * @dependency nile-icon\n * @dependency nile-input\n * @dependency nile-checkbox\n * @dependency nile-dropdown\n * @dependency nile-textarea\n *\n * @event nile-change - Emitted when the control's value changes.\n * @event nile-switch - Emitted when the nile component is being switched.\n */\n\nexport interface switchconfig {\n [key: string]: any;\n toggleSwitch: boolean;\n disable?: boolean;\n confirmation?: boolean;\n align: 'block' | 'inline';\n inputs: switchInputType[];\n}\n\nexport interface switchInputType {\n inputType:\n | INPUT_TYPE_NAMES.DROPDOWN\n | INPUT_TYPE_NAMES.TEXT\n | INPUT_TYPE_NAMES.CHECKBOX\n | INPUT_TYPE_NAMES.TEXTAREA\n | INPUT_TYPE_NAMES.RADIO\n | INPUT_TYPE_NAMES.CONTENTEDITOR\n | INPUT_TYPE_NAMES.OBJECT_MAPPER\n | INPUT_TYPE_NAMES.CODE_EDITOR;\n value?: String | boolean;\n label?: String;\n readonly?: boolean;\n type?: string;\n icon: string;\n mode?: string;\n placeholder?: string;\n disabled?: boolean;\n required?: boolean;\n error?: boolean;\n errorMessage?: string;\n options?: Array<any>;\n customAutoCompletions?: any;\n helperText?: string;\n multiple?: boolean;\n noborder?: boolean;\n multiLine?: boolean;\n expand?: boolean;\n}\n\nexport enum POSITIONS {\n INLINE = 'inline',\n BLOCK = 'block',\n}\n\nexport enum INPUT_TYPE {\n DEFAULT = 'defaultInput',\n SWITCH = 'switchInput',\n}\n\nexport enum INPUT_TYPE_NAMES {\n DROPDOWN = 'dropdown',\n TEXT = 'text',\n CHECKBOX = 'checkbox',\n TEXTAREA = 'text-area',\n RADIO = 'radio',\n CONTENTEDITOR = 'content-editor',\n OBJECT_MAPPER = 'object-mapper',\n CODE_EDITOR = 'code-editor',\n}\n\nexport enum MODE {\n CREATE = 'create',\n EDIT = 'edit',\n}\n\n@customElement('nile-switcher')\nexport class NileSwitcher extends NileElement {\n /**\n * The styles for nile switcher\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n static styles: CSSResultGroup = styles;\n\n @property({ type: Object }) nileSwitchConfig: switchconfig;\n @property({ type: Number }) current: Number = 0;\n\n @property({ type: Object }) currentInput: switchInputType;\n\n connectedCallback() {\n super.connectedCallback();\n this.emit('nile-init');\n }\n\n @watch(['current'], { waitUntilFirstUpdate: true })\n handleSwitcherChange() {\n this.setCurrentInput();\n }\n\n setCurrentInput() {\n if (this.nileSwitchConfig?.inputs) {\n this.currentInput = this.nileSwitchConfig.inputs.filter(\n (input: switchInputType, index: Number) => {\n return index === this.current;\n }\n )[0];\n }\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n renderNileText(Input: switchInputType) {\n const {\n value,\n label,\n placeholder,\n disabled,\n required,\n error,\n errorMessage,\n inputType,\n noborder,\n } = Input;\n return html`<nile-input\n class=${classMap({\n 'switcher-input': true,\n 'switcher-input--noborder': !!noborder,\n })}\n .value=${value}\n .label=${label}\n .disabled=${disabled}\n .required=${required}\n .errorMessage=${errorMessage}\n .placeholder=${placeholder}\n .error=${error}\n @nile-input=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n ></nile-input>`;\n }\n\n renderDropdown(Input: switchInputType) {\n const {\n options,\n multiple,\n placeholder,\n disabled,\n value,\n error,\n errorMessage,\n inputType,\n } = Input;\n\n return html`<nile-select\n class=\"switcher-dropdown\"\n .placeholder=${placeholder}\n .disabled=\"${disabled}\"\n .multiple=\"${multiple}\"\n .value=\"${value}\"\n .error=\"${error}\"\n .errorMessage=\"${errorMessage}\"\n @nile-change=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n >\n ${options?.map((option: any) => {\n return html`<nile-option .value=\"${option}\">${option} </nile-option>`;\n })}\n </nile-select>`;\n }\n\n renderNileTextArea(Input: switchInputType) {\n const { value, disabled, readonly, errorMessage, error, inputType } = Input;\n\n return html`<nile-textarea\n class=\"switcher-textarea\"\n .value=${value}\n .disabled=${disabled}\n ?readonly=${readonly}\n .error=${error}\n .errorMessage=${errorMessage}\n @nile-input=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n ></nile-textarea>`;\n }\n\n renderNileCheckBox(Input: switchInputType) {\n const { value, label, disabled, inputType } = Input;\n\n return html`<nile-checkbox\n class=\"switcher-checkbox\"\n .checked=${value}\n .label=${label}\n .disabled=${disabled}\n @valueChange=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n ></nile-checkbox\n >; `;\n }\n\n renderNileRadio(Input: switchInputType) {\n const { options, value, disabled, errorMessage, inputType } = Input;\n\n const haserrorMessage = !!errorMessage;\n\n return html`<nile-radio-group\n class=\"switcher-radio-group\"\n .value=${value}\n .disabled=${disabled}\n @change=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n >\n ${options &&\n options.map((option: any) => {\n return html`<nile-radio .value=\"${option}\">${option} </nile-radio>`;\n })}\n ${haserrorMessage ? this.renderErrorMessage(errorMessage) : ''}\n </nile-radio-group> `;\n }\n\n renderErrorMessage(errorMessage: string) {\n return html`\n <nile-form-error-message>${errorMessage}</nile-form-error-message>\n `;\n }\n\n renderContentEditor(Input: switchInputType) {\n let { options, inputType, errorMessage, type, readonly, noborder, value } =\n Input;\n return html`<nile-content-editor\n class=\"switcher-content-editor\"\n .value=${value}\n .options=${options}\n .type=${type}\n .readonly=${readonly}\n .noborder=${noborder}\n .errorMessage=${errorMessage}\n @nile-change=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n >\n </nile-content-editor>`;\n }\n\n renderObjectMapper() {\n const noborder = this.currentInput.noborder;\n const mode = this.currentInput.mode;\n const value =\n this.currentInput.mode === MODE.CREATE\n ? 'Click to Create - Not Mapped'\n : '';\n\n return html`<nile-input\n class=${classMap({\n 'switcher-object-mapper': true,\n 'switcher-object-mapper--noborder': !!noborder,\n })}\n .value=${value}\n readonly=\"true\"\n @click=\"${(e: CustomEvent) =>\n this.handleChange(e, INPUT_TYPE_NAMES.OBJECT_MAPPER)}\"\n >\n <nile-icon\n class=\"pointer-cursor switcher-object-mapper-icon\"\n slot=\"suffix\"\n name=\"collapse\"\n color=\"#005EA6\"\n size=\"16\"\n >\n </nile-icon>\n </nile-input>`;\n }\n\n renderCodeEditor(Input: switchInputType) {\n const {\n value,\n multiLine,\n customAutoCompletions,\n disabled,\n readonly,\n errorMessage,\n error,\n inputType,\n noborder,\n } = Input;\n return html`<nile-code-editor\n class=${classMap({\n 'code-editor': true,\n 'code-editor__no-border': !!noborder,\n })}\n @nile-expand=\"${(e: CustomEvent) =>\n this.handleExpand(e, INPUT_TYPE_NAMES.CODE_EDITOR)}\"\n @nile-change=\"${(e: CustomEvent) =>\n this.handleChange(e, INPUT_TYPE_NAMES.CODE_EDITOR)}\"\n .multiline=\"${multiLine}\"\n .value=\"${value}\"\n .customOptions=\"${customAutoCompletions}\"\n .showLineNumbers=\"false\"\n ></nile-code-editor> `;\n }\n\n handleExpand(event: CustomEvent, inputType: string) {\n this.currentInput.expand = event.detail.expand;\n this.emit('nile-change', { input: this.currentInput });\n }\n\n handleChange(event: CustomEvent, inputType: string) {\n switch (inputType) {\n case INPUT_TYPE_NAMES.OBJECT_MAPPER:\n this.currentInput.value = 'clicked';\n break;\n case INPUT_TYPE_NAMES.CHECKBOX:\n this.currentInput.value = event.detail.checked;\n break;\n case INPUT_TYPE_NAMES.CODE_EDITOR:\n this.currentInput.value = event.detail.value;\n break;\n default:\n this.currentInput.value = event.detail.value;\n }\n event.stopPropagation();\n this.emit('nile-change', { input: this.currentInput });\n }\n\n renderIcon() {\n const inputs = this.nileSwitchConfig.inputs;\n const toolTipPosition =\n this.nileSwitchConfig.align === POSITIONS.BLOCK ? 'top' : 'bottom';\n\n return html`\n <div class=\"switcher-icons-container\">\n ${repeat(\n inputs,\n (input: any, index: number) => html` <nile-tooltip\n class=${classMap({\n 'switcher-tooltip-container': true,\n })}\n content=${input.helperText}\n placement=${toolTipPosition}\n >\n <div class=${classMap({\n 'switcher-icon-container': true,\n current: index === this.current,\n })}>\n <nile-icon\n size=\"16\"\n class=${classMap({\n 'pointer-cursor': true,\n })}\n .name=${input.icon}\n color=\"#000000\"\n @click=${() => this.toggleField(input, index)}\n ></nile-icon>\n <div>\n \n </nile-tooltip>`\n )}\n </div>\n `;\n }\n\n toggleField(currentInput: switchInputType, index: Number) {\n this.current = index;\n this.emit('nile-switch', { input: this.currentInput });\n }\n\n singleFieldSwitcher() {\n if (!this.currentInput) {\n this.setCurrentInput();\n }\n return html`\n ${choose(\n this.currentInput.inputType,\n [\n [INPUT_TYPE_NAMES.TEXT, () => this.renderNileText(this.currentInput)],\n [\n INPUT_TYPE_NAMES.CHECKBOX,\n () => this.renderNileCheckBox(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.TEXTAREA,\n () => this.renderNileTextArea(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.RADIO,\n () => this.renderNileRadio(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.DROPDOWN,\n () => this.renderDropdown(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.CONTENTEDITOR,\n () => this.renderContentEditor(this.currentInput),\n ],\n [INPUT_TYPE_NAMES.OBJECT_MAPPER, () => this.renderObjectMapper()],\n [\n INPUT_TYPE_NAMES.CODE_EDITOR,\n () => this.renderCodeEditor(this.currentInput),\n ],\n ],\n () => this.renderNileText(this.currentInput)\n )}\n `;\n }\n\n public render(): TemplateResult {\n const align = this.nileSwitchConfig.align;\n return html`<div\n class=${classMap({\n 'switcher-block': align === POSITIONS.BLOCK,\n 'switcher-inline': align === POSITIONS.INLINE,\n 'switcher-input-container': true,\n })}\n >\n ${this.renderIcon()} ${this.singleFieldSwitcher()}\n </div>`;\n }\n}\n\nexport default NileSwitcher;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-switcher': NileSwitcher;\n }\n}\n"],"names":["MODE","POSITIONS","INLINE","BLOCK","INPUT_TYPE","DEFAULT","SWITCH","INPUT_TYPE_NAMES","DROPDOWN","TEXT","CHECKBOX","TEXTAREA","RADIO","CONTENTEDITOR","OBJECT_MAPPER","CODE_EDITOR","CREATE","EDIT","_export","NileSwitcher","$","this","current","_this","_createClass","key","value","connectedCallback","super","emit","handleSwitcherChange","setCurrentInput","nileSwitchConfig","inputs","currentInput","filter","input","index","disconnectedCallback","renderNileText","Input","label","placeholder","disabled","required","error","errorMessage","inputType","noborder","html","_templateObject","_taggedTemplateLiteral","classMap","e","handleChange","renderDropdown","_this4","options","multiple","_templateObject2","map","option","_templateObject3","renderNileTextArea","readonly","_templateObject4","renderNileCheckBox","_this6","_templateObject5","renderNileRadio","haserrorMessage","_templateObject6","_templateObject7","renderErrorMessage","_templateObject8","renderContentEditor","_this8","type","_templateObject9","renderObjectMapper","mode","_templateObject10","renderCodeEditor","multiLine","customAutoCompletions","_templateObject11","handleExpand","event","expand","detail","checked","stopPropagation","renderIcon","toolTipPosition","align","_templateObject12","repeat","_templateObject13","helperText","icon","toggleField","singleFieldSwitcher","_templateObject14","choose","render","_templateObject15","NileElement","styles","__decorate","property","Object","prototype","Number","watch","waitUntilFirstUpdate","customElement"],"mappings":"s6JA0FYA,CArBZ,SAAYC,CACVA,CAAAA,CAAAA,CAAAA,CAAAC,OAAA,QACAD,CAAAA,CAAAA,CAAAE,KAAA,CAAA,OACD,EAHD,CAAYF,CAAAA,GAAAA,EAGX,CAAA,CAAA,CAAA,CAAA,CAED,SAAYG,CACVA,CAAAA,CAAAA,CAAAA,CAAAC,OAAA,CAAA,cAAA,CACAD,EAAAE,MAAA,CAAA,aACD,EAHD,CAAYF,CAAAA,GAAAA,EAGX,CAAA,CAAA,CAAA,CAAA,CAED,SAAYG,CAAAA,CAAAA,CACVA,EAAAC,QAAA,CAAA,UAAA,CACAD,EAAAE,IAAA,CAAA,MAAA,CACAF,EAAAG,QAAA,CAAA,UAAA,CACAH,CAAA,CAAAI,QAAA,CAAA,YACAJ,CAAA,CAAAK,KAAA,CAAA,QACAL,CAAA,CAAAM,aAAA,CAAA,iBACAN,CAAA,CAAAO,aAAA,CAAA,gBACAP,CAAA,CAAAQ,WAAA,CAAA,aACD,EATD,CAAYR,IAAAA,CASX,CAAA,CAAA,IAED,SAAYP,CAAAA,CAAAA,CACVA,CAAA,CAAAgB,MAAA,CAAA,SACAhB,CAAA,CAAAiB,IAAA,CAAA,MACD,EAHD,CAAYjB,IAAAA,CAGX,CAAA,CAAA,CAGM,CAAA,CAAA,CAAAkB,OAAA,KAAMC,uEAAN,SAAAC,EAAA,uEAQuBC,KAAAA,CAAOC,OAAAA,CAAW,CAkV/C,QAAAC,KAAA,EA9UCC,YAAA,CAAAJ,CAAA,GAAAK,GAAA,qBAAAC,KAAA,UAAAC,kBAAA,CACEC,CAAAA,IAAAA,CAAAA,eAAAA,CAAAA,CAAAA,CAAAA,SAAAA,4BAAAA,IAAAA,OACAP,IAAKQ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,CACf,iBAAkB0C,CAAU7F,GAAAA,CAAAA,CAAUE,MACtC,iBAAmB2F,CAAAA,CAAAA,GAAU7F,CAAUC,CAAAA,MAAAA,CACvC,0BAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAG5BmB,IAAAA,CAAKuE,aAAgBvE,IAAKgF,CAAAA,mBAAAA,CAAAA,CAAAA,EAE/B,CApVMlF,WAAAA,CAAAA,GALyBuF,CAAAA,GAKzBvF,CAAAA,CAAMwF,OAAmBA,CAEJC,CAAAA,CAAAA,CAAA,CAA3BC,CAAS,CAAA,CAAEhC,IAAMiC,CAAAA,MAAAA,CAAAA,CAAAA,CAAAA,CAAyC3F,CAAA4F,CAAAA,SAAAA,CAAA,uBAAA,EAC/BH,CAAAA,CAAAA,CAAAA,CAAA,CAA3BC,CAAAA,CAAS,CAAEhC,IAAAA,CAAMmC,UAA8B7F,CAAA4F,CAAAA,SAAAA,CAAA,SAAA,CAAA,IAAA,EAAA,CAAA,CAEpBH,CAAA,CAAA,CAA3BC,EAAS,CAAEhC,IAAAA,CAAMiC,UAAwC3F,CAAA4F,CAAAA,SAAAA,CAAA,mBAAA,EAQ1DH,CAAAA,CAAAA,CAAAA,CAAA,CADCK,CAAAA,CAAM,CAAC,SAAA,CAAA,CAAY,CAAEC,oBAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAG3C/F,CAAA4F,CAAAA,SAAAA,CAAA,sBAAA,CAAA,IAAA,CAAA,CAAA7F,OAAA,KApBUC,EAAYyF,CAAA,CAAA,CADxBO,CAAc,CAAA,eAAA,CAAA,CAAA,CACFhG"}
|
1
|
+
{"version":3,"file":"nile-switcher.cjs.js","sources":["../../../src/nile-switcher/nile-switcher.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, TemplateResult } from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-switcher.css';\nimport NileElement from '../internal/nile-element';\nimport { CSSResultGroup } from 'lit';\nimport { choose } from 'lit/directives/choose.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { watch } from '../internal/watch';\nimport { HasSlotController } from '../internal/slot';\n\n/**\n * @summary Allows you to switch between nile elements\n *\n * @dependency nile-icon\n * @dependency nile-input\n * @dependency nile-checkbox\n * @dependency nile-dropdown\n * @dependency nile-textarea\n *\n * @event nile-change - Emitted when the control's value changes.\n * @event nile-switch - Emitted when the nile component is being switched.\n */\n\nexport interface switchconfig {\n [key: string]: any;\n toggleSwitch: boolean;\n disable?: boolean;\n confirmation?: boolean;\n align: 'block' | 'inline';\n inputs: switchInputType[];\n}\n\nexport interface switchInputType {\n inputType:\n | INPUT_TYPE_NAMES.DROPDOWN\n | INPUT_TYPE_NAMES.TEXT\n | INPUT_TYPE_NAMES.CHECKBOX\n | INPUT_TYPE_NAMES.TEXTAREA\n | INPUT_TYPE_NAMES.RADIO\n | INPUT_TYPE_NAMES.CONTENTEDITOR\n | INPUT_TYPE_NAMES.OBJECT_MAPPER\n | INPUT_TYPE_NAMES.CODE_EDITOR;\n value?: String | boolean;\n label?: String;\n readonly?: boolean;\n type?: string;\n icon: string;\n mode?: string;\n placeholder?: string;\n disabled?: boolean;\n required?: boolean;\n error?: boolean;\n errorMessage?: string;\n options?: Array<any>;\n customAutoCompletions?: any;\n helperText?: string;\n multiple?: boolean;\n noborder?: boolean;\n multiLine?: boolean;\n expand?: boolean;\n}\n\nexport enum POSITIONS {\n INLINE = 'inline',\n BLOCK = 'block',\n}\n\nexport enum INPUT_TYPE {\n DEFAULT = 'defaultInput',\n SWITCH = 'switchInput',\n}\n\nexport enum INPUT_TYPE_NAMES {\n DROPDOWN = 'dropdown',\n TEXT = 'text',\n CHECKBOX = 'checkbox',\n TEXTAREA = 'text-area',\n RADIO = 'radio',\n CONTENTEDITOR = 'content-editor',\n OBJECT_MAPPER = 'object-mapper',\n CODE_EDITOR = 'code-editor',\n}\n\nexport enum MODE {\n CREATE = 'create',\n EDIT = 'edit',\n}\n\n@customElement('nile-switcher')\nexport class NileSwitcher extends NileElement {\n /**\n * The styles for nile switcher\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n static styles: CSSResultGroup = styles;\n\n private readonly hasSlotController = new HasSlotController(this, 'label');\n\n @property({ type: Object }) nileSwitchConfig: switchconfig;\n @property({ type: Number }) current: Number = 1;\n\n @property({ type: Object }) currentInput: switchInputType;\n\n connectedCallback() {\n super.connectedCallback();\n this.emit('nile-init');\n }\n\n @watch(['current'], { waitUntilFirstUpdate: true })\n handleSwitcherChange() {\n this.setCurrentInput();\n }\n\n setCurrentInput() {\n if (this.nileSwitchConfig?.inputs) {\n this.currentInput = this.nileSwitchConfig.inputs.filter(\n (input: switchInputType, index: Number) => {\n return index === this.current;\n }\n )[0];\n }\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n renderNileText(Input: switchInputType) {\n const {\n value,\n label,\n placeholder,\n disabled,\n required,\n error,\n errorMessage,\n inputType,\n noborder,\n } = Input;\n return html`<nile-input\n class=${classMap({\n 'switcher-input': true,\n 'switcher-input--noborder': !!noborder,\n })}\n .value=${value}\n .label=${label}\n .disabled=${disabled}\n .required=${required}\n .errorMessage=${errorMessage}\n .placeholder=${placeholder}\n .error=${error}\n @nile-input=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n ></nile-input>`;\n }\n\n renderDropdown(Input: switchInputType) {\n const {\n options,\n multiple,\n placeholder,\n disabled,\n value,\n error,\n errorMessage,\n inputType,\n } = Input;\n\n return html`<nile-select\n part=\"dropdown\"\n class=\"switcher-dropdown\"\n .placeholder=${placeholder}\n .disabled=\"${disabled}\"\n .multiple=\"${multiple}\"\n .value=\"${value}\"\n .error=\"${error}\"\n .errorMessage=\"${errorMessage}\"\n @nile-change=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n >\n ${options?.map((option: any) => {\n return html`<nile-option .value=\"${option}\">${option} </nile-option>`;\n })}\n </nile-select>`;\n }\n\n renderNileTextArea(Input: switchInputType) {\n const { value, disabled, readonly, errorMessage, error, inputType } = Input;\n\n return html`<nile-textarea\n class=\"switcher-textarea\"\n .value=${value}\n .disabled=${disabled}\n ?readonly=${readonly}\n .error=${error}\n .errorMessage=${errorMessage}\n @nile-input=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n ></nile-textarea>`;\n }\n\n renderNileCheckBox(Input: switchInputType) {\n const { value, label, disabled, inputType } = Input;\n\n return html`<nile-checkbox\n class=\"switcher-checkbox\"\n .checked=${value}\n .label=${label}\n .disabled=${disabled}\n @valueChange=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n ></nile-checkbox\n >; `;\n }\n\n renderNileRadio(Input: switchInputType) {\n const { options, value, disabled, errorMessage, inputType } = Input;\n\n const haserrorMessage = !!errorMessage;\n\n return html`<nile-radio-group\n class=\"switcher-radio-group\"\n .value=${value}\n .disabled=${disabled}\n @change=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n >\n ${options &&\n options.map((option: any) => {\n return html`<nile-radio .value=\"${option}\">${option} </nile-radio>`;\n })}\n ${haserrorMessage ? this.renderErrorMessage(errorMessage) : ''}\n </nile-radio-group> `;\n }\n\n renderErrorMessage(errorMessage: string) {\n return html`\n <nile-form-error-message>${errorMessage}</nile-form-error-message>\n `;\n }\n\n renderContentEditor(Input: switchInputType) {\n let { options, inputType, errorMessage, type, readonly, noborder, value } =\n Input;\n return html`<nile-content-editor\n class=\"switcher-content-editor\"\n .value=${value}\n .options=${options}\n .type=${type}\n .readonly=${readonly}\n .noborder=${noborder}\n .errorMessage=${errorMessage}\n @nile-change=${(e: CustomEvent) => {\n this.handleChange(e, inputType);\n }}\n >\n </nile-content-editor>`;\n }\n\n renderObjectMapper() {\n const noborder = this.currentInput.noborder;\n const mode = this.currentInput.mode;\n const value =\n this.currentInput.mode === MODE.CREATE\n ? 'Click to Create - Not Mapped'\n : 'Click to Edit';\n\n return html`<nile-input\n class=${classMap({\n 'switcher-object-mapper': true,\n 'switcher-object-mapper--noborder': !!noborder,\n })}\n .value=${value}\n readonly=\"true\"\n @click=\"${(e: CustomEvent) =>\n this.handleChange(e, INPUT_TYPE_NAMES.OBJECT_MAPPER)}\"\n >\n <nile-icon\n class=\"pointer-cursor switcher-object-mapper-icon\"\n slot=\"suffix\"\n name=\"collapse\"\n color=\"#005EA6\"\n size=\"16\"\n >\n </nile-icon>\n </nile-input>`;\n }\n\n renderCodeEditor(Input: switchInputType) {\n const {\n value,\n multiLine,\n customAutoCompletions,\n disabled,\n readonly,\n errorMessage,\n error,\n inputType,\n noborder,\n } = Input;\n return html`<nile-code-editor\n part=\"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 .customOptions=\"${customAutoCompletions}\"\n ></nile-code-editor> `;\n }\n\n handleExpand(event: CustomEvent, inputType: string) {\n this.currentInput.expand = event.detail.expand;\n this.emit('nile-change', { input: this.currentInput });\n }\n\n handleChange(event: CustomEvent, inputType: string) {\n switch (inputType) {\n case INPUT_TYPE_NAMES.OBJECT_MAPPER:\n this.currentInput.value = 'clicked';\n break;\n case INPUT_TYPE_NAMES.CHECKBOX:\n this.currentInput.value = event.detail.checked;\n break;\n case INPUT_TYPE_NAMES.CODE_EDITOR:\n this.currentInput.value = event.detail.value;\n break;\n default:\n this.currentInput.value = event.detail.value;\n }\n event.stopPropagation();\n this.emit('nile-change', { input: this.currentInput });\n }\n\n renderIcon() {\n const inputs = this.nileSwitchConfig.inputs;\n const toolTipPosition =\n this.nileSwitchConfig.align === POSITIONS.BLOCK ? 'top' : 'bottom';\n\n return html`\n <div part=\"icons-container\" class=\"switcher-icons-container\">\n ${repeat(\n inputs,\n (input: any, index: number) => html` <nile-tooltip\n class=${classMap({\n 'switcher-tooltip-container': true,\n })}\n content=${input.helperText}\n placement=${toolTipPosition}\n >\n <div class=${classMap({\n 'switcher-icon-container': true,\n current: index === this.current,\n })}>\n <nile-icon\n size=\"16\"\n class=${classMap({\n 'pointer-cursor': true,\n })}\n .name=${input.icon}\n color=\"#000000\"\n @click=${() => this.toggleField(input, index)}\n ></nile-icon>\n <div>\n \n </nile-tooltip>`\n )}\n </div>\n `;\n }\n\n isToggleSwitch = (item: any) => {\n return typeof item === 'undefined' || item;\n };\n\n toggleField(currentInput: switchInputType, index: Number) {\n if (this.isToggleSwitch(this.nileSwitchConfig.confirmation)) {\n this.current = index;\n }\n this.updateComplete.then(res => {\n if (res) {\n this.emit('nile-switch', { input: this.currentInput });\n }\n });\n }\n\n singleFieldSwitcher() {\n if (!this.currentInput) {\n this.setCurrentInput();\n }\n return html`\n ${choose(\n this.currentInput.inputType,\n [\n [INPUT_TYPE_NAMES.TEXT, () => this.renderNileText(this.currentInput)],\n [\n INPUT_TYPE_NAMES.CHECKBOX,\n () => this.renderNileCheckBox(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.TEXTAREA,\n () => this.renderNileTextArea(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.RADIO,\n () => this.renderNileRadio(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.DROPDOWN,\n () => this.renderDropdown(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.CONTENTEDITOR,\n () => this.renderContentEditor(this.currentInput),\n ],\n [INPUT_TYPE_NAMES.OBJECT_MAPPER, () => this.renderObjectMapper()],\n [\n INPUT_TYPE_NAMES.CODE_EDITOR,\n () => this.renderCodeEditor(this.currentInput),\n ],\n ],\n () => this.renderNileText(this.currentInput)\n )}\n `;\n }\n\n public render(): TemplateResult {\n const hasLabelSlot = this.hasSlotController.test('label');\n const align = this.nileSwitchConfig.align;\n return html`<div\n part=\"base\"\n class=${classMap({\n 'switcher-block': align === POSITIONS.BLOCK,\n 'switcher-inline': align === POSITIONS.INLINE,\n 'switcher-container': true,\n })}\n >\n <div class=\"label-container\">\n ${hasLabelSlot\n ? html`\n <label\n part=\"switcher-label\"\n class=\"switcher__label\"\n for=\"input\"\n >\n <slot name=\"label\"></slot>\n </label>\n </div> `\n : ''}\n ${this.renderIcon()}\n </div>\n ${this.singleFieldSwitcher()}\n </div>`;\n }\n}\n\nexport default NileSwitcher;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-switcher': NileSwitcher;\n }\n}\n"],"names":["POSITIONS","INLINE","BLOCK","INPUT_TYPE","DEFAULT","SWITCH","INPUT_TYPE_NAMES","DROPDOWN","TEXT","CHECKBOX","TEXTAREA","RADIO","CONTENTEDITOR","OBJECT_MAPPER","CODE_EDITOR","MODE","CREATE","EDIT","_export","NileSwitcher","b","this","hasSlotController","HasSlotController","current","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","mode","_templateObject10","renderCodeEditor","multiLine","customAutoCompletions","_templateObject11","handleExpand","event","expand","detail","checked","stopPropagation","renderIcon","toolTipPosition","align","_templateObject12","repeat","_templateObject13","helperText","icon","toggleField","confirmation","updateComplete","then","res","singleFieldSwitcher","_templateObject14","choose","render","hasLabelSlot","test","_templateObject15","_templateObject16","NileElement","styles","__decor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AA,CAAA,CAAA,CAAA,CAAA,CAG3C3G,CAAAwG,CAAAA,SAAAA,CAAA,sBAAA,CAAA,IAAA,CAAA,CAAAzG,OAAA,KAtBUC,EAAYqG,CAAA,CAAA,CADxBO,CAAc,CAAA,eAAA,CAAA,CAAA,CACF5G"}
|
@@ -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 e,_templateObject,r;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}return{setters:[function(_index001CjsJs){e=_index001CjsJs.i;}],execute:function(){_export("s",r=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n width: 100%;\n box-sizing: border-box;\n }\n\n .pointer-cursor {\n cursor: pointer;\n }\n\n .switcher__label {\n display: flex;\n align-items: center;\n color: inherit;\n color: var(--nile-colors-dark-900);\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n switcher-object-mapper:hover {\n display: flex;\n }\n .switcher-icon-container.current {\n background: var(--nile-colors-blue-400);\n }\n\n .switcher-container {\n display: flex;\n }\n\n .switcher-inline {\n gap: 0.5rem;\n }\n\n .switcher-block {\n flex-direction: column;\n }\n\n .switcher-inline > :nth-child(2) {\n flex: 1;\n }\n\n .switcher-icons-container {\n display: flex;\n margin-left: auto;\n gap: 0.5rem;\n max-height: 38px;\n align-items: center;\n }\n\n .switcher-block > .switcher-icons-container {\n margin-left: auto;\n }\n\n .label-container {\n display: flex;\n }\n\n .switcher-icon-container {\n cursor: pointer;\n justify-content: center;\n display: flex;\n align-items: center;\n margin-bottom: 6px;\n height: 28px;\n width: 28px;\n border-radius: 4px;\n }\n nile-radio {\n display: inline-block;\n padding-right: 10px;\n }\n\n nile-code-editor {\n overflow: hidden;\n }\n\n .switcher-object-mapper-icon {\n display: none;\n }\n .switcher-object-mapper:hover > .switcher-object-mapper-icon {\n display: block;\n }\n .switcher-object-mapper::part(input) {\n color: var(--nile-colors-primary-600);\n cursor: pointer;\n }\n\n .switcher-input--noborder::part(base) {\n border: none;\n }\n .switcher-object-mapper--noborder::part(base) {\n border: none;\n }\n"]))));}};});
|
2
2
|
//# sourceMappingURL=nile-switcher.css.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-switcher.css.cjs.js","sources":["../../../src/nile-switcher/nile-switcher.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * FieldGenerator CSS\n */\nexport const styles = css`\n :host {\n width: 100%;\n box-sizing: border-box;\n }\n\n .
|
1
|
+
{"version":3,"file":"nile-switcher.css.cjs.js","sources":["../../../src/nile-switcher/nile-switcher.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * FieldGenerator CSS\n */\nexport const styles = css`\n :host {\n width: 100%;\n box-sizing: border-box;\n }\n\n .pointer-cursor {\n cursor: pointer;\n }\n\n .switcher__label {\n display: flex;\n align-items: center;\n color: inherit;\n color: var(--nile-colors-dark-900);\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n switcher-object-mapper:hover {\n display: flex;\n }\n .switcher-icon-container.current {\n background: var(--nile-colors-blue-400);\n }\n\n .switcher-container {\n display: flex;\n }\n\n .switcher-inline {\n gap: 0.5rem;\n }\n\n .switcher-block {\n flex-direction: column;\n }\n\n .switcher-inline > :nth-child(2) {\n flex: 1;\n }\n\n .switcher-icons-container {\n display: flex;\n margin-left: auto;\n gap: 0.5rem;\n max-height: 38px;\n align-items: center;\n }\n\n .switcher-block > .switcher-icons-container {\n margin-left: auto;\n }\n\n .label-container {\n display: flex;\n }\n\n .switcher-icon-container {\n cursor: pointer;\n justify-content: center;\n display: flex;\n align-items: center;\n margin-bottom: 6px;\n height: 28px;\n width: 28px;\n border-radius: 4px;\n }\n nile-radio {\n display: inline-block;\n padding-right: 10px;\n }\n\n nile-code-editor {\n overflow: hidden;\n }\n\n .switcher-object-mapper-icon {\n display: none;\n }\n .switcher-object-mapper:hover > .switcher-object-mapper-icon {\n display: block;\n }\n .switcher-object-mapper::part(input) {\n color: var(--nile-colors-primary-600);\n cursor: pointer;\n }\n\n .switcher-input--noborder::part(base) {\n border: none;\n }\n .switcher-object-mapper--noborder::part(base) {\n border: none;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"gXAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
@@ -1,25 +1,34 @@
|
|
1
|
-
import{i as
|
1
|
+
import{i as e}from"../index-cd2f9c12.esm.js";const r=e`
|
2
2
|
:host {
|
3
3
|
width: 100%;
|
4
4
|
box-sizing: border-box;
|
5
5
|
}
|
6
6
|
|
7
|
-
.
|
7
|
+
.pointer-cursor {
|
8
8
|
cursor: pointer;
|
9
|
-
|
9
|
+
}
|
10
|
+
|
11
|
+
.switcher__label {
|
10
12
|
display: flex;
|
11
13
|
align-items: center;
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
14
|
+
color: inherit;
|
15
|
+
color: var(--nile-colors-dark-900);
|
16
|
+
font-family: Colfax-regular;
|
17
|
+
font-size: 14px;
|
18
|
+
font-style: normal;
|
19
|
+
font-weight: 400;
|
20
|
+
line-height: 14px;
|
21
|
+
letter-spacing: 0.2px;
|
16
22
|
}
|
17
23
|
|
24
|
+
switcher-object-mapper:hover {
|
25
|
+
display: flex;
|
26
|
+
}
|
18
27
|
.switcher-icon-container.current {
|
19
28
|
background: var(--nile-colors-blue-400);
|
20
29
|
}
|
21
30
|
|
22
|
-
.switcher-
|
31
|
+
.switcher-container {
|
23
32
|
display: flex;
|
24
33
|
}
|
25
34
|
|
@@ -31,21 +40,36 @@ import{i as r}from"../index-cd2f9c12.esm.js";const e=r`
|
|
31
40
|
flex-direction: column;
|
32
41
|
}
|
33
42
|
|
34
|
-
.switcher-block > :first-child {
|
35
|
-
align-self: end;
|
36
|
-
}
|
37
|
-
|
38
43
|
.switcher-inline > :nth-child(2) {
|
39
44
|
flex: 1;
|
40
45
|
}
|
41
46
|
|
42
|
-
.switcher-
|
47
|
+
.switcher-icons-container {
|
43
48
|
display: flex;
|
49
|
+
margin-left: auto;
|
44
50
|
gap: 0.5rem;
|
45
51
|
max-height: 38px;
|
46
52
|
align-items: center;
|
47
53
|
}
|
48
54
|
|
55
|
+
.switcher-block > .switcher-icons-container {
|
56
|
+
margin-left: auto;
|
57
|
+
}
|
58
|
+
|
59
|
+
.label-container {
|
60
|
+
display: flex;
|
61
|
+
}
|
62
|
+
|
63
|
+
.switcher-icon-container {
|
64
|
+
cursor: pointer;
|
65
|
+
justify-content: center;
|
66
|
+
display: flex;
|
67
|
+
align-items: center;
|
68
|
+
margin-bottom: 6px;
|
69
|
+
height: 28px;
|
70
|
+
width: 28px;
|
71
|
+
border-radius: 4px;
|
72
|
+
}
|
49
73
|
nile-radio {
|
50
74
|
display: inline-block;
|
51
75
|
padding-right: 10px;
|
@@ -53,15 +77,14 @@ import{i as r}from"../index-cd2f9c12.esm.js";const e=r`
|
|
53
77
|
|
54
78
|
nile-code-editor {
|
55
79
|
overflow: hidden;
|
56
|
-
padding-top: 2px;
|
57
|
-
border-radius: 5px;
|
58
|
-
border: 1px solid rgb(204, 204, 204);
|
59
80
|
}
|
60
81
|
|
61
|
-
.
|
62
|
-
|
82
|
+
.switcher-object-mapper-icon {
|
83
|
+
display: none;
|
84
|
+
}
|
85
|
+
.switcher-object-mapper:hover > .switcher-object-mapper-icon {
|
86
|
+
display: block;
|
63
87
|
}
|
64
|
-
|
65
88
|
.switcher-object-mapper::part(input) {
|
66
89
|
color: var(--nile-colors-primary-600);
|
67
90
|
cursor: pointer;
|
@@ -73,4 +96,4 @@ import{i as r}from"../index-cd2f9c12.esm.js";const e=r`
|
|
73
96
|
.switcher-object-mapper--noborder::part(base) {
|
74
97
|
border: none;
|
75
98
|
}
|
76
|
-
`;export{
|
99
|
+
`;export{r as s};
|
@@ -1,64 +1,65 @@
|
|
1
|
-
import{__decorate as e}from"tslib";import{x as
|
1
|
+
import{__decorate as e}from"tslib";import{x as t}from"../index-cd2f9c12.esm.js";import{customElement as i}from"lit/decorators.js";import{s as r}from"./nile-switcher.css.esm.js";import{N as s}from"../internal/nile-element.esm.js";import{choose as n}from"lit/directives/choose.js";import{classMap as o}from"lit/directives/class-map.js";import{repeat as l}from"lit/directives/repeat.js";import{w as a}from"../internal/watch.esm.js";import{H as c}from"../internal/slot.esm.js";import{n as d}from"../property-09139d3c.esm.js";import"lit";var h,p,u,$;!function(e){e.INLINE="inline",e.BLOCK="block"}(h||(h={})),function(e){e.DEFAULT="defaultInput",e.SWITCH="switchInput"}(p||(p={})),function(e){e.DROPDOWN="dropdown",e.TEXT="text",e.CHECKBOX="checkbox",e.TEXTAREA="text-area",e.RADIO="radio",e.CONTENTEDITOR="content-editor",e.OBJECT_MAPPER="object-mapper",e.CODE_EDITOR="code-editor"}(u||(u={})),function(e){e.CREATE="create",e.EDIT="edit"}($||($={}));let m=class extends s{constructor(){super(...arguments),this.hasSlotController=new c(this,"label"),this.current=1,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,t)=>t===this.current))[0])}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}renderNileText(e){const{value:i,label:r,placeholder:s,disabled:n,required:l,error:a,errorMessage:c,inputType:d,noborder:h}=e;return t`<nile-input
|
2
2
|
class=${o({"switcher-input":!0,"switcher-input--noborder":!!h})}
|
3
|
-
.value=${
|
3
|
+
.value=${i}
|
4
4
|
.label=${r}
|
5
5
|
.disabled=${n}
|
6
6
|
.required=${l}
|
7
|
-
.errorMessage=${
|
7
|
+
.errorMessage=${c}
|
8
8
|
.placeholder=${s}
|
9
|
-
.error=${
|
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:i,multiple:r,placeholder:s,disabled:n,value:o,error:l,errorMessage:a,inputType:c}=e;return t`<nile-select
|
12
|
+
part="dropdown"
|
12
13
|
class="switcher-dropdown"
|
13
14
|
.placeholder=${s}
|
14
15
|
.disabled="${n}"
|
15
16
|
.multiple="${r}"
|
16
17
|
.value="${o}"
|
17
18
|
.error="${l}"
|
18
|
-
.errorMessage="${
|
19
|
-
@nile-change=${e=>{this.handleChange(e,
|
19
|
+
.errorMessage="${a}"
|
20
|
+
@nile-change=${e=>{this.handleChange(e,c)}}
|
20
21
|
>
|
21
|
-
${
|
22
|
-
</nile-select>`}renderNileTextArea(e){const{value:
|
22
|
+
${i?.map((e=>t`<nile-option .value="${e}">${e} </nile-option>`))}
|
23
|
+
</nile-select>`}renderNileTextArea(e){const{value:i,disabled:r,readonly:s,errorMessage:n,error:o,inputType:l}=e;return t`<nile-textarea
|
23
24
|
class="switcher-textarea"
|
24
|
-
.value=${
|
25
|
+
.value=${i}
|
25
26
|
.disabled=${r}
|
26
27
|
?readonly=${s}
|
27
28
|
.error=${o}
|
28
29
|
.errorMessage=${n}
|
29
30
|
@nile-input=${e=>{this.handleChange(e,l)}}
|
30
|
-
></nile-textarea>`}renderNileCheckBox(e){const{value:
|
31
|
+
></nile-textarea>`}renderNileCheckBox(e){const{value:i,label:r,disabled:s,inputType:n}=e;return t`<nile-checkbox
|
31
32
|
class="switcher-checkbox"
|
32
|
-
.checked=${
|
33
|
+
.checked=${i}
|
33
34
|
.label=${r}
|
34
35
|
.disabled=${s}
|
35
36
|
@valueChange=${e=>{this.handleChange(e,n)}}
|
36
37
|
></nile-checkbox
|
37
|
-
>; `}renderNileRadio(e){const{options:
|
38
|
+
>; `}renderNileRadio(e){const{options:i,value:r,disabled:s,errorMessage:n,inputType:o}=e,l=!!n;return t`<nile-radio-group
|
38
39
|
class="switcher-radio-group"
|
39
40
|
.value=${r}
|
40
41
|
.disabled=${s}
|
41
42
|
@change=${e=>{this.handleChange(e,o)}}
|
42
43
|
>
|
43
|
-
${
|
44
|
+
${i&&i.map((e=>t`<nile-radio .value="${e}">${e} </nile-radio>`))}
|
44
45
|
${l?this.renderErrorMessage(n):""}
|
45
|
-
</nile-radio-group> `}renderErrorMessage(e){return
|
46
|
+
</nile-radio-group> `}renderErrorMessage(e){return t`
|
46
47
|
<nile-form-error-message>${e}</nile-form-error-message>
|
47
|
-
`}renderContentEditor(e){let{options:
|
48
|
+
`}renderContentEditor(e){let{options:i,inputType:r,errorMessage:s,type:n,readonly:o,noborder:l,value:a}=e;return t`<nile-content-editor
|
48
49
|
class="switcher-content-editor"
|
49
|
-
.value=${
|
50
|
-
.options=${
|
50
|
+
.value=${a}
|
51
|
+
.options=${i}
|
51
52
|
.type=${n}
|
52
53
|
.readonly=${o}
|
53
54
|
.noborder=${l}
|
54
55
|
.errorMessage=${s}
|
55
56
|
@nile-change=${e=>{this.handleChange(e,r)}}
|
56
57
|
>
|
57
|
-
</nile-content-editor>`}renderObjectMapper(){const e=this.currentInput.noborder;this.currentInput.mode;const
|
58
|
+
</nile-content-editor>`}renderObjectMapper(){const e=this.currentInput.noborder;this.currentInput.mode;const i=this.currentInput.mode===$.CREATE?"Click to Create - Not Mapped":"Click to Edit";return t`<nile-input
|
58
59
|
class=${o({"switcher-object-mapper":!0,"switcher-object-mapper--noborder":!!e})}
|
59
|
-
.value=${
|
60
|
+
.value=${i}
|
60
61
|
readonly="true"
|
61
|
-
@click="${e=>this.handleChange(e,
|
62
|
+
@click="${e=>this.handleChange(e,u.OBJECT_MAPPER)}"
|
62
63
|
>
|
63
64
|
<nile-icon
|
64
65
|
class="pointer-cursor switcher-object-mapper-icon"
|
@@ -68,20 +69,20 @@ import{__decorate as e}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";
|
|
68
69
|
size="16"
|
69
70
|
>
|
70
71
|
</nile-icon>
|
71
|
-
</nile-input>`}renderCodeEditor(e){const{value:
|
72
|
-
|
73
|
-
|
74
|
-
@nile-
|
72
|
+
</nile-input>`}renderCodeEditor(e){const{value:i,multiLine:r,customAutoCompletions:s,disabled:n,readonly:l,errorMessage:a,error:c,inputType:d,noborder:h}=e;return t`<nile-code-editor
|
73
|
+
part="switcher-code-editor"
|
74
|
+
class=${o({"code-editor":!0})}
|
75
|
+
@nile-expand="${e=>this.handleExpand(e,u.CODE_EDITOR)}"
|
76
|
+
@nile-change="${e=>this.handleChange(e,u.CODE_EDITOR)}"
|
75
77
|
.multiline="${r}"
|
76
|
-
.value="${
|
78
|
+
.value="${i}"
|
77
79
|
.customOptions="${s}"
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
${l(e,((e,r)=>i` <nile-tooltip
|
80
|
+
></nile-code-editor> `}handleExpand(e,t){this.currentInput.expand=e.detail.expand,this.emit("nile-change",{input:this.currentInput})}handleChange(e,t){switch(t){case u.OBJECT_MAPPER:this.currentInput.value="clicked";break;case u.CHECKBOX:this.currentInput.value=e.detail.checked;break;case u.CODE_EDITOR:default:this.currentInput.value=e.detail.value}e.stopPropagation(),this.emit("nile-change",{input:this.currentInput})}renderIcon(){const e=this.nileSwitchConfig.inputs,i=this.nileSwitchConfig.align===h.BLOCK?"top":"bottom";return t`
|
81
|
+
<div part="icons-container" class="switcher-icons-container">
|
82
|
+
${l(e,((e,r)=>t` <nile-tooltip
|
82
83
|
class=${o({"switcher-tooltip-container":!0})}
|
83
84
|
content=${e.helperText}
|
84
|
-
placement=${
|
85
|
+
placement=${i}
|
85
86
|
>
|
86
87
|
<div class=${o({"switcher-icon-container":!0,current:r===this.current})}>
|
87
88
|
<nile-icon
|
@@ -95,10 +96,23 @@ import{__decorate as e}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";
|
|
95
96
|
|
96
97
|
</nile-tooltip>`))}
|
97
98
|
</div>
|
98
|
-
`}toggleField(e,
|
99
|
-
${n(this.currentInput.inputType,[[
|
100
|
-
`}render(){const e=this.nileSwitchConfig.align;return
|
101
|
-
|
99
|
+
`}toggleField(e,t){this.isToggleSwitch(this.nileSwitchConfig.confirmation)&&(this.current=t),this.updateComplete.then((e=>{e&&this.emit("nile-switch",{input:this.currentInput})}))}singleFieldSwitcher(){return this.currentInput||this.setCurrentInput(),t`
|
100
|
+
${n(this.currentInput.inputType,[[u.TEXT,()=>this.renderNileText(this.currentInput)],[u.CHECKBOX,()=>this.renderNileCheckBox(this.currentInput)],[u.TEXTAREA,()=>this.renderNileTextArea(this.currentInput)],[u.RADIO,()=>this.renderNileRadio(this.currentInput)],[u.DROPDOWN,()=>this.renderDropdown(this.currentInput)],[u.CONTENTEDITOR,()=>this.renderContentEditor(this.currentInput)],[u.OBJECT_MAPPER,()=>this.renderObjectMapper()],[u.CODE_EDITOR,()=>this.renderCodeEditor(this.currentInput)]],(()=>this.renderNileText(this.currentInput)))}
|
101
|
+
`}render(){const e=this.hasSlotController.test("label"),i=this.nileSwitchConfig.align;return t`<div
|
102
|
+
part="base"
|
103
|
+
class=${o({"switcher-block":i===h.BLOCK,"switcher-inline":i===h.INLINE,"switcher-container":!0})}
|
102
104
|
>
|
103
|
-
|
104
|
-
|
105
|
+
<div class="label-container">
|
106
|
+
${e?t`
|
107
|
+
<label
|
108
|
+
part="switcher-label"
|
109
|
+
class="switcher__label"
|
110
|
+
for="input"
|
111
|
+
>
|
112
|
+
<slot name="label"></slot>
|
113
|
+
</label>
|
114
|
+
</div> `:""}
|
115
|
+
${this.renderIcon()}
|
116
|
+
</div>
|
117
|
+
${this.singleFieldSwitcher()}
|
118
|
+
</div>`}};m.styles=r,e([d({type:Object})],m.prototype,"nileSwitchConfig",void 0),e([d({type:Number})],m.prototype,"current",void 0),e([d({type:Object})],m.prototype,"currentInput",void 0),e([a(["current"],{waitUntilFirstUpdate:!0})],m.prototype,"handleSwitcherChange",null),m=e([i("nile-switcher")],m);export{m as N};
|
@@ -17,7 +17,13 @@ export const styles = css `
|
|
17
17
|
display: flex;
|
18
18
|
justify-content: flex-end;
|
19
19
|
flex-direction: row-reverse;
|
20
|
-
|
20
|
+
padding: 5px;
|
21
|
+
border-radius: 5px;
|
22
|
+
border: 1px solid rgb(204, 204, 204);
|
23
|
+
}
|
24
|
+
|
25
|
+
.error {
|
26
|
+
border-color: #e5434d;
|
21
27
|
}
|
22
28
|
|
23
29
|
.cm-editor {
|
@@ -31,11 +37,12 @@ export const styles = css `
|
|
31
37
|
}
|
32
38
|
|
33
39
|
.code-editor__icon__container {
|
34
|
-
|
40
|
+
display: none;
|
35
41
|
}
|
36
|
-
|
37
|
-
|
38
|
-
|
42
|
+
.code-mirror:hover > .code-editor__icon__container {
|
43
|
+
cursor: pointer;
|
44
|
+
display: flex;
|
45
|
+
padding-right: 10px;
|
39
46
|
}
|
40
47
|
`;
|
41
48
|
export default [styles];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-code-editor.css.js","sourceRoot":"","sources":["../../../src/nile-code-editor/nile-code-editor.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCxB,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 .cm-editor {\n overflow: hidden;\n width: 100%;\n height: 100%;\n }\n\n .ͼ1.cm-focused {\n outline: none;\n }\n\n .code-editor__icon__container {\n display: none;\n }\n .code-mirror:hover > .code-editor__icon__container {\n cursor: pointer;\n display: flex;\n padding-right: 10px;\n }\n`;\n\nexport default [styles];\n"]}
|