@aquera/nile-elements 0.0.29 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.css.js +1 -0
  2. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.css.js.map +1 -1
  3. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js +43 -6
  4. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
  5. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.d.ts +30 -17
  6. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +143 -110
  7. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js.map +1 -1
  8. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
  9. package/dist/index.cjs.js +1 -1
  10. package/dist/index.esm.js +1 -1
  11. package/dist/index.iife.js +378 -317
  12. package/dist/nile-content-editor/nile-content-editor.css.cjs.js +1 -1
  13. package/dist/nile-content-editor/nile-content-editor.css.cjs.js.map +1 -1
  14. package/dist/nile-content-editor/nile-content-editor.css.esm.js +1 -0
  15. package/dist/nile-switcher/index.cjs.js +1 -1
  16. package/dist/nile-switcher/index.esm.js +1 -1
  17. package/dist/nile-switcher/nile-switcher.cjs.js +1 -1
  18. package/dist/nile-switcher/nile-switcher.cjs.js.map +1 -1
  19. package/dist/nile-switcher/nile-switcher.css.cjs.js +1 -1
  20. package/dist/nile-switcher/nile-switcher.css.cjs.js.map +1 -1
  21. package/dist/nile-switcher/nile-switcher.css.esm.js +45 -8
  22. package/dist/nile-switcher/nile-switcher.esm.js +72 -44
  23. package/dist/src/nile-content-editor/nile-content-editor.css.js +1 -0
  24. package/dist/src/nile-content-editor/nile-content-editor.css.js.map +1 -1
  25. package/dist/src/nile-switcher/nile-switcher.css.js +43 -6
  26. package/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
  27. package/dist/src/nile-switcher/nile-switcher.d.ts +30 -17
  28. package/dist/src/nile-switcher/nile-switcher.js +143 -110
  29. package/dist/src/nile-switcher/nile-switcher.js.map +1 -1
  30. package/dist/tsconfig.tsbuildinfo +1 -1
  31. package/package.json +1 -1
  32. package/src/nile-content-editor/nile-content-editor.css.ts +1 -0
  33. package/src/nile-switcher/nile-switcher.css.ts +43 -6
  34. package/src/nile-switcher/nile-switcher.ts +167 -172
@@ -1,2 +1,2 @@
1
- System.register(["../index-cd83c5c8.cjs.js"],function(_export,_context){"use strict";var o,_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){o=_index001CjsJs.i;}],execute:function(){_export("s",e=o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n box-sizing: border-box;\n font-size: 14px;\n }\n\n .content-editable-wrapper {\n position: relative;\n width: 100%;\n box-sizing: border-box;\n }\n\n .dropdown-position {\n position: relative;\n bottom: 1px;\n }\n .content-editable-input {\n box-sizing: border-box;\n width: 100%;\n padding: 9px;\n border: 1px solid #c7ced4;\n border-radius: 4px;\n overflow: auto;\n overflow-x: auto;\n overflow-anchor: none;\n scrollbar-width: none;\n -ms-overflow-style: none;\n cursor: text;\n white-space: nowrap;\n background-color: #ffffff;\n height: 38px;\n }\n .content-editable-input:focus {\n outline: none;\n }\n\n .error {\n border-color: #e5434d;\n }\n\n .read-only {\n background-color: hsl(240 4.8% 95.9%);\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .chips {\n display: inline;\n background: #e5e9eb;\n color: #000;\n border-radius: 4px;\n padding: 6px;\n height: 24px;\n line-height: 10px;\n margin-left: 3px;\n letter-spacing: 0.2px;\n }\n\n .text-area {\n height: 120px;\n overflow: scroll;\n line-height: 26px;\n }\n\n .text-area .chips {\n padding: 4px 8px;\n }\n\n .chip-error {\n background: #f3a5aa;\n }\n .nile-options-container {\n box-sizing: border-box;\n background-color: #ffffff;\n border: 1px solid #c7ced4;\n overflow: auto;\n max-height: 150px;\n }\n\n label {\n display: inline-block;\n margin-bottom: 6px;\n font-family: 'colfax-medium';\n }\n\n .asterik {\n color: #e5434d;\n }\n\n .no-border {\n border: none;\n }\n"]))));}};});
1
+ System.register(["../index-cd83c5c8.cjs.js"],function(_export,_context){"use strict";var o,_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){o=_index001CjsJs.i;}],execute:function(){_export("s",e=o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n box-sizing: border-box;\n font-size: 14px;\n overflow: hidden;\n }\n\n .content-editable-wrapper {\n position: relative;\n width: 100%;\n box-sizing: border-box;\n }\n\n .dropdown-position {\n position: relative;\n bottom: 1px;\n }\n .content-editable-input {\n box-sizing: border-box;\n width: 100%;\n padding: 9px;\n border: 1px solid #c7ced4;\n border-radius: 4px;\n overflow: auto;\n overflow-x: auto;\n overflow-anchor: none;\n scrollbar-width: none;\n -ms-overflow-style: none;\n cursor: text;\n white-space: nowrap;\n background-color: #ffffff;\n height: 38px;\n }\n .content-editable-input:focus {\n outline: none;\n }\n\n .error {\n border-color: #e5434d;\n }\n\n .read-only {\n background-color: hsl(240 4.8% 95.9%);\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .chips {\n display: inline;\n background: #e5e9eb;\n color: #000;\n border-radius: 4px;\n padding: 6px;\n height: 24px;\n line-height: 10px;\n margin-left: 3px;\n letter-spacing: 0.2px;\n }\n\n .text-area {\n height: 120px;\n overflow: scroll;\n line-height: 26px;\n }\n\n .text-area .chips {\n padding: 4px 8px;\n }\n\n .chip-error {\n background: #f3a5aa;\n }\n .nile-options-container {\n box-sizing: border-box;\n background-color: #ffffff;\n border: 1px solid #c7ced4;\n overflow: auto;\n max-height: 150px;\n }\n\n label {\n display: inline-block;\n margin-bottom: 6px;\n font-family: 'colfax-medium';\n }\n\n .asterik {\n color: #e5434d;\n }\n\n .no-border {\n border: none;\n }\n"]))));}};});
2
2
  //# sourceMappingURL=nile-content-editor.css.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-content-editor.css.cjs.js","sources":["../../../src/nile-content-editor/nile-content-editor.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 * AttributeExpression CSS\n */\nexport const styles = css`\n :host {\n box-sizing: border-box;\n font-size: 14px;\n }\n\n .content-editable-wrapper {\n position: relative;\n width: 100%;\n box-sizing: border-box;\n }\n\n .dropdown-position {\n position: relative;\n bottom: 1px;\n }\n .content-editable-input {\n box-sizing: border-box;\n width: 100%;\n padding: 9px;\n border: 1px solid #c7ced4;\n border-radius: 4px;\n overflow: auto;\n overflow-x: auto;\n overflow-anchor: none;\n scrollbar-width: none;\n -ms-overflow-style: none;\n cursor: text;\n white-space: nowrap;\n background-color: #ffffff;\n height: 38px;\n }\n .content-editable-input:focus {\n outline: none;\n }\n\n .error {\n border-color: #e5434d;\n }\n\n .read-only {\n background-color: hsl(240 4.8% 95.9%);\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .chips {\n display: inline;\n background: #e5e9eb;\n color: #000;\n border-radius: 4px;\n padding: 6px;\n height: 24px;\n line-height: 10px;\n margin-left: 3px;\n letter-spacing: 0.2px;\n }\n\n .text-area {\n height: 120px;\n overflow: scroll;\n line-height: 26px;\n }\n\n .text-area .chips {\n padding: 4px 8px;\n }\n\n .chip-error {\n background: #f3a5aa;\n }\n .nile-options-container {\n box-sizing: border-box;\n background-color: #ffffff;\n border: 1px solid #c7ced4;\n overflow: auto;\n max-height: 150px;\n }\n\n label {\n display: inline-block;\n margin-bottom: 6px;\n font-family: 'colfax-medium';\n }\n\n .asterik {\n color: #e5434d;\n }\n\n .no-border {\n border: none;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"gXAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
1
+ {"version":3,"file":"nile-content-editor.css.cjs.js","sources":["../../../src/nile-content-editor/nile-content-editor.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 * AttributeExpression CSS\n */\nexport const styles = css`\n :host {\n box-sizing: border-box;\n font-size: 14px;\n overflow: hidden;\n }\n\n .content-editable-wrapper {\n position: relative;\n width: 100%;\n box-sizing: border-box;\n }\n\n .dropdown-position {\n position: relative;\n bottom: 1px;\n }\n .content-editable-input {\n box-sizing: border-box;\n width: 100%;\n padding: 9px;\n border: 1px solid #c7ced4;\n border-radius: 4px;\n overflow: auto;\n overflow-x: auto;\n overflow-anchor: none;\n scrollbar-width: none;\n -ms-overflow-style: none;\n cursor: text;\n white-space: nowrap;\n background-color: #ffffff;\n height: 38px;\n }\n .content-editable-input:focus {\n outline: none;\n }\n\n .error {\n border-color: #e5434d;\n }\n\n .read-only {\n background-color: hsl(240 4.8% 95.9%);\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .chips {\n display: inline;\n background: #e5e9eb;\n color: #000;\n border-radius: 4px;\n padding: 6px;\n height: 24px;\n line-height: 10px;\n margin-left: 3px;\n letter-spacing: 0.2px;\n }\n\n .text-area {\n height: 120px;\n overflow: scroll;\n line-height: 26px;\n }\n\n .text-area .chips {\n padding: 4px 8px;\n }\n\n .chip-error {\n background: #f3a5aa;\n }\n .nile-options-container {\n box-sizing: border-box;\n background-color: #ffffff;\n border: 1px solid #c7ced4;\n overflow: auto;\n max-height: 150px;\n }\n\n label {\n display: inline-block;\n margin-bottom: 6px;\n font-family: 'colfax-medium';\n }\n\n .asterik {\n color: #e5434d;\n }\n\n .no-border {\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"}
@@ -2,6 +2,7 @@ import{i as o}from"../index-cd2f9c12.esm.js";const e=o`
2
2
  :host {
3
3
  box-sizing: border-box;
4
4
  font-size: 14px;
5
+ overflow: hidden;
5
6
  }
6
7
 
7
8
  .content-editable-wrapper {
@@ -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","../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(_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","../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(_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"../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"../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","../property-0f6a51ec.cjs.js","lit"],function(_export,_context){"use strict";var e,i,t,r,n,s,o,l,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_templateObject12,a,c,d;function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(obj,key,value){key=_toPropertyKey(key);if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}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){n=_internalNileElementCjsJs.N;},function(_litDirectivesChooseJs){s=_litDirectivesChooseJs.choose;},function(_litDirectivesClassMapJs){o=_litDirectivesClassMapJs.classMap;},function(_property002CjsJs){l=_property002CjsJs.n;},function(_lit){}],execute:function(){!function(e){e.DEFAULT="defaultInput",e.SWITCH="switchInput";}(a||(a={})),function(e){e.DROPDOWN="dropdown",e.TEXT="text",e.CHECKBOX="checkbox",e.TEXTAREA="text-area",e.RADIO="radio",e.CONTENTEDITOR="content-editor";}(c||(c={}));_export("N",d=/*#__PURE__*/function(_n){_inherits(d,_n);var _super=_createSuper(d);function d(){_classCallCheck(this,d);return _super.apply(this,arguments);}_createClass(d,[{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf(d.prototype),"connectedCallback",this).call(this),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_get(_getPrototypeOf(d.prototype),"disconnectedCallback",this).call(this),this.emit("nile-destroy");}},{key:"renderNileText",value:function renderNileText(e,t){var _this=this;var r=e.value,n=e.label,s=e.placeholder,o=e.disabled,l=e.required,a=e.error,c=e.errorMessage,_d=e.inputType;return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-input\n .value=","\n .label=","\n .disabled=","\n .required=","\n .errorMessage=","\n .placeholder=","\n .error=","\n @nile-input=","\n ></nile-input>"])),r,n,o,l,c,s,a,function(e){_this.handleChange(e,t,_d);});}},{key:"renderDropdown",value:function renderDropdown(e,t){var _this2=this;var r=e.options,n=e.multiple,s=e.placeholder,o=e.disabled,l=e.value,a=e.error,c=e.errorMessage,_d2=e.inputType;return i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-select\n .placeholder=","\n .disabled=\"","\"\n .multiple=\"","\"\n .value=\"","\"\n .error=\"","\"\n .errorMessage=\"","\"\n @nile-change=","\n >\n ","\n </nile-select>"])),s,o,n,l,a,c,function(e){_this2.handleChange(e,t,_d2);},r===null||r===void 0?void 0:r.map(function(e){return i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-option .value=\"","\">"," </nile-option>"])),e,e);}));}},{key:"renderNileTextArea",value:function renderNileTextArea(e,t){var _this3=this;var r=e.value,n=e.disabled,s=e.readonly,o=e.errorMessage,l=e.error,a=e.inputType;return i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-textarea\n .value=","\n .disabled=","\n ?readonly=","\n .error=","\n .errorMessage=","\n @nile-input=","\n ></nile-textarea>"])),r,n,s,l,o,function(e){_this3.handleChange(e,t,a);});}},{key:"renderNileCheckBox",value:function renderNileCheckBox(e,t){var _this4=this;var r=e.value,n=e.label,s=e.disabled,o=e.inputType;return i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-checkbox\n .checked=","\n .label=","\n .disabled=","\n @valueChange=","\n ></nile-checkbox\n >; "])),r,n,s,function(e){_this4.handleChange(e,t,o);});}},{key:"renderNileRadio",value:function renderNileRadio(e,t){var _this5=this;var r=e.options,n=e.value,s=e.disabled,o=e.inputType,l=e.errorMessage,a=!!l;return i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-radio-group\n .value=","\n .disabled=","\n @change=","\n >\n ","\n ","\n </nile-radio-group> "])),n,s,function(e){_this5.handleChange(e,t,o);},r&&r.map(function(e){return i(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-radio .value=\"","\">"," </nile-radio>"])),e,e);}),a?this.renderErrorMessage(l):"");}},{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,t){var _this6=this;var r=e.options,n=e.inputType,s=e.errorMessage,o=e.type,l=e.readonly,a=e.noborder,c=e.value;return i(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["<nile-content-editor\n .value=","\n .options=","\n .type=","\n .readonly=","\n .noborder=","\n .errorMessage=","\n @nile-change=","\n >\n </nile-content-editor>"])),c,r,o,l,a,s,function(e){_this6.handleChange(e,t,n);});}},{key:"handleChange",value:function handleChange(e,i,t){t===c.CHECKBOX?this.nileSwitchConfig[i].value=e.detail.checked:this.nileSwitchConfig[i].value=e.detail.value,e.stopPropagation(),this.emit("nile-change",{config:this.nileSwitchConfig});}},{key:"renderIcon",value:function renderIcon(e,t){var r=e.helperText,n=t.helperText,s=this.nileSwitchConfig.toggleSwitch?"stringinput":"header-functions",l=this.nileSwitchConfig.toggleSwitch?r||"switch to ".concat(e.inputType):n||"switch to ".concat(t.inputType);return i(_templateObject10||(_templateObject10=_taggedTemplateLiteral([" <nile-tooltip\n class=","\n content=","\n placement=\"bottom\"\n >\n <nile-icon\n size=\"14\"\n class=","\n .name=","\n color=\"#005EA6\"\n @click=","\n ></nile-icon>\n </nile-tooltip>"])),o({"tooltip-container":!0}),l,o({"pointer-cursor":!0}),s,this.toggleField);}},{key:"toggleField",value:function toggleField(){this.nileSwitchConfig.confirmation||(this.nileSwitchConfig=_objectSpread(_objectSpread({},this.nileSwitchConfig),{},{toggleSwitch:!this.nileSwitchConfig.toggleSwitch})),this.emit("nile-switch",{config:this.nileSwitchConfig});}},{key:"singleFieldSwitcher",value:function singleFieldSwitcher(e,t,r,n){var _this7=this;var o=e.inputType,l=t.inputType;return i(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["\n ","\n ","\n "])),r?s(l,[[c.TEXTAREA,function(){return _this7.renderNileTextArea(t,a.SWITCH);}],[c.TEXT,function(){return _this7.renderNileText(t,a.SWITCH);}],[c.CONTENTEDITOR,function(){return _this7.renderContentEditor(t,a.SWITCH);}]],function(){return _this7.renderNileTextArea(t,a.SWITCH);}):s(o,[[c.TEXT,function(){return _this7.renderNileText(e,a.DEFAULT);}],[c.CHECKBOX,function(){return _this7.renderNileCheckBox(e,a.DEFAULT);}],[c.TEXTAREA,function(){return _this7.renderNileTextArea(e,a.DEFAULT);}],[c.RADIO,function(){return _this7.renderNileRadio(e,a.DEFAULT);}],[c.DROPDOWN,function(){return _this7.renderDropdown(_this7.nileSwitchConfig.defaultInput,a.DEFAULT);}],[c.CONTENTEDITOR,function(){return _this7.renderContentEditor(_this7.nileSwitchConfig.defaultInput,a.DEFAULT);}]],function(){return _this7.renderNileText(e,a.DEFAULT);}),n?"":this.renderIcon(e,t));}},{key:"render",value:function render(){var _this$nileSwitchConfi=this.nileSwitchConfig,e=_this$nileSwitchConfi.toggleSwitch,t=_this$nileSwitchConfi.defaultInput,r=_this$nileSwitchConfi.switchInput,n=_this$nileSwitchConfi.disable;return i(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["<div class=\"input-container\">\n ","\n </div>"])),this.singleFieldSwitcher(t,r,e,!!n));}}]);return d;}(n));d.styles=r,e([l({type:Object})],d.prototype,"nileSwitchConfig",void 0),_export("N",d=e([t("nile-switcher")],d));}};});
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","../property-0f6a51ec.cjs.js","lit"],function(_export,_context){"use strict";var e,i,r,t,s,n,o,l,c,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_templateObject12,_templateObject13,_templateObject14,a,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){r=_litDecoratorsJs.customElement;},function(_nileSwitcherCssCjsJs){t=_nileSwitcherCssCjsJs.s;},function(_internalNileElementCjsJs){s=_internalNileElementCjsJs.N;},function(_litDirectivesChooseJs){n=_litDirectivesChooseJs.choose;},function(_litDirectivesClassMapJs){o=_litDirectivesClassMapJs.classMap;},function(_litDirectivesRepeatJs){l=_litDirectivesRepeatJs.repeat;},function(_property002CjsJs){c=_property002CjsJs.n;},function(_lit){}],execute:function(){!function(e){e.INLINE="inline",e.BLOCK="block";}(a||(a={})),function(e){e.DEFAULT="defaultInput",e.SWITCH="switchInput";}(d||(d={})),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";}(h||(h={})),function(e){e.CREATE="create",e.EDIT="edit";}(p||(p={}));_export("N",u=/*#__PURE__*/function(_s){_inherits(u,_s);var _super=_createSuper(u);function u(){_classCallCheck(this,u);return _super.apply(this,arguments);}_createClass(u,[{key:"connectedCallback",value:function connectedCallback(){this.currentInput=this.nileSwitchConfig.inputs[0],_get(_getPrototypeOf(u.prototype),"connectedCallback",this).call(this),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_get(_getPrototypeOf(u.prototype),"disconnectedCallback",this).call(this),this.emit("nile-destroy");}},{key:"renderNileText",value:function renderNileText(e){var _this=this;var r=e.value,t=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}),r,t,n,l,a,s,c,function(e){_this.handleChange(e,d);});}},{key:"renderDropdown",value:function renderDropdown(e){var _this2=this;var r=e.options,t=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,t,o,l,c,function(e){_this2.handleChange(e,a);},r===null||r===void 0?void 0:r.map(function(e){return i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-option .value=\"","\">"," </nile-option>"])),e,e);}));}},{key:"renderNileTextArea",value:function renderNileTextArea(e){var _this3=this;var r=e.value,t=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>"])),r,t,s,o,n,function(e){_this3.handleChange(e,l);});}},{key:"renderNileCheckBox",value:function renderNileCheckBox(e){var _this4=this;var r=e.value,t=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 >; "])),r,t,s,function(e){_this4.handleChange(e,n);});}},{key:"renderNileRadio",value:function renderNileRadio(e){var _this5=this;var r=e.options,t=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> "])),t,s,function(e){_this5.handleChange(e,o);},r&&r.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 _this6=this;var r=e.options,t=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,r,n,o,l,s,function(e){_this6.handleChange(e,t);});}},{key:"renderObjectMapper",value:function renderObjectMapper(){var _this7=this;var e=this.currentInput.noborder;this.currentInput.mode;var r=this.currentInput.mode===p.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}),r,function(e){return _this7.handleChange(e,h.OBJECT_MAPPER);});}},{key:"handleChange",value:function handleChange(e,i){switch(i){case h.OBJECT_MAPPER:this.currentInput.value="clicked";break;case h.CHECKBOX:this.currentInput.value=e.detail.checked;break;default:this.currentInput.value=e.detail.value;}e.stopPropagation(),this.emit("nile-change",{input:this.currentInput});}},{key:"renderIcon",value:function renderIcon(){var _this8=this;var e=this.nileSwitchConfig.inputs,r=this.nileSwitchConfig.align===a.BLOCK?"top":"bottom";return i(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["\n <div class=\"switcher-icons-container\">\n ","\n </div>\n "])),l(e,function(e){return i(_templateObject12||(_templateObject12=_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:e.order===_this8.currentInput.order}),o({"pointer-cursor":!0}),e.icon,function(){return _this8.toggleField(e);});}));}},{key:"toggleField",value:function toggleField(e){this.currentInput=e,this.emit("nile-switch",{input:this.currentInput});}},{key:"singleFieldSwitcher",value:function singleFieldSwitcher(){var _this9=this;return i(_templateObject13||(_templateObject13=_taggedTemplateLiteral(["\n ","\n "])),n(this.currentInput.inputType,[[h.TEXT,function(){return _this9.renderNileText(_this9.currentInput);}],[h.CHECKBOX,function(){return _this9.renderNileCheckBox(_this9.currentInput);}],[h.TEXTAREA,function(){return _this9.renderNileTextArea(_this9.currentInput);}],[h.RADIO,function(){return _this9.renderNileRadio(_this9.currentInput);}],[h.DROPDOWN,function(){return _this9.renderDropdown(_this9.currentInput);}],[h.CONTENTEDITOR,function(){return _this9.renderContentEditor(_this9.currentInput);}],[h.OBJECT_MAPPER,function(){return _this9.renderObjectMapper();}]],function(){return _this9.renderNileText(_this9.currentInput);}));}},{key:"render",value:function render(){var e=this.nileSwitchConfig.align;return i(_templateObject14||(_templateObject14=_taggedTemplateLiteral(["<div\n class=","\n >\n "," ","\n </div>"])),o({"switcher-block":e===a.BLOCK,"switcher-inline":e===a.INLINE,"switcher-input-container":!0}),this.renderIcon(),this.singleFieldSwitcher());}}]);return u;}(s));u.styles=t,e([c({type:Object})],u.prototype,"nileSwitchConfig",void 0),e([c()],u.prototype,"currentInput",void 0),_export("N",u=e([r("nile-switcher")],u));}};});
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';\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 \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 */\n\nexport interface switchconfig {\n [key: string]: any;\n toggleSwitch: boolean;\n disable?: boolean;\n confirmation?: boolean;\n defaultInput: switchInputType;\n switchInput: 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 value?: String | boolean;\n label?: String;\n readonly?: boolean;\n type?: string;\n placeholder?: string;\n disabled?: boolean;\n required?: boolean;\n error?: boolean;\n errorMessage?: string;\n options?: Array<any>;\n helperText?: string;\n multiple?: boolean;\n noborder?: boolean;\n}\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}\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 @property({ type: Object }) nileSwitchConfig: switchconfig;\n\n connectedCallback() {\n super.connectedCallback();\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n renderNileText(Input: switchInputType, inputType: string) {\n const {\n value,\n label,\n placeholder,\n disabled,\n required,\n error,\n errorMessage,\n inputType: inputTypeName,\n } = Input;\n return html`<nile-input\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, inputTypeName);\n }}\n ></nile-input>`;\n }\n\n renderDropdown(Input: switchInputType, inputType: string) {\n const {\n options,\n multiple,\n placeholder,\n disabled,\n value,\n error,\n errorMessage,\n inputType: inputTypeName,\n } = Input;\n\n return html`<nile-select\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, inputTypeName);\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, inputType: string) {\n const {\n value,\n disabled,\n readonly,\n errorMessage,\n error,\n inputType: inputTypeName,\n } = Input;\n\n return html`<nile-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, inputTypeName);\n }}\n ></nile-textarea>`;\n }\n\n renderNileCheckBox(Input: switchInputType, inputType: string) {\n const { value, label, disabled, inputType: inputTypeName } = Input;\n\n return html`<nile-checkbox\n .checked=${value}\n .label=${label}\n .disabled=${disabled}\n @valueChange=${(e: CustomEvent) => {\n this.handleChange(e, inputType, inputTypeName);\n }}\n ></nile-checkbox\n >; `;\n }\n\n renderNileRadio(Input: switchInputType, inputType: string) {\n const {\n options,\n value,\n disabled,\n inputType: inputTypeName,\n errorMessage,\n } = Input;\n\n const haserrorMessage = !!errorMessage;\n\n return html`<nile-radio-group\n .value=${value}\n .disabled=${disabled}\n @change=${(e: CustomEvent) => {\n this.handleChange(e, inputType, inputTypeName);\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, inputType: string) {\n let {\n options,\n inputType: inputTypeName,\n errorMessage,\n type,\n readonly,\n noborder,\n value,\n } = Input;\n return html`<nile-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, inputTypeName);\n }}\n >\n </nile-content-editor>`;\n }\n\n handleChange(event: CustomEvent, inputType: string, inputTypeName: string) {\n if (inputTypeName === INPUT_TYPE_NAMES.CHECKBOX) {\n this.nileSwitchConfig[inputType as keyof switchconfig].value =\n event.detail.checked;\n } else {\n this.nileSwitchConfig[inputType as keyof switchconfig].value =\n event.detail.value;\n }\n event.stopPropagation();\n this.emit('nile-change', { config: this.nileSwitchConfig });\n }\n\n renderIcon(defaultInput: switchInputType, switchInput: switchInputType) {\n const defaultHelperText = defaultInput.helperText;\n const switchHelperText = switchInput.helperText;\n\n const icon = !this.nileSwitchConfig.toggleSwitch\n ? 'header-functions'\n : 'stringinput';\n\n const helperText = !this.nileSwitchConfig.toggleSwitch\n ? !!switchHelperText\n ? switchHelperText\n : `switch to ${switchInput.inputType}`\n : !!defaultHelperText\n ? defaultHelperText\n : `switch to ${defaultInput.inputType}`;\n\n return html` <nile-tooltip\n class=${classMap({\n 'tooltip-container': true,\n })}\n content=${helperText}\n placement=\"bottom\"\n >\n <nile-icon\n size=\"14\"\n class=${classMap({\n 'pointer-cursor': true,\n })}\n .name=${icon}\n color=\"#005EA6\"\n @click=${this.toggleField}\n ></nile-icon>\n </nile-tooltip>`;\n }\n\n toggleField() {\n if (!this.nileSwitchConfig.confirmation) {\n this.nileSwitchConfig = {\n ...this.nileSwitchConfig,\n toggleSwitch: !this.nileSwitchConfig.toggleSwitch,\n };\n }\n this.emit('nile-switch', { config: this.nileSwitchConfig });\n }\n\n singleFieldSwitcher(\n defaultInput: switchInputType,\n switchInput: switchInputType,\n toggleField: boolean,\n disable: boolean\n ) {\n const defaultInputType = defaultInput.inputType;\n const switchInputType = switchInput.inputType;\n return html`\n ${!toggleField\n ? choose(\n defaultInputType,\n [\n [\n INPUT_TYPE_NAMES.TEXT,\n () => this.renderNileText(defaultInput, INPUT_TYPE.DEFAULT),\n ],\n [\n INPUT_TYPE_NAMES.CHECKBOX,\n () => this.renderNileCheckBox(defaultInput, INPUT_TYPE.DEFAULT),\n ],\n [\n INPUT_TYPE_NAMES.TEXTAREA,\n () => this.renderNileTextArea(defaultInput, INPUT_TYPE.DEFAULT),\n ],\n [\n INPUT_TYPE_NAMES.RADIO,\n () => this.renderNileRadio(defaultInput, INPUT_TYPE.DEFAULT),\n ],\n [\n INPUT_TYPE_NAMES.DROPDOWN,\n () =>\n this.renderDropdown(\n this.nileSwitchConfig.defaultInput,\n INPUT_TYPE.DEFAULT\n ),\n ],\n [\n INPUT_TYPE_NAMES.CONTENTEDITOR,\n () =>\n this.renderContentEditor(\n this.nileSwitchConfig.defaultInput,\n INPUT_TYPE.DEFAULT\n ),\n ],\n ],\n () => this.renderNileText(defaultInput, INPUT_TYPE.DEFAULT)\n )\n : choose(\n switchInputType,\n [\n [\n INPUT_TYPE_NAMES.TEXTAREA,\n () => this.renderNileTextArea(switchInput, INPUT_TYPE.SWITCH),\n ],\n [\n INPUT_TYPE_NAMES.TEXT,\n () => this.renderNileText(switchInput, INPUT_TYPE.SWITCH),\n ],\n [\n INPUT_TYPE_NAMES.CONTENTEDITOR,\n () => this.renderContentEditor(switchInput, INPUT_TYPE.SWITCH),\n ],\n ],\n\n () => this.renderNileTextArea(switchInput, INPUT_TYPE.SWITCH)\n )}\n ${!disable ? this.renderIcon(defaultInput, switchInput) : ''}\n `;\n }\n public render(): TemplateResult {\n const {\n toggleSwitch: toggleField,\n defaultInput,\n switchInput,\n disable,\n } = this.nileSwitchConfig;\n\n return html`<div class=\"input-container\">\n ${this.singleFieldSwitcher(\n defaultInput,\n switchInput,\n toggleField,\n !!disable\n )}\n </div>`;\n }\n}\n\nexport default NileSwitcher;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-switcher': NileSwitcher;\n }\n}\n"],"names":["INPUT_TYPE","DEFAULT","SWITCH","INPUT_TYPE_NAMES","DROPDOWN","TEXT","CHECKBOX","TEXTAREA","RADIO","CONTENTEDITOR","_export","NileSwitcher","_n","_inherits","d","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","connectedCallback","super","this","emit","disconnectedCallback","renderNileText","Input","inputType","label","placeholder","disabled","required","error","errorMessage","inputTypeName","html","_templateObject","_taggedTemplateLiteral","e","handleChange","renderDropdown","options","multiple","_templateObject2","map","option","_templateObject3","renderNileTextArea","readonly","_templateObject4","renderNileCheckBox","_templateObject5","renderNileRadio","haserrorMessage","_templateObject6","_templateObject7","renderErrorMessage","_templateObject8","renderContentEditor","type","noborder","_templateObject9","event","nileSwitchConfig","detail","checked","stopPropagation","config","renderIcon","defaultInput","switchInput","defaultHelperText","helperText","switchHelperText","icon","toggleSwitch","concat","_templateObject10","classMap","toggleField","confirmation","_objectSpread","singleFieldSwitcher","disable","defaultInputType","switchInputType","_templateObject11","choose","render","_this$nileSwitchConfi","_templateObject12","NileElement","styles","__decorate","property","Object","prototype","customElement"],"mappings":"i/KA8DA,CAAA,SAAYA,CACVA,CAAAA,CAAA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AWC,CAAcC,CAAAA,CAAAA,CAAAA,EAE9C,CACM,GAAApD,GAAA,UAAAC,KAAA,UAAAqE,OAAA,CAAAA,CACL,IAAAC,qBAAA,CAKInE,IAAKyC,CAAAA,gBAAAA,CAJOgB,wBAAdJ,YAAAA,CACAN,CAAAA,CAAAA,qBAAAA,CADyBA,YACzBA,CACAC,CAAAA,CAAAA,qBAAAA,CADYA,WACZA,CACAa,CAAAA,CAAAA,qBAAAA,CADWA,OACXA,CAGF,MAAOhD,CAAAA,CAAI,CAAAuD,iBAAA,GAAAA,iBAAA,CAAArD,sBAAA,8DACPf,IAAK4D,CAAAA,mBAAAA,CACLb,CACAC,CAAAA,CAAAA,CACAS,CACEI,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAGP,CAAA,WAAAxE,CAAA,GAnT+BgF,CAQhC,GAHOnF,EAAMoF,MAAmBA,CAAAA,CAAAA,CACJC,EAAA,CAA3BC,CAAAA,CAAS,CAAEnC,IAAMoC,CAAAA,MAAAA,CAAAA,CAAAA,CAAAA,CAAyCvF,CAAAwF,CAAAA,SAAAA,CAAA,uBAAA,EANhDxF,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAYqF,EAAA,CADxBI,CAAAA,CAAc,kBACFzF"}
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';\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 current: number;\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 value?: String | boolean;\n label?: String;\n readonly?: boolean;\n order: number;\n type?: string;\n icon: string;\n mode?: string;\n placeholder?: string;\n disabled?: boolean;\n required?: boolean;\n error?: boolean;\n errorMessage?: string;\n options?: Array<any>;\n helperText?: string;\n multiple?: boolean;\n noborder?: boolean;\n}\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}\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() currentInput: switchInputType;\n\n connectedCallback() {\n this.currentInput = this.nileSwitchConfig.inputs[0];\n super.connectedCallback();\n this.emit('nile-init');\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 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 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 => 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: input.order === this.currentInput.order,\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)}\n ></nile-icon>\n <div>\n \n </nile-tooltip>`\n )}\n </div>\n `;\n }\n\n toggleField(currentInput: switchInputType) {\n this.currentInput = currentInput;\n this.emit('nile-switch', { input: this.currentInput });\n }\n\n singleFieldSwitcher() {\n return html`\n ${choose(\n this.currentInput.inputType,\n [\n [INPUT_TYPE_NAMES.TEXT, () => this.renderNileText(this.currentInput)],\n [\n INPUT_TYPE_NAMES.CHECKBOX,\n () => this.renderNileCheckBox(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.TEXTAREA,\n () => this.renderNileTextArea(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.RADIO,\n () => this.renderNileRadio(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.DROPDOWN,\n () => this.renderDropdown(this.currentInput),\n ],\n [\n INPUT_TYPE_NAMES.CONTENTEDITOR,\n () => this.renderContentEditor(this.currentInput),\n ],\n [INPUT_TYPE_NAMES.OBJECT_MAPPER, () => this.renderObjectMapper()],\n ],\n () => 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":["POSITIONS","INLINE","BLOCK","INPUT_TYPE","DEFAULT","SWITCH","INPUT_TYPE_NAMES","DROPDOWN","TEXT","CHECKBOX","TEXTAREA","RADIO","CONTENTEDITOR","OBJECT_MAPPER","MODE","CREATE","EDIT","_export","NileSwitcher","connectedCallback","this","currentInput","nileSwitchConfig","inputs","_get","_getPrototypeOf","u","prototype","call","emit","key","value","disconnectedCallback","super","renderNileText","Input","_this","label","placeholder","disabled","required","error","errorMessage","inputType","noborder","html","_templateObject","_taggedTemplateLiteral","classMap","e","handleChange","renderDropdown","_this2","options","multiple","_templateObject2","map","option","_templateObject3","renderNileTextArea","readonly","_templateObject4","renderNileCheckBox","_this4","_templateObject5","renderNileRadio","haserrorMessage","_templateObject6","_templateObject7","renderErrorMessage","_templateObject8","renderContentEditor","_this6","type","_templateObject9","renderObjectMapper","mode","_templateObject10","event","detail","checked","stopPropagation","input","renderIcon","toolTipPosition","align","_templateObject11","repeat","_templateObject12","helperText","current","order","icon","toggleField","singleFieldSwitcher","_templateObject13","choose","render","_templateObject14","NileElement","styles","__decorate","property","Object","customElement"],"mappings":"g0JAkEA,SAAYA,CAAAA,CAAAA,CACVA,CAAA,CAAAC,MAAA,CAAA,SACAD,CAAA,CAAAE,KAAA,CAAA,OACD,EAHD,CAAYF,CAAAA,GAAAA,CAAAA,CAGX,CAAA,CAAA,CAAA,CAAA,CAED,SAAYG,CAAAA,CAAAA,CACVA,CAAA,CAAAC,OAAA,CAAA,eACAD,CAAA,CAAAE,MAAA,CAAA,aACD,EAHD,CAAYF,CAAAA,GAAAA,CAGX,CAAA,CAAA,IAED,SAAYG,CAAAA,CAAAA,CACVA,CAAA,CAAAC,QAAA,CAAA,UACAD,CAAAA,CAAAA,CAAAE,IAAA,CAAA,MAAA,CACAF,EAAAG,QAAA,CAAA,UAAA,CACAH,CAAA,CAAAI,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AAA,CAAAA,GAAAA,CAAAA,CAE9C,iBAAMvD,CAAAA,MAAAA,CAAKc,eAAed,MAAKC,CAAAA,YAAAA,CAAAA,EAAAA,CAAAA,EAGpC,CAEM,GAAAS,GAAA,UAAAC,KAAA,UAAAkE,OAAA,EACL,GAAMZ,CAAAA,CAAAA,CAAQjE,KAAKE,gBAAiB+D,CAAAA,KAAAA,CACpC,MAAOxC,CAAAA,CAAI,CAAAqD,iBAAA,GAAAA,iBAAA,CAAAnD,sBAAA,+DACDC,CAAS,CAAA,CACf,iBAAkBqC,CAAUrF,GAAAA,CAAAA,CAAUE,MACtC,iBAAmBmF,CAAAA,CAAAA,GAAUrF,CAAUC,CAAAA,MAAAA,CACvC,0BAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAG5BmB,IAAAA,CAAK+D,aAAgB/D,IAAK0E,CAAAA,mBAAAA,CAAAA,CAAAA,EAE/B,CA1RM5E,WAAAA,CAAAA,GALyBiF,CAUhC,GALOjF,CAAAA,CAAMkF,MAAmBA,CAAAA,CAAAA,CAEJC,CAAA,CAAA,CAA3BC,EAAS,CAAE7B,IAAAA,CAAM8B,MAAyCrF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAS,SAAA,CAAA,kBAAA,CAAA,IAAA,IAC/C0E,CAAA,CAAA,CAAXC,CAAyCpF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAS,SAAA,CAAA,cAAA,CAAA,IAAA,EAR/BT,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAYmF,CAAA,CAAA,CADxBG,CAAc,CAAA,eAAA,CAAA,CAAA,CACFtF"}
@@ -1,2 +1,2 @@
1
- System.register(["../index-cd83c5c8.cjs.js"],function(_export,_context){"use strict";var i,_templateObject,n;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){i=_index001CjsJs.i;}],execute:function(){_export("s",n=i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n width: 100%;\n box-sizing: border-box;\n }\n\n .pointer-cursor {\n cursor: pointer;\n }\n .input-container {\n display: flex;\n gap: 0.5rem;\n }\n\n .input-container > :first-child {\n max-width: 98%;\n min-width: 98%;\n }\n\n nile-icon {\n max-height: 38px;\n }\n\n nile-radio {\n display: inline-block;\n padding-right: 10px;\n }\n"]))));}};});
1
+ System.register(["../index-cd83c5c8.cjs.js"],function(_export,_context){"use strict";var i,_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){i=_index001CjsJs.i;}],execute:function(){_export("s",r=i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n width: 100%;\n box-sizing: border-box;\n }\n\n .switcher-icon-container {\n cursor: pointer;\n justify-content: center;\n display: flex;\n align-items: center;\n margin-bottom: 6px;\n height: 28px;\n width: 28px;\n border-radius: 4px;\n }\n\n .switcher-icon-container.current {\n background: var(--nile-colors-blue-400);\n }\n\n .switcher-input-container {\n display: flex;\n }\n\n .switcher-inline {\n gap: 0.5rem;\n }\n\n .switcher-block {\n flex-direction: column;\n }\n\n .switcher-block > :first-child {\n align-self: end;\n }\n\n .switcher-inline > :nth-child(2) {\n flex: 1;\n }\n\n .switcher-input-container > :first-child {\n display: flex;\n gap: 0.5rem;\n max-height: 38px;\n align-items: center;\n }\n\n nile-radio {\n display: inline-block;\n padding-right: 10px;\n }\n\n .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 .pointer-cursor {\n cursor: pointer;\n }\n .input-container {\n display: flex;\n gap: 0.5rem;\n }\n\n .input-container > :first-child {\n max-width: 98%;\n min-width: 98%;\n }\n\n nile-icon {\n max-height: 38px;\n }\n\n nile-radio {\n display: inline-block;\n padding-right: 10px;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"gXAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
1
+ {"version":3,"file":"nile-switcher.css.cjs.js","sources":["../../../src/nile-switcher/nile-switcher.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * FieldGenerator CSS\n */\nexport const styles = css`\n :host {\n width: 100%;\n box-sizing: border-box;\n }\n\n .switcher-icon-container {\n cursor: pointer;\n justify-content: center;\n display: flex;\n align-items: center;\n margin-bottom: 6px;\n height: 28px;\n width: 28px;\n border-radius: 4px;\n }\n\n .switcher-icon-container.current {\n background: var(--nile-colors-blue-400);\n }\n\n .switcher-input-container {\n display: flex;\n }\n\n .switcher-inline {\n gap: 0.5rem;\n }\n\n .switcher-block {\n flex-direction: column;\n }\n\n .switcher-block > :first-child {\n align-self: end;\n }\n\n .switcher-inline > :nth-child(2) {\n flex: 1;\n }\n\n .switcher-input-container > :first-child {\n display: flex;\n gap: 0.5rem;\n max-height: 38px;\n align-items: center;\n }\n\n nile-radio {\n display: inline-block;\n padding-right: 10px;\n }\n\n .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,28 +1,65 @@
1
- import{i}from"../index-cd2f9c12.esm.js";const n=i`
1
+ import{i as e}from"../index-cd2f9c12.esm.js";const i=e`
2
2
  :host {
3
3
  width: 100%;
4
4
  box-sizing: border-box;
5
5
  }
6
6
 
7
- .pointer-cursor {
7
+ .switcher-icon-container {
8
8
  cursor: pointer;
9
+ justify-content: center;
10
+ display: flex;
11
+ align-items: center;
12
+ margin-bottom: 6px;
13
+ height: 28px;
14
+ width: 28px;
15
+ border-radius: 4px;
16
+ }
17
+
18
+ .switcher-icon-container.current {
19
+ background: var(--nile-colors-blue-400);
9
20
  }
10
- .input-container {
21
+
22
+ .switcher-input-container {
11
23
  display: flex;
24
+ }
25
+
26
+ .switcher-inline {
12
27
  gap: 0.5rem;
13
28
  }
14
29
 
15
- .input-container > :first-child {
16
- max-width: 98%;
17
- min-width: 98%;
30
+ .switcher-block {
31
+ flex-direction: column;
32
+ }
33
+
34
+ .switcher-block > :first-child {
35
+ align-self: end;
36
+ }
37
+
38
+ .switcher-inline > :nth-child(2) {
39
+ flex: 1;
18
40
  }
19
41
 
20
- nile-icon {
42
+ .switcher-input-container > :first-child {
43
+ display: flex;
44
+ gap: 0.5rem;
21
45
  max-height: 38px;
46
+ align-items: center;
22
47
  }
23
48
 
24
49
  nile-radio {
25
50
  display: inline-block;
26
51
  padding-right: 10px;
27
52
  }
28
- `;export{n as s};
53
+
54
+ .switcher-object-mapper::part(input) {
55
+ color: var(--nile-colors-primary-600);
56
+ cursor: pointer;
57
+ }
58
+
59
+ .switcher-input--noborder::part(base) {
60
+ border: none;
61
+ }
62
+ .switcher-object-mapper--noborder::part(base) {
63
+ border: none;
64
+ }
65
+ `;export{i as s};
@@ -1,68 +1,96 @@
1
- import{__decorate as e}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";import{customElement as t}from"lit/decorators.js";import{s as r}from"./nile-switcher.css.esm.js";import{N as n}from"../internal/nile-element.esm.js";import{choose as s}from"lit/directives/choose.js";import{classMap as o}from"lit/directives/class-map.js";import{n as l}from"../property-09139d3c.esm.js";import"lit";var a,c;!function(e){e.DEFAULT="defaultInput",e.SWITCH="switchInput"}(a||(a={})),function(e){e.DROPDOWN="dropdown",e.TEXT="text",e.CHECKBOX="checkbox",e.TEXTAREA="text-area",e.RADIO="radio",e.CONTENTEDITOR="content-editor"}(c||(c={}));let d=class extends n{connectedCallback(){super.connectedCallback(),this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}renderNileText(e,t){const{value:r,label:n,placeholder:s,disabled:o,required:l,error:a,errorMessage:c,inputType:d}=e;return i`<nile-input
1
+ import{__decorate as e}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";import{customElement as r}from"lit/decorators.js";import{s as t}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{n as c}from"../property-09139d3c.esm.js";import"lit";var a,d,h,p;!function(e){e.INLINE="inline",e.BLOCK="block"}(a||(a={})),function(e){e.DEFAULT="defaultInput",e.SWITCH="switchInput"}(d||(d={})),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"}(h||(h={})),function(e){e.CREATE="create",e.EDIT="edit"}(p||(p={}));let u=class extends s{connectedCallback(){this.currentInput=this.nileSwitchConfig.inputs[0],super.connectedCallback(),this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}renderNileText(e){const{value:r,label:t,placeholder:s,disabled:n,required:l,error:c,errorMessage:a,inputType:d,noborder:h}=e;return i`<nile-input
2
+ class=${o({"switcher-input":!0,"switcher-input--noborder":!!h})}
2
3
  .value=${r}
3
- .label=${n}
4
- .disabled=${o}
4
+ .label=${t}
5
+ .disabled=${n}
5
6
  .required=${l}
6
- .errorMessage=${c}
7
+ .errorMessage=${a}
7
8
  .placeholder=${s}
8
- .error=${a}
9
- @nile-input=${e=>{this.handleChange(e,t,d)}}
10
- ></nile-input>`}renderDropdown(e,t){const{options:r,multiple:n,placeholder:s,disabled:o,value:l,error:a,errorMessage:c,inputType:d}=e;return i`<nile-select
9
+ .error=${c}
10
+ @nile-input=${e=>{this.handleChange(e,d)}}
11
+ ></nile-input>`}renderDropdown(e){const{options:r,multiple:t,placeholder:s,disabled:n,value:o,error:l,errorMessage:c,inputType:a}=e;return i`<nile-select
12
+ class="switcher-dropdown"
11
13
  .placeholder=${s}
12
- .disabled="${o}"
13
- .multiple="${n}"
14
- .value="${l}"
15
- .error="${a}"
14
+ .disabled="${n}"
15
+ .multiple="${t}"
16
+ .value="${o}"
17
+ .error="${l}"
16
18
  .errorMessage="${c}"
17
- @nile-change=${e=>{this.handleChange(e,t,d)}}
19
+ @nile-change=${e=>{this.handleChange(e,a)}}
18
20
  >
19
21
  ${r?.map((e=>i`<nile-option .value="${e}">${e} </nile-option>`))}
20
- </nile-select>`}renderNileTextArea(e,t){const{value:r,disabled:n,readonly:s,errorMessage:o,error:l,inputType:a}=e;return i`<nile-textarea
22
+ </nile-select>`}renderNileTextArea(e){const{value:r,disabled:t,readonly:s,errorMessage:n,error:o,inputType:l}=e;return i`<nile-textarea
23
+ class="switcher-textarea"
21
24
  .value=${r}
22
- .disabled=${n}
25
+ .disabled=${t}
23
26
  ?readonly=${s}
24
- .error=${l}
25
- .errorMessage=${o}
26
- @nile-input=${e=>{this.handleChange(e,t,a)}}
27
- ></nile-textarea>`}renderNileCheckBox(e,t){const{value:r,label:n,disabled:s,inputType:o}=e;return i`<nile-checkbox
27
+ .error=${o}
28
+ .errorMessage=${n}
29
+ @nile-input=${e=>{this.handleChange(e,l)}}
30
+ ></nile-textarea>`}renderNileCheckBox(e){const{value:r,label:t,disabled:s,inputType:n}=e;return i`<nile-checkbox
31
+ class="switcher-checkbox"
28
32
  .checked=${r}
29
- .label=${n}
33
+ .label=${t}
30
34
  .disabled=${s}
31
- @valueChange=${e=>{this.handleChange(e,t,o)}}
35
+ @valueChange=${e=>{this.handleChange(e,n)}}
32
36
  ></nile-checkbox
33
- >; `}renderNileRadio(e,t){const{options:r,value:n,disabled:s,inputType:o,errorMessage:l}=e,a=!!l;return i`<nile-radio-group
34
- .value=${n}
37
+ >; `}renderNileRadio(e){const{options:r,value:t,disabled:s,errorMessage:n,inputType:o}=e,l=!!n;return i`<nile-radio-group
38
+ class="switcher-radio-group"
39
+ .value=${t}
35
40
  .disabled=${s}
36
- @change=${e=>{this.handleChange(e,t,o)}}
41
+ @change=${e=>{this.handleChange(e,o)}}
37
42
  >
38
43
  ${r&&r.map((e=>i`<nile-radio .value="${e}">${e} </nile-radio>`))}
39
- ${a?this.renderErrorMessage(l):""}
44
+ ${l?this.renderErrorMessage(n):""}
40
45
  </nile-radio-group> `}renderErrorMessage(e){return i`
41
46
  <nile-form-error-message>${e}</nile-form-error-message>
42
- `}renderContentEditor(e,t){let{options:r,inputType:n,errorMessage:s,type:o,readonly:l,noborder:a,value:c}=e;return i`<nile-content-editor
47
+ `}renderContentEditor(e){let{options:r,inputType:t,errorMessage:s,type:n,readonly:o,noborder:l,value:c}=e;return i`<nile-content-editor
48
+ class="switcher-content-editor"
43
49
  .value=${c}
44
50
  .options=${r}
45
- .type=${o}
46
- .readonly=${l}
47
- .noborder=${a}
51
+ .type=${n}
52
+ .readonly=${o}
53
+ .noborder=${l}
48
54
  .errorMessage=${s}
49
- @nile-change=${e=>{this.handleChange(e,t,n)}}
55
+ @nile-change=${e=>{this.handleChange(e,t)}}
50
56
  >
51
- </nile-content-editor>`}handleChange(e,i,t){t===c.CHECKBOX?this.nileSwitchConfig[i].value=e.detail.checked:this.nileSwitchConfig[i].value=e.detail.value,e.stopPropagation(),this.emit("nile-change",{config:this.nileSwitchConfig})}renderIcon(e,t){const r=e.helperText,n=t.helperText,s=this.nileSwitchConfig.toggleSwitch?"stringinput":"header-functions",l=this.nileSwitchConfig.toggleSwitch?r||`switch to ${e.inputType}`:n||`switch to ${t.inputType}`;return i` <nile-tooltip
52
- class=${o({"tooltip-container":!0})}
53
- content=${l}
54
- placement="bottom"
57
+ </nile-content-editor>`}renderObjectMapper(){const e=this.currentInput.noborder;this.currentInput.mode;const r=this.currentInput.mode===p.CREATE?"Click to Create - Not Mapped":"";return i`<nile-input
58
+ class=${o({"switcher-object-mapper":!0,"switcher-object-mapper--noborder":!!e})}
59
+ .value=${r}
60
+ readonly="true"
61
+ @click="${e=>this.handleChange(e,h.OBJECT_MAPPER)}"
55
62
  >
56
63
  <nile-icon
57
- size="14"
58
- class=${o({"pointer-cursor":!0})}
59
- .name=${s}
64
+ class="pointer-cursor switcher-object-mapper-icon"
65
+ slot="suffix"
66
+ name="collapse"
60
67
  color="#005EA6"
61
- @click=${this.toggleField}
62
- ></nile-icon>
63
- </nile-tooltip>`}toggleField(){this.nileSwitchConfig.confirmation||(this.nileSwitchConfig={...this.nileSwitchConfig,toggleSwitch:!this.nileSwitchConfig.toggleSwitch}),this.emit("nile-switch",{config:this.nileSwitchConfig})}singleFieldSwitcher(e,t,r,n){const o=e.inputType,l=t.inputType;return i`
64
- ${r?s(l,[[c.TEXTAREA,()=>this.renderNileTextArea(t,a.SWITCH)],[c.TEXT,()=>this.renderNileText(t,a.SWITCH)],[c.CONTENTEDITOR,()=>this.renderContentEditor(t,a.SWITCH)]],(()=>this.renderNileTextArea(t,a.SWITCH))):s(o,[[c.TEXT,()=>this.renderNileText(e,a.DEFAULT)],[c.CHECKBOX,()=>this.renderNileCheckBox(e,a.DEFAULT)],[c.TEXTAREA,()=>this.renderNileTextArea(e,a.DEFAULT)],[c.RADIO,()=>this.renderNileRadio(e,a.DEFAULT)],[c.DROPDOWN,()=>this.renderDropdown(this.nileSwitchConfig.defaultInput,a.DEFAULT)],[c.CONTENTEDITOR,()=>this.renderContentEditor(this.nileSwitchConfig.defaultInput,a.DEFAULT)]],(()=>this.renderNileText(e,a.DEFAULT)))}
65
- ${n?"":this.renderIcon(e,t)}
66
- `}render(){const{toggleSwitch:e,defaultInput:t,switchInput:r,disable:n}=this.nileSwitchConfig;return i`<div class="input-container">
67
- ${this.singleFieldSwitcher(t,r,e,!!n)}
68
- </div>`}};d.styles=r,e([l({type:Object})],d.prototype,"nileSwitchConfig",void 0),d=e([t("nile-switcher")],d);export{d as N};
68
+ size="16"
69
+ >
70
+ </nile-icon>
71
+ </nile-input>`}handleChange(e,i){switch(i){case h.OBJECT_MAPPER:this.currentInput.value="clicked";break;case h.CHECKBOX:this.currentInput.value=e.detail.checked;break;default:this.currentInput.value=e.detail.value}e.stopPropagation(),this.emit("nile-change",{input:this.currentInput})}renderIcon(){const e=this.nileSwitchConfig.inputs,r=this.nileSwitchConfig.align===a.BLOCK?"top":"bottom";return i`
72
+ <div class="switcher-icons-container">
73
+ ${l(e,(e=>i` <nile-tooltip
74
+ class=${o({"switcher-tooltip-container":!0})}
75
+ content=${e.helperText}
76
+ placement=${r}
77
+ >
78
+ <div class=${o({"switcher-icon-container":!0,current:e.order===this.currentInput.order})}>
79
+ <nile-icon
80
+ size="16"
81
+ class=${o({"pointer-cursor":!0})}
82
+ .name=${e.icon}
83
+ color="#000000"
84
+ @click=${()=>this.toggleField(e)}
85
+ ></nile-icon>
86
+ <div>
87
+
88
+ </nile-tooltip>`))}
89
+ </div>
90
+ `}toggleField(e){this.currentInput=e,this.emit("nile-switch",{input:this.currentInput})}singleFieldSwitcher(){return i`
91
+ ${n(this.currentInput.inputType,[[h.TEXT,()=>this.renderNileText(this.currentInput)],[h.CHECKBOX,()=>this.renderNileCheckBox(this.currentInput)],[h.TEXTAREA,()=>this.renderNileTextArea(this.currentInput)],[h.RADIO,()=>this.renderNileRadio(this.currentInput)],[h.DROPDOWN,()=>this.renderDropdown(this.currentInput)],[h.CONTENTEDITOR,()=>this.renderContentEditor(this.currentInput)],[h.OBJECT_MAPPER,()=>this.renderObjectMapper()]],(()=>this.renderNileText(this.currentInput)))}
92
+ `}render(){const e=this.nileSwitchConfig.align;return i`<div
93
+ class=${o({"switcher-block":e===a.BLOCK,"switcher-inline":e===a.INLINE,"switcher-input-container":!0})}
94
+ >
95
+ ${this.renderIcon()} ${this.singleFieldSwitcher()}
96
+ </div>`}};u.styles=t,e([c({type:Object})],u.prototype,"nileSwitchConfig",void 0),e([c()],u.prototype,"currentInput",void 0),u=e([r("nile-switcher")],u);export{u as N};
@@ -12,6 +12,7 @@ export const styles = css `
12
12
  :host {
13
13
  box-sizing: border-box;
14
14
  font-size: 14px;
15
+ overflow: hidden;
15
16
  }
16
17
 
17
18
  .content-editable-wrapper {
@@ -1 +1 @@
1
- {"version":3,"file":"nile-content-editor.css.js","sourceRoot":"","sources":["../../../src/nile-content-editor/nile-content-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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4FxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * AttributeExpression CSS\n */\nexport const styles = css`\n :host {\n box-sizing: border-box;\n font-size: 14px;\n }\n\n .content-editable-wrapper {\n position: relative;\n width: 100%;\n box-sizing: border-box;\n }\n\n .dropdown-position {\n position: relative;\n bottom: 1px;\n }\n .content-editable-input {\n box-sizing: border-box;\n width: 100%;\n padding: 9px;\n border: 1px solid #c7ced4;\n border-radius: 4px;\n overflow: auto;\n overflow-x: auto;\n overflow-anchor: none;\n scrollbar-width: none;\n -ms-overflow-style: none;\n cursor: text;\n white-space: nowrap;\n background-color: #ffffff;\n height: 38px;\n }\n .content-editable-input:focus {\n outline: none;\n }\n\n .error {\n border-color: #e5434d;\n }\n\n .read-only {\n background-color: hsl(240 4.8% 95.9%);\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .chips {\n display: inline;\n background: #e5e9eb;\n color: #000;\n border-radius: 4px;\n padding: 6px;\n height: 24px;\n line-height: 10px;\n margin-left: 3px;\n letter-spacing: 0.2px;\n }\n\n .text-area {\n height: 120px;\n overflow: scroll;\n line-height: 26px;\n }\n\n .text-area .chips {\n padding: 4px 8px;\n }\n\n .chip-error {\n background: #f3a5aa;\n }\n .nile-options-container {\n box-sizing: border-box;\n background-color: #ffffff;\n border: 1px solid #c7ced4;\n overflow: auto;\n max-height: 150px;\n }\n\n label {\n display: inline-block;\n margin-bottom: 6px;\n font-family: 'colfax-medium';\n }\n\n .asterik {\n color: #e5434d;\n }\n\n .no-border {\n border: none;\n }\n`;\n\nexport default [styles];\n"]}
1
+ {"version":3,"file":"nile-content-editor.css.js","sourceRoot":"","sources":["../../../src/nile-content-editor/nile-content-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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6FxB,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 * AttributeExpression CSS\n */\nexport const styles = css`\n :host {\n box-sizing: border-box;\n font-size: 14px;\n overflow: hidden;\n }\n\n .content-editable-wrapper {\n position: relative;\n width: 100%;\n box-sizing: border-box;\n }\n\n .dropdown-position {\n position: relative;\n bottom: 1px;\n }\n .content-editable-input {\n box-sizing: border-box;\n width: 100%;\n padding: 9px;\n border: 1px solid #c7ced4;\n border-radius: 4px;\n overflow: auto;\n overflow-x: auto;\n overflow-anchor: none;\n scrollbar-width: none;\n -ms-overflow-style: none;\n cursor: text;\n white-space: nowrap;\n background-color: #ffffff;\n height: 38px;\n }\n .content-editable-input:focus {\n outline: none;\n }\n\n .error {\n border-color: #e5434d;\n }\n\n .read-only {\n background-color: hsl(240 4.8% 95.9%);\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .chips {\n display: inline;\n background: #e5e9eb;\n color: #000;\n border-radius: 4px;\n padding: 6px;\n height: 24px;\n line-height: 10px;\n margin-left: 3px;\n letter-spacing: 0.2px;\n }\n\n .text-area {\n height: 120px;\n overflow: scroll;\n line-height: 26px;\n }\n\n .text-area .chips {\n padding: 4px 8px;\n }\n\n .chip-error {\n background: #f3a5aa;\n }\n .nile-options-container {\n box-sizing: border-box;\n background-color: #ffffff;\n border: 1px solid #c7ced4;\n overflow: auto;\n max-height: 150px;\n }\n\n label {\n display: inline-block;\n margin-bottom: 6px;\n font-family: 'colfax-medium';\n }\n\n .asterik {\n color: #e5434d;\n }\n\n .no-border {\n border: none;\n }\n`;\n\nexport default [styles];\n"]}
@@ -14,27 +14,64 @@ export const styles = css `
14
14
  box-sizing: border-box;
15
15
  }
16
16
 
17
- .pointer-cursor {
17
+ .switcher-icon-container {
18
18
  cursor: pointer;
19
+ justify-content: center;
20
+ display: flex;
21
+ align-items: center;
22
+ margin-bottom: 6px;
23
+ height: 28px;
24
+ width: 28px;
25
+ border-radius: 4px;
26
+ }
27
+
28
+ .switcher-icon-container.current {
29
+ background: var(--nile-colors-blue-400);
19
30
  }
20
- .input-container {
31
+
32
+ .switcher-input-container {
21
33
  display: flex;
34
+ }
35
+
36
+ .switcher-inline {
22
37
  gap: 0.5rem;
23
38
  }
24
39
 
25
- .input-container > :first-child {
26
- max-width: 98%;
27
- min-width: 98%;
40
+ .switcher-block {
41
+ flex-direction: column;
42
+ }
43
+
44
+ .switcher-block > :first-child {
45
+ align-self: end;
46
+ }
47
+
48
+ .switcher-inline > :nth-child(2) {
49
+ flex: 1;
28
50
  }
29
51
 
30
- nile-icon {
52
+ .switcher-input-container > :first-child {
53
+ display: flex;
54
+ gap: 0.5rem;
31
55
  max-height: 38px;
56
+ align-items: center;
32
57
  }
33
58
 
34
59
  nile-radio {
35
60
  display: inline-block;
36
61
  padding-right: 10px;
37
62
  }
63
+
64
+ .switcher-object-mapper::part(input) {
65
+ color: var(--nile-colors-primary-600);
66
+ cursor: pointer;
67
+ }
68
+
69
+ .switcher-input--noborder::part(base) {
70
+ border: none;
71
+ }
72
+ .switcher-object-mapper--noborder::part(base) {
73
+ border: none;
74
+ }
38
75
  `;
39
76
  export default [styles];
40
77
  //# sourceMappingURL=nile-switcher.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-switcher.css.js","sourceRoot":"","sources":["../../../src/nile-switcher/nile-switcher.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * FieldGenerator CSS\n */\nexport const styles = css`\n :host {\n width: 100%;\n box-sizing: border-box;\n }\n\n .pointer-cursor {\n cursor: pointer;\n }\n .input-container {\n display: flex;\n gap: 0.5rem;\n }\n\n .input-container > :first-child {\n max-width: 98%;\n min-width: 98%;\n }\n\n nile-icon {\n max-height: 38px;\n }\n\n nile-radio {\n display: inline-block;\n padding-right: 10px;\n }\n`;\n\nexport default [styles];\n"]}
1
+ {"version":3,"file":"nile-switcher.css.js","sourceRoot":"","sources":["../../../src/nile-switcher/nile-switcher.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgExB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * FieldGenerator CSS\n */\nexport const styles = css`\n :host {\n width: 100%;\n box-sizing: border-box;\n }\n\n .switcher-icon-container {\n cursor: pointer;\n justify-content: center;\n display: flex;\n align-items: center;\n margin-bottom: 6px;\n height: 28px;\n width: 28px;\n border-radius: 4px;\n }\n\n .switcher-icon-container.current {\n background: var(--nile-colors-blue-400);\n }\n\n .switcher-input-container {\n display: flex;\n }\n\n .switcher-inline {\n gap: 0.5rem;\n }\n\n .switcher-block {\n flex-direction: column;\n }\n\n .switcher-block > :first-child {\n align-self: end;\n }\n\n .switcher-inline > :nth-child(2) {\n flex: 1;\n }\n\n .switcher-input-container > :first-child {\n display: flex;\n gap: 0.5rem;\n max-height: 38px;\n align-items: center;\n }\n\n nile-radio {\n display: inline-block;\n padding-right: 10px;\n }\n\n .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"]}